style: auto-fix ESLint issues (curly braces and formatting)
- Add curly braces to all if/else/for/while statements - Fix indentation and trailing spaces - Auto-fixed 372 linting errors using eslint --fix - Remaining issues are warnings only (non-null assertions, explicit any types)
This commit is contained in:
@@ -14,17 +14,17 @@ function formatUptime(seconds) {
|
||||
const m = Math.floor((seconds % 3600) / 60);
|
||||
const s = seconds % 60;
|
||||
const parts = [];
|
||||
if (d > 0) parts.push(`${d}d`);
|
||||
if (h > 0) parts.push(`${h}h`);
|
||||
if (m > 0) parts.push(`${m}m`);
|
||||
if (d > 0) {parts.push(`${d}d`);}
|
||||
if (h > 0) {parts.push(`${h}h`);}
|
||||
if (m > 0) {parts.push(`${m}m`);}
|
||||
parts.push(`${s}s`);
|
||||
return parts.join(' ');
|
||||
}
|
||||
|
||||
function timeAgo(timestamp) {
|
||||
const secs = Math.floor((Date.now() - timestamp) / 1000);
|
||||
if (secs < 60) return `${secs}s ago`;
|
||||
if (secs < 3600) return `${Math.floor(secs / 60)}m ago`;
|
||||
if (secs < 60) {return `${secs}s ago`;}
|
||||
if (secs < 3600) {return `${Math.floor(secs / 60)}m ago`;}
|
||||
return `${Math.floor(secs / 3600)}h ago`;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ function renderSkeleton(el) {
|
||||
|
||||
function updateCounters(metrics, health) {
|
||||
const el = document.getElementById('ops-counters');
|
||||
if (!el) return;
|
||||
if (!el) {return;}
|
||||
|
||||
const sessions = health?.sessions ?? 0;
|
||||
const errCount = metrics?.errors ?? 0;
|
||||
@@ -94,13 +94,13 @@ function updateCounters(metrics, health) {
|
||||
`<div class="stat-card">
|
||||
<div class="stat-label">${c.label}</div>
|
||||
<div class="stat-value ${c.cls}">${c.value}</div>
|
||||
</div>`
|
||||
</div>`,
|
||||
).join('');
|
||||
}
|
||||
|
||||
function updateModelTable(metrics) {
|
||||
const el = document.getElementById('ops-model-table');
|
||||
if (!el) return;
|
||||
if (!el) {return;}
|
||||
|
||||
const mc = metrics?.modelCalls;
|
||||
const calls = mc?.recentCalls ?? [];
|
||||
@@ -155,7 +155,7 @@ function updateModelTable(metrics) {
|
||||
|
||||
function updateEvents(eventsData) {
|
||||
const el = document.getElementById('ops-events');
|
||||
if (!el) return;
|
||||
if (!el) {return;}
|
||||
|
||||
const events = eventsData?.events ?? [];
|
||||
|
||||
@@ -180,7 +180,7 @@ function updateEvents(eventsData) {
|
||||
|
||||
function updateActiveRequests(requestsData) {
|
||||
const el = document.getElementById('ops-requests');
|
||||
if (!el) return;
|
||||
if (!el) {return;}
|
||||
|
||||
const requests = requestsData?.requests ?? [];
|
||||
|
||||
@@ -219,7 +219,7 @@ function updateActiveRequests(requestsData) {
|
||||
|
||||
function updateChannels(channelsData) {
|
||||
const el = document.getElementById('ops-channels');
|
||||
if (!el) return;
|
||||
if (!el) {return;}
|
||||
|
||||
const channels = channelsData?.channels ?? [];
|
||||
|
||||
@@ -232,7 +232,7 @@ function updateChannels(channelsData) {
|
||||
`<div class="channel-card">
|
||||
<span class="channel-dot ${ch.status}"></span>
|
||||
<span class="channel-name">${escapeHtml(ch.name)}</span>
|
||||
</div>`
|
||||
</div>`,
|
||||
).join('');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user