diff --git a/Plugin/unraid/include/confui.php b/Plugin/unraid/include/confui.php index c0e7f37..8c2005c 100644 --- a/Plugin/unraid/include/confui.php +++ b/Plugin/unraid/include/confui.php @@ -131,17 +131,40 @@ function vv_conf_ui_assets(): void { `; } + // The gutter is seeded here and then kept in step by the input/scroll handlers in wire(). + // It cannot be produced once and left: the numbers follow the textarea's value, which is the + // thing the operator is about to change. function linesCtl(f) { const v = String(f.value == null ? '' : f.value); const n = v.split('\n').length; - const gutter = Array.from({ length: n }, (_, i) => i + 1).join('\n'); return `
${gutter}
- Nothing configurable here.
'; + this.hydrate(box); return box; }, @@ -232,7 +285,16 @@ function vv_conf_ui_assets(): void { if (onChange) onChange(); }; - box.addEventListener('input', e => { if (e.target.dataset.ctl) refresh(e.target); }); + box.addEventListener('input', e => { + if (!e.target.dataset.ctl) return; + if (e.target.classList.contains('vv-cf-array')) syncGutter(e.target); + refresh(e.target); + }); + // Capture: scroll does not bubble, so a listener on the container never sees a textarea + // scrolling inside it any other way. + box.addEventListener('scroll', e => { + if (e.target.classList && e.target.classList.contains('vv-cf-array')) scrollGutter(e.target); + }, true); box.addEventListener('change', e => { const el = e.target; if (!el.dataset.ctl) return; diff --git a/Plugin/unraid/pages/scheduler.php b/Plugin/unraid/pages/scheduler.php index f9b6bf3..5afec36 100644 --- a/Plugin/unraid/pages/scheduler.php +++ b/Plugin/unraid/pages/scheduler.php @@ -68,6 +68,10 @@ require_once dirname(__DIR__) . '/include/ai_profiles.php'; // The chat component itself now, not only the store: the assistant panel in the right-hand pane // is an instance of it rather than a second implementation. require_once dirname(__DIR__) . '/include/ai_chat.php'; +// The shared settings renderer. This page used to draw conf fields itself, which meant every +// boolean was a text box and every credential was legible — 329 of its 704 fields deserved a +// better control than the one they got. +require_once dirname(__DIR__) . '/include/confui.php'; // Live values for the `$VAR` markers in pages/readme/*.md. Conf variables, plus the derived // path constants — those are not conf keys, but they are exactly what a reader needs resolved @@ -1083,6 +1087,7 @@ Still the same two servers, two households, the same media stack running itself. vv_ai_profiles_script(); vv_ai_chat_store_script(); vv_ai_chat_assets(); + vv_conf_ui_assets(); ?>