Hardcode agent stale timeout
This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
*/
|
||||
|
||||
import { state } from './state.js';
|
||||
import { api } from './api.js';
|
||||
import { toast } from './app.js';
|
||||
|
||||
// ── Time helpers ──────────────────────────────────────────────────────────
|
||||
|
||||
@@ -126,35 +124,7 @@ export function initStatus() {
|
||||
// ── Config panel ──────────────────────────────────────────────────────────
|
||||
|
||||
export function initConfig() {
|
||||
const form = document.getElementById('config-form');
|
||||
const staleInput = document.getElementById('cfg-stale');
|
||||
const saveBtn = document.getElementById('cfg-save');
|
||||
|
||||
// Populate from state
|
||||
state.subscribe('config', (cfg) => {
|
||||
if (!cfg) return;
|
||||
staleInput.value = cfg.agent_stale_after_seconds;
|
||||
});
|
||||
|
||||
form.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
saveBtn.disabled = true;
|
||||
const original = saveBtn.innerHTML;
|
||||
saveBtn.innerHTML = '<span class="spinner"></span>';
|
||||
|
||||
try {
|
||||
const cfg = await api.updateConfig({
|
||||
agent_stale_after_seconds: parseInt(staleInput.value, 10) || 30,
|
||||
});
|
||||
state.set('config', cfg);
|
||||
toast('Settings saved', 'success');
|
||||
} catch (e) {
|
||||
toast(e.message, 'error');
|
||||
} finally {
|
||||
saveBtn.disabled = false;
|
||||
saveBtn.innerHTML = original;
|
||||
}
|
||||
});
|
||||
// Intentionally empty: the web UI no longer exposes editable settings.
|
||||
}
|
||||
|
||||
function escapeHtml(str) {
|
||||
|
||||
Reference in New Issue
Block a user