From 6f45f55efea240cf7957604061451c4916f8f20d Mon Sep 17 00:00:00 2001 From: wajeht <58354193+wajeht@users.noreply.github.com> Date: Fri, 16 Aug 2024 15:08:49 -0500 Subject: [PATCH] style: Update styling for channel details in apps-id-channels page --- src/handler.ts | 2 + src/views/pages/apps-id-channels.html | 69 +++++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 4 deletions(-) diff --git a/src/handler.ts b/src/handler.ts index 3ee5047..cf85b12 100644 --- a/src/handler.ts +++ b/src/handler.ts @@ -145,6 +145,8 @@ export async function getAppChannelsPageHandler(req: Request, res: Response) { 'app_id', app_channels.app_id, 'is_active', app_channels.is_active, 'channel_type', channel_types.name, + 'created_at', app_channels.created_at, + 'updated_at', app_channels.updated_at, 'config', CASE WHEN channel_types.name = 'email' THEN json_build_object('host', email_configs.host, 'port', email_configs.port, 'alias', email_configs.alias, 'auth_email', email_configs.auth_email) diff --git a/src/views/pages/apps-id-channels.html b/src/views/pages/apps-id-channels.html index 343cffd..6225082 100644 --- a/src/views/pages/apps-id-channels.html +++ b/src/views/pages/apps-id-channels.html @@ -8,10 +8,71 @@

Channels

<% if (app.channels.length) { %> - <% app.channels.forEach(c => { %> -
-
<%= JSON.stringify(c, null, 2) %>
-
+ <% app.channels.forEach(channel => { %> +
+
ID:
+
<%= channel.id %>
+ +
Type:
+
<%= channel.channel_type %>
+ +
Status:
+
+ <%= channel.is_active ? 'Active' : 'Inactive' %> +
+ +
Created:
+
<%= new Date(channel.created_at).toLocaleString() %>
+ +
Updated:
+
<%= new Date(channel.updated_at).toLocaleString() %>
+ +
+
+ View +
+ <% if (channel.channel_type === 'email') { %> +
Email Host:
+
<%= channel.config.host %>
+ +
Email Port:
+
<%= channel.config.port %>
+ +
Email Alias:
+
<%= channel.config.alias %>
+ +
Email Auth:
+
<%= channel.config.auth_email %>
+ <% } %> + + <% if (channel.channel_type === 'discord') { %> +
Webhook URL:
+
<%= channel.config.webhook_url %>
+ <% } %> + + <% if (channel.channel_type === 'sms') { %> +
Phone Number:
+
<%= channel.config.phone_number %>
+ +
From Phone Number:
+
<%= channel.config.from_phone_number %>
+ +
Account SID:
+
<%= channel.config.account_sid %>
+ <% } %> +
+
+ Edit +
+ +
<% }) %> <% } %>