config upload fix
This commit is contained in:
@@ -58,15 +58,28 @@
|
||||
});
|
||||
|
||||
async function load(): Promise<void> {
|
||||
const [baselineRes, overlayRes, scopeRes] = await Promise.all([
|
||||
fetch('/api/configs?kind=baseline'),
|
||||
fetch('/api/configs?kind=config'),
|
||||
fetch('/api/scope-options')
|
||||
]);
|
||||
baselines = (await baselineRes.json()).scripts;
|
||||
overlays = (await overlayRes.json()).scripts;
|
||||
scopeOptions = (await scopeRes.json()) as ScopeOptions;
|
||||
loading = false;
|
||||
try {
|
||||
const [baselineRes, overlayRes, scopeRes] = await Promise.all([
|
||||
fetch('/api/configs?kind=baseline'),
|
||||
fetch('/api/configs?kind=config'),
|
||||
fetch('/api/scope-options')
|
||||
]);
|
||||
if (!baselineRes.ok || !overlayRes.ok) {
|
||||
flash = `configs API returned ${baselineRes.status}/${overlayRes.status}. If this is a dev environment, restart the server so the DB migration runs.`;
|
||||
baselines = [];
|
||||
overlays = [];
|
||||
} else {
|
||||
baselines = ((await baselineRes.json()) as { scripts?: ArtifactRow[] }).scripts ?? [];
|
||||
overlays = ((await overlayRes.json()) as { scripts?: ArtifactRow[] }).scripts ?? [];
|
||||
}
|
||||
if (scopeRes.ok) {
|
||||
scopeOptions = ((await scopeRes.json()) as ScopeOptions | undefined) ?? { games: [], mapsByGame: {} };
|
||||
}
|
||||
} catch (err) {
|
||||
flash = `failed to load configs: ${(err as Error).message}`;
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMount(load);
|
||||
|
||||
@@ -50,13 +50,25 @@
|
||||
});
|
||||
|
||||
async function load(): Promise<void> {
|
||||
const [pluginRes, scopeRes] = await Promise.all([
|
||||
fetch('/api/plugins'),
|
||||
fetch('/api/scope-options')
|
||||
]);
|
||||
plugins = (await pluginRes.json()).scripts;
|
||||
scopeOptions = (await scopeRes.json()) as ScopeOptions;
|
||||
loading = false;
|
||||
try {
|
||||
const [pluginRes, scopeRes] = await Promise.all([
|
||||
fetch('/api/plugins'),
|
||||
fetch('/api/scope-options')
|
||||
]);
|
||||
if (!pluginRes.ok) {
|
||||
flash = `plugins API returned ${pluginRes.status}. If this is a dev environment, restart the server so the DB migration runs.`;
|
||||
plugins = [];
|
||||
} else {
|
||||
plugins = ((await pluginRes.json()) as { scripts?: ArtifactRow[] }).scripts ?? [];
|
||||
}
|
||||
if (scopeRes.ok) {
|
||||
scopeOptions = ((await scopeRes.json()) as ScopeOptions | undefined) ?? { games: [], mapsByGame: {} };
|
||||
}
|
||||
} catch (err) {
|
||||
flash = `failed to load plugins: ${(err as Error).message}`;
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMount(load);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
//////////////////////////////////////////////////
|
||||
// GENERAL CONFIGURATION //
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
set g_inactivity "190" // Enable or Disable auto kick feature for idle/AFK players.
|
||||
set sv_disableClientConsole "0" // Enable or Disable players ability to access server commands
|
||||
set sv_floodProtect "1" // Chat Spam Protection.
|
||||
set sv_kickBanTime "300" // Kick Ban Duration.
|
||||
set sv_voice "1" // Allow Voice Chat?
|
||||
set sv_voicequality "3" // Voice Quality.
|
||||
set sp_minplayers "1" // Minimum amount of players.
|
||||
set scr_allowFileIo "1" // Allow GSC scripts to interact with files?
|
||||
set scr_kill_infinite_loops "1" // Kill misbehaving threads?
|
||||
set sv_wwwBaseURL "" // Fast DL URL
|
||||
|
||||
set sv_maprotation "map zombie_theater"
|
||||
@@ -0,0 +1,29 @@
|
||||
Note: Unnecessary use of -X or --request, POST is already inferred.
|
||||
* Host localhost:3000 was resolved.
|
||||
* IPv6: ::1
|
||||
* IPv4: 127.0.0.1
|
||||
% Total % Received % Xferd Average Speed Time Time Time Current
|
||||
Dload Upload Total Spent Left Speed
|
||||
␍ 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying [::1]:3000...
|
||||
* Connected to localhost (::1) port 3000
|
||||
* using HTTP/1.x
|
||||
> POST /api/configs HTTP/1.1␍
|
||||
> Host: localhost:3000␍
|
||||
> User-Agent: curl/8.15.0␍
|
||||
> Accept: */*␍
|
||||
> Content-Length: 1832␍
|
||||
> Content-Type: multipart/form-data; boundary=------------------------barYWMs19HWi81kFXmt3OX␍
|
||||
> ␍
|
||||
} [1832 bytes data]
|
||||
* upload completely sent off: 1832 bytes
|
||||
< HTTP/1.1 200 OK␍
|
||||
< Access-Control-Allow-Origin: *␍
|
||||
< content-length: 232␍
|
||||
< content-type: application/json␍
|
||||
< Date: Sat, 12 Sep 2026 23:27:36 GMT␍
|
||||
< Connection: keep-alive␍
|
||||
< Keep-Alive: timeout=5␍
|
||||
< ␍
|
||||
{ [232 bytes data]
|
||||
␍100 2064 100 232 100 1832 49225 379k --:--:-- --:--:-- --:--:-- 503k{"ok":true,"script":{"id":2,"name":"T5 Zombies Baseline","target_rel_path":"dedicated_sp.cfg","scope_type":"game","scope_value":"t5","current_version_id":null,"kind":"baseline","created_at":"2026-09-12T23:27:36.519Z"},"versionId":2}
|
||||
* Connection #0 to host localhost left intact
|
||||
Reference in New Issue
Block a user