Fix: Add Discord channel status to matrix body template (inline cards, not partial)
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
<% txServers.forEach(server => {
|
<% txServers.forEach(server => {
|
||||||
const isOnline = server.log.is_online;
|
const isOnline = server.log.is_online;
|
||||||
const hasError = !!server.log.last_error;
|
const hasError = !!server.log.last_error;
|
||||||
|
const discordComplete = server.discord?.complete;
|
||||||
let borderClass = 'border-gray-200 dark:border-gray-700';
|
let borderClass = 'border-gray-200 dark:border-gray-700';
|
||||||
if (isOnline && !hasError) borderClass = 'border-green-500 shadow-[0_0_10px_rgba(34,197,94,0.2)]';
|
if (isOnline && !hasError) borderClass = 'border-green-500 shadow-[0_0_10px_rgba(34,197,94,0.2)]';
|
||||||
if (hasError) borderClass = 'border-red-500 shadow-[0_0_10px_rgba(239,68,68,0.2)]';
|
if (hasError) borderClass = 'border-red-500 shadow-[0_0_10px_rgba(239,68,68,0.2)]';
|
||||||
@@ -38,6 +39,19 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Discord Channel Status -->
|
||||||
|
<div class="mb-4">
|
||||||
|
<span class="text-gray-500 dark:text-gray-400 block text-xs mb-1">Discord Channels</span>
|
||||||
|
<% if (discordComplete) { %>
|
||||||
|
<span class="text-green-600 dark:text-green-400 text-sm font-medium">✅ All 4 channels</span>
|
||||||
|
<% } else if (server.discord?.missing?.length > 0) { %>
|
||||||
|
<div class="bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 p-2 rounded text-xs">
|
||||||
|
<strong>Missing:</strong> <%= server.discord.missing.join(', ') %>
|
||||||
|
</div>
|
||||||
|
<% } else { %>
|
||||||
|
<span class="text-gray-500 dark:text-gray-400 text-sm">Unable to check</span>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
<% if (hasError) { %>
|
<% if (hasError) { %>
|
||||||
<div class="bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 p-2 rounded text-xs mb-4 break-words">
|
<div class="bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 p-2 rounded text-xs mb-4 break-words">
|
||||||
<strong>Error:</strong> <%= server.log.last_error %>
|
<strong>Error:</strong> <%= server.log.last_error %>
|
||||||
@@ -64,6 +78,7 @@
|
|||||||
<% ncServers.forEach(server => {
|
<% ncServers.forEach(server => {
|
||||||
const isOnline = server.log.is_online;
|
const isOnline = server.log.is_online;
|
||||||
const hasError = !!server.log.last_error;
|
const hasError = !!server.log.last_error;
|
||||||
|
const discordComplete = server.discord?.complete;
|
||||||
let borderClass = 'border-gray-200 dark:border-gray-700';
|
let borderClass = 'border-gray-200 dark:border-gray-700';
|
||||||
if (isOnline && !hasError) borderClass = 'border-green-500 shadow-[0_0_10px_rgba(34,197,94,0.2)]';
|
if (isOnline && !hasError) borderClass = 'border-green-500 shadow-[0_0_10px_rgba(34,197,94,0.2)]';
|
||||||
if (hasError) borderClass = 'border-red-500 shadow-[0_0_10px_rgba(239,68,68,0.2)]';
|
if (hasError) borderClass = 'border-red-500 shadow-[0_0_10px_rgba(239,68,68,0.2)]';
|
||||||
@@ -95,6 +110,19 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Discord Channel Status -->
|
||||||
|
<div class="mb-4">
|
||||||
|
<span class="text-gray-500 dark:text-gray-400 block text-xs mb-1">Discord Channels</span>
|
||||||
|
<% if (discordComplete) { %>
|
||||||
|
<span class="text-green-600 dark:text-green-400 text-sm font-medium">✅ All 4 channels</span>
|
||||||
|
<% } else if (server.discord?.missing?.length > 0) { %>
|
||||||
|
<div class="bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 p-2 rounded text-xs">
|
||||||
|
<strong>Missing:</strong> <%= server.discord.missing.join(', ') %>
|
||||||
|
</div>
|
||||||
|
<% } else { %>
|
||||||
|
<span class="text-gray-500 dark:text-gray-400 text-sm">Unable to check</span>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
<% if (hasError) { %>
|
<% if (hasError) { %>
|
||||||
<div class="bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 p-2 rounded text-xs mb-4 break-words">
|
<div class="bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 p-2 rounded text-xs mb-4 break-words">
|
||||||
<strong>Error:</strong> <%= server.log.last_error %>
|
<strong>Error:</strong> <%= server.log.last_error %>
|
||||||
|
|||||||
Reference in New Issue
Block a user