@opengis/cms 0.0.57 → 0.0.59
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/README.md +1 -1
- package/dist/AddNewItemInTree-05PSSEFi.js +76 -0
- package/dist/ArticlesPage-BjYzvTWM.js +298 -0
- package/dist/CollectionsBreadcrumb-HePNJb-d.js +4 -0
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-BJh-tjam.js +53 -0
- package/dist/CollectionsPage-DHfPNql6.js +124 -0
- package/dist/{CreateForm-BMOBeP4G.js → CreateForm-5FvT45vH.js} +1 -1
- package/dist/Dashboard-CXkg_pk8.js +358 -0
- package/dist/EditCollectionPage-CqYHpEON.js +187 -0
- package/dist/{EmptyData-DaZt_nAm.js → EmptyData-DxPrSXhV.js} +1 -1
- package/dist/{MenuAddPage-Bf48Z-ah.js → MenuAddPage-QTnwCoGh.js} +40 -35
- package/dist/MenuBody-Bi0ONVZf.js +125 -0
- package/dist/MenuItemPage-B7Y9KFyb.js +1027 -0
- package/dist/MenuList-BLIpeqSd.js +172 -0
- package/dist/MenuPage-3W6jZ15H.js +107 -0
- package/dist/MenuWrapper-OrOv6sOb.js +12 -0
- package/dist/MonacoEditor-ByPT8pnv.js +4 -0
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js +84 -0
- package/dist/{UniversalTable.vue_vue_type_script_setup_true_lang-CJGTsd1V.js → UniversalTable-GBd_pStq.js} +81 -81
- package/dist/{UniversalTablePagination.vue_vue_type_script_setup_true_lang-GYZd_gkA.js → UniversalTablePagination-Dw2hc0nc.js} +47 -47
- package/dist/VsFormTags-CMjiu9sY.js +114 -0
- package/dist/VsPreview-DwETkOpb.js +63 -0
- package/dist/contentForm-Buku-lel.js +489 -0
- package/dist/getField-CpwVE28P.js +179 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +72 -71
- package/dist/style.css +1 -1
- package/dist/vs-builder-edit-D-q1o8tF.js +604 -0
- package/dist/vs-builder-monaco-Cw-f19gc.js +33 -0
- package/dist/vs-builder-preview-BH4VAM3a.js +44 -0
- package/dist/vs-form-custom-datatable-BDZo48w3.js +317 -0
- package/dist/vs-form-integer-BZ855R3g.js +61 -0
- package/dist/vs-form-media-select-NY27EaG1.js +837 -0
- package/dist/vs-form-reference-list-Dtv8fJJU.js +1536 -0
- package/dist/vs-form-reletion-link-BhzNQszm.js +34 -0
- package/dist/vs-form-tiptap-DDFQjRjY.js +4 -0
- package/dist/vs-form-tiptap.vue_vue_type_script_setup_true_lang-DGgsqXwg.js +11 -0
- package/dist/vs-richtext-md-C098v_6Q.js +4 -0
- package/dist/vs-richtext-md.vue_vue_type_script_setup_true_lang-Ct8uTV-J.js +14 -0
- package/locales/en.json +1 -0
- package/locales/uk.json +1 -0
- package/package.json +69 -68
- package/server/functions/utils/mock.reply.js +7 -7
- package/server/routes/cms/controllers/getPermissions.js +15 -15
- package/server/routes/cms/controllers/setPermissions.js +49 -49
- package/server/templates/select/core.user_mentioned.sql +1 -1
- package/dist/ArticlesPage-BcR1hbds.js +0 -286
- package/dist/BuilderPage-CK_osM89.js +0 -386
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-CnOe9ORD.js +0 -45
- package/dist/CollectionsPage-JfmrHNR_.js +0 -110
- package/dist/EditCollectionPage-Cw3GQYRe.js +0 -809
- package/dist/MenuItemPage-CXn5HC8j.js +0 -1366
- package/dist/MenuPage-tJZtK46W.js +0 -106
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js +0 -84
- package/dist/contentForm-B6gHgGkz.js +0 -586
- package/dist/getField-Y5WXnRR0.js +0 -2948
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { defineComponent as h, resolveComponent as S, openBlock as l, createElementBlock as c, createElementVNode as e, toDisplayString as a, unref as u, createVNode as n, withCtx as A, createTextVNode as p, normalizeClass as g, createBlock as _, resolveDynamicComponent as j, Fragment as x, renderList as k, ref as P, onMounted as I } from "vue";
|
|
2
|
+
import { HelpCircle as T, Plus as L, FileText as v, Users as w, Image as U, Eye as F, Calendar as N, SquarePen as R, Activity as V, Zap as z } from "lucide-vue-next";
|
|
3
|
+
import { useI18n as $ } from "vue-i18n";
|
|
4
|
+
import { useRouter as M } from "vue-router";
|
|
5
|
+
const B = { class: "flex items-center justify-between" }, E = { class: "flex items-center gap-2" }, q = { class: "text-4xl font-bold text-slate-800 dark:text-slate-100 mb-2" }, H = ["href", "title"], J = { class: "text-lg text-slate-600 dark:text-slate-300" }, O = /* @__PURE__ */ h({
|
|
6
|
+
__name: "DashboardHeader",
|
|
7
|
+
setup(b) {
|
|
8
|
+
const { locale: r } = $();
|
|
9
|
+
return (o, t) => {
|
|
10
|
+
const i = S("router-link");
|
|
11
|
+
return l(), c("div", B, [
|
|
12
|
+
e("div", null, [
|
|
13
|
+
e("div", E, [
|
|
14
|
+
e("h1", q, a(o.$t("cms.dashboard.title")), 1),
|
|
15
|
+
e("a", {
|
|
16
|
+
href: `https://cms.opengis.info/${u(r)}/get-started/app-overview`,
|
|
17
|
+
target: "_blank",
|
|
18
|
+
title: o.$t("cms.guide.appOverview")
|
|
19
|
+
}, [
|
|
20
|
+
n(u(T), { class: "w-5 h-5" })
|
|
21
|
+
], 8, H)
|
|
22
|
+
]),
|
|
23
|
+
e("div", J, a(o.$t("cms.dashboard.description")), 1)
|
|
24
|
+
]),
|
|
25
|
+
e("div", null, [
|
|
26
|
+
n(i, {
|
|
27
|
+
to: "/settings/collections",
|
|
28
|
+
class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white"
|
|
29
|
+
}, {
|
|
30
|
+
default: A(() => [
|
|
31
|
+
n(u(L), { class: "w-4 h-4 mr-2" }),
|
|
32
|
+
p(" " + a(o.$t("cms.dashboard.newCollection")), 1)
|
|
33
|
+
]),
|
|
34
|
+
_: 1
|
|
35
|
+
})
|
|
36
|
+
])
|
|
37
|
+
]);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}), W = { class: "rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-300 transform hover:scale-105" }, G = { class: "p-6" }, K = { class: "flex items-start justify-between" }, Q = { class: "flex-1" }, Z = { class: "flex items-center space-x-2 mb-2" }, X = { class: "text-sm font-medium text-slate-600 dark:text-slate-400" }, Y = { class: "text-3xl font-bold text-slate-800 dark:text-slate-100 mb-1" }, ee = { class: "text-xs text-slate-500 dark:text-slate-400 mb-3" }, te = /* @__PURE__ */ h({
|
|
41
|
+
__name: "StatCard",
|
|
42
|
+
props: {
|
|
43
|
+
stat: {}
|
|
44
|
+
},
|
|
45
|
+
setup(b) {
|
|
46
|
+
const r = (o) => ({
|
|
47
|
+
"file-text": v,
|
|
48
|
+
users: w,
|
|
49
|
+
image: U,
|
|
50
|
+
eye: F
|
|
51
|
+
})[o] || v;
|
|
52
|
+
return (o, t) => (l(), c("div", W, [
|
|
53
|
+
e("div", G, [
|
|
54
|
+
e("div", K, [
|
|
55
|
+
e("div", Q, [
|
|
56
|
+
e("div", Z, [
|
|
57
|
+
e("div", {
|
|
58
|
+
class: g(`p-2 rounded-lg bg-${o.stat.color}-50 dark:bg-${o.stat.color}-900/20`)
|
|
59
|
+
}, [
|
|
60
|
+
(l(), _(j(r(o.stat.icon)), {
|
|
61
|
+
class: g(`w-5 h-5 text-${o.stat.color}-600`)
|
|
62
|
+
}, null, 8, ["class"]))
|
|
63
|
+
], 2),
|
|
64
|
+
e("p", X, a(o.stat.title), 1)
|
|
65
|
+
]),
|
|
66
|
+
e("p", Y, a(o.stat.value), 1),
|
|
67
|
+
e("p", ee, a(o.stat.description), 1)
|
|
68
|
+
])
|
|
69
|
+
])
|
|
70
|
+
])
|
|
71
|
+
]));
|
|
72
|
+
}
|
|
73
|
+
}), se = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6" }, oe = /* @__PURE__ */ h({
|
|
74
|
+
__name: "StatsGrid",
|
|
75
|
+
props: {
|
|
76
|
+
stats: {}
|
|
77
|
+
},
|
|
78
|
+
setup(b) {
|
|
79
|
+
return (r, o) => (l(), c("div", se, [
|
|
80
|
+
(l(!0), c(x, null, k(r.stats, (t) => (l(), _(te, {
|
|
81
|
+
key: t.id,
|
|
82
|
+
stat: t
|
|
83
|
+
}, null, 8, ["stat"]))), 128))
|
|
84
|
+
]));
|
|
85
|
+
}
|
|
86
|
+
}), re = { class: "p-4 hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors" }, ae = { class: "flex items-center justify-between" }, ie = { class: "flex-1" }, ne = { class: "flex items-center space-x-3 mb-2" }, le = { class: "inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-xs bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-600 dark:text-slate-300" }, de = { class: "font-semibold text-slate-800 dark:text-slate-100 mb-1" }, ce = { class: "flex items-center space-x-4 text-sm text-slate-500 dark:text-slate-400" }, ue = { class: "flex items-center" }, me = { class: "flex items-center" }, he = { class: "flex items-center" }, be = { class: "flex items-center space-x-2" }, pe = /* @__PURE__ */ h({
|
|
87
|
+
__name: "ContentItem",
|
|
88
|
+
props: {
|
|
89
|
+
item: {}
|
|
90
|
+
},
|
|
91
|
+
setup(b) {
|
|
92
|
+
const r = (t) => {
|
|
93
|
+
const i = {
|
|
94
|
+
published: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-300",
|
|
95
|
+
draft: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-300",
|
|
96
|
+
review: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-300"
|
|
97
|
+
};
|
|
98
|
+
return i[t] || i.draft;
|
|
99
|
+
}, o = (t) => {
|
|
100
|
+
if (!t)
|
|
101
|
+
return "--.--.--";
|
|
102
|
+
const i = new Date(t);
|
|
103
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
104
|
+
year: "numeric",
|
|
105
|
+
month: "short",
|
|
106
|
+
day: "numeric"
|
|
107
|
+
}).format(i);
|
|
108
|
+
};
|
|
109
|
+
return (t, i) => {
|
|
110
|
+
const d = S("router-link");
|
|
111
|
+
return l(), c("div", re, [
|
|
112
|
+
e("div", ae, [
|
|
113
|
+
e("div", ie, [
|
|
114
|
+
e("div", ne, [
|
|
115
|
+
e("div", le, a(t.item.type), 1),
|
|
116
|
+
e("div", {
|
|
117
|
+
class: g(r(t.item.status))
|
|
118
|
+
}, a(t.item.status || "--"), 3)
|
|
119
|
+
]),
|
|
120
|
+
e("h3", de, a(t.item.title || "--"), 1),
|
|
121
|
+
e("div", ce, [
|
|
122
|
+
e("span", ue, [
|
|
123
|
+
n(u(w), { class: "w-4 h-4 mr-1" }),
|
|
124
|
+
p(" " + a(t.item.author || "--"), 1)
|
|
125
|
+
]),
|
|
126
|
+
e("span", me, [
|
|
127
|
+
n(u(N), { class: "w-4 h-4 mr-1" }),
|
|
128
|
+
p(" " + a(o(t.item.updated_at) || "--.--.--"), 1)
|
|
129
|
+
]),
|
|
130
|
+
e("span", he, [
|
|
131
|
+
n(u(F), { class: "w-4 h-4 mr-1" }),
|
|
132
|
+
p(" " + a(t.item.views || "--") + " " + a(t.$t("cms.dashboard.views")), 1)
|
|
133
|
+
])
|
|
134
|
+
])
|
|
135
|
+
]),
|
|
136
|
+
e("div", be, [
|
|
137
|
+
n(d, {
|
|
138
|
+
to: `/collections/${t.item.object_id}/${t.item.content_id}`,
|
|
139
|
+
class: "inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors border shadow-sm rounded-md text-xs h-8 w-8 p-0 bg-white border-slate-300 hover:text-accent-foreground hover:bg-slate-50 dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600"
|
|
140
|
+
}, {
|
|
141
|
+
default: A(() => [
|
|
142
|
+
n(u(R), { class: "w-4 h-4 dark:text-blue-50" })
|
|
143
|
+
]),
|
|
144
|
+
_: 1
|
|
145
|
+
}, 8, ["to"])
|
|
146
|
+
])
|
|
147
|
+
])
|
|
148
|
+
]);
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}), ge = { class: "lg:col-span-2" }, _e = { class: "rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm" }, fe = { class: "flex flex-col space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800" }, ve = { class: "flex items-center justify-between" }, xe = { class: "tracking-tight text-xl font-semibold text-slate-800 dark:text-slate-100 flex items-center" }, ke = { class: "p-0" }, we = { class: "divide-y divide-slate-100 dark:divide-slate-700" }, $e = /* @__PURE__ */ h({
|
|
152
|
+
__name: "RecentContent",
|
|
153
|
+
props: {
|
|
154
|
+
content: {}
|
|
155
|
+
},
|
|
156
|
+
setup(b) {
|
|
157
|
+
const r = M(), o = (t) => {
|
|
158
|
+
r.push(t);
|
|
159
|
+
};
|
|
160
|
+
return (t, i) => (l(), c("div", ge, [
|
|
161
|
+
e("div", _e, [
|
|
162
|
+
e("div", fe, [
|
|
163
|
+
e("div", ve, [
|
|
164
|
+
e("h3", xe, [
|
|
165
|
+
n(u(V), { class: "w-5 h-5 mr-2" }),
|
|
166
|
+
p(" " + a(t.$t("cms.dashboard.recentContent")), 1)
|
|
167
|
+
]),
|
|
168
|
+
e("button", {
|
|
169
|
+
onClick: i[0] || (i[0] = (d) => o("/settings/collections")),
|
|
170
|
+
class: "inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border shadow-sm hover:text-accent-foreground h-8 rounded-md px-3 text-xs bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600"
|
|
171
|
+
}, a(t.$t("cms.dashboard.viewAll")), 1)
|
|
172
|
+
])
|
|
173
|
+
]),
|
|
174
|
+
e("div", ke, [
|
|
175
|
+
e("div", we, [
|
|
176
|
+
(l(!0), c(x, null, k(t.content, (d) => (l(), _(pe, {
|
|
177
|
+
key: d.id,
|
|
178
|
+
item: d
|
|
179
|
+
}, null, 8, ["item"]))), 128))
|
|
180
|
+
])
|
|
181
|
+
])
|
|
182
|
+
])
|
|
183
|
+
]));
|
|
184
|
+
}
|
|
185
|
+
}), ye = { class: "rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm" }, Ce = { class: "flex flex-col space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800" }, De = { class: "tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 flex items-center" }, Pe = { class: "p-4" }, Se = { class: "grid grid-cols-2 gap-3" }, Ae = ["onClick"], je = { class: "p-2 rounded-lg bg-blue-50 dark:bg-blue-900/20 mb-2 w-fit" }, Ue = { class: "font-medium text-slate-800 dark:text-slate-100 text-sm mb-1 group-hover:text-slate-900 dark:group-hover:text-slate-50" }, Fe = { class: "text-xs text-slate-500 dark:text-slate-400 group-hover:text-slate-600 dark:group-hover:text-slate-300" }, Me = /* @__PURE__ */ h({
|
|
186
|
+
__name: "QuickActions",
|
|
187
|
+
setup(b) {
|
|
188
|
+
const r = M(), { t: o } = $(), t = [
|
|
189
|
+
{
|
|
190
|
+
id: "create-article",
|
|
191
|
+
title: o("cms.dashboard.createArticle"),
|
|
192
|
+
description: o("cms.dashboard.createArticleDescription"),
|
|
193
|
+
icon: v,
|
|
194
|
+
iconColor: "text-blue-500",
|
|
195
|
+
link: "/collections/pages/create"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: "upload-media",
|
|
199
|
+
title: o("cms.dashboard.uploadMedia"),
|
|
200
|
+
description: o("cms.dashboard.uploadMediaDescription"),
|
|
201
|
+
icon: U,
|
|
202
|
+
iconColor: "text-purple-500",
|
|
203
|
+
link: "/media"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: "manage-users",
|
|
207
|
+
title: o("cms.dashboard.manageUsers"),
|
|
208
|
+
description: o("cms.dashboard.manageUsersDescription"),
|
|
209
|
+
icon: w,
|
|
210
|
+
iconColor: "text-green-500",
|
|
211
|
+
link: "/settings/users"
|
|
212
|
+
}
|
|
213
|
+
], i = (d) => {
|
|
214
|
+
d && r.push(d);
|
|
215
|
+
};
|
|
216
|
+
return (d, m) => (l(), c("div", ye, [
|
|
217
|
+
e("div", Ce, [
|
|
218
|
+
e("h3", De, [
|
|
219
|
+
n(u(z), { class: "w-5 h-5 mr-2" }),
|
|
220
|
+
p(" " + a(d.$t("cms.dashboard.quickActions")), 1)
|
|
221
|
+
])
|
|
222
|
+
]),
|
|
223
|
+
e("div", Pe, [
|
|
224
|
+
e("div", Se, [
|
|
225
|
+
(l(), c(x, null, k(t, (s) => e("button", {
|
|
226
|
+
key: s.id,
|
|
227
|
+
class: "p-3 rounded-lg border border-slate-200 transition-all duration-200 text-left group hover:bg-slate-50 hover:shadow-md dark:border-slate-600 bg-white dark:bg-slate-700 dark:hover:bg-slate-600",
|
|
228
|
+
onClick: (f) => i(s == null ? void 0 : s.link)
|
|
229
|
+
}, [
|
|
230
|
+
e("div", je, [
|
|
231
|
+
(l(), _(j(s == null ? void 0 : s.icon), {
|
|
232
|
+
class: g(`w-4 h-4 ${s == null ? void 0 : s.iconColor}`)
|
|
233
|
+
}, null, 8, ["class"]))
|
|
234
|
+
]),
|
|
235
|
+
e("h3", Ue, a(s == null ? void 0 : s.title), 1),
|
|
236
|
+
e("p", Fe, a(s == null ? void 0 : s.description), 1)
|
|
237
|
+
], 8, Ae)), 64))
|
|
238
|
+
])
|
|
239
|
+
])
|
|
240
|
+
]));
|
|
241
|
+
}
|
|
242
|
+
}), Ie = { class: "w-full max-w-7xl mx-auto space-y-8" }, Te = { class: "grid grid-cols-1 lg:grid-cols-3 gap-6" }, ze = /* @__PURE__ */ h({
|
|
243
|
+
__name: "Dashboard",
|
|
244
|
+
setup(b) {
|
|
245
|
+
const { t: r } = $(), o = P([
|
|
246
|
+
{
|
|
247
|
+
id: "total-content",
|
|
248
|
+
title: r("cms.dashboard.totalContent"),
|
|
249
|
+
value: "2,847",
|
|
250
|
+
description: r("cms.dashboard.articlesPostsPages"),
|
|
251
|
+
change: { value: "+12.5%", isPositive: !0 },
|
|
252
|
+
icon: "file-text",
|
|
253
|
+
color: "blue"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: "active-users",
|
|
257
|
+
title: r("cms.dashboard.activeUsers"),
|
|
258
|
+
value: "1,234",
|
|
259
|
+
description: r("cms.dashboard.monthlyActiveUsers"),
|
|
260
|
+
change: { value: "+8.2%", isPositive: !0 },
|
|
261
|
+
icon: "users",
|
|
262
|
+
color: "emerald"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: "media-files",
|
|
266
|
+
title: r("cms.dashboard.mediaFiles"),
|
|
267
|
+
value: "5,692",
|
|
268
|
+
description: r("cms.dashboard.imagesVideosDocs"),
|
|
269
|
+
change: { value: "+23.1%", isPositive: !0 },
|
|
270
|
+
icon: "image",
|
|
271
|
+
color: "purple"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: "new-media",
|
|
275
|
+
title: r("cms.dashboard.newMediaFiles"),
|
|
276
|
+
value: "89.2K",
|
|
277
|
+
description: r("cms.dashboard.thisMonth"),
|
|
278
|
+
change: { value: "-2.4%", isPositive: !1 },
|
|
279
|
+
icon: "eye",
|
|
280
|
+
color: "orange"
|
|
281
|
+
}
|
|
282
|
+
]), t = P([
|
|
283
|
+
{
|
|
284
|
+
id: 1,
|
|
285
|
+
type: "Article",
|
|
286
|
+
status: "published",
|
|
287
|
+
title: r("cms.dashboard.gettingStartedWithNextJs14"),
|
|
288
|
+
author: r("cms.dashboard.sarahJohnson"),
|
|
289
|
+
updated_at: "2024-01-15",
|
|
290
|
+
views: 1247
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
id: 2,
|
|
294
|
+
type: "Post",
|
|
295
|
+
status: "draft",
|
|
296
|
+
title: r("cms.dashboard.advancedReactPatterns"),
|
|
297
|
+
author: r("cms.dashboard.mikeChen"),
|
|
298
|
+
updated_at: "2024-01-14",
|
|
299
|
+
views: 0
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
id: 3,
|
|
303
|
+
type: "Article",
|
|
304
|
+
status: "published",
|
|
305
|
+
title: r("cms.dashboard.uiUxDesignPrinciples"),
|
|
306
|
+
author: r("cms.dashboard.emmaWilson"),
|
|
307
|
+
updated_at: "2024-01-13",
|
|
308
|
+
views: 892
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
id: 4,
|
|
312
|
+
type: "Post",
|
|
313
|
+
status: "review",
|
|
314
|
+
title: r("cms.dashboard.databaseOptimizationTips"),
|
|
315
|
+
author: r("cms.dashboard.alexRodriguez"),
|
|
316
|
+
updated_at: "2024-01-12",
|
|
317
|
+
views: 0
|
|
318
|
+
}
|
|
319
|
+
]), i = (m) => {
|
|
320
|
+
o.value = o.value.map((s) => {
|
|
321
|
+
var f, y, C, D;
|
|
322
|
+
switch (s.id) {
|
|
323
|
+
case "total-content":
|
|
324
|
+
return { ...s, value: ((f = m.totalContent) == null ? void 0 : f.toLocaleString()) ?? s.value };
|
|
325
|
+
case "active-users":
|
|
326
|
+
return { ...s, value: ((y = m.totalUsers) == null ? void 0 : y.toLocaleString()) ?? s.value };
|
|
327
|
+
case "media-files":
|
|
328
|
+
return { ...s, value: ((C = m.totalMediaFiles) == null ? void 0 : C.toLocaleString()) ?? s.value };
|
|
329
|
+
case "new-media":
|
|
330
|
+
return { ...s, value: ((D = m.newMediaFiles) == null ? void 0 : D.toLocaleString()) ?? s.value };
|
|
331
|
+
default:
|
|
332
|
+
return s;
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
}, d = async () => {
|
|
336
|
+
const s = await (await fetch("api/cms-stat")).json();
|
|
337
|
+
t.value = s.recentContent, i(s.stat);
|
|
338
|
+
};
|
|
339
|
+
return I(() => {
|
|
340
|
+
d();
|
|
341
|
+
}), (m, s) => (l(), c("div", Ie, [
|
|
342
|
+
n(O),
|
|
343
|
+
n(oe, { stats: o.value }, null, 8, ["stats"]),
|
|
344
|
+
e("div", Te, [
|
|
345
|
+
n($e, {
|
|
346
|
+
content: t.value,
|
|
347
|
+
class: "lg:col-span-2"
|
|
348
|
+
}, null, 8, ["content"]),
|
|
349
|
+
e("div", null, [
|
|
350
|
+
n(Me)
|
|
351
|
+
])
|
|
352
|
+
])
|
|
353
|
+
]));
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
export {
|
|
357
|
+
ze as default
|
|
358
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { defineAsyncComponent as k, defineComponent as z, inject as E, ref as u, computed as m, onMounted as S, openBlock as v, createElementBlock as h, createVNode as q, createElementVNode as n, createTextVNode as D, toDisplayString as d, unref as T, Fragment as O, renderList as R, normalizeClass as W, createBlock as J, resolveDynamicComponent as M, createCommentVNode as Y } from "vue";
|
|
2
|
+
import { useRoute as G, useRouter as H } from "vue-router";
|
|
3
|
+
import { useI18n as K } from "vue-i18n";
|
|
4
|
+
import { notify as $ } from "@opengis/core";
|
|
5
|
+
import { _ as P } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-BJh-tjam.js";
|
|
6
|
+
const Q = {
|
|
7
|
+
monaco: k(() => import("./vs-builder-monaco-Cw-f19gc.js")),
|
|
8
|
+
edit: k(() => import("./vs-builder-edit-D-q1o8tF.js")),
|
|
9
|
+
preview: k(() => import("./vs-builder-preview-BH4VAM3a.js"))
|
|
10
|
+
}, X = { class: "mx-auto max-w-[90%]" }, Z = { class: "flex items-center justify-between mb-6" }, ee = { class: "mb-2 text-2xl font-semibold text-gray-900" }, te = { class: "lowercase" }, oe = { class: "text-gray-600" }, ne = { class: "flex items-center gap-2" }, se = { class: "w-full" }, ie = { class: "flex items-center w-full h-10 max-w-md grid-cols-3 p-1 mb-6 bg-white border border-gray-200 rounded-md text-muted-foreground" }, re = ["onClick"], ae = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "mx-auto bg-white rounded-md py-4 px-2 bg-opacity-50"
|
|
13
|
+
}, ve = /* @__PURE__ */ z({
|
|
14
|
+
__name: "EditCollectionPage",
|
|
15
|
+
setup(le) {
|
|
16
|
+
const { t: s } = K(), j = E("cms.fetchContentTypes"), p = u("edit"), r = u({ yaml: "", data: { columns: [], type: "collection" } }), w = u({}), x = u(""), i = G(), b = H(), I = u(!1), _ = u(!0), C = u(""), A = m(() => [
|
|
17
|
+
// {
|
|
18
|
+
// name: "YAML",
|
|
19
|
+
// id: "monaco",
|
|
20
|
+
// },
|
|
21
|
+
{
|
|
22
|
+
name: s("cms.builder.edit"),
|
|
23
|
+
id: "edit"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: s("cms.builder.preview"),
|
|
27
|
+
id: "preview"
|
|
28
|
+
}
|
|
29
|
+
]), a = m(() => {
|
|
30
|
+
if (typeof i.params.collection == "string" && typeof i.params.contentId == "string")
|
|
31
|
+
return i.params.collection;
|
|
32
|
+
const e = i.params.id;
|
|
33
|
+
return e === "edit" ? i.params.collection : e;
|
|
34
|
+
}), g = m(() => typeof i.params.contentId == "string" ? i.params.contentId : null), L = m(() => {
|
|
35
|
+
if (a.value && g.value)
|
|
36
|
+
return `/collections/${a.value}/${g.value}`;
|
|
37
|
+
const e = i.query.from;
|
|
38
|
+
return typeof e == "string" && e.startsWith("/") ? e : null;
|
|
39
|
+
}), N = m(() => {
|
|
40
|
+
if (C.value)
|
|
41
|
+
return C.value;
|
|
42
|
+
const e = i.query.fromLabel;
|
|
43
|
+
return typeof e == "string" && e.trim() ? e.trim() : null;
|
|
44
|
+
}), F = m(() => {
|
|
45
|
+
const o = [
|
|
46
|
+
{
|
|
47
|
+
label: x.value || a.value,
|
|
48
|
+
route: `collections/${a.value}`
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: s("cms.collections.edit")
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
return L.value && N.value && o.splice(1, 0, {
|
|
55
|
+
label: N.value,
|
|
56
|
+
route: L.value
|
|
57
|
+
}), o;
|
|
58
|
+
}), B = (e) => {
|
|
59
|
+
if (e) {
|
|
60
|
+
if (e.startsWith("/")) {
|
|
61
|
+
b.push(e);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
b.push(`/${e}`);
|
|
65
|
+
}
|
|
66
|
+
}, U = async () => {
|
|
67
|
+
var e;
|
|
68
|
+
try {
|
|
69
|
+
if (_.value = !0, !a.value)
|
|
70
|
+
return;
|
|
71
|
+
if (g.value) {
|
|
72
|
+
const f = await fetch(
|
|
73
|
+
`/api/cms/${a.value}/${g.value}`
|
|
74
|
+
);
|
|
75
|
+
if (f.ok) {
|
|
76
|
+
const c = await f.json(), y = Array.isArray(c == null ? void 0 : c.rows) ? c.rows[0] : c;
|
|
77
|
+
y != null && y.title && (C.value = y.title);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const t = await (await fetch(`/api/cms-type/${a.value}`)).json(), l = {
|
|
81
|
+
...t,
|
|
82
|
+
columns: Array.isArray(t.columns) ? t.columns : (e = Object.entries((t == null ? void 0 : t.columns) || {})) == null ? void 0 : e.map(([f, c]) => ({
|
|
83
|
+
...c,
|
|
84
|
+
name: f
|
|
85
|
+
}))
|
|
86
|
+
};
|
|
87
|
+
r.value = {
|
|
88
|
+
...r.value,
|
|
89
|
+
data: l
|
|
90
|
+
}, x.value = l.title || l.name;
|
|
91
|
+
} catch (o) {
|
|
92
|
+
console.error(o);
|
|
93
|
+
} finally {
|
|
94
|
+
_.value = !1, I.value = !0;
|
|
95
|
+
}
|
|
96
|
+
}, V = async () => {
|
|
97
|
+
var e, o;
|
|
98
|
+
try {
|
|
99
|
+
if (await w.value.validate()) {
|
|
100
|
+
$({
|
|
101
|
+
type: "warning",
|
|
102
|
+
title: s("cms.common.actions.warning"),
|
|
103
|
+
message: s("cms.builder.editFieldFailed")
|
|
104
|
+
});
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const l = a.value;
|
|
108
|
+
if (!l)
|
|
109
|
+
return;
|
|
110
|
+
const f = await fetch(
|
|
111
|
+
`/api/cms-type/${l}`,
|
|
112
|
+
{
|
|
113
|
+
method: "PUT",
|
|
114
|
+
headers: {
|
|
115
|
+
"Content-Type": "application/json"
|
|
116
|
+
},
|
|
117
|
+
body: JSON.stringify(p.value === "monaco" ? (e = r.value) == null ? void 0 : e.yaml : (o = r.value) == null ? void 0 : o.data)
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
b.back(), j && j(), $({
|
|
121
|
+
type: "success",
|
|
122
|
+
title: s("cms.common.actions.success"),
|
|
123
|
+
message: s("cms.collections.collectionCreated")
|
|
124
|
+
});
|
|
125
|
+
} catch (t) {
|
|
126
|
+
console.error(t), $({
|
|
127
|
+
type: "error",
|
|
128
|
+
title: s("cms.common.actions.error"),
|
|
129
|
+
message: s("cms.collections.collectionCreationFailed")
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
return S(() => {
|
|
134
|
+
U();
|
|
135
|
+
}), (e, o) => (v(), h("div", X, [
|
|
136
|
+
q(P, {
|
|
137
|
+
items: F.value,
|
|
138
|
+
loading: _.value,
|
|
139
|
+
onNavigate: B
|
|
140
|
+
}, null, 8, ["items", "loading"]),
|
|
141
|
+
n("div", Z, [
|
|
142
|
+
n("div", null, [
|
|
143
|
+
n("h1", ee, [
|
|
144
|
+
D(d(e.$t("cms.builder.editCollection")) + ": ", 1),
|
|
145
|
+
n("span", te, ' "' + d(x.value) + '" ', 1)
|
|
146
|
+
]),
|
|
147
|
+
n("p", oe, d(e.$t("cms.builder.editContentForYourSite")), 1)
|
|
148
|
+
]),
|
|
149
|
+
n("div", ne, [
|
|
150
|
+
n("a", {
|
|
151
|
+
onClick: o[0] || (o[0] = (t) => T(b).back()),
|
|
152
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border bg-background hover:text-accent-foreground h-10 px-4 py-2 border-gray-300 text-gray-700 hover:bg-gray-50"
|
|
153
|
+
}, d(e.$t("cms.common.actions.back")), 1),
|
|
154
|
+
n("button", {
|
|
155
|
+
onClick: V,
|
|
156
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap text-white rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-primary-foreground h-10 px-4 py-2 bg-blue-600 hover:bg-blue-700"
|
|
157
|
+
}, d(e.$t("cms.common.actions.save")), 1)
|
|
158
|
+
])
|
|
159
|
+
]),
|
|
160
|
+
n("div", se, [
|
|
161
|
+
n("div", ie, [
|
|
162
|
+
(v(!0), h(O, null, R(A.value, (t) => (v(), h("button", {
|
|
163
|
+
key: t.id,
|
|
164
|
+
onClick: (l) => p.value = t.id,
|
|
165
|
+
class: W([
|
|
166
|
+
"inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700 data-[state=active]:border-blue-200",
|
|
167
|
+
t.id === p.value ? "bg-blue-50 text-blue-700 border-blue-200" : ""
|
|
168
|
+
])
|
|
169
|
+
}, d(t.name), 11, re))), 128))
|
|
170
|
+
])
|
|
171
|
+
]),
|
|
172
|
+
I.value ? (v(), h("div", ae, [
|
|
173
|
+
(v(), J(M(T(Q)[p.value]), {
|
|
174
|
+
yaml: r.value.yaml,
|
|
175
|
+
"onUpdate:yaml": o[1] || (o[1] = (t) => r.value.yaml = t),
|
|
176
|
+
data: r.value.data,
|
|
177
|
+
"onUpdate:data": o[2] || (o[2] = (t) => r.value.data = t),
|
|
178
|
+
form: w.value,
|
|
179
|
+
"onUpdate:form": o[3] || (o[3] = (t) => w.value = t)
|
|
180
|
+
}, null, 40, ["yaml", "data", "form"]))
|
|
181
|
+
])) : Y("", !0)
|
|
182
|
+
]));
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
export {
|
|
186
|
+
ve as default
|
|
187
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { defineComponent as g, ref as m, openBlock as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { _ as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const C = { class: "space-y-6 max-w-7xl mx-auto" }, M = { class: "flex items-center justify-between" }, N = { class: "flex items-center gap-4" }, $ = { class: "text-2xl font-semibold text-gray-900 dark:text-white" }, j = { class: "flex items-center space-x-3" }, A = { class: "max-w-[1000px]" }, D = /* @__PURE__ */ g({
|
|
1
|
+
import { defineComponent as g, defineAsyncComponent as v, ref as m, openBlock as y, createElementBlock as x, createElementVNode as o, unref as a, createVNode as c, toDisplayString as d, createTextVNode as w } from "vue";
|
|
2
|
+
import { useRouter as b, useRoute as k } from "vue-router";
|
|
3
|
+
import { ArrowLeft as _, Save as V } from "lucide-vue-next";
|
|
4
|
+
import { useI18n as q } from "vue-i18n";
|
|
5
|
+
import { notify as l } from "@opengis/core";
|
|
6
|
+
import { inputs as C, VForm as E } from "@opengis/form";
|
|
7
|
+
const M = { class: "space-y-6 max-w-7xl mx-auto" }, S = { class: "flex items-center justify-between" }, A = { class: "flex items-center gap-4" }, N = { class: "text-2xl font-semibold text-gray-900 dark:text-white" }, $ = { class: "flex items-center space-x-3" }, j = { class: "max-w-[1000px]" }, D = /* @__PURE__ */ g({
|
|
9
8
|
__name: "MenuAddPage",
|
|
10
|
-
setup(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
setup(F) {
|
|
10
|
+
const p = v(
|
|
11
|
+
() => import("./MonacoEditor-ByPT8pnv.js")
|
|
12
|
+
);
|
|
13
|
+
C["vs-input-monaco-editor"] = p;
|
|
14
|
+
const { t: e } = q(), u = b();
|
|
15
|
+
k();
|
|
16
|
+
const f = m([
|
|
15
17
|
{
|
|
16
18
|
key: "name",
|
|
17
19
|
title: e("cms.menu.form.name"),
|
|
@@ -48,63 +50,66 @@ const C = { class: "space-y-6 max-w-7xl mx-auto" }, M = { class: "flex items-cen
|
|
|
48
50
|
language: "yaml",
|
|
49
51
|
theme: "vs-light"
|
|
50
52
|
}
|
|
51
|
-
]), r = m({}), i = m({}),
|
|
53
|
+
]), r = m({}), i = m({}), h = async () => {
|
|
52
54
|
try {
|
|
53
55
|
if (await i.value.validate()) {
|
|
54
|
-
|
|
56
|
+
l({
|
|
55
57
|
type: "warning",
|
|
56
58
|
title: e("cms.common.actions.warning"),
|
|
57
59
|
message: e("cms.menu.createMenuFailed")
|
|
58
60
|
});
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
|
-
await fetch("/api/cms-menu", {
|
|
63
|
+
const t = await fetch("/api/cms-menu", {
|
|
62
64
|
method: "POST",
|
|
63
65
|
headers: {
|
|
64
66
|
"Content-Type": "application/json"
|
|
65
67
|
},
|
|
66
68
|
body: JSON.stringify(r.value)
|
|
67
|
-
})
|
|
69
|
+
});
|
|
70
|
+
if (!t.ok)
|
|
71
|
+
throw new Error(`Failed to create menu: ${t.status}`);
|
|
72
|
+
l({
|
|
68
73
|
title: e("cms.common.success"),
|
|
69
74
|
type: "success",
|
|
70
75
|
message: e("cms.common.successMessage")
|
|
71
76
|
}), r.value = {}, u.push("/menu");
|
|
72
77
|
} catch (s) {
|
|
73
|
-
console.log(s),
|
|
78
|
+
console.log(s), l({
|
|
74
79
|
title: e("cms.common.error"),
|
|
75
80
|
type: "error",
|
|
76
81
|
message: e("cms.common.errorMessage")
|
|
77
82
|
});
|
|
78
83
|
}
|
|
79
84
|
};
|
|
80
|
-
return (s,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
onClick:
|
|
85
|
+
return (s, t) => (y(), x("div", M, [
|
|
86
|
+
o("div", S, [
|
|
87
|
+
o("div", A, [
|
|
88
|
+
o("button", {
|
|
89
|
+
onClick: t[0] || (t[0] = (n) => a(u).back()),
|
|
85
90
|
class: "p-2 text-gray-500 rounded-full hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
86
91
|
}, [
|
|
87
|
-
|
|
92
|
+
c(a(_), { class: "w-5 h-5" })
|
|
88
93
|
]),
|
|
89
|
-
|
|
94
|
+
o("h1", N, d(s.$t("cms.menu.menuAdd")), 1)
|
|
90
95
|
]),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
onClick:
|
|
96
|
+
o("div", $, [
|
|
97
|
+
o("button", {
|
|
98
|
+
onClick: h,
|
|
94
99
|
class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
|
|
95
100
|
}, [
|
|
96
|
-
|
|
97
|
-
|
|
101
|
+
c(a(V), { class: "w-4 h-4 mr-2" }),
|
|
102
|
+
w(" " + d(s.$t("cms.common.actions.save")), 1)
|
|
98
103
|
])
|
|
99
104
|
])
|
|
100
105
|
]),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
schema:
|
|
106
|
+
o("div", j, [
|
|
107
|
+
c(a(E), {
|
|
108
|
+
schema: f.value,
|
|
104
109
|
modelValue: r.value,
|
|
105
|
-
"onUpdate:modelValue":
|
|
110
|
+
"onUpdate:modelValue": t[1] || (t[1] = (n) => r.value = n),
|
|
106
111
|
form: i.value,
|
|
107
|
-
"onUpdate:form":
|
|
112
|
+
"onUpdate:form": t[2] || (t[2] = (n) => i.value = n)
|
|
108
113
|
}, null, 8, ["schema", "modelValue", "form"])
|
|
109
114
|
])
|
|
110
115
|
]));
|