@sonicjs-cms/core 2.0.0-alpha.10 → 2.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-BRC3F4CG.cjs → chunk-6BHDKYLU.cjs} +8 -2
- package/dist/{chunk-KRJMGD4E.js.map → chunk-6BHDKYLU.cjs.map} +1 -1
- package/dist/{chunk-4USDL3UP.cjs → chunk-DG4INX36.cjs} +41 -1360
- package/dist/chunk-DG4INX36.cjs.map +1 -0
- package/dist/{chunk-GGBHOIDD.js → chunk-FDUDHGI6.js} +20 -1339
- package/dist/chunk-FDUDHGI6.js.map +1 -0
- package/dist/{chunk-KRJMGD4E.js → chunk-FZYF43TN.js} +8 -2
- package/dist/chunk-FZYF43TN.js.map +1 -0
- package/dist/chunk-G4JGVZAF.js +1337 -0
- package/dist/chunk-G4JGVZAF.js.map +1 -0
- package/dist/chunk-LEGKJ5DI.cjs +1344 -0
- package/dist/chunk-LEGKJ5DI.cjs.map +1 -0
- package/dist/index.cjs +54 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/middleware.d.ts +2 -0
- package/dist/plugins.d.ts +2 -0
- package/dist/routes.cjs +14 -13
- package/dist/routes.d.ts +2 -0
- package/dist/routes.js +2 -1
- package/dist/services.d.ts +2 -0
- package/dist/templates.cjs +22 -9
- package/dist/templates.d.ts +2 -0
- package/dist/templates.js +2 -1
- package/dist/types.d.ts +2 -0
- package/dist/utils.d.ts +2 -0
- package/package.json +2 -2
- package/dist/chunk-4USDL3UP.cjs.map +0 -1
- package/dist/chunk-BRC3F4CG.cjs.map +0 -1
- package/dist/chunk-GGBHOIDD.js.map +0 -1
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var chunkAGOE25LF_cjs = require('./chunk-AGOE25LF.cjs');
|
|
4
4
|
var chunkBUKT6HP5_cjs = require('./chunk-BUKT6HP5.cjs');
|
|
5
5
|
var chunkRNR4HA23_cjs = require('./chunk-RNR4HA23.cjs');
|
|
6
|
+
var chunkLEGKJ5DI_cjs = require('./chunk-LEGKJ5DI.cjs');
|
|
6
7
|
var chunkRGCQSFKC_cjs = require('./chunk-RGCQSFKC.cjs');
|
|
7
|
-
var chunkIGJUBJBW_cjs = require('./chunk-IGJUBJBW.cjs');
|
|
8
8
|
var hono = require('hono');
|
|
9
9
|
var cors = require('hono/cors');
|
|
10
10
|
var zod = require('zod');
|
|
@@ -12,549 +12,6 @@ var validator = require('hono/validator');
|
|
|
12
12
|
var cookie = require('hono/cookie');
|
|
13
13
|
var html = require('hono/html');
|
|
14
14
|
|
|
15
|
-
// src/templates/components/logo.template.ts
|
|
16
|
-
function renderLogo(data = {}) {
|
|
17
|
-
const {
|
|
18
|
-
size = "md",
|
|
19
|
-
variant = "default",
|
|
20
|
-
showText = true,
|
|
21
|
-
showVersion = true,
|
|
22
|
-
version = "v0.1.0",
|
|
23
|
-
className = "",
|
|
24
|
-
href
|
|
25
|
-
} = data;
|
|
26
|
-
const sizeClass = sizeClasses[size];
|
|
27
|
-
const logoSvg = `
|
|
28
|
-
<svg class="${sizeClass} ${className}" viewBox="380 1300 2250 400" aria-hidden="true">
|
|
29
|
-
<path fill="${variant === "white" ? "#ffffff" : variant === "dark" ? "#1f2937" : "#F1F2F2"}" d="M476.851,1404.673h168.536c4.714,0,8.695-1.618,11.944-4.866c3.241-3.241,4.866-7.222,4.866-11.943 c0-2.357-0.443-4.569-1.327-6.636c-0.885-2.06-2.067-3.829-3.539-5.308c-1.479-1.472-3.249-2.654-5.308-3.538 c-2.067-0.885-4.279-1.327-6.635-1.327H476.851c-20.057,0-37.158,7.154-51.313,21.454c-14.155,14.308-21.233,31.483-21.233,51.534 c0,20.058,7.078,37.234,21.233,51.534c14.155,14.308,31.255,21.454,51.313,21.454h112.357c10.907,0,20.196,3.837,27.868,11.502 c7.666,7.672,11.502,16.885,11.502,27.646c0,10.769-3.836,19.982-11.502,27.647c-7.672,7.673-16.961,11.502-27.868,11.502H421.115 c-4.721,0-8.702,1.624-11.944,4.865c-3.248,3.249-4.866,7.23-4.866,11.944c0,3.248,0.733,6.123,2.212,8.626 c1.472,2.509,3.462,4.499,5.971,5.972c2.502,1.472,5.378,2.212,8.626,2.212h168.094c20.052,0,37.227-7.078,51.534-21.234 c14.3-14.155,21.454-31.331,21.454-51.534c0-20.196-7.154-37.379-21.454-51.534c-14.308-14.156-31.483-21.234-51.534-21.234 H476.851c-10.616,0-19.76-3.905-27.426-11.721c-7.672-7.811-11.501-17.101-11.501-27.87c0-10.761,3.829-19.975,11.501-27.647 C457.091,1408.508,466.235,1404.673,476.851,1404.673z"></path>
|
|
30
|
-
<path fill="${variant === "white" ? "#ffffff" : variant === "dark" ? "#1f2937" : "#F1F2F2"}" d="M974.78,1398.211c-5.016,6.574-10.034,13.146-15.048,19.721c-1.828,2.398-3.657,4.796-5.487,7.194 c1.994,1.719,3.958,3.51,5.873,5.424c18.724,18.731,28.089,41.216,28.089,67.459c0,26.251-9.366,48.658-28.089,67.237 c-18.731,18.579-41.215,27.868-67.459,27.868c-9.848,0-19.156-1.308-27.923-3.923l-4.185,3.354 c-8.587,6.885-17.154,13.796-25.725,20.702c17.52,8.967,36.86,13.487,58.054,13.487c35.533,0,65.91-12.608,91.124-37.821 c25.214-25.215,37.821-55.584,37.821-91.125c0-35.534-12.607-65.911-37.821-91.126 C981.004,1403.663,977.926,1400.854,974.78,1398.211z"></path>
|
|
31
|
-
<path fill="${variant === "white" ? "#ffffff" : variant === "dark" ? "#1f2937" : "#F1F2F2"}" d="M1364.644,1439.619c-4.72,0-8.702,1.624-11.943,4.865c-3.249,3.249-4.866,7.23-4.866,11.944v138.014 l-167.651-211.003c-0.297-0.586-0.74-1.03-1.327-1.326c-4.721-4.714-10.249-7.742-16.588-9.069 c-6.346-1.326-12.608-0.732-18.801,1.77c-6.192,2.509-11.059,6.49-14.598,11.944c-3.539,5.46-5.308,11.577-5.308,18.357v208.348 c0,4.721,1.618,8.703,4.866,11.944c3.241,3.241,7.222,4.865,11.943,4.865c2.945,0,5.751-0.738,8.405-2.211 c2.654-1.472,4.713-3.463,6.193-5.971c1.473-2.503,2.212-5.378,2.212-8.627v-205.251l166.325,209.675 c2.06,2.654,4.423,4.865,7.078,6.635c5.308,3.829,11.349,5.75,18.137,5.75c5.308,0,10.464-1.182,15.482-3.538 c3.539-1.769,6.56-4.127,9.069-7.078c2.502-2.945,4.491-6.338,5.971-10.175c1.473-3.829,2.212-7.664,2.212-11.501v-141.552 c0-4.714-1.624-8.695-4.865-11.944C1373.339,1441.243,1369.359,1439.619,1364.644,1439.619z"></path>
|
|
32
|
-
<path fill="${variant === "white" ? "#ffffff" : variant === "dark" ? "#1f2937" : "#F1F2F2"}" d="M1508.406,1432.983c-2.654-1.472-5.46-2.212-8.404-2.212c-4.721,0-8.703,1.7-11.944,5.087 c-3.249,3.395-4.865,7.3-4.865,11.723v163.228c0,4.721,1.616,8.702,4.865,11.943c3.241,3.249,7.223,4.866,11.944,4.866 c2.944,0,5.751-0.732,8.404-2.212c2.655-1.472,4.714-3.539,6.193-6.194c1.473-2.654,2.213-5.453,2.213-8.404V1447.58 c0-2.945-0.74-5.75-2.213-8.405C1513.12,1436.522,1511.06,1434.462,1508.406,1432.983z"></path>
|
|
33
|
-
<path fill="${variant === "white" ? "#ffffff" : variant === "dark" ? "#1f2937" : "#F1F2F2"}" d="M1499.78,1367.957c-4.575,0-8.481,1.625-11.722,4.866c-3.249,3.249-4.865,7.23-4.865,11.943 c0,2.951,0.732,5.75,2.212,8.405c1.472,2.654,3.463,4.721,5.971,6.193c2.503,1.479,5.378,2.212,8.627,2.212 c4.423,0,8.328-1.618,11.721-4.865c3.387-3.243,5.088-7.224,5.088-11.944c0-4.713-1.701-8.694-5.088-11.943 C1508.33,1369.582,1504.349,1367.957,1499.78,1367.957z"></path>
|
|
34
|
-
<path fill="${variant === "white" ? "#ffffff" : variant === "dark" ? "#1f2937" : "#F1F2F2"}" d="M1859.627,1369.727H1747.27c-35.388,0-65.69,12.607-90.904,37.821 c-25.213,25.215-37.82,55.591-37.82,91.125c0,35.54,12.607,65.911,37.82,91.125c25.215,25.215,55.516,37.821,90.904,37.821h56.178 c4.714,0,8.695-1.618,11.944-4.866c3.241-3.241,4.865-7.222,4.865-11.943c0-4.714-1.624-8.695-4.865-11.943 c-3.249-3.243-7.23-4.866-11.944-4.866h-56.178c-26.251,0-48.659-9.359-67.237-28.09c-18.579-18.723-27.868-41.207-27.868-67.459 c0-26.243,9.29-48.659,27.868-67.237c18.579-18.579,40.987-27.868,67.237-27.868h112.357c4.714,0,8.696-1.693,11.944-5.087 c3.241-3.387,4.865-7.368,4.865-11.943c0-4.569-1.624-8.475-4.865-11.723C1868.322,1371.351,1864.341,1369.727,1859.627,1369.727z "></path>
|
|
35
|
-
<path fill="#06b6d4" d="M2219.256,1371.054h-112.357c-4.423,0-8.336,1.624-11.723,4.865c-3.393,3.249-5.087,7.23-5.087,11.944 c0,4.721,1.694,8.702,5.087,11.943c3.387,3.249,7.3,4.866,11.723,4.866h95.547v95.105c0,26.251-9.365,48.659-28.088,67.237 c-18.731,18.579-41.215,27.868-67.459,27.868c-26.251,0-48.659-9.289-67.237-27.868c-18.579-18.579-27.868-40.987-27.868-67.237 c0-4.713-1.701-8.771-5.088-12.165c-3.393-3.387-7.374-5.087-11.943-5.087c-4.575,0-8.481,1.7-11.722,5.087 c-3.249,3.393-4.865,7.451-4.865,12.165c0,35.388,12.607,65.69,37.82,90.904c25.215,25.213,55.584,37.82,91.126,37.82 c35.532,0,65.91-12.607,91.125-37.82c25.214-25.215,37.82-55.516,37.82-90.904v-111.915c0-4.714-1.624-8.695-4.865-11.944 C2227.951,1372.678,2223.971,1371.054,2219.256,1371.054z"></path>
|
|
36
|
-
<path fill="#06b6d4" d="M2574.24,1502.875c-14.306-14.156-31.483-21.234-51.533-21.234H2410.35 c-10.617,0-19.762-3.829-27.426-11.501c-7.672-7.664-11.501-16.954-11.501-27.868c0-10.907,3.829-20.196,11.501-27.868 c7.664-7.664,16.809-11.501,27.426-11.501h112.357c4.714,0,8.695-1.617,11.944-4.866c3.241-3.241,4.865-7.222,4.865-11.943 c0-4.714-1.624-8.695-4.865-11.944c-3.249-3.241-7.23-4.865-11.944-4.865H2410.35c-20.058,0-37.158,7.154-51.313,21.454 c-14.156,14.308-21.232,31.483-21.232,51.534c0,20.058,7.077,37.234,21.232,51.534c14.156,14.308,31.255,21.454,51.313,21.454 h112.357c7.078,0,13.637,1.77,19.684,5.308c6.042,3.539,10.838,8.336,14.377,14.377c3.538,6.047,5.307,12.607,5.307,19.685 c0,10.616-3.835,19.76-11.501,27.425c-7.672,7.673-16.961,11.502-27.868,11.502h-168.094c-4.721,0-8.703,1.7-11.944,5.087 c-3.249,3.393-4.865,7.374-4.865,11.943c0,4.576,1.616,8.481,4.865,11.723c3.241,3.249,7.223,4.866,11.944,4.866h168.094 c20.051,0,37.227-7.078,51.533-21.234c14.302-14.155,21.454-31.331,21.454-51.534 C2595.695,1534.213,2588.542,1517.03,2574.24,1502.875z"></path>
|
|
37
|
-
<path fill="#06b6d4" d="M854.024,1585.195l20.001-16.028c16.616-13.507,33.04-27.265,50.086-40.251 c1.13-0.861,2.9-1.686,2.003-3.516c-0.843-1.716-2.481-2.302-4.484-2.123c-8.514,0.765-17.016-0.538-25.537-0.353 c-1.124,0.024-2.768,0.221-3.163-1.25c-0.371-1.369,1.088-2.063,1.919-2.894c6.26-6.242,12.574-12.43,18.816-18.691 c9.303-9.327,18.565-18.714,27.851-28.066c1.848-1.859,3.701-3.713,5.549-5.572c2.655-2.661,5.309-5.315,7.958-7.982 c0.574-0.579,1.259-1.141,1.246-1.94c-0.004-0.257-0.078-0.538-0.254-0.853c-0.556-0.981-1.441-1.1-2.469-0.957 c-0.658,0.096-1.315,0.185-1.973,0.275c-3.844,0.538-7.689,1.076-11.533,1.608c-3.641,0.505-7.281,1.02-10.922,1.529 c-4.162,0.582-8.324,1.158-12.486,1.748c-1.142,0.161-2.409,1.662-3.354,0.508c-0.419-0.508-0.431-1.028-0.251-1.531 c0.269-0.741,0.957-1.441,1.387-2.021c3.414-4.58,6.882-9.124,10.356-13.662c1.74-2.272,3.48-4.544,5.214-6.822 c4.682-6.141,9.369-12.281,14.051-18.422c0.09-0.119,0.181-0.237,0.271-0.355c6.848-8.98,13.7-17.958,20.553-26.936 c0.488-0.64,0.977-1.28,1.465-1.92c2.159-2.828,4.315-5.658,6.476-8.486c4.197-5.501,8.454-10.954,12.67-16.442 c0.263-0.347,0.538-0.718,0.717-1.106c0.269-0.586,0.299-1.196-0.335-1.776c-0.825-0.753-1.8-0.15-2.595,0.419 c-0.67,0.472-1.333,0.957-1.955,1.489c-2.206,1.889-4.401,3.797-6.595,5.698c-3.958,3.438-7.922,6.876-11.976,10.194 c-2.443,2.003-4.865,4.028-7.301,6.038c-18.689-10.581-39.53-15.906-62.549-15.906c-35.54,0-65.911,12.607-91.125,37.82 c-25.214,25.215-37.821,55.592-37.821,91.126c0,35.54,12.607,65.91,37.821,91.125c4.146,4.146,8.445,7.916,12.87,11.381 c-9.015,11.14-18.036,22.277-27.034,33.429c-1.208,1.489-3.755,3.151-2.745,4.891c0.078,0.144,0.173,0.281,0.305,0.425 c1.321,1.429,3.492-1.303,4.933-2.457c6.673-5.333,13.333-10.685,19.982-16.042c3.707-2.984,7.417-5.965,11.124-8.952 c1.474-1.188,2.951-2.373,4.425-3.561c6.41-5.164,12.816-10.333,19.238-15.481L854.024,1585.195z M797.552,1498.009 c0-26.243,9.29-48.728,27.868-67.459c18.579-18.723,40.987-28.089,67.238-28.089c12.273,0,23.712,2.075,34.34,6.171 c-3.37,2.905-6.734,5.816-10.069,8.762c-6.075,5.351-12.365,10.469-18.667,15.564c-4.179,3.378-8.371,6.744-12.514,10.164 c-7.54,6.23-15.037,12.52-22.529,18.804c-7.091,5.955-14.182,11.904-21.19,17.949c-1.136,0.974-3.055,1.907-2.135,3.94 c0.831,1.836,2.774,1.417,4.341,1.578l12.145-0.599l14.151-0.698c1.031-0.102,2.192-0.257,2.89,0.632 c0.034,0.044,0.073,0.078,0.106,0.127c1.017,1.561-0.67,2.105-1.387,2.942c-6.308,7.318-12.616,14.637-18.978,21.907 c-8.161,9.339-16.353,18.649-24.544,27.958c-2.146,2.433-4.275,4.879-6.422,7.312c-1.034,1.172-2.129,2.272-1.238,3.922 c0.933,1.728,2.685,1.752,4.323,1.602c4.134-0.367,8.263-0.489,12.396-0.492c0.242,0,0.485-0.005,0.728-0.004 c2.711,0.009,5.422,0.068,8.134,0.145c2.582,0.074,5.166,0.165,7.752,0.249c0.275,1.62-0.879,2.356-1.62,3.259 c-1.333,1.626-2.667,3.247-4,4.867c-4.315,5.252-8.62,10.514-12.928,15.772c-3.562-2.725-7.007-5.733-10.324-9.051 C806.842,1546.667,797.552,1524.26,797.552,1498.009z"></path>
|
|
38
|
-
</svg>
|
|
39
|
-
`;
|
|
40
|
-
const versionBadge = showVersion ? `
|
|
41
|
-
<span class="inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium ring-1 ring-inset ${variant === "white" ? "bg-white/10 text-white/80 ring-white/20" : "bg-cyan-50 text-cyan-700 ring-cyan-700/10 dark:bg-cyan-500/10 dark:text-cyan-400 dark:ring-cyan-500/20"}">
|
|
42
|
-
${version}
|
|
43
|
-
</span>
|
|
44
|
-
` : "";
|
|
45
|
-
const logoContent = showText ? `
|
|
46
|
-
<div class="flex items-center gap-2 ${className}">
|
|
47
|
-
${logoSvg}
|
|
48
|
-
${versionBadge}
|
|
49
|
-
</div>
|
|
50
|
-
` : logoSvg;
|
|
51
|
-
if (href) {
|
|
52
|
-
return `<a href="${href}" class="inline-block hover:opacity-80 transition-opacity">${logoContent}</a>`;
|
|
53
|
-
}
|
|
54
|
-
return logoContent;
|
|
55
|
-
}
|
|
56
|
-
var sizeClasses;
|
|
57
|
-
var init_logo_template = chunkIGJUBJBW_cjs.__esm({
|
|
58
|
-
"src/templates/components/logo.template.ts"() {
|
|
59
|
-
sizeClasses = {
|
|
60
|
-
sm: "h-6 w-auto",
|
|
61
|
-
md: "h-8 w-auto",
|
|
62
|
-
lg: "h-12 w-auto",
|
|
63
|
-
xl: "h-16 w-auto"
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// src/templates/layouts/admin-layout-catalyst.template.ts
|
|
69
|
-
var admin_layout_catalyst_template_exports = {};
|
|
70
|
-
chunkIGJUBJBW_cjs.__export(admin_layout_catalyst_template_exports, {
|
|
71
|
-
renderAdminLayoutCatalyst: () => renderAdminLayoutCatalyst,
|
|
72
|
-
renderCatalystCheckbox: () => renderCatalystCheckbox
|
|
73
|
-
});
|
|
74
|
-
function renderCatalystCheckbox(props) {
|
|
75
|
-
const {
|
|
76
|
-
id,
|
|
77
|
-
name,
|
|
78
|
-
checked = false,
|
|
79
|
-
disabled = false,
|
|
80
|
-
label,
|
|
81
|
-
description,
|
|
82
|
-
color = "dark/zinc",
|
|
83
|
-
className = ""
|
|
84
|
-
} = props;
|
|
85
|
-
const colorClasses = {
|
|
86
|
-
"dark/zinc": "peer-checked:bg-zinc-900 peer-checked:before:bg-zinc-900 dark:peer-checked:bg-zinc-600",
|
|
87
|
-
"dark/white": "peer-checked:bg-zinc-900 peer-checked:before:bg-zinc-900 dark:peer-checked:bg-white",
|
|
88
|
-
"white": "peer-checked:bg-white peer-checked:before:bg-white",
|
|
89
|
-
"dark": "peer-checked:bg-zinc-900 peer-checked:before:bg-zinc-900",
|
|
90
|
-
"zinc": "peer-checked:bg-zinc-600 peer-checked:before:bg-zinc-600",
|
|
91
|
-
"blue": "peer-checked:bg-blue-600 peer-checked:before:bg-blue-600",
|
|
92
|
-
"green": "peer-checked:bg-green-600 peer-checked:before:bg-green-600",
|
|
93
|
-
"red": "peer-checked:bg-red-600 peer-checked:before:bg-red-600"
|
|
94
|
-
};
|
|
95
|
-
const checkColor = color === "dark/white" ? "dark:text-zinc-900" : "text-white";
|
|
96
|
-
const baseClasses = `
|
|
97
|
-
relative isolate flex w-4 h-4 items-center justify-center rounded-[0.3125rem]
|
|
98
|
-
before:absolute before:inset-0 before:-z-10 before:rounded-[calc(0.3125rem-1px)] before:bg-white before:shadow-sm
|
|
99
|
-
dark:before:hidden
|
|
100
|
-
dark:bg-white/5
|
|
101
|
-
border border-zinc-950/15 peer-checked:border-transparent
|
|
102
|
-
dark:border-white/15 dark:peer-checked:border-white/5
|
|
103
|
-
peer-focus:outline peer-focus:outline-2 peer-focus:outline-offset-2 peer-focus:outline-blue-500
|
|
104
|
-
peer-disabled:opacity-50
|
|
105
|
-
peer-disabled:border-zinc-950/25 peer-disabled:bg-zinc-950/5
|
|
106
|
-
dark:peer-disabled:border-white/20 dark:peer-disabled:bg-white/2.5
|
|
107
|
-
`.trim().replace(/\s+/g, " ");
|
|
108
|
-
const checkIconClasses = `
|
|
109
|
-
w-4 h-4 opacity-0 peer-checked:opacity-100 pointer-events-none
|
|
110
|
-
`.trim().replace(/\s+/g, " ");
|
|
111
|
-
if (description) {
|
|
112
|
-
return `
|
|
113
|
-
<div class="grid grid-cols-[1.125rem_1fr] gap-x-4 gap-y-1 sm:grid-cols-[1rem_1fr] ${className}">
|
|
114
|
-
<div class="col-start-1 row-start-1 mt-0.75 sm:mt-1">
|
|
115
|
-
<input
|
|
116
|
-
type="checkbox"
|
|
117
|
-
id="${id}"
|
|
118
|
-
name="${name}"
|
|
119
|
-
${checked ? "checked" : ""}
|
|
120
|
-
${disabled ? "disabled" : ""}
|
|
121
|
-
class="peer sr-only"
|
|
122
|
-
/>
|
|
123
|
-
<label for="${id}" class="inline-flex cursor-pointer">
|
|
124
|
-
<span class="${baseClasses} ${colorClasses[color] || colorClasses["dark/zinc"]}">
|
|
125
|
-
<svg class="${checkIconClasses} ${checkColor}" viewBox="0 0 14 14" fill="none" stroke="currentColor">
|
|
126
|
-
<path d="M3 8L6 11L11 3.5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
127
|
-
</svg>
|
|
128
|
-
</span>
|
|
129
|
-
</label>
|
|
130
|
-
</div>
|
|
131
|
-
${label ? `<label for="${id}" class="col-start-2 row-start-1 text-sm/6 font-medium text-zinc-950 dark:text-white cursor-pointer">${label}</label>` : ""}
|
|
132
|
-
${description ? `<p class="col-start-2 row-start-2 text-sm/6 text-zinc-500 dark:text-zinc-400">${description}</p>` : ""}
|
|
133
|
-
</div>
|
|
134
|
-
`;
|
|
135
|
-
} else {
|
|
136
|
-
return `
|
|
137
|
-
<label class="inline-flex items-center gap-3 cursor-pointer ${className}">
|
|
138
|
-
<input
|
|
139
|
-
type="checkbox"
|
|
140
|
-
id="${id}"
|
|
141
|
-
name="${name}"
|
|
142
|
-
${checked ? "checked" : ""}
|
|
143
|
-
${disabled ? "disabled" : ""}
|
|
144
|
-
class="peer sr-only"
|
|
145
|
-
/>
|
|
146
|
-
<span class="${baseClasses} ${colorClasses[color] || colorClasses["dark/zinc"]}">
|
|
147
|
-
<svg class="${checkIconClasses} ${checkColor}" viewBox="0 0 14 14" fill="none" stroke="currentColor">
|
|
148
|
-
<path d="M3 8L6 11L11 3.5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
149
|
-
</svg>
|
|
150
|
-
</span>
|
|
151
|
-
${label ? `<span class="text-sm/6 font-medium text-zinc-950 dark:text-white">${label}</span>` : ""}
|
|
152
|
-
</label>
|
|
153
|
-
`;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function renderAdminLayoutCatalyst(data) {
|
|
157
|
-
return `<!DOCTYPE html>
|
|
158
|
-
<html lang="en" class="dark">
|
|
159
|
-
<head>
|
|
160
|
-
<meta charset="UTF-8">
|
|
161
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
162
|
-
<title>${data.title} - SonicJS AI Admin</title>
|
|
163
|
-
<link rel="icon" type="image/x-icon" href="https://demo.sonicjs.com/images/favicon.ico">
|
|
164
|
-
|
|
165
|
-
<!-- Tailwind CSS -->
|
|
166
|
-
<script src="https://cdn.tailwindcss.com"></script>
|
|
167
|
-
<script>
|
|
168
|
-
tailwind.config = {
|
|
169
|
-
darkMode: 'class',
|
|
170
|
-
theme: {
|
|
171
|
-
extend: {
|
|
172
|
-
colors: {
|
|
173
|
-
zinc: {
|
|
174
|
-
50: '#fafafa',
|
|
175
|
-
100: '#f4f4f5',
|
|
176
|
-
200: '#e4e4e7',
|
|
177
|
-
300: '#d4d4d8',
|
|
178
|
-
400: '#a1a1aa',
|
|
179
|
-
500: '#71717a',
|
|
180
|
-
600: '#52525b',
|
|
181
|
-
700: '#3f3f46',
|
|
182
|
-
800: '#27272a',
|
|
183
|
-
900: '#18181b',
|
|
184
|
-
950: '#09090b'
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
</script>
|
|
191
|
-
|
|
192
|
-
<!-- Additional Styles -->
|
|
193
|
-
<style>
|
|
194
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
|
195
|
-
|
|
196
|
-
* {
|
|
197
|
-
margin: 0;
|
|
198
|
-
padding: 0;
|
|
199
|
-
box-sizing: border-box;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
body {
|
|
203
|
-
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
|
204
|
-
-webkit-font-smoothing: antialiased;
|
|
205
|
-
-moz-osx-font-smoothing: grayscale;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/* Custom scrollbar */
|
|
209
|
-
::-webkit-scrollbar {
|
|
210
|
-
width: 8px;
|
|
211
|
-
height: 8px;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
::-webkit-scrollbar-track {
|
|
215
|
-
background: #27272a;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
::-webkit-scrollbar-thumb {
|
|
219
|
-
background: #52525b;
|
|
220
|
-
border-radius: 4px;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
::-webkit-scrollbar-thumb:hover {
|
|
224
|
-
background: #71717a;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/* Smooth transitions */
|
|
228
|
-
* {
|
|
229
|
-
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
|
230
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
231
|
-
transition-duration: 150ms;
|
|
232
|
-
}
|
|
233
|
-
</style>
|
|
234
|
-
|
|
235
|
-
<!-- Scripts -->
|
|
236
|
-
<script src="https://unpkg.com/htmx.org@2.0.3"></script>
|
|
237
|
-
<script src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
|
|
238
|
-
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
|
|
239
|
-
|
|
240
|
-
${data.styles ? data.styles.map((style) => `<link rel="stylesheet" href="${style}">`).join("\n ") : ""}
|
|
241
|
-
${data.scripts ? data.scripts.map((script) => `<script src="${script}"></script>`).join("\n ") : ""}
|
|
242
|
-
</head>
|
|
243
|
-
<body class="min-h-screen bg-white dark:bg-zinc-900">
|
|
244
|
-
<div class="relative isolate flex min-h-svh w-full max-lg:flex-col lg:bg-zinc-100 dark:lg:bg-zinc-950">
|
|
245
|
-
<!-- Sidebar on desktop -->
|
|
246
|
-
<div class="fixed inset-y-0 left-0 w-64 max-lg:hidden">
|
|
247
|
-
${renderCatalystSidebar(
|
|
248
|
-
data.currentPath,
|
|
249
|
-
data.user,
|
|
250
|
-
data.dynamicMenuItems,
|
|
251
|
-
false,
|
|
252
|
-
data.version,
|
|
253
|
-
data.enableExperimentalFeatures
|
|
254
|
-
)}
|
|
255
|
-
</div>
|
|
256
|
-
|
|
257
|
-
<!-- Mobile sidebar (hidden by default) -->
|
|
258
|
-
<div id="mobile-sidebar-overlay" class="fixed inset-0 bg-black/30 lg:hidden hidden z-40" onclick="closeMobileSidebar()"></div>
|
|
259
|
-
<div id="mobile-sidebar" class="fixed inset-y-0 left-0 w-80 transform -translate-x-full transition-transform duration-300 ease-in-out lg:hidden z-50">
|
|
260
|
-
${renderCatalystSidebar(
|
|
261
|
-
data.currentPath,
|
|
262
|
-
data.user,
|
|
263
|
-
data.dynamicMenuItems,
|
|
264
|
-
true,
|
|
265
|
-
data.version,
|
|
266
|
-
data.enableExperimentalFeatures
|
|
267
|
-
)}
|
|
268
|
-
</div>
|
|
269
|
-
|
|
270
|
-
<!-- Main content area -->
|
|
271
|
-
<main class="flex flex-1 flex-col pb-2 lg:min-w-0 lg:pr-2 lg:pl-64">
|
|
272
|
-
<!-- Mobile header with menu toggle -->
|
|
273
|
-
<header class="flex items-center px-4 py-2.5 lg:hidden border-b border-zinc-950/5 dark:border-white/5">
|
|
274
|
-
<button onclick="openMobileSidebar()" class="relative flex items-center justify-center rounded-lg p-2 text-zinc-950 hover:bg-zinc-950/5 dark:text-white dark:hover:bg-white/5" aria-label="Open navigation">
|
|
275
|
-
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
|
276
|
-
<path d="M2 6.75C2 6.33579 2.33579 6 2.75 6H17.25C17.6642 6 18 6.33579 18 6.75C18 7.16421 17.6642 7.5 17.25 7.5H2.75C2.33579 7.5 2 7.16421 2 6.75ZM2 13.25C2 12.8358 2.33579 12.5 2.75 12.5H17.25C17.6642 12.5 18 12.8358 18 13.25C18 13.6642 17.6642 14 17.25 14H2.75C2.33579 14 2 13.6642 2 13.25Z" />
|
|
277
|
-
</svg>
|
|
278
|
-
</button>
|
|
279
|
-
<div class="ml-4 flex-1">
|
|
280
|
-
${renderLogo({ size: "sm", showText: true, variant: "white", version: data.version, href: "/admin" })}
|
|
281
|
-
</div>
|
|
282
|
-
</header>
|
|
283
|
-
|
|
284
|
-
<!-- Content -->
|
|
285
|
-
<div class="grow p-6 lg:rounded-lg lg:bg-white lg:p-10 lg:shadow-sm lg:ring-1 lg:ring-zinc-950/5 dark:lg:bg-zinc-900 dark:lg:ring-white/10">
|
|
286
|
-
${data.content}
|
|
287
|
-
</div>
|
|
288
|
-
</main>
|
|
289
|
-
</div>
|
|
290
|
-
|
|
291
|
-
<!-- Notification Container -->
|
|
292
|
-
<div id="notification-container" class="fixed top-4 right-4 z-50 space-y-2"></div>
|
|
293
|
-
|
|
294
|
-
<script>
|
|
295
|
-
// Mobile sidebar toggle
|
|
296
|
-
function openMobileSidebar() {
|
|
297
|
-
const sidebar = document.getElementById('mobile-sidebar');
|
|
298
|
-
const overlay = document.getElementById('mobile-sidebar-overlay');
|
|
299
|
-
sidebar.classList.remove('-translate-x-full');
|
|
300
|
-
overlay.classList.remove('hidden');
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
function closeMobileSidebar() {
|
|
304
|
-
const sidebar = document.getElementById('mobile-sidebar');
|
|
305
|
-
const overlay = document.getElementById('mobile-sidebar-overlay');
|
|
306
|
-
sidebar.classList.add('-translate-x-full');
|
|
307
|
-
overlay.classList.add('hidden');
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
// User dropdown toggle
|
|
311
|
-
function toggleUserDropdown() {
|
|
312
|
-
const dropdown = document.getElementById('userDropdown');
|
|
313
|
-
dropdown.classList.toggle('hidden');
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// Close dropdown when clicking outside
|
|
317
|
-
document.addEventListener('click', function(event) {
|
|
318
|
-
const dropdown = document.getElementById('userDropdown');
|
|
319
|
-
const button = event.target.closest('[data-user-menu]');
|
|
320
|
-
if (!button && dropdown && !dropdown.contains(event.target)) {
|
|
321
|
-
dropdown.classList.add('hidden');
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
// Show notification
|
|
326
|
-
function showNotification(message, type = 'info') {
|
|
327
|
-
const container = document.getElementById('notification-container');
|
|
328
|
-
const notification = document.createElement('div');
|
|
329
|
-
const colors = {
|
|
330
|
-
success: 'bg-green-50 dark:bg-green-500/10 text-green-700 dark:text-green-400 ring-green-600/20 dark:ring-green-500/20',
|
|
331
|
-
error: 'bg-red-50 dark:bg-red-500/10 text-red-700 dark:text-red-400 ring-red-600/20 dark:ring-red-500/20',
|
|
332
|
-
warning: 'bg-amber-50 dark:bg-amber-500/10 text-amber-700 dark:text-amber-400 ring-amber-600/20 dark:ring-amber-500/20',
|
|
333
|
-
info: 'bg-blue-50 dark:bg-blue-500/10 text-blue-700 dark:text-blue-400 ring-blue-600/20 dark:ring-blue-500/20'
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
notification.className = \`rounded-lg p-4 ring-1 \${colors[type] || colors.info} max-w-sm shadow-lg\`;
|
|
337
|
-
notification.innerHTML = \`
|
|
338
|
-
<div class="flex items-center justify-between">
|
|
339
|
-
<span class="text-sm">\${message}</span>
|
|
340
|
-
<button onclick="this.parentElement.parentElement.remove()" class="ml-4 hover:opacity-70">
|
|
341
|
-
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
342
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
|
343
|
-
</svg>
|
|
344
|
-
</button>
|
|
345
|
-
</div>
|
|
346
|
-
\`;
|
|
347
|
-
|
|
348
|
-
container.appendChild(notification);
|
|
349
|
-
|
|
350
|
-
// Auto remove after 5 seconds
|
|
351
|
-
setTimeout(() => {
|
|
352
|
-
if (notification.parentElement) {
|
|
353
|
-
notification.remove();
|
|
354
|
-
}
|
|
355
|
-
}, 5000);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
// Initialize dark mode
|
|
359
|
-
if (localStorage.getItem('darkMode') === 'false') {
|
|
360
|
-
document.documentElement.classList.remove('dark');
|
|
361
|
-
}
|
|
362
|
-
</script>
|
|
363
|
-
</body>
|
|
364
|
-
</html>`;
|
|
365
|
-
}
|
|
366
|
-
function renderCatalystSidebar(currentPath = "", user, dynamicMenuItems, isMobile = false, version, enableExperimentalFeatures) {
|
|
367
|
-
let baseMenuItems = [
|
|
368
|
-
{
|
|
369
|
-
label: "Dashboard",
|
|
370
|
-
path: "/admin",
|
|
371
|
-
icon: `<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
|
372
|
-
<path d="M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"/>
|
|
373
|
-
</svg>`
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
label: "Collections",
|
|
377
|
-
path: "/admin/collections",
|
|
378
|
-
icon: `<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
|
379
|
-
<path d="M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z"/>
|
|
380
|
-
</svg>`
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
label: "Content",
|
|
384
|
-
path: "/admin/content",
|
|
385
|
-
icon: `<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
|
386
|
-
<path fill-rule="evenodd" d="M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z" clip-rule="evenodd"/>
|
|
387
|
-
</svg>`
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
label: "Media",
|
|
391
|
-
path: "/admin/media",
|
|
392
|
-
icon: `<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
|
393
|
-
<path fill-rule="evenodd" d="M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z" clip-rule="evenodd"/>
|
|
394
|
-
</svg>`
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
label: "Users",
|
|
398
|
-
path: "/admin/users",
|
|
399
|
-
icon: `<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
|
400
|
-
<path d="M9 6a3 3 0 11-6 0 3 3 0 016 0zM17 6a3 3 0 11-6 0 3 3 0 016 0zM12.93 17c.046-.327.07-.66.07-1a6.97 6.97 0 00-1.5-4.33A5 5 0 0119 16v1h-6.07zM6 11a5 5 0 015 5v1H1v-1a5 5 0 015-5z"/>
|
|
401
|
-
</svg>`
|
|
402
|
-
}
|
|
403
|
-
];
|
|
404
|
-
if (enableExperimentalFeatures) {
|
|
405
|
-
baseMenuItems.push({
|
|
406
|
-
label: "Plugins",
|
|
407
|
-
path: "/admin/plugins",
|
|
408
|
-
icon: `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
409
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/>
|
|
410
|
-
</svg>`
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
const settingsMenuItem = {
|
|
414
|
-
label: "Settings",
|
|
415
|
-
path: "/admin/settings",
|
|
416
|
-
icon: `<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20">
|
|
417
|
-
<path fill-rule="evenodd" d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z" clip-rule="evenodd"/>
|
|
418
|
-
</svg>`
|
|
419
|
-
};
|
|
420
|
-
const allMenuItems = [...baseMenuItems];
|
|
421
|
-
if (dynamicMenuItems && dynamicMenuItems.length > 0) {
|
|
422
|
-
const usersIndex = allMenuItems.findIndex(
|
|
423
|
-
(item) => item.path === "/admin/users"
|
|
424
|
-
);
|
|
425
|
-
if (usersIndex !== -1) {
|
|
426
|
-
allMenuItems.splice(usersIndex + 1, 0, ...dynamicMenuItems);
|
|
427
|
-
} else {
|
|
428
|
-
allMenuItems.push(...dynamicMenuItems);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
const closeButton = isMobile ? `
|
|
432
|
-
<div class="-mb-3 px-4 pt-3">
|
|
433
|
-
<button onclick="closeMobileSidebar()" class="relative flex w-full items-center gap-3 rounded-lg p-2 text-left text-base/6 font-medium text-zinc-950 hover:bg-zinc-950/5 dark:text-white dark:hover:bg-white/5 sm:text-sm/5" aria-label="Close navigation">
|
|
434
|
-
<svg class="h-5 w-5 shrink-0 fill-zinc-500 dark:fill-zinc-400" viewBox="0 0 20 20">
|
|
435
|
-
<path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" />
|
|
436
|
-
</svg>
|
|
437
|
-
<span>Close menu</span>
|
|
438
|
-
</button>
|
|
439
|
-
</div>
|
|
440
|
-
` : "";
|
|
441
|
-
return `
|
|
442
|
-
<nav class="flex h-full min-h-0 flex-col bg-white shadow-sm ring-1 ring-zinc-950/5 dark:bg-zinc-900 dark:ring-white/10 ${isMobile ? "rounded-lg p-2 m-2" : ""}">
|
|
443
|
-
${closeButton}
|
|
444
|
-
|
|
445
|
-
<!-- Sidebar Header -->
|
|
446
|
-
<div class="flex flex-col border-b border-zinc-950/5 p-4 dark:border-white/5">
|
|
447
|
-
${renderLogo({ size: "md", showText: true, variant: "white", version, href: "/admin" })}
|
|
448
|
-
</div>
|
|
449
|
-
|
|
450
|
-
<!-- Sidebar Body -->
|
|
451
|
-
<div class="flex flex-1 flex-col overflow-y-auto p-4">
|
|
452
|
-
<div class="flex flex-col gap-0.5">
|
|
453
|
-
${allMenuItems.map((item) => {
|
|
454
|
-
const isActive = currentPath === item.path || item.path !== "/admin" && currentPath?.startsWith(item.path);
|
|
455
|
-
return `
|
|
456
|
-
<span class="relative">
|
|
457
|
-
${isActive ? `
|
|
458
|
-
<span class="absolute inset-y-2 -left-4 w-0.5 rounded-full bg-cyan-500 dark:bg-cyan-400"></span>
|
|
459
|
-
` : ""}
|
|
460
|
-
<a
|
|
461
|
-
href="${item.path}"
|
|
462
|
-
class="flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left text-sm/5 font-medium ${isActive ? "text-zinc-950 dark:text-white" : "text-zinc-950 hover:bg-zinc-950/5 dark:text-white dark:hover:bg-white/5"}"
|
|
463
|
-
${isActive ? 'data-current="true"' : ""}
|
|
464
|
-
>
|
|
465
|
-
<span class="shrink-0 ${isActive ? "fill-zinc-950 dark:fill-white" : "fill-zinc-500 dark:fill-zinc-400"}">
|
|
466
|
-
${item.icon}
|
|
467
|
-
</span>
|
|
468
|
-
<span class="truncate">${item.label}</span>
|
|
469
|
-
</a>
|
|
470
|
-
</span>
|
|
471
|
-
`;
|
|
472
|
-
}).join("")}
|
|
473
|
-
</div>
|
|
474
|
-
</div>
|
|
475
|
-
|
|
476
|
-
<!-- Settings Menu Item (Bottom) -->
|
|
477
|
-
<div class="border-t border-zinc-950/5 p-4 dark:border-white/5">
|
|
478
|
-
${(() => {
|
|
479
|
-
const isActive = currentPath === settingsMenuItem.path || currentPath?.startsWith(settingsMenuItem.path);
|
|
480
|
-
return `
|
|
481
|
-
<span class="relative">
|
|
482
|
-
${isActive ? `
|
|
483
|
-
<span class="absolute inset-y-2 -left-4 w-0.5 rounded-full bg-cyan-500 dark:bg-cyan-400"></span>
|
|
484
|
-
` : ""}
|
|
485
|
-
<a
|
|
486
|
-
href="${settingsMenuItem.path}"
|
|
487
|
-
class="flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left text-sm/5 font-medium ${isActive ? "text-zinc-950 dark:text-white" : "text-zinc-950 hover:bg-zinc-950/5 dark:text-white dark:hover:bg-white/5"}"
|
|
488
|
-
${isActive ? 'data-current="true"' : ""}
|
|
489
|
-
>
|
|
490
|
-
<span class="shrink-0 ${isActive ? "fill-zinc-950 dark:fill-white" : "fill-zinc-500 dark:fill-zinc-400"}">
|
|
491
|
-
${settingsMenuItem.icon}
|
|
492
|
-
</span>
|
|
493
|
-
<span class="truncate">${settingsMenuItem.label}</span>
|
|
494
|
-
</a>
|
|
495
|
-
</span>
|
|
496
|
-
`;
|
|
497
|
-
})()}
|
|
498
|
-
</div>
|
|
499
|
-
|
|
500
|
-
<!-- Sidebar Footer (User) -->
|
|
501
|
-
${user ? `
|
|
502
|
-
<div class="flex flex-col border-t border-zinc-950/5 p-4 dark:border-white/5">
|
|
503
|
-
<div class="relative">
|
|
504
|
-
<button
|
|
505
|
-
data-user-menu
|
|
506
|
-
onclick="toggleUserDropdown()"
|
|
507
|
-
class="flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left text-sm/5 font-medium text-zinc-950 hover:bg-zinc-950/5 dark:text-white dark:hover:bg-white/5"
|
|
508
|
-
>
|
|
509
|
-
<div class="flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-zinc-950 text-white dark:bg-white dark:text-zinc-950">
|
|
510
|
-
<span class="text-xs font-semibold">${(user.name || user.email || "U").charAt(0).toUpperCase()}</span>
|
|
511
|
-
</div>
|
|
512
|
-
<span class="flex-1 truncate">${user.name || user.email || "User"}</span>
|
|
513
|
-
<svg class="h-4 w-4 shrink-0 fill-zinc-500 dark:fill-zinc-400" viewBox="0 0 20 20">
|
|
514
|
-
<path d="M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z" />
|
|
515
|
-
</svg>
|
|
516
|
-
</button>
|
|
517
|
-
|
|
518
|
-
<!-- User Dropdown -->
|
|
519
|
-
<div id="userDropdown" class="hidden absolute bottom-full mb-2 left-0 right-0 mx-2 rounded-xl bg-white shadow-lg ring-1 ring-zinc-950/10 dark:bg-zinc-800 dark:ring-white/10 z-50">
|
|
520
|
-
<div class="p-2">
|
|
521
|
-
<div class="px-3 py-2 border-b border-zinc-950/5 dark:border-white/5">
|
|
522
|
-
<p class="text-sm font-medium text-zinc-950 dark:text-white">${user.name || user.email || "User"}</p>
|
|
523
|
-
<p class="text-xs text-zinc-500 dark:text-zinc-400">${user.email || ""}</p>
|
|
524
|
-
</div>
|
|
525
|
-
<a href="/admin/profile" class="flex items-center gap-2 rounded-lg px-3 py-2 text-sm text-zinc-950 hover:bg-zinc-950/5 dark:text-white dark:hover:bg-white/5">
|
|
526
|
-
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
527
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
|
|
528
|
-
</svg>
|
|
529
|
-
My Profile
|
|
530
|
-
</a>
|
|
531
|
-
<a href="/admin/settings" class="flex items-center gap-2 rounded-lg px-3 py-2 text-sm text-zinc-950 hover:bg-zinc-950/5 dark:text-white dark:hover:bg-white/5">
|
|
532
|
-
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
533
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
|
|
534
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
|
|
535
|
-
</svg>
|
|
536
|
-
Settings
|
|
537
|
-
</a>
|
|
538
|
-
<a href="/auth/logout" class="flex items-center gap-2 rounded-lg px-3 py-2 text-sm text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-500/10">
|
|
539
|
-
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
540
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"/>
|
|
541
|
-
</svg>
|
|
542
|
-
Sign Out
|
|
543
|
-
</a>
|
|
544
|
-
</div>
|
|
545
|
-
</div>
|
|
546
|
-
</div>
|
|
547
|
-
</div>
|
|
548
|
-
` : ""}
|
|
549
|
-
</nav>
|
|
550
|
-
`;
|
|
551
|
-
}
|
|
552
|
-
var init_admin_layout_catalyst_template = chunkIGJUBJBW_cjs.__esm({
|
|
553
|
-
"src/templates/layouts/admin-layout-catalyst.template.ts"() {
|
|
554
|
-
init_logo_template();
|
|
555
|
-
}
|
|
556
|
-
});
|
|
557
|
-
|
|
558
15
|
// src/schemas/index.ts
|
|
559
16
|
var schemaDefinitions = [];
|
|
560
17
|
var apiContentCrudRoutes = new hono.Hono();
|
|
@@ -1115,10 +572,11 @@ apiMediaRoutes.post("/upload", async (c) => {
|
|
|
1115
572
|
try {
|
|
1116
573
|
const user = c.get("user");
|
|
1117
574
|
const formData = await c.req.formData();
|
|
1118
|
-
const
|
|
1119
|
-
if (!
|
|
575
|
+
const fileData = formData.get("file");
|
|
576
|
+
if (!fileData || typeof fileData === "string") {
|
|
1120
577
|
return c.json({ error: "No file provided" }, 400);
|
|
1121
578
|
}
|
|
579
|
+
const file = fileData;
|
|
1122
580
|
const validation = fileValidationSchema.safeParse({
|
|
1123
581
|
name: file.name,
|
|
1124
582
|
type: file.type,
|
|
@@ -1229,7 +687,13 @@ apiMediaRoutes.post("/upload-multiple", async (c) => {
|
|
|
1229
687
|
try {
|
|
1230
688
|
const user = c.get("user");
|
|
1231
689
|
const formData = await c.req.formData();
|
|
1232
|
-
const
|
|
690
|
+
const filesData = formData.getAll("files");
|
|
691
|
+
const files = [];
|
|
692
|
+
for (const f of filesData) {
|
|
693
|
+
if (typeof f !== "string") {
|
|
694
|
+
files.push(f);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
1233
697
|
if (!files || files.length === 0) {
|
|
1234
698
|
return c.json({ error: "No files provided" }, 400);
|
|
1235
699
|
}
|
|
@@ -1440,7 +904,6 @@ apiMediaRoutes.post("/bulk-delete", async (c) => {
|
|
|
1440
904
|
});
|
|
1441
905
|
apiMediaRoutes.post("/create-folder", async (c) => {
|
|
1442
906
|
try {
|
|
1443
|
-
const user = c.get("user");
|
|
1444
907
|
const body = await c.req.json();
|
|
1445
908
|
const folderName = body.folderName;
|
|
1446
909
|
if (!folderName || typeof folderName !== "string") {
|
|
@@ -3762,7 +3225,7 @@ authRoutes.post("/reset-password", async (c) => {
|
|
|
3762
3225
|
var auth_default = authRoutes;
|
|
3763
3226
|
|
|
3764
3227
|
// src/templates/pages/admin-content-form.template.ts
|
|
3765
|
-
init_admin_layout_catalyst_template();
|
|
3228
|
+
chunkLEGKJ5DI_cjs.init_admin_layout_catalyst_template();
|
|
3766
3229
|
|
|
3767
3230
|
// src/templates/components/dynamic-field.template.ts
|
|
3768
3231
|
function renderDynamicField(field, options = {}) {
|
|
@@ -4786,16 +4249,17 @@ function renderContentFormPage(data) {
|
|
|
4786
4249
|
`;
|
|
4787
4250
|
const layoutData = {
|
|
4788
4251
|
title,
|
|
4252
|
+
pageTitle: "Content Management",
|
|
4789
4253
|
currentPath: "/admin/content",
|
|
4790
4254
|
user: data.user,
|
|
4791
4255
|
content: pageContent,
|
|
4792
4256
|
version: data.version
|
|
4793
4257
|
};
|
|
4794
|
-
return renderAdminLayoutCatalyst(layoutData);
|
|
4258
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayoutCatalyst(layoutData);
|
|
4795
4259
|
}
|
|
4796
4260
|
|
|
4797
4261
|
// src/templates/pages/admin-content-list.template.ts
|
|
4798
|
-
init_admin_layout_catalyst_template();
|
|
4262
|
+
chunkLEGKJ5DI_cjs.init_admin_layout_catalyst_template();
|
|
4799
4263
|
|
|
4800
4264
|
// src/templates/components/table.template.ts
|
|
4801
4265
|
function renderTable(data) {
|
|
@@ -5793,12 +5257,13 @@ function renderContentListPage(data) {
|
|
|
5793
5257
|
`;
|
|
5794
5258
|
const layoutData = {
|
|
5795
5259
|
title: "Content Management",
|
|
5260
|
+
pageTitle: "Content Management",
|
|
5796
5261
|
currentPath: "/admin/content",
|
|
5797
5262
|
user: data.user,
|
|
5798
5263
|
version: data.version,
|
|
5799
5264
|
content: pageContent
|
|
5800
5265
|
};
|
|
5801
|
-
return renderAdminLayoutCatalyst(layoutData);
|
|
5266
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayoutCatalyst(layoutData);
|
|
5802
5267
|
}
|
|
5803
5268
|
|
|
5804
5269
|
// src/templates/components/version-history.template.ts
|
|
@@ -7112,795 +6577,6 @@ ${JSON.stringify(data, null, 2)}
|
|
|
7112
6577
|
});
|
|
7113
6578
|
var admin_content_default = adminContentRoutes;
|
|
7114
6579
|
|
|
7115
|
-
// src/templates/layouts/admin-layout-v2.template.ts
|
|
7116
|
-
init_logo_template();
|
|
7117
|
-
function renderAdminLayout(data) {
|
|
7118
|
-
const { renderAdminLayoutCatalyst: renderAdminLayoutCatalyst2 } = (init_admin_layout_catalyst_template(), chunkIGJUBJBW_cjs.__toCommonJS(admin_layout_catalyst_template_exports));
|
|
7119
|
-
return renderAdminLayoutCatalyst2(data);
|
|
7120
|
-
}
|
|
7121
|
-
function adminLayoutV2(data) {
|
|
7122
|
-
return `<!DOCTYPE html>
|
|
7123
|
-
<html lang="en" class="dark">
|
|
7124
|
-
<head>
|
|
7125
|
-
<meta charset="UTF-8">
|
|
7126
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7127
|
-
<title>${data.title} - SonicJS AI Admin</title>
|
|
7128
|
-
<link rel="icon" type="image/x-icon" href="https://demo.sonicjs.com/images/favicon.ico">
|
|
7129
|
-
|
|
7130
|
-
<!-- Tailwind CSS -->
|
|
7131
|
-
<script src="https://cdn.tailwindcss.com"></script>
|
|
7132
|
-
<script>
|
|
7133
|
-
tailwind.config = {
|
|
7134
|
-
darkMode: 'class',
|
|
7135
|
-
theme: {
|
|
7136
|
-
extend: {
|
|
7137
|
-
backdropBlur: {
|
|
7138
|
-
xs: '2px',
|
|
7139
|
-
},
|
|
7140
|
-
colors: {
|
|
7141
|
-
primary: '#465FFF',
|
|
7142
|
-
secondary: '#212A3E',
|
|
7143
|
-
dark: '#1C1C24',
|
|
7144
|
-
'dark-2': '#1A1A27',
|
|
7145
|
-
'dark-3': '#2C2C54',
|
|
7146
|
-
'dark-4': '#40407A',
|
|
7147
|
-
'dark-5': '#706FD3',
|
|
7148
|
-
'gray-1': '#F7F9FC',
|
|
7149
|
-
'gray-2': '#E4E6EA',
|
|
7150
|
-
'gray-3': '#D2D4D9',
|
|
7151
|
-
'gray-4': '#9CA3AF',
|
|
7152
|
-
'gray-5': '#6B7280',
|
|
7153
|
-
'gray-6': '#4B5563',
|
|
7154
|
-
'gray-7': '#374151',
|
|
7155
|
-
'gray-8': '#1F2937',
|
|
7156
|
-
'gray-9': '#111827',
|
|
7157
|
-
success: '#10B981',
|
|
7158
|
-
warning: '#F59E0B',
|
|
7159
|
-
error: '#EF4444',
|
|
7160
|
-
info: '#3B82F6'
|
|
7161
|
-
},
|
|
7162
|
-
fontFamily: {
|
|
7163
|
-
satoshi: ['Satoshi', 'sans-serif'],
|
|
7164
|
-
},
|
|
7165
|
-
spacing: {
|
|
7166
|
-
'4.5': '1.125rem',
|
|
7167
|
-
'5.5': '1.375rem',
|
|
7168
|
-
'6.5': '1.625rem',
|
|
7169
|
-
'7.5': '1.875rem'
|
|
7170
|
-
},
|
|
7171
|
-
boxShadow: {
|
|
7172
|
-
'default': '0px 8px 13px -3px rgba(0, 0, 0, 0.07)',
|
|
7173
|
-
'card': '0px 1px 3px rgba(0, 0, 0, 0.12)',
|
|
7174
|
-
'card-2': '0px 1px 2px rgba(0, 0, 0, 0.05)',
|
|
7175
|
-
'switcher': '0px 2px 4px rgba(0, 0, 0, 0.2), inset 0px 2px 2px #FFFFFF, inset 0px -1px 1px rgba(0, 0, 0, 0.1)',
|
|
7176
|
-
},
|
|
7177
|
-
dropShadow: {
|
|
7178
|
-
1: '0px 1px 0px #E2E8F0',
|
|
7179
|
-
2: '0px 1px 4px rgba(0, 0, 0, 0.12)',
|
|
7180
|
-
}
|
|
7181
|
-
}
|
|
7182
|
-
}
|
|
7183
|
-
}
|
|
7184
|
-
</script>
|
|
7185
|
-
|
|
7186
|
-
<!-- Additional Styles -->
|
|
7187
|
-
<style>
|
|
7188
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
|
7189
|
-
|
|
7190
|
-
* {
|
|
7191
|
-
margin: 0;
|
|
7192
|
-
padding: 0;
|
|
7193
|
-
box-sizing: border-box;
|
|
7194
|
-
}
|
|
7195
|
-
|
|
7196
|
-
body {
|
|
7197
|
-
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
|
7198
|
-
}
|
|
7199
|
-
|
|
7200
|
-
/* Custom scrollbar */
|
|
7201
|
-
::-webkit-scrollbar {
|
|
7202
|
-
width: 6px;
|
|
7203
|
-
}
|
|
7204
|
-
|
|
7205
|
-
::-webkit-scrollbar-track {
|
|
7206
|
-
background: #1F2937;
|
|
7207
|
-
}
|
|
7208
|
-
|
|
7209
|
-
::-webkit-scrollbar-thumb {
|
|
7210
|
-
background: #465FFF;
|
|
7211
|
-
border-radius: 3px;
|
|
7212
|
-
}
|
|
7213
|
-
|
|
7214
|
-
::-webkit-scrollbar-thumb:hover {
|
|
7215
|
-
background: #3B4EE8;
|
|
7216
|
-
}
|
|
7217
|
-
|
|
7218
|
-
/* Sidebar animations */
|
|
7219
|
-
.sidebar-item {
|
|
7220
|
-
transition: all 0.3s ease;
|
|
7221
|
-
}
|
|
7222
|
-
|
|
7223
|
-
.sidebar-item:hover {
|
|
7224
|
-
transform: translateX(4px);
|
|
7225
|
-
}
|
|
7226
|
-
|
|
7227
|
-
/* Card animations */
|
|
7228
|
-
.card-hover {
|
|
7229
|
-
transition: all 0.3s ease;
|
|
7230
|
-
}
|
|
7231
|
-
|
|
7232
|
-
.card-hover:hover {
|
|
7233
|
-
transform: translateY(-2px);
|
|
7234
|
-
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
7235
|
-
}
|
|
7236
|
-
|
|
7237
|
-
/* Button gradients */
|
|
7238
|
-
.btn-gradient {
|
|
7239
|
-
background: linear-gradient(135deg, #465FFF 0%, #9333EA 100%);
|
|
7240
|
-
}
|
|
7241
|
-
|
|
7242
|
-
.btn-gradient:hover {
|
|
7243
|
-
background: linear-gradient(135deg, #3B4EE8 0%, #7C2D12 100%);
|
|
7244
|
-
}
|
|
7245
|
-
|
|
7246
|
-
/* Dark mode form elements */
|
|
7247
|
-
.form-input {
|
|
7248
|
-
background-color: #1F2937;
|
|
7249
|
-
border-color: #374151;
|
|
7250
|
-
color: #F9FAFB;
|
|
7251
|
-
}
|
|
7252
|
-
|
|
7253
|
-
.form-input:focus {
|
|
7254
|
-
border-color: #465FFF;
|
|
7255
|
-
box-shadow: 0 0 0 3px rgba(70, 95, 255, 0.1);
|
|
7256
|
-
}
|
|
7257
|
-
|
|
7258
|
-
/* Notification styles */
|
|
7259
|
-
.notification {
|
|
7260
|
-
animation: slideInRight 0.3s ease-out;
|
|
7261
|
-
}
|
|
7262
|
-
|
|
7263
|
-
@keyframes slideInRight {
|
|
7264
|
-
from {
|
|
7265
|
-
transform: translateX(100%);
|
|
7266
|
-
opacity: 0;
|
|
7267
|
-
}
|
|
7268
|
-
to {
|
|
7269
|
-
transform: translateX(0);
|
|
7270
|
-
opacity: 1;
|
|
7271
|
-
}
|
|
7272
|
-
}
|
|
7273
|
-
|
|
7274
|
-
/* Custom slider styles */
|
|
7275
|
-
.slider::-webkit-slider-thumb {
|
|
7276
|
-
appearance: none;
|
|
7277
|
-
height: 16px;
|
|
7278
|
-
width: 16px;
|
|
7279
|
-
border-radius: 50%;
|
|
7280
|
-
background: #465FFF;
|
|
7281
|
-
cursor: pointer;
|
|
7282
|
-
border: 2px solid white;
|
|
7283
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
7284
|
-
}
|
|
7285
|
-
|
|
7286
|
-
.slider::-moz-range-thumb {
|
|
7287
|
-
height: 16px;
|
|
7288
|
-
width: 16px;
|
|
7289
|
-
border-radius: 50%;
|
|
7290
|
-
background: #465FFF;
|
|
7291
|
-
cursor: pointer;
|
|
7292
|
-
border: 2px solid white;
|
|
7293
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
7294
|
-
}
|
|
7295
|
-
|
|
7296
|
-
.slider::-webkit-slider-track {
|
|
7297
|
-
height: 8px;
|
|
7298
|
-
border-radius: 4px;
|
|
7299
|
-
background: rgba(255, 255, 255, 0.2);
|
|
7300
|
-
}
|
|
7301
|
-
|
|
7302
|
-
.slider::-moz-range-track {
|
|
7303
|
-
height: 8px;
|
|
7304
|
-
border-radius: 4px;
|
|
7305
|
-
background: rgba(255, 255, 255, 0.2);
|
|
7306
|
-
border: none;
|
|
7307
|
-
}
|
|
7308
|
-
|
|
7309
|
-
/* PNG Background Images */
|
|
7310
|
-
.svg-pattern-blue-waves {
|
|
7311
|
-
background-color: #111827;
|
|
7312
|
-
background-image: url('/images/backgrounds/blue-waves.png');
|
|
7313
|
-
background-size: cover;
|
|
7314
|
-
background-position: center;
|
|
7315
|
-
background-repeat: no-repeat;
|
|
7316
|
-
}
|
|
7317
|
-
|
|
7318
|
-
.svg-pattern-blue-crescent {
|
|
7319
|
-
background-color: #111827;
|
|
7320
|
-
background-image: url('/images/backgrounds/blue-crescent.png');
|
|
7321
|
-
background-size: cover;
|
|
7322
|
-
background-position: center;
|
|
7323
|
-
background-repeat: no-repeat;
|
|
7324
|
-
}
|
|
7325
|
-
|
|
7326
|
-
.svg-pattern-blue-stars {
|
|
7327
|
-
background-color: #111827;
|
|
7328
|
-
background-image: url('/images/backgrounds/blue-stars.png');
|
|
7329
|
-
background-size: cover;
|
|
7330
|
-
background-position: center;
|
|
7331
|
-
background-repeat: no-repeat;
|
|
7332
|
-
}
|
|
7333
|
-
|
|
7334
|
-
.svg-pattern-blue-waves-3d {
|
|
7335
|
-
background-color: #111827;
|
|
7336
|
-
background-image: url('/images/backgrounds/blue-waves-3d.png');
|
|
7337
|
-
background-size: cover;
|
|
7338
|
-
background-position: center;
|
|
7339
|
-
background-repeat: no-repeat;
|
|
7340
|
-
}
|
|
7341
|
-
</style>
|
|
7342
|
-
|
|
7343
|
-
<!-- Scripts -->
|
|
7344
|
-
<script src="https://unpkg.com/htmx.org@2.0.3"></script>
|
|
7345
|
-
<script src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
|
|
7346
|
-
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
|
|
7347
|
-
|
|
7348
|
-
${data.styles ? data.styles.map((style) => `<link rel="stylesheet" href="${style}">`).join("\n ") : ""}
|
|
7349
|
-
${data.scripts ? data.scripts.map((script) => `<script src="${script}"></script>`).join("\n ") : ""}
|
|
7350
|
-
</head>
|
|
7351
|
-
<body class="bg-gradient-to-br from-slate-900 via-gray-900 to-black min-h-screen text-gray-1">
|
|
7352
|
-
<!-- Background overlay with glass effect -->
|
|
7353
|
-
<div id="background-overlay" class="fixed inset-0 backdrop-blur-sm" style="background-color: rgba(0, 0, 0, 0.2);"></div>
|
|
7354
|
-
<!-- Main container -->
|
|
7355
|
-
<div class="relative z-10 min-h-screen">
|
|
7356
|
-
<!-- Header -->
|
|
7357
|
-
${renderTopBar(data.pageTitle || "Dashboard", data.user)}
|
|
7358
|
-
|
|
7359
|
-
<!-- Main content area -->
|
|
7360
|
-
<div class="px-4 sm:px-6 lg:px-8 py-8">
|
|
7361
|
-
<div class="grid grid-cols-1 lg:grid-cols-5 gap-6">
|
|
7362
|
-
<!-- Sidebar -->
|
|
7363
|
-
<div class="lg:col-span-1">
|
|
7364
|
-
${renderSidebar(data.currentPath || "/", data.user, data.dynamicMenuItems)}
|
|
7365
|
-
</div>
|
|
7366
|
-
|
|
7367
|
-
<!-- Main content -->
|
|
7368
|
-
<div class="lg:col-span-4">
|
|
7369
|
-
${data.content}
|
|
7370
|
-
</div>
|
|
7371
|
-
</div>
|
|
7372
|
-
</div>
|
|
7373
|
-
</div>
|
|
7374
|
-
|
|
7375
|
-
<!-- Notification Container -->
|
|
7376
|
-
<div id="notification-container" class="fixed top-4 right-4 z-50 space-y-2"></div>
|
|
7377
|
-
|
|
7378
|
-
<script>
|
|
7379
|
-
// Dark mode toggle functionality
|
|
7380
|
-
function toggleDarkMode() {
|
|
7381
|
-
document.documentElement.classList.toggle('dark');
|
|
7382
|
-
localStorage.setItem('darkMode', document.documentElement.classList.contains('dark'));
|
|
7383
|
-
}
|
|
7384
|
-
|
|
7385
|
-
// Initialize dark mode from localStorage
|
|
7386
|
-
if (localStorage.getItem('darkMode') === 'true' || (!('darkMode' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
7387
|
-
document.documentElement.classList.add('dark');
|
|
7388
|
-
}
|
|
7389
|
-
|
|
7390
|
-
// Sidebar toggle for mobile
|
|
7391
|
-
function toggleSidebar() {
|
|
7392
|
-
const sidebar = document.getElementById('sidebar');
|
|
7393
|
-
const overlay = document.getElementById('sidebar-overlay');
|
|
7394
|
-
sidebar.classList.toggle('-translate-x-full');
|
|
7395
|
-
overlay.classList.toggle('hidden');
|
|
7396
|
-
}
|
|
7397
|
-
|
|
7398
|
-
// Close sidebar on overlay click
|
|
7399
|
-
function closeSidebar() {
|
|
7400
|
-
const sidebar = document.getElementById('sidebar');
|
|
7401
|
-
const overlay = document.getElementById('sidebar-overlay');
|
|
7402
|
-
sidebar.classList.add('-translate-x-full');
|
|
7403
|
-
overlay.classList.add('hidden');
|
|
7404
|
-
}
|
|
7405
|
-
|
|
7406
|
-
// User dropdown toggle
|
|
7407
|
-
function toggleUserDropdown() {
|
|
7408
|
-
const dropdown = document.getElementById('userDropdown');
|
|
7409
|
-
dropdown.classList.toggle('hidden');
|
|
7410
|
-
}
|
|
7411
|
-
|
|
7412
|
-
// Close dropdown when clicking outside
|
|
7413
|
-
document.addEventListener('click', function(event) {
|
|
7414
|
-
const dropdown = document.getElementById('userDropdown');
|
|
7415
|
-
const button = event.target.closest('button');
|
|
7416
|
-
if (!button || !button.getAttribute('onclick')) {
|
|
7417
|
-
dropdown.classList.add('hidden');
|
|
7418
|
-
}
|
|
7419
|
-
});
|
|
7420
|
-
|
|
7421
|
-
// Show notification
|
|
7422
|
-
function showNotification(message, type = 'info') {
|
|
7423
|
-
const container = document.getElementById('notification-container');
|
|
7424
|
-
const notification = document.createElement('div');
|
|
7425
|
-
const colors = {
|
|
7426
|
-
success: 'bg-success text-white',
|
|
7427
|
-
error: 'bg-error text-white',
|
|
7428
|
-
warning: 'bg-warning text-white',
|
|
7429
|
-
info: 'bg-info text-white'
|
|
7430
|
-
};
|
|
7431
|
-
|
|
7432
|
-
notification.className = \`notification px-6 py-4 rounded-lg shadow-lg \${colors[type] || colors.info} max-w-sm\`;
|
|
7433
|
-
notification.innerHTML = \`
|
|
7434
|
-
<div class="flex items-center justify-between">
|
|
7435
|
-
<span>\${message}</span>
|
|
7436
|
-
<button onclick="this.parentElement.parentElement.remove()" class="ml-4 text-white/80 hover:text-white">
|
|
7437
|
-
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7438
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
|
7439
|
-
</svg>
|
|
7440
|
-
</button>
|
|
7441
|
-
</div>
|
|
7442
|
-
\`;
|
|
7443
|
-
|
|
7444
|
-
container.appendChild(notification);
|
|
7445
|
-
|
|
7446
|
-
// Auto remove after 5 seconds
|
|
7447
|
-
setTimeout(() => {
|
|
7448
|
-
if (notification.parentElement) {
|
|
7449
|
-
notification.remove();
|
|
7450
|
-
}
|
|
7451
|
-
}, 5000);
|
|
7452
|
-
}
|
|
7453
|
-
|
|
7454
|
-
// Background customizer functionality
|
|
7455
|
-
function toggleBackgroundCustomizer() {
|
|
7456
|
-
const dropdown = document.getElementById('backgroundCustomizer');
|
|
7457
|
-
dropdown.classList.toggle('hidden');
|
|
7458
|
-
}
|
|
7459
|
-
|
|
7460
|
-
// Background themes
|
|
7461
|
-
const backgroundThemes = {
|
|
7462
|
-
'default': 'bg-gradient-to-br from-slate-900 via-gray-900 to-black',
|
|
7463
|
-
'cosmic-blue': 'bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900',
|
|
7464
|
-
'matrix-green': 'bg-gradient-to-br from-gray-900 via-emerald-900 to-green-900',
|
|
7465
|
-
'cyber-pink': 'bg-gradient-to-br from-gray-900 via-pink-900 to-rose-900',
|
|
7466
|
-
'neon-orange': 'bg-gradient-to-br from-gray-900 via-orange-900 to-amber-900',
|
|
7467
|
-
'purple-space': 'bg-gradient-to-br from-gray-900 via-purple-900 to-violet-800',
|
|
7468
|
-
'blue-waves': 'svg-pattern-blue-waves',
|
|
7469
|
-
'blue-crescent': 'svg-pattern-blue-crescent',
|
|
7470
|
-
'blue-stars': 'svg-pattern-blue-stars',
|
|
7471
|
-
'blue-waves-3d': 'svg-pattern-blue-waves-3d'
|
|
7472
|
-
};
|
|
7473
|
-
|
|
7474
|
-
// Set background theme
|
|
7475
|
-
function setBackground(theme) {
|
|
7476
|
-
const body = document.body;
|
|
7477
|
-
|
|
7478
|
-
// Remove all existing background classes and SVG patterns
|
|
7479
|
-
Object.values(backgroundThemes).forEach(bgClass => {
|
|
7480
|
-
if (bgClass.startsWith('svg-pattern-')) {
|
|
7481
|
-
body.classList.remove(bgClass);
|
|
7482
|
-
} else {
|
|
7483
|
-
body.classList.remove(...bgClass.split(' ').slice(1)); // Remove 'bg-gradient-to-br' prefix
|
|
7484
|
-
}
|
|
7485
|
-
});
|
|
7486
|
-
body.classList.remove('bg-gradient-to-br');
|
|
7487
|
-
|
|
7488
|
-
// Add new background
|
|
7489
|
-
const themeClass = backgroundThemes[theme];
|
|
7490
|
-
if (themeClass.startsWith('svg-pattern-')) {
|
|
7491
|
-
body.classList.add(themeClass);
|
|
7492
|
-
} else {
|
|
7493
|
-
const newClasses = themeClass.split(' ').slice(1); // Remove 'bg-gradient-to-br' prefix
|
|
7494
|
-
body.classList.add('bg-gradient-to-br', ...newClasses);
|
|
7495
|
-
}
|
|
7496
|
-
|
|
7497
|
-
// Save preference
|
|
7498
|
-
localStorage.setItem('backgroundTheme', theme);
|
|
7499
|
-
|
|
7500
|
-
// Close dropdown
|
|
7501
|
-
toggleBackgroundCustomizer();
|
|
7502
|
-
|
|
7503
|
-
// Show notification
|
|
7504
|
-
showNotification('Background changed to ' + theme.replace('-', ' '), 'success');
|
|
7505
|
-
}
|
|
7506
|
-
|
|
7507
|
-
// Adjust background darkness
|
|
7508
|
-
function adjustDarkness(value) {
|
|
7509
|
-
const overlay = document.getElementById('background-overlay');
|
|
7510
|
-
if (overlay) {
|
|
7511
|
-
const opacity = value / 100; // Convert percentage to decimal
|
|
7512
|
-
overlay.style.backgroundColor = 'rgba(0, 0, 0, ' + opacity + ')';
|
|
7513
|
-
localStorage.setItem('backgroundDarkness', value);
|
|
7514
|
-
console.log('Darkness adjusted to:', value + '%', 'Opacity:', opacity);
|
|
7515
|
-
} else {
|
|
7516
|
-
console.log('Overlay element not found');
|
|
7517
|
-
}
|
|
7518
|
-
}
|
|
7519
|
-
|
|
7520
|
-
// Initialize background on page load
|
|
7521
|
-
function initializeBackground() {
|
|
7522
|
-
const savedTheme = localStorage.getItem('backgroundTheme') || 'default';
|
|
7523
|
-
const savedDarkness = localStorage.getItem('backgroundDarkness') || '20';
|
|
7524
|
-
|
|
7525
|
-
// Set background theme
|
|
7526
|
-
if (savedTheme !== 'default') {
|
|
7527
|
-
const body = document.body;
|
|
7528
|
-
const themeClass = backgroundThemes[savedTheme];
|
|
7529
|
-
|
|
7530
|
-
// Remove all existing backgrounds first
|
|
7531
|
-
Object.values(backgroundThemes).forEach(bgClass => {
|
|
7532
|
-
if (bgClass.startsWith('svg-pattern-')) {
|
|
7533
|
-
body.classList.remove(bgClass);
|
|
7534
|
-
} else {
|
|
7535
|
-
body.classList.remove(...bgClass.split(' ').slice(1));
|
|
7536
|
-
}
|
|
7537
|
-
});
|
|
7538
|
-
body.classList.remove('bg-gradient-to-br');
|
|
7539
|
-
|
|
7540
|
-
// Apply saved theme
|
|
7541
|
-
if (themeClass.startsWith('svg-pattern-')) {
|
|
7542
|
-
body.classList.add(themeClass);
|
|
7543
|
-
} else {
|
|
7544
|
-
const newClasses = themeClass.split(' ').slice(1);
|
|
7545
|
-
body.classList.add('bg-gradient-to-br', ...newClasses);
|
|
7546
|
-
}
|
|
7547
|
-
}
|
|
7548
|
-
|
|
7549
|
-
// Set darkness
|
|
7550
|
-
const overlay = document.getElementById('background-overlay');
|
|
7551
|
-
if (overlay) {
|
|
7552
|
-
const opacity = savedDarkness / 100;
|
|
7553
|
-
overlay.style.backgroundColor = 'rgba(0, 0, 0, ' + opacity + ')';
|
|
7554
|
-
}
|
|
7555
|
-
|
|
7556
|
-
// Set slider value
|
|
7557
|
-
const slider = document.getElementById('darknessSlider');
|
|
7558
|
-
if (slider) {
|
|
7559
|
-
slider.value = savedDarkness;
|
|
7560
|
-
}
|
|
7561
|
-
}
|
|
7562
|
-
|
|
7563
|
-
// Close dropdown when clicking outside
|
|
7564
|
-
document.addEventListener('click', function(event) {
|
|
7565
|
-
const dropdown = document.getElementById('backgroundCustomizer');
|
|
7566
|
-
const button = event.target.closest('button');
|
|
7567
|
-
const slider = event.target.closest('#darknessSlider');
|
|
7568
|
-
const dropdownContainer = event.target.closest('#backgroundCustomizer');
|
|
7569
|
-
|
|
7570
|
-
// Don't close if clicking inside the dropdown, on the toggle button, or on the slider
|
|
7571
|
-
if (!button?.getAttribute('onclick')?.includes('toggleBackgroundCustomizer') &&
|
|
7572
|
-
!slider && !dropdownContainer) {
|
|
7573
|
-
dropdown?.classList.add('hidden');
|
|
7574
|
-
}
|
|
7575
|
-
});
|
|
7576
|
-
|
|
7577
|
-
// Initialize background when page loads
|
|
7578
|
-
document.addEventListener('DOMContentLoaded', initializeBackground);
|
|
7579
|
-
</script>
|
|
7580
|
-
</body>
|
|
7581
|
-
</html>`;
|
|
7582
|
-
}
|
|
7583
|
-
function renderSidebar(currentPath, user, dynamicMenuItems) {
|
|
7584
|
-
const baseMenuItems = [
|
|
7585
|
-
{
|
|
7586
|
-
label: "Dashboard",
|
|
7587
|
-
path: "/admin",
|
|
7588
|
-
icon: `<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
7589
|
-
<path d="M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"/>
|
|
7590
|
-
</svg>`
|
|
7591
|
-
},
|
|
7592
|
-
{
|
|
7593
|
-
label: "Content",
|
|
7594
|
-
path: "/admin/content",
|
|
7595
|
-
icon: `<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
7596
|
-
<path d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
|
|
7597
|
-
</svg>`
|
|
7598
|
-
},
|
|
7599
|
-
{
|
|
7600
|
-
label: "Collections",
|
|
7601
|
-
path: "/admin/collections",
|
|
7602
|
-
icon: `<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
7603
|
-
<path d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3z"/>
|
|
7604
|
-
</svg>`
|
|
7605
|
-
},
|
|
7606
|
-
{
|
|
7607
|
-
label: "Media",
|
|
7608
|
-
path: "/admin/media",
|
|
7609
|
-
icon: `<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
7610
|
-
<path fill-rule="evenodd" d="M3 3a1 1 0 000 2v8a2 2 0 002 2h2.586l-1.293 1.293a1 1 0 101.414 1.414L10 15.414l2.293 2.293a1 1 0 001.414-1.414L12.414 15H15a2 2 0 002-2V5a1 1 0 100-2H3zm11.707 4.707a1 1 0 00-1.414-1.414L10 9.586 8.707 8.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
|
|
7611
|
-
</svg>`
|
|
7612
|
-
},
|
|
7613
|
-
{
|
|
7614
|
-
label: "Users",
|
|
7615
|
-
path: "/admin/users",
|
|
7616
|
-
icon: `<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
7617
|
-
<path d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3z"/>
|
|
7618
|
-
</svg>`
|
|
7619
|
-
},
|
|
7620
|
-
{
|
|
7621
|
-
label: "Plugins",
|
|
7622
|
-
path: "/admin/plugins",
|
|
7623
|
-
icon: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7624
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/>
|
|
7625
|
-
</svg>`
|
|
7626
|
-
},
|
|
7627
|
-
{
|
|
7628
|
-
label: "Cache",
|
|
7629
|
-
path: "/admin/cache",
|
|
7630
|
-
icon: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7631
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/>
|
|
7632
|
-
</svg>`
|
|
7633
|
-
},
|
|
7634
|
-
{
|
|
7635
|
-
label: "Design",
|
|
7636
|
-
path: "/admin/design",
|
|
7637
|
-
icon: `<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
7638
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M4.098 19.902a3.75 3.75 0 0 0 5.304 0l6.401-6.402M6.75 21A3.75 3.75 0 0 1 3 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 0 0 3.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008Z" />
|
|
7639
|
-
</svg>`
|
|
7640
|
-
},
|
|
7641
|
-
{
|
|
7642
|
-
label: "Logs",
|
|
7643
|
-
path: "/admin/logs",
|
|
7644
|
-
icon: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7645
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
|
|
7646
|
-
</svg>`
|
|
7647
|
-
},
|
|
7648
|
-
{
|
|
7649
|
-
label: "Settings",
|
|
7650
|
-
path: "/admin/settings",
|
|
7651
|
-
icon: `<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
7652
|
-
<path fill-rule="evenodd" d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z" clip-rule="evenodd"/>
|
|
7653
|
-
</svg>`
|
|
7654
|
-
},
|
|
7655
|
-
{
|
|
7656
|
-
label: "API Reference",
|
|
7657
|
-
path: "/admin/api-reference",
|
|
7658
|
-
icon: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7659
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"/>
|
|
7660
|
-
</svg>`
|
|
7661
|
-
},
|
|
7662
|
-
{
|
|
7663
|
-
label: "Field Types",
|
|
7664
|
-
path: "/admin/field-types",
|
|
7665
|
-
icon: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7666
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"/>
|
|
7667
|
-
</svg>`
|
|
7668
|
-
},
|
|
7669
|
-
{
|
|
7670
|
-
label: "API Spec",
|
|
7671
|
-
path: "/api",
|
|
7672
|
-
target: "_blank",
|
|
7673
|
-
icon: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7674
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
|
|
7675
|
-
</svg>`
|
|
7676
|
-
}
|
|
7677
|
-
];
|
|
7678
|
-
const allMenuItems = [...baseMenuItems];
|
|
7679
|
-
if (dynamicMenuItems && dynamicMenuItems.length > 0) {
|
|
7680
|
-
const usersIndex = allMenuItems.findIndex((item) => item.path === "/admin/users");
|
|
7681
|
-
if (usersIndex !== -1) {
|
|
7682
|
-
allMenuItems.splice(usersIndex + 1, 0, ...dynamicMenuItems);
|
|
7683
|
-
} else {
|
|
7684
|
-
allMenuItems.push(...dynamicMenuItems);
|
|
7685
|
-
}
|
|
7686
|
-
}
|
|
7687
|
-
return `
|
|
7688
|
-
<nav class="backdrop-blur-md bg-black/30 rounded-xl border border-white/10 shadow-xl p-6 h-[calc(100vh-9.5rem)] sticky top-8">
|
|
7689
|
-
<div class="space-y-4">
|
|
7690
|
-
${allMenuItems.map((item) => {
|
|
7691
|
-
const isActive = currentPath === item.path || item.path !== "/admin" && currentPath.startsWith(item.path);
|
|
7692
|
-
const targetAttr = item.target ? ` target="${item.target}"` : "";
|
|
7693
|
-
return `
|
|
7694
|
-
<a href="${item.path}"${targetAttr} class="flex items-center space-x-3 ${isActive ? "text-white bg-white/20" : "text-gray-300 hover:text-white"} rounded-lg px-3 py-2 transition-all hover:bg-white/10">
|
|
7695
|
-
${item.icon}
|
|
7696
|
-
<span>${item.label}</span>
|
|
7697
|
-
</a>
|
|
7698
|
-
`;
|
|
7699
|
-
}).join("")}
|
|
7700
|
-
</div>
|
|
7701
|
-
</nav>
|
|
7702
|
-
`;
|
|
7703
|
-
}
|
|
7704
|
-
function renderTopBar(pageTitle, user) {
|
|
7705
|
-
return `
|
|
7706
|
-
<header class="backdrop-blur-md bg-white/10 border-b border-white/20 shadow-lg relative z-[9998]">
|
|
7707
|
-
<div class="px-4 sm:px-6 lg:px-8">
|
|
7708
|
-
<div class="flex justify-between items-center py-4">
|
|
7709
|
-
<div class="flex items-center space-x-4">
|
|
7710
|
-
${renderLogo({ size: "md", showText: true, variant: "white" })}
|
|
7711
|
-
</div>
|
|
7712
|
-
|
|
7713
|
-
<div class="flex items-center space-x-4">
|
|
7714
|
-
<!-- Notifications -->
|
|
7715
|
-
<button class="p-2 text-gray-300 hover:text-white transition-colors rounded-lg hover:bg-white/10 relative">
|
|
7716
|
-
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7717
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/>
|
|
7718
|
-
</svg>
|
|
7719
|
-
<span class="absolute top-1 right-1 w-2 h-2 bg-red-400 rounded-full"></span>
|
|
7720
|
-
</button>
|
|
7721
|
-
|
|
7722
|
-
<!-- Background Customizer -->
|
|
7723
|
-
<div class="relative z-[9999]">
|
|
7724
|
-
<button class="p-2 text-gray-300 hover:text-white transition-colors rounded-lg hover:bg-white/10" onclick="toggleBackgroundCustomizer()">
|
|
7725
|
-
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
7726
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M4.098 19.902a3.75 3.75 0 0 0 5.304 0l6.401-6.402M6.75 21A3.75 3.75 0 0 1 3 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 0 0 3.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008Z" />
|
|
7727
|
-
</svg>
|
|
7728
|
-
</button>
|
|
7729
|
-
|
|
7730
|
-
<!-- Background Customizer Dropdown -->
|
|
7731
|
-
<div id="backgroundCustomizer" class="hidden absolute right-0 mt-2 w-80 backdrop-blur-md bg-black/95 rounded-xl border border-white/10 shadow-xl z-[9999]">
|
|
7732
|
-
<div class="p-6">
|
|
7733
|
-
<div class="flex items-center justify-between mb-4">
|
|
7734
|
-
<h3 class="text-lg font-semibold text-white">Background Themes</h3>
|
|
7735
|
-
<button onclick="toggleBackgroundCustomizer()" class="text-gray-400 hover:text-white">
|
|
7736
|
-
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7737
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
|
7738
|
-
</svg>
|
|
7739
|
-
</button>
|
|
7740
|
-
</div>
|
|
7741
|
-
|
|
7742
|
-
<!-- Background Options -->
|
|
7743
|
-
<div class="space-y-3 mb-6">
|
|
7744
|
-
<div class="grid grid-cols-2 gap-3">
|
|
7745
|
-
<!-- Default (Deep Space) -->
|
|
7746
|
-
<button onclick="setBackground('default')" class="bg-preview bg-gradient-to-br from-slate-900 via-gray-900 to-black h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group">
|
|
7747
|
-
<div class="absolute inset-0 bg-black/20 rounded-lg"></div>
|
|
7748
|
-
<div class="absolute bottom-1 left-2 text-xs text-white font-medium">Default</div>
|
|
7749
|
-
</button>
|
|
7750
|
-
|
|
7751
|
-
<!-- Cosmic Blue -->
|
|
7752
|
-
<button onclick="setBackground('cosmic-blue')" class="bg-preview bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900 h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group">
|
|
7753
|
-
<div class="absolute inset-0 bg-black/20 rounded-lg"></div>
|
|
7754
|
-
<div class="absolute bottom-1 left-2 text-xs text-white font-medium">Cosmic</div>
|
|
7755
|
-
</button>
|
|
7756
|
-
|
|
7757
|
-
<!-- Matrix Green -->
|
|
7758
|
-
<button onclick="setBackground('matrix-green')" class="bg-preview bg-gradient-to-br from-gray-900 via-emerald-900 to-green-900 h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group">
|
|
7759
|
-
<div class="absolute inset-0 bg-black/20 rounded-lg"></div>
|
|
7760
|
-
<div class="absolute bottom-1 left-2 text-xs text-white font-medium">Matrix</div>
|
|
7761
|
-
</button>
|
|
7762
|
-
|
|
7763
|
-
<!-- Cyber Pink -->
|
|
7764
|
-
<button onclick="setBackground('cyber-pink')" class="bg-preview bg-gradient-to-br from-gray-900 via-pink-900 to-rose-900 h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group">
|
|
7765
|
-
<div class="absolute inset-0 bg-black/20 rounded-lg"></div>
|
|
7766
|
-
<div class="absolute bottom-1 left-2 text-xs text-white font-medium">Cyber</div>
|
|
7767
|
-
</button>
|
|
7768
|
-
|
|
7769
|
-
<!-- Neon Orange -->
|
|
7770
|
-
<button onclick="setBackground('neon-orange')" class="bg-preview bg-gradient-to-br from-gray-900 via-orange-900 to-amber-900 h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group">
|
|
7771
|
-
<div class="absolute inset-0 bg-black/20 rounded-lg"></div>
|
|
7772
|
-
<div class="absolute bottom-1 left-2 text-xs text-white font-medium">Neon</div>
|
|
7773
|
-
</button>
|
|
7774
|
-
|
|
7775
|
-
<!-- Purple Space -->
|
|
7776
|
-
<button onclick="setBackground('purple-space')" class="bg-preview bg-gradient-to-br from-gray-900 via-purple-900 to-violet-800 h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group">
|
|
7777
|
-
<div class="absolute inset-0 bg-black/20 rounded-lg"></div>
|
|
7778
|
-
<div class="absolute bottom-1 left-2 text-xs text-white font-medium">Purple</div>
|
|
7779
|
-
</button>
|
|
7780
|
-
</div>
|
|
7781
|
-
|
|
7782
|
-
<!-- Custom Backgrounds -->
|
|
7783
|
-
<div class="mt-4">
|
|
7784
|
-
<h4 class="text-sm font-medium text-gray-300 mb-3">Custom Backgrounds</h4>
|
|
7785
|
-
<div class="grid grid-cols-2 gap-3">
|
|
7786
|
-
<!-- Blue Waves -->
|
|
7787
|
-
<button onclick="setBackground('blue-waves')" class="h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group overflow-hidden">
|
|
7788
|
-
<div class="absolute inset-0">
|
|
7789
|
-
<img src="/images/backgrounds/blue-waves.png" alt="Blue Waves" class="w-full h-full object-cover opacity-60">
|
|
7790
|
-
</div>
|
|
7791
|
-
<div class="absolute bottom-1 left-2 text-xs text-white font-medium bg-black/50 px-2 py-1 rounded">Waves</div>
|
|
7792
|
-
</button>
|
|
7793
|
-
|
|
7794
|
-
<!-- Blue Crescent -->
|
|
7795
|
-
<button onclick="setBackground('blue-crescent')" class="h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group overflow-hidden">
|
|
7796
|
-
<div class="absolute inset-0">
|
|
7797
|
-
<img src="/images/backgrounds/blue-crescent.png" alt="Blue Crescent" class="w-full h-full object-cover opacity-60">
|
|
7798
|
-
</div>
|
|
7799
|
-
<div class="absolute bottom-1 left-2 text-xs text-white font-medium bg-black/50 px-2 py-1 rounded">Crescent</div>
|
|
7800
|
-
</button>
|
|
7801
|
-
|
|
7802
|
-
<!-- Blue Stars -->
|
|
7803
|
-
<button onclick="setBackground('blue-stars')" class="h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group overflow-hidden">
|
|
7804
|
-
<div class="absolute inset-0">
|
|
7805
|
-
<img src="/images/backgrounds/blue-stars.png" alt="Blue Stars" class="w-full h-full object-cover opacity-60">
|
|
7806
|
-
</div>
|
|
7807
|
-
<div class="absolute bottom-1 left-2 text-xs text-white font-medium bg-black/50 px-2 py-1 rounded">Stars</div>
|
|
7808
|
-
</button>
|
|
7809
|
-
|
|
7810
|
-
<!-- Blue Waves 3D -->
|
|
7811
|
-
<button onclick="setBackground('blue-waves-3d')" class="h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group overflow-hidden">
|
|
7812
|
-
<div class="absolute inset-0">
|
|
7813
|
-
<img src="/images/backgrounds/blue-waves-3d.png" alt="Blue Waves 3D" class="w-full h-full object-cover opacity-60">
|
|
7814
|
-
</div>
|
|
7815
|
-
<div class="absolute bottom-1 left-2 text-xs text-white font-medium bg-black/50 px-2 py-1 rounded">3D Waves</div>
|
|
7816
|
-
</button>
|
|
7817
|
-
</div>
|
|
7818
|
-
</div>
|
|
7819
|
-
</div>
|
|
7820
|
-
|
|
7821
|
-
<!-- Darkness Slider -->
|
|
7822
|
-
<div class="space-y-3">
|
|
7823
|
-
<label class="block text-sm font-medium text-white">Background Darkness</label>
|
|
7824
|
-
<div class="flex items-center space-x-3">
|
|
7825
|
-
<svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7826
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707"/>
|
|
7827
|
-
</svg>
|
|
7828
|
-
<input
|
|
7829
|
-
type="range"
|
|
7830
|
-
id="darknessSlider"
|
|
7831
|
-
min="10"
|
|
7832
|
-
max="100"
|
|
7833
|
-
value="20"
|
|
7834
|
-
class="flex-1 h-2 bg-white/20 rounded-lg appearance-none cursor-pointer slider"
|
|
7835
|
-
oninput="adjustDarkness(this.value)"
|
|
7836
|
-
onchange="adjustDarkness(this.value)"
|
|
7837
|
-
>
|
|
7838
|
-
<svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7839
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"/>
|
|
7840
|
-
</svg>
|
|
7841
|
-
</div>
|
|
7842
|
-
<div class="text-xs text-gray-400 text-center">Adjust overlay darkness</div>
|
|
7843
|
-
</div>
|
|
7844
|
-
</div>
|
|
7845
|
-
</div>
|
|
7846
|
-
</div>
|
|
7847
|
-
|
|
7848
|
-
<!-- User Dropdown -->
|
|
7849
|
-
${user ? `
|
|
7850
|
-
<div class="relative z-[9999]">
|
|
7851
|
-
<button class="flex items-center space-x-3 p-2 rounded-lg hover:bg-white/10 transition-colors group" onclick="toggleUserDropdown()">
|
|
7852
|
-
<div class="w-8 h-8 bg-gradient-to-br from-green-400 to-blue-500 rounded-full flex items-center justify-center">
|
|
7853
|
-
<span class="text-white text-sm font-medium">${(user.name || user.email || "U").charAt(0).toUpperCase()}</span>
|
|
7854
|
-
</div>
|
|
7855
|
-
<div class="hidden md:block text-left">
|
|
7856
|
-
<div class="text-white text-sm font-medium">${user.name || user.email || "User"}</div>
|
|
7857
|
-
<div class="text-gray-400 text-xs">${user.role || "Administrator"}</div>
|
|
7858
|
-
</div>
|
|
7859
|
-
<svg class="w-4 h-4 text-gray-400 group-hover:text-white transition-colors" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7860
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
|
|
7861
|
-
</svg>
|
|
7862
|
-
</button>
|
|
7863
|
-
|
|
7864
|
-
<!-- Dropdown Menu -->
|
|
7865
|
-
<div id="userDropdown" class="hidden absolute right-0 mt-2 w-48 backdrop-blur-md bg-black/95 rounded-xl border border-white/10 shadow-xl z-[9999]">
|
|
7866
|
-
<div class="py-2">
|
|
7867
|
-
<div class="px-4 py-2 border-b border-white/10">
|
|
7868
|
-
<p class="text-sm font-medium text-gray-1">${user.name || user.email || "User"}</p>
|
|
7869
|
-
<p class="text-xs text-gray-4">${user.email || ""}</p>
|
|
7870
|
-
</div>
|
|
7871
|
-
<a href="/admin/profile" class="flex items-center gap-3 px-4 py-2 text-sm text-gray-300 hover:bg-white/10 hover:text-white transition-colors">
|
|
7872
|
-
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7873
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
|
|
7874
|
-
</svg>
|
|
7875
|
-
My Profile
|
|
7876
|
-
</a>
|
|
7877
|
-
<a href="/admin/settings" class="flex items-center gap-3 px-4 py-2 text-sm text-gray-300 hover:bg-white/10 hover:text-white transition-colors">
|
|
7878
|
-
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7879
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
|
|
7880
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
|
|
7881
|
-
</svg>
|
|
7882
|
-
Settings
|
|
7883
|
-
</a>
|
|
7884
|
-
<a href="/auth/logout" class="flex items-center gap-3 px-4 py-2 text-sm text-red-300 hover:bg-red-500/10 hover:text-red-200 transition-colors">
|
|
7885
|
-
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
7886
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"/>
|
|
7887
|
-
</svg>
|
|
7888
|
-
Sign Out
|
|
7889
|
-
</a>
|
|
7890
|
-
</div>
|
|
7891
|
-
</div>
|
|
7892
|
-
</div>
|
|
7893
|
-
` : `
|
|
7894
|
-
<a href="/auth/login" class="backdrop-blur-md bg-white/10 px-4 py-2 rounded-lg text-white font-medium hover:bg-white/20 transition-all">
|
|
7895
|
-
Sign In
|
|
7896
|
-
</a>
|
|
7897
|
-
`}
|
|
7898
|
-
</div>
|
|
7899
|
-
</div>
|
|
7900
|
-
</header>
|
|
7901
|
-
`;
|
|
7902
|
-
}
|
|
7903
|
-
|
|
7904
6580
|
// src/templates/pages/admin-profile.template.ts
|
|
7905
6581
|
function renderProfilePage(data) {
|
|
7906
6582
|
const pageContent = `
|
|
@@ -8300,7 +6976,7 @@ function renderProfilePage(data) {
|
|
|
8300
6976
|
user: data.user,
|
|
8301
6977
|
content: pageContent
|
|
8302
6978
|
};
|
|
8303
|
-
return renderAdminLayout(layoutData);
|
|
6979
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayout(layoutData);
|
|
8304
6980
|
}
|
|
8305
6981
|
|
|
8306
6982
|
// src/templates/pages/admin-activity-logs.template.ts
|
|
@@ -8510,7 +7186,7 @@ function renderActivityLogsPage(data) {
|
|
|
8510
7186
|
user: data.user,
|
|
8511
7187
|
content: pageContent
|
|
8512
7188
|
};
|
|
8513
|
-
return renderAdminLayout(layoutData);
|
|
7189
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayout(layoutData);
|
|
8514
7190
|
}
|
|
8515
7191
|
function getActionBadgeClass(action) {
|
|
8516
7192
|
if (action.includes("login") || action.includes("logout")) {
|
|
@@ -8530,7 +7206,7 @@ function formatAction(action) {
|
|
|
8530
7206
|
}
|
|
8531
7207
|
|
|
8532
7208
|
// src/templates/pages/admin-user-edit.template.ts
|
|
8533
|
-
init_admin_layout_catalyst_template();
|
|
7209
|
+
chunkLEGKJ5DI_cjs.init_admin_layout_catalyst_template();
|
|
8534
7210
|
function renderUserEditPage(data) {
|
|
8535
7211
|
const pageContent = `
|
|
8536
7212
|
<div>
|
|
@@ -8863,11 +7539,11 @@ function renderUserEditPage(data) {
|
|
|
8863
7539
|
user: data.user,
|
|
8864
7540
|
content: pageContent
|
|
8865
7541
|
};
|
|
8866
|
-
return renderAdminLayoutCatalyst(layoutData);
|
|
7542
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayoutCatalyst(layoutData);
|
|
8867
7543
|
}
|
|
8868
7544
|
|
|
8869
7545
|
// src/templates/pages/admin-user-new.template.ts
|
|
8870
|
-
init_admin_layout_catalyst_template();
|
|
7546
|
+
chunkLEGKJ5DI_cjs.init_admin_layout_catalyst_template();
|
|
8871
7547
|
function renderUserNewPage(data) {
|
|
8872
7548
|
const pageContent = `
|
|
8873
7549
|
<div>
|
|
@@ -9146,15 +7822,16 @@ function renderUserNewPage(data) {
|
|
|
9146
7822
|
`;
|
|
9147
7823
|
const layoutData = {
|
|
9148
7824
|
title: "Create User",
|
|
7825
|
+
pageTitle: "Create New User",
|
|
9149
7826
|
currentPath: "/admin/users",
|
|
9150
7827
|
user: data.user,
|
|
9151
7828
|
content: pageContent
|
|
9152
7829
|
};
|
|
9153
|
-
return renderAdminLayoutCatalyst(layoutData);
|
|
7830
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayoutCatalyst(layoutData);
|
|
9154
7831
|
}
|
|
9155
7832
|
|
|
9156
7833
|
// src/templates/pages/admin-users-list.template.ts
|
|
9157
|
-
init_admin_layout_catalyst_template();
|
|
7834
|
+
chunkLEGKJ5DI_cjs.init_admin_layout_catalyst_template();
|
|
9158
7835
|
function renderUsersListPage(data) {
|
|
9159
7836
|
const columns = [
|
|
9160
7837
|
{
|
|
@@ -9551,12 +8228,13 @@ function renderUsersListPage(data) {
|
|
|
9551
8228
|
`;
|
|
9552
8229
|
const layoutData = {
|
|
9553
8230
|
title: "Users",
|
|
8231
|
+
pageTitle: "User Management",
|
|
9554
8232
|
currentPath: "/admin/users",
|
|
9555
8233
|
user: data.user,
|
|
9556
8234
|
version: data.version,
|
|
9557
8235
|
content: pageContent
|
|
9558
8236
|
};
|
|
9559
|
-
return renderAdminLayoutCatalyst(layoutData);
|
|
8237
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayoutCatalyst(layoutData);
|
|
9560
8238
|
}
|
|
9561
8239
|
|
|
9562
8240
|
// src/routes/admin-users.ts
|
|
@@ -10924,7 +9602,7 @@ function getFileIcon(mimeType) {
|
|
|
10924
9602
|
}
|
|
10925
9603
|
|
|
10926
9604
|
// src/templates/pages/admin-media-library.template.ts
|
|
10927
|
-
init_admin_layout_catalyst_template();
|
|
9605
|
+
chunkLEGKJ5DI_cjs.init_admin_layout_catalyst_template();
|
|
10928
9606
|
function renderMediaLibraryPage(data) {
|
|
10929
9607
|
const pageContent = `
|
|
10930
9608
|
<div>
|
|
@@ -11850,12 +10528,13 @@ function renderMediaLibraryPage(data) {
|
|
|
11850
10528
|
}
|
|
11851
10529
|
const layoutData = {
|
|
11852
10530
|
title: "Media Library",
|
|
10531
|
+
pageTitle: "Media Library",
|
|
11853
10532
|
currentPath: "/admin/media",
|
|
11854
10533
|
user: data.user,
|
|
11855
10534
|
version: data.version,
|
|
11856
10535
|
content: pageContent
|
|
11857
10536
|
};
|
|
11858
|
-
return renderAdminLayoutCatalyst(layoutData);
|
|
10537
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayoutCatalyst(layoutData);
|
|
11859
10538
|
}
|
|
11860
10539
|
|
|
11861
10540
|
// src/templates/components/media-file-details.template.ts
|
|
@@ -12773,7 +11452,7 @@ function formatFileSize(bytes) {
|
|
|
12773
11452
|
}
|
|
12774
11453
|
|
|
12775
11454
|
// src/templates/pages/admin-plugins-list.template.ts
|
|
12776
|
-
init_admin_layout_catalyst_template();
|
|
11455
|
+
chunkLEGKJ5DI_cjs.init_admin_layout_catalyst_template();
|
|
12777
11456
|
function renderPluginsListPage(data) {
|
|
12778
11457
|
const pageContent = `
|
|
12779
11458
|
<div>
|
|
@@ -13141,12 +11820,13 @@ function renderPluginsListPage(data) {
|
|
|
13141
11820
|
`;
|
|
13142
11821
|
const layoutData = {
|
|
13143
11822
|
title: "Plugins",
|
|
11823
|
+
pageTitle: "Plugin Management",
|
|
13144
11824
|
currentPath: "/admin/plugins",
|
|
13145
11825
|
user: data.user,
|
|
13146
11826
|
version: data.version,
|
|
13147
11827
|
content: pageContent
|
|
13148
11828
|
};
|
|
13149
|
-
return renderAdminLayoutCatalyst(layoutData);
|
|
11829
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayoutCatalyst(layoutData);
|
|
13150
11830
|
}
|
|
13151
11831
|
function renderPluginCard(plugin) {
|
|
13152
11832
|
const statusColors = {
|
|
@@ -13796,7 +12476,7 @@ function renderPluginSettingsPage(data) {
|
|
|
13796
12476
|
user,
|
|
13797
12477
|
content: pageContent
|
|
13798
12478
|
};
|
|
13799
|
-
return renderAdminLayout(layoutData);
|
|
12479
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayout(layoutData);
|
|
13800
12480
|
}
|
|
13801
12481
|
function renderStatusBadge(status) {
|
|
13802
12482
|
const statusColors = {
|
|
@@ -14393,7 +13073,7 @@ function formatLastUpdated(timestamp) {
|
|
|
14393
13073
|
}
|
|
14394
13074
|
|
|
14395
13075
|
// src/templates/pages/admin-logs-list.template.ts
|
|
14396
|
-
init_admin_layout_catalyst_template();
|
|
13076
|
+
chunkLEGKJ5DI_cjs.init_admin_layout_catalyst_template();
|
|
14397
13077
|
function renderLogsListPage(data) {
|
|
14398
13078
|
const { logs, pagination, filters, user } = data;
|
|
14399
13079
|
const content = `
|
|
@@ -14699,11 +13379,12 @@ function renderLogsListPage(data) {
|
|
|
14699
13379
|
`;
|
|
14700
13380
|
const layoutData = {
|
|
14701
13381
|
title: "System Logs",
|
|
13382
|
+
pageTitle: "System Logs",
|
|
14702
13383
|
currentPath: "/admin/logs",
|
|
14703
13384
|
user,
|
|
14704
13385
|
content
|
|
14705
13386
|
};
|
|
14706
|
-
return renderAdminLayoutCatalyst(layoutData);
|
|
13387
|
+
return chunkLEGKJ5DI_cjs.renderAdminLayoutCatalyst(layoutData);
|
|
14707
13388
|
}
|
|
14708
13389
|
function renderLogDetailsPage(data) {
|
|
14709
13390
|
const { log, user } = data;
|
|
@@ -14915,7 +13596,7 @@ function renderLogDetailsPage(data) {
|
|
|
14915
13596
|
</div>
|
|
14916
13597
|
</div>
|
|
14917
13598
|
`;
|
|
14918
|
-
return adminLayoutV2({
|
|
13599
|
+
return chunkLEGKJ5DI_cjs.adminLayoutV2({
|
|
14919
13600
|
title: `Log Details - ${log.id}`,
|
|
14920
13601
|
user,
|
|
14921
13602
|
content
|
|
@@ -15158,7 +13839,7 @@ function renderLogConfigPage(data) {
|
|
|
15158
13839
|
|
|
15159
13840
|
<script src="https://unpkg.com/htmx.org@1.9.6"></script>
|
|
15160
13841
|
`;
|
|
15161
|
-
return adminLayoutV2({
|
|
13842
|
+
return chunkLEGKJ5DI_cjs.adminLayoutV2({
|
|
15162
13843
|
title: "Log Configuration",
|
|
15163
13844
|
user,
|
|
15164
13845
|
content
|
|
@@ -15561,5 +14242,5 @@ exports.api_media_default = api_media_default;
|
|
|
15561
14242
|
exports.api_system_default = api_system_default;
|
|
15562
14243
|
exports.auth_default = auth_default;
|
|
15563
14244
|
exports.userRoutes = userRoutes;
|
|
15564
|
-
//# sourceMappingURL=chunk-
|
|
15565
|
-
//# sourceMappingURL=chunk-
|
|
14245
|
+
//# sourceMappingURL=chunk-DG4INX36.cjs.map
|
|
14246
|
+
//# sourceMappingURL=chunk-DG4INX36.cjs.map
|