diff --git a/core/resources/views/inbox.blade.php b/core/resources/views/inbox.blade.php index cbbae6b..e01f0ba 100644 --- a/core/resources/views/inbox.blade.php +++ b/core/resources/views/inbox.blade.php @@ -163,7 +163,14 @@ footer{position:relative;z-index:1;max-width:880px;width:100%;margin:0 auto;padd @foreach($channels as $ch)
{{ ['web' => 'Веб', 'telegram' => 'Telegram', 'webhook' => 'Webhook'][$ch['type']] }} - {{ $ch['type'] === 'web' ? 'этот инбокс' : ($ch['type'] === 'telegram' ? 'чат '.($ch['config']['chat_id'] ?? '—') : ($ch['config']['deliver_url'] ?? '—')) }} + @if($ch['type'] === 'webhook') +
+
доставка → {{ $ch['config']['deliver_url'] ?? '—' }}
+
присутствие → {{ $ch['config']['presence_url'] ?? '—' }}
+
+ @else + {{ $ch['type'] === 'web' ? 'этот инбокс' : 'чат '.($ch['config']['chat_id'] ?? '—') }} + @endif @if($ch['type'] !== 'web')@endif
@endforeach diff --git a/core/tests/Feature/InboxChannelsTest.php b/core/tests/Feature/InboxChannelsTest.php new file mode 100644 index 0000000..5636c1e --- /dev/null +++ b/core/tests/Feature/InboxChannelsTest.php @@ -0,0 +1,28 @@ +get('/', ['X-Remote-User' => 'luci']); + User::sole()->channels()->create([ + 'type' => ChannelType::Webhook, + 'config' => ['deliver_url' => 'https://ha.test/api/webhook/hado', 'presence_url' => 'https://ha.test/api/presence'], + 'enabled' => true, + ]); + + $this->get('/', ['X-Remote-User' => 'luci'])->assertOk() + ->assertSee('https://ha.test/api/webhook/hado') + ->assertSee('https://ha.test/api/presence') + ->assertSeeInOrder(['доставка', 'https://ha.test/api/webhook/hado', 'присутствие', 'https://ha.test/api/presence']); + } +}