feat: one-page panel - shell with Машины, Терминал and Настройки, pages as fragments, forms sent in place

This commit is contained in:
redtea committed 2026-10-15 20:05:20 +03:00
1 parent 7b9daa524e
commit 113c63fd1b
17 files changed
+678 -432

No files matched your search

+5 -4
View File
@@ -1,11 +1,12 @@
// The users table in Settings: the role, the machines a user may use (a
// dialog with a list to tick), the password sign-in and whether the user
// may switch it themselves. Each change is saved at once.
(function () {
// It is mounted on the settings fragment each time the shell puts it in place.
window.UsersTable = {mount: function (root) {
'use strict';
var table = document.querySelector('table.users');
var table = root.querySelector('table.users');
if (!table) return;
var $ = function (id) { return document.getElementById(id); };
var $ = function (id) { return root.querySelector('#' + id); };
function save(id, body) {
return fetch('/api/panel/users/' + id, {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(body)})
@@ -102,4 +103,4 @@
// ---- a new user: the machines appear for a plain user ----
var role = $('newrole'), pick = $('newagents');
if (role) role.onchange = function () { pick.hidden = role.value !== 'user'; };
})();
}};