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
+7
-6
@@ -97,6 +97,7 @@ function putActionHandler(action, _object, isNew): Promise<ValidationErrors> {
|
||||
})
|
||||
.catch(reject);
|
||||
} else if (action === "delete") {
|
||||
if (!confirm("Deleting user. Are you sure?")) return void resolve(null);
|
||||
store
|
||||
.deleteResource("users", object["_id"])
|
||||
.then(() => {
|
||||
@@ -152,7 +153,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/users", ops);
|
||||
m.route.set("/users", ops);
|
||||
}
|
||||
|
||||
const sort = vnode.attrs["sort"]
|
||||
@@ -172,7 +173,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/users", ops);
|
||||
m.route.set("/users", ops);
|
||||
}
|
||||
|
||||
let filter = vnode.attrs["filter"]
|
||||
@@ -211,7 +212,7 @@ export const component: ClosureComponent = (): Component => {
|
||||
attrs["recordActionsCallback"] = (user) => {
|
||||
return [
|
||||
m(
|
||||
"a",
|
||||
"button.text-cyan-700 hover:text-cyan-900 font-medium",
|
||||
{
|
||||
onclick: () => {
|
||||
let cb: () => Children = null;
|
||||
@@ -296,7 +297,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 user",
|
||||
onclick: () => {
|
||||
@@ -342,7 +343,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 users",
|
||||
disabled: !selected.size,
|
||||
@@ -385,7 +386,7 @@ export const component: ClosureComponent = (): Component => {
|
||||
};
|
||||
|
||||
return [
|
||||
m("h1", "Listing users"),
|
||||
m("h1.text-xl font-medium text-stone-900 mb-5", "Listing users"),
|
||||
m(filterComponent, filterAttrs),
|
||||
m(
|
||||
"loading",
|
||||
|
||||
Reference in new issue
Block a user