Fix Venue Manager hosted startup and Modal preload config
Browse files- app.py +6 -2
- frontend/index.html +3 -3
- frontend/js/components.js +8 -6
app.py
CHANGED
|
@@ -6,8 +6,12 @@ from typing import Any
|
|
| 6 |
|
| 7 |
|
| 8 |
def load_local_modal_env() -> None:
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
return
|
| 12 |
for raw_line in env_path.read_text().splitlines():
|
| 13 |
line = raw_line.strip()
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
def load_local_modal_env() -> None:
|
| 9 |
+
current = Path(__file__).resolve()
|
| 10 |
+
env_path = next(
|
| 11 |
+
(parent / ".env.modal.local" for parent in current.parents if (parent / ".env.modal.local").exists()),
|
| 12 |
+
None,
|
| 13 |
+
)
|
| 14 |
+
if env_path is None:
|
| 15 |
return
|
| 16 |
for raw_line in env_path.read_text().splitlines():
|
| 17 |
line = raw_line.strip()
|
frontend/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 9 |
<link href="https://fonts.googleapis.com/css2?family=Saira+Condensed:ital,wght@0,500;0,600;0,700;0,800;1,700&family=Barlow:ital,wght@0,400;0,500;0,600;0,700&family=Barlow+Semi+Condensed:wght@500;600;700&display=swap" rel="stylesheet" />
|
| 10 |
<link rel="stylesheet" href="/frontend/styles/tokens.css?v=20260615-tryme" />
|
| 11 |
-
<link rel="stylesheet" href="/frontend/styles/components.css?v=20260616-
|
| 12 |
</head>
|
| 13 |
<body>
|
| 14 |
<div class="app" id="app"></div>
|
|
@@ -16,7 +16,7 @@
|
|
| 16 |
<!-- data → helpers → components → app (load order matters) -->
|
| 17 |
<script src="/frontend/js/data.js?v=20260615-tryme-metrics"></script>
|
| 18 |
<script src="/frontend/js/dom.js"></script>
|
| 19 |
-
<script src="/frontend/js/components.js?v=20260616-
|
| 20 |
-
<script src="/frontend/js/app.js?v=20260616-
|
| 21 |
</body>
|
| 22 |
</html>
|
|
|
|
| 8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 9 |
<link href="https://fonts.googleapis.com/css2?family=Saira+Condensed:ital,wght@0,500;0,600;0,700;0,800;1,700&family=Barlow:ital,wght@0,400;0,500;0,600;0,700&family=Barlow+Semi+Condensed:wght@500;600;700&display=swap" rel="stylesheet" />
|
| 10 |
<link rel="stylesheet" href="/frontend/styles/tokens.css?v=20260615-tryme" />
|
| 11 |
+
<link rel="stylesheet" href="/frontend/styles/components.css?v=20260616-terminal-model-labels" />
|
| 12 |
</head>
|
| 13 |
<body>
|
| 14 |
<div class="app" id="app"></div>
|
|
|
|
| 16 |
<!-- data → helpers → components → app (load order matters) -->
|
| 17 |
<script src="/frontend/js/data.js?v=20260615-tryme-metrics"></script>
|
| 18 |
<script src="/frontend/js/dom.js"></script>
|
| 19 |
+
<script src="/frontend/js/components.js?v=20260616-terminal-model-labels"></script>
|
| 20 |
+
<script src="/frontend/js/app.js?v=20260616-terminal-model-labels"></script>
|
| 21 |
</body>
|
| 22 |
</html>
|
frontend/js/components.js
CHANGED
|
@@ -390,10 +390,10 @@ function BackendRows(state) {
|
|
| 390 |
];
|
| 391 |
}
|
| 392 |
|
| 393 |
-
function formatLatency(ms) {
|
| 394 |
-
if (ms == null || ms === '') return
|
| 395 |
const n = Number(ms);
|
| 396 |
-
if (!Number.isFinite(n)) return
|
| 397 |
if (n >= 1000) return `${(n / 1000).toFixed(n >= 10000 ? 0 : 1)}s`;
|
| 398 |
return `${Math.round(n)}ms`;
|
| 399 |
}
|
|
@@ -452,9 +452,11 @@ function ModelRunBlock(state) {
|
|
| 452 |
if (!req?.modelBacked) return null;
|
| 453 |
const info = modelRunState(state);
|
| 454 |
const valid = info.validation?.valid;
|
| 455 |
-
const fallback = info.fallbackUsed === true ? 'Yes' : info.fallbackUsed === false ? 'No' : 'Pending';
|
| 456 |
-
const schema = valid === true ? 'Valid' : valid === false ? 'Blocked' : 'Pending';
|
| 457 |
const statusClass = String(info.status || '').toLowerCase();
|
|
|
|
|
|
|
|
|
|
|
|
|
| 458 |
const raw = activeConversation(state)?.model_extraction || state.modelRuns?.[req.id] || {};
|
| 459 |
return h('div', { class: 'model-run', 'data-design-id': 'model-run-proof' },
|
| 460 |
h('div', { class: 'model-run-head' },
|
|
@@ -468,7 +470,7 @@ function ModelRunBlock(state) {
|
|
| 468 |
SimpleDetailRow('Signal', info.signal),
|
| 469 |
SimpleDetailRow('Elapsed', formatLatency(info.elapsed)),
|
| 470 |
SimpleDetailRow('Timeout', info.timeoutSeconds ? `${info.timeoutSeconds}s` : 'Pending'),
|
| 471 |
-
SimpleDetailRow('Latency', formatLatency(info.latency)),
|
| 472 |
SimpleDetailRow('Schema', schema),
|
| 473 |
SimpleDetailRow('Fallback', fallback),
|
| 474 |
SimpleDetailRow('Trace id', info.traceId)),
|
|
|
|
| 390 |
];
|
| 391 |
}
|
| 392 |
|
| 393 |
+
function formatLatency(ms, emptyLabel = 'Pending') {
|
| 394 |
+
if (ms == null || ms === '') return emptyLabel;
|
| 395 |
const n = Number(ms);
|
| 396 |
+
if (!Number.isFinite(n)) return emptyLabel;
|
| 397 |
if (n >= 1000) return `${(n / 1000).toFixed(n >= 10000 ? 0 : 1)}s`;
|
| 398 |
return `${Math.round(n)}ms`;
|
| 399 |
}
|
|
|
|
| 452 |
if (!req?.modelBacked) return null;
|
| 453 |
const info = modelRunState(state);
|
| 454 |
const valid = info.validation?.valid;
|
|
|
|
|
|
|
| 455 |
const statusClass = String(info.status || '').toLowerCase();
|
| 456 |
+
const runEnded = ['complete', 'blocked', 'error'].includes(statusClass);
|
| 457 |
+
const pendingOrMissing = runEnded ? 'Not reported' : 'Pending';
|
| 458 |
+
const fallback = info.fallbackUsed === true ? 'Yes' : info.fallbackUsed === false ? 'No' : pendingOrMissing;
|
| 459 |
+
const schema = valid === true ? 'Valid' : valid === false ? 'Blocked' : runEnded ? 'Not validated' : 'Pending';
|
| 460 |
const raw = activeConversation(state)?.model_extraction || state.modelRuns?.[req.id] || {};
|
| 461 |
return h('div', { class: 'model-run', 'data-design-id': 'model-run-proof' },
|
| 462 |
h('div', { class: 'model-run-head' },
|
|
|
|
| 470 |
SimpleDetailRow('Signal', info.signal),
|
| 471 |
SimpleDetailRow('Elapsed', formatLatency(info.elapsed)),
|
| 472 |
SimpleDetailRow('Timeout', info.timeoutSeconds ? `${info.timeoutSeconds}s` : 'Pending'),
|
| 473 |
+
SimpleDetailRow('Latency', formatLatency(info.latency, pendingOrMissing)),
|
| 474 |
SimpleDetailRow('Schema', schema),
|
| 475 |
SimpleDetailRow('Fallback', fallback),
|
| 476 |
SimpleDetailRow('Trace id', info.traceId)),
|