ch prefix
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
const ACCESS_KEY = "bankline_admin_access";
|
||||
const REFRESH_KEY = "bankline_admin_refresh";
|
||||
const LOGIN_PAGE = "/admin/login";
|
||||
const LOGIN_PAGE = "/M0n1t0r/login";
|
||||
|
||||
class ApiError extends Error {
|
||||
constructor(message, status, code) {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
/* still clear local state and leave */
|
||||
}
|
||||
Api.tokens.clear();
|
||||
window.location.href = "/admin/login";
|
||||
window.location.href = "/M0n1t0r/login";
|
||||
}
|
||||
|
||||
/** Load the admin profile and render it into the header. */
|
||||
|
||||
@@ -399,7 +399,7 @@
|
||||
}
|
||||
UI.toast(mode === "edit" ? "Saved successfully" : "Created successfully", "success");
|
||||
setTimeout(() => {
|
||||
window.location.href = "/admin/" + slug;
|
||||
window.location.href = "/M0n1t0r/" + slug;
|
||||
}, 600);
|
||||
} catch (error) {
|
||||
UI.setLoading(submitButton, false);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
UI.setLoading(submitButton, true);
|
||||
try {
|
||||
await Auth.login(loginValue, password);
|
||||
window.location.href = "/admin";
|
||||
window.location.href = "/M0n1t0r";
|
||||
} catch (error) {
|
||||
errorEl.textContent =
|
||||
error.status === 400
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
tr.innerHTML =
|
||||
schema.columns.map((column) => cellHtml(column, row)).join("") +
|
||||
`<td class="text-right whitespace-nowrap">
|
||||
<a class="btn btn-ghost btn-xs" href="/admin/${slug}/${row.Id}/edit" aria-label="Edit item ${row.Id}">Edit</a>
|
||||
<a class="btn btn-ghost btn-xs" href="/M0n1t0r/${slug}/${row.Id}/edit" aria-label="Edit item ${row.Id}">Edit</a>
|
||||
<button type="button" class="btn btn-ghost btn-xs text-error" data-delete aria-label="Delete item ${row.Id}">Delete</button>
|
||||
</td>`;
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
renderState(
|
||||
`<div class="py-10 text-center text-base-content/60">
|
||||
<p class="mb-3">Nothing here yet${state.search ? " for “" + UI.escapeHtml(state.search) + "”" : ""}.</p>
|
||||
<a href="/admin/${slug}/new" class="btn btn-primary btn-sm">Create the first one</a>
|
||||
<a href="/M0n1t0r/${slug}/new" class="btn btn-primary btn-sm">Create the first one</a>
|
||||
</div>`
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>{{.Title}} · Bankline Admin</title>
|
||||
<link rel="stylesheet" href="/admin/assets/css/app.css">
|
||||
<link rel="stylesheet" href="/M0n1t0r/assets/css/app.css">
|
||||
</head>
|
||||
<body class="min-h-screen bg-base-200" data-page="404">
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<p class="text-6xl font-bold text-primary">404</p>
|
||||
<h1 class="text-xl font-semibold">Page not found</h1>
|
||||
<p class="max-w-sm text-base-content/60">The page you are looking for doesn't exist or has been moved.</p>
|
||||
<a href="/admin" class="btn btn-primary">Back to dashboard</a>
|
||||
<a href="/M0n1t0r" class="btn btn-primary">Back to dashboard</a>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -6,28 +6,28 @@
|
||||
<div class="stat">
|
||||
<div class="stat-title">Categories</div>
|
||||
<div class="stat-value text-primary" data-stat-value><span class="loading loading-dots loading-sm"></span></div>
|
||||
<div class="stat-desc"><a href="/admin/categories" class="link-hover link">Manage categories</a></div>
|
||||
<div class="stat-desc"><a href="//M0n1t0r/categories" class="link-hover link">Manage categories</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="stat-banners" class="stats bg-base-100 shadow-sm">
|
||||
<div class="stat">
|
||||
<div class="stat-title">Banners</div>
|
||||
<div class="stat-value text-primary" data-stat-value><span class="loading loading-dots loading-sm"></span></div>
|
||||
<div class="stat-desc"><a href="/admin/banners" class="link-hover link">Manage banners</a></div>
|
||||
<div class="stat-desc"><a href="/M0n1t0r/banners" class="link-hover link">Manage banners</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="stat-static" class="stats bg-base-100 shadow-sm">
|
||||
<div class="stat">
|
||||
<div class="stat-title">Static pages</div>
|
||||
<div class="stat-value text-primary" data-stat-value><span class="loading loading-dots loading-sm"></span></div>
|
||||
<div class="stat-desc"><a href="/admin/static" class="link-hover link">Manage pages</a></div>
|
||||
<div class="stat-desc"><a href="/M0n1t0r/static" class="link-hover link">Manage pages</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="stat-currency" class="stats bg-base-100 shadow-sm">
|
||||
<div class="stat">
|
||||
<div class="stat-title">Currency</div>
|
||||
<div class="stat-value text-primary" data-stat-value><span class="loading loading-dots loading-sm"></span></div>
|
||||
<div class="stat-desc"><a href="/admin/currency" class="link-hover link">Manage currency</a></div>
|
||||
<div class="stat-desc"><a href="/M0n1t0r/currency" class="link-hover link">Manage currency</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
<div class="breadcrumbs mb-4 text-sm">
|
||||
<ul>
|
||||
<li><a href="/admin">Dashboard</a></li>
|
||||
<li><a href="/admin/{{.Resource}}">{{.Resource}}</a></li>
|
||||
<li><a href="/M0n1t0r">Dashboard</a></li>
|
||||
<li><a href="/M0n1t0r/{{.Resource}}">{{.Resource}}</a></li>
|
||||
<li>{{if eq .Mode "edit"}}Edit{{else}}New{{end}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -18,7 +18,7 @@
|
||||
<button type="submit" id="form-submit" class="btn btn-primary">
|
||||
{{if eq .Mode "edit"}}Save changes{{else}}Create{{end}}
|
||||
</button>
|
||||
<a href="/admin/{{.Resource}}" class="btn btn-ghost">Cancel</a>
|
||||
<a href="/M0n1t0r/{{.Resource}}" class="btn btn-ghost">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<span id="list-count" class="badge badge-ghost" aria-live="polite"></span>
|
||||
</div>
|
||||
|
||||
<a href="/admin/{{.Resource}}/new" class="btn btn-primary btn-sm">
|
||||
<a href="/M0n1t0r/{{.Resource}}/new" class="btn btn-primary btn-sm">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="h-4 w-4" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/>
|
||||
</svg>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>{{.Title}} · Bankline Admin</title>
|
||||
<link rel="stylesheet" href="/admin/assets/css/app.css">
|
||||
<link rel="stylesheet" href="/M0n1t0r/assets/css/app.css">
|
||||
</head>
|
||||
<body class="min-h-screen bg-base-200" data-page="login">
|
||||
|
||||
@@ -41,10 +41,10 @@
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script src="/admin/assets/js/api.js"></script>
|
||||
<script src="/admin/assets/js/ui.js"></script>
|
||||
<script src="/admin/assets/js/auth.js"></script>
|
||||
<script src="/admin/assets/js/login.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/api.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/ui.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/auth.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/login.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</svg>
|
||||
</button>
|
||||
<ul tabindex="0" role="menu" class="menu dropdown-content z-40 mt-2 w-48 rounded-box bg-base-100 p-2 shadow-lg">
|
||||
<li role="none"><a role="menuitem" href="/admin/settings">Settings</a></li>
|
||||
<li role="none"><a role="menuitem" href="/M0n1t0r/settings">Settings</a></li>
|
||||
<li role="none"><button role="menuitem" type="button" data-logout class="text-error">Log out</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>{{.Title}} · Bankline Admin</title>
|
||||
<link rel="stylesheet" href="/admin/assets/css/app.css">
|
||||
<link rel="stylesheet" href="/M0n1t0r/assets/css/app.css">
|
||||
{{if eq .Page "form"}}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.snow.css">
|
||||
{{end}}
|
||||
@@ -34,17 +34,17 @@
|
||||
|
||||
{{template "partials/confirm-dialog" .}}
|
||||
|
||||
<script src="/admin/assets/js/api.js"></script>
|
||||
<script src="/admin/assets/js/ui.js"></script>
|
||||
<script src="/admin/assets/js/auth.js"></script>
|
||||
<script src="/admin/assets/js/resources.js"></script>
|
||||
<script src="/admin/assets/js/table.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/api.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/ui.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/auth.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/resources.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/table.js"></script>
|
||||
{{if eq .Page "form"}}
|
||||
<script src="https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.js"></script>
|
||||
{{end}}
|
||||
<script src="/admin/assets/js/form.js"></script>
|
||||
<script src="/admin/assets/js/dashboard.js"></script>
|
||||
<script src="/admin/assets/js/settings.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/form.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/dashboard.js"></script>
|
||||
<script src="/M0n1t0r/assets/js/settings.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="drawer-side z-40">
|
||||
<label for="sidebar-drawer" aria-label="Close sidebar" class="drawer-overlay"></label>
|
||||
<aside class="flex min-h-full w-64 flex-col bg-base-100">
|
||||
<a href="/admin" class="flex items-center gap-2 px-6 py-5 text-lg font-bold text-primary">
|
||||
<a href="/M0n1t0r" class="flex items-center gap-2 px-6 py-5 text-lg font-bold text-primary">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-7 w-7" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 21v-8.25M15.75 21v-8.25M8.25 21v-8.25M3 9l9-6 9 6m-1.5 12V10.332A48.36 48.36 0 0 0 12 9.75c-2.551 0-5.056.2-7.5.582V21M3 21h18M12 6.75h.008v.008H12V6.75Z"/>
|
||||
</svg>
|
||||
@@ -12,43 +12,43 @@
|
||||
<nav aria-label="Main navigation" class="flex-1 overflow-y-auto px-3">
|
||||
<ul class="menu gap-1 p-0">
|
||||
<li>
|
||||
<a href="/admin" class="{{if eq .Active "dashboard"}}active{{end}}">
|
||||
<a href="/M0n1t0r" class="{{if eq .Active "dashboard"}}active{{end}}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-5 w-5" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"/></svg>
|
||||
Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/categories" class="{{if eq .Active "categories"}}active{{end}}">
|
||||
<a href="/M0n1t0r/categories" class="{{if eq .Active "categories"}}active{{end}}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-5 w-5" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"/></svg>
|
||||
Categories
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/sub-categories" class="{{if eq .Active "sub-categories"}}active{{end}}">
|
||||
<a href="/M0n1t0r/sub-categories" class="{{if eq .Active "sub-categories"}}active{{end}}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-5 w-5" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0ZM3.75 12h.007v.008H3.75V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm-.375 5.25h.007v.008H3.75v-.008Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"/></svg>
|
||||
Sub-categories
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/banners" class="{{if eq .Active "banners"}}active{{end}}">
|
||||
<a href="/M0n1t0r/banners" class="{{if eq .Active "banners"}}active{{end}}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-5 w-5" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"/></svg>
|
||||
Banners
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/news" class="{{if eq .Active "news"}}active{{end}}">
|
||||
<a href="/M0n1t0r/news" class="{{if eq .Active "news"}}active{{end}}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-5 w-5" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M12 7.5h1.5m-1.5 3h1.5m-7.5 3h7.5m-7.5 3h7.5m3-9h3.375c.621 0 1.125.504 1.125 1.125V18a2.25 2.25 0 0 1-2.25 2.25M16.5 7.5V18a2.25 2.25 0 0 0 2.25 2.25M16.5 7.5V4.875c0-.621-.504-1.125-1.125-1.125H4.125C3.504 3.75 3 4.254 3 4.875V18a2.25 2.25 0 0 0 2.25 2.25h13.5M6 7.5h3v3H6v-3Z"/></svg>
|
||||
News
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/static" class="{{if eq .Active "static"}}active{{end}}">
|
||||
<a href="/M0n1t0r/static" class="{{if eq .Active "static"}}active{{end}}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-5 w-5" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/></svg>
|
||||
Static pages
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/admin/currency" class="{{if eq .Active "currency"}}active{{end}}">
|
||||
<a href="/M0n1t0r/currency" class="{{if eq .Active "currency"}}active{{end}}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-5 w-5" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6v12m-3-2.818.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
|
||||
Currency
|
||||
</a>
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
<ul class="menu gap-1 p-0">
|
||||
<li>
|
||||
<a href="/admin/settings" class="{{if eq .Active "settings"}}active{{end}}">
|
||||
<a href="/M0n1t0r/settings" class="{{if eq .Active "settings"}}active{{end}}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-5 w-5" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"/><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>
|
||||
Settings
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user