This commit is contained in:
seb
2026-07-07 20:08:23 +02:00
parent 61fee8069d
commit b4fa5857ad
3 changed files with 6 additions and 5 deletions

View File

@@ -56,7 +56,7 @@ function EndpointDashboard({ endpoint, range }) {
<Box sx={{ mb: 8, p: 3, bgcolor: 'background.paper', borderRadius: 2, border: '1px solid', borderColor: 'divider' }}> <Box sx={{ mb: 8, p: 3, bgcolor: 'background.paper', borderRadius: 2, border: '1px solid', borderColor: 'divider' }}>
<Box sx={{ display: 'flex', alignItems: 'center', mb: 3 }}> <Box sx={{ display: 'flex', alignItems: 'center', mb: 3 }}>
<Typography variant="h6" sx={{ mr: 2, fontWeight: 700 }}> <Typography variant="h6" sx={{ mr: 2, fontWeight: 700 }}>
{endpoint.id} {endpoint.name || endpoint.id}
<Typography component="span" variant="caption" color="text.secondary" sx={{ ml: 1, fontWeight: 400 }}> <Typography component="span" variant="caption" color="text.secondary" sx={{ ml: 1, fontWeight: 400 }}>
({endpoint.url}) ({endpoint.url})
</Typography> </Typography>

View File

@@ -3,8 +3,8 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TSE Monitor</title> <title>Monitor</title>
<meta name="description" content="CloudTSE availability and response-time dashboard" /> <meta name="description" content="Availability and response-time dashboard" />
<link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />

View File

@@ -24,6 +24,7 @@ for (const [key, value] of Object.entries(process.env)) {
const id = key.substring(9, key.length - 4); const id = key.substring(9, key.length - 4);
ENDPOINTS.push({ ENDPOINTS.push({
id, id,
name: process.env[`ENDPOINT_${id}_NAME`] || id,
url: value, url: value,
expectJsonAttr: process.env[`ENDPOINT_${id}_EXPECT_JSON_ATTR`], expectJsonAttr: process.env[`ENDPOINT_${id}_EXPECT_JSON_ATTR`],
expectSubstring: process.env[`ENDPOINT_${id}_EXPECT_SUBSTRING`] expectSubstring: process.env[`ENDPOINT_${id}_EXPECT_SUBSTRING`]
@@ -31,7 +32,7 @@ for (const [key, value] of Object.entries(process.env)) {
} }
} }
if (ENDPOINTS.length === 0) { if (ENDPOINTS.length === 0) {
ENDPOINTS.push({ id: 'DEFAULT', url: process.env.TSE_URL || 'http://3.78.227.48:20001/' }); ENDPOINTS.push({ id: 'DEFAULT', name: 'Default Endpoint', url: process.env.TSE_URL || 'http://3.78.227.48:20001/' });
} }
// ── DB ──────────────────────────────────────────────────────────────────────── // ── DB ────────────────────────────────────────────────────────────────────────
@@ -294,7 +295,7 @@ const app = express();
app.use((_, res, next) => { res.setHeader('Access-Control-Allow-Origin', '*'); next(); }); app.use((_, res, next) => { res.setHeader('Access-Control-Allow-Origin', '*'); next(); });
app.get('/api/endpoints', (_, res) => { app.get('/api/endpoints', (_, res) => {
res.json(ENDPOINTS.map(e => ({ id: e.id, url: e.url }))); res.json(ENDPOINTS.map(e => ({ id: e.id, name: e.name, url: e.url })));
}); });
app.get('/api/summary', (req, res) => { app.get('/api/summary', (req, res) => {