feat: add Server page with log viewer, SQL console, and config editor

This commit is contained in:
plenarius
2026-04-20 19:57:34 -04:00
parent e8cce96557
commit 3484404b94
3 changed files with 429 additions and 0 deletions
+18
View File
@@ -61,6 +61,24 @@ export const api = {
request("/build/nwnx", { method: "POST", body: JSON.stringify({ target }) }),
},
server: {
status: () => request<{ nwserver: string; mariadb: string }>("/server/status"),
start: () => request("/server/start", { method: "POST" }),
stop: () => request("/server/stop", { method: "POST" }),
restart: () => request("/server/restart", { method: "POST" }),
generateConfig: () => request("/server/generate-config", { method: "POST" }),
seedDb: (cdKey: string, playerName: string) =>
request("/server/seed-db", {
method: "POST",
body: JSON.stringify({ cdKey, playerName }),
}),
sql: (query: string, allowWrite?: boolean) =>
request<{ columns: string[]; rows: Record<string, string>[] }>("/server/sql", {
method: "POST",
body: JSON.stringify({ query, allowWrite }),
}),
},
docker: {
containers: () => request<Array<Record<string, string>>>("/docker/containers"),
pull: (image: string) =>