feat(ui): redesign UI with Tailwind CSS, CodeMirror 6, and new layout
- Replace all hand-written CSS with Tailwind utility classes - Upgrade CodeMirror 5 to CodeMirror 6 (scoped @codemirror/* packages) - Redesign layout with responsive sidebar navigation using JSX/Mithril - Flatten admin routes (e.g. /admin/presets -> /presets) - Add "remember me" login option with 2-week persistent cookie - Add delete confirmation dialogs across admin pages - Upgrade esbuild from 0.21 to 0.27 and update browser targets - Add Inter and Roboto Mono variable fonts with subset script
This commit is contained in:
1 parent
a7256620e0
commit
4a191afdec
64 files changed
+4147
-2421
No files matched your search
@@ -76,6 +76,8 @@ function putActionHandler(action, _object, isNew): Promise<ValidationErrors> {
|
||||
})
|
||||
.catch(reject);
|
||||
} else if (action === "delete") {
|
||||
if (!confirm("Deleting virtual parameter. Are you sure?"))
|
||||
return void resolve(null);
|
||||
store
|
||||
.deleteResource("virtualParameters", object["_id"])
|
||||
.then(() => {
|
||||
@@ -142,7 +144,7 @@ export const component: ClosureComponent = (): Component => {
|
||||
function onFilterChanged(filter): void {
|
||||
const ops = { filter };
|
||||
if (vnode.attrs["sort"]) ops["sort"] = vnode.attrs["sort"];
|
||||
m.route.set("/admin/virtualParameters", ops);
|
||||
m.route.set("/virtualParameters", ops);
|
||||
}
|
||||
|
||||
const sort = vnode.attrs["sort"]
|
||||
@@ -159,7 +161,7 @@ export const component: ClosureComponent = (): Component => {
|
||||
_sort[attributes[Math.abs(index) - 1].id] = Math.sign(index);
|
||||
const ops = { sort: JSON.stringify(_sort) };
|
||||
if (vnode.attrs["filter"]) ops["filter"] = vnode.attrs["filter"];
|
||||
m.route.set("/admin/virtualParameters", ops);
|
||||
m.route.set("/virtualParameters", ops);
|
||||
}
|
||||
|
||||
let filter = vnode.attrs["filter"]
|
||||
@@ -187,7 +189,7 @@ export const component: ClosureComponent = (): Component => {
|
||||
attrs["recordActionsCallback"] = (virtualParameter) => {
|
||||
return [
|
||||
m(
|
||||
"a",
|
||||
"button.text-cyan-700 hover:text-cyan-900 font-medium",
|
||||
{
|
||||
onclick: () => {
|
||||
let cb: () => Children = null;
|
||||
@@ -239,7 +241,7 @@ export const component: ClosureComponent = (): Component => {
|
||||
attrs["actionsCallback"] = (selected: Set<string>): Children => {
|
||||
return [
|
||||
m(
|
||||
"button.primary",
|
||||
"button.px-4 py-2 border border-stone-300 shadow-xs text-sm font-medium rounded-md text-stone-700 bg-white hover:bg-stone-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-cyan-500 disabled:opacity-50 disabled:cursor-not-allowed",
|
||||
{
|
||||
title: "Create new virtual parameter",
|
||||
onclick: () => {
|
||||
@@ -285,7 +287,7 @@ export const component: ClosureComponent = (): Component => {
|
||||
"New",
|
||||
),
|
||||
m(
|
||||
"button.primary",
|
||||
"button.px-4 py-2 border border-stone-300 shadow-xs text-sm font-medium rounded-md text-stone-700 bg-white hover:bg-stone-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-cyan-500 disabled:opacity-50 disabled:cursor-not-allowed",
|
||||
{
|
||||
title: "Delete selected virtual parameters",
|
||||
disabled: !selected.size,
|
||||
@@ -330,7 +332,10 @@ export const component: ClosureComponent = (): Component => {
|
||||
};
|
||||
|
||||
return [
|
||||
m("h1", "Listing virtual parameters"),
|
||||
m(
|
||||
"h1.text-xl font-medium text-stone-900 mb-5",
|
||||
"Listing virtual parameters",
|
||||
),
|
||||
m(filterComponent, filterAttrs),
|
||||
m(
|
||||
"loading",
|
||||
|
||||
Reference in new issue
Block a user