@dskripchenko/laravel-admin 1.1.20 → 1.1.21
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1098 -1082
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { defineStore as ne, createPinia as
|
|
3
|
-
import { RouterLink as
|
|
4
|
-
import { UidMenu as mt, UidMenuItem as Oe, UidMenuSeparator as
|
|
5
|
-
import
|
|
1
|
+
import { ref as R, computed as v, defineComponent as L, openBlock as o, createElementBlock as c, createElementVNode as d, createBlock as b, unref as r, withCtx as m, Fragment as P, renderList as D, createTextVNode as S, toDisplayString as h, createCommentVNode as U, createVNode as $, renderSlot as Y, resolveDynamicComponent as se, normalizeClass as Z, createSlots as qe, h as Lt, watch as ee, onBeforeUnmount as Pt, resolveComponent as rt, Transition as Ze, withModifiers as ut, nextTick as _e, onMounted as Re, withKeys as Mt, normalizeProps as Fe, mergeProps as Ue, normalizeStyle as Te, inject as dt, provide as Nt, createApp as Bt, reactive as It } from "vue";
|
|
2
|
+
import { defineStore as ne, createPinia as Dt } from "pinia";
|
|
3
|
+
import { RouterLink as Vt, useRouter as ie, useRoute as be, createWebHistory as ct, createRouter as zt } from "vue-router";
|
|
4
|
+
import { UidMenu as mt, UidMenuItem as Oe, UidMenuSeparator as qt, UidAvatar as ft, UidSidebar as Ot, UidSidebarGroup as Wt, UidSidebarItem as jt, UidSidebarLayout as Kt, UidCard as K, UidButton as z, UidAlert as te, UidInput as de, UidCheckbox as vt, UidSkeleton as We, UidErrorState as Gt, UidEmptyState as Ht, UidTable as je, UidPagination as Xt, UidBadge as Ke, UidSelect as Ee, UidStat as Ce, UidHeatmap as Yt, UidGauge as Jt, UidFormField as ke, UidTextarea as Qt, UidNumberInput as Zt, UidDatePicker as en, UidStack as tn, UidGrid as nn, UidTabs as pt, UidTabPanel as gt, UidTab as Ae, UidDescriptionList as an, UidDescriptionItem as ln, UidDrawer as sn, UidStepper as on, UidFileUpload as rn, UidProgress as un } from "@dskripchenko/ui";
|
|
5
|
+
import dn from "axios";
|
|
6
6
|
import { p as ht, u as ce } from "./formState-DGNcH1XQ.js";
|
|
7
|
-
import { t as
|
|
7
|
+
import { t as So } from "./formState-DGNcH1XQ.js";
|
|
8
8
|
let ye = null;
|
|
9
|
-
function
|
|
9
|
+
function cn(e) {
|
|
10
10
|
ye = e;
|
|
11
11
|
}
|
|
12
12
|
function H() {
|
|
@@ -16,14 +16,14 @@ function H() {
|
|
|
16
16
|
);
|
|
17
17
|
return ye;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Ji() {
|
|
20
20
|
ye = null;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Qi() {
|
|
23
23
|
return ye !== null;
|
|
24
24
|
}
|
|
25
25
|
const Ge = ne("admin-theme", () => {
|
|
26
|
-
const e =
|
|
26
|
+
const e = R("light"), t = R(["light", "dark"]), n = v(() => e.value === "dark");
|
|
27
27
|
function s(u) {
|
|
28
28
|
e.value = u.theme, t.value = u.availableThemes, i(u.theme);
|
|
29
29
|
}
|
|
@@ -39,8 +39,8 @@ const Ge = ne("admin-theme", () => {
|
|
|
39
39
|
a(u);
|
|
40
40
|
try {
|
|
41
41
|
await H().post("/system/setTheme", { theme: u });
|
|
42
|
-
} catch (
|
|
43
|
-
throw a(f),
|
|
42
|
+
} catch (p) {
|
|
43
|
+
throw a(f), p;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
function i(u) {
|
|
@@ -54,7 +54,7 @@ const Ge = ne("admin-theme", () => {
|
|
|
54
54
|
applyLocal: a,
|
|
55
55
|
setTheme: l
|
|
56
56
|
};
|
|
57
|
-
}),
|
|
57
|
+
}), mn = ["aria-label", "aria-pressed"], fn = ["data-icon"], _t = /* @__PURE__ */ L({
|
|
58
58
|
__name: "ThemeToggle",
|
|
59
59
|
setup(e) {
|
|
60
60
|
const t = Ge(), n = v(() => t.current === "dark"), s = v(() => n.value ? "sun" : "moon"), a = v(
|
|
@@ -74,11 +74,11 @@ const Ge = ne("admin-theme", () => {
|
|
|
74
74
|
d("span", {
|
|
75
75
|
class: "admin-topbar__icon",
|
|
76
76
|
"data-icon": s.value
|
|
77
|
-
}, null, 8,
|
|
78
|
-
], 8,
|
|
77
|
+
}, null, 8, fn)
|
|
78
|
+
], 8, mn));
|
|
79
79
|
}
|
|
80
80
|
}), He = ne("admin-locale", () => {
|
|
81
|
-
const e =
|
|
81
|
+
const e = R("ru"), t = R(["ru", "en"]);
|
|
82
82
|
function n(i) {
|
|
83
83
|
e.value = i.locale, t.value = i.availableLocales, l(i.locale);
|
|
84
84
|
}
|
|
@@ -112,7 +112,7 @@ const Ge = ne("admin-theme", () => {
|
|
|
112
112
|
applyLocal: s,
|
|
113
113
|
setLocale: a
|
|
114
114
|
};
|
|
115
|
-
}),
|
|
115
|
+
}), vn = {
|
|
116
116
|
type: "button",
|
|
117
117
|
class: "admin-topbar__icon-btn",
|
|
118
118
|
style: { width: "auto", padding: "0 8px", gap: "4px", "font-size": "12px" },
|
|
@@ -126,12 +126,12 @@ const Ge = ne("admin-theme", () => {
|
|
|
126
126
|
}
|
|
127
127
|
return (s, a) => (o(), b(r(mt), null, {
|
|
128
128
|
trigger: m(() => [
|
|
129
|
-
d("button",
|
|
129
|
+
d("button", vn, [
|
|
130
130
|
a[0] || (a[0] = d("span", {
|
|
131
131
|
class: "admin-topbar__icon",
|
|
132
132
|
"data-icon": "globe"
|
|
133
133
|
}, null, -1)),
|
|
134
|
-
d("span", null,
|
|
134
|
+
d("span", null, h((r(t).current ?? "").toUpperCase()), 1)
|
|
135
135
|
])
|
|
136
136
|
]),
|
|
137
137
|
default: m(() => [
|
|
@@ -140,7 +140,7 @@ const Ge = ne("admin-theme", () => {
|
|
|
140
140
|
onClick: (i) => n(l)
|
|
141
141
|
}, {
|
|
142
142
|
default: m(() => [
|
|
143
|
-
|
|
143
|
+
S(h(l.toUpperCase()), 1)
|
|
144
144
|
]),
|
|
145
145
|
_: 2
|
|
146
146
|
}, 1032, ["onClick"]))), 128))
|
|
@@ -149,48 +149,48 @@ const Ge = ne("admin-theme", () => {
|
|
|
149
149
|
}));
|
|
150
150
|
}
|
|
151
151
|
}), Xe = ne("admin-notifications", () => {
|
|
152
|
-
const e =
|
|
153
|
-
function i(
|
|
154
|
-
t.value =
|
|
152
|
+
const e = R([]), t = R(0), n = R(!1), s = R("all"), a = R(null), l = v(() => t.value > 0);
|
|
153
|
+
function i(x) {
|
|
154
|
+
t.value = x.unread_notifications_count;
|
|
155
155
|
}
|
|
156
|
-
async function u(
|
|
156
|
+
async function u(x = "all", C = 1) {
|
|
157
157
|
n.value = !0;
|
|
158
158
|
try {
|
|
159
|
-
const
|
|
160
|
-
e.value =
|
|
161
|
-
page:
|
|
162
|
-
per_page:
|
|
163
|
-
total:
|
|
164
|
-
last_page:
|
|
165
|
-
}, s.value =
|
|
159
|
+
const g = await H().get(`/notifications/list?type=${x}&page=${C}`);
|
|
160
|
+
e.value = g.data, t.value = g.meta.unread_count, a.value = {
|
|
161
|
+
page: g.meta.page,
|
|
162
|
+
per_page: g.meta.per_page,
|
|
163
|
+
total: g.meta.total,
|
|
164
|
+
last_page: g.meta.last_page
|
|
165
|
+
}, s.value = x;
|
|
166
166
|
} finally {
|
|
167
167
|
n.value = !1;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
async function f() {
|
|
171
|
-
const
|
|
171
|
+
const C = await H().get(
|
|
172
172
|
"/notifications/unread"
|
|
173
173
|
);
|
|
174
|
-
t.value =
|
|
174
|
+
t.value = C.count, s.value === "unread" && (e.value = C.data);
|
|
175
175
|
}
|
|
176
|
-
async function
|
|
177
|
-
await H().post("/notifications/markAsRead", { id:
|
|
178
|
-
const
|
|
179
|
-
|
|
176
|
+
async function p(x) {
|
|
177
|
+
await H().post("/notifications/markAsRead", { id: x });
|
|
178
|
+
const _ = e.value.find((g) => g.id === x);
|
|
179
|
+
_ && _.read_at === null && (_.read_at = (/* @__PURE__ */ new Date()).toISOString(), t.value = Math.max(0, t.value - 1));
|
|
180
180
|
}
|
|
181
|
-
async function
|
|
181
|
+
async function y() {
|
|
182
182
|
await H().post("/notifications/markAllAsRead");
|
|
183
|
-
const
|
|
184
|
-
for (const
|
|
185
|
-
|
|
183
|
+
const C = (/* @__PURE__ */ new Date()).toISOString();
|
|
184
|
+
for (const _ of e.value)
|
|
185
|
+
_.read_at === null && (_.read_at = C);
|
|
186
186
|
t.value = 0;
|
|
187
187
|
}
|
|
188
|
-
async function k(
|
|
189
|
-
await H().post("/notifications/destroy", { id:
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
const
|
|
193
|
-
e.value.splice(
|
|
188
|
+
async function k(x) {
|
|
189
|
+
await H().post("/notifications/destroy", { id: x });
|
|
190
|
+
const _ = e.value.findIndex((g) => g.id === x);
|
|
191
|
+
if (_ !== -1) {
|
|
192
|
+
const g = e.value[_].read_at === null;
|
|
193
|
+
e.value.splice(_, 1), g && (t.value = Math.max(0, t.value - 1));
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
return {
|
|
@@ -203,18 +203,18 @@ const Ge = ne("admin-theme", () => {
|
|
|
203
203
|
hydrate: i,
|
|
204
204
|
load: u,
|
|
205
205
|
loadUnread: f,
|
|
206
|
-
markAsRead:
|
|
207
|
-
markAllAsRead:
|
|
206
|
+
markAsRead: p,
|
|
207
|
+
markAllAsRead: y,
|
|
208
208
|
destroy: k
|
|
209
209
|
};
|
|
210
|
-
}),
|
|
210
|
+
}), pn = ["title"], gn = /* @__PURE__ */ L({
|
|
211
211
|
__name: "NotificationBell",
|
|
212
212
|
setup(e) {
|
|
213
213
|
const t = Xe(), n = v(() => {
|
|
214
214
|
const s = t.unreadCount;
|
|
215
215
|
return s <= 0 ? null : s > 99 ? "99+" : String(s);
|
|
216
216
|
});
|
|
217
|
-
return (s, a) => (o(), b(r(
|
|
217
|
+
return (s, a) => (o(), b(r(Vt), {
|
|
218
218
|
to: "/notifications",
|
|
219
219
|
class: "admin-topbar__icon-btn",
|
|
220
220
|
"aria-label": "Уведомления"
|
|
@@ -228,7 +228,7 @@ const Ge = ne("admin-theme", () => {
|
|
|
228
228
|
key: 0,
|
|
229
229
|
class: "admin-topbar__bell-badge",
|
|
230
230
|
title: `Непрочитанных: ${r(t).unreadCount}`
|
|
231
|
-
},
|
|
231
|
+
}, h(n.value), 9, pn)) : U("", !0)
|
|
232
232
|
]),
|
|
233
233
|
_: 1
|
|
234
234
|
}));
|
|
@@ -247,12 +247,12 @@ class bt extends ae {
|
|
|
247
247
|
super(401, t), this.name = "UnauthenticatedError";
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
class
|
|
250
|
+
class hn extends ae {
|
|
251
251
|
constructor(t) {
|
|
252
252
|
super(403, t), this.name = "ForbiddenError";
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
class
|
|
255
|
+
class _n extends ae {
|
|
256
256
|
constructor(t) {
|
|
257
257
|
super(404, t), this.name = "NotFoundError";
|
|
258
258
|
}
|
|
@@ -281,9 +281,9 @@ function et(e, t) {
|
|
|
281
281
|
case 401:
|
|
282
282
|
return new bt(t);
|
|
283
283
|
case 403:
|
|
284
|
-
return new gn(t);
|
|
285
|
-
case 404:
|
|
286
284
|
return new hn(t);
|
|
285
|
+
case 404:
|
|
286
|
+
return new _n(t);
|
|
287
287
|
case 422:
|
|
288
288
|
return new Le(t);
|
|
289
289
|
default:
|
|
@@ -291,67 +291,67 @@ function et(e, t) {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
const Q = ne("admin-auth", () => {
|
|
294
|
-
const e =
|
|
295
|
-
function l(
|
|
296
|
-
e.value =
|
|
294
|
+
const e = R(null), t = R([]), n = R(null), s = v(() => e.value !== null), a = v(() => n.value !== null);
|
|
295
|
+
function l(_) {
|
|
296
|
+
e.value = _.user, t.value = _.permissions;
|
|
297
297
|
}
|
|
298
|
-
function i(
|
|
299
|
-
return t.value.includes("*") || t.value.includes(
|
|
300
|
-
if (!
|
|
301
|
-
const
|
|
302
|
-
return
|
|
298
|
+
function i(_) {
|
|
299
|
+
return t.value.includes("*") || t.value.includes(_) ? !0 : t.value.some((g) => {
|
|
300
|
+
if (!g.endsWith(".*")) return !1;
|
|
301
|
+
const F = g.slice(0, -1);
|
|
302
|
+
return _.startsWith(F);
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
|
-
function u(
|
|
306
|
-
return
|
|
305
|
+
function u(_) {
|
|
306
|
+
return _.some(i);
|
|
307
307
|
}
|
|
308
|
-
function f(
|
|
309
|
-
return
|
|
308
|
+
function f(_) {
|
|
309
|
+
return _.every(i);
|
|
310
310
|
}
|
|
311
|
-
async function
|
|
312
|
-
const
|
|
311
|
+
async function p(_) {
|
|
312
|
+
const g = H();
|
|
313
313
|
try {
|
|
314
|
-
const
|
|
314
|
+
const F = await g.post(
|
|
315
315
|
"/auth/login",
|
|
316
|
-
|
|
316
|
+
_
|
|
317
317
|
);
|
|
318
|
-
return
|
|
319
|
-
} catch (
|
|
320
|
-
if (
|
|
321
|
-
const q =
|
|
318
|
+
return F?.user && (e.value = F.user), Array.isArray(F?.permissions) && (t.value = F.permissions), n.value = null, "authenticated";
|
|
319
|
+
} catch (F) {
|
|
320
|
+
if (F instanceof ae && F.errorKey === "two_factor_required") {
|
|
321
|
+
const q = F.payload.challenge_token;
|
|
322
322
|
return n.value = {
|
|
323
323
|
challengeToken: typeof q == "string" ? q : "",
|
|
324
|
-
remember:
|
|
324
|
+
remember: _.remember ?? !1
|
|
325
325
|
}, "two_factor_required";
|
|
326
326
|
}
|
|
327
|
-
throw
|
|
327
|
+
throw F;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
async function _
|
|
330
|
+
async function y(_) {
|
|
331
331
|
if (n.value === null)
|
|
332
332
|
throw new Error("No pending 2FA challenge");
|
|
333
|
-
const
|
|
333
|
+
const F = await H().post("/auth/twoFactorChallenge", {
|
|
334
334
|
challenge_token: n.value.challengeToken,
|
|
335
|
-
code:
|
|
335
|
+
code: _
|
|
336
336
|
});
|
|
337
|
-
e.value =
|
|
337
|
+
e.value = F.user, n.value = null;
|
|
338
338
|
}
|
|
339
|
-
async function k(
|
|
339
|
+
async function k(_) {
|
|
340
340
|
if (n.value === null)
|
|
341
341
|
throw new Error("No pending 2FA challenge");
|
|
342
|
-
const
|
|
342
|
+
const F = await H().post("/auth/twoFactorRecovery", {
|
|
343
343
|
challenge_token: n.value.challengeToken,
|
|
344
|
-
recovery_code:
|
|
344
|
+
recovery_code: _
|
|
345
345
|
});
|
|
346
|
-
return e.value =
|
|
346
|
+
return e.value = F.user, n.value = null, { remaining: F.recovery_codes_remaining };
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function x() {
|
|
349
349
|
n.value = null;
|
|
350
350
|
}
|
|
351
|
-
async function
|
|
352
|
-
const
|
|
351
|
+
async function C() {
|
|
352
|
+
const _ = H();
|
|
353
353
|
try {
|
|
354
|
-
await
|
|
354
|
+
await _.post("/auth/logout");
|
|
355
355
|
} finally {
|
|
356
356
|
e.value = null, t.value = [], n.value = null;
|
|
357
357
|
}
|
|
@@ -369,19 +369,19 @@ const Q = ne("admin-auth", () => {
|
|
|
369
369
|
hasPermission: i,
|
|
370
370
|
hasAnyPermission: u,
|
|
371
371
|
hasAllPermissions: f,
|
|
372
|
-
login:
|
|
373
|
-
twoFactorChallenge:
|
|
372
|
+
login: p,
|
|
373
|
+
twoFactorChallenge: y,
|
|
374
374
|
twoFactorRecovery: k,
|
|
375
|
-
cancelChallenge:
|
|
376
|
-
logout:
|
|
375
|
+
cancelChallenge: x,
|
|
376
|
+
logout: C
|
|
377
377
|
};
|
|
378
|
-
}),
|
|
378
|
+
}), yn = {
|
|
379
379
|
type: "button",
|
|
380
380
|
class: "admin-topbar__icon-btn admin-user-menu__trigger",
|
|
381
381
|
"aria-label": "Меню пользователя",
|
|
382
382
|
"aria-haspopup": "menu",
|
|
383
383
|
style: { width: "auto", padding: "0 4px", gap: "8px" }
|
|
384
|
-
},
|
|
384
|
+
}, bn = /* @__PURE__ */ L({
|
|
385
385
|
__name: "UserMenu",
|
|
386
386
|
setup(e) {
|
|
387
387
|
const t = Q(), n = ie();
|
|
@@ -397,7 +397,7 @@ const Q = ne("admin-auth", () => {
|
|
|
397
397
|
}
|
|
398
398
|
return (l, i) => (o(), b(r(mt), null, {
|
|
399
399
|
trigger: m(() => [
|
|
400
|
-
d("button",
|
|
400
|
+
d("button", yn, [
|
|
401
401
|
$(r(ft), {
|
|
402
402
|
src: r(t).user?.avatar ?? void 0,
|
|
403
403
|
name: r(t).user?.name ?? "?",
|
|
@@ -409,17 +409,17 @@ const Q = ne("admin-auth", () => {
|
|
|
409
409
|
default: m(() => [
|
|
410
410
|
$(r(Oe), { onClick: a }, {
|
|
411
411
|
default: m(() => [...i[0] || (i[0] = [
|
|
412
|
-
|
|
412
|
+
S("Профиль", -1)
|
|
413
413
|
])]),
|
|
414
414
|
_: 1
|
|
415
415
|
}),
|
|
416
|
-
$(r(
|
|
416
|
+
$(r(qt)),
|
|
417
417
|
$(r(Oe), {
|
|
418
418
|
variant: "danger",
|
|
419
419
|
onClick: s
|
|
420
420
|
}, {
|
|
421
421
|
default: m(() => [...i[1] || (i[1] = [
|
|
422
|
-
|
|
422
|
+
S("Выйти", -1)
|
|
423
423
|
])]),
|
|
424
424
|
_: 1
|
|
425
425
|
})
|
|
@@ -427,10 +427,10 @@ const Q = ne("admin-auth", () => {
|
|
|
427
427
|
_: 1
|
|
428
428
|
}));
|
|
429
429
|
}
|
|
430
|
-
}),
|
|
430
|
+
}), kn = { class: "admin-topbar" }, wn = { class: "admin-topbar__breadcrumbs" }, $n = {
|
|
431
431
|
key: 0,
|
|
432
432
|
class: "sep"
|
|
433
|
-
},
|
|
433
|
+
}, xn = /* @__PURE__ */ L({
|
|
434
434
|
__name: "AdminTopBar",
|
|
435
435
|
props: {
|
|
436
436
|
breadcrumbs: { default: () => [] },
|
|
@@ -439,7 +439,7 @@ const Q = ne("admin-auth", () => {
|
|
|
439
439
|
emits: ["toggle-sidebar"],
|
|
440
440
|
setup(e, { emit: t }) {
|
|
441
441
|
const n = e, s = t, a = v(() => n.breadcrumbs.length - 1);
|
|
442
|
-
return (l, i) => (o(), c("header",
|
|
442
|
+
return (l, i) => (o(), c("header", kn, [
|
|
443
443
|
e.showCollapseToggle ? (o(), c("button", {
|
|
444
444
|
key: 0,
|
|
445
445
|
type: "button",
|
|
@@ -451,17 +451,17 @@ const Q = ne("admin-auth", () => {
|
|
|
451
451
|
class: "admin-topbar__icon",
|
|
452
452
|
"data-icon": "panel-left"
|
|
453
453
|
}, null, -1)
|
|
454
|
-
])])) :
|
|
455
|
-
d("div",
|
|
454
|
+
])])) : U("", !0),
|
|
455
|
+
d("div", wn, [
|
|
456
456
|
Y(l.$slots, "breadcrumbs", {}, () => [
|
|
457
457
|
(o(!0), c(P, null, D(e.breadcrumbs, (u, f) => (o(), c(P, { key: f }, [
|
|
458
|
-
f > 0 ? (o(), c("span",
|
|
458
|
+
f > 0 ? (o(), c("span", $n, "›")) : U("", !0),
|
|
459
459
|
(o(), b(se(u.to ? "a" : "span"), {
|
|
460
460
|
href: typeof u.to == "string" ? u.to : void 0,
|
|
461
461
|
class: Z(f === a.value ? "cur" : "")
|
|
462
462
|
}, {
|
|
463
463
|
default: m(() => [
|
|
464
|
-
|
|
464
|
+
S(h(u.label), 1)
|
|
465
465
|
]),
|
|
466
466
|
_: 2
|
|
467
467
|
}, 1032, ["href", "class"]))
|
|
@@ -484,49 +484,49 @@ const Q = ne("admin-auth", () => {
|
|
|
484
484
|
], -1))
|
|
485
485
|
]),
|
|
486
486
|
Y(l.$slots, "actions"),
|
|
487
|
-
$(
|
|
487
|
+
$(gn),
|
|
488
488
|
$(_t),
|
|
489
489
|
$(yt),
|
|
490
|
-
$(
|
|
490
|
+
$(bn)
|
|
491
491
|
]));
|
|
492
492
|
}
|
|
493
493
|
}), kt = ne("admin-menu", () => {
|
|
494
|
-
const e =
|
|
495
|
-
const
|
|
496
|
-
if (Array.isArray(k.permissions) && k.permissions.length > 0 && !
|
|
494
|
+
const e = R([]), t = R(!1), n = R(null), s = R(!1), a = v(() => {
|
|
495
|
+
const p = Q(), y = (k) => {
|
|
496
|
+
if (Array.isArray(k.permissions) && k.permissions.length > 0 && !p.hasAnyPermission(k.permissions))
|
|
497
497
|
return null;
|
|
498
|
-
const
|
|
499
|
-
return { ...k, children:
|
|
498
|
+
const x = (k.children ?? []).map(y).filter((C) => C !== null);
|
|
499
|
+
return { ...k, children: x };
|
|
500
500
|
};
|
|
501
|
-
return e.value.map(
|
|
501
|
+
return e.value.map(y).filter((k) => k !== null);
|
|
502
502
|
}), l = v(() => {
|
|
503
|
-
const
|
|
503
|
+
const p = /* @__PURE__ */ new Map();
|
|
504
504
|
for (const k of a.value) {
|
|
505
|
-
const
|
|
506
|
-
|
|
505
|
+
const x = k.group ?? null;
|
|
506
|
+
p.has(x) || p.set(x, []), p.get(x).push(k);
|
|
507
507
|
}
|
|
508
|
-
const
|
|
509
|
-
for (const [k,
|
|
510
|
-
|
|
511
|
-
const
|
|
512
|
-
return
|
|
513
|
-
}),
|
|
514
|
-
return
|
|
508
|
+
const y = [];
|
|
509
|
+
for (const [k, x] of p)
|
|
510
|
+
x.sort((C, _) => {
|
|
511
|
+
const g = (C.order ?? 0) - (_.order ?? 0);
|
|
512
|
+
return g !== 0 ? g : C.label.localeCompare(_.label);
|
|
513
|
+
}), y.push({ group: k, items: x });
|
|
514
|
+
return y;
|
|
515
515
|
});
|
|
516
|
-
async function i(
|
|
517
|
-
if (s.value && !
|
|
516
|
+
async function i(p = !1) {
|
|
517
|
+
if (s.value && !p) return e.value;
|
|
518
518
|
t.value = !0, n.value = null;
|
|
519
519
|
try {
|
|
520
520
|
const k = await H().get("/system/menu");
|
|
521
521
|
return e.value = Array.isArray(k.items) ? k.items : [], s.value = !0, e.value;
|
|
522
|
-
} catch (
|
|
523
|
-
throw n.value =
|
|
522
|
+
} catch (y) {
|
|
523
|
+
throw n.value = y instanceof Error ? y : new Error(String(y)), y;
|
|
524
524
|
} finally {
|
|
525
525
|
t.value = !1;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
function u(
|
|
529
|
-
e.value =
|
|
528
|
+
function u(p) {
|
|
529
|
+
e.value = p, s.value = !0, n.value = null;
|
|
530
530
|
}
|
|
531
531
|
function f() {
|
|
532
532
|
e.value = [], s.value = !1, n.value = null, t.value = !1;
|
|
@@ -542,16 +542,16 @@ const Q = ne("admin-auth", () => {
|
|
|
542
542
|
setItems: u,
|
|
543
543
|
reset: f
|
|
544
544
|
};
|
|
545
|
-
}),
|
|
545
|
+
}), Sn = { class: "admin-sidebar-brand" }, Cn = { class: "admin-sidebar-brand__mark" }, An = {
|
|
546
546
|
key: 0,
|
|
547
547
|
class: "admin-sidebar-brand__name"
|
|
548
|
-
},
|
|
548
|
+
}, En = {
|
|
549
549
|
key: 0,
|
|
550
550
|
class: "admin-sidebar-tenant"
|
|
551
|
-
},
|
|
551
|
+
}, Rn = { class: "admin-sidebar-foot" }, Fn = {
|
|
552
552
|
key: 0,
|
|
553
553
|
class: "admin-sidebar-foot__text"
|
|
554
|
-
}, Un = ["href"],
|
|
554
|
+
}, Un = ["href"], Tn = /* @__PURE__ */ L({
|
|
555
555
|
__name: "AdminSidebar",
|
|
556
556
|
props: {
|
|
557
557
|
collapsed: { type: Boolean, default: !1 },
|
|
@@ -568,37 +568,37 @@ const Q = ne("admin-auth", () => {
|
|
|
568
568
|
}
|
|
569
569
|
function l(u) {
|
|
570
570
|
if (u)
|
|
571
|
-
return () =>
|
|
571
|
+
return () => Lt("span", { class: "admin-sidebar__icon", "data-icon": u });
|
|
572
572
|
}
|
|
573
573
|
function i(u) {
|
|
574
574
|
if (u.url) return u.url;
|
|
575
575
|
if (u.routeName) return { name: u.routeName };
|
|
576
576
|
}
|
|
577
|
-
return (u, f) => (o(), b(r(
|
|
577
|
+
return (u, f) => (o(), b(r(Ot), { collapsed: e.collapsed }, qe({
|
|
578
578
|
header: m(() => [
|
|
579
|
-
d("div",
|
|
580
|
-
d("div",
|
|
581
|
-
e.collapsed ?
|
|
579
|
+
d("div", Sn, [
|
|
580
|
+
d("div", Cn, h(e.brandMark), 1),
|
|
581
|
+
e.collapsed ? U("", !0) : (o(), c("div", An, h(e.brandName), 1))
|
|
582
582
|
]),
|
|
583
|
-
e.tenant && !e.collapsed ? (o(), c("div",
|
|
584
|
-
d("span", null,
|
|
585
|
-
d("b", null,
|
|
586
|
-
])) :
|
|
583
|
+
e.tenant && !e.collapsed ? (o(), c("div", En, [
|
|
584
|
+
d("span", null, h(e.tenant.label), 1),
|
|
585
|
+
d("b", null, h(e.tenant.name), 1)
|
|
586
|
+
])) : U("", !0)
|
|
587
587
|
]),
|
|
588
588
|
nav: m(() => [
|
|
589
|
-
(o(!0), c(P, null, D(s.value, (
|
|
590
|
-
key: `grp-${
|
|
591
|
-
title:
|
|
589
|
+
(o(!0), c(P, null, D(s.value, (p, y) => (o(), b(r(Wt), {
|
|
590
|
+
key: `grp-${y}`,
|
|
591
|
+
title: p.group ?? void 0
|
|
592
592
|
}, {
|
|
593
593
|
default: m(() => [
|
|
594
|
-
(o(!0), c(P, null, D(
|
|
594
|
+
(o(!0), c(P, null, D(p.items, (k) => (o(), b(r(jt), {
|
|
595
595
|
key: k.key,
|
|
596
596
|
to: i(k),
|
|
597
597
|
active: a(k),
|
|
598
598
|
badge: k.badge ?? void 0
|
|
599
599
|
}, qe({
|
|
600
600
|
default: m(() => [
|
|
601
|
-
|
|
601
|
+
S(" " + h(k.label), 1)
|
|
602
602
|
]),
|
|
603
603
|
_: 2
|
|
604
604
|
}, [
|
|
@@ -619,24 +619,24 @@ const Q = ne("admin-auth", () => {
|
|
|
619
619
|
e.version || e.docsUrl ? {
|
|
620
620
|
name: "footer",
|
|
621
621
|
fn: m(() => [
|
|
622
|
-
d("div",
|
|
623
|
-
e.version ? (o(), c("span", Fn,
|
|
622
|
+
d("div", Rn, [
|
|
623
|
+
e.version ? (o(), c("span", Fn, h(e.version), 1)) : U("", !0),
|
|
624
624
|
e.docsUrl ? (o(), c("a", {
|
|
625
625
|
key: 1,
|
|
626
626
|
href: e.docsUrl,
|
|
627
627
|
class: "admin-sidebar-foot__text admin-sidebar-foot__link"
|
|
628
|
-
}, " Docs ", 8, Un)) :
|
|
628
|
+
}, " Docs ", 8, Un)) : U("", !0)
|
|
629
629
|
])
|
|
630
630
|
]),
|
|
631
631
|
key: "0"
|
|
632
632
|
} : void 0
|
|
633
633
|
]), 1032, ["collapsed"]));
|
|
634
634
|
}
|
|
635
|
-
}),
|
|
635
|
+
}), Ln = { class: "admin-shell-root" }, Pn = {
|
|
636
636
|
key: 0,
|
|
637
637
|
class: "admin-impersonation-banner",
|
|
638
638
|
role: "status"
|
|
639
|
-
}, Ie = "data-admin-impersonating",
|
|
639
|
+
}, Ie = "data-admin-impersonating", Mn = /* @__PURE__ */ L({
|
|
640
640
|
__name: "AdminShell",
|
|
641
641
|
props: {
|
|
642
642
|
collapsed: { type: Boolean, default: !1 },
|
|
@@ -657,33 +657,33 @@ const Q = ne("admin-auth", () => {
|
|
|
657
657
|
typeof document > "u" || (i !== null ? document.documentElement.setAttribute(Ie, "true") : document.documentElement.removeAttribute(Ie));
|
|
658
658
|
},
|
|
659
659
|
{ immediate: !0 }
|
|
660
|
-
),
|
|
660
|
+
), Pt(() => {
|
|
661
661
|
typeof document < "u" && document.documentElement.removeAttribute(Ie);
|
|
662
|
-
}), (i, u) => (o(), c("div",
|
|
663
|
-
e.impersonation ? (o(), c("div",
|
|
662
|
+
}), (i, u) => (o(), c("div", Ln, [
|
|
663
|
+
e.impersonation ? (o(), c("div", Pn, [
|
|
664
664
|
d("span", null, [
|
|
665
|
-
u[1] || (u[1] =
|
|
666
|
-
d("b", null,
|
|
667
|
-
u[2] || (u[2] =
|
|
665
|
+
u[1] || (u[1] = S(" Вы вошли как ", -1)),
|
|
666
|
+
d("b", null, h(e.impersonation.asName), 1),
|
|
667
|
+
u[2] || (u[2] = S(" · режим имперсонации ", -1))
|
|
668
668
|
]),
|
|
669
669
|
d("button", {
|
|
670
670
|
type: "button",
|
|
671
671
|
class: "admin-impersonation-banner__exit",
|
|
672
672
|
onClick: l
|
|
673
673
|
}, " Выйти из режима ")
|
|
674
|
-
])) :
|
|
674
|
+
])) : U("", !0),
|
|
675
675
|
$(r(Kt), {
|
|
676
676
|
"model-value": e.collapsed,
|
|
677
677
|
"onUpdate:modelValue": a
|
|
678
678
|
}, {
|
|
679
679
|
sidebar: m(() => [
|
|
680
680
|
Y(i.$slots, "sidebar", {}, () => [
|
|
681
|
-
$(
|
|
681
|
+
$(Tn, { collapsed: e.collapsed }, null, 8, ["collapsed"])
|
|
682
682
|
])
|
|
683
683
|
]),
|
|
684
684
|
header: m(() => [
|
|
685
685
|
Y(i.$slots, "topbar", {}, () => [
|
|
686
|
-
$(
|
|
686
|
+
$(xn, {
|
|
687
687
|
onToggleSidebar: u[0] || (u[0] = (f) => a(!e.collapsed))
|
|
688
688
|
})
|
|
689
689
|
])
|
|
@@ -696,7 +696,7 @@ const Q = ne("admin-auth", () => {
|
|
|
696
696
|
]));
|
|
697
697
|
}
|
|
698
698
|
}), Ye = ne("admin-navigation", () => {
|
|
699
|
-
const e =
|
|
699
|
+
const e = R(0), t = v(() => e.value > 0);
|
|
700
700
|
function n() {
|
|
701
701
|
e.value += 1;
|
|
702
702
|
}
|
|
@@ -707,10 +707,10 @@ const Q = ne("admin-auth", () => {
|
|
|
707
707
|
e.value = 0;
|
|
708
708
|
}
|
|
709
709
|
return { pending: e, isLoading: t, start: n, end: s, reset: a };
|
|
710
|
-
}),
|
|
710
|
+
}), Nn = /* @__PURE__ */ L({
|
|
711
711
|
__name: "AdminLoadingBar",
|
|
712
712
|
setup(e) {
|
|
713
|
-
const t = Ye(), n =
|
|
713
|
+
const t = Ye(), n = R(!1);
|
|
714
714
|
let s = null;
|
|
715
715
|
ee(
|
|
716
716
|
() => t.isLoading,
|
|
@@ -731,17 +731,17 @@ const Q = ne("admin-auth", () => {
|
|
|
731
731
|
"aria-busy": "true"
|
|
732
732
|
}, null, 2));
|
|
733
733
|
}
|
|
734
|
-
}),
|
|
734
|
+
}), Bn = { class: "admin-page-host" }, In = /* @__PURE__ */ L({
|
|
735
735
|
__name: "AdminApp",
|
|
736
736
|
setup(e) {
|
|
737
737
|
const t = be(), n = v(() => !(t.meta?.fullscreen === !0 || t.meta?.kind === "auth" || t.name === "admin.notFound"));
|
|
738
738
|
return (s, a) => {
|
|
739
739
|
const l = rt("router-view");
|
|
740
740
|
return o(), c(P, null, [
|
|
741
|
-
$(
|
|
742
|
-
n.value ? (o(), b(
|
|
741
|
+
$(Nn),
|
|
742
|
+
n.value ? (o(), b(Mn, { key: 0 }, {
|
|
743
743
|
default: m(() => [
|
|
744
|
-
d("div",
|
|
744
|
+
d("div", Bn, [
|
|
745
745
|
$(l, null, {
|
|
746
746
|
default: m(({ Component: i }) => [
|
|
747
747
|
$(Ze, { name: "admin-page" }, {
|
|
@@ -771,30 +771,30 @@ const Q = ne("admin-auth", () => {
|
|
|
771
771
|
};
|
|
772
772
|
}
|
|
773
773
|
}), oe = ne("admin-manifest", () => {
|
|
774
|
-
const e =
|
|
775
|
-
function
|
|
776
|
-
return l.value.find((
|
|
774
|
+
const e = R(null), t = R(!1), n = R(null), s = v(() => e.value !== null), a = v(() => e.value?.version ?? null), l = v(() => e.value?.resources ?? []), i = v(() => e.value?.screens ?? []), u = v(() => e.value?.settings ?? []), f = v(() => e.value?.plugins ?? []);
|
|
775
|
+
function p(_) {
|
|
776
|
+
return l.value.find((g) => g.slug === _) ?? null;
|
|
777
777
|
}
|
|
778
|
-
function _
|
|
779
|
-
return i.value.find((
|
|
778
|
+
function y(_) {
|
|
779
|
+
return i.value.find((g) => g.slug === _) ?? null;
|
|
780
780
|
}
|
|
781
|
-
function k(
|
|
782
|
-
return u.value.find((
|
|
781
|
+
function k(_) {
|
|
782
|
+
return u.value.find((g) => g.slug === _) ?? null;
|
|
783
783
|
}
|
|
784
|
-
async function
|
|
785
|
-
if (e.value !== null && !
|
|
784
|
+
async function x(_ = !1) {
|
|
785
|
+
if (e.value !== null && !_)
|
|
786
786
|
return e.value;
|
|
787
787
|
t.value = !0, n.value = null;
|
|
788
788
|
try {
|
|
789
|
-
const
|
|
790
|
-
return e.value =
|
|
791
|
-
} catch (
|
|
792
|
-
throw n.value =
|
|
789
|
+
const F = await H().get("/system/manifest");
|
|
790
|
+
return e.value = F, F;
|
|
791
|
+
} catch (g) {
|
|
792
|
+
throw n.value = g instanceof Error ? g : new Error(String(g)), g;
|
|
793
793
|
} finally {
|
|
794
794
|
t.value = !1;
|
|
795
795
|
}
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function C() {
|
|
798
798
|
e.value = null, n.value = null, t.value = !1;
|
|
799
799
|
}
|
|
800
800
|
return {
|
|
@@ -810,55 +810,55 @@ const Q = ne("admin-auth", () => {
|
|
|
810
810
|
settings: u,
|
|
811
811
|
plugins: f,
|
|
812
812
|
// actions
|
|
813
|
-
getResource:
|
|
814
|
-
getScreen:
|
|
813
|
+
getResource: p,
|
|
814
|
+
getScreen: y,
|
|
815
815
|
getSettings: k,
|
|
816
|
-
load:
|
|
817
|
-
reset:
|
|
816
|
+
load: x,
|
|
817
|
+
reset: C
|
|
818
818
|
};
|
|
819
|
-
}),
|
|
819
|
+
}), Dn = { class: "admin-home" }, Vn = { class: "admin-home__title" }, zn = {
|
|
820
820
|
key: 0,
|
|
821
821
|
class: "admin-home__resources"
|
|
822
|
-
},
|
|
822
|
+
}, qn = { class: "admin-home__grid" }, On = ["onClick"], Wn = { class: "admin-home__card-label" }, jn = { class: "admin-home__card-slug" }, Kn = /* @__PURE__ */ L({
|
|
823
823
|
__name: "HomePage",
|
|
824
824
|
setup(e) {
|
|
825
825
|
const t = oe(), n = Q(), s = ie(), a = v(() => n.user?.name ?? ""), l = v(() => t.manifest?.resources ?? []);
|
|
826
|
-
return (i, u) => (o(), c("div",
|
|
827
|
-
$(r(
|
|
826
|
+
return (i, u) => (o(), c("div", Dn, [
|
|
827
|
+
$(r(K), {
|
|
828
828
|
padding: "lg",
|
|
829
829
|
class: "admin-home__hero"
|
|
830
830
|
}, {
|
|
831
831
|
default: m(() => [
|
|
832
|
-
d("h1",
|
|
832
|
+
d("h1", Vn, "Добро пожаловать" + h(a.value ? ", " + a.value : ""), 1),
|
|
833
833
|
u[0] || (u[0] = d("p", { class: "admin-home__lead" }, " Админ-панель готова. Воспользуйтесь сайдбаром или переходите к ресурсам ниже. ", -1))
|
|
834
834
|
]),
|
|
835
835
|
_: 1
|
|
836
836
|
}),
|
|
837
|
-
l.value.length ? (o(), c("section",
|
|
837
|
+
l.value.length ? (o(), c("section", zn, [
|
|
838
838
|
u[1] || (u[1] = d("h2", { class: "admin-home__heading" }, "Ресурсы", -1)),
|
|
839
|
-
d("ul",
|
|
839
|
+
d("ul", qn, [
|
|
840
840
|
(o(!0), c(P, null, D(l.value, (f) => (o(), c("li", {
|
|
841
841
|
key: f.slug
|
|
842
842
|
}, [
|
|
843
843
|
d("button", {
|
|
844
844
|
type: "button",
|
|
845
845
|
class: "admin-home__card",
|
|
846
|
-
onClick: (
|
|
846
|
+
onClick: (p) => r(s).push({ name: `admin.resource.${f.slug}.index` })
|
|
847
847
|
}, [
|
|
848
|
-
d("span",
|
|
849
|
-
d("span",
|
|
850
|
-
], 8,
|
|
848
|
+
d("span", Wn, h(f.label), 1),
|
|
849
|
+
d("span", jn, h(f.slug), 1)
|
|
850
|
+
], 8, On)
|
|
851
851
|
]))), 128))
|
|
852
852
|
])
|
|
853
|
-
])) :
|
|
853
|
+
])) : U("", !0)
|
|
854
854
|
]));
|
|
855
855
|
}
|
|
856
|
-
}),
|
|
856
|
+
}), Gn = { class: "admin-status-page" }, Hn = /* @__PURE__ */ L({
|
|
857
857
|
__name: "ForbiddenPage",
|
|
858
858
|
setup(e) {
|
|
859
859
|
const t = ie();
|
|
860
|
-
return (n, s) => (o(), c("div",
|
|
861
|
-
$(r(
|
|
860
|
+
return (n, s) => (o(), c("div", Gn, [
|
|
861
|
+
$(r(K), {
|
|
862
862
|
padding: "lg",
|
|
863
863
|
class: "admin-status-page__card"
|
|
864
864
|
}, {
|
|
@@ -870,7 +870,7 @@ const Q = ne("admin-auth", () => {
|
|
|
870
870
|
onClick: s[0] || (s[0] = (a) => r(t).replace({ name: "admin.home" }))
|
|
871
871
|
}, {
|
|
872
872
|
default: m(() => [...s[1] || (s[1] = [
|
|
873
|
-
|
|
873
|
+
S(" На главную ", -1)
|
|
874
874
|
])]),
|
|
875
875
|
_: 1
|
|
876
876
|
})
|
|
@@ -879,12 +879,12 @@ const Q = ne("admin-auth", () => {
|
|
|
879
879
|
})
|
|
880
880
|
]));
|
|
881
881
|
}
|
|
882
|
-
}),
|
|
882
|
+
}), Xn = { class: "admin-status-page" }, Yn = /* @__PURE__ */ L({
|
|
883
883
|
__name: "NotFoundPage",
|
|
884
884
|
setup(e) {
|
|
885
885
|
const t = ie();
|
|
886
|
-
return (n, s) => (o(), c("div",
|
|
887
|
-
$(r(
|
|
886
|
+
return (n, s) => (o(), c("div", Xn, [
|
|
887
|
+
$(r(K), {
|
|
888
888
|
padding: "lg",
|
|
889
889
|
class: "admin-status-page__card"
|
|
890
890
|
}, {
|
|
@@ -896,7 +896,7 @@ const Q = ne("admin-auth", () => {
|
|
|
896
896
|
onClick: s[0] || (s[0] = (a) => r(t).replace({ name: "admin.home" }))
|
|
897
897
|
}, {
|
|
898
898
|
default: m(() => [...s[1] || (s[1] = [
|
|
899
|
-
|
|
899
|
+
S(" На главную ", -1)
|
|
900
900
|
])]),
|
|
901
901
|
_: 1
|
|
902
902
|
})
|
|
@@ -905,51 +905,51 @@ const Q = ne("admin-auth", () => {
|
|
|
905
905
|
})
|
|
906
906
|
]));
|
|
907
907
|
}
|
|
908
|
-
}),
|
|
908
|
+
}), Jn = { class: "admin-settings-page" }, Qn = { class: "admin-settings-page__title" }, Zn = {
|
|
909
909
|
key: 0,
|
|
910
910
|
class: "admin-settings-page__hint"
|
|
911
|
-
},
|
|
911
|
+
}, ea = {
|
|
912
912
|
key: 1,
|
|
913
913
|
class: "admin-settings-page__debug"
|
|
914
|
-
},
|
|
914
|
+
}, ta = /* @__PURE__ */ L({
|
|
915
915
|
__name: "SettingsPage",
|
|
916
916
|
setup(e) {
|
|
917
917
|
const t = be(), n = oe(), s = v(() => String(t.params.slug ?? "")), a = v(() => n.manifest?.settings?.find((l) => l.slug === s.value) ?? null);
|
|
918
|
-
return (l, i) => (o(), c("div",
|
|
919
|
-
$(r(
|
|
918
|
+
return (l, i) => (o(), c("div", Jn, [
|
|
919
|
+
$(r(K), { padding: "lg" }, {
|
|
920
920
|
default: m(() => [
|
|
921
|
-
d("h1",
|
|
922
|
-
a.value ? (o(), c("pre",
|
|
921
|
+
d("h1", Qn, h(a.value?.label ?? s.value), 1),
|
|
922
|
+
a.value ? (o(), c("pre", ea, h(JSON.stringify(a.value.fields, null, 2)), 1)) : (o(), c("p", Zn, " Settings «" + h(s.value) + "» не найдено в manifest'е. ", 1))
|
|
923
923
|
]),
|
|
924
924
|
_: 1
|
|
925
925
|
})
|
|
926
926
|
]));
|
|
927
927
|
}
|
|
928
|
-
}),
|
|
928
|
+
}), na = { class: "admin-status-page" }, aa = { class: "admin-status-page__title" }, la = { class: "admin-status-page__hint" }, sa = /* @__PURE__ */ L({
|
|
929
929
|
__name: "UnknownScreenPage",
|
|
930
930
|
setup(e) {
|
|
931
931
|
const t = be(), n = v(() => String(t.params.slug ?? "")), s = v(() => String(t.meta?.title ?? n.value));
|
|
932
|
-
return (a, l) => (o(), c("div",
|
|
933
|
-
$(r(
|
|
932
|
+
return (a, l) => (o(), c("div", na, [
|
|
933
|
+
$(r(K), {
|
|
934
934
|
padding: "lg",
|
|
935
935
|
class: "admin-status-page__card"
|
|
936
936
|
}, {
|
|
937
937
|
default: m(() => [
|
|
938
|
-
d("h1",
|
|
939
|
-
d("p",
|
|
940
|
-
|
|
941
|
-
l[0] || (l[0] = d("code", null, "createAdminApp(" +
|
|
942
|
-
l[1] || (l[1] =
|
|
938
|
+
d("h1", aa, h(s.value), 1),
|
|
939
|
+
d("p", la, [
|
|
940
|
+
S(" Это заглушка для screen «" + h(n.value) + "». Передайте свой компонент через ", 1),
|
|
941
|
+
l[0] || (l[0] = d("code", null, "createAdminApp(" + h("{") + " pages: " + h("{") + " screen: MyScreen " + h("}") + " " + h("}") + ")", -1)),
|
|
942
|
+
l[1] || (l[1] = S(". ", -1))
|
|
943
943
|
])
|
|
944
944
|
]),
|
|
945
945
|
_: 1
|
|
946
946
|
})
|
|
947
947
|
]));
|
|
948
948
|
}
|
|
949
|
-
}),
|
|
949
|
+
}), ia = { class: "admin-auth-card__row" }, oa = ["href"], ra = {
|
|
950
950
|
key: 1,
|
|
951
951
|
style: { "text-align": "center", "font-size": "var(--uid-font-size-xs)", color: "var(--uid-text-secondary)", "padding-top": "4px" }
|
|
952
|
-
},
|
|
952
|
+
}, ua = ["href"], da = /* @__PURE__ */ L({
|
|
953
953
|
__name: "LoginForm",
|
|
954
954
|
props: {
|
|
955
955
|
forgotUrl: { default: null },
|
|
@@ -958,28 +958,28 @@ const Q = ne("admin-auth", () => {
|
|
|
958
958
|
},
|
|
959
959
|
emits: ["success"],
|
|
960
960
|
setup(e, { emit: t }) {
|
|
961
|
-
const n = t, s = Q(), a =
|
|
962
|
-
async function
|
|
961
|
+
const n = t, s = Q(), a = R(""), l = R(""), i = R(!1), u = R(!1), f = R(null), p = R({}), y = v(() => p.value.email?.[0]), k = v(() => p.value.password?.[0]);
|
|
962
|
+
async function x() {
|
|
963
963
|
if (!u.value) {
|
|
964
|
-
u.value = !0, f.value = null,
|
|
964
|
+
u.value = !0, f.value = null, p.value = {};
|
|
965
965
|
try {
|
|
966
|
-
const
|
|
966
|
+
const C = await s.login({
|
|
967
967
|
email: a.value,
|
|
968
968
|
password: l.value,
|
|
969
969
|
remember: i.value
|
|
970
970
|
});
|
|
971
|
-
n("success",
|
|
972
|
-
} catch (
|
|
973
|
-
|
|
971
|
+
n("success", C);
|
|
972
|
+
} catch (C) {
|
|
973
|
+
C instanceof Le ? (p.value = C.fields, f.value = C.firstFieldMessage()) : C instanceof Pe ? f.value = "Нет соединения с сервером" : C instanceof ae ? f.value = C.message || "Не удалось войти" : f.value = C.message;
|
|
974
974
|
} finally {
|
|
975
975
|
u.value = !1;
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
|
-
return (
|
|
979
|
+
return (C, _) => (o(), c("form", {
|
|
980
980
|
class: "admin-auth-card__bd",
|
|
981
981
|
novalidate: "",
|
|
982
|
-
onSubmit: ut(
|
|
982
|
+
onSubmit: ut(x, ["prevent"])
|
|
983
983
|
}, [
|
|
984
984
|
f.value ? (o(), b(r(te), {
|
|
985
985
|
key: 0,
|
|
@@ -988,25 +988,25 @@ const Q = ne("admin-auth", () => {
|
|
|
988
988
|
role: "alert"
|
|
989
989
|
}, {
|
|
990
990
|
default: m(() => [
|
|
991
|
-
|
|
991
|
+
S(h(f.value), 1)
|
|
992
992
|
]),
|
|
993
993
|
_: 1
|
|
994
|
-
})) :
|
|
994
|
+
})) : U("", !0),
|
|
995
995
|
$(r(de), {
|
|
996
996
|
modelValue: a.value,
|
|
997
|
-
"onUpdate:modelValue":
|
|
997
|
+
"onUpdate:modelValue": _[0] || (_[0] = (g) => a.value = g),
|
|
998
998
|
type: "email",
|
|
999
999
|
label: "Email",
|
|
1000
1000
|
placeholder: "you@company.com",
|
|
1001
1001
|
autocomplete: "username",
|
|
1002
1002
|
required: !0,
|
|
1003
1003
|
disabled: u.value,
|
|
1004
|
-
error:
|
|
1004
|
+
error: y.value,
|
|
1005
1005
|
name: "email"
|
|
1006
1006
|
}, null, 8, ["modelValue", "disabled", "error"]),
|
|
1007
1007
|
$(r(de), {
|
|
1008
1008
|
modelValue: l.value,
|
|
1009
|
-
"onUpdate:modelValue":
|
|
1009
|
+
"onUpdate:modelValue": _[1] || (_[1] = (g) => l.value = g),
|
|
1010
1010
|
type: "password",
|
|
1011
1011
|
label: "Пароль",
|
|
1012
1012
|
autocomplete: "current-password",
|
|
@@ -1015,14 +1015,14 @@ const Q = ne("admin-auth", () => {
|
|
|
1015
1015
|
error: k.value,
|
|
1016
1016
|
name: "password"
|
|
1017
1017
|
}, null, 8, ["modelValue", "disabled", "error"]),
|
|
1018
|
-
d("div",
|
|
1018
|
+
d("div", ia, [
|
|
1019
1019
|
$(r(vt), {
|
|
1020
1020
|
modelValue: i.value,
|
|
1021
|
-
"onUpdate:modelValue":
|
|
1021
|
+
"onUpdate:modelValue": _[2] || (_[2] = (g) => i.value = g),
|
|
1022
1022
|
disabled: u.value
|
|
1023
1023
|
}, {
|
|
1024
|
-
default: m(() => [...
|
|
1025
|
-
|
|
1024
|
+
default: m(() => [..._[3] || (_[3] = [
|
|
1025
|
+
S(" Запомнить меня ", -1)
|
|
1026
1026
|
])]),
|
|
1027
1027
|
_: 1
|
|
1028
1028
|
}, 8, ["modelValue", "disabled"]),
|
|
@@ -1030,7 +1030,7 @@ const Q = ne("admin-auth", () => {
|
|
|
1030
1030
|
key: 0,
|
|
1031
1031
|
href: e.forgotUrl,
|
|
1032
1032
|
class: "admin-auth-card__link"
|
|
1033
|
-
}, " Забыли пароль? ", 8,
|
|
1033
|
+
}, " Забыли пароль? ", 8, oa)) : U("", !0)
|
|
1034
1034
|
]),
|
|
1035
1035
|
$(r(z), {
|
|
1036
1036
|
type: "submit",
|
|
@@ -1040,35 +1040,35 @@ const Q = ne("admin-auth", () => {
|
|
|
1040
1040
|
disabled: u.value
|
|
1041
1041
|
}, {
|
|
1042
1042
|
default: m(() => [
|
|
1043
|
-
|
|
1043
|
+
S(h(u.value ? "Вход…" : "Войти"), 1)
|
|
1044
1044
|
]),
|
|
1045
1045
|
_: 1
|
|
1046
1046
|
}, 8, ["loading", "disabled"]),
|
|
1047
|
-
e.ssoLinkLabel && e.ssoUrl ? (o(), c("div",
|
|
1048
|
-
|
|
1047
|
+
e.ssoLinkLabel && e.ssoUrl ? (o(), c("div", ra, [
|
|
1048
|
+
_[4] || (_[4] = S(" или войдите через ", -1)),
|
|
1049
1049
|
d("a", {
|
|
1050
1050
|
href: e.ssoUrl,
|
|
1051
1051
|
class: "admin-auth-card__link"
|
|
1052
|
-
},
|
|
1053
|
-
])) :
|
|
1052
|
+
}, h(e.ssoLinkLabel), 9, ua)
|
|
1053
|
+
])) : U("", !0)
|
|
1054
1054
|
], 32));
|
|
1055
1055
|
}
|
|
1056
|
-
}),
|
|
1056
|
+
}), ca = ["value", "disabled", "aria-label", "onInput", "onKeydown"], ma = { class: "admin-auth-card__row" }, fa = /* @__PURE__ */ L({
|
|
1057
1057
|
__name: "TwoFactorForm",
|
|
1058
1058
|
emits: ["success", "cancel"],
|
|
1059
1059
|
setup(e, { emit: t }) {
|
|
1060
|
-
const n = t, s = Q(), a =
|
|
1061
|
-
function
|
|
1060
|
+
const n = t, s = Q(), a = R("totp"), l = R(["", "", "", "", "", ""]), i = R(""), u = R([]), f = R(!1), p = R(null), y = R(null), k = v(() => l.value.join("")), x = v(() => a.value === "totp" ? k.value.length === 6 : i.value.trim().length > 0);
|
|
1061
|
+
function C(w, V) {
|
|
1062
1062
|
V instanceof HTMLInputElement && (u.value[w] = V);
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1064
|
+
function _(w, V) {
|
|
1065
1065
|
const W = V.target, G = W.value.replace(/\D/g, "").slice(-1);
|
|
1066
1066
|
l.value[w] = G, W.value = G, G && w < l.value.length - 1 && _e(() => u.value[w + 1]?.focus()), k.value.length === l.value.length && q();
|
|
1067
1067
|
}
|
|
1068
|
-
function
|
|
1068
|
+
function g(w, V) {
|
|
1069
1069
|
V.key === "Backspace" && !l.value[w] && w > 0 ? _e(() => u.value[w - 1]?.focus()) : V.key === "ArrowLeft" && w > 0 ? (u.value[w - 1]?.focus(), V.preventDefault()) : V.key === "ArrowRight" && w < l.value.length - 1 && (u.value[w + 1]?.focus(), V.preventDefault());
|
|
1070
1070
|
}
|
|
1071
|
-
function
|
|
1071
|
+
function F(w) {
|
|
1072
1072
|
const W = (w.clipboardData?.getData("text") ?? "").replace(/\D/g, "").slice(0, l.value.length);
|
|
1073
1073
|
if (W.length !== 0) {
|
|
1074
1074
|
w.preventDefault();
|
|
@@ -1080,18 +1080,18 @@ const Q = ne("admin-auth", () => {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
async function q() {
|
|
1083
|
-
if (!(f.value || !
|
|
1084
|
-
f.value = !0,
|
|
1083
|
+
if (!(f.value || !x.value)) {
|
|
1084
|
+
f.value = !0, p.value = null;
|
|
1085
1085
|
try {
|
|
1086
1086
|
if (a.value === "totp")
|
|
1087
1087
|
await s.twoFactorChallenge(k.value);
|
|
1088
1088
|
else {
|
|
1089
1089
|
const w = await s.twoFactorRecovery(i.value.trim());
|
|
1090
|
-
|
|
1090
|
+
y.value = w.remaining;
|
|
1091
1091
|
}
|
|
1092
1092
|
n("success");
|
|
1093
1093
|
} catch (w) {
|
|
1094
|
-
w instanceof Le ?
|
|
1094
|
+
w instanceof Le ? p.value = w.firstFieldMessage() ?? "Неверный код" : w instanceof Pe ? p.value = "Нет соединения с сервером" : w instanceof ae ? p.value = w.message || "Не удалось проверить код" : p.value = w.message;
|
|
1095
1095
|
} finally {
|
|
1096
1096
|
f.value = !1;
|
|
1097
1097
|
}
|
|
@@ -1101,44 +1101,44 @@ const Q = ne("admin-auth", () => {
|
|
|
1101
1101
|
s.cancelChallenge(), n("cancel");
|
|
1102
1102
|
}
|
|
1103
1103
|
function T() {
|
|
1104
|
-
a.value = a.value === "totp" ? "recovery" : "totp",
|
|
1104
|
+
a.value = a.value === "totp" ? "recovery" : "totp", p.value = null;
|
|
1105
1105
|
}
|
|
1106
1106
|
return (w, V) => (o(), c("form", {
|
|
1107
1107
|
class: "admin-auth-card__bd",
|
|
1108
1108
|
novalidate: "",
|
|
1109
1109
|
onSubmit: ut(q, ["prevent"])
|
|
1110
1110
|
}, [
|
|
1111
|
-
|
|
1111
|
+
p.value ? (o(), b(r(te), {
|
|
1112
1112
|
key: 0,
|
|
1113
1113
|
variant: "danger",
|
|
1114
1114
|
class: "admin-auth-card__alert",
|
|
1115
1115
|
role: "alert"
|
|
1116
1116
|
}, {
|
|
1117
1117
|
default: m(() => [
|
|
1118
|
-
|
|
1118
|
+
S(h(p.value), 1)
|
|
1119
1119
|
]),
|
|
1120
1120
|
_: 1
|
|
1121
|
-
})) :
|
|
1122
|
-
|
|
1121
|
+
})) : U("", !0),
|
|
1122
|
+
y.value !== null ? (o(), b(r(te), {
|
|
1123
1123
|
key: 1,
|
|
1124
1124
|
variant: "info",
|
|
1125
1125
|
class: "admin-auth-card__alert",
|
|
1126
1126
|
role: "status"
|
|
1127
1127
|
}, {
|
|
1128
1128
|
default: m(() => [
|
|
1129
|
-
|
|
1129
|
+
S(" Использован recovery-код. Осталось: " + h(y.value), 1)
|
|
1130
1130
|
]),
|
|
1131
1131
|
_: 1
|
|
1132
|
-
})) :
|
|
1132
|
+
})) : U("", !0),
|
|
1133
1133
|
a.value === "totp" ? (o(), c("div", {
|
|
1134
1134
|
key: 2,
|
|
1135
1135
|
class: "admin-code-input",
|
|
1136
|
-
onPaste:
|
|
1136
|
+
onPaste: F
|
|
1137
1137
|
}, [
|
|
1138
1138
|
(o(!0), c(P, null, D(l.value, (W, G) => (o(), c("input", {
|
|
1139
1139
|
key: G,
|
|
1140
1140
|
ref_for: !0,
|
|
1141
|
-
ref: (
|
|
1141
|
+
ref: (A) => C(G, A),
|
|
1142
1142
|
value: l.value[G],
|
|
1143
1143
|
type: "text",
|
|
1144
1144
|
inputmode: "numeric",
|
|
@@ -1146,9 +1146,9 @@ const Q = ne("admin-auth", () => {
|
|
|
1146
1146
|
maxlength: "1",
|
|
1147
1147
|
disabled: f.value,
|
|
1148
1148
|
"aria-label": `Цифра ${G + 1}`,
|
|
1149
|
-
onInput: (
|
|
1150
|
-
onKeydown: (
|
|
1151
|
-
}, null, 40,
|
|
1149
|
+
onInput: (A) => _(G, A),
|
|
1150
|
+
onKeydown: (A) => g(G, A)
|
|
1151
|
+
}, null, 40, ca))), 128))
|
|
1152
1152
|
], 32)) : (o(), b(r(de), {
|
|
1153
1153
|
key: 3,
|
|
1154
1154
|
modelValue: i.value,
|
|
@@ -1164,23 +1164,23 @@ const Q = ne("admin-auth", () => {
|
|
|
1164
1164
|
variant: "primary",
|
|
1165
1165
|
size: "lg",
|
|
1166
1166
|
loading: f.value,
|
|
1167
|
-
disabled: f.value || !
|
|
1167
|
+
disabled: f.value || !x.value
|
|
1168
1168
|
}, {
|
|
1169
1169
|
default: m(() => [
|
|
1170
|
-
|
|
1170
|
+
S(h(f.value ? "Проверка…" : "Подтвердить"), 1)
|
|
1171
1171
|
]),
|
|
1172
1172
|
_: 1
|
|
1173
1173
|
}, 8, ["loading", "disabled"]),
|
|
1174
|
-
d("div",
|
|
1174
|
+
d("div", ma, [
|
|
1175
1175
|
d("button", {
|
|
1176
1176
|
type: "button",
|
|
1177
1177
|
class: "admin-auth-card__link",
|
|
1178
1178
|
onClick: T
|
|
1179
1179
|
}, [
|
|
1180
1180
|
a.value === "totp" ? (o(), c(P, { key: 0 }, [
|
|
1181
|
-
|
|
1181
|
+
S("Использовать recovery-код")
|
|
1182
1182
|
], 64)) : (o(), c(P, { key: 1 }, [
|
|
1183
|
-
|
|
1183
|
+
S("Вернуться к коду из приложения")
|
|
1184
1184
|
], 64))
|
|
1185
1185
|
]),
|
|
1186
1186
|
d("button", {
|
|
@@ -1191,13 +1191,13 @@ const Q = ne("admin-auth", () => {
|
|
|
1191
1191
|
])
|
|
1192
1192
|
], 32));
|
|
1193
1193
|
}
|
|
1194
|
-
}),
|
|
1194
|
+
}), va = { class: "admin-auth-page" }, pa = {
|
|
1195
1195
|
key: 0,
|
|
1196
1196
|
class: "admin-auth-page__corner"
|
|
1197
|
-
},
|
|
1197
|
+
}, ga = { class: "admin-auth-card__hd" }, ha = ["src", "alt"], _a = {
|
|
1198
1198
|
key: 1,
|
|
1199
1199
|
"aria-hidden": "true"
|
|
1200
|
-
},
|
|
1200
|
+
}, ya = { key: 2 }, ba = { class: "admin-auth-card__title" }, ka = { class: "admin-auth-card__sub" }, wa = /* @__PURE__ */ L({
|
|
1201
1201
|
__name: "LoginPage",
|
|
1202
1202
|
props: {
|
|
1203
1203
|
brandName: { default: "Laravel Admin" },
|
|
@@ -1225,19 +1225,19 @@ const Q = ne("admin-auth", () => {
|
|
|
1225
1225
|
(i) => {
|
|
1226
1226
|
i && l();
|
|
1227
1227
|
}
|
|
1228
|
-
),
|
|
1228
|
+
), Re(() => {
|
|
1229
1229
|
n.isAuthenticated && l();
|
|
1230
|
-
}), (i, u) => (o(), c("div",
|
|
1231
|
-
e.showCornerActions ? (o(), c("div",
|
|
1230
|
+
}), (i, u) => (o(), c("div", va, [
|
|
1231
|
+
e.showCornerActions ? (o(), c("div", pa, [
|
|
1232
1232
|
$(_t),
|
|
1233
1233
|
$(yt)
|
|
1234
|
-
])) :
|
|
1235
|
-
$(r(
|
|
1234
|
+
])) : U("", !0),
|
|
1235
|
+
$(r(K), {
|
|
1236
1236
|
class: Z(["admin-auth-card", r(n).isChallengePending ? "admin-auth-card--wide" : ""]),
|
|
1237
1237
|
padding: "none"
|
|
1238
1238
|
}, {
|
|
1239
1239
|
default: m(() => [
|
|
1240
|
-
d("div",
|
|
1240
|
+
d("div", ga, [
|
|
1241
1241
|
d("div", {
|
|
1242
1242
|
class: Z(["admin-auth-card__logo", r(n).isChallengePending ? "admin-auth-card__logo--accent" : ""])
|
|
1243
1243
|
}, [
|
|
@@ -1245,30 +1245,30 @@ const Q = ne("admin-auth", () => {
|
|
|
1245
1245
|
key: 0,
|
|
1246
1246
|
src: e.brandLogo,
|
|
1247
1247
|
alt: e.brandName
|
|
1248
|
-
}, null, 8,
|
|
1248
|
+
}, null, 8, ha)) : r(n).isChallengePending ? (o(), c("span", _a, "🛡")) : (o(), c("span", ya, h(e.brandMark), 1))
|
|
1249
1249
|
], 2),
|
|
1250
|
-
d("div",
|
|
1250
|
+
d("div", ba, [
|
|
1251
1251
|
r(n).isChallengePending ? (o(), c(P, { key: 0 }, [
|
|
1252
|
-
|
|
1252
|
+
S("Двухфакторная проверка")
|
|
1253
1253
|
], 64)) : (o(), c(P, { key: 1 }, [
|
|
1254
|
-
|
|
1254
|
+
S(h(e.brandName), 1)
|
|
1255
1255
|
], 64))
|
|
1256
1256
|
]),
|
|
1257
|
-
d("div",
|
|
1257
|
+
d("div", ka, [
|
|
1258
1258
|
r(n).isChallengePending ? (o(), c(P, { key: 0 }, [
|
|
1259
|
-
|
|
1259
|
+
S(" Введите 6-значный код из приложения-аутентификатора ")
|
|
1260
1260
|
], 64)) : (o(), c(P, { key: 1 }, [
|
|
1261
|
-
|
|
1261
|
+
S("Войдите, чтобы продолжить работу")
|
|
1262
1262
|
], 64))
|
|
1263
1263
|
])
|
|
1264
1264
|
]),
|
|
1265
|
-
r(n).isChallengePending ? (o(), b(
|
|
1265
|
+
r(n).isChallengePending ? (o(), b(fa, {
|
|
1266
1266
|
key: 0,
|
|
1267
1267
|
onSuccess: u[0] || (u[0] = () => {
|
|
1268
1268
|
}),
|
|
1269
1269
|
onCancel: u[1] || (u[1] = () => {
|
|
1270
1270
|
})
|
|
1271
|
-
})) : (o(), b(
|
|
1271
|
+
})) : (o(), b(da, {
|
|
1272
1272
|
key: 1,
|
|
1273
1273
|
"forgot-url": e.forgotUrl,
|
|
1274
1274
|
"sso-link-label": e.ssoLinkLabel,
|
|
@@ -1281,10 +1281,10 @@ const Q = ne("admin-auth", () => {
|
|
|
1281
1281
|
}, 8, ["class"])
|
|
1282
1282
|
]));
|
|
1283
1283
|
}
|
|
1284
|
-
}), tt = { page: 1, per_page: 20, total: 0, last_page: 1 },
|
|
1285
|
-
const e =
|
|
1284
|
+
}), tt = { page: 1, per_page: 20, total: 0, last_page: 1 }, wt = ne("admin-resource-index", () => {
|
|
1285
|
+
const e = R(null), t = R([]), n = R({ ...tt }), s = R(!1), a = R(!1), l = R(null);
|
|
1286
1286
|
let i = null;
|
|
1287
|
-
const u = 200, f =
|
|
1287
|
+
const u = 200, f = R(""), p = R({}), y = R(null), k = R(null), x = R(/* @__PURE__ */ new Set()), C = v(() => !s.value && l.value === null && t.value.length === 0), _ = v(() => x.value.size), g = v(() => x.value.size > 0), F = v(() => l.value !== null), q = v(() => x.value.size === 0 || t.value.length === 0 ? "none" : t.value.every((j) => x.value.has(M(j))) ? "all" : "mixed");
|
|
1288
1288
|
function M(B) {
|
|
1289
1289
|
return B.id ?? B.key ?? "";
|
|
1290
1290
|
}
|
|
@@ -1292,20 +1292,20 @@ const Q = ne("admin-auth", () => {
|
|
|
1292
1292
|
e.value !== B && (e.value = B, w(), s.value = !0);
|
|
1293
1293
|
}
|
|
1294
1294
|
function w() {
|
|
1295
|
-
t.value = [], n.value = { ...tt }, s.value = !1, l.value = null, f.value = "",
|
|
1295
|
+
t.value = [], n.value = { ...tt }, s.value = !1, l.value = null, f.value = "", p.value = {}, y.value = null, k.value = null, x.value = /* @__PURE__ */ new Set();
|
|
1296
1296
|
}
|
|
1297
1297
|
function V(B = {}) {
|
|
1298
|
-
const
|
|
1298
|
+
const j = {
|
|
1299
1299
|
page: B.page ?? n.value.page,
|
|
1300
1300
|
per_page: B.per_page ?? n.value.per_page
|
|
1301
1301
|
}, $e = B.search ?? f.value;
|
|
1302
|
-
$e && (
|
|
1303
|
-
const ge = B.sort ??
|
|
1304
|
-
ge && Qe !== null && (
|
|
1305
|
-
const Ut = B.filters ??
|
|
1306
|
-
for (const [
|
|
1307
|
-
re == null || re === "" || (Be[
|
|
1308
|
-
return Object.keys(Be).length > 0 && (
|
|
1302
|
+
$e && (j.q = $e);
|
|
1303
|
+
const ge = B.sort ?? y.value, Qe = B.direction ?? k.value;
|
|
1304
|
+
ge && Qe !== null && (j.order = [{ column: ge, direction: Qe }]);
|
|
1305
|
+
const Ut = B.filters ?? p.value, Be = {};
|
|
1306
|
+
for (const [Tt, re] of Object.entries(Ut))
|
|
1307
|
+
re == null || re === "" || (Be[Tt] = Array.isArray(re) ? re.join(",") : re);
|
|
1308
|
+
return Object.keys(Be).length > 0 && (j.filters = Be), j;
|
|
1309
1309
|
}
|
|
1310
1310
|
async function W(B = {}) {
|
|
1311
1311
|
if (!e.value)
|
|
@@ -1314,10 +1314,10 @@ const Q = ne("admin-auth", () => {
|
|
|
1314
1314
|
a.value = !0;
|
|
1315
1315
|
}, u);
|
|
1316
1316
|
try {
|
|
1317
|
-
const
|
|
1317
|
+
const j = H(), $e = V(B), ge = await j.post(`/${e.value}/search`, $e);
|
|
1318
1318
|
t.value = ge.data, n.value = ge.meta;
|
|
1319
|
-
} catch (
|
|
1320
|
-
throw l.value =
|
|
1319
|
+
} catch (j) {
|
|
1320
|
+
throw l.value = j instanceof Error ? j : new Error(String(j)), j;
|
|
1321
1321
|
} finally {
|
|
1322
1322
|
s.value = !1, a.value = !1, i !== null && (clearTimeout(i), i = null);
|
|
1323
1323
|
}
|
|
@@ -1325,39 +1325,39 @@ const Q = ne("admin-auth", () => {
|
|
|
1325
1325
|
async function G(B) {
|
|
1326
1326
|
f.value = B, n.value.page = 1, await W();
|
|
1327
1327
|
}
|
|
1328
|
-
async function
|
|
1329
|
-
|
|
1328
|
+
async function A(B, j) {
|
|
1329
|
+
j == null || j === "" ? delete p.value[B] : p.value[B] = j, n.value.page = 1, await W();
|
|
1330
1330
|
}
|
|
1331
1331
|
async function E() {
|
|
1332
|
-
|
|
1332
|
+
p.value = {}, n.value.page = 1, await W();
|
|
1333
1333
|
}
|
|
1334
|
-
async function N(B,
|
|
1335
|
-
|
|
1334
|
+
async function N(B, j = "asc") {
|
|
1335
|
+
y.value = B, k.value = j, await W();
|
|
1336
1336
|
}
|
|
1337
1337
|
async function O(B) {
|
|
1338
|
-
|
|
1338
|
+
y.value === B ? k.value === "asc" ? k.value = "desc" : k.value === "desc" ? (y.value = null, k.value = null) : k.value = "asc" : (y.value = B, k.value = "asc"), await W();
|
|
1339
1339
|
}
|
|
1340
1340
|
async function X(B) {
|
|
1341
1341
|
n.value.page = B, await W();
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1343
|
+
function At(B) {
|
|
1344
|
+
const j = new Set(x.value);
|
|
1345
|
+
j.has(B) ? j.delete(B) : j.add(B), x.value = j;
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function Et() {
|
|
1348
1348
|
if (q.value === "all") {
|
|
1349
|
-
|
|
1349
|
+
x.value = /* @__PURE__ */ new Set();
|
|
1350
1350
|
return;
|
|
1351
1351
|
}
|
|
1352
|
-
const B = new Set(
|
|
1353
|
-
for (const
|
|
1354
|
-
|
|
1352
|
+
const B = new Set(x.value);
|
|
1353
|
+
for (const j of t.value) B.add(M(j));
|
|
1354
|
+
x.value = B;
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1357
|
-
|
|
1356
|
+
function Rt() {
|
|
1357
|
+
x.value = /* @__PURE__ */ new Set();
|
|
1358
1358
|
}
|
|
1359
1359
|
function Ft(B) {
|
|
1360
|
-
return
|
|
1360
|
+
return x.value.has(B);
|
|
1361
1361
|
}
|
|
1362
1362
|
return {
|
|
1363
1363
|
// state
|
|
@@ -1368,48 +1368,51 @@ const Q = ne("admin-auth", () => {
|
|
|
1368
1368
|
slowLoading: a,
|
|
1369
1369
|
error: l,
|
|
1370
1370
|
search: f,
|
|
1371
|
-
filters:
|
|
1372
|
-
sortKey:
|
|
1371
|
+
filters: p,
|
|
1372
|
+
sortKey: y,
|
|
1373
1373
|
sortDirection: k,
|
|
1374
|
-
selection:
|
|
1374
|
+
selection: x,
|
|
1375
1375
|
// getters
|
|
1376
|
-
isEmpty:
|
|
1377
|
-
hasError:
|
|
1378
|
-
hasSelection:
|
|
1379
|
-
selectedCount:
|
|
1376
|
+
isEmpty: C,
|
|
1377
|
+
hasError: F,
|
|
1378
|
+
hasSelection: g,
|
|
1379
|
+
selectedCount: _,
|
|
1380
1380
|
selectionState: q,
|
|
1381
1381
|
// actions
|
|
1382
1382
|
setSlug: T,
|
|
1383
1383
|
reset: w,
|
|
1384
1384
|
load: W,
|
|
1385
1385
|
setSearch: G,
|
|
1386
|
-
setFilter:
|
|
1386
|
+
setFilter: A,
|
|
1387
1387
|
clearFilters: E,
|
|
1388
1388
|
setSort: N,
|
|
1389
1389
|
toggleSort: O,
|
|
1390
1390
|
setPage: X,
|
|
1391
|
-
toggleRow:
|
|
1392
|
-
toggleAllOnPage:
|
|
1393
|
-
clearSelection:
|
|
1391
|
+
toggleRow: At,
|
|
1392
|
+
toggleAllOnPage: Et,
|
|
1393
|
+
clearSelection: Rt,
|
|
1394
1394
|
isSelected: Ft,
|
|
1395
1395
|
rowId: M
|
|
1396
1396
|
};
|
|
1397
|
-
}),
|
|
1398
|
-
|
|
1397
|
+
}), $a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1398
|
+
__proto__: null,
|
|
1399
|
+
useResourceIndexStore: wt
|
|
1400
|
+
}, Symbol.toStringTag, { value: "Module" })), nt = "d.m.Y H:i:s", xa = "d.m.Y", Sa = /^\d{4}-\d{2}-\d{2}[T\s]\d{2}:\d{2}/;
|
|
1401
|
+
function Ca(e, t, n = {}) {
|
|
1399
1402
|
if (e == null) return "";
|
|
1400
|
-
if (!t && typeof e == "string" &&
|
|
1403
|
+
if (!t && typeof e == "string" && Sa.test(e))
|
|
1401
1404
|
return De(e, nt);
|
|
1402
1405
|
switch (t) {
|
|
1403
1406
|
case "date":
|
|
1404
|
-
return De(String(e), n.format ??
|
|
1407
|
+
return De(String(e), n.format ?? xa);
|
|
1405
1408
|
case "datetime":
|
|
1406
1409
|
return De(String(e), n.format ?? nt);
|
|
1407
1410
|
case "money":
|
|
1408
|
-
return
|
|
1411
|
+
return Aa(e, n.currency ?? "RUB", n.decimals ?? 2);
|
|
1409
1412
|
case "boolean":
|
|
1410
|
-
return
|
|
1413
|
+
return Ea(e, n.trueLabel ?? "Да", n.falseLabel ?? "Нет");
|
|
1411
1414
|
case "bytes":
|
|
1412
|
-
return
|
|
1415
|
+
return Ra(e);
|
|
1413
1416
|
default:
|
|
1414
1417
|
return String(e);
|
|
1415
1418
|
}
|
|
@@ -1442,37 +1445,37 @@ function De(e, t) {
|
|
|
1442
1445
|
}
|
|
1443
1446
|
return l;
|
|
1444
1447
|
}
|
|
1445
|
-
function
|
|
1448
|
+
function Aa(e, t, n) {
|
|
1446
1449
|
const s = typeof e == "number" ? e : Number(e);
|
|
1447
1450
|
return isNaN(s) ? String(e) : `${s.toFixed(n)} ${t}`;
|
|
1448
1451
|
}
|
|
1449
|
-
function
|
|
1452
|
+
function Ea(e, t, n) {
|
|
1450
1453
|
return e === !0 || e === 1 || e === "1" || e === "true" ? t : n;
|
|
1451
1454
|
}
|
|
1452
|
-
function
|
|
1455
|
+
function Ra(e) {
|
|
1453
1456
|
const t = typeof e == "number" ? e : Number(e);
|
|
1454
1457
|
return isNaN(t) ? String(e) : t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / 1024 / 1024).toFixed(1)} MB` : `${(t / 1024 / 1024 / 1024).toFixed(1)} GB`;
|
|
1455
1458
|
}
|
|
1456
|
-
const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-page__hd" },
|
|
1459
|
+
const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-page__hd" }, Ta = { class: "admin-page__title-wrap" }, La = { class: "admin-page__title" }, Pa = {
|
|
1457
1460
|
key: 0,
|
|
1458
1461
|
class: "admin-page__count"
|
|
1459
|
-
},
|
|
1462
|
+
}, Ma = { class: "admin-page__actions" }, Na = {
|
|
1460
1463
|
key: 0,
|
|
1461
1464
|
class: "admin-bulk-toolbar",
|
|
1462
1465
|
role: "toolbar"
|
|
1463
|
-
},
|
|
1466
|
+
}, Ba = { class: "admin-bulk-toolbar__count" }, Ia = {
|
|
1464
1467
|
key: 1,
|
|
1465
1468
|
class: "admin-filter-bar"
|
|
1466
|
-
},
|
|
1469
|
+
}, Da = ["value"], Va = {
|
|
1467
1470
|
key: 2,
|
|
1468
1471
|
class: "admin-resource-index__loading"
|
|
1469
|
-
},
|
|
1472
|
+
}, za = {
|
|
1470
1473
|
key: 5,
|
|
1471
1474
|
class: "admin-resource-index__table"
|
|
1472
|
-
},
|
|
1475
|
+
}, qa = {
|
|
1473
1476
|
key: 6,
|
|
1474
1477
|
class: "admin-resource-index__footer"
|
|
1475
|
-
},
|
|
1478
|
+
}, Oa = /* @__PURE__ */ L({
|
|
1476
1479
|
__name: "ResourceIndexPage",
|
|
1477
1480
|
props: {
|
|
1478
1481
|
slug: {},
|
|
@@ -1483,9 +1486,9 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1483
1486
|
},
|
|
1484
1487
|
emits: ["bulk-action", "row-click"],
|
|
1485
1488
|
setup(e, { emit: t }) {
|
|
1486
|
-
const n = e, s = t, a =
|
|
1489
|
+
const n = e, s = t, a = wt(), l = oe(), i = Ye(), u = v(() => l.getResource(n.slug)), f = v(
|
|
1487
1490
|
() => n.title ?? u.value?.label ?? n.slug
|
|
1488
|
-
),
|
|
1491
|
+
), p = v(() => (u.value?.columns ?? []).map((E) => {
|
|
1489
1492
|
const N = E;
|
|
1490
1493
|
return {
|
|
1491
1494
|
key: String(N.key ?? N.name ?? ""),
|
|
@@ -1494,9 +1497,9 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1494
1497
|
align: N.align ?? "left",
|
|
1495
1498
|
width: typeof N.width == "string" ? N.width : void 0
|
|
1496
1499
|
};
|
|
1497
|
-
}).filter((E) => E.key)),
|
|
1498
|
-
const
|
|
1499
|
-
for (const N of
|
|
1500
|
+
}).filter((E) => E.key)), y = v(() => {
|
|
1501
|
+
const A = u.value?.columns ?? [], E = {};
|
|
1502
|
+
for (const N of A) {
|
|
1500
1503
|
const O = N, X = String(O.key ?? O.name ?? "");
|
|
1501
1504
|
X && (E[X] = {
|
|
1502
1505
|
preset: typeof O.preset == "string" ? O.preset : void 0,
|
|
@@ -1505,22 +1508,22 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1505
1508
|
}
|
|
1506
1509
|
return E;
|
|
1507
1510
|
});
|
|
1508
|
-
function k(
|
|
1509
|
-
const O = E?.row?.[
|
|
1510
|
-
return
|
|
1511
|
+
function k(A, E) {
|
|
1512
|
+
const O = E?.row?.[A], X = y.value[A];
|
|
1513
|
+
return Ca(O, X?.preset, X?.meta ?? {});
|
|
1511
1514
|
}
|
|
1512
|
-
function
|
|
1513
|
-
return
|
|
1515
|
+
function x(A) {
|
|
1516
|
+
return A?.row;
|
|
1514
1517
|
}
|
|
1515
|
-
const
|
|
1518
|
+
const C = v(
|
|
1516
1519
|
() => a.search !== "" || Object.keys(a.filters).length > 0
|
|
1517
|
-
),
|
|
1518
|
-
() => !a.isEmpty ||
|
|
1519
|
-
),
|
|
1520
|
-
const
|
|
1521
|
-
return
|
|
1520
|
+
), _ = v(
|
|
1521
|
+
() => !a.isEmpty || C.value
|
|
1522
|
+
), g = v(() => {
|
|
1523
|
+
const A = a.meta.total;
|
|
1524
|
+
return A === 0 ? "" : `${a.items.length} из ${A}`;
|
|
1522
1525
|
});
|
|
1523
|
-
async function
|
|
1526
|
+
async function F() {
|
|
1524
1527
|
i.start();
|
|
1525
1528
|
try {
|
|
1526
1529
|
await a.load();
|
|
@@ -1529,71 +1532,71 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1529
1532
|
i.end();
|
|
1530
1533
|
}
|
|
1531
1534
|
}
|
|
1532
|
-
|
|
1535
|
+
Re(async () => {
|
|
1533
1536
|
a.setSlug(n.slug), l.manifest === null && await l.load().catch(() => {
|
|
1534
|
-
}), await
|
|
1537
|
+
}), await F();
|
|
1535
1538
|
}), ee(
|
|
1536
1539
|
() => n.slug,
|
|
1537
|
-
async (
|
|
1538
|
-
|
|
1540
|
+
async (A, E) => {
|
|
1541
|
+
A !== E && (a.setSlug(A), await F());
|
|
1539
1542
|
}
|
|
1540
1543
|
);
|
|
1541
|
-
async function q(
|
|
1542
|
-
await _e(), await a.setSort(
|
|
1544
|
+
async function q(A) {
|
|
1545
|
+
await _e(), await a.setSort(A, a.sortDirection);
|
|
1543
1546
|
}
|
|
1544
|
-
async function M(
|
|
1545
|
-
await _e(), await a.setSort(a.sortKey,
|
|
1547
|
+
async function M(A) {
|
|
1548
|
+
await _e(), await a.setSort(a.sortKey, A);
|
|
1546
1549
|
}
|
|
1547
|
-
function T(
|
|
1548
|
-
a.selection =
|
|
1550
|
+
function T(A) {
|
|
1551
|
+
a.selection = A;
|
|
1549
1552
|
}
|
|
1550
|
-
async function w(
|
|
1551
|
-
await a.setPage(
|
|
1553
|
+
async function w(A) {
|
|
1554
|
+
await a.setPage(A);
|
|
1552
1555
|
}
|
|
1553
|
-
function V(
|
|
1554
|
-
s("row-click",
|
|
1556
|
+
function V(A) {
|
|
1557
|
+
s("row-click", A);
|
|
1555
1558
|
}
|
|
1556
|
-
function W(
|
|
1557
|
-
s("bulk-action",
|
|
1559
|
+
function W(A) {
|
|
1560
|
+
s("bulk-action", A, [...a.selection]);
|
|
1558
1561
|
}
|
|
1559
1562
|
async function G() {
|
|
1560
1563
|
await a.load().catch(() => {
|
|
1561
1564
|
});
|
|
1562
1565
|
}
|
|
1563
|
-
return (
|
|
1566
|
+
return (A, E) => (o(), c("section", Fa, [
|
|
1564
1567
|
d("header", Ua, [
|
|
1565
|
-
d("div",
|
|
1566
|
-
d("h1",
|
|
1567
|
-
e.subtitle ||
|
|
1568
|
+
d("div", Ta, [
|
|
1569
|
+
d("h1", La, h(f.value), 1),
|
|
1570
|
+
e.subtitle || g.value ? (o(), c("div", Pa, [
|
|
1568
1571
|
e.subtitle ? (o(), c(P, { key: 0 }, [
|
|
1569
|
-
|
|
1570
|
-
], 64)) :
|
|
1571
|
-
e.subtitle &&
|
|
1572
|
-
|
|
1573
|
-
], 64)) :
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
], 64)) :
|
|
1577
|
-
])) :
|
|
1572
|
+
S(h(e.subtitle), 1)
|
|
1573
|
+
], 64)) : U("", !0),
|
|
1574
|
+
e.subtitle && g.value ? (o(), c(P, { key: 1 }, [
|
|
1575
|
+
S(" · ")
|
|
1576
|
+
], 64)) : U("", !0),
|
|
1577
|
+
g.value ? (o(), c(P, { key: 2 }, [
|
|
1578
|
+
S(h(g.value), 1)
|
|
1579
|
+
], 64)) : U("", !0)
|
|
1580
|
+
])) : U("", !0)
|
|
1578
1581
|
]),
|
|
1579
|
-
d("div",
|
|
1580
|
-
Y(
|
|
1582
|
+
d("div", Ma, [
|
|
1583
|
+
Y(A.$slots, "actions"),
|
|
1581
1584
|
e.createRouteName ? (o(), b(r(z), {
|
|
1582
1585
|
key: 0,
|
|
1583
1586
|
variant: "primary",
|
|
1584
|
-
onClick: E[0] || (E[0] = (N) =>
|
|
1587
|
+
onClick: E[0] || (E[0] = (N) => A.$router.push({ name: e.createRouteName }))
|
|
1585
1588
|
}, {
|
|
1586
1589
|
default: m(() => [
|
|
1587
|
-
|
|
1590
|
+
S(h(e.createLabel), 1)
|
|
1588
1591
|
]),
|
|
1589
1592
|
_: 1
|
|
1590
|
-
})) :
|
|
1593
|
+
})) : U("", !0)
|
|
1591
1594
|
])
|
|
1592
1595
|
]),
|
|
1593
|
-
r(a).hasSelection ? (o(), c("div",
|
|
1594
|
-
d("span",
|
|
1595
|
-
E[7] || (E[7] =
|
|
1596
|
-
d("b", null,
|
|
1596
|
+
r(a).hasSelection ? (o(), c("div", Na, [
|
|
1597
|
+
d("span", Ba, [
|
|
1598
|
+
E[7] || (E[7] = S(" Выбрано ", -1)),
|
|
1599
|
+
d("b", null, h(r(a).selectedCount), 1)
|
|
1597
1600
|
]),
|
|
1598
1601
|
E[13] || (E[13] = d("span", { class: "admin-bulk-toolbar__divider" }, null, -1)),
|
|
1599
1602
|
$(r(z), {
|
|
@@ -1602,7 +1605,7 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1602
1605
|
onClick: E[1] || (E[1] = (N) => W("publish"))
|
|
1603
1606
|
}, {
|
|
1604
1607
|
default: m(() => [...E[8] || (E[8] = [
|
|
1605
|
-
|
|
1608
|
+
S("Опубликовать", -1)
|
|
1606
1609
|
])]),
|
|
1607
1610
|
_: 1
|
|
1608
1611
|
}),
|
|
@@ -1612,7 +1615,7 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1612
1615
|
onClick: E[2] || (E[2] = (N) => W("archive"))
|
|
1613
1616
|
}, {
|
|
1614
1617
|
default: m(() => [...E[9] || (E[9] = [
|
|
1615
|
-
|
|
1618
|
+
S("Архивировать", -1)
|
|
1616
1619
|
])]),
|
|
1617
1620
|
_: 1
|
|
1618
1621
|
}),
|
|
@@ -1622,7 +1625,7 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1622
1625
|
onClick: E[3] || (E[3] = (N) => W("export"))
|
|
1623
1626
|
}, {
|
|
1624
1627
|
default: m(() => [...E[10] || (E[10] = [
|
|
1625
|
-
|
|
1628
|
+
S("Экспорт", -1)
|
|
1626
1629
|
])]),
|
|
1627
1630
|
_: 1
|
|
1628
1631
|
}),
|
|
@@ -1632,7 +1635,7 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1632
1635
|
onClick: E[4] || (E[4] = (N) => W("delete"))
|
|
1633
1636
|
}, {
|
|
1634
1637
|
default: m(() => [...E[11] || (E[11] = [
|
|
1635
|
-
|
|
1638
|
+
S("Удалить", -1)
|
|
1636
1639
|
])]),
|
|
1637
1640
|
_: 1
|
|
1638
1641
|
}),
|
|
@@ -1643,19 +1646,19 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1643
1646
|
onClick: r(a).clearSelection
|
|
1644
1647
|
}, {
|
|
1645
1648
|
default: m(() => [...E[12] || (E[12] = [
|
|
1646
|
-
|
|
1649
|
+
S(" Снять выделение ", -1)
|
|
1647
1650
|
])]),
|
|
1648
1651
|
_: 1
|
|
1649
1652
|
}, 8, ["onClick"])
|
|
1650
|
-
])) :
|
|
1653
|
+
])) : _.value ? (o(), c("div", Ia, [
|
|
1651
1654
|
d("input", {
|
|
1652
1655
|
value: r(a).search,
|
|
1653
1656
|
type: "search",
|
|
1654
1657
|
placeholder: "Поиск…",
|
|
1655
1658
|
class: "admin-filter-bar__search",
|
|
1656
|
-
onKeydown: E[5] || (E[5] =
|
|
1657
|
-
}, null, 40,
|
|
1658
|
-
Y(
|
|
1659
|
+
onKeydown: E[5] || (E[5] = Mt((N) => r(a).setSearch(N.target.value), ["enter"]))
|
|
1660
|
+
}, null, 40, Da),
|
|
1661
|
+
Y(A.$slots, "filters", {
|
|
1659
1662
|
filters: r(a).filters,
|
|
1660
1663
|
setFilter: r(a).setFilter
|
|
1661
1664
|
}),
|
|
@@ -1667,17 +1670,17 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1667
1670
|
onClick: r(a).clearFilters
|
|
1668
1671
|
}, {
|
|
1669
1672
|
default: m(() => [...E[15] || (E[15] = [
|
|
1670
|
-
|
|
1673
|
+
S(" Сброс ", -1)
|
|
1671
1674
|
])]),
|
|
1672
1675
|
_: 1
|
|
1673
|
-
}, 8, ["onClick"])) :
|
|
1674
|
-
])) :
|
|
1675
|
-
r(a).loading && r(a).items.length === 0 ? (o(), c("div",
|
|
1676
|
+
}, 8, ["onClick"])) : U("", !0)
|
|
1677
|
+
])) : U("", !0),
|
|
1678
|
+
r(a).loading && r(a).items.length === 0 ? (o(), c("div", Va, [
|
|
1676
1679
|
r(a).slowLoading ? (o(), c(P, { key: 0 }, D(8, (N) => $(r(We), {
|
|
1677
1680
|
key: N,
|
|
1678
1681
|
height: "40px"
|
|
1679
|
-
})), 64)) :
|
|
1680
|
-
])) : r(a).hasError ? (o(), b(r(
|
|
1682
|
+
})), 64)) : U("", !0)
|
|
1683
|
+
])) : r(a).hasError ? (o(), b(r(Gt), {
|
|
1681
1684
|
key: 3,
|
|
1682
1685
|
title: "Не удалось загрузить данные",
|
|
1683
1686
|
description: r(a).error?.message ?? "Попробуйте обновить страницу.",
|
|
@@ -1689,13 +1692,13 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1689
1692
|
onClick: G
|
|
1690
1693
|
}, {
|
|
1691
1694
|
default: m(() => [...E[17] || (E[17] = [
|
|
1692
|
-
|
|
1695
|
+
S("Обновить", -1)
|
|
1693
1696
|
])]),
|
|
1694
1697
|
_: 1
|
|
1695
1698
|
})
|
|
1696
1699
|
]),
|
|
1697
1700
|
_: 1
|
|
1698
|
-
}, 8, ["description"])) : r(a).isEmpty ? (o(), b(r(
|
|
1701
|
+
}, 8, ["description"])) : r(a).isEmpty ? (o(), b(r(Ht), {
|
|
1699
1702
|
key: 4,
|
|
1700
1703
|
title: "Пока пусто",
|
|
1701
1704
|
description: "Создайте первую запись или измените фильтры.",
|
|
@@ -1705,18 +1708,18 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1705
1708
|
e.createRouteName ? (o(), b(r(z), {
|
|
1706
1709
|
key: 0,
|
|
1707
1710
|
variant: "primary",
|
|
1708
|
-
onClick: E[6] || (E[6] = (N) =>
|
|
1711
|
+
onClick: E[6] || (E[6] = (N) => A.$router.push({ name: e.createRouteName }))
|
|
1709
1712
|
}, {
|
|
1710
1713
|
default: m(() => [
|
|
1711
|
-
|
|
1714
|
+
S(h(e.createLabel), 1)
|
|
1712
1715
|
]),
|
|
1713
1716
|
_: 1
|
|
1714
|
-
})) :
|
|
1717
|
+
})) : U("", !0)
|
|
1715
1718
|
]),
|
|
1716
1719
|
_: 1
|
|
1717
|
-
})) : (o(), c("div",
|
|
1718
|
-
$(r(
|
|
1719
|
-
columns:
|
|
1720
|
+
})) : (o(), c("div", za, [
|
|
1721
|
+
$(r(je), {
|
|
1722
|
+
columns: p.value,
|
|
1720
1723
|
data: r(a).items,
|
|
1721
1724
|
"sort-key": r(a).sortKey,
|
|
1722
1725
|
"sort-direction": r(a).sortDirection,
|
|
@@ -1728,70 +1731,70 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1728
1731
|
"onUpdate:selection": T,
|
|
1729
1732
|
onRowClick: V
|
|
1730
1733
|
}, qe({ _: 2 }, [
|
|
1731
|
-
D(
|
|
1734
|
+
D(p.value, (N) => ({
|
|
1732
1735
|
name: N.key,
|
|
1733
1736
|
fn: m((O) => [
|
|
1734
|
-
Y(
|
|
1735
|
-
row:
|
|
1737
|
+
Y(A.$slots, `cell-${N.key}`, {
|
|
1738
|
+
row: x(O)
|
|
1736
1739
|
}, () => [
|
|
1737
|
-
|
|
1740
|
+
S(h(k(N.key, O)), 1)
|
|
1738
1741
|
])
|
|
1739
1742
|
])
|
|
1740
1743
|
}))
|
|
1741
1744
|
]), 1032, ["columns", "data", "sort-key", "sort-direction", "selection", "row-key"])
|
|
1742
1745
|
])),
|
|
1743
|
-
!r(a).loading && !r(a).hasError && !r(a).isEmpty ? (o(), c("footer",
|
|
1744
|
-
$(r(
|
|
1746
|
+
!r(a).loading && !r(a).hasError && !r(a).isEmpty ? (o(), c("footer", qa, [
|
|
1747
|
+
$(r(Xt), {
|
|
1745
1748
|
"model-value": r(a).meta.page,
|
|
1746
1749
|
total: r(a).meta.total,
|
|
1747
1750
|
"per-page": r(a).meta.per_page,
|
|
1748
1751
|
"onUpdate:modelValue": w
|
|
1749
1752
|
}, null, 8, ["model-value", "total", "per-page"])
|
|
1750
|
-
])) :
|
|
1753
|
+
])) : U("", !0)
|
|
1751
1754
|
]));
|
|
1752
1755
|
}
|
|
1753
|
-
}),
|
|
1754
|
-
const e =
|
|
1755
|
-
const
|
|
1756
|
+
}), $t = ne("admin-resource-form", () => {
|
|
1757
|
+
const e = R(null), t = R("create"), n = R(null), s = R({}), a = R({}), l = R({}), i = R(!1), u = R(!1), f = R(!1), p = R(null), y = v(() => t.value === "create"), k = v(() => t.value === "edit"), x = v(() => t.value === "view"), C = v(() => p.value !== null), _ = v(() => {
|
|
1758
|
+
const A = s.value, E = a.value, N = /* @__PURE__ */ new Set([...Object.keys(A), ...Object.keys(E)]);
|
|
1756
1759
|
for (const O of N)
|
|
1757
|
-
if (!Object.is(
|
|
1758
|
-
if (typeof
|
|
1759
|
-
if (JSON.stringify(
|
|
1760
|
+
if (!Object.is(A[O], E[O]))
|
|
1761
|
+
if (typeof A[O] == "object" || typeof E[O] == "object") {
|
|
1762
|
+
if (JSON.stringify(A[O]) !== JSON.stringify(E[O])) return !0;
|
|
1760
1763
|
} else
|
|
1761
1764
|
return !0;
|
|
1762
1765
|
return !1;
|
|
1763
1766
|
});
|
|
1764
|
-
function
|
|
1765
|
-
for (const N of Object.keys(
|
|
1766
|
-
Object.assign(
|
|
1767
|
+
function g(A, E) {
|
|
1768
|
+
for (const N of Object.keys(A)) delete A[N];
|
|
1769
|
+
Object.assign(A, E);
|
|
1767
1770
|
}
|
|
1768
|
-
function
|
|
1769
|
-
|
|
1771
|
+
function F() {
|
|
1772
|
+
g(s.value, {}), g(a.value, {}), l.value = {}, i.value = !1, u.value = !1, f.value = !1, p.value = null, n.value = null;
|
|
1770
1773
|
}
|
|
1771
|
-
function q(
|
|
1772
|
-
e.value =
|
|
1774
|
+
function q(A, E = {}) {
|
|
1775
|
+
e.value = A, t.value = "create", n.value = null, g(s.value, E), g(a.value, E), l.value = {}, p.value = null;
|
|
1773
1776
|
}
|
|
1774
|
-
async function M(
|
|
1775
|
-
e.value =
|
|
1777
|
+
async function M(A, E, N = "edit") {
|
|
1778
|
+
e.value = A, t.value = N, n.value = E, i.value = !0, p.value = null, l.value = {};
|
|
1776
1779
|
try {
|
|
1777
|
-
const X = await H().get(`/${
|
|
1780
|
+
const X = await H().get(`/${A}/read`, {
|
|
1778
1781
|
params: { id: E }
|
|
1779
1782
|
});
|
|
1780
|
-
|
|
1783
|
+
g(s.value, X.record), g(a.value, X.record);
|
|
1781
1784
|
} catch (O) {
|
|
1782
|
-
throw
|
|
1785
|
+
throw p.value = O instanceof Error ? O : new Error(String(O)), O;
|
|
1783
1786
|
} finally {
|
|
1784
1787
|
i.value = !1;
|
|
1785
1788
|
}
|
|
1786
1789
|
}
|
|
1787
|
-
function T(
|
|
1788
|
-
if (s.value[
|
|
1790
|
+
function T(A, E) {
|
|
1791
|
+
if (s.value[A] = E, l.value[A]) {
|
|
1789
1792
|
const N = { ...l.value };
|
|
1790
|
-
delete N[
|
|
1793
|
+
delete N[A], l.value = N;
|
|
1791
1794
|
}
|
|
1792
1795
|
}
|
|
1793
|
-
function w(
|
|
1794
|
-
l.value = { ...
|
|
1796
|
+
function w(A) {
|
|
1797
|
+
l.value = { ...A };
|
|
1795
1798
|
}
|
|
1796
1799
|
function V() {
|
|
1797
1800
|
l.value = {};
|
|
@@ -1799,14 +1802,14 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1799
1802
|
async function W() {
|
|
1800
1803
|
if (!e.value) throw new Error("useResourceFormStore.save() before slug set");
|
|
1801
1804
|
if (u.value) throw new Error("Already saving");
|
|
1802
|
-
u.value = !0,
|
|
1805
|
+
u.value = !0, p.value = null, l.value = {};
|
|
1803
1806
|
try {
|
|
1804
|
-
const
|
|
1807
|
+
const A = H(), E = t.value === "create" ? `/${e.value}/create` : `/${e.value}/update`, N = t.value === "create" ? s.value : { id: n.value, ...s.value }, O = await A.post(E, N), X = O.record?.id ?? O.id;
|
|
1805
1808
|
if (X === void 0)
|
|
1806
1809
|
throw new Error("save: backend response does not contain record.id");
|
|
1807
|
-
return n.value = X,
|
|
1808
|
-
} catch (
|
|
1809
|
-
throw
|
|
1810
|
+
return n.value = X, g(a.value, { ...s.value }), t.value = "edit", X;
|
|
1811
|
+
} catch (A) {
|
|
1812
|
+
throw A instanceof Le ? l.value = { ...A.fields } : (A instanceof ae || A instanceof Error) && (p.value = A), A;
|
|
1810
1813
|
} finally {
|
|
1811
1814
|
u.value = !1;
|
|
1812
1815
|
}
|
|
@@ -1815,11 +1818,11 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1815
1818
|
if (!e.value || n.value === null)
|
|
1816
1819
|
throw new Error("Nothing to delete");
|
|
1817
1820
|
if (f.value) throw new Error("Already deleting");
|
|
1818
|
-
f.value = !0,
|
|
1821
|
+
f.value = !0, p.value = null;
|
|
1819
1822
|
try {
|
|
1820
1823
|
await H().post(`/${e.value}/delete`, { id: n.value });
|
|
1821
|
-
} catch (
|
|
1822
|
-
throw
|
|
1824
|
+
} catch (A) {
|
|
1825
|
+
throw A instanceof Error && (p.value = A), A;
|
|
1823
1826
|
} finally {
|
|
1824
1827
|
f.value = !1;
|
|
1825
1828
|
}
|
|
@@ -1835,15 +1838,15 @@ const Fa = { class: "admin-page admin-resource-index" }, Ua = { class: "admin-pa
|
|
|
1835
1838
|
loading: i,
|
|
1836
1839
|
saving: u,
|
|
1837
1840
|
deleting: f,
|
|
1838
|
-
error:
|
|
1841
|
+
error: p,
|
|
1839
1842
|
// getters
|
|
1840
|
-
isCreate:
|
|
1843
|
+
isCreate: y,
|
|
1841
1844
|
isEdit: k,
|
|
1842
|
-
isView:
|
|
1843
|
-
isDirty:
|
|
1844
|
-
hasError:
|
|
1845
|
+
isView: x,
|
|
1846
|
+
isDirty: _,
|
|
1847
|
+
hasError: C,
|
|
1845
1848
|
// actions
|
|
1846
|
-
reset:
|
|
1849
|
+
reset: F,
|
|
1847
1850
|
prepareCreate: q,
|
|
1848
1851
|
load: M,
|
|
1849
1852
|
setField: T,
|
|
@@ -1877,14 +1880,14 @@ function Me() {
|
|
|
1877
1880
|
}
|
|
1878
1881
|
};
|
|
1879
1882
|
}
|
|
1880
|
-
const me = Me(), fe = Me(),
|
|
1881
|
-
function
|
|
1883
|
+
const me = Me(), fe = Me(), Zi = me.register, xt = me.get, eo = me.has, to = me.list, no = fe.register, at = fe.get, ao = fe.has, lo = fe.list;
|
|
1884
|
+
function so() {
|
|
1882
1885
|
me.clear(), fe.clear();
|
|
1883
1886
|
}
|
|
1884
|
-
function
|
|
1887
|
+
function Wa(e) {
|
|
1885
1888
|
e.fields && me.registerBundle(e.fields), e.layouts && fe.registerBundle(e.layouts);
|
|
1886
1889
|
}
|
|
1887
|
-
const
|
|
1890
|
+
const St = /* @__PURE__ */ L({
|
|
1888
1891
|
__name: "UnknownField",
|
|
1889
1892
|
props: {
|
|
1890
1893
|
type: {},
|
|
@@ -1893,30 +1896,30 @@ const xt = /* @__PURE__ */ L({
|
|
|
1893
1896
|
setup(e) {
|
|
1894
1897
|
return (t, n) => (o(), b(r(te), { variant: "warning" }, {
|
|
1895
1898
|
title: m(() => [
|
|
1896
|
-
|
|
1899
|
+
S("Неизвестный тип поля: " + h(e.type), 1)
|
|
1897
1900
|
]),
|
|
1898
1901
|
default: m(() => [
|
|
1899
1902
|
e.name ? (o(), c(P, { key: 0 }, [
|
|
1900
|
-
d("code", null,
|
|
1901
|
-
n[0] || (n[0] =
|
|
1902
|
-
d("code", null, "registerField('" +
|
|
1903
|
-
n[1] || (n[1] =
|
|
1904
|
-
], 64)) :
|
|
1903
|
+
d("code", null, h(e.name), 1),
|
|
1904
|
+
n[0] || (n[0] = S(" — зарегистрируйте field-компонент через ", -1)),
|
|
1905
|
+
d("code", null, "registerField('" + h(e.type) + "', YourComponent)", 1),
|
|
1906
|
+
n[1] || (n[1] = S(". ", -1))
|
|
1907
|
+
], 64)) : U("", !0)
|
|
1905
1908
|
]),
|
|
1906
1909
|
_: 1
|
|
1907
1910
|
}));
|
|
1908
1911
|
}
|
|
1909
|
-
}),
|
|
1912
|
+
}), Ct = /* @__PURE__ */ L({
|
|
1910
1913
|
__name: "FieldRenderer",
|
|
1911
1914
|
props: {
|
|
1912
1915
|
node: {}
|
|
1913
1916
|
},
|
|
1914
1917
|
setup(e) {
|
|
1915
|
-
const t = e, n = v(() =>
|
|
1918
|
+
const t = e, n = v(() => xt(t.node.type)), s = v(() => {
|
|
1916
1919
|
const { type: a, ...l } = t.node;
|
|
1917
1920
|
return l;
|
|
1918
1921
|
});
|
|
1919
|
-
return (a, l) => n.value ? (o(), b(se(n.value), Ue(
|
|
1922
|
+
return (a, l) => n.value ? (o(), b(se(n.value), Fe(Ue({ key: 0 }, s.value)), null, 16)) : (o(), b(St, {
|
|
1920
1923
|
key: 1,
|
|
1921
1924
|
type: e.node.type,
|
|
1922
1925
|
name: e.node.name
|
|
@@ -1936,24 +1939,24 @@ const xt = /* @__PURE__ */ L({
|
|
|
1936
1939
|
return i ? { kind: "layout", component: i } : { kind: "unknown" };
|
|
1937
1940
|
}
|
|
1938
1941
|
const l = at(t.node.type);
|
|
1939
|
-
return l ? { kind: "layout", component: l } :
|
|
1942
|
+
return l ? { kind: "layout", component: l } : xt(t.node.type) ? { kind: "field" } : { kind: "unknown" };
|
|
1940
1943
|
}), s = v(() => {
|
|
1941
1944
|
const { type: l, kind: i, ...u } = t.node;
|
|
1942
1945
|
return u;
|
|
1943
1946
|
}), a = v(() => t.node);
|
|
1944
|
-
return (l, i) => n.value.kind === "layout" && n.value.component ? (o(), b(se(n.value.component), Ue(
|
|
1947
|
+
return (l, i) => n.value.kind === "layout" && n.value.component ? (o(), b(se(n.value.component), Fe(Ue({ key: 0 }, s.value)), null, 16)) : n.value.kind === "field" ? (o(), b(Ct, {
|
|
1945
1948
|
key: 1,
|
|
1946
1949
|
node: a.value
|
|
1947
|
-
}, null, 8, ["node"])) : (o(), b(
|
|
1950
|
+
}, null, 8, ["node"])) : (o(), b(St, {
|
|
1948
1951
|
key: 2,
|
|
1949
1952
|
type: e.node.type,
|
|
1950
1953
|
name: e.node.name
|
|
1951
1954
|
}, null, 8, ["type", "name"]));
|
|
1952
1955
|
}
|
|
1953
|
-
}),
|
|
1956
|
+
}), ja = { class: "admin-page admin-resource-form" }, Ka = { class: "admin-page__hd" }, Ga = { class: "admin-page__title-wrap" }, Ha = { class: "admin-page__title" }, Xa = { class: "admin-page__actions" }, Ya = {
|
|
1954
1957
|
key: 1,
|
|
1955
1958
|
class: "admin-resource-form__loading"
|
|
1956
|
-
},
|
|
1959
|
+
}, Ja = {
|
|
1957
1960
|
key: 3,
|
|
1958
1961
|
class: "admin-resource-form__savebar"
|
|
1959
1962
|
}, lt = /* @__PURE__ */ L({
|
|
@@ -1964,20 +1967,20 @@ const xt = /* @__PURE__ */ L({
|
|
|
1964
1967
|
indexRouteName: { default: "admin.home" }
|
|
1965
1968
|
},
|
|
1966
1969
|
setup(e) {
|
|
1967
|
-
const t = e, n =
|
|
1970
|
+
const t = e, n = $t(), s = oe(), a = ie(), l = ht(n.state, n.errors);
|
|
1968
1971
|
ee(
|
|
1969
1972
|
() => n.errors,
|
|
1970
|
-
(
|
|
1971
|
-
l.setErrors({ ...
|
|
1973
|
+
(_) => {
|
|
1974
|
+
l.setErrors({ ..._ });
|
|
1972
1975
|
}
|
|
1973
1976
|
);
|
|
1974
1977
|
const i = v(() => s.getResource(t.slug)), u = v(
|
|
1975
1978
|
() => i.value?.fields ?? []
|
|
1976
|
-
), f = v(() => n.isCreate ? `Создать: ${i.value?.label ?? t.slug}` : `${i.value?.label ?? t.slug}: запись #${t.id}`),
|
|
1977
|
-
const
|
|
1978
|
-
return typeof
|
|
1979
|
-
}),
|
|
1980
|
-
switch (
|
|
1979
|
+
), f = v(() => n.isCreate ? `Создать: ${i.value?.label ?? t.slug}` : `${i.value?.label ?? t.slug}: запись #${t.id}`), p = v(() => {
|
|
1980
|
+
const _ = n.state.status;
|
|
1981
|
+
return typeof _ == "string" ? _ : null;
|
|
1982
|
+
}), y = v(() => {
|
|
1983
|
+
switch (p.value) {
|
|
1981
1984
|
case "published":
|
|
1982
1985
|
return "success";
|
|
1983
1986
|
case "review":
|
|
@@ -1989,63 +1992,63 @@ const xt = /* @__PURE__ */ L({
|
|
|
1989
1992
|
return "default";
|
|
1990
1993
|
}
|
|
1991
1994
|
});
|
|
1992
|
-
|
|
1995
|
+
Re(async () => {
|
|
1993
1996
|
s.manifest === null && await s.load().catch(() => {
|
|
1994
1997
|
}), t.id !== null && t.id !== void 0 ? await n.load(t.slug, t.id, "edit").catch(() => {
|
|
1995
1998
|
}) : n.prepareCreate(t.slug);
|
|
1996
1999
|
}), ee(
|
|
1997
2000
|
() => [t.slug, t.id],
|
|
1998
|
-
async ([
|
|
1999
|
-
|
|
2000
|
-
}) : n.prepareCreate(
|
|
2001
|
+
async ([_, g]) => {
|
|
2002
|
+
g != null ? await n.load(_, g, "edit").catch(() => {
|
|
2003
|
+
}) : n.prepareCreate(_);
|
|
2001
2004
|
}
|
|
2002
2005
|
);
|
|
2003
2006
|
async function k() {
|
|
2004
2007
|
try {
|
|
2005
|
-
const
|
|
2008
|
+
const _ = await n.save();
|
|
2006
2009
|
n.isCreate && a.push({
|
|
2007
2010
|
name: `admin.resource.${t.slug}.edit`,
|
|
2008
|
-
params: { id:
|
|
2011
|
+
params: { id: _ }
|
|
2009
2012
|
}).catch(() => {
|
|
2010
2013
|
});
|
|
2011
2014
|
} catch {
|
|
2012
2015
|
}
|
|
2013
2016
|
}
|
|
2014
|
-
async function
|
|
2017
|
+
async function x() {
|
|
2015
2018
|
confirm("Удалить запись?") && (await n.destroy().catch(() => {
|
|
2016
2019
|
}), n.hasError || a.push({ name: t.indexRouteName }).catch(() => {
|
|
2017
2020
|
}));
|
|
2018
2021
|
}
|
|
2019
|
-
function
|
|
2022
|
+
function C() {
|
|
2020
2023
|
n.isDirty && !confirm("Несохранённые изменения будут потеряны. Продолжить?") || a.push({ name: t.indexRouteName }).catch(() => {
|
|
2021
2024
|
});
|
|
2022
2025
|
}
|
|
2023
|
-
return (
|
|
2026
|
+
return (_, g) => (o(), c("section", ja, [
|
|
2024
2027
|
d("header", Ka, [
|
|
2025
|
-
d("div",
|
|
2028
|
+
d("div", Ga, [
|
|
2026
2029
|
d("a", {
|
|
2027
2030
|
class: "admin-resource-form__back",
|
|
2028
|
-
onClick:
|
|
2031
|
+
onClick: C
|
|
2029
2032
|
}, "← Назад"),
|
|
2030
|
-
d("h1",
|
|
2031
|
-
|
|
2033
|
+
d("h1", Ha, h(f.value), 1),
|
|
2034
|
+
p.value ? (o(), b(r(Ke), {
|
|
2032
2035
|
key: 0,
|
|
2033
|
-
variant:
|
|
2036
|
+
variant: y.value
|
|
2034
2037
|
}, {
|
|
2035
2038
|
default: m(() => [
|
|
2036
|
-
|
|
2039
|
+
S(h(p.value), 1)
|
|
2037
2040
|
]),
|
|
2038
2041
|
_: 1
|
|
2039
|
-
}, 8, ["variant"])) :
|
|
2042
|
+
}, 8, ["variant"])) : U("", !0)
|
|
2040
2043
|
]),
|
|
2041
|
-
d("div",
|
|
2044
|
+
d("div", Xa, [
|
|
2042
2045
|
$(r(z), {
|
|
2043
2046
|
variant: "ghost",
|
|
2044
2047
|
disabled: r(n).saving || r(n).deleting,
|
|
2045
|
-
onClick:
|
|
2048
|
+
onClick: C
|
|
2046
2049
|
}, {
|
|
2047
|
-
default: m(() => [...
|
|
2048
|
-
|
|
2050
|
+
default: m(() => [...g[0] || (g[0] = [
|
|
2051
|
+
S(" Отмена ", -1)
|
|
2049
2052
|
])]),
|
|
2050
2053
|
_: 1
|
|
2051
2054
|
}, 8, ["disabled"]),
|
|
@@ -2054,13 +2057,13 @@ const xt = /* @__PURE__ */ L({
|
|
|
2054
2057
|
variant: "danger",
|
|
2055
2058
|
disabled: r(n).saving || r(n).deleting,
|
|
2056
2059
|
loading: r(n).deleting,
|
|
2057
|
-
onClick:
|
|
2060
|
+
onClick: x
|
|
2058
2061
|
}, {
|
|
2059
|
-
default: m(() => [...
|
|
2060
|
-
|
|
2062
|
+
default: m(() => [...g[1] || (g[1] = [
|
|
2063
|
+
S(" Удалить ", -1)
|
|
2061
2064
|
])]),
|
|
2062
2065
|
_: 1
|
|
2063
|
-
}, 8, ["disabled", "loading"])) :
|
|
2066
|
+
}, 8, ["disabled", "loading"])) : U("", !0),
|
|
2064
2067
|
$(r(z), {
|
|
2065
2068
|
variant: "primary",
|
|
2066
2069
|
disabled: r(n).saving || r(n).loading,
|
|
@@ -2068,7 +2071,7 @@ const xt = /* @__PURE__ */ L({
|
|
|
2068
2071
|
onClick: k
|
|
2069
2072
|
}, {
|
|
2070
2073
|
default: m(() => [
|
|
2071
|
-
|
|
2074
|
+
S(h(r(n).isCreate ? "Создать" : "Сохранить"), 1)
|
|
2072
2075
|
]),
|
|
2073
2076
|
_: 1
|
|
2074
2077
|
}, 8, ["disabled", "loading"])
|
|
@@ -2081,37 +2084,37 @@ const xt = /* @__PURE__ */ L({
|
|
|
2081
2084
|
role: "alert"
|
|
2082
2085
|
}, {
|
|
2083
2086
|
default: m(() => [
|
|
2084
|
-
|
|
2087
|
+
S(h(r(n).error?.message ?? "Не удалось сохранить запись"), 1)
|
|
2085
2088
|
]),
|
|
2086
2089
|
_: 1
|
|
2087
|
-
})) :
|
|
2088
|
-
r(n).loading ? (o(), c("div",
|
|
2089
|
-
(o(), c(P, null, D(6, (
|
|
2090
|
-
key:
|
|
2090
|
+
})) : U("", !0),
|
|
2091
|
+
r(n).loading ? (o(), c("div", Ya, [
|
|
2092
|
+
(o(), c(P, null, D(6, (F) => $(r(We), {
|
|
2093
|
+
key: F,
|
|
2091
2094
|
height: "40px"
|
|
2092
2095
|
})), 64))
|
|
2093
|
-
])) : (o(), b(r(
|
|
2096
|
+
])) : (o(), b(r(K), {
|
|
2094
2097
|
key: 2,
|
|
2095
2098
|
padding: "md",
|
|
2096
2099
|
class: "admin-resource-form__body"
|
|
2097
2100
|
}, {
|
|
2098
2101
|
default: m(() => [
|
|
2099
|
-
(o(!0), c(P, null, D(u.value, (
|
|
2102
|
+
(o(!0), c(P, null, D(u.value, (F, q) => (o(), b(we, {
|
|
2100
2103
|
key: q,
|
|
2101
|
-
node:
|
|
2104
|
+
node: F
|
|
2102
2105
|
}, null, 8, ["node"]))), 128))
|
|
2103
2106
|
]),
|
|
2104
2107
|
_: 1
|
|
2105
2108
|
})),
|
|
2106
|
-
r(n).isDirty && !r(n).loading ? (o(), c("div",
|
|
2107
|
-
|
|
2109
|
+
r(n).isDirty && !r(n).loading ? (o(), c("div", Ja, [
|
|
2110
|
+
g[4] || (g[4] = d("span", { class: "admin-resource-form__savebar-hint" }, " Есть несохранённые изменения ", -1)),
|
|
2108
2111
|
$(r(z), {
|
|
2109
2112
|
variant: "ghost",
|
|
2110
2113
|
size: "sm",
|
|
2111
|
-
onClick:
|
|
2114
|
+
onClick: C
|
|
2112
2115
|
}, {
|
|
2113
|
-
default: m(() => [...
|
|
2114
|
-
|
|
2116
|
+
default: m(() => [...g[2] || (g[2] = [
|
|
2117
|
+
S("Отмена", -1)
|
|
2115
2118
|
])]),
|
|
2116
2119
|
_: 1
|
|
2117
2120
|
}),
|
|
@@ -2122,15 +2125,15 @@ const xt = /* @__PURE__ */ L({
|
|
|
2122
2125
|
disabled: r(n).saving,
|
|
2123
2126
|
onClick: k
|
|
2124
2127
|
}, {
|
|
2125
|
-
default: m(() => [...
|
|
2126
|
-
|
|
2128
|
+
default: m(() => [...g[3] || (g[3] = [
|
|
2129
|
+
S(" Сохранить ", -1)
|
|
2127
2130
|
])]),
|
|
2128
2131
|
_: 1
|
|
2129
2132
|
}, 8, ["loading", "disabled"])
|
|
2130
|
-
])) :
|
|
2133
|
+
])) : U("", !0)
|
|
2131
2134
|
]));
|
|
2132
2135
|
}
|
|
2133
|
-
}), ve = Me(),
|
|
2136
|
+
}), ve = Me(), io = ve.register, st = ve.get, oo = ve.has, ro = ve.list, uo = ve.clear, Qa = ve.registerBundle, Za = /* @__PURE__ */ L({
|
|
2134
2137
|
__name: "UnknownEntry",
|
|
2135
2138
|
props: {
|
|
2136
2139
|
type: {},
|
|
@@ -2139,41 +2142,41 @@ const xt = /* @__PURE__ */ L({
|
|
|
2139
2142
|
setup(e) {
|
|
2140
2143
|
return (t, n) => (o(), b(r(te), { variant: "warning" }, {
|
|
2141
2144
|
title: m(() => [
|
|
2142
|
-
|
|
2145
|
+
S("Неизвестный тип infolist-entry: " + h(e.type), 1)
|
|
2143
2146
|
]),
|
|
2144
2147
|
default: m(() => [
|
|
2145
|
-
n[0] || (n[0] =
|
|
2146
|
-
d("code", null, "registerInfolistEntry('" +
|
|
2147
|
-
n[1] || (n[1] =
|
|
2148
|
+
n[0] || (n[0] = S(" Зарегистрируйте через ", -1)),
|
|
2149
|
+
d("code", null, "registerInfolistEntry('" + h(e.type) + "', YourComponent)", 1),
|
|
2150
|
+
n[1] || (n[1] = S(". ", -1))
|
|
2148
2151
|
]),
|
|
2149
2152
|
_: 1
|
|
2150
2153
|
}));
|
|
2151
2154
|
}
|
|
2152
|
-
}),
|
|
2155
|
+
}), el = {
|
|
2153
2156
|
key: 1,
|
|
2154
2157
|
class: "admin-infolist-rows"
|
|
2155
|
-
},
|
|
2158
|
+
}, tl = {
|
|
2156
2159
|
key: 2,
|
|
2157
2160
|
class: "admin-infolist-cols"
|
|
2158
|
-
},
|
|
2161
|
+
}, nl = {
|
|
2159
2162
|
key: 3,
|
|
2160
2163
|
class: "admin-infolist-section"
|
|
2161
|
-
},
|
|
2164
|
+
}, al = {
|
|
2162
2165
|
key: 0,
|
|
2163
2166
|
class: "admin-infolist-section__hd"
|
|
2164
|
-
},
|
|
2167
|
+
}, ll = {
|
|
2165
2168
|
key: 0,
|
|
2166
2169
|
class: "admin-infolist-section__title"
|
|
2167
|
-
},
|
|
2170
|
+
}, sl = {
|
|
2168
2171
|
key: 1,
|
|
2169
2172
|
class: "admin-infolist-section__description"
|
|
2170
|
-
},
|
|
2173
|
+
}, il = { class: "admin-infolist-section__body" }, ol = {
|
|
2171
2174
|
key: 4,
|
|
2172
2175
|
class: "admin-infolist-tabs"
|
|
2173
|
-
},
|
|
2176
|
+
}, rl = {
|
|
2174
2177
|
class: "admin-infolist-tabs__list",
|
|
2175
2178
|
role: "tablist"
|
|
2176
|
-
},
|
|
2179
|
+
}, ul = { class: "admin-infolist-tabs__panel" }, dl = /* @__PURE__ */ L({
|
|
2177
2180
|
__name: "InfolistRenderer",
|
|
2178
2181
|
props: {
|
|
2179
2182
|
node: {}
|
|
@@ -2188,64 +2191,64 @@ const xt = /* @__PURE__ */ L({
|
|
|
2188
2191
|
return n.has(t.node.type) ? { kind: "layout", layoutType: t.node.type } : { kind: "unknown" };
|
|
2189
2192
|
if (n.has(t.node.type))
|
|
2190
2193
|
return { kind: "layout", layoutType: t.node.type };
|
|
2191
|
-
const
|
|
2192
|
-
return
|
|
2194
|
+
const y = st(t.node.type);
|
|
2195
|
+
return y ? { kind: "entry", component: y } : { kind: "unknown" };
|
|
2193
2196
|
}), a = v(() => {
|
|
2194
|
-
const { type:
|
|
2195
|
-
return
|
|
2197
|
+
const { type: y, kind: k, items: x, ...C } = t.node;
|
|
2198
|
+
return C;
|
|
2196
2199
|
}), l = v(
|
|
2197
2200
|
() => t.node.items ?? []
|
|
2198
2201
|
), i = v(() => t.node.title ?? null), u = v(
|
|
2199
2202
|
() => t.node.description ?? null
|
|
2200
2203
|
), f = v(() => {
|
|
2201
|
-
const
|
|
2202
|
-
return typeof
|
|
2203
|
-
}),
|
|
2204
|
-
return (
|
|
2205
|
-
const
|
|
2206
|
-
return s.value.kind === "entry" ? (o(), b(se(s.value.component), Ue(
|
|
2207
|
-
(o(!0), c(P, null, D(l.value, (
|
|
2208
|
-
key:
|
|
2209
|
-
node:
|
|
2204
|
+
const y = t.node.active;
|
|
2205
|
+
return typeof y == "number" ? y : 0;
|
|
2206
|
+
}), p = v(() => t.node.items ?? []);
|
|
2207
|
+
return (y, k) => {
|
|
2208
|
+
const x = rt("InfolistRenderer", !0);
|
|
2209
|
+
return s.value.kind === "entry" ? (o(), b(se(s.value.component), Fe(Ue({ key: 0 }, a.value)), null, 16)) : s.value.kind === "layout" && s.value.layoutType === "rows" ? (o(), c("div", el, [
|
|
2210
|
+
(o(!0), c(P, null, D(l.value, (C, _) => (o(), b(x, {
|
|
2211
|
+
key: _,
|
|
2212
|
+
node: C
|
|
2210
2213
|
}, null, 8, ["node"]))), 128))
|
|
2211
|
-
])) : s.value.kind === "layout" && s.value.layoutType === "columns" ? (o(), c("div",
|
|
2212
|
-
(o(!0), c(P, null, D(l.value, (
|
|
2213
|
-
key:
|
|
2214
|
+
])) : s.value.kind === "layout" && s.value.layoutType === "columns" ? (o(), c("div", tl, [
|
|
2215
|
+
(o(!0), c(P, null, D(l.value, (C, _) => (o(), c("div", {
|
|
2216
|
+
key: _,
|
|
2214
2217
|
class: "admin-infolist-cols__item",
|
|
2215
2218
|
style: Te({
|
|
2216
|
-
gridColumn: `span ${typeof
|
|
2219
|
+
gridColumn: `span ${typeof C.span == "number" ? C.span : Math.max(1, Math.floor(12 / l.value.length))}`
|
|
2217
2220
|
})
|
|
2218
2221
|
}, [
|
|
2219
|
-
$(
|
|
2222
|
+
$(x, { node: C }, null, 8, ["node"])
|
|
2220
2223
|
], 4))), 128))
|
|
2221
|
-
])) : s.value.kind === "layout" && (s.value.layoutType === "section" || s.value.layoutType === "block") ? (o(), c("section",
|
|
2222
|
-
i.value || u.value ? (o(), c("header",
|
|
2223
|
-
i.value ? (o(), c("h3",
|
|
2224
|
-
u.value ? (o(), c("p",
|
|
2225
|
-
])) :
|
|
2226
|
-
d("div",
|
|
2227
|
-
(o(!0), c(P, null, D(l.value, (
|
|
2228
|
-
key:
|
|
2229
|
-
node:
|
|
2224
|
+
])) : s.value.kind === "layout" && (s.value.layoutType === "section" || s.value.layoutType === "block") ? (o(), c("section", nl, [
|
|
2225
|
+
i.value || u.value ? (o(), c("header", al, [
|
|
2226
|
+
i.value ? (o(), c("h3", ll, h(i.value), 1)) : U("", !0),
|
|
2227
|
+
u.value ? (o(), c("p", sl, h(u.value), 1)) : U("", !0)
|
|
2228
|
+
])) : U("", !0),
|
|
2229
|
+
d("div", il, [
|
|
2230
|
+
(o(!0), c(P, null, D(l.value, (C, _) => (o(), b(x, {
|
|
2231
|
+
key: _,
|
|
2232
|
+
node: C
|
|
2230
2233
|
}, null, 8, ["node"]))), 128))
|
|
2231
2234
|
])
|
|
2232
|
-
])) : s.value.kind === "layout" && s.value.layoutType === "tabs" ? (o(), c("div",
|
|
2233
|
-
d("ul",
|
|
2234
|
-
(o(!0), c(P, null, D(
|
|
2235
|
-
key:
|
|
2235
|
+
])) : s.value.kind === "layout" && s.value.layoutType === "tabs" ? (o(), c("div", ol, [
|
|
2236
|
+
d("ul", rl, [
|
|
2237
|
+
(o(!0), c(P, null, D(p.value, (C, _) => (o(), c("li", {
|
|
2238
|
+
key: C.key ?? _,
|
|
2236
2239
|
class: Z([
|
|
2237
2240
|
"admin-infolist-tabs__tab",
|
|
2238
|
-
{ "admin-infolist-tabs__tab--active":
|
|
2241
|
+
{ "admin-infolist-tabs__tab--active": _ === f.value }
|
|
2239
2242
|
])
|
|
2240
|
-
},
|
|
2243
|
+
}, h(C.label), 3))), 128))
|
|
2241
2244
|
]),
|
|
2242
|
-
d("div",
|
|
2243
|
-
(o(!0), c(P, null, D(
|
|
2244
|
-
key:
|
|
2245
|
-
node:
|
|
2245
|
+
d("div", ul, [
|
|
2246
|
+
(o(!0), c(P, null, D(p.value[f.value]?.items ?? [], (C, _) => (o(), b(x, {
|
|
2247
|
+
key: _,
|
|
2248
|
+
node: C
|
|
2246
2249
|
}, null, 8, ["node"]))), 128))
|
|
2247
2250
|
])
|
|
2248
|
-
])) : (o(), b(
|
|
2251
|
+
])) : (o(), b(Za, {
|
|
2249
2252
|
key: 5,
|
|
2250
2253
|
type: e.node.type,
|
|
2251
2254
|
name: e.node.name
|
|
@@ -2253,10 +2256,10 @@ const xt = /* @__PURE__ */ L({
|
|
|
2253
2256
|
};
|
|
2254
2257
|
}
|
|
2255
2258
|
}), Je = /* @__PURE__ */ Symbol("admin.infolist-record");
|
|
2256
|
-
function
|
|
2257
|
-
|
|
2259
|
+
function cl(e) {
|
|
2260
|
+
Nt(Je, e);
|
|
2258
2261
|
}
|
|
2259
|
-
function
|
|
2262
|
+
function co() {
|
|
2260
2263
|
const e = dt(Je);
|
|
2261
2264
|
if (!e)
|
|
2262
2265
|
throw new Error("useRecord() called outside of provideRecord() scope");
|
|
@@ -2265,10 +2268,10 @@ function uo() {
|
|
|
2265
2268
|
function Ne() {
|
|
2266
2269
|
return dt(Je, null);
|
|
2267
2270
|
}
|
|
2268
|
-
const
|
|
2271
|
+
const ml = { class: "admin-page admin-resource-view" }, fl = { class: "admin-page__hd" }, vl = { class: "admin-page__title-wrap" }, pl = { class: "admin-page__title" }, gl = { class: "admin-page__actions" }, hl = {
|
|
2269
2272
|
key: 1,
|
|
2270
2273
|
class: "admin-resource-view__loading"
|
|
2271
|
-
},
|
|
2274
|
+
}, _l = /* @__PURE__ */ L({
|
|
2272
2275
|
__name: "ResourceViewPage",
|
|
2273
2276
|
props: {
|
|
2274
2277
|
slug: {},
|
|
@@ -2277,21 +2280,21 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2277
2280
|
indexRouteName: { default: "admin.home" }
|
|
2278
2281
|
},
|
|
2279
2282
|
setup(e) {
|
|
2280
|
-
const t = e, n =
|
|
2281
|
-
|
|
2283
|
+
const t = e, n = $t(), s = oe(), a = ie();
|
|
2284
|
+
cl(n.state);
|
|
2282
2285
|
const l = v(() => s.getResource(t.slug)), i = v(
|
|
2283
2286
|
() => l.value?.fields ?? []
|
|
2284
2287
|
), u = v(
|
|
2285
2288
|
() => `${l.value?.label ?? t.slug}: запись #${t.id}`
|
|
2286
2289
|
);
|
|
2287
|
-
|
|
2290
|
+
Re(async () => {
|
|
2288
2291
|
s.manifest === null && await s.load().catch(() => {
|
|
2289
2292
|
}), await n.load(t.slug, t.id, "view").catch(() => {
|
|
2290
2293
|
});
|
|
2291
2294
|
}), ee(
|
|
2292
2295
|
() => [t.slug, t.id],
|
|
2293
|
-
async ([
|
|
2294
|
-
await n.load(
|
|
2296
|
+
async ([y, k]) => {
|
|
2297
|
+
await n.load(y, k, "view").catch(() => {
|
|
2295
2298
|
});
|
|
2296
2299
|
}
|
|
2297
2300
|
);
|
|
@@ -2304,23 +2307,23 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2304
2307
|
a.push({ name: t.editRouteName, params: { id: t.id } }).catch(() => {
|
|
2305
2308
|
});
|
|
2306
2309
|
}
|
|
2307
|
-
async function
|
|
2310
|
+
async function p() {
|
|
2308
2311
|
confirm("Удалить запись?") && (await n.destroy().catch(() => {
|
|
2309
2312
|
}), n.hasError || a.push({ name: t.indexRouteName }).catch(() => {
|
|
2310
2313
|
}));
|
|
2311
2314
|
}
|
|
2312
|
-
return (
|
|
2313
|
-
d("header",
|
|
2314
|
-
d("div",
|
|
2315
|
-
d("h1",
|
|
2315
|
+
return (y, k) => (o(), c("section", ml, [
|
|
2316
|
+
d("header", fl, [
|
|
2317
|
+
d("div", vl, [
|
|
2318
|
+
d("h1", pl, h(u.value), 1)
|
|
2316
2319
|
]),
|
|
2317
|
-
d("div",
|
|
2320
|
+
d("div", gl, [
|
|
2318
2321
|
$(r(z), {
|
|
2319
2322
|
variant: "ghost",
|
|
2320
2323
|
onClick: f
|
|
2321
2324
|
}, {
|
|
2322
2325
|
default: m(() => [...k[0] || (k[0] = [
|
|
2323
|
-
|
|
2326
|
+
S("Редактировать", -1)
|
|
2324
2327
|
])]),
|
|
2325
2328
|
_: 1
|
|
2326
2329
|
}),
|
|
@@ -2328,10 +2331,10 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2328
2331
|
variant: "danger",
|
|
2329
2332
|
loading: r(n).deleting,
|
|
2330
2333
|
disabled: r(n).deleting,
|
|
2331
|
-
onClick:
|
|
2334
|
+
onClick: p
|
|
2332
2335
|
}, {
|
|
2333
2336
|
default: m(() => [...k[1] || (k[1] = [
|
|
2334
|
-
|
|
2337
|
+
S(" Удалить ", -1)
|
|
2335
2338
|
])]),
|
|
2336
2339
|
_: 1
|
|
2337
2340
|
}, 8, ["loading", "disabled"])
|
|
@@ -2344,40 +2347,40 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2344
2347
|
role: "alert"
|
|
2345
2348
|
}, {
|
|
2346
2349
|
default: m(() => [
|
|
2347
|
-
|
|
2350
|
+
S(h(r(n).error?.message ?? "Не удалось загрузить запись"), 1)
|
|
2348
2351
|
]),
|
|
2349
2352
|
_: 1
|
|
2350
|
-
})) :
|
|
2351
|
-
r(n).loading ? (o(), c("div",
|
|
2352
|
-
(o(), c(P, null, D(8, (
|
|
2353
|
-
key:
|
|
2353
|
+
})) : U("", !0),
|
|
2354
|
+
r(n).loading ? (o(), c("div", hl, [
|
|
2355
|
+
(o(), c(P, null, D(8, (x) => $(r(We), {
|
|
2356
|
+
key: x,
|
|
2354
2357
|
height: "24px"
|
|
2355
2358
|
})), 64))
|
|
2356
|
-
])) : (o(), b(r(
|
|
2359
|
+
])) : (o(), b(r(K), {
|
|
2357
2360
|
key: 2,
|
|
2358
2361
|
padding: "md",
|
|
2359
2362
|
class: "admin-resource-view__body"
|
|
2360
2363
|
}, {
|
|
2361
2364
|
default: m(() => [
|
|
2362
|
-
(o(!0), c(P, null, D(i.value, (
|
|
2363
|
-
key:
|
|
2364
|
-
node:
|
|
2365
|
+
(o(!0), c(P, null, D(i.value, (x, C) => (o(), b(dl, {
|
|
2366
|
+
key: C,
|
|
2367
|
+
node: x
|
|
2365
2368
|
}, null, 8, ["node"]))), 128))
|
|
2366
2369
|
]),
|
|
2367
2370
|
_: 1
|
|
2368
2371
|
}))
|
|
2369
2372
|
]));
|
|
2370
2373
|
}
|
|
2371
|
-
}),
|
|
2374
|
+
}), yl = { class: "admin-page admin-profile" }, bl = { class: "admin-page__hd" }, kl = { class: "admin-page__title-wrap" }, wl = { class: "admin-page__title" }, $l = { class: "admin-page__count" }, xl = { class: "admin-profile__layout" }, Sl = {
|
|
2372
2375
|
class: "admin-profile__nav",
|
|
2373
2376
|
"aria-label": "Profile sections"
|
|
2374
|
-
},
|
|
2377
|
+
}, Cl = ["onClick"], Al = ["data-icon"], El = { class: "admin-profile__content" }, Rl = { class: "admin-profile__hero" }, Fl = { class: "admin-profile__hero-text" }, Ul = { class: "admin-profile__hero-name" }, Tl = { class: "admin-profile__hero-meta" }, Ll = { class: "admin-profile__form" }, Pl = { class: "admin-profile__card-ft" }, Ml = { class: "admin-profile__card-hd" }, Nl = {
|
|
2375
2378
|
key: 0,
|
|
2376
2379
|
class: "admin-profile__hint"
|
|
2377
|
-
},
|
|
2380
|
+
}, Bl = {
|
|
2378
2381
|
key: 1,
|
|
2379
2382
|
class: "admin-profile__hint"
|
|
2380
|
-
},
|
|
2383
|
+
}, Il = { class: "admin-profile__card-ft" }, Dl = { class: "admin-profile__hint" }, Vl = /* @__PURE__ */ L({
|
|
2381
2384
|
__name: "ProfilePage",
|
|
2382
2385
|
props: {
|
|
2383
2386
|
title: { default: "Profile" },
|
|
@@ -2391,42 +2394,42 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2391
2394
|
{ id: "security", label: "Безопасность", icon: "shield" },
|
|
2392
2395
|
{ id: "tokens", label: "API токены", icon: "key" },
|
|
2393
2396
|
{ id: "sessions", label: "Сессии", icon: "monitor" }
|
|
2394
|
-
], f =
|
|
2395
|
-
function
|
|
2397
|
+
], f = R(n.section);
|
|
2398
|
+
function p(M) {
|
|
2396
2399
|
f.value = M, s("update:section", M);
|
|
2397
2400
|
}
|
|
2398
|
-
const
|
|
2401
|
+
const y = R({
|
|
2399
2402
|
name: a.user?.name ?? "",
|
|
2400
2403
|
email: a.user?.email ?? "",
|
|
2401
2404
|
locale: i.current,
|
|
2402
2405
|
theme: l.current
|
|
2403
2406
|
}), k = v(
|
|
2404
2407
|
() => i.available.map((M) => ({ value: M, label: M.toUpperCase() }))
|
|
2405
|
-
),
|
|
2408
|
+
), x = v(
|
|
2406
2409
|
() => l.available.map((M) => ({ value: M, label: M === "dark" ? "Тёмная" : M === "light" ? "Светлая" : M }))
|
|
2407
2410
|
);
|
|
2408
|
-
function
|
|
2409
|
-
s("save", { ...
|
|
2411
|
+
function C() {
|
|
2412
|
+
s("save", { ...y.value });
|
|
2410
2413
|
}
|
|
2411
|
-
function
|
|
2414
|
+
function _() {
|
|
2412
2415
|
s("avatar-replace");
|
|
2413
2416
|
}
|
|
2414
|
-
function
|
|
2417
|
+
function g() {
|
|
2415
2418
|
s("two-factor-disable");
|
|
2416
2419
|
}
|
|
2417
|
-
function
|
|
2420
|
+
function F() {
|
|
2418
2421
|
s("two-factor-regenerate");
|
|
2419
2422
|
}
|
|
2420
2423
|
const q = v(() => !!a.user?.twoFactorEnabled);
|
|
2421
|
-
return (M, T) => (o(), c("section",
|
|
2422
|
-
d("header",
|
|
2423
|
-
d("div",
|
|
2424
|
-
d("h1",
|
|
2425
|
-
d("div",
|
|
2424
|
+
return (M, T) => (o(), c("section", yl, [
|
|
2425
|
+
d("header", bl, [
|
|
2426
|
+
d("div", kl, [
|
|
2427
|
+
d("h1", wl, h(e.title), 1),
|
|
2428
|
+
d("div", $l, h(e.subtitle), 1)
|
|
2426
2429
|
])
|
|
2427
2430
|
]),
|
|
2428
|
-
d("div",
|
|
2429
|
-
d("nav",
|
|
2431
|
+
d("div", xl, [
|
|
2432
|
+
d("nav", Sl, [
|
|
2430
2433
|
(o(), c(P, null, D(u, (w) => d("button", {
|
|
2431
2434
|
key: w.id,
|
|
2432
2435
|
type: "button",
|
|
@@ -2434,17 +2437,17 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2434
2437
|
"admin-profile__nav-item",
|
|
2435
2438
|
{ "admin-profile__nav-item--active": f.value === w.id }
|
|
2436
2439
|
]),
|
|
2437
|
-
onClick: (V) =>
|
|
2440
|
+
onClick: (V) => p(w.id)
|
|
2438
2441
|
}, [
|
|
2439
2442
|
d("span", {
|
|
2440
2443
|
class: "admin-profile__nav-icon",
|
|
2441
2444
|
"data-icon": w.icon
|
|
2442
|
-
}, null, 8,
|
|
2443
|
-
d("span", null,
|
|
2444
|
-
], 10,
|
|
2445
|
+
}, null, 8, Al),
|
|
2446
|
+
d("span", null, h(w.label), 1)
|
|
2447
|
+
], 10, Cl)), 64))
|
|
2445
2448
|
]),
|
|
2446
|
-
d("div",
|
|
2447
|
-
f.value === "general" ? (o(), b(r(
|
|
2449
|
+
d("div", El, [
|
|
2450
|
+
f.value === "general" ? (o(), b(r(K), {
|
|
2448
2451
|
key: 0,
|
|
2449
2452
|
padding: "md"
|
|
2450
2453
|
}, {
|
|
@@ -2452,104 +2455,104 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2452
2455
|
T[7] || (T[7] = d("header", { class: "admin-profile__card-hd" }, [
|
|
2453
2456
|
d("h3", { class: "admin-profile__card-title" }, "Профиль")
|
|
2454
2457
|
], -1)),
|
|
2455
|
-
d("div",
|
|
2458
|
+
d("div", Rl, [
|
|
2456
2459
|
$(r(ft), {
|
|
2457
2460
|
src: r(a).user?.avatar ?? void 0,
|
|
2458
2461
|
name: r(a).user?.name ?? "?",
|
|
2459
2462
|
size: "lg"
|
|
2460
2463
|
}, null, 8, ["src", "name"]),
|
|
2461
2464
|
d("div", Fl, [
|
|
2462
|
-
d("div", Ul,
|
|
2463
|
-
d("div",
|
|
2465
|
+
d("div", Ul, h(r(a).user?.name ?? "—"), 1),
|
|
2466
|
+
d("div", Tl, h(r(a).user?.email ?? "—"), 1)
|
|
2464
2467
|
]),
|
|
2465
2468
|
T[5] || (T[5] = d("div", { style: { flex: "1" } }, null, -1)),
|
|
2466
2469
|
$(r(z), {
|
|
2467
2470
|
variant: "ghost",
|
|
2468
2471
|
size: "sm",
|
|
2469
|
-
onClick:
|
|
2472
|
+
onClick: _
|
|
2470
2473
|
}, {
|
|
2471
2474
|
default: m(() => [...T[4] || (T[4] = [
|
|
2472
|
-
|
|
2475
|
+
S(" Заменить ", -1)
|
|
2473
2476
|
])]),
|
|
2474
2477
|
_: 1
|
|
2475
2478
|
})
|
|
2476
2479
|
]),
|
|
2477
|
-
d("div",
|
|
2480
|
+
d("div", Ll, [
|
|
2478
2481
|
$(r(de), {
|
|
2479
|
-
modelValue:
|
|
2480
|
-
"onUpdate:modelValue": T[0] || (T[0] = (w) =>
|
|
2482
|
+
modelValue: y.value.name,
|
|
2483
|
+
"onUpdate:modelValue": T[0] || (T[0] = (w) => y.value.name = w),
|
|
2481
2484
|
label: "Имя",
|
|
2482
2485
|
name: "name"
|
|
2483
2486
|
}, null, 8, ["modelValue"]),
|
|
2484
2487
|
$(r(de), {
|
|
2485
|
-
modelValue:
|
|
2486
|
-
"onUpdate:modelValue": T[1] || (T[1] = (w) =>
|
|
2488
|
+
modelValue: y.value.email,
|
|
2489
|
+
"onUpdate:modelValue": T[1] || (T[1] = (w) => y.value.email = w),
|
|
2487
2490
|
label: "Email",
|
|
2488
2491
|
type: "email",
|
|
2489
2492
|
name: "email"
|
|
2490
2493
|
}, null, 8, ["modelValue"]),
|
|
2491
2494
|
$(r(Ee), {
|
|
2492
|
-
modelValue:
|
|
2493
|
-
"onUpdate:modelValue": T[2] || (T[2] = (w) =>
|
|
2495
|
+
modelValue: y.value.locale,
|
|
2496
|
+
"onUpdate:modelValue": T[2] || (T[2] = (w) => y.value.locale = w),
|
|
2494
2497
|
options: k.value,
|
|
2495
2498
|
label: "Язык"
|
|
2496
2499
|
}, null, 8, ["modelValue", "options"]),
|
|
2497
2500
|
$(r(Ee), {
|
|
2498
|
-
modelValue:
|
|
2499
|
-
"onUpdate:modelValue": T[3] || (T[3] = (w) =>
|
|
2500
|
-
options:
|
|
2501
|
+
modelValue: y.value.theme,
|
|
2502
|
+
"onUpdate:modelValue": T[3] || (T[3] = (w) => y.value.theme = w),
|
|
2503
|
+
options: x.value,
|
|
2501
2504
|
label: "Тема"
|
|
2502
2505
|
}, null, 8, ["modelValue", "options"])
|
|
2503
2506
|
]),
|
|
2504
|
-
d("footer",
|
|
2507
|
+
d("footer", Pl, [
|
|
2505
2508
|
$(r(z), {
|
|
2506
2509
|
variant: "primary",
|
|
2507
|
-
onClick:
|
|
2510
|
+
onClick: C
|
|
2508
2511
|
}, {
|
|
2509
2512
|
default: m(() => [...T[6] || (T[6] = [
|
|
2510
|
-
|
|
2513
|
+
S("Сохранить", -1)
|
|
2511
2514
|
])]),
|
|
2512
2515
|
_: 1
|
|
2513
2516
|
})
|
|
2514
2517
|
])
|
|
2515
2518
|
]),
|
|
2516
2519
|
_: 1
|
|
2517
|
-
})) : f.value === "security" ? (o(), b(r(
|
|
2520
|
+
})) : f.value === "security" ? (o(), b(r(K), {
|
|
2518
2521
|
key: 1,
|
|
2519
2522
|
padding: "md"
|
|
2520
2523
|
}, {
|
|
2521
2524
|
default: m(() => [
|
|
2522
|
-
d("header",
|
|
2525
|
+
d("header", Ml, [
|
|
2523
2526
|
T[8] || (T[8] = d("h3", { class: "admin-profile__card-title" }, "Двухфакторная аутентификация", -1)),
|
|
2524
|
-
$(r(
|
|
2527
|
+
$(r(Ke), {
|
|
2525
2528
|
variant: q.value ? "success" : "default"
|
|
2526
2529
|
}, {
|
|
2527
2530
|
default: m(() => [
|
|
2528
|
-
|
|
2531
|
+
S(h(q.value ? "Включена" : "Отключена"), 1)
|
|
2529
2532
|
]),
|
|
2530
2533
|
_: 1
|
|
2531
2534
|
}, 8, ["variant"])
|
|
2532
2535
|
]),
|
|
2533
|
-
q.value ? (o(), c("p",
|
|
2534
|
-
d("footer",
|
|
2536
|
+
q.value ? (o(), c("p", Nl, " 2FA включена. У вас остались recovery-коды на случай потери устройства. ")) : (o(), c("p", Bl, " Включите 2FA для дополнительной защиты аккаунта. ")),
|
|
2537
|
+
d("footer", Il, [
|
|
2535
2538
|
q.value ? (o(), c(P, { key: 0 }, [
|
|
2536
2539
|
$(r(z), {
|
|
2537
2540
|
variant: "ghost",
|
|
2538
2541
|
size: "sm",
|
|
2539
|
-
onClick:
|
|
2542
|
+
onClick: F
|
|
2540
2543
|
}, {
|
|
2541
2544
|
default: m(() => [...T[9] || (T[9] = [
|
|
2542
|
-
|
|
2545
|
+
S(" Перегенерировать коды ", -1)
|
|
2543
2546
|
])]),
|
|
2544
2547
|
_: 1
|
|
2545
2548
|
}),
|
|
2546
2549
|
$(r(z), {
|
|
2547
2550
|
variant: "danger",
|
|
2548
2551
|
size: "sm",
|
|
2549
|
-
onClick:
|
|
2552
|
+
onClick: g
|
|
2550
2553
|
}, {
|
|
2551
2554
|
default: m(() => [...T[10] || (T[10] = [
|
|
2552
|
-
|
|
2555
|
+
S(" Отключить 2FA ", -1)
|
|
2553
2556
|
])]),
|
|
2554
2557
|
_: 1
|
|
2555
2558
|
})
|
|
@@ -2559,7 +2562,7 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2559
2562
|
disabled: ""
|
|
2560
2563
|
}, {
|
|
2561
2564
|
default: m(() => [...T[11] || (T[11] = [
|
|
2562
|
-
|
|
2565
|
+
S(" Включить 2FA (host customize) ", -1)
|
|
2563
2566
|
])]),
|
|
2564
2567
|
_: 1
|
|
2565
2568
|
})
|
|
@@ -2571,9 +2574,9 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2571
2574
|
key: 2,
|
|
2572
2575
|
section: f.value
|
|
2573
2576
|
}, () => [
|
|
2574
|
-
$(r(
|
|
2577
|
+
$(r(K), { padding: "md" }, {
|
|
2575
2578
|
default: m(() => [
|
|
2576
|
-
d("p",
|
|
2579
|
+
d("p", Dl, " Section «" + h(f.value) + "» не реализована библиотекой — host-проект подключает её через slot " + h(f.value) + ". ", 1)
|
|
2577
2580
|
]),
|
|
2578
2581
|
_: 1
|
|
2579
2582
|
})
|
|
@@ -2582,7 +2585,7 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2582
2585
|
])
|
|
2583
2586
|
]));
|
|
2584
2587
|
}
|
|
2585
|
-
}), pe = Me(),
|
|
2588
|
+
}), pe = Me(), mo = pe.register, zl = pe.get, fo = pe.has, vo = pe.list, po = pe.clear, ql = pe.registerBundle, Ol = /* @__PURE__ */ L({
|
|
2586
2589
|
__name: "UnknownWidget",
|
|
2587
2590
|
props: {
|
|
2588
2591
|
type: {}
|
|
@@ -2590,35 +2593,35 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2590
2593
|
setup(e) {
|
|
2591
2594
|
return (t, n) => (o(), b(r(te), { variant: "warning" }, {
|
|
2592
2595
|
title: m(() => [
|
|
2593
|
-
|
|
2596
|
+
S("Неизвестный widget-тип: " + h(e.type), 1)
|
|
2594
2597
|
]),
|
|
2595
2598
|
default: m(() => [
|
|
2596
|
-
n[0] || (n[0] =
|
|
2597
|
-
d("code", null, "registerWidget('" +
|
|
2598
|
-
n[1] || (n[1] =
|
|
2599
|
+
n[0] || (n[0] = S(" Зарегистрируйте через ", -1)),
|
|
2600
|
+
d("code", null, "registerWidget('" + h(e.type) + "', YourComponent)", 1),
|
|
2601
|
+
n[1] || (n[1] = S(". ", -1))
|
|
2599
2602
|
]),
|
|
2600
2603
|
_: 1
|
|
2601
2604
|
}));
|
|
2602
2605
|
}
|
|
2603
|
-
}),
|
|
2606
|
+
}), Wl = /* @__PURE__ */ L({
|
|
2604
2607
|
__name: "WidgetRenderer",
|
|
2605
2608
|
props: {
|
|
2606
2609
|
node: {}
|
|
2607
2610
|
},
|
|
2608
2611
|
setup(e) {
|
|
2609
|
-
const t = e, n = v(() =>
|
|
2612
|
+
const t = e, n = v(() => zl(t.node.type)), s = v(() => {
|
|
2610
2613
|
const { type: a, span: l, ...i } = t.node;
|
|
2611
2614
|
return i;
|
|
2612
2615
|
});
|
|
2613
|
-
return (a, l) => n.value ? (o(), b(se(n.value), Ue(
|
|
2616
|
+
return (a, l) => n.value ? (o(), b(se(n.value), Fe(Ue({ key: 0 }, s.value)), null, 16)) : (o(), b(Ol, {
|
|
2614
2617
|
key: 1,
|
|
2615
2618
|
type: e.node.type
|
|
2616
2619
|
}, null, 8, ["type"]));
|
|
2617
2620
|
}
|
|
2618
|
-
}),
|
|
2621
|
+
}), jl = { class: "admin-page admin-dashboard" }, Kl = { class: "admin-page__hd" }, Gl = { class: "admin-page__title-wrap" }, Hl = { class: "admin-page__title" }, Xl = {
|
|
2619
2622
|
key: 0,
|
|
2620
2623
|
class: "admin-page__count"
|
|
2621
|
-
},
|
|
2624
|
+
}, Yl = { class: "admin-page__actions" }, Jl = { class: "admin-dashboard__grid" }, Ql = /* @__PURE__ */ L({
|
|
2622
2625
|
__name: "DashboardPage",
|
|
2623
2626
|
props: {
|
|
2624
2627
|
slug: { default: void 0 },
|
|
@@ -2627,37 +2630,37 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2627
2630
|
subtitle: { default: void 0 }
|
|
2628
2631
|
},
|
|
2629
2632
|
setup(e) {
|
|
2630
|
-
const t = e, n = oe(), s = v(() => !t.slug || !n.manifest ? null : n.manifest.dashboards?.find((
|
|
2633
|
+
const t = e, n = oe(), s = v(() => !t.slug || !n.manifest ? null : n.manifest.dashboards?.find((p) => p.slug === t.slug) ?? null), a = v(() => t.widgets ? t.widgets : s.value ? s.value.widgets ?? [] : []), l = v(
|
|
2631
2634
|
() => t.title ?? s.value?.label ?? "Dashboard"
|
|
2632
2635
|
), i = v(
|
|
2633
2636
|
() => t.subtitle ?? s.value?.description ?? null
|
|
2634
2637
|
);
|
|
2635
2638
|
function u(f) {
|
|
2636
|
-
const
|
|
2637
|
-
return Math.max(1, Math.min(12,
|
|
2639
|
+
const p = typeof f.span == "number" ? f.span : 12;
|
|
2640
|
+
return Math.max(1, Math.min(12, p));
|
|
2638
2641
|
}
|
|
2639
|
-
return (f,
|
|
2642
|
+
return (f, p) => (o(), c("section", jl, [
|
|
2640
2643
|
d("header", Kl, [
|
|
2641
|
-
d("div",
|
|
2642
|
-
d("h1",
|
|
2643
|
-
i.value ? (o(), c("div",
|
|
2644
|
+
d("div", Gl, [
|
|
2645
|
+
d("h1", Hl, h(l.value), 1),
|
|
2646
|
+
i.value ? (o(), c("div", Xl, h(i.value), 1)) : U("", !0)
|
|
2644
2647
|
]),
|
|
2645
|
-
d("div",
|
|
2648
|
+
d("div", Yl, [
|
|
2646
2649
|
Y(f.$slots, "actions")
|
|
2647
2650
|
])
|
|
2648
2651
|
]),
|
|
2649
|
-
d("div",
|
|
2650
|
-
(o(!0), c(P, null, D(a.value, (
|
|
2652
|
+
d("div", Jl, [
|
|
2653
|
+
(o(!0), c(P, null, D(a.value, (y, k) => (o(), c("div", {
|
|
2651
2654
|
key: k,
|
|
2652
2655
|
class: "admin-dashboard__cell",
|
|
2653
|
-
style: Te({ gridColumn: `span ${u(
|
|
2656
|
+
style: Te({ gridColumn: `span ${u(y)} / span ${u(y)}` })
|
|
2654
2657
|
}, [
|
|
2655
|
-
$(
|
|
2658
|
+
$(Wl, { node: y }, null, 8, ["node"])
|
|
2656
2659
|
], 4))), 128))
|
|
2657
2660
|
])
|
|
2658
2661
|
]));
|
|
2659
2662
|
}
|
|
2660
|
-
}),
|
|
2663
|
+
}), Zl = /* @__PURE__ */ L({
|
|
2661
2664
|
__name: "StatWidget",
|
|
2662
2665
|
props: {
|
|
2663
2666
|
title: { default: "" },
|
|
@@ -2688,16 +2691,16 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2688
2691
|
loading: e.loading
|
|
2689
2692
|
}, null, 8, ["title", "value", "prefix", "suffix", "trend", "precision", "tone", "loading"]));
|
|
2690
2693
|
}
|
|
2691
|
-
}),
|
|
2694
|
+
}), es = {
|
|
2692
2695
|
key: 0,
|
|
2693
2696
|
class: "admin-widget__hd"
|
|
2694
|
-
},
|
|
2697
|
+
}, ts = {
|
|
2695
2698
|
key: 0,
|
|
2696
2699
|
class: "admin-widget__title"
|
|
2697
|
-
},
|
|
2700
|
+
}, ns = {
|
|
2698
2701
|
key: 1,
|
|
2699
2702
|
class: "admin-widget__desc"
|
|
2700
|
-
},
|
|
2703
|
+
}, as = ["viewBox", "height", "aria-label"], ls = ["x", "y", "width", "height", "fill", "data-label", "data-value"], ss = /* @__PURE__ */ L({
|
|
2701
2704
|
__name: "BarChartWidget",
|
|
2702
2705
|
props: {
|
|
2703
2706
|
title: { default: "" },
|
|
@@ -2717,15 +2720,15 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2717
2720
|
heightPct: i.value / n.value * 100
|
|
2718
2721
|
}));
|
|
2719
2722
|
});
|
|
2720
|
-
return (a, l) => (o(), b(r(
|
|
2723
|
+
return (a, l) => (o(), b(r(K), {
|
|
2721
2724
|
padding: "md",
|
|
2722
2725
|
class: "admin-widget"
|
|
2723
2726
|
}, {
|
|
2724
2727
|
default: m(() => [
|
|
2725
|
-
e.title || e.description ? (o(), c("header",
|
|
2726
|
-
e.title ? (o(), c("h3",
|
|
2727
|
-
e.description ? (o(), c("p",
|
|
2728
|
-
])) :
|
|
2728
|
+
e.title || e.description ? (o(), c("header", es, [
|
|
2729
|
+
e.title ? (o(), c("h3", ts, h(e.title), 1)) : U("", !0),
|
|
2730
|
+
e.description ? (o(), c("p", ns, h(e.description), 1)) : U("", !0)
|
|
2731
|
+
])) : U("", !0),
|
|
2729
2732
|
(o(), c("svg", {
|
|
2730
2733
|
class: "admin-widget-bar-chart",
|
|
2731
2734
|
viewBox: `0 0 100 ${e.height}`,
|
|
@@ -2746,17 +2749,17 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2746
2749
|
"data-label": i.label,
|
|
2747
2750
|
"data-value": i.value
|
|
2748
2751
|
}, [
|
|
2749
|
-
d("title", null,
|
|
2750
|
-
], 8,
|
|
2751
|
-
], 8,
|
|
2752
|
+
d("title", null, h(i.label) + ": " + h(i.value), 1)
|
|
2753
|
+
], 8, ls))), 128))
|
|
2754
|
+
], 8, as))
|
|
2752
2755
|
]),
|
|
2753
2756
|
_: 1
|
|
2754
2757
|
}));
|
|
2755
2758
|
}
|
|
2756
|
-
}),
|
|
2759
|
+
}), is = {
|
|
2757
2760
|
key: 0,
|
|
2758
2761
|
class: "admin-widget__hd"
|
|
2759
|
-
},
|
|
2762
|
+
}, os = { class: "admin-widget__title" }, rs = { class: "admin-donut-widget__row" }, us = ["aria-label"], ds = ["d", "fill"], cs = { class: "admin-donut-widget__legend" }, ms = { class: "admin-donut-widget__label" }, fs = { class: "admin-donut-widget__value" }, vs = /* @__PURE__ */ L({
|
|
2760
2763
|
__name: "DonutChartWidget",
|
|
2761
2764
|
props: {
|
|
2762
2765
|
title: { default: "" },
|
|
@@ -2774,7 +2777,7 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2774
2777
|
return t.data.map((i, u) => {
|
|
2775
2778
|
const f = l / s.value * 2 * Math.PI;
|
|
2776
2779
|
l += i.value;
|
|
2777
|
-
const
|
|
2780
|
+
const p = l / s.value * 2 * Math.PI, y = 50, k = 60, x = 60, C = k + y * Math.cos(f - Math.PI / 2), _ = x + y * Math.sin(f - Math.PI / 2), g = k + y * Math.cos(p - Math.PI / 2), F = x + y * Math.sin(p - Math.PI / 2), q = p - f > Math.PI ? 1 : 0, M = t.data.length === 1 ? `M ${k - y} ${x} a ${y} ${y} 0 1 0 ${y * 2} 0 a ${y} ${y} 0 1 0 ${-y * 2} 0` : `M ${k} ${x} L ${C} ${_} A ${y} ${y} 0 ${q} 1 ${g} ${F} Z`;
|
|
2778
2781
|
return {
|
|
2779
2782
|
...i,
|
|
2780
2783
|
path: M,
|
|
@@ -2783,15 +2786,15 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2783
2786
|
};
|
|
2784
2787
|
});
|
|
2785
2788
|
});
|
|
2786
|
-
return (l, i) => (o(), b(r(
|
|
2789
|
+
return (l, i) => (o(), b(r(K), {
|
|
2787
2790
|
padding: "md",
|
|
2788
2791
|
class: "admin-widget admin-donut-widget"
|
|
2789
2792
|
}, {
|
|
2790
2793
|
default: m(() => [
|
|
2791
|
-
e.title ? (o(), c("header",
|
|
2792
|
-
d("h3",
|
|
2793
|
-
])) :
|
|
2794
|
-
d("div",
|
|
2794
|
+
e.title ? (o(), c("header", is, [
|
|
2795
|
+
d("h3", os, h(e.title), 1)
|
|
2796
|
+
])) : U("", !0),
|
|
2797
|
+
d("div", rs, [
|
|
2795
2798
|
(o(), c("svg", {
|
|
2796
2799
|
viewBox: "0 0 120 120",
|
|
2797
2800
|
class: "admin-donut-widget__svg",
|
|
@@ -2803,23 +2806,23 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2803
2806
|
d: u.path,
|
|
2804
2807
|
fill: u.color
|
|
2805
2808
|
}, [
|
|
2806
|
-
d("title", null,
|
|
2807
|
-
], 8,
|
|
2809
|
+
d("title", null, h(u.label) + ": " + h(u.value) + " (" + h(u.pct) + "%)", 1)
|
|
2810
|
+
], 8, ds))), 128)),
|
|
2808
2811
|
i[0] || (i[0] = d("circle", {
|
|
2809
2812
|
cx: "60",
|
|
2810
2813
|
cy: "60",
|
|
2811
2814
|
r: "30",
|
|
2812
2815
|
fill: "var(--uid-surface-raised)"
|
|
2813
2816
|
}, null, -1))
|
|
2814
|
-
], 8,
|
|
2815
|
-
d("ul",
|
|
2817
|
+
], 8, us)),
|
|
2818
|
+
d("ul", cs, [
|
|
2816
2819
|
(o(!0), c(P, null, D(a.value, (u, f) => (o(), c("li", { key: f }, [
|
|
2817
2820
|
d("span", {
|
|
2818
2821
|
class: "admin-donut-widget__dot",
|
|
2819
2822
|
style: Te({ background: u.color })
|
|
2820
2823
|
}, null, 4),
|
|
2821
|
-
d("span",
|
|
2822
|
-
d("span",
|
|
2824
|
+
d("span", ms, h(u.label), 1),
|
|
2825
|
+
d("span", fs, h(u.pct) + "%", 1)
|
|
2823
2826
|
]))), 128))
|
|
2824
2827
|
])
|
|
2825
2828
|
])
|
|
@@ -2827,10 +2830,10 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2827
2830
|
_: 1
|
|
2828
2831
|
}));
|
|
2829
2832
|
}
|
|
2830
|
-
}),
|
|
2833
|
+
}), ps = {
|
|
2831
2834
|
key: 0,
|
|
2832
2835
|
class: "admin-widget__hd"
|
|
2833
|
-
},
|
|
2836
|
+
}, gs = { class: "admin-widget__title" }, hs = /* @__PURE__ */ L({
|
|
2834
2837
|
__name: "RecentTableWidget",
|
|
2835
2838
|
props: {
|
|
2836
2839
|
title: { default: "" },
|
|
@@ -2839,15 +2842,15 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2839
2842
|
emptyText: { default: "Нет данных" }
|
|
2840
2843
|
},
|
|
2841
2844
|
setup(e) {
|
|
2842
|
-
return (t, n) => (o(), b(r(
|
|
2845
|
+
return (t, n) => (o(), b(r(K), {
|
|
2843
2846
|
padding: "md",
|
|
2844
2847
|
class: "admin-widget"
|
|
2845
2848
|
}, {
|
|
2846
2849
|
default: m(() => [
|
|
2847
|
-
e.title ? (o(), c("header",
|
|
2848
|
-
d("h3",
|
|
2849
|
-
])) :
|
|
2850
|
-
$(r(
|
|
2850
|
+
e.title ? (o(), c("header", ps, [
|
|
2851
|
+
d("h3", gs, h(e.title), 1)
|
|
2852
|
+
])) : U("", !0),
|
|
2853
|
+
$(r(je), {
|
|
2851
2854
|
columns: e.columns,
|
|
2852
2855
|
data: e.rows,
|
|
2853
2856
|
"empty-text": e.emptyText
|
|
@@ -2856,10 +2859,10 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2856
2859
|
_: 1
|
|
2857
2860
|
}));
|
|
2858
2861
|
}
|
|
2859
|
-
}),
|
|
2862
|
+
}), _s = {
|
|
2860
2863
|
key: 0,
|
|
2861
2864
|
class: "admin-widget__hd"
|
|
2862
|
-
},
|
|
2865
|
+
}, ys = { class: "admin-widget__title" }, bs = /* @__PURE__ */ L({
|
|
2863
2866
|
__name: "HeatmapWidget",
|
|
2864
2867
|
props: {
|
|
2865
2868
|
title: { default: "" },
|
|
@@ -2869,15 +2872,15 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2869
2872
|
gap: { default: 2 }
|
|
2870
2873
|
},
|
|
2871
2874
|
setup(e) {
|
|
2872
|
-
return (t, n) => (o(), b(r(
|
|
2875
|
+
return (t, n) => (o(), b(r(K), {
|
|
2873
2876
|
padding: "md",
|
|
2874
2877
|
class: "admin-widget"
|
|
2875
2878
|
}, {
|
|
2876
2879
|
default: m(() => [
|
|
2877
|
-
e.title ? (o(), c("header",
|
|
2878
|
-
d("h3",
|
|
2879
|
-
])) :
|
|
2880
|
-
$(r(
|
|
2880
|
+
e.title ? (o(), c("header", _s, [
|
|
2881
|
+
d("h3", ys, h(e.title), 1)
|
|
2882
|
+
])) : U("", !0),
|
|
2883
|
+
$(r(Yt), {
|
|
2881
2884
|
data: e.data,
|
|
2882
2885
|
levels: e.levels,
|
|
2883
2886
|
color: e.color,
|
|
@@ -2887,10 +2890,10 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2887
2890
|
_: 1
|
|
2888
2891
|
}));
|
|
2889
2892
|
}
|
|
2890
|
-
}),
|
|
2893
|
+
}), ks = {
|
|
2891
2894
|
key: 0,
|
|
2892
2895
|
class: "admin-widget__hd"
|
|
2893
|
-
},
|
|
2896
|
+
}, ws = { class: "admin-widget__title" }, $s = { style: { display: "flex", "justify-content": "center" } }, xs = /* @__PURE__ */ L({
|
|
2894
2897
|
__name: "GaugeWidget",
|
|
2895
2898
|
props: {
|
|
2896
2899
|
title: { default: "" },
|
|
@@ -2912,16 +2915,16 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2912
2915
|
warning: "warning",
|
|
2913
2916
|
negative: "danger"
|
|
2914
2917
|
}, s = v(() => n[t.tone]);
|
|
2915
|
-
return (a, l) => (o(), b(r(
|
|
2918
|
+
return (a, l) => (o(), b(r(K), {
|
|
2916
2919
|
padding: "md",
|
|
2917
2920
|
class: "admin-widget"
|
|
2918
2921
|
}, {
|
|
2919
2922
|
default: m(() => [
|
|
2920
|
-
e.title ? (o(), c("header",
|
|
2921
|
-
d("h3",
|
|
2922
|
-
])) :
|
|
2923
|
-
d("div",
|
|
2924
|
-
$(r(
|
|
2923
|
+
e.title ? (o(), c("header", ks, [
|
|
2924
|
+
d("h3", ws, h(e.title), 1)
|
|
2925
|
+
])) : U("", !0),
|
|
2926
|
+
d("div", $s, [
|
|
2927
|
+
$(r(Jt), {
|
|
2925
2928
|
value: e.value,
|
|
2926
2929
|
min: e.min,
|
|
2927
2930
|
max: e.max,
|
|
@@ -2938,49 +2941,49 @@ const cl = { class: "admin-page admin-resource-view" }, ml = { class: "admin-pag
|
|
|
2938
2941
|
_: 1
|
|
2939
2942
|
}));
|
|
2940
2943
|
}
|
|
2941
|
-
}),
|
|
2944
|
+
}), Ss = {
|
|
2942
2945
|
key: 0,
|
|
2943
2946
|
class: "admin-widget__hd"
|
|
2944
|
-
},
|
|
2947
|
+
}, Cs = { class: "admin-widget__title" }, As = { class: "admin-markdown-widget" }, Es = /* @__PURE__ */ L({
|
|
2945
2948
|
__name: "MarkdownWidget",
|
|
2946
2949
|
props: {
|
|
2947
2950
|
title: { default: "" },
|
|
2948
2951
|
content: {}
|
|
2949
2952
|
},
|
|
2950
2953
|
setup(e) {
|
|
2951
|
-
return (t, n) => (o(), b(r(
|
|
2954
|
+
return (t, n) => (o(), b(r(K), {
|
|
2952
2955
|
padding: "md",
|
|
2953
2956
|
class: "admin-widget"
|
|
2954
2957
|
}, {
|
|
2955
2958
|
default: m(() => [
|
|
2956
|
-
e.title ? (o(), c("header",
|
|
2957
|
-
d("h3",
|
|
2958
|
-
])) :
|
|
2959
|
-
d("div",
|
|
2959
|
+
e.title ? (o(), c("header", Ss, [
|
|
2960
|
+
d("h3", Cs, h(e.title), 1)
|
|
2961
|
+
])) : U("", !0),
|
|
2962
|
+
d("div", As, h(e.content), 1)
|
|
2960
2963
|
]),
|
|
2961
2964
|
_: 1
|
|
2962
2965
|
}));
|
|
2963
2966
|
}
|
|
2964
2967
|
});
|
|
2965
|
-
function
|
|
2966
|
-
|
|
2967
|
-
stat:
|
|
2968
|
-
"bar-chart":
|
|
2969
|
-
"donut-chart":
|
|
2970
|
-
"recent-table":
|
|
2971
|
-
heatmap:
|
|
2972
|
-
gauge:
|
|
2973
|
-
markdown:
|
|
2968
|
+
function Rs() {
|
|
2969
|
+
ql({
|
|
2970
|
+
stat: Zl,
|
|
2971
|
+
"bar-chart": ss,
|
|
2972
|
+
"donut-chart": vs,
|
|
2973
|
+
"recent-table": hs,
|
|
2974
|
+
heatmap: bs,
|
|
2975
|
+
gauge: xs,
|
|
2976
|
+
markdown: Es
|
|
2974
2977
|
});
|
|
2975
2978
|
}
|
|
2976
2979
|
function Fs(e) {
|
|
2977
2980
|
return e.success === !0;
|
|
2978
2981
|
}
|
|
2979
|
-
function
|
|
2982
|
+
function go(e) {
|
|
2980
2983
|
return e.success === !1;
|
|
2981
2984
|
}
|
|
2982
2985
|
function Us(e) {
|
|
2983
|
-
const t =
|
|
2986
|
+
const t = dn.create({
|
|
2984
2987
|
baseURL: e.baseURL,
|
|
2985
2988
|
withCredentials: !0,
|
|
2986
2989
|
headers: {
|
|
@@ -2989,7 +2992,7 @@ function Us(e) {
|
|
|
2989
2992
|
}
|
|
2990
2993
|
});
|
|
2991
2994
|
e.csrfToken && (t.defaults.headers.common["X-CSRF-TOKEN"] = e.csrfToken), e.locale && (t.defaults.headers.common["X-Admin-Locale"] = e.locale), t.interceptors.request.use((a) => {
|
|
2992
|
-
const l =
|
|
2995
|
+
const l = Ts("XSRF-TOKEN");
|
|
2993
2996
|
return l && a.headers.set("X-XSRF-TOKEN", decodeURIComponent(l)), a;
|
|
2994
2997
|
}), t.interceptors.response.use(
|
|
2995
2998
|
(a) => {
|
|
@@ -3025,26 +3028,26 @@ function Us(e) {
|
|
|
3025
3028
|
}
|
|
3026
3029
|
};
|
|
3027
3030
|
}
|
|
3028
|
-
function
|
|
3031
|
+
function Ts(e) {
|
|
3029
3032
|
if (typeof document > "u") return null;
|
|
3030
|
-
const t = document.cookie.match(new RegExp("(^|; )" +
|
|
3033
|
+
const t = document.cookie.match(new RegExp("(^|; )" + Ls(e) + "=([^;]*)"));
|
|
3031
3034
|
return t ? t[2] : null;
|
|
3032
3035
|
}
|
|
3033
|
-
function
|
|
3036
|
+
function Ls(e) {
|
|
3034
3037
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3035
3038
|
}
|
|
3036
3039
|
function xe(e, t) {
|
|
3037
3040
|
const n = e.permissions?.[t];
|
|
3038
3041
|
return typeof n == "string" && n.length > 0 ? [n] : [];
|
|
3039
3042
|
}
|
|
3040
|
-
function
|
|
3043
|
+
function Ps(e, t) {
|
|
3041
3044
|
const n = e.permissions?.[t];
|
|
3042
3045
|
return typeof n == "string" && n.length > 0 ? [n] : [];
|
|
3043
3046
|
}
|
|
3044
|
-
function
|
|
3047
|
+
function Ms(e) {
|
|
3045
3048
|
return Array.isArray(e.permission) ? e.permission : typeof e.permission == "string" && e.permission.length > 0 ? [e.permission] : [];
|
|
3046
3049
|
}
|
|
3047
|
-
function
|
|
3050
|
+
function Ns(e, t) {
|
|
3048
3051
|
const n = e.slug, s = `/r/${n}`;
|
|
3049
3052
|
return [
|
|
3050
3053
|
{
|
|
@@ -3105,7 +3108,7 @@ function Ms(e, t) {
|
|
|
3105
3108
|
}
|
|
3106
3109
|
];
|
|
3107
3110
|
}
|
|
3108
|
-
function
|
|
3111
|
+
function Bs(e, t) {
|
|
3109
3112
|
return {
|
|
3110
3113
|
path: `/screens/${e.slug}`,
|
|
3111
3114
|
name: `admin.screen.${e.slug}`,
|
|
@@ -3115,11 +3118,11 @@ function Ns(e, t) {
|
|
|
3115
3118
|
kind: "screen",
|
|
3116
3119
|
slug: e.slug,
|
|
3117
3120
|
title: e.name,
|
|
3118
|
-
permissions:
|
|
3121
|
+
permissions: Ms(e)
|
|
3119
3122
|
}
|
|
3120
3123
|
};
|
|
3121
3124
|
}
|
|
3122
|
-
function
|
|
3125
|
+
function Is(e, t) {
|
|
3123
3126
|
return {
|
|
3124
3127
|
path: `/settings/${e.slug}`,
|
|
3125
3128
|
name: `admin.settings.${e.slug}`,
|
|
@@ -3129,11 +3132,11 @@ function Bs(e, t) {
|
|
|
3129
3132
|
kind: "settings",
|
|
3130
3133
|
slug: e.slug,
|
|
3131
3134
|
title: e.label,
|
|
3132
|
-
permissions:
|
|
3135
|
+
permissions: Ps(e, "view")
|
|
3133
3136
|
}
|
|
3134
3137
|
};
|
|
3135
3138
|
}
|
|
3136
|
-
function
|
|
3139
|
+
function Ds(e, t) {
|
|
3137
3140
|
if (typeof e.slug != "string" || e.slug.length === 0) return null;
|
|
3138
3141
|
const n = e.permission, s = Array.isArray(n) ? n : typeof n == "string" && n.length > 0 ? [n] : [];
|
|
3139
3142
|
return {
|
|
@@ -3149,22 +3152,22 @@ function Is(e, t) {
|
|
|
3149
3152
|
}
|
|
3150
3153
|
};
|
|
3151
3154
|
}
|
|
3152
|
-
function
|
|
3155
|
+
function Vs(e, t) {
|
|
3153
3156
|
if (e === null) return [];
|
|
3154
3157
|
const n = [];
|
|
3155
3158
|
for (const s of e.resources)
|
|
3156
|
-
n.push(...
|
|
3159
|
+
n.push(...Ns(s, t));
|
|
3157
3160
|
for (const s of e.screens)
|
|
3158
|
-
n.push(Ns(s, t));
|
|
3159
|
-
for (const s of e.settings)
|
|
3160
3161
|
n.push(Bs(s, t));
|
|
3162
|
+
for (const s of e.settings)
|
|
3163
|
+
n.push(Is(s, t));
|
|
3161
3164
|
for (const s of e.dashboards) {
|
|
3162
|
-
const a =
|
|
3165
|
+
const a = Ds(s, t);
|
|
3163
3166
|
a && n.push(a);
|
|
3164
3167
|
}
|
|
3165
3168
|
return n;
|
|
3166
3169
|
}
|
|
3167
|
-
function
|
|
3170
|
+
function zs(e = {}) {
|
|
3168
3171
|
const t = e.loginRouteName ?? "admin.login", n = e.forbiddenRouteName ?? "admin.forbidden", s = e.redirectQueryKey ?? "redirect";
|
|
3169
3172
|
return (a) => {
|
|
3170
3173
|
if (a.name === t)
|
|
@@ -3184,7 +3187,7 @@ function Vs(e = {}) {
|
|
|
3184
3187
|
return Array.isArray(u) && u.length > 0 && !l.hasAnyPermission(u) ? { name: n } : !0;
|
|
3185
3188
|
};
|
|
3186
3189
|
}
|
|
3187
|
-
function
|
|
3190
|
+
function qs(e = {}) {
|
|
3188
3191
|
const t = e.template, n = e.brand ?? "", s = e.fallback ?? "";
|
|
3189
3192
|
return (a) => {
|
|
3190
3193
|
if (typeof document > "u") return;
|
|
@@ -3193,16 +3196,16 @@ function zs(e = {}) {
|
|
|
3193
3196
|
t ? i = t.replace("{title}", l).replace("{brand}", n) : l && n ? i = `${l} · ${n}` : i = l || n, document.title = i;
|
|
3194
3197
|
};
|
|
3195
3198
|
}
|
|
3196
|
-
const
|
|
3199
|
+
const Os = [
|
|
3197
3200
|
"admin.resource.",
|
|
3198
3201
|
"admin.screen.",
|
|
3199
3202
|
"admin.settings.",
|
|
3200
3203
|
"admin.dashboard."
|
|
3201
3204
|
];
|
|
3202
|
-
function Os(e) {
|
|
3203
|
-
return typeof e != "string" ? !1 : qs.some((t) => e.startsWith(t));
|
|
3204
|
-
}
|
|
3205
3205
|
function Ws(e) {
|
|
3206
|
+
return typeof e != "string" ? !1 : Os.some((t) => e.startsWith(t));
|
|
3207
|
+
}
|
|
3208
|
+
function js(e) {
|
|
3206
3209
|
const t = e.base ?? "/admin", n = e.history ?? ct(t), s = [
|
|
3207
3210
|
{
|
|
3208
3211
|
path: "/login",
|
|
@@ -3239,18 +3242,18 @@ function Ws(e) {
|
|
|
3239
3242
|
name: "admin.notFound",
|
|
3240
3243
|
component: e.components.notFound,
|
|
3241
3244
|
meta: { kind: "system", title: "404" }
|
|
3242
|
-
}, l =
|
|
3245
|
+
}, l = zt({
|
|
3243
3246
|
history: n,
|
|
3244
3247
|
routes: [...s, ...e.extraRoutes ?? [], a]
|
|
3245
3248
|
});
|
|
3246
|
-
return l.beforeEach(
|
|
3249
|
+
return l.beforeEach(zs(e.authGuard)), l.afterEach(qs(e.titleGuard)), l.replaceManifestRoutes = (i) => {
|
|
3247
3250
|
const u = l.getRoutes();
|
|
3248
|
-
for (const
|
|
3249
|
-
|
|
3251
|
+
for (const p of u)
|
|
3252
|
+
Ws(p.name) && l.removeRoute(p.name);
|
|
3250
3253
|
l.hasRoute("admin.notFound") && l.removeRoute("admin.notFound");
|
|
3251
|
-
const f =
|
|
3252
|
-
for (const
|
|
3253
|
-
l.addRoute(
|
|
3254
|
+
const f = Vs(i, e.components);
|
|
3255
|
+
for (const p of f)
|
|
3256
|
+
l.addRoute(p);
|
|
3254
3257
|
l.addRoute(a);
|
|
3255
3258
|
}, l;
|
|
3256
3259
|
}
|
|
@@ -3312,7 +3315,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3312
3315
|
disabled: e.disabled
|
|
3313
3316
|
}, {
|
|
3314
3317
|
default: m(() => [
|
|
3315
|
-
$(r(
|
|
3318
|
+
$(r(Qt), {
|
|
3316
3319
|
"model-value": s.value,
|
|
3317
3320
|
rows: e.rows,
|
|
3318
3321
|
placeholder: e.placeholder ?? void 0,
|
|
@@ -3355,7 +3358,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3355
3358
|
disabled: e.disabled
|
|
3356
3359
|
}, {
|
|
3357
3360
|
default: m(() => [
|
|
3358
|
-
$(r(
|
|
3361
|
+
$(r(Zt), {
|
|
3359
3362
|
"model-value": s.value,
|
|
3360
3363
|
min: e.min ?? void 0,
|
|
3361
3364
|
max: e.max ?? void 0,
|
|
@@ -3445,8 +3448,8 @@ const J = /* @__PURE__ */ L({
|
|
|
3445
3448
|
}, {
|
|
3446
3449
|
default: m(() => [
|
|
3447
3450
|
e.inlineLabel ? (o(), c(P, { key: 0 }, [
|
|
3448
|
-
|
|
3449
|
-
], 64)) :
|
|
3451
|
+
S(h(e.inlineLabel), 1)
|
|
3452
|
+
], 64)) : U("", !0)
|
|
3450
3453
|
]),
|
|
3451
3454
|
_: 1
|
|
3452
3455
|
}, 8, ["model-value", "disabled", "name"])
|
|
@@ -3482,7 +3485,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3482
3485
|
disabled: e.disabled
|
|
3483
3486
|
}, {
|
|
3484
3487
|
default: m(() => [
|
|
3485
|
-
$(r(
|
|
3488
|
+
$(r(en), {
|
|
3486
3489
|
"model-value": s.value,
|
|
3487
3490
|
min: e.min ?? void 0,
|
|
3488
3491
|
max: e.max ?? void 0,
|
|
@@ -3501,7 +3504,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3501
3504
|
gap: { default: "var(--uid-space-md)" }
|
|
3502
3505
|
},
|
|
3503
3506
|
setup(e) {
|
|
3504
|
-
return (t, n) => (o(), b(r(
|
|
3507
|
+
return (t, n) => (o(), b(r(tn), {
|
|
3505
3508
|
direction: "column",
|
|
3506
3509
|
gap: e.gap,
|
|
3507
3510
|
align: "stretch"
|
|
@@ -3528,7 +3531,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3528
3531
|
const l = a.span;
|
|
3529
3532
|
return typeof l == "number" && l > 0 ? Math.min(l, t.cols) : n.value;
|
|
3530
3533
|
}
|
|
3531
|
-
return (a, l) => (o(), b(r(
|
|
3534
|
+
return (a, l) => (o(), b(r(nn), {
|
|
3532
3535
|
cols: e.cols,
|
|
3533
3536
|
gap: e.gap
|
|
3534
3537
|
}, {
|
|
@@ -3544,16 +3547,16 @@ const J = /* @__PURE__ */ L({
|
|
|
3544
3547
|
_: 1
|
|
3545
3548
|
}, 8, ["cols", "gap"]));
|
|
3546
3549
|
}
|
|
3547
|
-
}),
|
|
3550
|
+
}), Gs = {
|
|
3548
3551
|
key: 0,
|
|
3549
3552
|
class: "admin-section__header"
|
|
3550
|
-
},
|
|
3553
|
+
}, Hs = {
|
|
3551
3554
|
key: 0,
|
|
3552
3555
|
class: "admin-section__title"
|
|
3553
|
-
},
|
|
3556
|
+
}, Xs = {
|
|
3554
3557
|
key: 1,
|
|
3555
3558
|
class: "admin-section__description"
|
|
3556
|
-
},
|
|
3559
|
+
}, Ys = { class: "admin-section__body" }, he = /* @__PURE__ */ L({
|
|
3557
3560
|
__name: "SectionLayout",
|
|
3558
3561
|
props: {
|
|
3559
3562
|
items: {},
|
|
@@ -3561,16 +3564,16 @@ const J = /* @__PURE__ */ L({
|
|
|
3561
3564
|
description: { default: null }
|
|
3562
3565
|
},
|
|
3563
3566
|
setup(e) {
|
|
3564
|
-
return (t, n) => (o(), b(r(
|
|
3567
|
+
return (t, n) => (o(), b(r(K), {
|
|
3565
3568
|
padding: "md",
|
|
3566
3569
|
class: "admin-section"
|
|
3567
3570
|
}, {
|
|
3568
3571
|
default: m(() => [
|
|
3569
|
-
e.title || e.description ? (o(), c("header",
|
|
3570
|
-
e.title ? (o(), c("h3",
|
|
3571
|
-
e.description ? (o(), c("p",
|
|
3572
|
-
])) :
|
|
3573
|
-
d("div",
|
|
3572
|
+
e.title || e.description ? (o(), c("header", Gs, [
|
|
3573
|
+
e.title ? (o(), c("h3", Hs, h(e.title), 1)) : U("", !0),
|
|
3574
|
+
e.description ? (o(), c("p", Xs, h(e.description), 1)) : U("", !0)
|
|
3575
|
+
])) : U("", !0),
|
|
3576
|
+
d("div", Ys, [
|
|
3574
3577
|
(o(!0), c(P, null, D(e.items, (s, a) => (o(), b(we, {
|
|
3575
3578
|
key: a,
|
|
3576
3579
|
node: s
|
|
@@ -3580,7 +3583,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3580
3583
|
_: 1
|
|
3581
3584
|
}));
|
|
3582
3585
|
}
|
|
3583
|
-
}),
|
|
3586
|
+
}), Js = /* @__PURE__ */ L({
|
|
3584
3587
|
__name: "TabsLayout",
|
|
3585
3588
|
props: {
|
|
3586
3589
|
items: {},
|
|
@@ -3592,7 +3595,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3592
3595
|
function a(u, f) {
|
|
3593
3596
|
return u.key ?? f;
|
|
3594
3597
|
}
|
|
3595
|
-
const l =
|
|
3598
|
+
const l = R(n.active ?? a(n.items[0] ?? {}, 0));
|
|
3596
3599
|
function i(u) {
|
|
3597
3600
|
l.value = u, s("update:active", u);
|
|
3598
3601
|
}
|
|
@@ -3601,24 +3604,24 @@ const J = /* @__PURE__ */ L({
|
|
|
3601
3604
|
"onUpdate:modelValue": i
|
|
3602
3605
|
}, {
|
|
3603
3606
|
list: m(() => [
|
|
3604
|
-
(o(!0), c(P, null, D(e.items, (
|
|
3605
|
-
key: a(
|
|
3606
|
-
value: a(
|
|
3607
|
+
(o(!0), c(P, null, D(e.items, (p, y) => (o(), b(r(Ae), {
|
|
3608
|
+
key: a(p, y),
|
|
3609
|
+
value: a(p, y)
|
|
3607
3610
|
}, {
|
|
3608
3611
|
default: m(() => [
|
|
3609
|
-
|
|
3612
|
+
S(h(p.label), 1)
|
|
3610
3613
|
]),
|
|
3611
3614
|
_: 2
|
|
3612
3615
|
}, 1032, ["value"]))), 128))
|
|
3613
3616
|
]),
|
|
3614
3617
|
default: m(() => [
|
|
3615
|
-
(o(!0), c(P, null, D(e.items, (
|
|
3616
|
-
key: `panel-${a(
|
|
3617
|
-
value: a(
|
|
3618
|
+
(o(!0), c(P, null, D(e.items, (p, y) => (o(), b(r(gt), {
|
|
3619
|
+
key: `panel-${a(p, y)}`,
|
|
3620
|
+
value: a(p, y)
|
|
3618
3621
|
}, {
|
|
3619
3622
|
default: m(() => [
|
|
3620
|
-
(o(!0), c(P, null, D(
|
|
3621
|
-
key:
|
|
3623
|
+
(o(!0), c(P, null, D(p.items, (k, x) => (o(), b(we, {
|
|
3624
|
+
key: x,
|
|
3622
3625
|
node: k
|
|
3623
3626
|
}, null, 8, ["node"]))), 128))
|
|
3624
3627
|
]),
|
|
@@ -3629,8 +3632,8 @@ const J = /* @__PURE__ */ L({
|
|
|
3629
3632
|
}, 8, ["model-value"]));
|
|
3630
3633
|
}
|
|
3631
3634
|
});
|
|
3632
|
-
function
|
|
3633
|
-
|
|
3635
|
+
function Qs() {
|
|
3636
|
+
Wa({
|
|
3634
3637
|
fields: {
|
|
3635
3638
|
// Backend Field-классы из dskripchenko/laravel-admin отдают эти fieldType()
|
|
3636
3639
|
// строки. Соответствие см. core/src/Field/{Input,TextArea,Select,...}.php.
|
|
@@ -3679,7 +3682,7 @@ function Js() {
|
|
|
3679
3682
|
columns: Ks,
|
|
3680
3683
|
section: he,
|
|
3681
3684
|
block: he,
|
|
3682
|
-
tabs:
|
|
3685
|
+
tabs: Js,
|
|
3683
3686
|
accordion: he,
|
|
3684
3687
|
group: it,
|
|
3685
3688
|
step: he,
|
|
@@ -3703,12 +3706,12 @@ const I = /* @__PURE__ */ L({
|
|
|
3703
3706
|
});
|
|
3704
3707
|
return (a, l) => (o(), c("span", {
|
|
3705
3708
|
class: Z(["admin-infolist-text", e.mono ? "admin-infolist-text--mono" : ""])
|
|
3706
|
-
},
|
|
3709
|
+
}, h(s.value), 3));
|
|
3707
3710
|
}
|
|
3708
|
-
}),
|
|
3711
|
+
}), Zs = {
|
|
3709
3712
|
key: 1,
|
|
3710
3713
|
class: "admin-infolist-text"
|
|
3711
|
-
},
|
|
3714
|
+
}, ei = /* @__PURE__ */ L({
|
|
3712
3715
|
__name: "BadgeEntry",
|
|
3713
3716
|
props: {
|
|
3714
3717
|
name: { default: "" },
|
|
@@ -3722,17 +3725,17 @@ const I = /* @__PURE__ */ L({
|
|
|
3722
3725
|
let l = t.value;
|
|
3723
3726
|
return l === void 0 && n && t.name && (l = n[t.name]), l == null ? "" : String(l);
|
|
3724
3727
|
}), a = v(() => t.variant ? t.variant : t.map[s.value] ?? "default");
|
|
3725
|
-
return (l, i) => s.value ? (o(), b(r(
|
|
3728
|
+
return (l, i) => s.value ? (o(), b(r(Ke), {
|
|
3726
3729
|
key: 0,
|
|
3727
3730
|
variant: a.value
|
|
3728
3731
|
}, {
|
|
3729
3732
|
default: m(() => [
|
|
3730
|
-
|
|
3733
|
+
S(h(s.value), 1)
|
|
3731
3734
|
]),
|
|
3732
3735
|
_: 1
|
|
3733
|
-
}, 8, ["variant"])) : (o(), c("span",
|
|
3736
|
+
}, 8, ["variant"])) : (o(), c("span", Zs, "—"));
|
|
3734
3737
|
}
|
|
3735
|
-
}),
|
|
3738
|
+
}), ti = ["data-icon"], ni = { key: 0 }, ai = /* @__PURE__ */ L({
|
|
3736
3739
|
__name: "IconEntry",
|
|
3737
3740
|
props: {
|
|
3738
3741
|
name: { default: "" },
|
|
@@ -3754,11 +3757,11 @@ const I = /* @__PURE__ */ L({
|
|
|
3754
3757
|
d("span", {
|
|
3755
3758
|
class: "admin-infolist-icon__glyph",
|
|
3756
3759
|
"data-icon": l.value
|
|
3757
|
-
}, null, 8,
|
|
3758
|
-
a.value ? (o(), c("span",
|
|
3760
|
+
}, null, 8, ti),
|
|
3761
|
+
a.value ? (o(), c("span", ni, h(a.value), 1)) : U("", !0)
|
|
3759
3762
|
], 2));
|
|
3760
3763
|
}
|
|
3761
|
-
}),
|
|
3764
|
+
}), li = {
|
|
3762
3765
|
key: 1,
|
|
3763
3766
|
class: "admin-infolist-text"
|
|
3764
3767
|
}, ot = /* @__PURE__ */ L({
|
|
@@ -3776,32 +3779,32 @@ const I = /* @__PURE__ */ L({
|
|
|
3776
3779
|
function a(l) {
|
|
3777
3780
|
return l == null ? "—" : typeof l == "object" ? JSON.stringify(l) : String(l);
|
|
3778
3781
|
}
|
|
3779
|
-
return (l, i) => s.value.length > 0 ? (o(), b(r(
|
|
3782
|
+
return (l, i) => s.value.length > 0 ? (o(), b(r(an), {
|
|
3780
3783
|
key: 0,
|
|
3781
3784
|
direction: "vertical",
|
|
3782
3785
|
columns: 1
|
|
3783
3786
|
}, {
|
|
3784
3787
|
default: m(() => [
|
|
3785
|
-
(o(!0), c(P, null, D(s.value, ([u, f]) => (o(), b(r(
|
|
3788
|
+
(o(!0), c(P, null, D(s.value, ([u, f]) => (o(), b(r(ln), {
|
|
3786
3789
|
key: u,
|
|
3787
3790
|
label: u
|
|
3788
3791
|
}, {
|
|
3789
3792
|
default: m(() => [
|
|
3790
|
-
|
|
3793
|
+
S(h(a(f)), 1)
|
|
3791
3794
|
]),
|
|
3792
3795
|
_: 2
|
|
3793
3796
|
}, 1032, ["label"]))), 128))
|
|
3794
3797
|
]),
|
|
3795
3798
|
_: 1
|
|
3796
|
-
})) : (o(), c("span",
|
|
3799
|
+
})) : (o(), c("span", li, "—"));
|
|
3797
3800
|
}
|
|
3798
3801
|
});
|
|
3799
|
-
function
|
|
3800
|
-
|
|
3802
|
+
function si() {
|
|
3803
|
+
Qa({
|
|
3801
3804
|
// Дефолтные типы infolist (BadgeEntry::make() и т.п.).
|
|
3802
3805
|
text: I,
|
|
3803
|
-
badge:
|
|
3804
|
-
icon:
|
|
3806
|
+
badge: ei,
|
|
3807
|
+
icon: ai,
|
|
3805
3808
|
keyvalue: ot,
|
|
3806
3809
|
"key-value": ot,
|
|
3807
3810
|
// Маппинг от backend Field::fieldType() → TextEntry для view-режима.
|
|
@@ -3842,30 +3845,30 @@ function li() {
|
|
|
3842
3845
|
"color-picker": I
|
|
3843
3846
|
});
|
|
3844
3847
|
}
|
|
3845
|
-
function
|
|
3846
|
-
const n = t.pages ?? {}, s = t.base ??
|
|
3848
|
+
function ho(e, t = {}) {
|
|
3849
|
+
const n = t.pages ?? {}, s = t.base ?? ii(e.baseUrl) ?? "/admin", a = Us({
|
|
3847
3850
|
baseURL: e.apiUrl,
|
|
3848
3851
|
csrfToken: e.csrf
|
|
3849
3852
|
});
|
|
3850
|
-
|
|
3851
|
-
const l =
|
|
3852
|
-
l.use(i), Q().hydrate(e), He().hydrate(e), Ge().hydrate(e), Xe().hydrate(e),
|
|
3853
|
-
const u =
|
|
3853
|
+
cn(a);
|
|
3854
|
+
const l = Bt(In), i = Dt();
|
|
3855
|
+
l.use(i), Q().hydrate(e), He().hydrate(e), Ge().hydrate(e), Xe().hydrate(e), Qs(), Rs(), si();
|
|
3856
|
+
const u = js({
|
|
3854
3857
|
base: s,
|
|
3855
3858
|
history: t.router?.history ?? ct(s),
|
|
3856
3859
|
components: {
|
|
3857
|
-
login: n.login ??
|
|
3860
|
+
login: n.login ?? wa,
|
|
3858
3861
|
home: n.home ?? Kn,
|
|
3859
|
-
forbidden: n.forbidden ??
|
|
3860
|
-
notFound: n.notFound ??
|
|
3861
|
-
profile: n.profile ??
|
|
3862
|
-
resourceIndex: n.resourceIndex ??
|
|
3862
|
+
forbidden: n.forbidden ?? Hn,
|
|
3863
|
+
notFound: n.notFound ?? Yn,
|
|
3864
|
+
profile: n.profile ?? Vl,
|
|
3865
|
+
resourceIndex: n.resourceIndex ?? Oa,
|
|
3863
3866
|
resourceCreate: n.resourceCreate ?? lt,
|
|
3864
3867
|
resourceEdit: n.resourceEdit ?? lt,
|
|
3865
|
-
resourceView: n.resourceView ??
|
|
3866
|
-
dashboard: n.dashboard ??
|
|
3867
|
-
settings: n.settings ??
|
|
3868
|
-
screen: n.screen ??
|
|
3868
|
+
resourceView: n.resourceView ?? _l,
|
|
3869
|
+
dashboard: n.dashboard ?? Ql,
|
|
3870
|
+
settings: n.settings ?? ta,
|
|
3871
|
+
screen: n.screen ?? sa
|
|
3869
3872
|
},
|
|
3870
3873
|
extraRoutes: t.router?.extraRoutes,
|
|
3871
3874
|
authGuard: t.router?.authGuard,
|
|
@@ -3873,33 +3876,46 @@ function go(e, t = {}) {
|
|
|
3873
3876
|
});
|
|
3874
3877
|
l.use(u);
|
|
3875
3878
|
const f = Ye();
|
|
3876
|
-
if (u.beforeEach((
|
|
3877
|
-
|
|
3879
|
+
if (u.beforeEach((p, y, k) => {
|
|
3880
|
+
p.fullPath !== y.fullPath && f.start(), k();
|
|
3878
3881
|
}), u.afterEach(() => {
|
|
3879
3882
|
f.end();
|
|
3880
3883
|
}), u.onError(() => {
|
|
3881
3884
|
f.end();
|
|
3885
|
+
}), u.beforeResolve(async (p, y, k) => {
|
|
3886
|
+
const x = typeof p.name == "string" ? p.name : null;
|
|
3887
|
+
if (x && x.startsWith("admin.resource.") && x.endsWith(".index")) {
|
|
3888
|
+
const C = p.params.slug ?? p.meta.slug;
|
|
3889
|
+
if (C)
|
|
3890
|
+
try {
|
|
3891
|
+
const { useResourceIndexStore: _ } = await Promise.resolve().then(() => $a), g = _();
|
|
3892
|
+
(g.slug !== C || g.items.length === 0) && (g.setSlug(C), await g.load().catch(() => {
|
|
3893
|
+
}));
|
|
3894
|
+
} catch {
|
|
3895
|
+
}
|
|
3896
|
+
}
|
|
3897
|
+
k();
|
|
3882
3898
|
}), !t.skipManifestLoad) {
|
|
3883
|
-
const
|
|
3899
|
+
const p = oe(), y = Q(), k = kt(), x = () => {
|
|
3884
3900
|
k.load().catch(() => {
|
|
3885
|
-
}),
|
|
3886
|
-
u.replaceManifestRoutes(
|
|
3887
|
-
const
|
|
3888
|
-
|
|
3889
|
-
}).catch((
|
|
3890
|
-
typeof console < "u" && console.error("[laravel-admin] manifest load failed:",
|
|
3901
|
+
}), p.load().then((C) => {
|
|
3902
|
+
u.replaceManifestRoutes(C);
|
|
3903
|
+
const _ = u.currentRoute.value;
|
|
3904
|
+
_.name === "admin.notFound" && _.fullPath !== "/" && u.replace(_.fullPath);
|
|
3905
|
+
}).catch((C) => {
|
|
3906
|
+
typeof console < "u" && console.error("[laravel-admin] manifest load failed:", C);
|
|
3891
3907
|
});
|
|
3892
3908
|
};
|
|
3893
|
-
|
|
3894
|
-
() =>
|
|
3895
|
-
(
|
|
3896
|
-
|
|
3909
|
+
y.isAuthenticated && x(), ee(
|
|
3910
|
+
() => y.user,
|
|
3911
|
+
(C, _) => {
|
|
3912
|
+
C && !_ && x();
|
|
3897
3913
|
}
|
|
3898
3914
|
);
|
|
3899
3915
|
}
|
|
3900
3916
|
return t.onAppCreated?.(l), { app: l, router: u, client: a };
|
|
3901
3917
|
}
|
|
3902
|
-
function
|
|
3918
|
+
function ii(e) {
|
|
3903
3919
|
if (!e) return null;
|
|
3904
3920
|
try {
|
|
3905
3921
|
return new URL(e).pathname || "/admin";
|
|
@@ -3907,8 +3923,8 @@ function si(e) {
|
|
|
3907
3923
|
return e.startsWith("/") ? e : null;
|
|
3908
3924
|
}
|
|
3909
3925
|
}
|
|
3910
|
-
async function
|
|
3911
|
-
const t =
|
|
3926
|
+
async function _o(e = {}) {
|
|
3927
|
+
const t = oi();
|
|
3912
3928
|
if (t)
|
|
3913
3929
|
return t;
|
|
3914
3930
|
if (e.client)
|
|
@@ -3922,31 +3938,31 @@ async function ho(e = {}) {
|
|
|
3922
3938
|
}
|
|
3923
3939
|
return null;
|
|
3924
3940
|
}
|
|
3925
|
-
function
|
|
3941
|
+
function oi() {
|
|
3926
3942
|
return typeof window > "u" ? null : window.__ADMIN_BOOTSTRAP__ ?? null;
|
|
3927
3943
|
}
|
|
3928
|
-
function
|
|
3944
|
+
function yo() {
|
|
3929
3945
|
return typeof document > "u" ? null : document.querySelector('meta[name="csrf-token"]')?.getAttribute("content") ?? null;
|
|
3930
3946
|
}
|
|
3931
|
-
const
|
|
3947
|
+
const ri = { class: "admin-notifs__hd" }, ui = { class: "admin-notifs__title" }, di = {
|
|
3932
3948
|
key: 0,
|
|
3933
3949
|
class: "admin-notifs__count"
|
|
3934
|
-
},
|
|
3950
|
+
}, ci = { class: "admin-notifs__list" }, mi = {
|
|
3935
3951
|
key: 0,
|
|
3936
3952
|
class: "admin-notifs__empty"
|
|
3937
|
-
},
|
|
3953
|
+
}, fi = {
|
|
3938
3954
|
key: 1,
|
|
3939
3955
|
class: "admin-notifs__empty"
|
|
3940
|
-
},
|
|
3956
|
+
}, vi = ["onClick"], pi = ["data-kind"], gi = { class: "admin-notifs__body" }, hi = { class: "admin-notifs__row1" }, _i = {
|
|
3941
3957
|
key: 0,
|
|
3942
3958
|
class: "admin-notifs__title-strong"
|
|
3943
|
-
},
|
|
3959
|
+
}, yi = {
|
|
3944
3960
|
key: 1,
|
|
3945
3961
|
class: "admin-notifs__title-soft"
|
|
3946
|
-
},
|
|
3962
|
+
}, bi = { class: "admin-notifs__time" }, ki = {
|
|
3947
3963
|
key: 0,
|
|
3948
3964
|
class: "admin-notifs__text"
|
|
3949
|
-
},
|
|
3965
|
+
}, wi = ["onClick"], bo = /* @__PURE__ */ L({
|
|
3950
3966
|
__name: "NotificationsDrawer",
|
|
3951
3967
|
props: {
|
|
3952
3968
|
open: { type: Boolean }
|
|
@@ -3954,55 +3970,55 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
3954
3970
|
emits: ["update:open", "select-item"],
|
|
3955
3971
|
setup(e, { emit: t }) {
|
|
3956
3972
|
const n = e, s = t, a = Xe();
|
|
3957
|
-
function l(
|
|
3958
|
-
s("update:open",
|
|
3973
|
+
function l(g) {
|
|
3974
|
+
s("update:open", g);
|
|
3959
3975
|
}
|
|
3960
3976
|
ee(
|
|
3961
3977
|
() => n.open,
|
|
3962
|
-
async (
|
|
3963
|
-
|
|
3978
|
+
async (g) => {
|
|
3979
|
+
g && await a.load(a.lastFilter ?? "all", 1).catch(() => {
|
|
3964
3980
|
});
|
|
3965
3981
|
},
|
|
3966
3982
|
{ immediate: !0 }
|
|
3967
3983
|
);
|
|
3968
3984
|
const i = v(() => a.lastFilter ?? "all");
|
|
3969
|
-
async function u(
|
|
3970
|
-
await a.load(
|
|
3985
|
+
async function u(g) {
|
|
3986
|
+
await a.load(g, 1).catch(() => {
|
|
3971
3987
|
});
|
|
3972
3988
|
}
|
|
3973
3989
|
async function f() {
|
|
3974
3990
|
await a.markAllAsRead().catch(() => {
|
|
3975
3991
|
});
|
|
3976
3992
|
}
|
|
3977
|
-
async function g
|
|
3978
|
-
s("select-item",
|
|
3993
|
+
async function p(g) {
|
|
3994
|
+
s("select-item", g), g.read_at || await a.markAsRead(g.id).catch(() => {
|
|
3979
3995
|
});
|
|
3980
3996
|
}
|
|
3981
|
-
async function
|
|
3982
|
-
|
|
3997
|
+
async function y(g, F) {
|
|
3998
|
+
F.stopPropagation(), await a.destroy(g.id).catch(() => {
|
|
3983
3999
|
});
|
|
3984
4000
|
}
|
|
3985
|
-
function k(
|
|
3986
|
-
const
|
|
3987
|
-
return
|
|
4001
|
+
function k(g) {
|
|
4002
|
+
const F = g.data.level;
|
|
4003
|
+
return F === "success" || F === "warning" || F === "danger" ? F : "info";
|
|
3988
4004
|
}
|
|
3989
|
-
function
|
|
3990
|
-
return
|
|
4005
|
+
function x(g) {
|
|
4006
|
+
return g.data.title ?? "—";
|
|
3991
4007
|
}
|
|
3992
|
-
function
|
|
3993
|
-
return
|
|
4008
|
+
function C(g) {
|
|
4009
|
+
return g.data.body ?? "";
|
|
3994
4010
|
}
|
|
3995
|
-
function
|
|
3996
|
-
if (!
|
|
3997
|
-
const
|
|
4011
|
+
function _(g) {
|
|
4012
|
+
if (!g) return "";
|
|
4013
|
+
const F = new Date(g), q = Math.max(0, Date.now() - F.getTime()), M = Math.floor(q / 6e4);
|
|
3998
4014
|
if (M < 1) return "только что";
|
|
3999
4015
|
if (M < 60) return `${M} мин назад`;
|
|
4000
4016
|
const T = Math.floor(M / 60);
|
|
4001
4017
|
if (T < 24) return `${T} ч назад`;
|
|
4002
4018
|
const w = Math.floor(T / 24);
|
|
4003
|
-
return w < 7 ? `${w} д назад` :
|
|
4019
|
+
return w < 7 ? `${w} д назад` : F.toLocaleDateString("ru-RU");
|
|
4004
4020
|
}
|
|
4005
|
-
return (
|
|
4021
|
+
return (g, F) => (o(), b(r(sn), {
|
|
4006
4022
|
"model-value": e.open,
|
|
4007
4023
|
side: "right",
|
|
4008
4024
|
width: "400px",
|
|
@@ -4010,10 +4026,10 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4010
4026
|
"onUpdate:modelValue": l
|
|
4011
4027
|
}, {
|
|
4012
4028
|
header: m(() => [
|
|
4013
|
-
d("div",
|
|
4014
|
-
d("h2",
|
|
4015
|
-
|
|
4016
|
-
r(a).unreadCount > 0 ? (o(), c("span",
|
|
4029
|
+
d("div", ri, [
|
|
4030
|
+
d("h2", ui, [
|
|
4031
|
+
F[0] || (F[0] = S(" Уведомления ", -1)),
|
|
4032
|
+
r(a).unreadCount > 0 ? (o(), c("span", di, " (" + h(r(a).unreadCount) + ") ", 1)) : U("", !0)
|
|
4017
4033
|
]),
|
|
4018
4034
|
r(a).unreadCount > 0 ? (o(), b(r(z), {
|
|
4019
4035
|
key: 0,
|
|
@@ -4021,11 +4037,11 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4021
4037
|
size: "sm",
|
|
4022
4038
|
onClick: f
|
|
4023
4039
|
}, {
|
|
4024
|
-
default: m(() => [...
|
|
4025
|
-
|
|
4040
|
+
default: m(() => [...F[1] || (F[1] = [
|
|
4041
|
+
S(" Прочитать все ", -1)
|
|
4026
4042
|
])]),
|
|
4027
4043
|
_: 1
|
|
4028
|
-
})) :
|
|
4044
|
+
})) : U("", !0)
|
|
4029
4045
|
])
|
|
4030
4046
|
]),
|
|
4031
4047
|
default: m(() => [
|
|
@@ -4035,23 +4051,23 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4035
4051
|
}, {
|
|
4036
4052
|
list: m(() => [
|
|
4037
4053
|
$(r(Ae), { value: "all" }, {
|
|
4038
|
-
default: m(() => [...
|
|
4039
|
-
|
|
4054
|
+
default: m(() => [...F[2] || (F[2] = [
|
|
4055
|
+
S("Все", -1)
|
|
4040
4056
|
])]),
|
|
4041
4057
|
_: 1
|
|
4042
4058
|
}),
|
|
4043
4059
|
$(r(Ae), { value: "unread" }, {
|
|
4044
4060
|
default: m(() => [
|
|
4045
|
-
|
|
4061
|
+
F[3] || (F[3] = S(" Непрочитанные", -1)),
|
|
4046
4062
|
r(a).unreadCount > 0 ? (o(), c(P, { key: 0 }, [
|
|
4047
|
-
|
|
4048
|
-
], 64)) :
|
|
4063
|
+
S(" (" + h(r(a).unreadCount) + ") ", 1)
|
|
4064
|
+
], 64)) : U("", !0)
|
|
4049
4065
|
]),
|
|
4050
4066
|
_: 1
|
|
4051
4067
|
}),
|
|
4052
4068
|
$(r(Ae), { value: "read" }, {
|
|
4053
|
-
default: m(() => [...
|
|
4054
|
-
|
|
4069
|
+
default: m(() => [...F[4] || (F[4] = [
|
|
4070
|
+
S("Прочитанные", -1)
|
|
4055
4071
|
])]),
|
|
4056
4072
|
_: 1
|
|
4057
4073
|
})
|
|
@@ -4062,8 +4078,8 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4062
4078
|
value: q
|
|
4063
4079
|
}, {
|
|
4064
4080
|
default: m(() => [
|
|
4065
|
-
d("ul",
|
|
4066
|
-
r(a).loading ? (o(), c("li",
|
|
4081
|
+
d("ul", ci, [
|
|
4082
|
+
r(a).loading ? (o(), c("li", mi, " Загрузка… ")) : r(a).items.length === 0 ? (o(), c("li", fi, " Нет уведомлений ")) : U("", !0),
|
|
4067
4083
|
(o(!0), c(P, null, D(r(a).items, (M) => (o(), c("li", {
|
|
4068
4084
|
key: M.id,
|
|
4069
4085
|
class: Z([
|
|
@@ -4071,26 +4087,26 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4071
4087
|
`admin-notifs__item--${k(M)}`,
|
|
4072
4088
|
{ "admin-notifs__item--unread": !M.read_at }
|
|
4073
4089
|
]),
|
|
4074
|
-
onClick: (T) =>
|
|
4090
|
+
onClick: (T) => p(M)
|
|
4075
4091
|
}, [
|
|
4076
4092
|
d("span", {
|
|
4077
4093
|
class: "admin-notifs__icon",
|
|
4078
4094
|
"data-kind": k(M)
|
|
4079
|
-
}, null, 8,
|
|
4080
|
-
d("div",
|
|
4081
|
-
d("div",
|
|
4082
|
-
M.read_at ? (o(), c("span",
|
|
4083
|
-
d("span",
|
|
4095
|
+
}, null, 8, pi),
|
|
4096
|
+
d("div", gi, [
|
|
4097
|
+
d("div", hi, [
|
|
4098
|
+
M.read_at ? (o(), c("span", yi, h(x(M)), 1)) : (o(), c("strong", _i, h(x(M)), 1)),
|
|
4099
|
+
d("span", bi, h(_(M.created_at)), 1)
|
|
4084
4100
|
]),
|
|
4085
|
-
|
|
4101
|
+
C(M) ? (o(), c("p", ki, h(C(M)), 1)) : U("", !0)
|
|
4086
4102
|
]),
|
|
4087
4103
|
d("button", {
|
|
4088
4104
|
type: "button",
|
|
4089
4105
|
class: "admin-notifs__close",
|
|
4090
4106
|
"aria-label": "Удалить",
|
|
4091
|
-
onClick: (T) =>
|
|
4092
|
-
}, " × ", 8,
|
|
4093
|
-
], 10,
|
|
4107
|
+
onClick: (T) => y(M, T)
|
|
4108
|
+
}, " × ", 8, wi)
|
|
4109
|
+
], 10, vi))), 128))
|
|
4094
4110
|
])
|
|
4095
4111
|
]),
|
|
4096
4112
|
_: 1
|
|
@@ -4102,22 +4118,22 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4102
4118
|
_: 1
|
|
4103
4119
|
}, 8, ["model-value"]));
|
|
4104
4120
|
}
|
|
4105
|
-
}),
|
|
4121
|
+
}), $i = { class: "admin-page admin-import-wizard" }, xi = { class: "admin-page__hd" }, Si = { class: "admin-page__title-wrap" }, Ci = { class: "admin-page__title" }, Ai = { class: "admin-page__actions" }, Ei = {
|
|
4106
4122
|
key: 0,
|
|
4107
4123
|
class: "admin-import-wizard__empty"
|
|
4108
|
-
},
|
|
4124
|
+
}, Ri = {
|
|
4109
4125
|
key: 1,
|
|
4110
4126
|
class: "admin-import-wizard__mapping"
|
|
4111
4127
|
}, Fi = { class: "admin-import-wizard__map-source" }, Ui = {
|
|
4112
4128
|
key: 0,
|
|
4113
4129
|
class: "admin-import-wizard__map-sample"
|
|
4114
|
-
},
|
|
4130
|
+
}, Ti = { class: "admin-import-wizard__card-hd" }, Li = {
|
|
4115
4131
|
key: 2,
|
|
4116
4132
|
class: "admin-import-wizard__empty"
|
|
4117
|
-
},
|
|
4133
|
+
}, Pi = {
|
|
4118
4134
|
key: 0,
|
|
4119
4135
|
class: "admin-import-wizard__empty"
|
|
4120
|
-
},
|
|
4136
|
+
}, Mi = { class: "admin-import-wizard__kpi" }, Ni = { class: "admin-import-wizard__nav" }, ko = /* @__PURE__ */ L({
|
|
4121
4137
|
__name: "ImportWizardPage",
|
|
4122
4138
|
props: {
|
|
4123
4139
|
title: { default: "Импорт" },
|
|
@@ -4135,36 +4151,36 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4135
4151
|
{ label: "Сопоставление", description: "Колонки файла → поля" },
|
|
4136
4152
|
{ label: "Предпросмотр", description: "Проверка первых строк" },
|
|
4137
4153
|
{ label: "Импорт", description: "Запуск + сводка" }
|
|
4138
|
-
], l =
|
|
4154
|
+
], l = R(0), i = v(() => n.step ?? l.value);
|
|
4139
4155
|
function u(T) {
|
|
4140
4156
|
n.step === void 0 && (T < 0 || T >= a.length || (l.value = T));
|
|
4141
4157
|
}
|
|
4142
|
-
const f =
|
|
4143
|
-
function
|
|
4158
|
+
const f = R([]);
|
|
4159
|
+
function p(T) {
|
|
4144
4160
|
f.value = T, T.length > 0 && s("file-uploaded", T[0].file);
|
|
4145
4161
|
}
|
|
4146
|
-
const
|
|
4162
|
+
const y = R({});
|
|
4147
4163
|
function k(T, w) {
|
|
4148
|
-
|
|
4164
|
+
y.value[T] = w === null || w === "" ? null : String(w);
|
|
4149
4165
|
}
|
|
4150
|
-
function
|
|
4166
|
+
function x() {
|
|
4151
4167
|
return n.headers.map((T) => ({
|
|
4152
4168
|
source: T.key,
|
|
4153
|
-
target:
|
|
4169
|
+
target: y.value[T.key] ?? null
|
|
4154
4170
|
}));
|
|
4155
4171
|
}
|
|
4156
|
-
function
|
|
4157
|
-
s("mapping-submit",
|
|
4172
|
+
function C() {
|
|
4173
|
+
s("mapping-submit", x()), u(2);
|
|
4158
4174
|
}
|
|
4159
|
-
function
|
|
4175
|
+
function _() {
|
|
4160
4176
|
s("run-import"), u(3);
|
|
4161
4177
|
}
|
|
4162
|
-
const
|
|
4178
|
+
const g = v(() => i.value > 0), F = v(() => {
|
|
4163
4179
|
switch (i.value) {
|
|
4164
4180
|
case 0:
|
|
4165
4181
|
return f.value.length > 0;
|
|
4166
4182
|
case 1:
|
|
4167
|
-
return Object.values(
|
|
4183
|
+
return Object.values(y.value).some((T) => T !== null);
|
|
4168
4184
|
case 2:
|
|
4169
4185
|
return !0;
|
|
4170
4186
|
default:
|
|
@@ -4177,28 +4193,28 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4177
4193
|
function M() {
|
|
4178
4194
|
s("cancel");
|
|
4179
4195
|
}
|
|
4180
|
-
return (T, w) => (o(), c("section",
|
|
4181
|
-
d("header",
|
|
4182
|
-
d("div",
|
|
4183
|
-
d("h1",
|
|
4196
|
+
return (T, w) => (o(), c("section", $i, [
|
|
4197
|
+
d("header", xi, [
|
|
4198
|
+
d("div", Si, [
|
|
4199
|
+
d("h1", Ci, h(e.title), 1)
|
|
4184
4200
|
]),
|
|
4185
|
-
d("div",
|
|
4201
|
+
d("div", Ai, [
|
|
4186
4202
|
$(r(z), {
|
|
4187
4203
|
variant: "ghost",
|
|
4188
4204
|
onClick: M
|
|
4189
4205
|
}, {
|
|
4190
4206
|
default: m(() => [...w[2] || (w[2] = [
|
|
4191
|
-
|
|
4207
|
+
S("Отмена", -1)
|
|
4192
4208
|
])]),
|
|
4193
4209
|
_: 1
|
|
4194
4210
|
})
|
|
4195
4211
|
])
|
|
4196
4212
|
]),
|
|
4197
|
-
$(r(
|
|
4213
|
+
$(r(on), {
|
|
4198
4214
|
steps: a,
|
|
4199
4215
|
current: i.value
|
|
4200
4216
|
}, null, 8, ["current"]),
|
|
4201
|
-
i.value === 0 ? (o(), b(r(
|
|
4217
|
+
i.value === 0 ? (o(), b(r(K), {
|
|
4202
4218
|
key: 0,
|
|
4203
4219
|
padding: "md",
|
|
4204
4220
|
class: "admin-import-wizard__card"
|
|
@@ -4208,18 +4224,18 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4208
4224
|
d("h3", null, "1. Загрузите файл"),
|
|
4209
4225
|
d("p", null, "CSV / TSV / XLSX, до 50 MB")
|
|
4210
4226
|
], -1)),
|
|
4211
|
-
$(r(
|
|
4227
|
+
$(r(rn), {
|
|
4212
4228
|
"model-value": f.value,
|
|
4213
4229
|
accept: ".csv,.tsv,.xlsx",
|
|
4214
4230
|
"max-size": 50 * 1024 * 1024,
|
|
4215
4231
|
"max-files": 1,
|
|
4216
4232
|
"primary-text": "Перетащите файл сюда или",
|
|
4217
4233
|
"secondary-text": "нажмите чтобы выбрать",
|
|
4218
|
-
"onUpdate:modelValue":
|
|
4234
|
+
"onUpdate:modelValue": p
|
|
4219
4235
|
}, null, 8, ["model-value"])
|
|
4220
4236
|
]),
|
|
4221
4237
|
_: 1
|
|
4222
|
-
})) : i.value === 1 ? (o(), b(r(
|
|
4238
|
+
})) : i.value === 1 ? (o(), b(r(K), {
|
|
4223
4239
|
key: 1,
|
|
4224
4240
|
padding: "md",
|
|
4225
4241
|
class: "admin-import-wizard__card"
|
|
@@ -4229,18 +4245,18 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4229
4245
|
d("h3", null, "2. Сопоставьте колонки"),
|
|
4230
4246
|
d("p", null, "Выберите поле ресурса для каждой колонки файла")
|
|
4231
4247
|
], -1)),
|
|
4232
|
-
e.headers.length === 0 ? (o(), c("div",
|
|
4248
|
+
e.headers.length === 0 ? (o(), c("div", Ei, " Нет данных — host ещё не отдал headers. Загрузите файл сначала. ")) : (o(), c("div", Ri, [
|
|
4233
4249
|
(o(!0), c(P, null, D(e.headers, (V) => (o(), c("div", {
|
|
4234
4250
|
key: V.key,
|
|
4235
4251
|
class: "admin-import-wizard__map-row"
|
|
4236
4252
|
}, [
|
|
4237
4253
|
d("div", Fi, [
|
|
4238
|
-
d("strong", null,
|
|
4239
|
-
V.sample ? (o(), c("span", Ui, " «" +
|
|
4254
|
+
d("strong", null, h(V.label), 1),
|
|
4255
|
+
V.sample ? (o(), c("span", Ui, " «" + h(V.sample) + "» ", 1)) : U("", !0)
|
|
4240
4256
|
]),
|
|
4241
4257
|
w[4] || (w[4] = d("span", { class: "admin-import-wizard__map-arrow" }, "→", -1)),
|
|
4242
4258
|
$(r(Ee), {
|
|
4243
|
-
"model-value":
|
|
4259
|
+
"model-value": y.value[V.key] ?? "",
|
|
4244
4260
|
options: q.value,
|
|
4245
4261
|
placeholder: "Не импортировать",
|
|
4246
4262
|
"onUpdate:modelValue": (W) => k(V.key, W)
|
|
@@ -4249,15 +4265,15 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4249
4265
|
]))
|
|
4250
4266
|
]),
|
|
4251
4267
|
_: 1
|
|
4252
|
-
})) : i.value === 2 ? (o(), b(r(
|
|
4268
|
+
})) : i.value === 2 ? (o(), b(r(K), {
|
|
4253
4269
|
key: 2,
|
|
4254
4270
|
padding: "md",
|
|
4255
4271
|
class: "admin-import-wizard__card"
|
|
4256
4272
|
}, {
|
|
4257
4273
|
default: m(() => [
|
|
4258
|
-
d("header",
|
|
4274
|
+
d("header", Ti, [
|
|
4259
4275
|
w[6] || (w[6] = d("h3", null, "3. Предпросмотр", -1)),
|
|
4260
|
-
d("p", null, "Первые " +
|
|
4276
|
+
d("p", null, "Первые " + h(e.preview.length) + " строк перед импортом", 1)
|
|
4261
4277
|
]),
|
|
4262
4278
|
e.preview.some((V) => V.__warning) ? (o(), b(r(te), {
|
|
4263
4279
|
key: 0,
|
|
@@ -4265,18 +4281,18 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4265
4281
|
style: { "margin-bottom": "var(--uid-space-md)" }
|
|
4266
4282
|
}, {
|
|
4267
4283
|
default: m(() => [...w[7] || (w[7] = [
|
|
4268
|
-
|
|
4284
|
+
S(" Часть строк имеет предупреждения — проверьте перед импортом. ", -1)
|
|
4269
4285
|
])]),
|
|
4270
4286
|
_: 1
|
|
4271
|
-
})) :
|
|
4272
|
-
e.previewColumns.length > 0 ? (o(), b(r(
|
|
4287
|
+
})) : U("", !0),
|
|
4288
|
+
e.previewColumns.length > 0 ? (o(), b(r(je), {
|
|
4273
4289
|
key: 1,
|
|
4274
4290
|
columns: e.previewColumns,
|
|
4275
4291
|
data: e.preview
|
|
4276
|
-
}, null, 8, ["columns", "data"])) : (o(), c("div",
|
|
4292
|
+
}, null, 8, ["columns", "data"])) : (o(), c("div", Li, " Host не передал previewColumns/preview. "))
|
|
4277
4293
|
]),
|
|
4278
4294
|
_: 1
|
|
4279
|
-
})) : (o(), b(r(
|
|
4295
|
+
})) : (o(), b(r(K), {
|
|
4280
4296
|
key: 3,
|
|
4281
4297
|
padding: "md",
|
|
4282
4298
|
class: "admin-import-wizard__card"
|
|
@@ -4286,12 +4302,12 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4286
4302
|
d("h3", null, "4. Импорт")
|
|
4287
4303
|
], -1)),
|
|
4288
4304
|
e.progress ? (o(), c(P, { key: 1 }, [
|
|
4289
|
-
e.progress.total > 0 ? (o(), b(r(
|
|
4305
|
+
e.progress.total > 0 ? (o(), b(r(un), {
|
|
4290
4306
|
key: 0,
|
|
4291
4307
|
"model-value": e.progress.created + e.progress.updated + e.progress.errors,
|
|
4292
4308
|
max: e.progress.total
|
|
4293
|
-
}, null, 8, ["model-value", "max"])) :
|
|
4294
|
-
d("div",
|
|
4309
|
+
}, null, 8, ["model-value", "max"])) : U("", !0),
|
|
4310
|
+
d("div", Mi, [
|
|
4295
4311
|
$(r(Ce), {
|
|
4296
4312
|
title: "Создано",
|
|
4297
4313
|
value: e.progress.created,
|
|
@@ -4308,56 +4324,56 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4308
4324
|
tone: "danger"
|
|
4309
4325
|
}, null, 8, ["value"])
|
|
4310
4326
|
])
|
|
4311
|
-
], 64)) : (o(), c("div",
|
|
4327
|
+
], 64)) : (o(), c("div", Pi, " Запускается импорт… "))
|
|
4312
4328
|
]),
|
|
4313
4329
|
_: 1
|
|
4314
4330
|
})),
|
|
4315
|
-
d("footer",
|
|
4316
|
-
|
|
4331
|
+
d("footer", Ni, [
|
|
4332
|
+
g.value ? (o(), b(r(z), {
|
|
4317
4333
|
key: 0,
|
|
4318
4334
|
variant: "ghost",
|
|
4319
4335
|
onClick: w[0] || (w[0] = (V) => u(i.value - 1))
|
|
4320
4336
|
}, {
|
|
4321
4337
|
default: m(() => [...w[9] || (w[9] = [
|
|
4322
|
-
|
|
4338
|
+
S(" Назад ", -1)
|
|
4323
4339
|
])]),
|
|
4324
4340
|
_: 1
|
|
4325
|
-
})) :
|
|
4341
|
+
})) : U("", !0),
|
|
4326
4342
|
w[13] || (w[13] = d("span", { style: { flex: "1" } }, null, -1)),
|
|
4327
4343
|
i.value === 0 ? (o(), b(r(z), {
|
|
4328
4344
|
key: 1,
|
|
4329
4345
|
variant: "primary",
|
|
4330
|
-
disabled: !
|
|
4346
|
+
disabled: !F.value,
|
|
4331
4347
|
onClick: w[1] || (w[1] = (V) => u(1))
|
|
4332
4348
|
}, {
|
|
4333
4349
|
default: m(() => [...w[10] || (w[10] = [
|
|
4334
|
-
|
|
4350
|
+
S(" Далее ", -1)
|
|
4335
4351
|
])]),
|
|
4336
4352
|
_: 1
|
|
4337
4353
|
}, 8, ["disabled"])) : i.value === 1 ? (o(), b(r(z), {
|
|
4338
4354
|
key: 2,
|
|
4339
4355
|
variant: "primary",
|
|
4340
|
-
disabled: !
|
|
4341
|
-
onClick:
|
|
4356
|
+
disabled: !F.value,
|
|
4357
|
+
onClick: C
|
|
4342
4358
|
}, {
|
|
4343
4359
|
default: m(() => [...w[11] || (w[11] = [
|
|
4344
|
-
|
|
4360
|
+
S(" Подтвердить mapping ", -1)
|
|
4345
4361
|
])]),
|
|
4346
4362
|
_: 1
|
|
4347
4363
|
}, 8, ["disabled"])) : i.value === 2 ? (o(), b(r(z), {
|
|
4348
4364
|
key: 3,
|
|
4349
4365
|
variant: "primary",
|
|
4350
|
-
onClick:
|
|
4366
|
+
onClick: _
|
|
4351
4367
|
}, {
|
|
4352
4368
|
default: m(() => [...w[12] || (w[12] = [
|
|
4353
|
-
|
|
4369
|
+
S(" Запустить импорт ", -1)
|
|
4354
4370
|
])]),
|
|
4355
4371
|
_: 1
|
|
4356
|
-
})) :
|
|
4372
|
+
})) : U("", !0)
|
|
4357
4373
|
])
|
|
4358
4374
|
]));
|
|
4359
4375
|
}
|
|
4360
|
-
}),
|
|
4376
|
+
}), Bi = { class: "admin-page admin-field-gallery" }, Ii = { class: "admin-gallery__group-title" }, Di = { class: "admin-gallery__grid" }, Vi = { class: "admin-gallery__card-hd" }, zi = { class: "admin-gallery__card-title" }, qi = { class: "admin-gallery__card-type" }, Oi = { class: "admin-gallery__card-desc" }, Wi = { class: "admin-gallery__card-demo" }, wo = /* @__PURE__ */ L({
|
|
4361
4377
|
__name: "FieldGalleryPage",
|
|
4362
4378
|
setup(e) {
|
|
4363
4379
|
const t = [
|
|
@@ -4421,10 +4437,10 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4421
4437
|
node: { type: "date", name: "demo_date", label: "Дата публикации", inputType: "date" },
|
|
4422
4438
|
initial: { demo_date: "2026-05-01" }
|
|
4423
4439
|
}
|
|
4424
|
-
], n = t.reduce((a, l) => (a[l.group] || (a[l.group] = []), a[l.group].push(l), a), {}), s =
|
|
4440
|
+
], n = t.reduce((a, l) => (a[l.group] || (a[l.group] = []), a[l.group].push(l), a), {}), s = It(
|
|
4425
4441
|
t.reduce((a, l) => Object.assign(a, l.initial), {})
|
|
4426
4442
|
);
|
|
4427
|
-
return ht(s), (a, l) => (o(), c("section",
|
|
4443
|
+
return ht(s), (a, l) => (o(), c("section", Bi, [
|
|
4428
4444
|
l[0] || (l[0] = d("header", { class: "admin-page__hd" }, [
|
|
4429
4445
|
d("div", { class: "admin-page__title-wrap" }, [
|
|
4430
4446
|
d("h1", { class: "admin-page__title" }, "Field Gallery"),
|
|
@@ -4435,21 +4451,21 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4435
4451
|
key: u,
|
|
4436
4452
|
class: "admin-gallery__group"
|
|
4437
4453
|
}, [
|
|
4438
|
-
d("h2",
|
|
4439
|
-
d("div",
|
|
4440
|
-
(o(!0), c(P, null, D(i, (f) => (o(), b(r(
|
|
4454
|
+
d("h2", Ii, h(u), 1),
|
|
4455
|
+
d("div", Di, [
|
|
4456
|
+
(o(!0), c(P, null, D(i, (f) => (o(), b(r(K), {
|
|
4441
4457
|
key: f.type + f.title,
|
|
4442
4458
|
padding: "md",
|
|
4443
4459
|
class: "admin-gallery__card"
|
|
4444
4460
|
}, {
|
|
4445
4461
|
default: m(() => [
|
|
4446
|
-
d("header",
|
|
4447
|
-
d("h3",
|
|
4448
|
-
d("code",
|
|
4462
|
+
d("header", Vi, [
|
|
4463
|
+
d("h3", zi, h(f.title), 1),
|
|
4464
|
+
d("code", qi, "type: " + h(f.type), 1)
|
|
4449
4465
|
]),
|
|
4450
|
-
d("p",
|
|
4451
|
-
d("div",
|
|
4452
|
-
$(
|
|
4466
|
+
d("p", Oi, h(f.description), 1),
|
|
4467
|
+
d("div", Wi, [
|
|
4468
|
+
$(Ct, {
|
|
4453
4469
|
node: f.node
|
|
4454
4470
|
}, null, 8, ["node"])
|
|
4455
4471
|
])
|
|
@@ -4462,108 +4478,108 @@ const oi = { class: "admin-notifs__hd" }, ri = { class: "admin-notifs__title" },
|
|
|
4462
4478
|
}
|
|
4463
4479
|
});
|
|
4464
4480
|
export {
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4481
|
+
In as AdminApp,
|
|
4482
|
+
Mn as AdminShell,
|
|
4483
|
+
Tn as AdminSidebar,
|
|
4484
|
+
xn as AdminTopBar,
|
|
4469
4485
|
ae as ApiError,
|
|
4470
|
-
|
|
4471
|
-
|
|
4486
|
+
ei as BadgeEntry,
|
|
4487
|
+
ss as BarChartWidget,
|
|
4472
4488
|
ze as CheckboxField,
|
|
4473
4489
|
Ks as ColumnsLayout,
|
|
4474
|
-
|
|
4490
|
+
Ql as DashboardPage,
|
|
4475
4491
|
ue as DateField,
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4492
|
+
vs as DonutChartWidget,
|
|
4493
|
+
wo as FieldGalleryPage,
|
|
4494
|
+
Ct as FieldRenderer,
|
|
4495
|
+
hn as ForbiddenError,
|
|
4496
|
+
Hn as ForbiddenPage,
|
|
4497
|
+
xs as GaugeWidget,
|
|
4498
|
+
bs as HeatmapWidget,
|
|
4483
4499
|
Kn as HomePage,
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4500
|
+
ai as IconEntry,
|
|
4501
|
+
ko as ImportWizardPage,
|
|
4502
|
+
dl as InfolistRenderer,
|
|
4487
4503
|
ot as KeyValueEntry,
|
|
4488
4504
|
we as LayoutRenderer,
|
|
4489
4505
|
yt as LocaleSwitcher,
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4506
|
+
da as LoginForm,
|
|
4507
|
+
wa as LoginPage,
|
|
4508
|
+
Es as MarkdownWidget,
|
|
4493
4509
|
Pe as NetworkError,
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4510
|
+
_n as NotFoundError,
|
|
4511
|
+
Yn as NotFoundPage,
|
|
4512
|
+
gn as NotificationBell,
|
|
4513
|
+
bo as NotificationsDrawer,
|
|
4498
4514
|
Ve as NumberField,
|
|
4499
|
-
|
|
4500
|
-
|
|
4515
|
+
Vl as ProfilePage,
|
|
4516
|
+
hs as RecentTableWidget,
|
|
4501
4517
|
lt as ResourceFormPage,
|
|
4502
|
-
|
|
4503
|
-
|
|
4518
|
+
Oa as ResourceIndexPage,
|
|
4519
|
+
_l as ResourceViewPage,
|
|
4504
4520
|
it as RowsLayout,
|
|
4505
4521
|
he as SectionLayout,
|
|
4506
4522
|
le as SelectField,
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4523
|
+
ta as SettingsPage,
|
|
4524
|
+
Zl as StatWidget,
|
|
4525
|
+
Js as TabsLayout,
|
|
4510
4526
|
Se as TextAreaField,
|
|
4511
4527
|
I as TextEntry,
|
|
4512
4528
|
J as TextField,
|
|
4513
4529
|
_t as ThemeToggle,
|
|
4514
|
-
|
|
4530
|
+
fa as TwoFactorForm,
|
|
4515
4531
|
bt as UnauthenticatedError,
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4532
|
+
Za as UnknownEntry,
|
|
4533
|
+
St as UnknownField,
|
|
4534
|
+
sa as UnknownScreenPage,
|
|
4535
|
+
Ol as UnknownWidget,
|
|
4536
|
+
bn as UserMenu,
|
|
4521
4537
|
Le as ValidationError,
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4538
|
+
Wl as WidgetRenderer,
|
|
4539
|
+
Vs as buildRoutesFromManifest,
|
|
4540
|
+
Ji as clearAdminClient,
|
|
4541
|
+
uo as clearInfolistRegistry,
|
|
4542
|
+
so as clearRegistry,
|
|
4543
|
+
po as clearWidgetRegistry,
|
|
4544
|
+
ho as createAdminApp,
|
|
4529
4545
|
Us as createAdminClient,
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4546
|
+
js as createAdminRouter,
|
|
4547
|
+
zs as createAuthGuard,
|
|
4548
|
+
qs as createTitleGuard,
|
|
4533
4549
|
H as getAdminClient,
|
|
4534
|
-
|
|
4550
|
+
xt as getField,
|
|
4535
4551
|
st as getInfolistEntry,
|
|
4536
4552
|
at as getLayout,
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4553
|
+
zl as getWidget,
|
|
4554
|
+
Qi as hasAdminClient,
|
|
4555
|
+
eo as hasField,
|
|
4556
|
+
oo as hasInfolistEntry,
|
|
4557
|
+
ao as hasLayout,
|
|
4558
|
+
fo as hasWidget,
|
|
4559
|
+
go as isError,
|
|
4544
4560
|
Fs as isSuccess,
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4561
|
+
to as listFields,
|
|
4562
|
+
ro as listInfolistEntries,
|
|
4563
|
+
lo as listLayouts,
|
|
4564
|
+
vo as listWidgets,
|
|
4565
|
+
_o as loadBootstrap,
|
|
4550
4566
|
ht as provideFormState,
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4567
|
+
cl as provideRecord,
|
|
4568
|
+
yo as readCsrfFromMeta,
|
|
4569
|
+
oi as readInlineBootstrap,
|
|
4570
|
+
Qs as registerBuiltinComponents,
|
|
4571
|
+
si as registerBuiltinInfolistEntries,
|
|
4572
|
+
Rs as registerBuiltinWidgets,
|
|
4573
|
+
Wa as registerComponents,
|
|
4574
|
+
Zi as registerField,
|
|
4575
|
+
Qa as registerInfolistEntries,
|
|
4576
|
+
io as registerInfolistEntry,
|
|
4577
|
+
no as registerLayout,
|
|
4578
|
+
mo as registerWidget,
|
|
4579
|
+
ql as registerWidgets,
|
|
4580
|
+
cn as setAdminClient,
|
|
4565
4581
|
et as toApiError,
|
|
4566
|
-
|
|
4582
|
+
So as tryUseFormState,
|
|
4567
4583
|
Ne as tryUseRecord,
|
|
4568
4584
|
Q as useAuthStore,
|
|
4569
4585
|
ce as useFormState,
|
|
@@ -4571,9 +4587,9 @@ export {
|
|
|
4571
4587
|
oe as useManifestStore,
|
|
4572
4588
|
kt as useMenuStore,
|
|
4573
4589
|
Xe as useNotificationsStore,
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4590
|
+
co as useRecord,
|
|
4591
|
+
$t as useResourceFormStore,
|
|
4592
|
+
wt as useResourceIndexStore,
|
|
4577
4593
|
Ge as useThemeStore
|
|
4578
4594
|
};
|
|
4579
4595
|
//# sourceMappingURL=index.mjs.map
|