feat: massive AI generation
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, onUnmounted, ref } from "vue";
|
import { onMounted, onUnmounted, ref } from "vue";
|
||||||
import GmWindow from "./GmWindow.vue";
|
import GmWindow from "./GmWindow.vue";
|
||||||
import { fetchTelemetry } from "../../api";
|
import { fetchTelemetry, resetWorld } from "../../api";
|
||||||
import type { TelemetrySnapshot } from "../../contractsTelemetry";
|
import type { TelemetrySnapshot } from "../../contractsTelemetry";
|
||||||
|
|
||||||
const emit = defineEmits<{ close: [] }>();
|
const emit = defineEmits<{ close: [] }>();
|
||||||
@@ -61,6 +61,22 @@ function cpuBarClass(pct: number) {
|
|||||||
if (pct >= 50) return "gm-telemetry-bar--mid";
|
if (pct >= 50) return "gm-telemetry-bar--mid";
|
||||||
return "gm-telemetry-bar--low";
|
return "gm-telemetry-bar--low";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const resetting = ref(false);
|
||||||
|
const resetError = ref<string | null>(null);
|
||||||
|
|
||||||
|
async function handleReset() {
|
||||||
|
if (!confirm("Reset the game world? This cannot be undone.")) return;
|
||||||
|
resetting.value = true;
|
||||||
|
resetError.value = null;
|
||||||
|
try {
|
||||||
|
await resetWorld();
|
||||||
|
} catch {
|
||||||
|
resetError.value = "Reset failed";
|
||||||
|
} finally {
|
||||||
|
resetting.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -161,6 +177,20 @@ function cpuBarClass(pct: number) {
|
|||||||
<span>Polling every 2s</span>
|
<span>Polling every 2s</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<!-- Reset -->
|
||||||
|
<div class="mt-3 border-t border-white/10 pt-3">
|
||||||
|
<div v-if="resetError" class="gm-telemetry-error mb-2 rounded px-3 py-1.5 text-xs">
|
||||||
|
{{ resetError }}
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
class="gm-telemetry-reset-btn w-full rounded px-3 py-1.5 text-xs font-semibold uppercase tracking-wide transition-opacity disabled:opacity-40"
|
||||||
|
:disabled="resetting"
|
||||||
|
@click="handleReset"
|
||||||
|
>
|
||||||
|
{{ resetting ? "Resetting…" : "Reset World" }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</GmWindow>
|
</GmWindow>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -747,6 +747,18 @@ canvas {
|
|||||||
box-shadow: 0 0 4px rgba(100, 220, 130, 0.5);
|
box-shadow: 0 0 4px rgba(100, 220, 130, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gm-telemetry-reset-btn {
|
||||||
|
background: rgba(255, 80, 60, 0.10);
|
||||||
|
border: 1px solid rgba(255, 80, 60, 0.28);
|
||||||
|
color: rgba(255, 140, 120, 0.9);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gm-telemetry-reset-btn:hover:not(:disabled) {
|
||||||
|
background: rgba(255, 80, 60, 0.20);
|
||||||
|
border-color: rgba(255, 80, 60, 0.50);
|
||||||
|
}
|
||||||
|
|
||||||
/* ── GM Settings Window ──────────────────────────────────────────────────── */
|
/* ── GM Settings Window ──────────────────────────────────────────────────── */
|
||||||
|
|
||||||
.gm-settings {
|
.gm-settings {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export default defineConfig({
|
|||||||
server: {
|
server: {
|
||||||
host: true,
|
host: true,
|
||||||
port: 5174,
|
port: 5174,
|
||||||
|
allowedHosts: ["sobina.local"],
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api": "http://127.0.0.1:5079",
|
"/api": "http://127.0.0.1:5079",
|
||||||
},
|
},
|
||||||
@@ -18,4 +19,4 @@ export default defineConfig({
|
|||||||
outDir: "../../dist/viewer",
|
outDir: "../../dist/viewer",
|
||||||
emptyOutDir: true,
|
emptyOutDir: true,
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user