1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-10 20:26:48 +00:00

style(admin): the group form has the user form's layout and a members search

The group form put every user as a checkbox in one unsorted list, the
members among them, with no way to find one: past a few dozen users a
wall of names. Its name field ran the width of the page.

It now has the user form's sections (Group, Permissions, Members), each
with what it is for beside its fields. Members come first, then everyone
else, each by username with their full name; a search box filters them
by username, name or e-mail (table_filter.js). A form's search, marked
data-forget, starts empty: the list pages remember theirs per page title,
which here is the same for every group. Hidden users stay in the form,
so saving while filtered keeps them. The button says Create group or
Save changes.
This commit is contained in:
catborise 2026-11-04 22:41:00 +03:00
parent 6523fd0955
commit 61979be731
9 changed files with 223 additions and 124 deletions

View file

@ -7,7 +7,7 @@
// be the chosen state too. In a grouped list a search for a group's host
// shows all of its rows, and its header row (data-group-header) shows while
// any of its rows does. A page's #no-match shows while no row does. The
// search is remembered for a day, per page.
// search is remembered for a day, per page, unless its box has data-forget.
//
// The instance list's state pills (#state-pills) set the state; each one's
// [data-count-state] counts the VMs of its state the search finds (its
@ -68,9 +68,13 @@ if (typeof module !== "undefined") {
} else {
var search = document.getElementById("filter");
var states = document.getElementById("state-filter");
search.value = Cookies.get(document.title + "_filter") || "";
// a form's search ([data-forget], the group form's members) starts empty
var remember = !search.hasAttribute("data-forget");
search.value = remember && Cookies.get(document.title + "_filter") || "";
search.addEventListener("input", function () {
Cookies.set(document.title + "_filter", search.value, {expires: 1});
if (remember) {
Cookies.set(document.title + "_filter", search.value, {expires: 1});
}
filterTable(document);
});
if (states) {