feat: the workspace at /workspace; Настройки show the assistant's model as set, key included, and PostgreSQL's fields only when chosen, its two buttons on one line; pages come in softly

This commit is contained in:
redtea committed 2026-10-16 09:30:19 +03:00
1 parent 352b016384
commit 6db78399ac
10 files changed
+48 -24

No files matched your search

+1 -1
View File
@@ -225,7 +225,7 @@
if (act && act.term && !act.ssh && act.agent.id === m.id) return act;
let t = ws.panes().find(p => p.term && !p.ssh && p.agent.id === m.id);
if (!t) {
if (document.querySelector('main#app').dataset.view !== 'terminal') App.go('/terminal');
if (document.querySelector('main#app').dataset.view !== 'terminal') App.go('/workspace');
ws.open('term', {id: m.id, name: m.name, host: m.hostname, user: m.user});
t = ws.panes().find(p => p.term && !p.ssh && p.agent.id === m.id);
for (let i = 0; i < 40 && t && t.state !== 'ok'; i++) await sleep(250);
+14
View File
@@ -904,3 +904,17 @@ body.ai-dragging .ai-fab, body.ai-dragging .ai-box { transition:none; }
.ai-form-in textarea { min-height:40px; }
.ai-send { min-height:40px; max-height:40px; min-width:40px; max-width:40px; line-height:1; border-radius:10px; }
.ai-form-in textarea { border-radius:10px; }
/* Настройки: the key with its eye; PostgreSQL's fields only when chosen. */
.ai-form .keybox { display:flex; gap:6px; align-items:center; }
.ai-form .keybox input { flex:1; }
.ai-form .keybox .btn.sq { width:38px; height:38px; flex:none; }
.db-form:not(.pg) .pg-fields { display:none; }
.db-form .pg-fields { display:grid; gap:10px; }
.db-form .frow2 { display:flex; gap:10px; }
.db-form .frow2 label:first-child { flex:1; }
.db-form .frow2 .port { width:120px; }
.db-actions { margin-top:12px; }
.db-actions form { margin:0; }
/* Moving between Машины, WorkSpace and Настройки: the page comes in softly. */
main#app > .view:not([hidden]) { animation:view-in .22s ease both; }
@keyframes view-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
+3 -1
View File
@@ -7,7 +7,7 @@
// unmounted - its timers, requests and listeners dropped - when it goes.
(function () {
'use strict';
const views = {'/': 'machines', '/terminal': 'terminal', '/settings': 'settings'};
const views = {'/': 'machines', '/workspace': 'terminal', '/terminal': 'terminal', '/settings': 'settings'};
const modules = {};
const mounted = new Map(); // area -> {mod, scope}
const $ = s => document.querySelector(s);
@@ -120,6 +120,8 @@
// start mounts what the server drew, once every script has registered.
function start() {
// The old address of the workspace shows as the new one.
if (location.pathname === '/terminal') { history.replaceState({}, '', '/workspace' + location.search); shown = '/workspace' + location.search; }
document.querySelectorAll('main#app > .view').forEach(mount);
show({dashboard: 'machines', settings: 'settings'}[$('main#app').dataset.view] || 'terminal');
// /agents/{id}/terminal or /files: that pane, at once.
+1 -1
View File
@@ -754,7 +754,7 @@
// open opens a pane of kind on agent in a new tab and shows the view.
function open(kind, agent, opts) {
const t = openPane(kind, agent, opts);
if (location.pathname !== '/terminal' && window.App) App.go('/terminal');
if (location.pathname !== '/workspace' && window.App) App.go('/workspace');
return t;
}
const in_ = (el, x, y) => { const r = el.getBoundingClientRect(); return x >= r.left && x <= r.right && y >= r.top && y <= r.bottom; };