revert: restore the original pre-redesign web console

Revert 688aad3, 39ac03a, c84dc36, and ff6a828 in reverse chronological order. Restore the exact tracked tree from 99aff42 while preserving history.

Validation: 29 authentication and base-path tests passed offline. All 23 prior UI browser tests ran in system Edge: 22 passed initially; the fake-login test passed on an unchanged isolated retry. Live game HTTP was blocked throughout browser validation.
This commit is contained in:
AttilaNet
2026-11-11 10:08:02 +08:00
parent 688aad37c1
commit e26d37e9c5
46 changed files with 748 additions and 4554 deletions
+4 -16
View File
@@ -29,7 +29,7 @@ export function control(field, {get, set, onError = () => {}}) {
} else if (['boolean', 'bool', 'checkbox'].includes(type)) {
root = el('input', {type: 'checkbox', 'aria-label': label});
root.addEventListener('change', () => commit(root.checked));
sync = () => { if (document.activeElement !== root) root.checked = Boolean(value()); };
sync = () => { root.checked = Boolean(value()); };
} else if (['select', 'enum'].includes(type)) {
root = el('select', {'aria-label': label});
let optionsSignature;
@@ -58,10 +58,7 @@ export function control(field, {get, set, onError = () => {}}) {
root.append(el('label', {}, check, option.label));
return {check, option};
});
sync = () => {
const selected = value() || [];
items.forEach(({check, option}) => { if (document.activeElement !== check) check.checked = selected.includes(option.value); });
};
sync = () => items.forEach(({check, option}) => { check.checked = (value() || []).includes(option.value); });
} else if (['id_counts', 'counts', 'reserves'].includes(type)) {
root = el('div', {class: 'counts-editor', role: 'group', 'aria-label': label});
const lines = el('div', {class: 'counts-lines'});
@@ -126,15 +123,7 @@ export function control(field, {get, set, onError = () => {}}) {
}
root.dataset.configPath = pathKey(path);
root.title = field.help || field.description || label;
const syncValue = sync;
sync = () => {
if (!root.contains(document.activeElement)) {
const disabled = Boolean(field.disabled || field.readonly);
if (root.matches('input,select,button,textarea')) root.disabled = disabled;
else root.querySelectorAll('input,select,button,textarea').forEach(input => { input.disabled = disabled; });
}
syncValue();
};
root.disabled = Boolean(field.disabled || field.readonly);
sync();
return {root, sync, field};
}
@@ -183,9 +172,8 @@ export class PolicyForm {
this.signature = signature;
}
this.host.hidden = !fields.length;
const latestByPath = new Map(fields.map(field => [pathKey(field.path), field]));
this.controls.forEach(entry => {
const latest = latestByPath.get(pathKey(entry.field.path));
const latest = fields.find(field => pathKey(field.path) === pathKey(entry.field.path));
if (latest) Object.assign(entry.field, latest);
entry.sync();
entry.row.dataset.dirty = String(Boolean(this.context.dirty?.(entry.field.path)));