feat: add Server page with log viewer, SQL console, and config editor
This commit is contained in:
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user