Spaces:
Running
Running
Add files using upload-large-folder tool
Browse files
third_party/CityFlow/frontend/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
| 5 |
<title>Traffic Visualizer</title>
|
| 6 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.8.2/pixi.min.js"></script>
|
| 7 |
<script src="https://cdn.jsdelivr.net/npm/pixi-viewport@4.2.3/dist/viewport.min.js"></script>
|
| 8 |
-
<link rel="stylesheet" href="/static/style_multi.css?v=
|
| 9 |
-
<script src="/static/Point.js?v=
|
| 10 |
<style>
|
| 11 |
@keyframes fadeInUp {
|
| 12 |
from { opacity: 0; transform: translateY(8px); }
|
|
@@ -118,6 +118,6 @@
|
|
| 118 |
|
| 119 |
</div>
|
| 120 |
|
| 121 |
-
<script src="/static/script_multi.js?v=
|
| 122 |
</body>
|
| 123 |
</html>
|
|
|
|
| 5 |
<title>Traffic Visualizer</title>
|
| 6 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.8.2/pixi.min.js"></script>
|
| 7 |
<script src="https://cdn.jsdelivr.net/npm/pixi-viewport@4.2.3/dist/viewport.min.js"></script>
|
| 8 |
+
<link rel="stylesheet" href="/static/style_multi.css?v=20260309c">
|
| 9 |
+
<script src="/static/Point.js?v=20260309c"></script>
|
| 10 |
<style>
|
| 11 |
@keyframes fadeInUp {
|
| 12 |
from { opacity: 0; transform: translateY(8px); }
|
|
|
|
| 118 |
|
| 119 |
</div>
|
| 120 |
|
| 121 |
+
<script src="/static/script_multi.js?v=20260309c"></script>
|
| 122 |
</body>
|
| 123 |
</html>
|
third_party/CityFlow/frontend/script_multi.js
CHANGED
|
@@ -301,6 +301,7 @@ runBtn.addEventListener("click", async () => {
|
|
| 301 |
if (!resp.ok) {
|
| 302 |
let detail = `HTTP ${resp.status}`;
|
| 303 |
try { const e = await resp.json(); detail = e.detail || detail; } catch (_) { /* HTML body (e.g. 504 proxy timeout) */ }
|
|
|
|
| 304 |
throw new Error(detail);
|
| 305 |
}
|
| 306 |
const data = await resp.json();
|
|
@@ -1274,10 +1275,10 @@ function initProgress(policies) {
|
|
| 1274 |
}
|
| 1275 |
|
| 1276 |
function markPolicyRunning(key) {
|
| 1277 |
-
// Linear fill: ~0.
|
| 1278 |
let pct = 0;
|
| 1279 |
_progressIntervals[key] = setInterval(() => {
|
| 1280 |
-
pct = Math.min(88, pct + 0.
|
| 1281 |
_setBar(key, pct);
|
| 1282 |
}, 100);
|
| 1283 |
}
|
|
|
|
| 301 |
if (!resp.ok) {
|
| 302 |
let detail = `HTTP ${resp.status}`;
|
| 303 |
try { const e = await resp.json(); detail = e.detail || detail; } catch (_) { /* HTML body (e.g. 504 proxy timeout) */ }
|
| 304 |
+
if (resp.status === 504 || resp.status === 502) detail += " — simulation timed out. Try fewer policies or check Space 1 is awake.";
|
| 305 |
throw new Error(detail);
|
| 306 |
}
|
| 307 |
const data = await resp.json();
|
|
|
|
| 1275 |
}
|
| 1276 |
|
| 1277 |
function markPolicyRunning(key) {
|
| 1278 |
+
// Linear fill: ~0.15% per 100ms tick → reaches 88% after ~58 s (matches 60s remote timeout).
|
| 1279 |
let pct = 0;
|
| 1280 |
_progressIntervals[key] = setInterval(() => {
|
| 1281 |
+
pct = Math.min(88, pct + 0.15);
|
| 1282 |
_setBar(key, pct);
|
| 1283 |
}, 100);
|
| 1284 |
}
|