webui: automation settings panel, set-location, responsive layout

- Automation tab: settings form (define_settings) beside the editor,
  stacking above it when narrow; script/settings save split.
- Set location modal: current location + reset checkbox.
- saveScriptSettings/setSavePath API wiring; plugins panel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ookami125 2026-06-21 23:22:00 -04:00
parent 5a5b5f4330
commit 9a1d67acd4
11 changed files with 741 additions and 13 deletions

View file

@ -40,6 +40,7 @@ body {
overflow: hidden;
-webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3342; border-radius: 6px; border: 2px solid var(--bg-1); }
@ -51,6 +52,28 @@ button, input, select { font-family: inherit; font-size: inherit; color: inherit
height: 100vh;
}
/* ---------------- Login ---------------- */
.login-screen {
position: fixed; inset: 0; display: grid; place-items: center;
background: var(--bg); z-index: 500;
}
.login-box {
width: min(360px, calc(100vw - 32px));
background: var(--bg-1);
border: 1px solid var(--line);
border-radius: 8px;
padding: 20px;
box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.login-brand { margin-bottom: 18px; }
.login-submit { width: 100%; padding: 8px 12px; }
.login-error {
color: var(--err); border: 1px solid rgba(240,97,109,.45);
background: rgba(240,97,109,.08); border-radius: 6px;
padding: 8px 10px; margin-bottom: 12px;
}
.login-note { margin: 12px 0 0; font-size: 12px; line-height: 1.4; }
/* ---------------- Toolbar ---------------- */
.toolbar {
display: flex; align-items: center; gap: 10px;
@ -283,6 +306,80 @@ table.dtbl td { padding: 3px 8px; border-bottom: 1px solid var(--line-soft); whi
.kvrow b { color: var(--txt); font-weight: 500; }
code.inline { background: var(--bg-3); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-family: var(--mono); font-size: 12px; color: var(--accent); }
/* ---------------- Automation view ---------------- */
.automation-layout { display: flex; gap: 12px; align-items: flex-start; }
.automation-main { flex: 1 1 auto; min-width: 0; }
.automation-settings { flex: 0 0 300px; align-self: stretch; }
/* Below this the side-by-side editor would be too narrow to read (the app also
* spends 232px on the sidebar), so stack settings ABOVE the script. */
@media (max-width: 1100px) {
/* Stack vertically, settings above the script. (The base .pane height:100%
* would otherwise make each pane fill the viewport and bury the editor.) */
.automation-layout {
flex-direction: column; align-items: stretch;
flex: 1 1 auto; min-height: 0;
}
/* Settings shrink to their content, but never take more than half the
* height scroll internally if there are a lot of them. */
.automation-settings {
order: -1; align-self: auto; width: 100%;
flex: 0 1 auto; height: auto; max-height: 50%; overflow: auto;
}
/* The script gets the rest (>= half) and its editor fills that space. */
.automation-main {
width: 100%; flex: 1 1 0; min-height: 0;
display: flex; flex-direction: column;
}
.automation-main .script-editor { flex: 1 1 auto; min-height: 180px; }
}
.settings-form { display: flex; flex-direction: column; gap: 12px; }
.setting-field { display: flex; flex-direction: column; gap: 5px; }
.setting-field.bool { flex-direction: row; align-items: center; gap: 8px; }
.setting-field .setting-label { color: var(--txt-dim); font-size: 12px; }
.setting-field input[type="text"],
.setting-field input[type="number"] {
background: var(--bg-1); border: 1px solid var(--line); border-radius: 6px;
padding: 7px 9px; color: var(--txt); font-size: 13px; outline: none;
}
.setting-field input[type="text"]:focus,
.setting-field input[type="number"]:focus { border-color: var(--accent); }
.setting-field.bool input { width: 15px; height: 15px; accent-color: var(--accent); }
.automation-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.automation-head h3 { margin: 0 0 4px; font-size: 15px; }
.script-actions { display: flex; align-items: center; gap: 8px; }
.script-save-status { min-width: 112px; text-align: right; color: var(--txt-faint); font-size: 12px; }
.script-save-status.dirty { color: var(--warn); }
.script-save-status.ok { color: var(--ok); }
.script-save-status.err { color: var(--err); }
.script-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.script-stat { background: var(--bg-1); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.script-stat span { display: block; color: var(--txt-dim); font-size: 11px; margin-bottom: 4px; }
.script-stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.script-error { border: 1px solid var(--err); border-radius: 6px; padding: 8px 10px; margin-bottom: 12px; color: var(--err); }
.script-error code { display: block; margin-top: 4px; color: var(--txt); font-family: var(--mono); font-size: 12px; white-space: pre-wrap; }
.script-editor {
position: relative; min-height: 420px; background: var(--bg-1);
border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.script-editor.disabled { opacity: .75; }
.script-highlight,
.script-editor textarea {
position: absolute; inset: 0; margin: 0; padding: 12px; border: 0;
font: 12px/1.45 var(--mono); tab-size: 4; white-space: pre;
}
.script-highlight { overflow: auto; color: var(--txt); pointer-events: none; }
.script-highlight code { white-space: pre; }
.script-editor textarea {
width: 100%; height: 100%; resize: none; outline: none; overflow: auto;
background: transparent; color: transparent; caret-color: var(--txt);
}
.script-editor textarea::selection { background: rgba(73, 157, 253, .28); color: transparent; }
.tok-comment { color: #697586; }
.tok-string { color: #8bd49c; }
.tok-keyword { color: #7fb4ff; }
.tok-number { color: #d8b4fe; }
.tok-api { color: #f6c177; }
/* ---------------- Search view ---------------- */
.search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-bar input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
@ -290,6 +387,7 @@ code.inline { background: var(--bg-3); border: 1px solid var(--line); border-rad
/* ---------------- Settings ---------------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.plugin-metric { font-size: 28px; line-height: 1; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
/* ---------------- Status bar ---------------- */
.statusbar {
@ -312,10 +410,10 @@ code.inline { background: var(--bg-3); border: 1px solid var(--line); border-rad
.modal .mfoot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.field { margin-bottom: 12px; }
.field label { display: block; color: var(--txt-dim); margin-bottom: 4px; font-size: 12px; }
.field input[type=text], .field textarea, .field select {
.field input[type=text], .field input[type=password], .field textarea, .field select {
width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px;
}
.field input[type=text]:focus, .field textarea:focus, .field select:focus,
.field input[type=text]:focus, .field input[type=password]:focus, .field textarea:focus, .field select:focus,
.field input[type=file]:focus { outline: none; border-color: var(--accent); }
.field textarea { min-height: 70px; font-family: var(--mono); font-size: 12px; resize: vertical; }