()
| 380 | } |
| 381 | |
| 382 | async function apply() { |
| 383 | const result = await api("/admin/api/config/apply", { |
| 384 | method: "POST", |
| 385 | body: JSON.stringify({ values: changedValues() }), |
| 386 | }); |
| 387 | if (!result.applied) { |
| 388 | showValidationResult(result); |
| 389 | return; |
| 390 | } |
| 391 | const restart = result.restart || {}; |
| 392 | if (restart.required && restart.automatic) { |
| 393 | showMessage("Applied. Restarting server...", "ok"); |
| 394 | byId("applyButton").disabled = true; |
| 395 | setTimeout(() => { |
| 396 | window.location.href = restart.admin_url || "/admin"; |
| 397 | }, 1600); |
| 398 | return; |
| 399 | } |
| 400 | const pending = restart.required ? restart.fields || [] : result.pending_fields || []; |
| 401 | await load(); |
| 402 | showMessage( |
| 403 | pending.length |
| 404 | ? `Applied. Restart fcc-server to use: ${pending.join(", ")}` |
| 405 | : "Applied", |
| 406 | "ok", |
| 407 | ); |
| 408 | } |
| 409 | |
| 410 | async function refreshLocalStatus() { |
| 411 | const result = await api("/admin/api/providers/local-status"); |
nothing calls this directly
no test coverage detected