|
435 | 435 | config = await api.updateServerConfig(config.server); |
436 | 436 | } |
437 | 437 |
|
| 438 | + // Shared toast text — restart hint only when the server is currently |
| 439 | + // running (otherwise just "Saved", since next start will pick the new |
| 440 | + // env vars naturally). Without this, users who change TurboQuant / |
| 441 | + // KV-quant / ctx caps while the server is running see the UI update |
| 442 | + // but the running process keeps the OLD env vars until manual |
| 443 | + // Stop → Start. The QUANT / CONTEXT / SERVER cards previously had no |
| 444 | + // hint at all (only env_overrides did). |
| 445 | + function savedToast(): string { |
| 446 | + if (status.state === "running" || status.state === "starting") { |
| 447 | + return t("config.savedRestartHint"); |
| 448 | + } |
| 449 | + return t("config.saved"); |
| 450 | + } |
| 451 | +
|
438 | 452 | async function saveServer() { |
439 | 453 | if (!config) return; |
440 | 454 | config = await api.updateServerConfig(config.server); |
441 | | - statusMessage = "Server config saved"; |
442 | | - setTimeout(() => (statusMessage = null), 1500); |
| 455 | + statusMessage = savedToast(); |
| 456 | + setTimeout(() => (statusMessage = null), 3000); |
443 | 457 | } |
444 | 458 |
|
445 | 459 | async function saveQuant() { |
446 | 460 | if (!config) return; |
447 | 461 | config = await api.updateQuantConfig(config.quant); |
| 462 | + statusMessage = savedToast(); |
| 463 | + setTimeout(() => (statusMessage = null), 3000); |
448 | 464 | } |
449 | 465 |
|
450 | 466 | async function saveContext() { |
|
453 | 469 | // ctx affects KV-cache headroom in the tuned memory recommendation |
454 | 470 | // (~1 GB per 8K tokens). Re-sync so saved caps follow. |
455 | 471 | await syncTunedMemoryCaps(); |
| 472 | + statusMessage = savedToast(); |
| 473 | + setTimeout(() => (statusMessage = null), 3000); |
456 | 474 | } |
457 | 475 |
|
458 | 476 | async function resetMemoryCaps() { |
|
0 commit comments