@dskripchenko/laravel-admin 1.1.6 → 1.1.8
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 +787 -752
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { ref as E, computed as p, defineComponent as L, openBlock as s, createElementBlock as c, createElementVNode as d, createBlock as w, unref as r, withCtx as m, Fragment as T, renderList as I, createTextVNode as C, toDisplayString as h, createCommentVNode as F, createVNode as x, renderSlot as H, resolveDynamicComponent as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import { RouterLink as
|
|
4
|
-
import { UidMenu as
|
|
5
|
-
import
|
|
6
|
-
import { p as
|
|
1
|
+
import { ref as E, computed as p, defineComponent as L, openBlock as s, createElementBlock as c, createElementVNode as d, createBlock as w, unref as r, withCtx as m, Fragment as T, renderList as I, createTextVNode as C, toDisplayString as h, createCommentVNode as F, createVNode as x, renderSlot as H, resolveDynamicComponent as ue, normalizeClass as Y, createSlots as qe, h as wt, watch as ne, onBeforeUnmount as $t, resolveComponent as lt, withModifiers as Oe, nextTick as Ie, onMounted as Re, withKeys as xt, normalizeProps as Ue, mergeProps as Ee, normalizeStyle as Fe, inject as st, provide as Ct, createApp as St, reactive as At } from "vue";
|
|
2
|
+
import { defineStore as ae, createPinia as Rt } from "pinia";
|
|
3
|
+
import { RouterLink as Ut, useRouter as le, useRoute as _e, createWebHistory as it, createRouter as Et } from "vue-router";
|
|
4
|
+
import { UidMenu as ot, UidMenuItem as De, UidMenuSeparator as Ft, UidAvatar as rt, UidSidebar as Lt, UidSidebarGroup as Pt, UidSidebarItem as Tt, UidSidebarLayout as Mt, UidCard as q, UidButton as B, UidAlert as Q, UidInput as re, UidCheckbox as Se, UidSkeleton as We, UidErrorState as Nt, UidEmptyState as It, UidTable as je, UidPagination as Bt, UidBadge as Ke, UidSelect as Ae, UidStat as xe, UidHeatmap as Vt, UidGauge as zt, UidFormField as ye, UidTextarea as qt, UidNumberInput as Dt, UidDatePicker as Ot, UidStack as Wt, UidGrid as jt, UidTabs as ut, UidTabPanel as dt, UidTab as Ce, UidDescriptionList as Kt, UidDescriptionItem as Gt, UidDrawer as Ht, UidStepper as Xt, UidFileUpload as Jt, UidProgress as Yt } from "@dskripchenko/ui";
|
|
5
|
+
import Qt from "axios";
|
|
6
|
+
import { p as ct, u as de } from "./formState-DGNcH1XQ.js";
|
|
7
7
|
import { t as co } from "./formState-DGNcH1XQ.js";
|
|
8
|
-
let
|
|
9
|
-
function
|
|
10
|
-
|
|
8
|
+
let he = null;
|
|
9
|
+
function Zt(e) {
|
|
10
|
+
he = e;
|
|
11
11
|
}
|
|
12
12
|
function W() {
|
|
13
|
-
if (
|
|
13
|
+
if (he === null)
|
|
14
14
|
throw new Error(
|
|
15
15
|
"[admin] AdminClient is not registered. Call setAdminClient(...) before using stores."
|
|
16
16
|
);
|
|
17
|
-
return
|
|
17
|
+
return he;
|
|
18
18
|
}
|
|
19
19
|
function Ii() {
|
|
20
|
-
|
|
20
|
+
he = null;
|
|
21
21
|
}
|
|
22
22
|
function Bi() {
|
|
23
|
-
return
|
|
23
|
+
return he !== null;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const Ge = ae("admin-theme", () => {
|
|
26
26
|
const e = E("light"), t = E(["light", "dark"]), n = p(() => e.value === "dark");
|
|
27
27
|
function o(u) {
|
|
28
28
|
e.value = u.theme, t.value = u.availableThemes, i(u.theme);
|
|
@@ -54,10 +54,10 @@ const De = ee("admin-theme", () => {
|
|
|
54
54
|
applyLocal: a,
|
|
55
55
|
setTheme: l
|
|
56
56
|
};
|
|
57
|
-
}),
|
|
57
|
+
}), en = ["aria-label", "aria-pressed"], tn = ["data-icon"], mt = /* @__PURE__ */ L({
|
|
58
58
|
__name: "ThemeToggle",
|
|
59
59
|
setup(e) {
|
|
60
|
-
const t =
|
|
60
|
+
const t = Ge(), n = p(() => t.current === "dark"), o = p(() => n.value ? "sun" : "moon"), a = p(
|
|
61
61
|
() => n.value ? "Переключить на светлую тему" : "Переключить на тёмную тему"
|
|
62
62
|
);
|
|
63
63
|
async function l() {
|
|
@@ -74,10 +74,10 @@ const De = ee("admin-theme", () => {
|
|
|
74
74
|
d("span", {
|
|
75
75
|
class: "admin-topbar__icon",
|
|
76
76
|
"data-icon": o.value
|
|
77
|
-
}, null, 8,
|
|
78
|
-
], 8,
|
|
77
|
+
}, null, 8, tn)
|
|
78
|
+
], 8, en));
|
|
79
79
|
}
|
|
80
|
-
}),
|
|
80
|
+
}), He = ae("admin-locale", () => {
|
|
81
81
|
const e = E("ru"), t = E(["ru", "en"]);
|
|
82
82
|
function n(i) {
|
|
83
83
|
e.value = i.locale, t.value = i.availableLocales, l(i.locale);
|
|
@@ -112,21 +112,21 @@ const De = ee("admin-theme", () => {
|
|
|
112
112
|
applyLocal: o,
|
|
113
113
|
setLocale: a
|
|
114
114
|
};
|
|
115
|
-
}),
|
|
115
|
+
}), nn = {
|
|
116
116
|
type: "button",
|
|
117
117
|
class: "admin-topbar__icon-btn",
|
|
118
118
|
style: { width: "auto", padding: "0 8px", gap: "4px", "font-size": "12px" },
|
|
119
119
|
"aria-label": "Сменить локаль"
|
|
120
|
-
},
|
|
120
|
+
}, ft = /* @__PURE__ */ L({
|
|
121
121
|
__name: "LocaleSwitcher",
|
|
122
122
|
setup(e) {
|
|
123
|
-
const t =
|
|
123
|
+
const t = He();
|
|
124
124
|
async function n(o) {
|
|
125
125
|
o !== t.current && await t.setLocale(o);
|
|
126
126
|
}
|
|
127
|
-
return (o, a) => (s(), w(r(
|
|
127
|
+
return (o, a) => (s(), w(r(ot), null, {
|
|
128
128
|
trigger: m(() => [
|
|
129
|
-
d("button",
|
|
129
|
+
d("button", nn, [
|
|
130
130
|
a[0] || (a[0] = d("span", {
|
|
131
131
|
class: "admin-topbar__icon",
|
|
132
132
|
"data-icon": "globe"
|
|
@@ -135,7 +135,7 @@ const De = ee("admin-theme", () => {
|
|
|
135
135
|
])
|
|
136
136
|
]),
|
|
137
137
|
default: m(() => [
|
|
138
|
-
(s(!0), c(T, null, I(r(t).available, (l) => (s(), w(r(
|
|
138
|
+
(s(!0), c(T, null, I(r(t).available, (l) => (s(), w(r(De), {
|
|
139
139
|
key: l,
|
|
140
140
|
onClick: (i) => n(l)
|
|
141
141
|
}, {
|
|
@@ -148,46 +148,46 @@ const De = ee("admin-theme", () => {
|
|
|
148
148
|
_: 1
|
|
149
149
|
}));
|
|
150
150
|
}
|
|
151
|
-
}),
|
|
151
|
+
}), Xe = ae("admin-notifications", () => {
|
|
152
152
|
const e = E([]), t = E(0), n = E(!1), o = E("all"), a = E(null), l = p(() => t.value > 0);
|
|
153
|
-
function i(
|
|
154
|
-
t.value =
|
|
153
|
+
function i(A) {
|
|
154
|
+
t.value = A.unread_notifications_count;
|
|
155
155
|
}
|
|
156
|
-
async function u(
|
|
156
|
+
async function u(A = "all", R = 1) {
|
|
157
157
|
n.value = !0;
|
|
158
158
|
try {
|
|
159
|
-
const g = await W().get(`/notifications/list?type=${
|
|
159
|
+
const g = await W().get(`/notifications/list?type=${A}&page=${R}`);
|
|
160
160
|
e.value = g.data, t.value = g.meta.unread_count, a.value = {
|
|
161
161
|
page: g.meta.page,
|
|
162
162
|
per_page: g.meta.per_page,
|
|
163
163
|
total: g.meta.total,
|
|
164
164
|
last_page: g.meta.last_page
|
|
165
|
-
}, o.value =
|
|
165
|
+
}, o.value = A;
|
|
166
166
|
} finally {
|
|
167
167
|
n.value = !1;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
async function f() {
|
|
171
|
-
const
|
|
171
|
+
const R = await W().get(
|
|
172
172
|
"/notifications/unread"
|
|
173
173
|
);
|
|
174
|
-
t.value =
|
|
174
|
+
t.value = R.count, o.value === "unread" && (e.value = R.data);
|
|
175
175
|
}
|
|
176
|
-
async function v(
|
|
177
|
-
await W().post("/notifications/markAsRead", { id:
|
|
178
|
-
const _ = e.value.find((g) => g.id ===
|
|
176
|
+
async function v(A) {
|
|
177
|
+
await W().post("/notifications/markAsRead", { id: A });
|
|
178
|
+
const _ = e.value.find((g) => g.id === A);
|
|
179
179
|
_ && _.read_at === null && (_.read_at = (/* @__PURE__ */ new Date()).toISOString(), t.value = Math.max(0, t.value - 1));
|
|
180
180
|
}
|
|
181
181
|
async function b() {
|
|
182
182
|
await W().post("/notifications/markAllAsRead");
|
|
183
|
-
const
|
|
183
|
+
const R = (/* @__PURE__ */ new Date()).toISOString();
|
|
184
184
|
for (const _ of e.value)
|
|
185
|
-
_.read_at === null && (_.read_at =
|
|
185
|
+
_.read_at === null && (_.read_at = R);
|
|
186
186
|
t.value = 0;
|
|
187
187
|
}
|
|
188
|
-
async function S(
|
|
189
|
-
await W().post("/notifications/destroy", { id:
|
|
190
|
-
const _ = e.value.findIndex((g) => g.id ===
|
|
188
|
+
async function S(A) {
|
|
189
|
+
await W().post("/notifications/destroy", { id: A });
|
|
190
|
+
const _ = e.value.findIndex((g) => g.id === A);
|
|
191
191
|
if (_ !== -1) {
|
|
192
192
|
const g = e.value[_].read_at === null;
|
|
193
193
|
e.value.splice(_, 1), g && (t.value = Math.max(0, t.value - 1));
|
|
@@ -207,14 +207,14 @@ const De = ee("admin-theme", () => {
|
|
|
207
207
|
markAllAsRead: b,
|
|
208
208
|
destroy: S
|
|
209
209
|
};
|
|
210
|
-
}),
|
|
210
|
+
}), an = ["title"], ln = /* @__PURE__ */ L({
|
|
211
211
|
__name: "NotificationBell",
|
|
212
212
|
setup(e) {
|
|
213
|
-
const t =
|
|
213
|
+
const t = Xe(), n = p(() => {
|
|
214
214
|
const o = t.unreadCount;
|
|
215
215
|
return o <= 0 ? null : o > 99 ? "99+" : String(o);
|
|
216
216
|
});
|
|
217
|
-
return (o, a) => (s(), w(r(
|
|
217
|
+
return (o, a) => (s(), w(r(Ut), {
|
|
218
218
|
to: "/notifications",
|
|
219
219
|
class: "admin-topbar__icon-btn",
|
|
220
220
|
"aria-label": "Уведомления"
|
|
@@ -228,13 +228,13 @@ const De = ee("admin-theme", () => {
|
|
|
228
228
|
key: 0,
|
|
229
229
|
class: "admin-topbar__bell-badge",
|
|
230
230
|
title: `Непрочитанных: ${r(t).unreadCount}`
|
|
231
|
-
}, h(n.value), 9,
|
|
231
|
+
}, h(n.value), 9, an)) : F("", !0)
|
|
232
232
|
]),
|
|
233
233
|
_: 1
|
|
234
234
|
}));
|
|
235
235
|
}
|
|
236
236
|
});
|
|
237
|
-
class
|
|
237
|
+
class Z extends Error {
|
|
238
238
|
status;
|
|
239
239
|
errorKey;
|
|
240
240
|
payload;
|
|
@@ -242,22 +242,22 @@ class Q extends Error {
|
|
|
242
242
|
super(n.message ?? `API error ${t}`), this.name = "ApiError", this.status = t, this.errorKey = n.errorKey ?? "unknown", this.payload = n;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
class
|
|
245
|
+
class vt extends Z {
|
|
246
246
|
constructor(t) {
|
|
247
247
|
super(401, t), this.name = "UnauthenticatedError";
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
class
|
|
250
|
+
class sn extends Z {
|
|
251
251
|
constructor(t) {
|
|
252
252
|
super(403, t), this.name = "ForbiddenError";
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
class
|
|
255
|
+
class on extends Z {
|
|
256
256
|
constructor(t) {
|
|
257
257
|
super(404, t), this.name = "NotFoundError";
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
class
|
|
260
|
+
class Le extends Z {
|
|
261
261
|
/** Field-keyed map of error messages. */
|
|
262
262
|
fields;
|
|
263
263
|
constructor(t) {
|
|
@@ -271,26 +271,26 @@ class Re extends Q {
|
|
|
271
271
|
return null;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
class
|
|
274
|
+
class Pe extends Error {
|
|
275
275
|
constructor(t = "Network error") {
|
|
276
276
|
super(t), this.name = "NetworkError";
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Ye(e, t) {
|
|
280
280
|
switch (e) {
|
|
281
281
|
case 401:
|
|
282
|
-
return new
|
|
282
|
+
return new vt(t);
|
|
283
283
|
case 403:
|
|
284
|
-
return new
|
|
284
|
+
return new sn(t);
|
|
285
285
|
case 404:
|
|
286
|
-
return new
|
|
286
|
+
return new on(t);
|
|
287
287
|
case 422:
|
|
288
|
-
return new
|
|
288
|
+
return new Le(t);
|
|
289
289
|
default:
|
|
290
|
-
return new
|
|
290
|
+
return new Z(e, t);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
const
|
|
293
|
+
const J = ae("admin-auth", () => {
|
|
294
294
|
const e = E(null), t = E([]), n = E(null), o = p(() => e.value !== null), a = p(() => n.value !== null);
|
|
295
295
|
function l(_) {
|
|
296
296
|
e.value = _.user, t.value = _.permissions;
|
|
@@ -317,7 +317,7 @@ const X = ee("admin-auth", () => {
|
|
|
317
317
|
);
|
|
318
318
|
return U?.user && (e.value = U.user), Array.isArray(U?.permissions) && (t.value = U.permissions), n.value = null, "authenticated";
|
|
319
319
|
} catch (U) {
|
|
320
|
-
if (U instanceof
|
|
320
|
+
if (U instanceof Z && U.errorKey === "two_factor_required") {
|
|
321
321
|
const P = U.payload.challenge_token;
|
|
322
322
|
return n.value = {
|
|
323
323
|
challengeToken: typeof P == "string" ? P : "",
|
|
@@ -345,10 +345,10 @@ const X = ee("admin-auth", () => {
|
|
|
345
345
|
});
|
|
346
346
|
return e.value = U.user, n.value = null, { remaining: U.recovery_codes_remaining };
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function A() {
|
|
349
349
|
n.value = null;
|
|
350
350
|
}
|
|
351
|
-
async function
|
|
351
|
+
async function R() {
|
|
352
352
|
const _ = W();
|
|
353
353
|
try {
|
|
354
354
|
await _.post("/auth/logout");
|
|
@@ -372,19 +372,19 @@ const X = ee("admin-auth", () => {
|
|
|
372
372
|
login: v,
|
|
373
373
|
twoFactorChallenge: b,
|
|
374
374
|
twoFactorRecovery: S,
|
|
375
|
-
cancelChallenge:
|
|
376
|
-
logout:
|
|
375
|
+
cancelChallenge: A,
|
|
376
|
+
logout: R
|
|
377
377
|
};
|
|
378
|
-
}),
|
|
378
|
+
}), rn = {
|
|
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
|
+
}, un = /* @__PURE__ */ L({
|
|
385
385
|
__name: "UserMenu",
|
|
386
386
|
setup(e) {
|
|
387
|
-
const t =
|
|
387
|
+
const t = J(), n = le();
|
|
388
388
|
async function o() {
|
|
389
389
|
try {
|
|
390
390
|
await t.logout();
|
|
@@ -395,10 +395,10 @@ const X = ee("admin-auth", () => {
|
|
|
395
395
|
function a() {
|
|
396
396
|
n.push({ name: "admin.profile" });
|
|
397
397
|
}
|
|
398
|
-
return (l, i) => (s(), w(r(
|
|
398
|
+
return (l, i) => (s(), w(r(ot), null, {
|
|
399
399
|
trigger: m(() => [
|
|
400
|
-
d("button",
|
|
401
|
-
x(r(
|
|
400
|
+
d("button", rn, [
|
|
401
|
+
x(r(rt), {
|
|
402
402
|
src: r(t).user?.avatar ?? void 0,
|
|
403
403
|
name: r(t).user?.name ?? "?",
|
|
404
404
|
alt: r(t).user?.name ?? "User",
|
|
@@ -407,14 +407,14 @@ const X = ee("admin-auth", () => {
|
|
|
407
407
|
])
|
|
408
408
|
]),
|
|
409
409
|
default: m(() => [
|
|
410
|
-
x(r(
|
|
410
|
+
x(r(De), { onClick: a }, {
|
|
411
411
|
default: m(() => [...i[0] || (i[0] = [
|
|
412
412
|
C("Профиль", -1)
|
|
413
413
|
])]),
|
|
414
414
|
_: 1
|
|
415
415
|
}),
|
|
416
|
-
x(r(
|
|
417
|
-
x(r(
|
|
416
|
+
x(r(Ft)),
|
|
417
|
+
x(r(De), {
|
|
418
418
|
variant: "danger",
|
|
419
419
|
onClick: o
|
|
420
420
|
}, {
|
|
@@ -427,10 +427,10 @@ const X = ee("admin-auth", () => {
|
|
|
427
427
|
_: 1
|
|
428
428
|
}));
|
|
429
429
|
}
|
|
430
|
-
}),
|
|
430
|
+
}), dn = { class: "admin-topbar" }, cn = { class: "admin-topbar__breadcrumbs" }, mn = {
|
|
431
431
|
key: 0,
|
|
432
432
|
class: "sep"
|
|
433
|
-
},
|
|
433
|
+
}, fn = /* @__PURE__ */ L({
|
|
434
434
|
__name: "AdminTopBar",
|
|
435
435
|
props: {
|
|
436
436
|
breadcrumbs: { default: () => [] },
|
|
@@ -439,7 +439,7 @@ const X = ee("admin-auth", () => {
|
|
|
439
439
|
emits: ["toggle-sidebar"],
|
|
440
440
|
setup(e, { emit: t }) {
|
|
441
441
|
const n = e, o = t, a = p(() => n.breadcrumbs.length - 1);
|
|
442
|
-
return (l, i) => (s(), c("header",
|
|
442
|
+
return (l, i) => (s(), c("header", dn, [
|
|
443
443
|
e.showCollapseToggle ? (s(), c("button", {
|
|
444
444
|
key: 0,
|
|
445
445
|
type: "button",
|
|
@@ -452,13 +452,13 @@ const X = ee("admin-auth", () => {
|
|
|
452
452
|
"data-icon": "panel-left"
|
|
453
453
|
}, null, -1)
|
|
454
454
|
])])) : F("", !0),
|
|
455
|
-
d("div",
|
|
455
|
+
d("div", cn, [
|
|
456
456
|
H(l.$slots, "breadcrumbs", {}, () => [
|
|
457
457
|
(s(!0), c(T, null, I(e.breadcrumbs, (u, f) => (s(), c(T, { key: f }, [
|
|
458
|
-
f > 0 ? (s(), c("span",
|
|
459
|
-
(s(), w(
|
|
458
|
+
f > 0 ? (s(), c("span", mn, "›")) : F("", !0),
|
|
459
|
+
(s(), w(ue(u.to ? "a" : "span"), {
|
|
460
460
|
href: typeof u.to == "string" ? u.to : void 0,
|
|
461
|
-
class:
|
|
461
|
+
class: Y(f === a.value ? "cur" : "")
|
|
462
462
|
}, {
|
|
463
463
|
default: m(() => [
|
|
464
464
|
C(h(u.label), 1)
|
|
@@ -484,33 +484,33 @@ const X = ee("admin-auth", () => {
|
|
|
484
484
|
], -1))
|
|
485
485
|
]),
|
|
486
486
|
H(l.$slots, "actions"),
|
|
487
|
-
x(
|
|
488
|
-
x(
|
|
489
|
-
x(
|
|
490
|
-
x(
|
|
487
|
+
x(ln),
|
|
488
|
+
x(mt),
|
|
489
|
+
x(ft),
|
|
490
|
+
x(un)
|
|
491
491
|
]));
|
|
492
492
|
}
|
|
493
|
-
}),
|
|
493
|
+
}), vn = ae("admin-menu", () => {
|
|
494
494
|
const e = E([]), t = E(!1), n = E(null), o = E(!1), a = p(() => {
|
|
495
|
-
const v =
|
|
495
|
+
const v = J(), b = (S) => {
|
|
496
496
|
if (Array.isArray(S.permissions) && S.permissions.length > 0 && !v.hasAnyPermission(S.permissions))
|
|
497
497
|
return null;
|
|
498
|
-
const
|
|
499
|
-
return { ...S, children:
|
|
498
|
+
const A = (S.children ?? []).map(b).filter((R) => R !== null);
|
|
499
|
+
return { ...S, children: A };
|
|
500
500
|
};
|
|
501
501
|
return e.value.map(b).filter((S) => S !== null);
|
|
502
502
|
}), l = p(() => {
|
|
503
503
|
const v = /* @__PURE__ */ new Map();
|
|
504
504
|
for (const S of a.value) {
|
|
505
|
-
const
|
|
506
|
-
v.has(
|
|
505
|
+
const A = S.group ?? null;
|
|
506
|
+
v.has(A) || v.set(A, []), v.get(A).push(S);
|
|
507
507
|
}
|
|
508
508
|
const b = [];
|
|
509
|
-
for (const [S,
|
|
510
|
-
|
|
511
|
-
const g = (
|
|
512
|
-
return g !== 0 ? g :
|
|
513
|
-
}), b.push({ group: S, items:
|
|
509
|
+
for (const [S, A] of v)
|
|
510
|
+
A.sort((R, _) => {
|
|
511
|
+
const g = (R.order ?? 0) - (_.order ?? 0);
|
|
512
|
+
return g !== 0 ? g : R.label.localeCompare(_.label);
|
|
513
|
+
}), b.push({ group: S, items: A });
|
|
514
514
|
return b;
|
|
515
515
|
});
|
|
516
516
|
async function i(v = !1) {
|
|
@@ -542,16 +542,16 @@ const X = ee("admin-auth", () => {
|
|
|
542
542
|
setItems: u,
|
|
543
543
|
reset: f
|
|
544
544
|
};
|
|
545
|
-
}),
|
|
545
|
+
}), pn = { class: "admin-sidebar-brand" }, gn = { class: "admin-sidebar-brand__mark" }, hn = {
|
|
546
546
|
key: 0,
|
|
547
547
|
class: "admin-sidebar-brand__name"
|
|
548
|
-
},
|
|
548
|
+
}, _n = {
|
|
549
549
|
key: 0,
|
|
550
550
|
class: "admin-sidebar-tenant"
|
|
551
|
-
},
|
|
551
|
+
}, yn = { class: "admin-sidebar-foot" }, bn = {
|
|
552
552
|
key: 0,
|
|
553
553
|
class: "admin-sidebar-foot__text"
|
|
554
|
-
},
|
|
554
|
+
}, kn = ["href"], wn = /* @__PURE__ */ L({
|
|
555
555
|
__name: "AdminSidebar",
|
|
556
556
|
props: {
|
|
557
557
|
collapsed: { type: Boolean, default: !1 },
|
|
@@ -562,41 +562,41 @@ const X = ee("admin-auth", () => {
|
|
|
562
562
|
docsUrl: { default: null }
|
|
563
563
|
},
|
|
564
564
|
setup(e) {
|
|
565
|
-
const t =
|
|
565
|
+
const t = vn(), n = _e(), o = p(() => t.groupedItems);
|
|
566
566
|
function a(u) {
|
|
567
567
|
return !!(u.routeName && n.name === u.routeName || u.url && n.path === u.url);
|
|
568
568
|
}
|
|
569
569
|
function l(u) {
|
|
570
570
|
if (u)
|
|
571
|
-
return () =>
|
|
571
|
+
return () => wt("span", { class: "admin-sidebar__icon", "data-icon": u });
|
|
572
572
|
}
|
|
573
573
|
function i(u) {
|
|
574
574
|
if (u.routeName) return { name: u.routeName };
|
|
575
575
|
if (u.url) return u.url;
|
|
576
576
|
}
|
|
577
|
-
return (u, f) => (s(), w(r(
|
|
577
|
+
return (u, f) => (s(), w(r(Lt), { collapsed: e.collapsed }, qe({
|
|
578
578
|
header: m(() => [
|
|
579
|
-
d("div",
|
|
580
|
-
d("div",
|
|
581
|
-
e.collapsed ? F("", !0) : (s(), c("div",
|
|
579
|
+
d("div", pn, [
|
|
580
|
+
d("div", gn, h(e.brandMark), 1),
|
|
581
|
+
e.collapsed ? F("", !0) : (s(), c("div", hn, h(e.brandName), 1))
|
|
582
582
|
]),
|
|
583
|
-
e.tenant && !e.collapsed ? (s(), c("div",
|
|
583
|
+
e.tenant && !e.collapsed ? (s(), c("div", _n, [
|
|
584
584
|
d("span", null, h(e.tenant.label), 1),
|
|
585
585
|
d("b", null, h(e.tenant.name), 1)
|
|
586
586
|
])) : F("", !0)
|
|
587
587
|
]),
|
|
588
588
|
nav: m(() => [
|
|
589
|
-
(s(!0), c(T, null, I(o.value, (v, b) => (s(), w(r(
|
|
589
|
+
(s(!0), c(T, null, I(o.value, (v, b) => (s(), w(r(Pt), {
|
|
590
590
|
key: `grp-${b}`,
|
|
591
591
|
title: v.group ?? void 0
|
|
592
592
|
}, {
|
|
593
593
|
default: m(() => [
|
|
594
|
-
(s(!0), c(T, null, I(v.items, (S) => (s(), w(r(
|
|
594
|
+
(s(!0), c(T, null, I(v.items, (S) => (s(), w(r(Tt), {
|
|
595
595
|
key: S.key,
|
|
596
596
|
to: i(S),
|
|
597
597
|
active: a(S),
|
|
598
598
|
badge: S.badge ?? void 0
|
|
599
|
-
},
|
|
599
|
+
}, qe({
|
|
600
600
|
default: m(() => [
|
|
601
601
|
C(" " + h(S.label), 1)
|
|
602
602
|
]),
|
|
@@ -605,7 +605,7 @@ const X = ee("admin-auth", () => {
|
|
|
605
605
|
S.icon ? {
|
|
606
606
|
name: "icon",
|
|
607
607
|
fn: m(() => [
|
|
608
|
-
(s(), w(
|
|
608
|
+
(s(), w(ue(l(S.icon))))
|
|
609
609
|
]),
|
|
610
610
|
key: "0"
|
|
611
611
|
} : void 0
|
|
@@ -619,24 +619,24 @@ const X = ee("admin-auth", () => {
|
|
|
619
619
|
e.version || e.docsUrl ? {
|
|
620
620
|
name: "footer",
|
|
621
621
|
fn: m(() => [
|
|
622
|
-
d("div",
|
|
623
|
-
e.version ? (s(), c("span",
|
|
622
|
+
d("div", yn, [
|
|
623
|
+
e.version ? (s(), c("span", bn, h(e.version), 1)) : F("", !0),
|
|
624
624
|
e.docsUrl ? (s(), 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,
|
|
628
|
+
}, " Docs ", 8, kn)) : F("", !0)
|
|
629
629
|
])
|
|
630
630
|
]),
|
|
631
631
|
key: "0"
|
|
632
632
|
} : void 0
|
|
633
633
|
]), 1032, ["collapsed"]));
|
|
634
634
|
}
|
|
635
|
-
}),
|
|
635
|
+
}), $n = { class: "admin-shell-root" }, xn = {
|
|
636
636
|
key: 0,
|
|
637
637
|
class: "admin-impersonation-banner",
|
|
638
638
|
role: "status"
|
|
639
|
-
},
|
|
639
|
+
}, Be = "data-admin-impersonating", Cn = /* @__PURE__ */ L({
|
|
640
640
|
__name: "AdminShell",
|
|
641
641
|
props: {
|
|
642
642
|
collapsed: { type: Boolean, default: !1 },
|
|
@@ -651,16 +651,16 @@ const X = ee("admin-auth", () => {
|
|
|
651
651
|
function l() {
|
|
652
652
|
o("exit-impersonation");
|
|
653
653
|
}
|
|
654
|
-
return
|
|
654
|
+
return ne(
|
|
655
655
|
() => n.impersonation,
|
|
656
656
|
(i) => {
|
|
657
|
-
typeof document > "u" || (i !== null ? document.documentElement.setAttribute(
|
|
657
|
+
typeof document > "u" || (i !== null ? document.documentElement.setAttribute(Be, "true") : document.documentElement.removeAttribute(Be));
|
|
658
658
|
},
|
|
659
659
|
{ immediate: !0 }
|
|
660
|
-
),
|
|
661
|
-
typeof document < "u" && document.documentElement.removeAttribute(
|
|
662
|
-
}), (i, u) => (s(), c("div",
|
|
663
|
-
e.impersonation ? (s(), c("div",
|
|
660
|
+
), $t(() => {
|
|
661
|
+
typeof document < "u" && document.documentElement.removeAttribute(Be);
|
|
662
|
+
}), (i, u) => (s(), c("div", $n, [
|
|
663
|
+
e.impersonation ? (s(), c("div", xn, [
|
|
664
664
|
d("span", null, [
|
|
665
665
|
u[1] || (u[1] = C(" Вы вошли как ", -1)),
|
|
666
666
|
d("b", null, h(e.impersonation.asName), 1),
|
|
@@ -672,18 +672,18 @@ const X = ee("admin-auth", () => {
|
|
|
672
672
|
onClick: l
|
|
673
673
|
}, " Выйти из режима ")
|
|
674
674
|
])) : F("", !0),
|
|
675
|
-
x(r(
|
|
675
|
+
x(r(Mt), {
|
|
676
676
|
"model-value": e.collapsed,
|
|
677
677
|
"onUpdate:modelValue": a
|
|
678
678
|
}, {
|
|
679
679
|
sidebar: m(() => [
|
|
680
680
|
H(i.$slots, "sidebar", {}, () => [
|
|
681
|
-
x(
|
|
681
|
+
x(wn, { collapsed: e.collapsed }, null, 8, ["collapsed"])
|
|
682
682
|
])
|
|
683
683
|
]),
|
|
684
684
|
header: m(() => [
|
|
685
685
|
H(i.$slots, "topbar", {}, () => [
|
|
686
|
-
x(
|
|
686
|
+
x(fn, {
|
|
687
687
|
onToggleSidebar: u[0] || (u[0] = (f) => a(!e.collapsed))
|
|
688
688
|
})
|
|
689
689
|
])
|
|
@@ -695,13 +695,13 @@ const X = ee("admin-auth", () => {
|
|
|
695
695
|
}, 8, ["model-value"])
|
|
696
696
|
]));
|
|
697
697
|
}
|
|
698
|
-
}),
|
|
698
|
+
}), Sn = /* @__PURE__ */ L({
|
|
699
699
|
__name: "AdminApp",
|
|
700
700
|
setup(e) {
|
|
701
|
-
const t =
|
|
701
|
+
const t = _e(), n = p(() => !(t.meta?.fullscreen === !0 || t.meta?.kind === "auth" || t.name === "admin.notFound"));
|
|
702
702
|
return (o, a) => {
|
|
703
|
-
const l =
|
|
704
|
-
return n.value ? (s(), w(
|
|
703
|
+
const l = lt("router-view");
|
|
704
|
+
return n.value ? (s(), w(Cn, { key: 0 }, {
|
|
705
705
|
default: m(() => [
|
|
706
706
|
x(l)
|
|
707
707
|
]),
|
|
@@ -709,7 +709,7 @@ const X = ee("admin-auth", () => {
|
|
|
709
709
|
})) : (s(), w(l, { key: 1 }));
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
}),
|
|
712
|
+
}), se = ae("admin-manifest", () => {
|
|
713
713
|
const e = E(null), t = E(!1), n = E(null), o = p(() => e.value !== null), a = p(() => e.value?.version ?? null), l = p(() => e.value?.resources ?? []), i = p(() => e.value?.screens ?? []), u = p(() => e.value?.settings ?? []), f = p(() => e.value?.plugins ?? []);
|
|
714
714
|
function v(_) {
|
|
715
715
|
return l.value.find((g) => g.slug === _) ?? null;
|
|
@@ -720,7 +720,7 @@ const X = ee("admin-auth", () => {
|
|
|
720
720
|
function S(_) {
|
|
721
721
|
return u.value.find((g) => g.slug === _) ?? null;
|
|
722
722
|
}
|
|
723
|
-
async function
|
|
723
|
+
async function A(_ = !1) {
|
|
724
724
|
if (e.value !== null && !_)
|
|
725
725
|
return e.value;
|
|
726
726
|
t.value = !0, n.value = null;
|
|
@@ -733,7 +733,7 @@ const X = ee("admin-auth", () => {
|
|
|
733
733
|
t.value = !1;
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function R() {
|
|
737
737
|
e.value = null, n.value = null, t.value = !1;
|
|
738
738
|
}
|
|
739
739
|
return {
|
|
@@ -752,30 +752,30 @@ const X = ee("admin-auth", () => {
|
|
|
752
752
|
getResource: v,
|
|
753
753
|
getScreen: b,
|
|
754
754
|
getSettings: S,
|
|
755
|
-
load:
|
|
756
|
-
reset:
|
|
755
|
+
load: A,
|
|
756
|
+
reset: R
|
|
757
757
|
};
|
|
758
|
-
}),
|
|
758
|
+
}), An = { class: "admin-home" }, Rn = { class: "admin-home__title" }, Un = {
|
|
759
759
|
key: 0,
|
|
760
760
|
class: "admin-home__resources"
|
|
761
|
-
},
|
|
761
|
+
}, En = { class: "admin-home__grid" }, Fn = ["onClick"], Ln = { class: "admin-home__card-label" }, Pn = { class: "admin-home__card-slug" }, Tn = /* @__PURE__ */ L({
|
|
762
762
|
__name: "HomePage",
|
|
763
763
|
setup(e) {
|
|
764
|
-
const t =
|
|
765
|
-
return (i, u) => (s(), c("div",
|
|
764
|
+
const t = se(), n = J(), o = le(), a = p(() => n.user?.name ?? ""), l = p(() => t.manifest?.resources ?? []);
|
|
765
|
+
return (i, u) => (s(), c("div", An, [
|
|
766
766
|
x(r(q), {
|
|
767
767
|
padding: "lg",
|
|
768
768
|
class: "admin-home__hero"
|
|
769
769
|
}, {
|
|
770
770
|
default: m(() => [
|
|
771
|
-
d("h1",
|
|
771
|
+
d("h1", Rn, "Добро пожаловать" + h(a.value ? ", " + a.value : ""), 1),
|
|
772
772
|
u[0] || (u[0] = d("p", { class: "admin-home__lead" }, " Админ-панель готова. Воспользуйтесь сайдбаром или переходите к ресурсам ниже. ", -1))
|
|
773
773
|
]),
|
|
774
774
|
_: 1
|
|
775
775
|
}),
|
|
776
|
-
l.value.length ? (s(), c("section",
|
|
776
|
+
l.value.length ? (s(), c("section", Un, [
|
|
777
777
|
u[1] || (u[1] = d("h2", { class: "admin-home__heading" }, "Ресурсы", -1)),
|
|
778
|
-
d("ul",
|
|
778
|
+
d("ul", En, [
|
|
779
779
|
(s(!0), c(T, null, I(l.value, (f) => (s(), c("li", {
|
|
780
780
|
key: f.slug
|
|
781
781
|
}, [
|
|
@@ -784,19 +784,19 @@ const X = ee("admin-auth", () => {
|
|
|
784
784
|
class: "admin-home__card",
|
|
785
785
|
onClick: (v) => r(o).push({ name: `admin.resource.${f.slug}.index` })
|
|
786
786
|
}, [
|
|
787
|
-
d("span",
|
|
788
|
-
d("span",
|
|
789
|
-
], 8,
|
|
787
|
+
d("span", Ln, h(f.label), 1),
|
|
788
|
+
d("span", Pn, h(f.slug), 1)
|
|
789
|
+
], 8, Fn)
|
|
790
790
|
]))), 128))
|
|
791
791
|
])
|
|
792
792
|
])) : F("", !0)
|
|
793
793
|
]));
|
|
794
794
|
}
|
|
795
|
-
}),
|
|
795
|
+
}), Mn = { class: "admin-status-page" }, Nn = /* @__PURE__ */ L({
|
|
796
796
|
__name: "ForbiddenPage",
|
|
797
797
|
setup(e) {
|
|
798
|
-
const t =
|
|
799
|
-
return (n, o) => (s(), c("div",
|
|
798
|
+
const t = le();
|
|
799
|
+
return (n, o) => (s(), c("div", Mn, [
|
|
800
800
|
x(r(q), {
|
|
801
801
|
padding: "lg",
|
|
802
802
|
class: "admin-status-page__card"
|
|
@@ -818,11 +818,11 @@ const X = ee("admin-auth", () => {
|
|
|
818
818
|
})
|
|
819
819
|
]));
|
|
820
820
|
}
|
|
821
|
-
}),
|
|
821
|
+
}), In = { class: "admin-status-page" }, Bn = /* @__PURE__ */ L({
|
|
822
822
|
__name: "NotFoundPage",
|
|
823
823
|
setup(e) {
|
|
824
|
-
const t =
|
|
825
|
-
return (n, o) => (s(), c("div",
|
|
824
|
+
const t = le();
|
|
825
|
+
return (n, o) => (s(), c("div", In, [
|
|
826
826
|
x(r(q), {
|
|
827
827
|
padding: "lg",
|
|
828
828
|
class: "admin-status-page__card"
|
|
@@ -844,38 +844,38 @@ const X = ee("admin-auth", () => {
|
|
|
844
844
|
})
|
|
845
845
|
]));
|
|
846
846
|
}
|
|
847
|
-
}),
|
|
847
|
+
}), Vn = { class: "admin-settings-page" }, zn = { class: "admin-settings-page__title" }, qn = {
|
|
848
848
|
key: 0,
|
|
849
849
|
class: "admin-settings-page__hint"
|
|
850
|
-
},
|
|
850
|
+
}, Dn = {
|
|
851
851
|
key: 1,
|
|
852
852
|
class: "admin-settings-page__debug"
|
|
853
|
-
},
|
|
853
|
+
}, On = /* @__PURE__ */ L({
|
|
854
854
|
__name: "SettingsPage",
|
|
855
855
|
setup(e) {
|
|
856
|
-
const t =
|
|
857
|
-
return (l, i) => (s(), c("div",
|
|
856
|
+
const t = _e(), n = se(), o = p(() => String(t.params.slug ?? "")), a = p(() => n.manifest?.settings?.find((l) => l.slug === o.value) ?? null);
|
|
857
|
+
return (l, i) => (s(), c("div", Vn, [
|
|
858
858
|
x(r(q), { padding: "lg" }, {
|
|
859
859
|
default: m(() => [
|
|
860
|
-
d("h1",
|
|
861
|
-
a.value ? (s(), c("pre",
|
|
860
|
+
d("h1", zn, h(a.value?.label ?? o.value), 1),
|
|
861
|
+
a.value ? (s(), c("pre", Dn, h(JSON.stringify(a.value.fields, null, 2)), 1)) : (s(), c("p", qn, " Settings «" + h(o.value) + "» не найдено в manifest'е. ", 1))
|
|
862
862
|
]),
|
|
863
863
|
_: 1
|
|
864
864
|
})
|
|
865
865
|
]));
|
|
866
866
|
}
|
|
867
|
-
}),
|
|
867
|
+
}), Wn = { class: "admin-status-page" }, jn = { class: "admin-status-page__title" }, Kn = { class: "admin-status-page__hint" }, Gn = /* @__PURE__ */ L({
|
|
868
868
|
__name: "UnknownScreenPage",
|
|
869
869
|
setup(e) {
|
|
870
|
-
const t =
|
|
871
|
-
return (a, l) => (s(), c("div",
|
|
870
|
+
const t = _e(), n = p(() => String(t.params.slug ?? "")), o = p(() => String(t.meta?.title ?? n.value));
|
|
871
|
+
return (a, l) => (s(), c("div", Wn, [
|
|
872
872
|
x(r(q), {
|
|
873
873
|
padding: "lg",
|
|
874
874
|
class: "admin-status-page__card"
|
|
875
875
|
}, {
|
|
876
876
|
default: m(() => [
|
|
877
|
-
d("h1",
|
|
878
|
-
d("p",
|
|
877
|
+
d("h1", jn, h(o.value), 1),
|
|
878
|
+
d("p", Kn, [
|
|
879
879
|
C(" Это заглушка для screen «" + h(n.value) + "». Передайте свой компонент через ", 1),
|
|
880
880
|
l[0] || (l[0] = d("code", null, "createAdminApp(" + h("{") + " pages: " + h("{") + " screen: MyScreen " + h("}") + " " + h("}") + ")", -1)),
|
|
881
881
|
l[1] || (l[1] = C(". ", -1))
|
|
@@ -885,10 +885,10 @@ const X = ee("admin-auth", () => {
|
|
|
885
885
|
})
|
|
886
886
|
]));
|
|
887
887
|
}
|
|
888
|
-
}),
|
|
888
|
+
}), Hn = { class: "admin-auth-card__row" }, Xn = ["href"], Jn = {
|
|
889
889
|
key: 1,
|
|
890
890
|
style: { "text-align": "center", "font-size": "var(--uid-font-size-xs)", color: "var(--uid-text-secondary)", "padding-top": "4px" }
|
|
891
|
-
},
|
|
891
|
+
}, Yn = ["href"], Qn = /* @__PURE__ */ L({
|
|
892
892
|
__name: "LoginForm",
|
|
893
893
|
props: {
|
|
894
894
|
forgotUrl: { default: null },
|
|
@@ -897,30 +897,30 @@ const X = ee("admin-auth", () => {
|
|
|
897
897
|
},
|
|
898
898
|
emits: ["success"],
|
|
899
899
|
setup(e, { emit: t }) {
|
|
900
|
-
const n = t, o =
|
|
901
|
-
async function
|
|
900
|
+
const n = t, o = J(), a = E(""), l = E(""), i = E(!1), u = E(!1), f = E(null), v = E({}), b = p(() => v.value.email?.[0]), S = p(() => v.value.password?.[0]);
|
|
901
|
+
async function A() {
|
|
902
902
|
if (!u.value) {
|
|
903
903
|
u.value = !0, f.value = null, v.value = {};
|
|
904
904
|
try {
|
|
905
|
-
const
|
|
905
|
+
const R = await o.login({
|
|
906
906
|
email: a.value,
|
|
907
907
|
password: l.value,
|
|
908
908
|
remember: i.value
|
|
909
909
|
});
|
|
910
|
-
n("success",
|
|
911
|
-
} catch (
|
|
912
|
-
|
|
910
|
+
n("success", R);
|
|
911
|
+
} catch (R) {
|
|
912
|
+
R instanceof Le ? (v.value = R.fields, f.value = R.firstFieldMessage()) : R instanceof Pe ? f.value = "Нет соединения с сервером" : R instanceof Z ? f.value = R.message || "Не удалось войти" : f.value = R.message;
|
|
913
913
|
} finally {
|
|
914
914
|
u.value = !1;
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
|
-
return (
|
|
918
|
+
return (R, _) => (s(), c("form", {
|
|
919
919
|
class: "admin-auth-card__bd",
|
|
920
920
|
novalidate: "",
|
|
921
|
-
onSubmit:
|
|
921
|
+
onSubmit: Oe(A, ["prevent"])
|
|
922
922
|
}, [
|
|
923
|
-
f.value ? (s(), w(r(
|
|
923
|
+
f.value ? (s(), w(r(Q), {
|
|
924
924
|
key: 0,
|
|
925
925
|
variant: "danger",
|
|
926
926
|
class: "admin-auth-card__alert",
|
|
@@ -931,7 +931,7 @@ const X = ee("admin-auth", () => {
|
|
|
931
931
|
]),
|
|
932
932
|
_: 1
|
|
933
933
|
})) : F("", !0),
|
|
934
|
-
x(r(
|
|
934
|
+
x(r(re), {
|
|
935
935
|
modelValue: a.value,
|
|
936
936
|
"onUpdate:modelValue": _[0] || (_[0] = (g) => a.value = g),
|
|
937
937
|
type: "email",
|
|
@@ -943,7 +943,7 @@ const X = ee("admin-auth", () => {
|
|
|
943
943
|
error: b.value,
|
|
944
944
|
name: "email"
|
|
945
945
|
}, null, 8, ["modelValue", "disabled", "error"]),
|
|
946
|
-
x(r(
|
|
946
|
+
x(r(re), {
|
|
947
947
|
modelValue: l.value,
|
|
948
948
|
"onUpdate:modelValue": _[1] || (_[1] = (g) => l.value = g),
|
|
949
949
|
type: "password",
|
|
@@ -954,8 +954,8 @@ const X = ee("admin-auth", () => {
|
|
|
954
954
|
error: S.value,
|
|
955
955
|
name: "password"
|
|
956
956
|
}, null, 8, ["modelValue", "disabled", "error"]),
|
|
957
|
-
d("div",
|
|
958
|
-
x(r(
|
|
957
|
+
d("div", Hn, [
|
|
958
|
+
x(r(Se), {
|
|
959
959
|
modelValue: i.value,
|
|
960
960
|
"onUpdate:modelValue": _[2] || (_[2] = (g) => i.value = g),
|
|
961
961
|
disabled: u.value
|
|
@@ -969,7 +969,7 @@ const X = ee("admin-auth", () => {
|
|
|
969
969
|
key: 0,
|
|
970
970
|
href: e.forgotUrl,
|
|
971
971
|
class: "admin-auth-card__link"
|
|
972
|
-
}, " Забыли пароль? ", 8,
|
|
972
|
+
}, " Забыли пароль? ", 8, Xn)) : F("", !0)
|
|
973
973
|
]),
|
|
974
974
|
x(r(B), {
|
|
975
975
|
type: "submit",
|
|
@@ -983,43 +983,43 @@ const X = ee("admin-auth", () => {
|
|
|
983
983
|
]),
|
|
984
984
|
_: 1
|
|
985
985
|
}, 8, ["loading", "disabled"]),
|
|
986
|
-
e.ssoLinkLabel && e.ssoUrl ? (s(), c("div",
|
|
986
|
+
e.ssoLinkLabel && e.ssoUrl ? (s(), c("div", Jn, [
|
|
987
987
|
_[4] || (_[4] = C(" или войдите через ", -1)),
|
|
988
988
|
d("a", {
|
|
989
989
|
href: e.ssoUrl,
|
|
990
990
|
class: "admin-auth-card__link"
|
|
991
|
-
}, h(e.ssoLinkLabel), 9,
|
|
991
|
+
}, h(e.ssoLinkLabel), 9, Yn)
|
|
992
992
|
])) : F("", !0)
|
|
993
993
|
], 32));
|
|
994
994
|
}
|
|
995
|
-
}),
|
|
995
|
+
}), Zn = ["value", "disabled", "aria-label", "onInput", "onKeydown"], ea = { class: "admin-auth-card__row" }, ta = /* @__PURE__ */ L({
|
|
996
996
|
__name: "TwoFactorForm",
|
|
997
997
|
emits: ["success", "cancel"],
|
|
998
998
|
setup(e, { emit: t }) {
|
|
999
|
-
const n = t, o =
|
|
1000
|
-
function
|
|
999
|
+
const n = t, o = J(), a = E("totp"), l = E(["", "", "", "", "", ""]), i = E(""), u = E([]), f = E(!1), v = E(null), b = E(null), S = p(() => l.value.join("")), A = p(() => a.value === "totp" ? S.value.length === 6 : i.value.trim().length > 0);
|
|
1000
|
+
function R($, V) {
|
|
1001
1001
|
V instanceof HTMLInputElement && (u.value[$] = V);
|
|
1002
1002
|
}
|
|
1003
1003
|
function _($, V) {
|
|
1004
|
-
const
|
|
1005
|
-
l.value[$] = D,
|
|
1004
|
+
const K = V.target, D = K.value.replace(/\D/g, "").slice(-1);
|
|
1005
|
+
l.value[$] = D, K.value = D, D && $ < l.value.length - 1 && Ie(() => u.value[$ + 1]?.focus()), S.value.length === l.value.length && P();
|
|
1006
1006
|
}
|
|
1007
1007
|
function g($, V) {
|
|
1008
|
-
V.key === "Backspace" && !l.value[$] && $ > 0 ?
|
|
1008
|
+
V.key === "Backspace" && !l.value[$] && $ > 0 ? Ie(() => u.value[$ - 1]?.focus()) : V.key === "ArrowLeft" && $ > 0 ? (u.value[$ - 1]?.focus(), V.preventDefault()) : V.key === "ArrowRight" && $ < l.value.length - 1 && (u.value[$ + 1]?.focus(), V.preventDefault());
|
|
1009
1009
|
}
|
|
1010
1010
|
function U($) {
|
|
1011
|
-
const
|
|
1012
|
-
if (
|
|
1011
|
+
const K = ($.clipboardData?.getData("text") ?? "").replace(/\D/g, "").slice(0, l.value.length);
|
|
1012
|
+
if (K.length !== 0) {
|
|
1013
1013
|
$.preventDefault();
|
|
1014
1014
|
for (let D = 0; D < l.value.length; D++)
|
|
1015
|
-
l.value[D] =
|
|
1016
|
-
|
|
1017
|
-
u.value[Math.min(
|
|
1015
|
+
l.value[D] = K[D] ?? "";
|
|
1016
|
+
Ie(() => {
|
|
1017
|
+
u.value[Math.min(K.length, l.value.length - 1)]?.focus(), K.length === l.value.length && P();
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
1021
|
async function P() {
|
|
1022
|
-
if (!(f.value || !
|
|
1022
|
+
if (!(f.value || !A.value)) {
|
|
1023
1023
|
f.value = !0, v.value = null;
|
|
1024
1024
|
try {
|
|
1025
1025
|
if (a.value === "totp")
|
|
@@ -1030,7 +1030,7 @@ const X = ee("admin-auth", () => {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
n("success");
|
|
1032
1032
|
} catch ($) {
|
|
1033
|
-
$ instanceof
|
|
1033
|
+
$ instanceof Le ? v.value = $.firstFieldMessage() ?? "Неверный код" : $ instanceof Pe ? v.value = "Нет соединения с сервером" : $ instanceof Z ? v.value = $.message || "Не удалось проверить код" : v.value = $.message;
|
|
1034
1034
|
} finally {
|
|
1035
1035
|
f.value = !1;
|
|
1036
1036
|
}
|
|
@@ -1045,9 +1045,9 @@ const X = ee("admin-auth", () => {
|
|
|
1045
1045
|
return ($, V) => (s(), c("form", {
|
|
1046
1046
|
class: "admin-auth-card__bd",
|
|
1047
1047
|
novalidate: "",
|
|
1048
|
-
onSubmit:
|
|
1048
|
+
onSubmit: Oe(P, ["prevent"])
|
|
1049
1049
|
}, [
|
|
1050
|
-
v.value ? (s(), w(r(
|
|
1050
|
+
v.value ? (s(), w(r(Q), {
|
|
1051
1051
|
key: 0,
|
|
1052
1052
|
variant: "danger",
|
|
1053
1053
|
class: "admin-auth-card__alert",
|
|
@@ -1058,7 +1058,7 @@ const X = ee("admin-auth", () => {
|
|
|
1058
1058
|
]),
|
|
1059
1059
|
_: 1
|
|
1060
1060
|
})) : F("", !0),
|
|
1061
|
-
b.value !== null ? (s(), w(r(
|
|
1061
|
+
b.value !== null ? (s(), w(r(Q), {
|
|
1062
1062
|
key: 1,
|
|
1063
1063
|
variant: "info",
|
|
1064
1064
|
class: "admin-auth-card__alert",
|
|
@@ -1074,10 +1074,10 @@ const X = ee("admin-auth", () => {
|
|
|
1074
1074
|
class: "admin-code-input",
|
|
1075
1075
|
onPaste: U
|
|
1076
1076
|
}, [
|
|
1077
|
-
(s(!0), c(T, null, I(l.value, (
|
|
1077
|
+
(s(!0), c(T, null, I(l.value, (K, D) => (s(), c("input", {
|
|
1078
1078
|
key: D,
|
|
1079
1079
|
ref_for: !0,
|
|
1080
|
-
ref: (M) =>
|
|
1080
|
+
ref: (M) => R(D, M),
|
|
1081
1081
|
value: l.value[D],
|
|
1082
1082
|
type: "text",
|
|
1083
1083
|
inputmode: "numeric",
|
|
@@ -1087,11 +1087,11 @@ const X = ee("admin-auth", () => {
|
|
|
1087
1087
|
"aria-label": `Цифра ${D + 1}`,
|
|
1088
1088
|
onInput: (M) => _(D, M),
|
|
1089
1089
|
onKeydown: (M) => g(D, M)
|
|
1090
|
-
}, null, 40,
|
|
1091
|
-
], 32)) : (s(), w(r(
|
|
1090
|
+
}, null, 40, Zn))), 128))
|
|
1091
|
+
], 32)) : (s(), w(r(re), {
|
|
1092
1092
|
key: 3,
|
|
1093
1093
|
modelValue: i.value,
|
|
1094
|
-
"onUpdate:modelValue": V[0] || (V[0] = (
|
|
1094
|
+
"onUpdate:modelValue": V[0] || (V[0] = (K) => i.value = K),
|
|
1095
1095
|
type: "text",
|
|
1096
1096
|
label: "Recovery-код",
|
|
1097
1097
|
autocomplete: "one-time-code",
|
|
@@ -1103,14 +1103,14 @@ const X = ee("admin-auth", () => {
|
|
|
1103
1103
|
variant: "primary",
|
|
1104
1104
|
size: "lg",
|
|
1105
1105
|
loading: f.value,
|
|
1106
|
-
disabled: f.value || !
|
|
1106
|
+
disabled: f.value || !A.value
|
|
1107
1107
|
}, {
|
|
1108
1108
|
default: m(() => [
|
|
1109
1109
|
C(h(f.value ? "Проверка…" : "Подтвердить"), 1)
|
|
1110
1110
|
]),
|
|
1111
1111
|
_: 1
|
|
1112
1112
|
}, 8, ["loading", "disabled"]),
|
|
1113
|
-
d("div",
|
|
1113
|
+
d("div", ea, [
|
|
1114
1114
|
d("button", {
|
|
1115
1115
|
type: "button",
|
|
1116
1116
|
class: "admin-auth-card__link",
|
|
@@ -1130,13 +1130,13 @@ const X = ee("admin-auth", () => {
|
|
|
1130
1130
|
])
|
|
1131
1131
|
], 32));
|
|
1132
1132
|
}
|
|
1133
|
-
}),
|
|
1133
|
+
}), na = { class: "admin-auth-page" }, aa = {
|
|
1134
1134
|
key: 0,
|
|
1135
1135
|
class: "admin-auth-page__corner"
|
|
1136
|
-
},
|
|
1136
|
+
}, la = { class: "admin-auth-card__hd" }, sa = ["src", "alt"], ia = {
|
|
1137
1137
|
key: 1,
|
|
1138
1138
|
"aria-hidden": "true"
|
|
1139
|
-
},
|
|
1139
|
+
}, oa = { key: 2 }, ra = { class: "admin-auth-card__title" }, ua = { class: "admin-auth-card__sub" }, da = /* @__PURE__ */ L({
|
|
1140
1140
|
__name: "LoginPage",
|
|
1141
1141
|
props: {
|
|
1142
1142
|
brandName: { default: "Laravel Admin" },
|
|
@@ -1150,7 +1150,7 @@ const X = ee("admin-auth", () => {
|
|
|
1150
1150
|
showCornerActions: { type: Boolean, default: !0 }
|
|
1151
1151
|
},
|
|
1152
1152
|
setup(e) {
|
|
1153
|
-
const t = e, n =
|
|
1153
|
+
const t = e, n = J(), o = le(), a = _e();
|
|
1154
1154
|
async function l() {
|
|
1155
1155
|
const i = a.query[t.redirectQueryKey];
|
|
1156
1156
|
if (typeof i == "string" && i.length > 0 && i.startsWith("/")) {
|
|
@@ -1159,41 +1159,41 @@ const X = ee("admin-auth", () => {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
await o.push({ name: t.homeRouteName });
|
|
1161
1161
|
}
|
|
1162
|
-
return
|
|
1162
|
+
return ne(
|
|
1163
1163
|
() => n.isAuthenticated,
|
|
1164
1164
|
(i) => {
|
|
1165
1165
|
i && l();
|
|
1166
1166
|
}
|
|
1167
|
-
),
|
|
1167
|
+
), Re(() => {
|
|
1168
1168
|
n.isAuthenticated && l();
|
|
1169
|
-
}), (i, u) => (s(), c("div",
|
|
1170
|
-
e.showCornerActions ? (s(), c("div",
|
|
1171
|
-
x(
|
|
1172
|
-
x(
|
|
1169
|
+
}), (i, u) => (s(), c("div", na, [
|
|
1170
|
+
e.showCornerActions ? (s(), c("div", aa, [
|
|
1171
|
+
x(mt),
|
|
1172
|
+
x(ft)
|
|
1173
1173
|
])) : F("", !0),
|
|
1174
1174
|
x(r(q), {
|
|
1175
|
-
class:
|
|
1175
|
+
class: Y(["admin-auth-card", r(n).isChallengePending ? "admin-auth-card--wide" : ""]),
|
|
1176
1176
|
padding: "none"
|
|
1177
1177
|
}, {
|
|
1178
1178
|
default: m(() => [
|
|
1179
|
-
d("div",
|
|
1179
|
+
d("div", la, [
|
|
1180
1180
|
d("div", {
|
|
1181
|
-
class:
|
|
1181
|
+
class: Y(["admin-auth-card__logo", r(n).isChallengePending ? "admin-auth-card__logo--accent" : ""])
|
|
1182
1182
|
}, [
|
|
1183
1183
|
e.brandLogo && !r(n).isChallengePending ? (s(), c("img", {
|
|
1184
1184
|
key: 0,
|
|
1185
1185
|
src: e.brandLogo,
|
|
1186
1186
|
alt: e.brandName
|
|
1187
|
-
}, null, 8,
|
|
1187
|
+
}, null, 8, sa)) : r(n).isChallengePending ? (s(), c("span", ia, "🛡")) : (s(), c("span", oa, h(e.brandMark), 1))
|
|
1188
1188
|
], 2),
|
|
1189
|
-
d("div",
|
|
1189
|
+
d("div", ra, [
|
|
1190
1190
|
r(n).isChallengePending ? (s(), c(T, { key: 0 }, [
|
|
1191
1191
|
C("Двухфакторная проверка")
|
|
1192
1192
|
], 64)) : (s(), c(T, { key: 1 }, [
|
|
1193
1193
|
C(h(e.brandName), 1)
|
|
1194
1194
|
], 64))
|
|
1195
1195
|
]),
|
|
1196
|
-
d("div",
|
|
1196
|
+
d("div", ua, [
|
|
1197
1197
|
r(n).isChallengePending ? (s(), c(T, { key: 0 }, [
|
|
1198
1198
|
C(" Введите 6-значный код из приложения-аутентификатора ")
|
|
1199
1199
|
], 64)) : (s(), c(T, { key: 1 }, [
|
|
@@ -1201,13 +1201,13 @@ const X = ee("admin-auth", () => {
|
|
|
1201
1201
|
], 64))
|
|
1202
1202
|
])
|
|
1203
1203
|
]),
|
|
1204
|
-
r(n).isChallengePending ? (s(), w(
|
|
1204
|
+
r(n).isChallengePending ? (s(), w(ta, {
|
|
1205
1205
|
key: 0,
|
|
1206
1206
|
onSuccess: u[0] || (u[0] = () => {
|
|
1207
1207
|
}),
|
|
1208
1208
|
onCancel: u[1] || (u[1] = () => {
|
|
1209
1209
|
})
|
|
1210
|
-
})) : (s(), w(
|
|
1210
|
+
})) : (s(), w(Qn, {
|
|
1211
1211
|
key: 1,
|
|
1212
1212
|
"forgot-url": e.forgotUrl,
|
|
1213
1213
|
"sso-link-label": e.ssoLinkLabel,
|
|
@@ -1220,8 +1220,8 @@ const X = ee("admin-auth", () => {
|
|
|
1220
1220
|
}, 8, ["class"])
|
|
1221
1221
|
]));
|
|
1222
1222
|
}
|
|
1223
|
-
}),
|
|
1224
|
-
const e = E(null), t = E([]), n = E({ ...
|
|
1223
|
+
}), Qe = { page: 1, per_page: 20, total: 0, last_page: 1 }, ca = ae("admin-resource-index", () => {
|
|
1224
|
+
const e = E(null), t = E([]), n = E({ ...Qe }), o = E(!1), a = E(null), l = E(""), i = E({}), u = E(null), f = E("asc"), v = E(/* @__PURE__ */ new Set()), b = p(() => !o.value && a.value === null && t.value.length === 0), S = p(() => v.value.size), A = p(() => v.value.size > 0), R = p(() => a.value !== null), _ = p(() => v.value.size === 0 || t.value.length === 0 ? "none" : t.value.every((z) => v.value.has(g(z))) ? "all" : "mixed");
|
|
1225
1225
|
function g(N) {
|
|
1226
1226
|
return N.id ?? N.key ?? "";
|
|
1227
1227
|
}
|
|
@@ -1229,28 +1229,28 @@ const X = ee("admin-auth", () => {
|
|
|
1229
1229
|
e.value !== N && (e.value = N, P());
|
|
1230
1230
|
}
|
|
1231
1231
|
function P() {
|
|
1232
|
-
t.value = [], n.value = { ...
|
|
1232
|
+
t.value = [], n.value = { ...Qe }, o.value = !1, a.value = null, l.value = "", i.value = {}, u.value = null, f.value = "asc", v.value = /* @__PURE__ */ new Set();
|
|
1233
1233
|
}
|
|
1234
1234
|
function k(N = {}) {
|
|
1235
1235
|
const z = {
|
|
1236
1236
|
page: N.page ?? n.value.page,
|
|
1237
1237
|
per_page: N.per_page ?? n.value.per_page
|
|
1238
|
-
},
|
|
1239
|
-
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1242
|
-
const
|
|
1243
|
-
for (const [
|
|
1244
|
-
|
|
1245
|
-
return Object.keys(
|
|
1238
|
+
}, ke = N.search ?? l.value;
|
|
1239
|
+
ke && (z.q = ke);
|
|
1240
|
+
const pe = N.sort ?? u.value;
|
|
1241
|
+
pe && (z.order = [{ column: pe, direction: N.direction ?? f.value }]);
|
|
1242
|
+
const bt = N.filters ?? i.value, Ne = {};
|
|
1243
|
+
for (const [kt, ie] of Object.entries(bt))
|
|
1244
|
+
ie == null || ie === "" || (Ne[kt] = Array.isArray(ie) ? ie.join(",") : ie);
|
|
1245
|
+
return Object.keys(Ne).length > 0 && (z.filters = Ne), z;
|
|
1246
1246
|
}
|
|
1247
1247
|
async function y(N = {}) {
|
|
1248
1248
|
if (!e.value)
|
|
1249
1249
|
throw new Error("useResourceIndexStore.load() called before setSlug()");
|
|
1250
1250
|
o.value = !0, a.value = null;
|
|
1251
1251
|
try {
|
|
1252
|
-
const z = W(),
|
|
1253
|
-
t.value =
|
|
1252
|
+
const z = W(), ke = k(N), pe = await z.post(`/${e.value}/search`, ke);
|
|
1253
|
+
t.value = pe.data, n.value = pe.meta;
|
|
1254
1254
|
} catch (z) {
|
|
1255
1255
|
throw a.value = z instanceof Error ? z : new Error(String(z)), z;
|
|
1256
1256
|
} finally {
|
|
@@ -1263,7 +1263,7 @@ const X = ee("admin-auth", () => {
|
|
|
1263
1263
|
async function V(N, z) {
|
|
1264
1264
|
z == null || z === "" ? delete i.value[N] : i.value[N] = z, n.value.page = 1, await y();
|
|
1265
1265
|
}
|
|
1266
|
-
async function
|
|
1266
|
+
async function K() {
|
|
1267
1267
|
i.value = {}, n.value.page = 1, await y();
|
|
1268
1268
|
}
|
|
1269
1269
|
async function D(N, z = "asc") {
|
|
@@ -1279,7 +1279,7 @@ const X = ee("admin-auth", () => {
|
|
|
1279
1279
|
const z = new Set(v.value);
|
|
1280
1280
|
z.has(N) ? z.delete(N) : z.add(N), v.value = z;
|
|
1281
1281
|
}
|
|
1282
|
-
function
|
|
1282
|
+
function j() {
|
|
1283
1283
|
if (_.value === "all") {
|
|
1284
1284
|
v.value = /* @__PURE__ */ new Set();
|
|
1285
1285
|
return;
|
|
@@ -1288,10 +1288,10 @@ const X = ee("admin-auth", () => {
|
|
|
1288
1288
|
for (const z of t.value) N.add(g(z));
|
|
1289
1289
|
v.value = N;
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1291
|
+
function ee() {
|
|
1292
1292
|
v.value = /* @__PURE__ */ new Set();
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function yt(N) {
|
|
1295
1295
|
return v.value.has(N);
|
|
1296
1296
|
}
|
|
1297
1297
|
return {
|
|
@@ -1308,8 +1308,8 @@ const X = ee("admin-auth", () => {
|
|
|
1308
1308
|
selection: v,
|
|
1309
1309
|
// getters
|
|
1310
1310
|
isEmpty: b,
|
|
1311
|
-
hasError:
|
|
1312
|
-
hasSelection:
|
|
1311
|
+
hasError: R,
|
|
1312
|
+
hasSelection: A,
|
|
1313
1313
|
selectedCount: S,
|
|
1314
1314
|
selectionState: _,
|
|
1315
1315
|
// actions
|
|
@@ -1318,36 +1318,36 @@ const X = ee("admin-auth", () => {
|
|
|
1318
1318
|
load: y,
|
|
1319
1319
|
setSearch: $,
|
|
1320
1320
|
setFilter: V,
|
|
1321
|
-
clearFilters:
|
|
1321
|
+
clearFilters: K,
|
|
1322
1322
|
setSort: D,
|
|
1323
1323
|
toggleSort: M,
|
|
1324
1324
|
setPage: O,
|
|
1325
1325
|
toggleRow: G,
|
|
1326
|
-
toggleAllOnPage:
|
|
1327
|
-
clearSelection:
|
|
1328
|
-
isSelected:
|
|
1326
|
+
toggleAllOnPage: j,
|
|
1327
|
+
clearSelection: ee,
|
|
1328
|
+
isSelected: yt,
|
|
1329
1329
|
rowId: g
|
|
1330
1330
|
};
|
|
1331
|
-
}),
|
|
1331
|
+
}), ma = { class: "admin-page admin-resource-index" }, fa = { class: "admin-page__hd" }, va = { class: "admin-page__title-wrap" }, pa = { class: "admin-page__title" }, ga = {
|
|
1332
1332
|
key: 0,
|
|
1333
1333
|
class: "admin-page__count"
|
|
1334
|
-
},
|
|
1334
|
+
}, ha = { class: "admin-page__actions" }, _a = {
|
|
1335
1335
|
key: 0,
|
|
1336
1336
|
class: "admin-bulk-toolbar",
|
|
1337
1337
|
role: "toolbar"
|
|
1338
|
-
},
|
|
1338
|
+
}, ya = { class: "admin-bulk-toolbar__count" }, ba = {
|
|
1339
1339
|
key: 1,
|
|
1340
1340
|
class: "admin-filter-bar"
|
|
1341
|
-
},
|
|
1341
|
+
}, ka = ["value"], wa = {
|
|
1342
1342
|
key: 2,
|
|
1343
1343
|
class: "admin-resource-index__loading"
|
|
1344
|
-
},
|
|
1344
|
+
}, $a = {
|
|
1345
1345
|
key: 5,
|
|
1346
1346
|
class: "admin-resource-index__table"
|
|
1347
|
-
},
|
|
1347
|
+
}, xa = { class: "admin-resource-index__select-header" }, Ca = { class: "admin-resource-index__select-overlay" }, Sa = ["onClick"], Aa = {
|
|
1348
1348
|
key: 6,
|
|
1349
1349
|
class: "admin-resource-index__footer"
|
|
1350
|
-
},
|
|
1350
|
+
}, Ra = /* @__PURE__ */ L({
|
|
1351
1351
|
__name: "ResourceIndexPage",
|
|
1352
1352
|
props: {
|
|
1353
1353
|
slug: {},
|
|
@@ -1358,7 +1358,7 @@ const X = ee("admin-auth", () => {
|
|
|
1358
1358
|
},
|
|
1359
1359
|
emits: ["bulk-action", "row-click"],
|
|
1360
1360
|
setup(e, { emit: t }) {
|
|
1361
|
-
const n = e, o = t, a =
|
|
1361
|
+
const n = e, o = t, a = ca(), l = se(), i = p(() => l.getResource(n.slug)), u = p(
|
|
1362
1362
|
() => n.title ?? i.value?.label ?? n.slug
|
|
1363
1363
|
), f = p(() => (i.value?.columns ?? []).map((k) => {
|
|
1364
1364
|
const y = k;
|
|
@@ -1373,11 +1373,11 @@ const X = ee("admin-auth", () => {
|
|
|
1373
1373
|
const P = a.meta.total;
|
|
1374
1374
|
return P === 0 ? "" : `${a.items.length} из ${P}`;
|
|
1375
1375
|
});
|
|
1376
|
-
|
|
1376
|
+
Re(async () => {
|
|
1377
1377
|
a.setSlug(n.slug), l.manifest === null && await l.load().catch(() => {
|
|
1378
1378
|
}), await a.load().catch(() => {
|
|
1379
1379
|
});
|
|
1380
|
-
}),
|
|
1380
|
+
}), ne(
|
|
1381
1381
|
() => n.slug,
|
|
1382
1382
|
async (P, k) => {
|
|
1383
1383
|
P !== k && (a.setSlug(P), await a.load().catch(() => {
|
|
@@ -1390,10 +1390,10 @@ const X = ee("admin-auth", () => {
|
|
|
1390
1390
|
async function S(P) {
|
|
1391
1391
|
await a.setPage(P);
|
|
1392
1392
|
}
|
|
1393
|
-
function
|
|
1393
|
+
function A() {
|
|
1394
1394
|
a.toggleAllOnPage();
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function R(P) {
|
|
1397
1397
|
a.toggleRow(P);
|
|
1398
1398
|
}
|
|
1399
1399
|
function _(P) {
|
|
@@ -1406,11 +1406,11 @@ const X = ee("admin-auth", () => {
|
|
|
1406
1406
|
await a.load().catch(() => {
|
|
1407
1407
|
});
|
|
1408
1408
|
}
|
|
1409
|
-
return (P, k) => (s(), c("section",
|
|
1410
|
-
d("header",
|
|
1411
|
-
d("div",
|
|
1412
|
-
d("h1",
|
|
1413
|
-
e.subtitle || v.value ? (s(), c("div",
|
|
1409
|
+
return (P, k) => (s(), c("section", ma, [
|
|
1410
|
+
d("header", fa, [
|
|
1411
|
+
d("div", va, [
|
|
1412
|
+
d("h1", pa, h(u.value), 1),
|
|
1413
|
+
e.subtitle || v.value ? (s(), c("div", ga, [
|
|
1414
1414
|
e.subtitle ? (s(), c(T, { key: 0 }, [
|
|
1415
1415
|
C(h(e.subtitle), 1)
|
|
1416
1416
|
], 64)) : F("", !0),
|
|
@@ -1422,7 +1422,7 @@ const X = ee("admin-auth", () => {
|
|
|
1422
1422
|
], 64)) : F("", !0)
|
|
1423
1423
|
])) : F("", !0)
|
|
1424
1424
|
]),
|
|
1425
|
-
d("div",
|
|
1425
|
+
d("div", ha, [
|
|
1426
1426
|
H(P.$slots, "actions"),
|
|
1427
1427
|
e.createRouteName ? (s(), w(r(B), {
|
|
1428
1428
|
key: 0,
|
|
@@ -1436,8 +1436,8 @@ const X = ee("admin-auth", () => {
|
|
|
1436
1436
|
})) : F("", !0)
|
|
1437
1437
|
])
|
|
1438
1438
|
]),
|
|
1439
|
-
r(a).hasSelection ? (s(), c("div",
|
|
1440
|
-
d("span",
|
|
1439
|
+
r(a).hasSelection ? (s(), c("div", _a, [
|
|
1440
|
+
d("span", ya, [
|
|
1441
1441
|
k[8] || (k[8] = C(" Выбрано ", -1)),
|
|
1442
1442
|
d("b", null, h(r(a).selectedCount), 1)
|
|
1443
1443
|
]),
|
|
@@ -1493,14 +1493,14 @@ const X = ee("admin-auth", () => {
|
|
|
1493
1493
|
])]),
|
|
1494
1494
|
_: 1
|
|
1495
1495
|
}, 8, ["onClick"])
|
|
1496
|
-
])) : (s(), c("div",
|
|
1496
|
+
])) : (s(), c("div", ba, [
|
|
1497
1497
|
d("input", {
|
|
1498
1498
|
value: r(a).search,
|
|
1499
1499
|
type: "search",
|
|
1500
1500
|
placeholder: "Поиск…",
|
|
1501
1501
|
class: "admin-filter-bar__search",
|
|
1502
|
-
onKeydown: k[5] || (k[5] =
|
|
1503
|
-
}, null, 40,
|
|
1502
|
+
onKeydown: k[5] || (k[5] = xt((y) => r(a).setSearch(y.target.value), ["enter"]))
|
|
1503
|
+
}, null, 40, ka),
|
|
1504
1504
|
H(P.$slots, "filters", {
|
|
1505
1505
|
filters: r(a).filters,
|
|
1506
1506
|
setFilter: r(a).setFilter
|
|
@@ -1518,12 +1518,12 @@ const X = ee("admin-auth", () => {
|
|
|
1518
1518
|
_: 1
|
|
1519
1519
|
}, 8, ["onClick"])) : F("", !0)
|
|
1520
1520
|
])),
|
|
1521
|
-
r(a).loading ? (s(), c("div",
|
|
1522
|
-
(s(), c(T, null, I(8, (y) => x(r(
|
|
1521
|
+
r(a).loading ? (s(), c("div", wa, [
|
|
1522
|
+
(s(), c(T, null, I(8, (y) => x(r(We), {
|
|
1523
1523
|
key: y,
|
|
1524
1524
|
height: "40px"
|
|
1525
1525
|
})), 64))
|
|
1526
|
-
])) : r(a).hasError ? (s(), w(r(
|
|
1526
|
+
])) : r(a).hasError ? (s(), w(r(Nt), {
|
|
1527
1527
|
key: 3,
|
|
1528
1528
|
title: "Не удалось загрузить данные",
|
|
1529
1529
|
description: r(a).error?.message ?? "Попробуйте обновить страницу.",
|
|
@@ -1541,7 +1541,7 @@ const X = ee("admin-auth", () => {
|
|
|
1541
1541
|
})
|
|
1542
1542
|
]),
|
|
1543
1543
|
_: 1
|
|
1544
|
-
}, 8, ["description"])) : r(a).isEmpty ? (s(), w(r(
|
|
1544
|
+
}, 8, ["description"])) : r(a).isEmpty ? (s(), w(r(It), {
|
|
1545
1545
|
key: 4,
|
|
1546
1546
|
title: "Пока пусто",
|
|
1547
1547
|
description: "Создайте первую запись или измените фильтры.",
|
|
@@ -1560,22 +1560,22 @@ const X = ee("admin-auth", () => {
|
|
|
1560
1560
|
})) : F("", !0)
|
|
1561
1561
|
]),
|
|
1562
1562
|
_: 1
|
|
1563
|
-
})) : (s(), c("div",
|
|
1564
|
-
d("div",
|
|
1565
|
-
x(r(
|
|
1563
|
+
})) : (s(), c("div", $a, [
|
|
1564
|
+
d("div", xa, [
|
|
1565
|
+
x(r(Se), {
|
|
1566
1566
|
"model-value": r(a).selectionState === "all",
|
|
1567
1567
|
indeterminate: r(a).selectionState === "mixed",
|
|
1568
1568
|
"aria-label": "Выделить всё",
|
|
1569
|
-
"onUpdate:modelValue":
|
|
1569
|
+
"onUpdate:modelValue": A
|
|
1570
1570
|
}, null, 8, ["model-value", "indeterminate"])
|
|
1571
1571
|
]),
|
|
1572
|
-
x(r(
|
|
1572
|
+
x(r(je), {
|
|
1573
1573
|
columns: f.value,
|
|
1574
1574
|
data: r(a).items,
|
|
1575
1575
|
"sort-key": r(a).sortKey ?? "",
|
|
1576
1576
|
"sort-direction": r(a).sortDirection,
|
|
1577
1577
|
"onUpdate:sortKey": b
|
|
1578
|
-
},
|
|
1578
|
+
}, qe({ _: 2 }, [
|
|
1579
1579
|
I(f.value, (y) => ({
|
|
1580
1580
|
name: `cell-${y.key}`,
|
|
1581
1581
|
fn: m(($) => [
|
|
@@ -1585,27 +1585,27 @@ const X = ee("admin-auth", () => {
|
|
|
1585
1585
|
])
|
|
1586
1586
|
}))
|
|
1587
1587
|
]), 1032, ["columns", "data", "sort-key", "sort-direction"]),
|
|
1588
|
-
d("div",
|
|
1588
|
+
d("div", Ca, [
|
|
1589
1589
|
(s(!0), c(T, null, I(r(a).items, (y) => (s(), c("div", {
|
|
1590
1590
|
key: String(r(a).rowId(y)),
|
|
1591
|
-
class:
|
|
1591
|
+
class: Y([
|
|
1592
1592
|
"admin-resource-index__row",
|
|
1593
1593
|
{ "admin-resource-index__row--selected": r(a).isSelected(r(a).rowId(y)) }
|
|
1594
1594
|
]),
|
|
1595
1595
|
onClick: ($) => _(y)
|
|
1596
1596
|
}, [
|
|
1597
|
-
x(r(
|
|
1597
|
+
x(r(Se), {
|
|
1598
1598
|
"model-value": r(a).isSelected(r(a).rowId(y)),
|
|
1599
1599
|
"aria-label": `Строка ${r(a).rowId(y)}`,
|
|
1600
|
-
"onUpdate:modelValue": ($) =>
|
|
1601
|
-
onClick: k[7] || (k[7] =
|
|
1600
|
+
"onUpdate:modelValue": ($) => R(r(a).rowId(y)),
|
|
1601
|
+
onClick: k[7] || (k[7] = Oe(() => {
|
|
1602
1602
|
}, ["stop"]))
|
|
1603
1603
|
}, null, 8, ["model-value", "aria-label", "onUpdate:modelValue"])
|
|
1604
|
-
], 10,
|
|
1604
|
+
], 10, Sa))), 128))
|
|
1605
1605
|
])
|
|
1606
1606
|
])),
|
|
1607
|
-
!r(a).loading && !r(a).hasError && !r(a).isEmpty ? (s(), c("footer",
|
|
1608
|
-
x(r(
|
|
1607
|
+
!r(a).loading && !r(a).hasError && !r(a).isEmpty ? (s(), c("footer", Aa, [
|
|
1608
|
+
x(r(Bt), {
|
|
1609
1609
|
"model-value": r(a).meta.page,
|
|
1610
1610
|
total: r(a).meta.total,
|
|
1611
1611
|
"per-page": r(a).meta.per_page,
|
|
@@ -1614,13 +1614,13 @@ const X = ee("admin-auth", () => {
|
|
|
1614
1614
|
])) : F("", !0)
|
|
1615
1615
|
]));
|
|
1616
1616
|
}
|
|
1617
|
-
}),
|
|
1618
|
-
const e = E(null), t = E("create"), n = E(null), o = E({}), a = E({}), l = E({}), i = E(!1), u = E(!1), f = E(!1), v = E(null), b = p(() => t.value === "create"), S = p(() => t.value === "edit"),
|
|
1617
|
+
}), pt = ae("admin-resource-form", () => {
|
|
1618
|
+
const e = E(null), t = E("create"), n = E(null), o = E({}), a = E({}), l = E({}), i = E(!1), u = E(!1), f = E(!1), v = E(null), b = p(() => t.value === "create"), S = p(() => t.value === "edit"), A = p(() => t.value === "view"), R = p(() => v.value !== null), _ = p(() => {
|
|
1619
1619
|
const M = o.value, O = a.value, G = /* @__PURE__ */ new Set([...Object.keys(M), ...Object.keys(O)]);
|
|
1620
|
-
for (const
|
|
1621
|
-
if (!Object.is(M[
|
|
1622
|
-
if (typeof M[
|
|
1623
|
-
if (JSON.stringify(M[
|
|
1620
|
+
for (const j of G)
|
|
1621
|
+
if (!Object.is(M[j], O[j]))
|
|
1622
|
+
if (typeof M[j] == "object" || typeof O[j] == "object") {
|
|
1623
|
+
if (JSON.stringify(M[j]) !== JSON.stringify(O[j])) return !0;
|
|
1624
1624
|
} else
|
|
1625
1625
|
return !0;
|
|
1626
1626
|
return !1;
|
|
@@ -1638,12 +1638,12 @@ const X = ee("admin-auth", () => {
|
|
|
1638
1638
|
async function k(M, O, G = "edit") {
|
|
1639
1639
|
e.value = M, t.value = G, n.value = O, i.value = !0, v.value = null, l.value = {};
|
|
1640
1640
|
try {
|
|
1641
|
-
const
|
|
1641
|
+
const ee = await W().get(`/${M}/read`, {
|
|
1642
1642
|
params: { id: O }
|
|
1643
1643
|
});
|
|
1644
|
-
g(o.value,
|
|
1645
|
-
} catch (
|
|
1646
|
-
throw v.value =
|
|
1644
|
+
g(o.value, ee.record), g(a.value, ee.record);
|
|
1645
|
+
} catch (j) {
|
|
1646
|
+
throw v.value = j instanceof Error ? j : new Error(String(j)), j;
|
|
1647
1647
|
} finally {
|
|
1648
1648
|
i.value = !1;
|
|
1649
1649
|
}
|
|
@@ -1660,15 +1660,17 @@ const X = ee("admin-auth", () => {
|
|
|
1660
1660
|
function V() {
|
|
1661
1661
|
l.value = {};
|
|
1662
1662
|
}
|
|
1663
|
-
async function
|
|
1663
|
+
async function K() {
|
|
1664
1664
|
if (!e.value) throw new Error("useResourceFormStore.save() before slug set");
|
|
1665
1665
|
if (u.value) throw new Error("Already saving");
|
|
1666
1666
|
u.value = !0, v.value = null, l.value = {};
|
|
1667
1667
|
try {
|
|
1668
|
-
const M = W(), O = t.value === "create" ? `/${e.value}/create` : `/${e.value}/update`, G = t.value === "create" ? o.value : { id: n.value, ...o.value },
|
|
1669
|
-
|
|
1668
|
+
const M = W(), O = t.value === "create" ? `/${e.value}/create` : `/${e.value}/update`, G = t.value === "create" ? o.value : { id: n.value, ...o.value }, j = await M.post(O, G), ee = j.record?.id ?? j.id;
|
|
1669
|
+
if (ee === void 0)
|
|
1670
|
+
throw new Error("save: backend response does not contain record.id");
|
|
1671
|
+
return n.value = ee, g(a.value, { ...o.value }), t.value = "edit", ee;
|
|
1670
1672
|
} catch (M) {
|
|
1671
|
-
throw M instanceof
|
|
1673
|
+
throw M instanceof Le ? l.value = { ...M.fields } : (M instanceof Z || M instanceof Error) && (v.value = M), M;
|
|
1672
1674
|
} finally {
|
|
1673
1675
|
u.value = !1;
|
|
1674
1676
|
}
|
|
@@ -1701,9 +1703,9 @@ const X = ee("admin-auth", () => {
|
|
|
1701
1703
|
// getters
|
|
1702
1704
|
isCreate: b,
|
|
1703
1705
|
isEdit: S,
|
|
1704
|
-
isView:
|
|
1706
|
+
isView: A,
|
|
1705
1707
|
isDirty: _,
|
|
1706
|
-
hasError:
|
|
1708
|
+
hasError: R,
|
|
1707
1709
|
// actions
|
|
1708
1710
|
reset: U,
|
|
1709
1711
|
prepareCreate: P,
|
|
@@ -1711,11 +1713,11 @@ const X = ee("admin-auth", () => {
|
|
|
1711
1713
|
setField: y,
|
|
1712
1714
|
setErrors: $,
|
|
1713
1715
|
clearErrors: V,
|
|
1714
|
-
save:
|
|
1716
|
+
save: K,
|
|
1715
1717
|
destroy: D
|
|
1716
1718
|
};
|
|
1717
1719
|
});
|
|
1718
|
-
function
|
|
1720
|
+
function Te() {
|
|
1719
1721
|
const e = /* @__PURE__ */ new Map();
|
|
1720
1722
|
return {
|
|
1721
1723
|
register(t, n) {
|
|
@@ -1739,21 +1741,21 @@ function Ee() {
|
|
|
1739
1741
|
}
|
|
1740
1742
|
};
|
|
1741
1743
|
}
|
|
1742
|
-
const
|
|
1744
|
+
const ce = Te(), me = Te(), Vi = ce.register, gt = ce.get, zi = ce.has, qi = ce.list, Di = me.register, Ze = me.get, Oi = me.has, Wi = me.list;
|
|
1743
1745
|
function ji() {
|
|
1744
|
-
|
|
1746
|
+
ce.clear(), me.clear();
|
|
1745
1747
|
}
|
|
1746
|
-
function
|
|
1747
|
-
e.fields &&
|
|
1748
|
+
function Ua(e) {
|
|
1749
|
+
e.fields && ce.registerBundle(e.fields), e.layouts && me.registerBundle(e.layouts);
|
|
1748
1750
|
}
|
|
1749
|
-
const
|
|
1751
|
+
const ht = /* @__PURE__ */ L({
|
|
1750
1752
|
__name: "UnknownField",
|
|
1751
1753
|
props: {
|
|
1752
1754
|
type: {},
|
|
1753
1755
|
name: {}
|
|
1754
1756
|
},
|
|
1755
1757
|
setup(e) {
|
|
1756
|
-
return (t, n) => (s(), w(r(
|
|
1758
|
+
return (t, n) => (s(), w(r(Q), { variant: "warning" }, {
|
|
1757
1759
|
title: m(() => [
|
|
1758
1760
|
C("Неизвестный тип поля: " + h(e.type), 1)
|
|
1759
1761
|
]),
|
|
@@ -1768,23 +1770,23 @@ const ft = /* @__PURE__ */ L({
|
|
|
1768
1770
|
_: 1
|
|
1769
1771
|
}));
|
|
1770
1772
|
}
|
|
1771
|
-
}),
|
|
1773
|
+
}), _t = /* @__PURE__ */ L({
|
|
1772
1774
|
__name: "FieldRenderer",
|
|
1773
1775
|
props: {
|
|
1774
1776
|
node: {}
|
|
1775
1777
|
},
|
|
1776
1778
|
setup(e) {
|
|
1777
|
-
const t = e, n = p(() =>
|
|
1779
|
+
const t = e, n = p(() => gt(t.node.type)), o = p(() => {
|
|
1778
1780
|
const { type: a, ...l } = t.node;
|
|
1779
1781
|
return l;
|
|
1780
1782
|
});
|
|
1781
|
-
return (a, l) => n.value ? (s(), w(
|
|
1783
|
+
return (a, l) => n.value ? (s(), w(ue(n.value), Ue(Ee({ key: 0 }, o.value)), null, 16)) : (s(), w(ht, {
|
|
1782
1784
|
key: 1,
|
|
1783
1785
|
type: e.node.type,
|
|
1784
1786
|
name: e.node.name
|
|
1785
1787
|
}, null, 8, ["type", "name"]));
|
|
1786
1788
|
}
|
|
1787
|
-
}),
|
|
1789
|
+
}), be = /* @__PURE__ */ L({
|
|
1788
1790
|
__name: "LayoutRenderer",
|
|
1789
1791
|
props: {
|
|
1790
1792
|
node: {}
|
|
@@ -1794,31 +1796,31 @@ const ft = /* @__PURE__ */ L({
|
|
|
1794
1796
|
if (t.node.kind === "field")
|
|
1795
1797
|
return { kind: "field" };
|
|
1796
1798
|
if (t.node.kind === "layout") {
|
|
1797
|
-
const i =
|
|
1799
|
+
const i = Ze(t.node.type);
|
|
1798
1800
|
return i ? { kind: "layout", component: i } : { kind: "unknown" };
|
|
1799
1801
|
}
|
|
1800
|
-
const l =
|
|
1801
|
-
return l ? { kind: "layout", component: l } :
|
|
1802
|
+
const l = Ze(t.node.type);
|
|
1803
|
+
return l ? { kind: "layout", component: l } : gt(t.node.type) ? { kind: "field" } : { kind: "unknown" };
|
|
1802
1804
|
}), o = p(() => {
|
|
1803
1805
|
const { type: l, kind: i, ...u } = t.node;
|
|
1804
1806
|
return u;
|
|
1805
1807
|
}), a = p(() => t.node);
|
|
1806
|
-
return (l, i) => n.value.kind === "layout" && n.value.component ? (s(), w(
|
|
1808
|
+
return (l, i) => n.value.kind === "layout" && n.value.component ? (s(), w(ue(n.value.component), Ue(Ee({ key: 0 }, o.value)), null, 16)) : n.value.kind === "field" ? (s(), w(_t, {
|
|
1807
1809
|
key: 1,
|
|
1808
1810
|
node: a.value
|
|
1809
|
-
}, null, 8, ["node"])) : (s(), w(
|
|
1811
|
+
}, null, 8, ["node"])) : (s(), w(ht, {
|
|
1810
1812
|
key: 2,
|
|
1811
1813
|
type: e.node.type,
|
|
1812
1814
|
name: e.node.name
|
|
1813
1815
|
}, null, 8, ["type", "name"]));
|
|
1814
1816
|
}
|
|
1815
|
-
}),
|
|
1817
|
+
}), Ea = { class: "admin-page admin-resource-form" }, Fa = { class: "admin-page__hd" }, La = { class: "admin-page__title-wrap" }, Pa = { class: "admin-page__title" }, Ta = { class: "admin-page__actions" }, Ma = {
|
|
1816
1818
|
key: 1,
|
|
1817
1819
|
class: "admin-resource-form__loading"
|
|
1818
|
-
},
|
|
1820
|
+
}, Na = {
|
|
1819
1821
|
key: 3,
|
|
1820
1822
|
class: "admin-resource-form__savebar"
|
|
1821
|
-
},
|
|
1823
|
+
}, et = /* @__PURE__ */ L({
|
|
1822
1824
|
__name: "ResourceFormPage",
|
|
1823
1825
|
props: {
|
|
1824
1826
|
slug: {},
|
|
@@ -1826,8 +1828,8 @@ const ft = /* @__PURE__ */ L({
|
|
|
1826
1828
|
indexRouteName: { default: "admin.home" }
|
|
1827
1829
|
},
|
|
1828
1830
|
setup(e) {
|
|
1829
|
-
const t = e, n =
|
|
1830
|
-
|
|
1831
|
+
const t = e, n = pt(), o = se(), a = le(), l = ct(n.state, n.errors);
|
|
1832
|
+
ne(
|
|
1831
1833
|
() => n.errors,
|
|
1832
1834
|
(_) => {
|
|
1833
1835
|
l.setErrors({ ..._ });
|
|
@@ -1851,11 +1853,11 @@ const ft = /* @__PURE__ */ L({
|
|
|
1851
1853
|
return "default";
|
|
1852
1854
|
}
|
|
1853
1855
|
});
|
|
1854
|
-
|
|
1856
|
+
Re(async () => {
|
|
1855
1857
|
o.manifest === null && await o.load().catch(() => {
|
|
1856
1858
|
}), t.id !== null && t.id !== void 0 ? await n.load(t.slug, t.id, "edit").catch(() => {
|
|
1857
1859
|
}) : n.prepareCreate(t.slug);
|
|
1858
|
-
}),
|
|
1860
|
+
}), ne(
|
|
1859
1861
|
() => [t.slug, t.id],
|
|
1860
1862
|
async ([_, g]) => {
|
|
1861
1863
|
g != null ? await n.load(_, g, "edit").catch(() => {
|
|
@@ -1873,24 +1875,24 @@ const ft = /* @__PURE__ */ L({
|
|
|
1873
1875
|
} catch {
|
|
1874
1876
|
}
|
|
1875
1877
|
}
|
|
1876
|
-
async function
|
|
1878
|
+
async function A() {
|
|
1877
1879
|
confirm("Удалить запись?") && (await n.destroy().catch(() => {
|
|
1878
1880
|
}), n.hasError || a.push({ name: t.indexRouteName }).catch(() => {
|
|
1879
1881
|
}));
|
|
1880
1882
|
}
|
|
1881
|
-
function
|
|
1883
|
+
function R() {
|
|
1882
1884
|
n.isDirty && !confirm("Несохранённые изменения будут потеряны. Продолжить?") || a.push({ name: t.indexRouteName }).catch(() => {
|
|
1883
1885
|
});
|
|
1884
1886
|
}
|
|
1885
|
-
return (_, g) => (s(), c("section",
|
|
1886
|
-
d("header",
|
|
1887
|
-
d("div",
|
|
1887
|
+
return (_, g) => (s(), c("section", Ea, [
|
|
1888
|
+
d("header", Fa, [
|
|
1889
|
+
d("div", La, [
|
|
1888
1890
|
d("a", {
|
|
1889
1891
|
class: "admin-resource-form__back",
|
|
1890
|
-
onClick:
|
|
1892
|
+
onClick: R
|
|
1891
1893
|
}, "← Назад"),
|
|
1892
|
-
d("h1",
|
|
1893
|
-
v.value ? (s(), w(r(
|
|
1894
|
+
d("h1", Pa, h(f.value), 1),
|
|
1895
|
+
v.value ? (s(), w(r(Ke), {
|
|
1894
1896
|
key: 0,
|
|
1895
1897
|
variant: b.value
|
|
1896
1898
|
}, {
|
|
@@ -1900,11 +1902,11 @@ const ft = /* @__PURE__ */ L({
|
|
|
1900
1902
|
_: 1
|
|
1901
1903
|
}, 8, ["variant"])) : F("", !0)
|
|
1902
1904
|
]),
|
|
1903
|
-
d("div",
|
|
1905
|
+
d("div", Ta, [
|
|
1904
1906
|
x(r(B), {
|
|
1905
1907
|
variant: "ghost",
|
|
1906
1908
|
disabled: r(n).saving || r(n).deleting,
|
|
1907
|
-
onClick:
|
|
1909
|
+
onClick: R
|
|
1908
1910
|
}, {
|
|
1909
1911
|
default: m(() => [...g[0] || (g[0] = [
|
|
1910
1912
|
C(" Отмена ", -1)
|
|
@@ -1916,7 +1918,7 @@ const ft = /* @__PURE__ */ L({
|
|
|
1916
1918
|
variant: "danger",
|
|
1917
1919
|
disabled: r(n).saving || r(n).deleting,
|
|
1918
1920
|
loading: r(n).deleting,
|
|
1919
|
-
onClick:
|
|
1921
|
+
onClick: A
|
|
1920
1922
|
}, {
|
|
1921
1923
|
default: m(() => [...g[1] || (g[1] = [
|
|
1922
1924
|
C(" Удалить ", -1)
|
|
@@ -1936,7 +1938,7 @@ const ft = /* @__PURE__ */ L({
|
|
|
1936
1938
|
}, 8, ["disabled", "loading"])
|
|
1937
1939
|
])
|
|
1938
1940
|
]),
|
|
1939
|
-
r(n).hasError ? (s(), w(r(
|
|
1941
|
+
r(n).hasError ? (s(), w(r(Q), {
|
|
1940
1942
|
key: 0,
|
|
1941
1943
|
variant: "danger",
|
|
1942
1944
|
class: "admin-resource-form__alert",
|
|
@@ -1947,8 +1949,8 @@ const ft = /* @__PURE__ */ L({
|
|
|
1947
1949
|
]),
|
|
1948
1950
|
_: 1
|
|
1949
1951
|
})) : F("", !0),
|
|
1950
|
-
r(n).loading ? (s(), c("div",
|
|
1951
|
-
(s(), c(T, null, I(6, (U) => x(r(
|
|
1952
|
+
r(n).loading ? (s(), c("div", Ma, [
|
|
1953
|
+
(s(), c(T, null, I(6, (U) => x(r(We), {
|
|
1952
1954
|
key: U,
|
|
1953
1955
|
height: "40px"
|
|
1954
1956
|
})), 64))
|
|
@@ -1958,19 +1960,19 @@ const ft = /* @__PURE__ */ L({
|
|
|
1958
1960
|
class: "admin-resource-form__body"
|
|
1959
1961
|
}, {
|
|
1960
1962
|
default: m(() => [
|
|
1961
|
-
(s(!0), c(T, null, I(u.value, (U, P) => (s(), w(
|
|
1963
|
+
(s(!0), c(T, null, I(u.value, (U, P) => (s(), w(be, {
|
|
1962
1964
|
key: P,
|
|
1963
1965
|
node: U
|
|
1964
1966
|
}, null, 8, ["node"]))), 128))
|
|
1965
1967
|
]),
|
|
1966
1968
|
_: 1
|
|
1967
1969
|
})),
|
|
1968
|
-
r(n).isDirty && !r(n).loading ? (s(), c("div",
|
|
1970
|
+
r(n).isDirty && !r(n).loading ? (s(), c("div", Na, [
|
|
1969
1971
|
g[4] || (g[4] = d("span", { class: "admin-resource-form__savebar-hint" }, " Есть несохранённые изменения ", -1)),
|
|
1970
1972
|
x(r(B), {
|
|
1971
1973
|
variant: "ghost",
|
|
1972
1974
|
size: "sm",
|
|
1973
|
-
onClick:
|
|
1975
|
+
onClick: R
|
|
1974
1976
|
}, {
|
|
1975
1977
|
default: m(() => [...g[2] || (g[2] = [
|
|
1976
1978
|
C("Отмена", -1)
|
|
@@ -1992,14 +1994,14 @@ const ft = /* @__PURE__ */ L({
|
|
|
1992
1994
|
])) : F("", !0)
|
|
1993
1995
|
]));
|
|
1994
1996
|
}
|
|
1995
|
-
}),
|
|
1997
|
+
}), fe = Te(), Ki = fe.register, tt = fe.get, Gi = fe.has, Hi = fe.list, Xi = fe.clear, Ia = fe.registerBundle, Ba = /* @__PURE__ */ L({
|
|
1996
1998
|
__name: "UnknownEntry",
|
|
1997
1999
|
props: {
|
|
1998
2000
|
type: {},
|
|
1999
2001
|
name: {}
|
|
2000
2002
|
},
|
|
2001
2003
|
setup(e) {
|
|
2002
|
-
return (t, n) => (s(), w(r(
|
|
2004
|
+
return (t, n) => (s(), w(r(Q), { variant: "warning" }, {
|
|
2003
2005
|
title: m(() => [
|
|
2004
2006
|
C("Неизвестный тип infolist-entry: " + h(e.type), 1)
|
|
2005
2007
|
]),
|
|
@@ -2011,31 +2013,31 @@ const ft = /* @__PURE__ */ L({
|
|
|
2011
2013
|
_: 1
|
|
2012
2014
|
}));
|
|
2013
2015
|
}
|
|
2014
|
-
}),
|
|
2016
|
+
}), Va = {
|
|
2015
2017
|
key: 1,
|
|
2016
2018
|
class: "admin-infolist-rows"
|
|
2017
|
-
},
|
|
2019
|
+
}, za = {
|
|
2018
2020
|
key: 2,
|
|
2019
2021
|
class: "admin-infolist-cols"
|
|
2020
|
-
},
|
|
2022
|
+
}, qa = {
|
|
2021
2023
|
key: 3,
|
|
2022
2024
|
class: "admin-infolist-section"
|
|
2023
|
-
},
|
|
2025
|
+
}, Da = {
|
|
2024
2026
|
key: 0,
|
|
2025
2027
|
class: "admin-infolist-section__hd"
|
|
2026
|
-
},
|
|
2028
|
+
}, Oa = {
|
|
2027
2029
|
key: 0,
|
|
2028
2030
|
class: "admin-infolist-section__title"
|
|
2029
|
-
},
|
|
2031
|
+
}, Wa = {
|
|
2030
2032
|
key: 1,
|
|
2031
2033
|
class: "admin-infolist-section__description"
|
|
2032
|
-
},
|
|
2034
|
+
}, ja = { class: "admin-infolist-section__body" }, Ka = {
|
|
2033
2035
|
key: 4,
|
|
2034
2036
|
class: "admin-infolist-tabs"
|
|
2035
|
-
},
|
|
2037
|
+
}, Ga = {
|
|
2036
2038
|
class: "admin-infolist-tabs__list",
|
|
2037
2039
|
role: "tablist"
|
|
2038
|
-
},
|
|
2040
|
+
}, Ha = { class: "admin-infolist-tabs__panel" }, Xa = /* @__PURE__ */ L({
|
|
2039
2041
|
__name: "InfolistRenderer",
|
|
2040
2042
|
props: {
|
|
2041
2043
|
node: {}
|
|
@@ -2043,18 +2045,18 @@ const ft = /* @__PURE__ */ L({
|
|
|
2043
2045
|
setup(e) {
|
|
2044
2046
|
const t = e, n = /* @__PURE__ */ new Set(["rows", "columns", "section", "block", "tabs"]), o = p(() => {
|
|
2045
2047
|
if (t.node.kind === "entry") {
|
|
2046
|
-
const S =
|
|
2048
|
+
const S = tt(t.node.type);
|
|
2047
2049
|
return S ? { kind: "entry", component: S } : { kind: "unknown" };
|
|
2048
2050
|
}
|
|
2049
2051
|
if (t.node.kind === "layout")
|
|
2050
2052
|
return n.has(t.node.type) ? { kind: "layout", layoutType: t.node.type } : { kind: "unknown" };
|
|
2051
2053
|
if (n.has(t.node.type))
|
|
2052
2054
|
return { kind: "layout", layoutType: t.node.type };
|
|
2053
|
-
const b =
|
|
2055
|
+
const b = tt(t.node.type);
|
|
2054
2056
|
return b ? { kind: "entry", component: b } : { kind: "unknown" };
|
|
2055
2057
|
}), a = p(() => {
|
|
2056
|
-
const { type: b, kind: S, items:
|
|
2057
|
-
return
|
|
2058
|
+
const { type: b, kind: S, items: A, ...R } = t.node;
|
|
2059
|
+
return R;
|
|
2058
2060
|
}), l = p(
|
|
2059
2061
|
() => t.node.items ?? []
|
|
2060
2062
|
), i = p(() => t.node.title ?? null), u = p(
|
|
@@ -2064,73 +2066,73 @@ const ft = /* @__PURE__ */ L({
|
|
|
2064
2066
|
return typeof b == "number" ? b : 0;
|
|
2065
2067
|
}), v = p(() => t.node.items ?? []);
|
|
2066
2068
|
return (b, S) => {
|
|
2067
|
-
const
|
|
2068
|
-
return o.value.kind === "entry" ? (s(), w(
|
|
2069
|
-
(s(!0), c(T, null, I(l.value, (
|
|
2069
|
+
const A = lt("InfolistRenderer", !0);
|
|
2070
|
+
return o.value.kind === "entry" ? (s(), w(ue(o.value.component), Ue(Ee({ key: 0 }, a.value)), null, 16)) : o.value.kind === "layout" && o.value.layoutType === "rows" ? (s(), c("div", Va, [
|
|
2071
|
+
(s(!0), c(T, null, I(l.value, (R, _) => (s(), w(A, {
|
|
2070
2072
|
key: _,
|
|
2071
|
-
node:
|
|
2073
|
+
node: R
|
|
2072
2074
|
}, null, 8, ["node"]))), 128))
|
|
2073
|
-
])) : o.value.kind === "layout" && o.value.layoutType === "columns" ? (s(), c("div",
|
|
2074
|
-
(s(!0), c(T, null, I(l.value, (
|
|
2075
|
+
])) : o.value.kind === "layout" && o.value.layoutType === "columns" ? (s(), c("div", za, [
|
|
2076
|
+
(s(!0), c(T, null, I(l.value, (R, _) => (s(), c("div", {
|
|
2075
2077
|
key: _,
|
|
2076
2078
|
class: "admin-infolist-cols__item",
|
|
2077
|
-
style:
|
|
2078
|
-
gridColumn: `span ${typeof
|
|
2079
|
+
style: Fe({
|
|
2080
|
+
gridColumn: `span ${typeof R.span == "number" ? R.span : Math.max(1, Math.floor(12 / l.value.length))}`
|
|
2079
2081
|
})
|
|
2080
2082
|
}, [
|
|
2081
|
-
x(
|
|
2083
|
+
x(A, { node: R }, null, 8, ["node"])
|
|
2082
2084
|
], 4))), 128))
|
|
2083
|
-
])) : o.value.kind === "layout" && (o.value.layoutType === "section" || o.value.layoutType === "block") ? (s(), c("section",
|
|
2084
|
-
i.value || u.value ? (s(), c("header",
|
|
2085
|
-
i.value ? (s(), c("h3",
|
|
2086
|
-
u.value ? (s(), c("p",
|
|
2085
|
+
])) : o.value.kind === "layout" && (o.value.layoutType === "section" || o.value.layoutType === "block") ? (s(), c("section", qa, [
|
|
2086
|
+
i.value || u.value ? (s(), c("header", Da, [
|
|
2087
|
+
i.value ? (s(), c("h3", Oa, h(i.value), 1)) : F("", !0),
|
|
2088
|
+
u.value ? (s(), c("p", Wa, h(u.value), 1)) : F("", !0)
|
|
2087
2089
|
])) : F("", !0),
|
|
2088
|
-
d("div",
|
|
2089
|
-
(s(!0), c(T, null, I(l.value, (
|
|
2090
|
+
d("div", ja, [
|
|
2091
|
+
(s(!0), c(T, null, I(l.value, (R, _) => (s(), w(A, {
|
|
2090
2092
|
key: _,
|
|
2091
|
-
node:
|
|
2093
|
+
node: R
|
|
2092
2094
|
}, null, 8, ["node"]))), 128))
|
|
2093
2095
|
])
|
|
2094
|
-
])) : o.value.kind === "layout" && o.value.layoutType === "tabs" ? (s(), c("div",
|
|
2095
|
-
d("ul",
|
|
2096
|
-
(s(!0), c(T, null, I(v.value, (
|
|
2097
|
-
key:
|
|
2098
|
-
class:
|
|
2096
|
+
])) : o.value.kind === "layout" && o.value.layoutType === "tabs" ? (s(), c("div", Ka, [
|
|
2097
|
+
d("ul", Ga, [
|
|
2098
|
+
(s(!0), c(T, null, I(v.value, (R, _) => (s(), c("li", {
|
|
2099
|
+
key: R.key ?? _,
|
|
2100
|
+
class: Y([
|
|
2099
2101
|
"admin-infolist-tabs__tab",
|
|
2100
2102
|
{ "admin-infolist-tabs__tab--active": _ === f.value }
|
|
2101
2103
|
])
|
|
2102
|
-
}, h(
|
|
2104
|
+
}, h(R.label), 3))), 128))
|
|
2103
2105
|
]),
|
|
2104
|
-
d("div",
|
|
2105
|
-
(s(!0), c(T, null, I(v.value[f.value]?.items ?? [], (
|
|
2106
|
+
d("div", Ha, [
|
|
2107
|
+
(s(!0), c(T, null, I(v.value[f.value]?.items ?? [], (R, _) => (s(), w(A, {
|
|
2106
2108
|
key: _,
|
|
2107
|
-
node:
|
|
2109
|
+
node: R
|
|
2108
2110
|
}, null, 8, ["node"]))), 128))
|
|
2109
2111
|
])
|
|
2110
|
-
])) : (s(), w(
|
|
2112
|
+
])) : (s(), w(Ba, {
|
|
2111
2113
|
key: 5,
|
|
2112
2114
|
type: e.node.type,
|
|
2113
2115
|
name: e.node.name
|
|
2114
2116
|
}, null, 8, ["type", "name"]));
|
|
2115
2117
|
};
|
|
2116
2118
|
}
|
|
2117
|
-
}),
|
|
2118
|
-
function
|
|
2119
|
-
|
|
2119
|
+
}), Je = /* @__PURE__ */ Symbol("admin.infolist-record");
|
|
2120
|
+
function Ja(e) {
|
|
2121
|
+
Ct(Je, e);
|
|
2120
2122
|
}
|
|
2121
2123
|
function Ji() {
|
|
2122
|
-
const e =
|
|
2124
|
+
const e = st(Je);
|
|
2123
2125
|
if (!e)
|
|
2124
2126
|
throw new Error("useRecord() called outside of provideRecord() scope");
|
|
2125
2127
|
return e;
|
|
2126
2128
|
}
|
|
2127
|
-
function
|
|
2128
|
-
return
|
|
2129
|
+
function Me() {
|
|
2130
|
+
return st(Je, null);
|
|
2129
2131
|
}
|
|
2130
|
-
const
|
|
2132
|
+
const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-page__hd" }, Za = { class: "admin-page__title-wrap" }, el = { class: "admin-page__title" }, tl = { class: "admin-page__actions" }, nl = {
|
|
2131
2133
|
key: 1,
|
|
2132
2134
|
class: "admin-resource-view__loading"
|
|
2133
|
-
},
|
|
2135
|
+
}, al = /* @__PURE__ */ L({
|
|
2134
2136
|
__name: "ResourceViewPage",
|
|
2135
2137
|
props: {
|
|
2136
2138
|
slug: {},
|
|
@@ -2139,18 +2141,18 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2139
2141
|
indexRouteName: { default: "admin.home" }
|
|
2140
2142
|
},
|
|
2141
2143
|
setup(e) {
|
|
2142
|
-
const t = e, n =
|
|
2143
|
-
|
|
2144
|
+
const t = e, n = pt(), o = se(), a = le();
|
|
2145
|
+
Ja(n.state);
|
|
2144
2146
|
const l = p(() => o.getResource(t.slug)), i = p(
|
|
2145
2147
|
() => l.value?.fields ?? []
|
|
2146
2148
|
), u = p(
|
|
2147
2149
|
() => `${l.value?.label ?? t.slug}: запись #${t.id}`
|
|
2148
2150
|
);
|
|
2149
|
-
|
|
2151
|
+
Re(async () => {
|
|
2150
2152
|
o.manifest === null && await o.load().catch(() => {
|
|
2151
2153
|
}), await n.load(t.slug, t.id, "view").catch(() => {
|
|
2152
2154
|
});
|
|
2153
|
-
}),
|
|
2155
|
+
}), ne(
|
|
2154
2156
|
() => [t.slug, t.id],
|
|
2155
2157
|
async ([b, S]) => {
|
|
2156
2158
|
await n.load(b, S, "view").catch(() => {
|
|
@@ -2171,12 +2173,12 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2171
2173
|
}), n.hasError || a.push({ name: t.indexRouteName }).catch(() => {
|
|
2172
2174
|
}));
|
|
2173
2175
|
}
|
|
2174
|
-
return (b, S) => (s(), c("section",
|
|
2175
|
-
d("header",
|
|
2176
|
-
d("div",
|
|
2177
|
-
d("h1",
|
|
2176
|
+
return (b, S) => (s(), c("section", Ya, [
|
|
2177
|
+
d("header", Qa, [
|
|
2178
|
+
d("div", Za, [
|
|
2179
|
+
d("h1", el, h(u.value), 1)
|
|
2178
2180
|
]),
|
|
2179
|
-
d("div",
|
|
2181
|
+
d("div", tl, [
|
|
2180
2182
|
x(r(B), {
|
|
2181
2183
|
variant: "ghost",
|
|
2182
2184
|
onClick: f
|
|
@@ -2199,7 +2201,7 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2199
2201
|
}, 8, ["loading", "disabled"])
|
|
2200
2202
|
])
|
|
2201
2203
|
]),
|
|
2202
|
-
r(n).hasError ? (s(), w(r(
|
|
2204
|
+
r(n).hasError ? (s(), w(r(Q), {
|
|
2203
2205
|
key: 0,
|
|
2204
2206
|
variant: "danger",
|
|
2205
2207
|
class: "admin-resource-view__alert",
|
|
@@ -2210,9 +2212,9 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2210
2212
|
]),
|
|
2211
2213
|
_: 1
|
|
2212
2214
|
})) : F("", !0),
|
|
2213
|
-
r(n).loading ? (s(), c("div",
|
|
2214
|
-
(s(), c(T, null, I(8, (
|
|
2215
|
-
key:
|
|
2215
|
+
r(n).loading ? (s(), c("div", nl, [
|
|
2216
|
+
(s(), c(T, null, I(8, (A) => x(r(We), {
|
|
2217
|
+
key: A,
|
|
2216
2218
|
height: "24px"
|
|
2217
2219
|
})), 64))
|
|
2218
2220
|
])) : (s(), w(r(q), {
|
|
@@ -2221,25 +2223,25 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2221
2223
|
class: "admin-resource-view__body"
|
|
2222
2224
|
}, {
|
|
2223
2225
|
default: m(() => [
|
|
2224
|
-
(s(!0), c(T, null, I(i.value, (
|
|
2225
|
-
key:
|
|
2226
|
-
node:
|
|
2226
|
+
(s(!0), c(T, null, I(i.value, (A, R) => (s(), w(Xa, {
|
|
2227
|
+
key: R,
|
|
2228
|
+
node: A
|
|
2227
2229
|
}, null, 8, ["node"]))), 128))
|
|
2228
2230
|
]),
|
|
2229
2231
|
_: 1
|
|
2230
2232
|
}))
|
|
2231
2233
|
]));
|
|
2232
2234
|
}
|
|
2233
|
-
}),
|
|
2235
|
+
}), ll = { class: "admin-page admin-profile" }, sl = { class: "admin-page__hd" }, il = { class: "admin-page__title-wrap" }, ol = { class: "admin-page__title" }, rl = { class: "admin-page__count" }, ul = { class: "admin-profile__layout" }, dl = {
|
|
2234
2236
|
class: "admin-profile__nav",
|
|
2235
2237
|
"aria-label": "Profile sections"
|
|
2236
|
-
},
|
|
2238
|
+
}, cl = ["onClick"], ml = ["data-icon"], fl = { class: "admin-profile__content" }, vl = { class: "admin-profile__hero" }, pl = { class: "admin-profile__hero-text" }, gl = { class: "admin-profile__hero-name" }, hl = { class: "admin-profile__hero-meta" }, _l = { class: "admin-profile__form" }, yl = { class: "admin-profile__card-ft" }, bl = { class: "admin-profile__card-hd" }, kl = {
|
|
2237
2239
|
key: 0,
|
|
2238
2240
|
class: "admin-profile__hint"
|
|
2239
|
-
},
|
|
2241
|
+
}, wl = {
|
|
2240
2242
|
key: 1,
|
|
2241
2243
|
class: "admin-profile__hint"
|
|
2242
|
-
},
|
|
2244
|
+
}, $l = { class: "admin-profile__card-ft" }, xl = { class: "admin-profile__hint" }, Cl = /* @__PURE__ */ L({
|
|
2243
2245
|
__name: "ProfilePage",
|
|
2244
2246
|
props: {
|
|
2245
2247
|
title: { default: "Profile" },
|
|
@@ -2248,7 +2250,7 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2248
2250
|
},
|
|
2249
2251
|
emits: ["update:section", "avatar-replace", "two-factor-disable", "two-factor-regenerate", "save"],
|
|
2250
2252
|
setup(e, { emit: t }) {
|
|
2251
|
-
const n = e, o = t, a =
|
|
2253
|
+
const n = e, o = t, a = J(), l = Ge(), i = He(), u = [
|
|
2252
2254
|
{ id: "general", label: "Основное", icon: "user" },
|
|
2253
2255
|
{ id: "security", label: "Безопасность", icon: "shield" },
|
|
2254
2256
|
{ id: "tokens", label: "API токены", icon: "key" },
|
|
@@ -2264,10 +2266,10 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2264
2266
|
theme: l.current
|
|
2265
2267
|
}), S = p(
|
|
2266
2268
|
() => i.available.map((k) => ({ value: k, label: k.toUpperCase() }))
|
|
2267
|
-
),
|
|
2269
|
+
), A = p(
|
|
2268
2270
|
() => l.available.map((k) => ({ value: k, label: k === "dark" ? "Тёмная" : k === "light" ? "Светлая" : k }))
|
|
2269
2271
|
);
|
|
2270
|
-
function
|
|
2272
|
+
function R() {
|
|
2271
2273
|
o("save", { ...b.value });
|
|
2272
2274
|
}
|
|
2273
2275
|
function _() {
|
|
@@ -2280,19 +2282,19 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2280
2282
|
o("two-factor-regenerate");
|
|
2281
2283
|
}
|
|
2282
2284
|
const P = p(() => !!a.user?.twoFactorEnabled);
|
|
2283
|
-
return (k, y) => (s(), c("section",
|
|
2284
|
-
d("header",
|
|
2285
|
-
d("div",
|
|
2286
|
-
d("h1",
|
|
2287
|
-
d("div",
|
|
2285
|
+
return (k, y) => (s(), c("section", ll, [
|
|
2286
|
+
d("header", sl, [
|
|
2287
|
+
d("div", il, [
|
|
2288
|
+
d("h1", ol, h(e.title), 1),
|
|
2289
|
+
d("div", rl, h(e.subtitle), 1)
|
|
2288
2290
|
])
|
|
2289
2291
|
]),
|
|
2290
|
-
d("div",
|
|
2291
|
-
d("nav",
|
|
2292
|
+
d("div", ul, [
|
|
2293
|
+
d("nav", dl, [
|
|
2292
2294
|
(s(), c(T, null, I(u, ($) => d("button", {
|
|
2293
2295
|
key: $.id,
|
|
2294
2296
|
type: "button",
|
|
2295
|
-
class:
|
|
2297
|
+
class: Y([
|
|
2296
2298
|
"admin-profile__nav-item",
|
|
2297
2299
|
{ "admin-profile__nav-item--active": f.value === $.id }
|
|
2298
2300
|
]),
|
|
@@ -2301,11 +2303,11 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2301
2303
|
d("span", {
|
|
2302
2304
|
class: "admin-profile__nav-icon",
|
|
2303
2305
|
"data-icon": $.icon
|
|
2304
|
-
}, null, 8,
|
|
2306
|
+
}, null, 8, ml),
|
|
2305
2307
|
d("span", null, h($.label), 1)
|
|
2306
|
-
], 10,
|
|
2308
|
+
], 10, cl)), 64))
|
|
2307
2309
|
]),
|
|
2308
|
-
d("div",
|
|
2310
|
+
d("div", fl, [
|
|
2309
2311
|
f.value === "general" ? (s(), w(r(q), {
|
|
2310
2312
|
key: 0,
|
|
2311
2313
|
padding: "md"
|
|
@@ -2314,15 +2316,15 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2314
2316
|
y[7] || (y[7] = d("header", { class: "admin-profile__card-hd" }, [
|
|
2315
2317
|
d("h3", { class: "admin-profile__card-title" }, "Профиль")
|
|
2316
2318
|
], -1)),
|
|
2317
|
-
d("div",
|
|
2318
|
-
x(r(
|
|
2319
|
+
d("div", vl, [
|
|
2320
|
+
x(r(rt), {
|
|
2319
2321
|
src: r(a).user?.avatar ?? void 0,
|
|
2320
2322
|
name: r(a).user?.name ?? "?",
|
|
2321
2323
|
size: "lg"
|
|
2322
2324
|
}, null, 8, ["src", "name"]),
|
|
2323
|
-
d("div",
|
|
2324
|
-
d("div",
|
|
2325
|
-
d("div",
|
|
2325
|
+
d("div", pl, [
|
|
2326
|
+
d("div", gl, h(r(a).user?.name ?? "—"), 1),
|
|
2327
|
+
d("div", hl, h(r(a).user?.email ?? "—"), 1)
|
|
2326
2328
|
]),
|
|
2327
2329
|
y[5] || (y[5] = d("div", { style: { flex: "1" } }, null, -1)),
|
|
2328
2330
|
x(r(B), {
|
|
@@ -2336,37 +2338,37 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2336
2338
|
_: 1
|
|
2337
2339
|
})
|
|
2338
2340
|
]),
|
|
2339
|
-
d("div",
|
|
2340
|
-
x(r(
|
|
2341
|
+
d("div", _l, [
|
|
2342
|
+
x(r(re), {
|
|
2341
2343
|
modelValue: b.value.name,
|
|
2342
2344
|
"onUpdate:modelValue": y[0] || (y[0] = ($) => b.value.name = $),
|
|
2343
2345
|
label: "Имя",
|
|
2344
2346
|
name: "name"
|
|
2345
2347
|
}, null, 8, ["modelValue"]),
|
|
2346
|
-
x(r(
|
|
2348
|
+
x(r(re), {
|
|
2347
2349
|
modelValue: b.value.email,
|
|
2348
2350
|
"onUpdate:modelValue": y[1] || (y[1] = ($) => b.value.email = $),
|
|
2349
2351
|
label: "Email",
|
|
2350
2352
|
type: "email",
|
|
2351
2353
|
name: "email"
|
|
2352
2354
|
}, null, 8, ["modelValue"]),
|
|
2353
|
-
x(r(
|
|
2355
|
+
x(r(Ae), {
|
|
2354
2356
|
modelValue: b.value.locale,
|
|
2355
2357
|
"onUpdate:modelValue": y[2] || (y[2] = ($) => b.value.locale = $),
|
|
2356
2358
|
options: S.value,
|
|
2357
2359
|
label: "Язык"
|
|
2358
2360
|
}, null, 8, ["modelValue", "options"]),
|
|
2359
|
-
x(r(
|
|
2361
|
+
x(r(Ae), {
|
|
2360
2362
|
modelValue: b.value.theme,
|
|
2361
2363
|
"onUpdate:modelValue": y[3] || (y[3] = ($) => b.value.theme = $),
|
|
2362
|
-
options:
|
|
2364
|
+
options: A.value,
|
|
2363
2365
|
label: "Тема"
|
|
2364
2366
|
}, null, 8, ["modelValue", "options"])
|
|
2365
2367
|
]),
|
|
2366
|
-
d("footer",
|
|
2368
|
+
d("footer", yl, [
|
|
2367
2369
|
x(r(B), {
|
|
2368
2370
|
variant: "primary",
|
|
2369
|
-
onClick:
|
|
2371
|
+
onClick: R
|
|
2370
2372
|
}, {
|
|
2371
2373
|
default: m(() => [...y[6] || (y[6] = [
|
|
2372
2374
|
C("Сохранить", -1)
|
|
@@ -2381,9 +2383,9 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2381
2383
|
padding: "md"
|
|
2382
2384
|
}, {
|
|
2383
2385
|
default: m(() => [
|
|
2384
|
-
d("header",
|
|
2386
|
+
d("header", bl, [
|
|
2385
2387
|
y[8] || (y[8] = d("h3", { class: "admin-profile__card-title" }, "Двухфакторная аутентификация", -1)),
|
|
2386
|
-
x(r(
|
|
2388
|
+
x(r(Ke), {
|
|
2387
2389
|
variant: P.value ? "success" : "default"
|
|
2388
2390
|
}, {
|
|
2389
2391
|
default: m(() => [
|
|
@@ -2392,8 +2394,8 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2392
2394
|
_: 1
|
|
2393
2395
|
}, 8, ["variant"])
|
|
2394
2396
|
]),
|
|
2395
|
-
P.value ? (s(), c("p",
|
|
2396
|
-
d("footer",
|
|
2397
|
+
P.value ? (s(), c("p", kl, " 2FA включена. У вас остались recovery-коды на случай потери устройства. ")) : (s(), c("p", wl, " Включите 2FA для дополнительной защиты аккаунта. ")),
|
|
2398
|
+
d("footer", $l, [
|
|
2397
2399
|
P.value ? (s(), c(T, { key: 0 }, [
|
|
2398
2400
|
x(r(B), {
|
|
2399
2401
|
variant: "ghost",
|
|
@@ -2435,7 +2437,7 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2435
2437
|
}, () => [
|
|
2436
2438
|
x(r(q), { padding: "md" }, {
|
|
2437
2439
|
default: m(() => [
|
|
2438
|
-
d("p",
|
|
2440
|
+
d("p", xl, " Section «" + h(f.value) + "» не реализована библиотекой — host-проект подключает её через slot " + h(f.value) + ". ", 1)
|
|
2439
2441
|
]),
|
|
2440
2442
|
_: 1
|
|
2441
2443
|
})
|
|
@@ -2444,13 +2446,13 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2444
2446
|
])
|
|
2445
2447
|
]));
|
|
2446
2448
|
}
|
|
2447
|
-
}),
|
|
2449
|
+
}), ve = Te(), Yi = ve.register, Sl = ve.get, Qi = ve.has, Zi = ve.list, eo = ve.clear, Al = ve.registerBundle, Rl = /* @__PURE__ */ L({
|
|
2448
2450
|
__name: "UnknownWidget",
|
|
2449
2451
|
props: {
|
|
2450
2452
|
type: {}
|
|
2451
2453
|
},
|
|
2452
2454
|
setup(e) {
|
|
2453
|
-
return (t, n) => (s(), w(r(
|
|
2455
|
+
return (t, n) => (s(), w(r(Q), { variant: "warning" }, {
|
|
2454
2456
|
title: m(() => [
|
|
2455
2457
|
C("Неизвестный widget-тип: " + h(e.type), 1)
|
|
2456
2458
|
]),
|
|
@@ -2462,25 +2464,25 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2462
2464
|
_: 1
|
|
2463
2465
|
}));
|
|
2464
2466
|
}
|
|
2465
|
-
}),
|
|
2467
|
+
}), Ul = /* @__PURE__ */ L({
|
|
2466
2468
|
__name: "WidgetRenderer",
|
|
2467
2469
|
props: {
|
|
2468
2470
|
node: {}
|
|
2469
2471
|
},
|
|
2470
2472
|
setup(e) {
|
|
2471
|
-
const t = e, n = p(() =>
|
|
2473
|
+
const t = e, n = p(() => Sl(t.node.type)), o = p(() => {
|
|
2472
2474
|
const { type: a, span: l, ...i } = t.node;
|
|
2473
2475
|
return i;
|
|
2474
2476
|
});
|
|
2475
|
-
return (a, l) => n.value ? (s(), w(
|
|
2477
|
+
return (a, l) => n.value ? (s(), w(ue(n.value), Ue(Ee({ key: 0 }, o.value)), null, 16)) : (s(), w(Rl, {
|
|
2476
2478
|
key: 1,
|
|
2477
2479
|
type: e.node.type
|
|
2478
2480
|
}, null, 8, ["type"]));
|
|
2479
2481
|
}
|
|
2480
|
-
}),
|
|
2482
|
+
}), El = { class: "admin-page admin-dashboard" }, Fl = { class: "admin-page__hd" }, Ll = { class: "admin-page__title-wrap" }, Pl = { class: "admin-page__title" }, Tl = {
|
|
2481
2483
|
key: 0,
|
|
2482
2484
|
class: "admin-page__count"
|
|
2483
|
-
},
|
|
2485
|
+
}, Ml = { class: "admin-page__actions" }, Nl = { class: "admin-dashboard__grid" }, Il = /* @__PURE__ */ L({
|
|
2484
2486
|
__name: "DashboardPage",
|
|
2485
2487
|
props: {
|
|
2486
2488
|
slug: { default: void 0 },
|
|
@@ -2489,7 +2491,7 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2489
2491
|
subtitle: { default: void 0 }
|
|
2490
2492
|
},
|
|
2491
2493
|
setup(e) {
|
|
2492
|
-
const t = e, n =
|
|
2494
|
+
const t = e, n = se(), o = p(() => !t.slug || !n.manifest ? null : n.manifest.dashboards?.find((v) => v.slug === t.slug) ?? null), a = p(() => t.widgets ? t.widgets : o.value ? o.value.widgets ?? [] : []), l = p(
|
|
2493
2495
|
() => t.title ?? o.value?.label ?? "Dashboard"
|
|
2494
2496
|
), i = p(
|
|
2495
2497
|
() => t.subtitle ?? o.value?.description ?? null
|
|
@@ -2498,28 +2500,28 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2498
2500
|
const v = typeof f.span == "number" ? f.span : 12;
|
|
2499
2501
|
return Math.max(1, Math.min(12, v));
|
|
2500
2502
|
}
|
|
2501
|
-
return (f, v) => (s(), c("section",
|
|
2502
|
-
d("header",
|
|
2503
|
-
d("div",
|
|
2504
|
-
d("h1",
|
|
2505
|
-
i.value ? (s(), c("div",
|
|
2503
|
+
return (f, v) => (s(), c("section", El, [
|
|
2504
|
+
d("header", Fl, [
|
|
2505
|
+
d("div", Ll, [
|
|
2506
|
+
d("h1", Pl, h(l.value), 1),
|
|
2507
|
+
i.value ? (s(), c("div", Tl, h(i.value), 1)) : F("", !0)
|
|
2506
2508
|
]),
|
|
2507
|
-
d("div",
|
|
2509
|
+
d("div", Ml, [
|
|
2508
2510
|
H(f.$slots, "actions")
|
|
2509
2511
|
])
|
|
2510
2512
|
]),
|
|
2511
|
-
d("div",
|
|
2513
|
+
d("div", Nl, [
|
|
2512
2514
|
(s(!0), c(T, null, I(a.value, (b, S) => (s(), c("div", {
|
|
2513
2515
|
key: S,
|
|
2514
2516
|
class: "admin-dashboard__cell",
|
|
2515
|
-
style:
|
|
2517
|
+
style: Fe({ gridColumn: `span ${u(b)} / span ${u(b)}` })
|
|
2516
2518
|
}, [
|
|
2517
|
-
x(
|
|
2519
|
+
x(Ul, { node: b }, null, 8, ["node"])
|
|
2518
2520
|
], 4))), 128))
|
|
2519
2521
|
])
|
|
2520
2522
|
]));
|
|
2521
2523
|
}
|
|
2522
|
-
}),
|
|
2524
|
+
}), Bl = /* @__PURE__ */ L({
|
|
2523
2525
|
__name: "StatWidget",
|
|
2524
2526
|
props: {
|
|
2525
2527
|
title: { default: "" },
|
|
@@ -2539,7 +2541,7 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2539
2541
|
warning: "warning",
|
|
2540
2542
|
info: "info"
|
|
2541
2543
|
}, o = p(() => n[t.tone]);
|
|
2542
|
-
return (a, l) => (s(), w(r(
|
|
2544
|
+
return (a, l) => (s(), w(r(xe), {
|
|
2543
2545
|
title: e.title,
|
|
2544
2546
|
value: e.value,
|
|
2545
2547
|
prefix: e.prefix,
|
|
@@ -2550,16 +2552,16 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2550
2552
|
loading: e.loading
|
|
2551
2553
|
}, null, 8, ["title", "value", "prefix", "suffix", "trend", "precision", "tone", "loading"]));
|
|
2552
2554
|
}
|
|
2553
|
-
}),
|
|
2555
|
+
}), Vl = {
|
|
2554
2556
|
key: 0,
|
|
2555
2557
|
class: "admin-widget__hd"
|
|
2556
|
-
},
|
|
2558
|
+
}, zl = {
|
|
2557
2559
|
key: 0,
|
|
2558
2560
|
class: "admin-widget__title"
|
|
2559
|
-
},
|
|
2561
|
+
}, ql = {
|
|
2560
2562
|
key: 1,
|
|
2561
2563
|
class: "admin-widget__desc"
|
|
2562
|
-
},
|
|
2564
|
+
}, Dl = ["viewBox", "height", "aria-label"], Ol = ["x", "y", "width", "height", "fill", "data-label", "data-value"], Wl = /* @__PURE__ */ L({
|
|
2563
2565
|
__name: "BarChartWidget",
|
|
2564
2566
|
props: {
|
|
2565
2567
|
title: { default: "" },
|
|
@@ -2584,9 +2586,9 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2584
2586
|
class: "admin-widget"
|
|
2585
2587
|
}, {
|
|
2586
2588
|
default: m(() => [
|
|
2587
|
-
e.title || e.description ? (s(), c("header",
|
|
2588
|
-
e.title ? (s(), c("h3",
|
|
2589
|
-
e.description ? (s(), c("p",
|
|
2589
|
+
e.title || e.description ? (s(), c("header", Vl, [
|
|
2590
|
+
e.title ? (s(), c("h3", zl, h(e.title), 1)) : F("", !0),
|
|
2591
|
+
e.description ? (s(), c("p", ql, h(e.description), 1)) : F("", !0)
|
|
2590
2592
|
])) : F("", !0),
|
|
2591
2593
|
(s(), c("svg", {
|
|
2592
2594
|
class: "admin-widget-bar-chart",
|
|
@@ -2609,16 +2611,16 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2609
2611
|
"data-value": i.value
|
|
2610
2612
|
}, [
|
|
2611
2613
|
d("title", null, h(i.label) + ": " + h(i.value), 1)
|
|
2612
|
-
], 8,
|
|
2613
|
-
], 8,
|
|
2614
|
+
], 8, Ol))), 128))
|
|
2615
|
+
], 8, Dl))
|
|
2614
2616
|
]),
|
|
2615
2617
|
_: 1
|
|
2616
2618
|
}));
|
|
2617
2619
|
}
|
|
2618
|
-
}),
|
|
2620
|
+
}), jl = {
|
|
2619
2621
|
key: 0,
|
|
2620
2622
|
class: "admin-widget__hd"
|
|
2621
|
-
},
|
|
2623
|
+
}, Kl = { class: "admin-widget__title" }, Gl = { class: "admin-donut-widget__row" }, Hl = ["aria-label"], Xl = ["d", "fill"], Jl = { class: "admin-donut-widget__legend" }, Yl = { class: "admin-donut-widget__label" }, Ql = { class: "admin-donut-widget__value" }, Zl = /* @__PURE__ */ L({
|
|
2622
2624
|
__name: "DonutChartWidget",
|
|
2623
2625
|
props: {
|
|
2624
2626
|
title: { default: "" },
|
|
@@ -2636,7 +2638,7 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2636
2638
|
return t.data.map((i, u) => {
|
|
2637
2639
|
const f = l / o.value * 2 * Math.PI;
|
|
2638
2640
|
l += i.value;
|
|
2639
|
-
const v = l / o.value * 2 * Math.PI, b = 50, S = 60,
|
|
2641
|
+
const v = l / o.value * 2 * Math.PI, b = 50, S = 60, A = 60, R = S + b * Math.cos(f - Math.PI / 2), _ = A + b * Math.sin(f - Math.PI / 2), g = S + b * Math.cos(v - Math.PI / 2), U = A + b * Math.sin(v - Math.PI / 2), P = v - f > Math.PI ? 1 : 0, k = t.data.length === 1 ? `M ${S - b} ${A} a ${b} ${b} 0 1 0 ${b * 2} 0 a ${b} ${b} 0 1 0 ${-b * 2} 0` : `M ${S} ${A} L ${R} ${_} A ${b} ${b} 0 ${P} 1 ${g} ${U} Z`;
|
|
2640
2642
|
return {
|
|
2641
2643
|
...i,
|
|
2642
2644
|
path: k,
|
|
@@ -2650,10 +2652,10 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2650
2652
|
class: "admin-widget admin-donut-widget"
|
|
2651
2653
|
}, {
|
|
2652
2654
|
default: m(() => [
|
|
2653
|
-
e.title ? (s(), c("header",
|
|
2654
|
-
d("h3",
|
|
2655
|
+
e.title ? (s(), c("header", jl, [
|
|
2656
|
+
d("h3", Kl, h(e.title), 1)
|
|
2655
2657
|
])) : F("", !0),
|
|
2656
|
-
d("div",
|
|
2658
|
+
d("div", Gl, [
|
|
2657
2659
|
(s(), c("svg", {
|
|
2658
2660
|
viewBox: "0 0 120 120",
|
|
2659
2661
|
class: "admin-donut-widget__svg",
|
|
@@ -2666,22 +2668,22 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2666
2668
|
fill: u.color
|
|
2667
2669
|
}, [
|
|
2668
2670
|
d("title", null, h(u.label) + ": " + h(u.value) + " (" + h(u.pct) + "%)", 1)
|
|
2669
|
-
], 8,
|
|
2671
|
+
], 8, Xl))), 128)),
|
|
2670
2672
|
i[0] || (i[0] = d("circle", {
|
|
2671
2673
|
cx: "60",
|
|
2672
2674
|
cy: "60",
|
|
2673
2675
|
r: "30",
|
|
2674
2676
|
fill: "var(--uid-surface-raised)"
|
|
2675
2677
|
}, null, -1))
|
|
2676
|
-
], 8,
|
|
2677
|
-
d("ul",
|
|
2678
|
+
], 8, Hl)),
|
|
2679
|
+
d("ul", Jl, [
|
|
2678
2680
|
(s(!0), c(T, null, I(a.value, (u, f) => (s(), c("li", { key: f }, [
|
|
2679
2681
|
d("span", {
|
|
2680
2682
|
class: "admin-donut-widget__dot",
|
|
2681
|
-
style:
|
|
2683
|
+
style: Fe({ background: u.color })
|
|
2682
2684
|
}, null, 4),
|
|
2683
|
-
d("span",
|
|
2684
|
-
d("span",
|
|
2685
|
+
d("span", Yl, h(u.label), 1),
|
|
2686
|
+
d("span", Ql, h(u.pct) + "%", 1)
|
|
2685
2687
|
]))), 128))
|
|
2686
2688
|
])
|
|
2687
2689
|
])
|
|
@@ -2689,10 +2691,10 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2689
2691
|
_: 1
|
|
2690
2692
|
}));
|
|
2691
2693
|
}
|
|
2692
|
-
}),
|
|
2694
|
+
}), es = {
|
|
2693
2695
|
key: 0,
|
|
2694
2696
|
class: "admin-widget__hd"
|
|
2695
|
-
},
|
|
2697
|
+
}, ts = { class: "admin-widget__title" }, ns = /* @__PURE__ */ L({
|
|
2696
2698
|
__name: "RecentTableWidget",
|
|
2697
2699
|
props: {
|
|
2698
2700
|
title: { default: "" },
|
|
@@ -2706,10 +2708,10 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2706
2708
|
class: "admin-widget"
|
|
2707
2709
|
}, {
|
|
2708
2710
|
default: m(() => [
|
|
2709
|
-
e.title ? (s(), c("header",
|
|
2710
|
-
d("h3",
|
|
2711
|
+
e.title ? (s(), c("header", es, [
|
|
2712
|
+
d("h3", ts, h(e.title), 1)
|
|
2711
2713
|
])) : F("", !0),
|
|
2712
|
-
x(r(
|
|
2714
|
+
x(r(je), {
|
|
2713
2715
|
columns: e.columns,
|
|
2714
2716
|
data: e.rows,
|
|
2715
2717
|
"empty-text": e.emptyText
|
|
@@ -2718,10 +2720,10 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2718
2720
|
_: 1
|
|
2719
2721
|
}));
|
|
2720
2722
|
}
|
|
2721
|
-
}),
|
|
2723
|
+
}), as = {
|
|
2722
2724
|
key: 0,
|
|
2723
2725
|
class: "admin-widget__hd"
|
|
2724
|
-
},
|
|
2726
|
+
}, ls = { class: "admin-widget__title" }, ss = /* @__PURE__ */ L({
|
|
2725
2727
|
__name: "HeatmapWidget",
|
|
2726
2728
|
props: {
|
|
2727
2729
|
title: { default: "" },
|
|
@@ -2736,10 +2738,10 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2736
2738
|
class: "admin-widget"
|
|
2737
2739
|
}, {
|
|
2738
2740
|
default: m(() => [
|
|
2739
|
-
e.title ? (s(), c("header",
|
|
2740
|
-
d("h3",
|
|
2741
|
+
e.title ? (s(), c("header", as, [
|
|
2742
|
+
d("h3", ls, h(e.title), 1)
|
|
2741
2743
|
])) : F("", !0),
|
|
2742
|
-
x(r(
|
|
2744
|
+
x(r(Vt), {
|
|
2743
2745
|
data: e.data,
|
|
2744
2746
|
levels: e.levels,
|
|
2745
2747
|
color: e.color,
|
|
@@ -2749,10 +2751,10 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2749
2751
|
_: 1
|
|
2750
2752
|
}));
|
|
2751
2753
|
}
|
|
2752
|
-
}),
|
|
2754
|
+
}), is = {
|
|
2753
2755
|
key: 0,
|
|
2754
2756
|
class: "admin-widget__hd"
|
|
2755
|
-
},
|
|
2757
|
+
}, os = { class: "admin-widget__title" }, rs = { style: { display: "flex", "justify-content": "center" } }, us = /* @__PURE__ */ L({
|
|
2756
2758
|
__name: "GaugeWidget",
|
|
2757
2759
|
props: {
|
|
2758
2760
|
title: { default: "" },
|
|
@@ -2779,11 +2781,11 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2779
2781
|
class: "admin-widget"
|
|
2780
2782
|
}, {
|
|
2781
2783
|
default: m(() => [
|
|
2782
|
-
e.title ? (s(), c("header",
|
|
2783
|
-
d("h3",
|
|
2784
|
+
e.title ? (s(), c("header", is, [
|
|
2785
|
+
d("h3", os, h(e.title), 1)
|
|
2784
2786
|
])) : F("", !0),
|
|
2785
|
-
d("div",
|
|
2786
|
-
x(r(
|
|
2787
|
+
d("div", rs, [
|
|
2788
|
+
x(r(zt), {
|
|
2787
2789
|
value: e.value,
|
|
2788
2790
|
min: e.min,
|
|
2789
2791
|
max: e.max,
|
|
@@ -2800,10 +2802,10 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2800
2802
|
_: 1
|
|
2801
2803
|
}));
|
|
2802
2804
|
}
|
|
2803
|
-
}),
|
|
2805
|
+
}), ds = {
|
|
2804
2806
|
key: 0,
|
|
2805
2807
|
class: "admin-widget__hd"
|
|
2806
|
-
},
|
|
2808
|
+
}, cs = { class: "admin-widget__title" }, ms = { class: "admin-markdown-widget" }, fs = /* @__PURE__ */ L({
|
|
2807
2809
|
__name: "MarkdownWidget",
|
|
2808
2810
|
props: {
|
|
2809
2811
|
title: { default: "" },
|
|
@@ -2815,34 +2817,34 @@ const Ga = { class: "admin-page admin-resource-view" }, Ha = { class: "admin-pag
|
|
|
2815
2817
|
class: "admin-widget"
|
|
2816
2818
|
}, {
|
|
2817
2819
|
default: m(() => [
|
|
2818
|
-
e.title ? (s(), c("header",
|
|
2819
|
-
d("h3",
|
|
2820
|
+
e.title ? (s(), c("header", ds, [
|
|
2821
|
+
d("h3", cs, h(e.title), 1)
|
|
2820
2822
|
])) : F("", !0),
|
|
2821
|
-
d("div",
|
|
2823
|
+
d("div", ms, h(e.content), 1)
|
|
2822
2824
|
]),
|
|
2823
2825
|
_: 1
|
|
2824
2826
|
}));
|
|
2825
2827
|
}
|
|
2826
2828
|
});
|
|
2827
|
-
function
|
|
2828
|
-
|
|
2829
|
-
stat:
|
|
2830
|
-
"bar-chart":
|
|
2831
|
-
"donut-chart":
|
|
2832
|
-
"recent-table":
|
|
2833
|
-
heatmap:
|
|
2834
|
-
gauge:
|
|
2835
|
-
markdown:
|
|
2829
|
+
function vs() {
|
|
2830
|
+
Al({
|
|
2831
|
+
stat: Bl,
|
|
2832
|
+
"bar-chart": Wl,
|
|
2833
|
+
"donut-chart": Zl,
|
|
2834
|
+
"recent-table": ns,
|
|
2835
|
+
heatmap: ss,
|
|
2836
|
+
gauge: us,
|
|
2837
|
+
markdown: fs
|
|
2836
2838
|
});
|
|
2837
2839
|
}
|
|
2838
|
-
function
|
|
2840
|
+
function ps(e) {
|
|
2839
2841
|
return e.success === !0;
|
|
2840
2842
|
}
|
|
2841
2843
|
function to(e) {
|
|
2842
2844
|
return e.success === !1;
|
|
2843
2845
|
}
|
|
2844
|
-
function
|
|
2845
|
-
const t =
|
|
2846
|
+
function gs(e) {
|
|
2847
|
+
const t = Qt.create({
|
|
2846
2848
|
baseURL: e.baseURL,
|
|
2847
2849
|
withCredentials: !0,
|
|
2848
2850
|
headers: {
|
|
@@ -2851,15 +2853,15 @@ function ms(e) {
|
|
|
2851
2853
|
}
|
|
2852
2854
|
});
|
|
2853
2855
|
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) => {
|
|
2854
|
-
const l =
|
|
2856
|
+
const l = hs("XSRF-TOKEN");
|
|
2855
2857
|
return l && a.headers.set("X-XSRF-TOKEN", decodeURIComponent(l)), a;
|
|
2856
2858
|
}), t.interceptors.response.use(
|
|
2857
2859
|
(a) => {
|
|
2858
2860
|
const l = a.data;
|
|
2859
2861
|
if (l && typeof l == "object" && "success" in l) {
|
|
2860
|
-
if (
|
|
2862
|
+
if (ps(l))
|
|
2861
2863
|
return a.data = l.payload, a;
|
|
2862
|
-
throw
|
|
2864
|
+
throw Ye(a.status, l.payload);
|
|
2863
2865
|
}
|
|
2864
2866
|
return a;
|
|
2865
2867
|
},
|
|
@@ -2868,10 +2870,10 @@ function ms(e) {
|
|
|
2868
2870
|
const l = a.response.status, i = a.response.data?.payload ?? {
|
|
2869
2871
|
errorKey: "unknown",
|
|
2870
2872
|
message: a.message
|
|
2871
|
-
}, u =
|
|
2872
|
-
return u instanceof
|
|
2873
|
+
}, u = Ye(l, i);
|
|
2874
|
+
return u instanceof vt && e.onUnauthenticated?.(), Promise.reject(u);
|
|
2873
2875
|
}
|
|
2874
|
-
return Promise.reject(new
|
|
2876
|
+
return Promise.reject(new Pe(a.message));
|
|
2875
2877
|
}
|
|
2876
2878
|
);
|
|
2877
2879
|
const n = (a, l, i) => t[a](l, i).then((u) => u.data), o = (a, l, i, u) => t[a](l, i, u).then((f) => f.data);
|
|
@@ -2887,26 +2889,26 @@ function ms(e) {
|
|
|
2887
2889
|
}
|
|
2888
2890
|
};
|
|
2889
2891
|
}
|
|
2890
|
-
function
|
|
2892
|
+
function hs(e) {
|
|
2891
2893
|
if (typeof document > "u") return null;
|
|
2892
|
-
const t = document.cookie.match(new RegExp("(^|; )" +
|
|
2894
|
+
const t = document.cookie.match(new RegExp("(^|; )" + _s(e) + "=([^;]*)"));
|
|
2893
2895
|
return t ? t[2] : null;
|
|
2894
2896
|
}
|
|
2895
|
-
function
|
|
2897
|
+
function _s(e) {
|
|
2896
2898
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2897
2899
|
}
|
|
2898
|
-
function
|
|
2900
|
+
function we(e, t) {
|
|
2899
2901
|
const n = e.permissions?.[t];
|
|
2900
2902
|
return typeof n == "string" && n.length > 0 ? [n] : [];
|
|
2901
2903
|
}
|
|
2902
|
-
function
|
|
2904
|
+
function ys(e, t) {
|
|
2903
2905
|
const n = e.permissions?.[t];
|
|
2904
2906
|
return typeof n == "string" && n.length > 0 ? [n] : [];
|
|
2905
2907
|
}
|
|
2906
|
-
function
|
|
2908
|
+
function bs(e) {
|
|
2907
2909
|
return Array.isArray(e.permission) ? e.permission : typeof e.permission == "string" && e.permission.length > 0 ? [e.permission] : [];
|
|
2908
2910
|
}
|
|
2909
|
-
function
|
|
2911
|
+
function ks(e, t) {
|
|
2910
2912
|
const n = e.slug, o = `/r/${n}`;
|
|
2911
2913
|
return [
|
|
2912
2914
|
{
|
|
@@ -2918,7 +2920,7 @@ function hs(e, t) {
|
|
|
2918
2920
|
kind: "resource",
|
|
2919
2921
|
slug: n,
|
|
2920
2922
|
title: e.label,
|
|
2921
|
-
permissions:
|
|
2923
|
+
permissions: we(e, "view")
|
|
2922
2924
|
},
|
|
2923
2925
|
// slug передаётся в page-component'ы как prop. Конкретный slug запекаем в
|
|
2924
2926
|
// function-mode, чтобы page видел его одинаково и через named-route, и через
|
|
@@ -2934,7 +2936,7 @@ function hs(e, t) {
|
|
|
2934
2936
|
kind: "resource",
|
|
2935
2937
|
slug: n,
|
|
2936
2938
|
title: `${e.label}: создать`,
|
|
2937
|
-
permissions:
|
|
2939
|
+
permissions: we(e, "create")
|
|
2938
2940
|
},
|
|
2939
2941
|
props: { slug: n }
|
|
2940
2942
|
},
|
|
@@ -2947,7 +2949,7 @@ function hs(e, t) {
|
|
|
2947
2949
|
kind: "resource",
|
|
2948
2950
|
slug: n,
|
|
2949
2951
|
title: `${e.label}: редактирование`,
|
|
2950
|
-
permissions:
|
|
2952
|
+
permissions: we(e, "update")
|
|
2951
2953
|
},
|
|
2952
2954
|
// slug запекаем, id из route-params.
|
|
2953
2955
|
props: (a) => ({ slug: n, id: a.params.id })
|
|
@@ -2961,13 +2963,13 @@ function hs(e, t) {
|
|
|
2961
2963
|
kind: "resource",
|
|
2962
2964
|
slug: n,
|
|
2963
2965
|
title: e.label,
|
|
2964
|
-
permissions:
|
|
2966
|
+
permissions: we(e, "view")
|
|
2965
2967
|
},
|
|
2966
2968
|
props: (a) => ({ slug: n, id: a.params.id })
|
|
2967
2969
|
}
|
|
2968
2970
|
];
|
|
2969
2971
|
}
|
|
2970
|
-
function
|
|
2972
|
+
function ws(e, t) {
|
|
2971
2973
|
return {
|
|
2972
2974
|
path: `/screens/${e.slug}`,
|
|
2973
2975
|
name: `admin.screen.${e.slug}`,
|
|
@@ -2977,11 +2979,11 @@ function _s(e, t) {
|
|
|
2977
2979
|
kind: "screen",
|
|
2978
2980
|
slug: e.slug,
|
|
2979
2981
|
title: e.name,
|
|
2980
|
-
permissions:
|
|
2982
|
+
permissions: bs(e)
|
|
2981
2983
|
}
|
|
2982
2984
|
};
|
|
2983
2985
|
}
|
|
2984
|
-
function
|
|
2986
|
+
function $s(e, t) {
|
|
2985
2987
|
return {
|
|
2986
2988
|
path: `/settings/${e.slug}`,
|
|
2987
2989
|
name: `admin.settings.${e.slug}`,
|
|
@@ -2991,11 +2993,11 @@ function ys(e, t) {
|
|
|
2991
2993
|
kind: "settings",
|
|
2992
2994
|
slug: e.slug,
|
|
2993
2995
|
title: e.label,
|
|
2994
|
-
permissions:
|
|
2996
|
+
permissions: ys(e, "view")
|
|
2995
2997
|
}
|
|
2996
2998
|
};
|
|
2997
2999
|
}
|
|
2998
|
-
function
|
|
3000
|
+
function xs(e, t) {
|
|
2999
3001
|
if (typeof e.slug != "string" || e.slug.length === 0) return null;
|
|
3000
3002
|
const n = e.permission, o = Array.isArray(n) ? n : typeof n == "string" && n.length > 0 ? [n] : [];
|
|
3001
3003
|
return {
|
|
@@ -3011,27 +3013,27 @@ function bs(e, t) {
|
|
|
3011
3013
|
}
|
|
3012
3014
|
};
|
|
3013
3015
|
}
|
|
3014
|
-
function
|
|
3016
|
+
function Cs(e, t) {
|
|
3015
3017
|
if (e === null) return [];
|
|
3016
3018
|
const n = [];
|
|
3017
3019
|
for (const o of e.resources)
|
|
3018
|
-
n.push(...
|
|
3020
|
+
n.push(...ks(o, t));
|
|
3019
3021
|
for (const o of e.screens)
|
|
3020
|
-
n.push(
|
|
3022
|
+
n.push(ws(o, t));
|
|
3021
3023
|
for (const o of e.settings)
|
|
3022
|
-
n.push(
|
|
3024
|
+
n.push($s(o, t));
|
|
3023
3025
|
for (const o of e.dashboards) {
|
|
3024
|
-
const a =
|
|
3026
|
+
const a = xs(o, t);
|
|
3025
3027
|
a && n.push(a);
|
|
3026
3028
|
}
|
|
3027
3029
|
return n;
|
|
3028
3030
|
}
|
|
3029
|
-
function
|
|
3031
|
+
function Ss(e = {}) {
|
|
3030
3032
|
const t = e.loginRouteName ?? "admin.login", n = e.forbiddenRouteName ?? "admin.forbidden", o = e.redirectQueryKey ?? "redirect";
|
|
3031
3033
|
return (a) => {
|
|
3032
3034
|
if (a.name === t)
|
|
3033
3035
|
return !0;
|
|
3034
|
-
const l =
|
|
3036
|
+
const l = J();
|
|
3035
3037
|
if (a.meta?.requiresAuth === !0 && !l.isAuthenticated)
|
|
3036
3038
|
return {
|
|
3037
3039
|
name: t,
|
|
@@ -3046,7 +3048,7 @@ function ws(e = {}) {
|
|
|
3046
3048
|
return Array.isArray(u) && u.length > 0 && !l.hasAnyPermission(u) ? { name: n } : !0;
|
|
3047
3049
|
};
|
|
3048
3050
|
}
|
|
3049
|
-
function
|
|
3051
|
+
function As(e = {}) {
|
|
3050
3052
|
const t = e.template, n = e.brand ?? "", o = e.fallback ?? "";
|
|
3051
3053
|
return (a) => {
|
|
3052
3054
|
if (typeof document > "u") return;
|
|
@@ -3055,17 +3057,17 @@ function $s(e = {}) {
|
|
|
3055
3057
|
t ? i = t.replace("{title}", l).replace("{brand}", n) : l && n ? i = `${l} · ${n}` : i = l || n, document.title = i;
|
|
3056
3058
|
};
|
|
3057
3059
|
}
|
|
3058
|
-
const
|
|
3060
|
+
const Rs = [
|
|
3059
3061
|
"admin.resource.",
|
|
3060
3062
|
"admin.screen.",
|
|
3061
3063
|
"admin.settings.",
|
|
3062
3064
|
"admin.dashboard."
|
|
3063
3065
|
];
|
|
3064
|
-
function
|
|
3065
|
-
return typeof e != "string" ? !1 :
|
|
3066
|
+
function Us(e) {
|
|
3067
|
+
return typeof e != "string" ? !1 : Rs.some((t) => e.startsWith(t));
|
|
3066
3068
|
}
|
|
3067
|
-
function
|
|
3068
|
-
const t = e.base ?? "/admin", n = e.history ??
|
|
3069
|
+
function Es(e) {
|
|
3070
|
+
const t = e.base ?? "/admin", n = e.history ?? it(t), o = [
|
|
3069
3071
|
{
|
|
3070
3072
|
path: "/login",
|
|
3071
3073
|
name: "admin.login",
|
|
@@ -3101,22 +3103,22 @@ function Ss(e) {
|
|
|
3101
3103
|
name: "admin.notFound",
|
|
3102
3104
|
component: e.components.notFound,
|
|
3103
3105
|
meta: { kind: "system", title: "404" }
|
|
3104
|
-
}, l =
|
|
3106
|
+
}, l = Et({
|
|
3105
3107
|
history: n,
|
|
3106
3108
|
routes: [...o, ...e.extraRoutes ?? [], a]
|
|
3107
3109
|
});
|
|
3108
|
-
return l.beforeEach(
|
|
3110
|
+
return l.beforeEach(Ss(e.authGuard)), l.afterEach(As(e.titleGuard)), l.replaceManifestRoutes = (i) => {
|
|
3109
3111
|
const u = l.getRoutes();
|
|
3110
3112
|
for (const v of u)
|
|
3111
|
-
|
|
3113
|
+
Us(v.name) && l.removeRoute(v.name);
|
|
3112
3114
|
l.hasRoute("admin.notFound") && l.removeRoute("admin.notFound");
|
|
3113
|
-
const f =
|
|
3115
|
+
const f = Cs(i, e.components);
|
|
3114
3116
|
for (const v of f)
|
|
3115
3117
|
l.addRoute(v);
|
|
3116
3118
|
l.addRoute(a);
|
|
3117
3119
|
}, l;
|
|
3118
3120
|
}
|
|
3119
|
-
const
|
|
3121
|
+
const X = /* @__PURE__ */ L({
|
|
3120
3122
|
__name: "TextField",
|
|
3121
3123
|
props: {
|
|
3122
3124
|
name: {},
|
|
@@ -3130,11 +3132,11 @@ const se = /* @__PURE__ */ L({
|
|
|
3130
3132
|
autocomplete: { default: null }
|
|
3131
3133
|
},
|
|
3132
3134
|
setup(e) {
|
|
3133
|
-
const t = e, n =
|
|
3135
|
+
const t = e, n = de(), o = p(() => n.getField(t.name) ?? ""), a = p(() => n.errors[t.name]?.[0]);
|
|
3134
3136
|
function l(i) {
|
|
3135
3137
|
n.setField(t.name, i);
|
|
3136
3138
|
}
|
|
3137
|
-
return (i, u) => (s(), w(r(
|
|
3139
|
+
return (i, u) => (s(), w(r(re), {
|
|
3138
3140
|
"model-value": o.value,
|
|
3139
3141
|
type: e.inputType,
|
|
3140
3142
|
label: e.label ?? void 0,
|
|
@@ -3149,7 +3151,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3149
3151
|
"onUpdate:modelValue": l
|
|
3150
3152
|
}, null, 8, ["model-value", "type", "label", "hint", "error", "placeholder", "required", "disabled", "readonly", "name", "autocomplete"]));
|
|
3151
3153
|
}
|
|
3152
|
-
}),
|
|
3154
|
+
}), $e = /* @__PURE__ */ L({
|
|
3153
3155
|
__name: "TextAreaField",
|
|
3154
3156
|
props: {
|
|
3155
3157
|
name: {},
|
|
@@ -3162,11 +3164,11 @@ const se = /* @__PURE__ */ L({
|
|
|
3162
3164
|
readonly: { type: Boolean, default: !1 }
|
|
3163
3165
|
},
|
|
3164
3166
|
setup(e) {
|
|
3165
|
-
const t = e, n =
|
|
3167
|
+
const t = e, n = de(), o = p(() => n.getField(t.name) ?? ""), a = p(() => n.errors[t.name]?.[0]);
|
|
3166
3168
|
function l(i) {
|
|
3167
3169
|
n.setField(t.name, i);
|
|
3168
3170
|
}
|
|
3169
|
-
return (i, u) => (s(), w(r(
|
|
3171
|
+
return (i, u) => (s(), w(r(ye), {
|
|
3170
3172
|
label: e.label ?? void 0,
|
|
3171
3173
|
hint: e.help ?? void 0,
|
|
3172
3174
|
error: a.value,
|
|
@@ -3174,7 +3176,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3174
3176
|
disabled: e.disabled
|
|
3175
3177
|
}, {
|
|
3176
3178
|
default: m(() => [
|
|
3177
|
-
x(r(
|
|
3179
|
+
x(r(qt), {
|
|
3178
3180
|
"model-value": o.value,
|
|
3179
3181
|
rows: e.rows,
|
|
3180
3182
|
placeholder: e.placeholder ?? void 0,
|
|
@@ -3187,7 +3189,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3187
3189
|
_: 1
|
|
3188
3190
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3189
3191
|
}
|
|
3190
|
-
}),
|
|
3192
|
+
}), Ve = /* @__PURE__ */ L({
|
|
3191
3193
|
__name: "NumberField",
|
|
3192
3194
|
props: {
|
|
3193
3195
|
name: {},
|
|
@@ -3202,14 +3204,14 @@ const se = /* @__PURE__ */ L({
|
|
|
3202
3204
|
readonly: { type: Boolean, default: !1 }
|
|
3203
3205
|
},
|
|
3204
3206
|
setup(e) {
|
|
3205
|
-
const t = e, n =
|
|
3207
|
+
const t = e, n = de(), o = p(() => {
|
|
3206
3208
|
const i = n.getField(t.name);
|
|
3207
3209
|
return i == null || i === "" ? null : typeof i == "number" ? i : Number(i);
|
|
3208
3210
|
}), a = p(() => n.errors[t.name]?.[0]);
|
|
3209
3211
|
function l(i) {
|
|
3210
3212
|
n.setField(t.name, i);
|
|
3211
3213
|
}
|
|
3212
|
-
return (i, u) => (s(), w(r(
|
|
3214
|
+
return (i, u) => (s(), w(r(ye), {
|
|
3213
3215
|
label: e.label ?? void 0,
|
|
3214
3216
|
hint: e.help ?? void 0,
|
|
3215
3217
|
error: a.value,
|
|
@@ -3217,7 +3219,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3217
3219
|
disabled: e.disabled
|
|
3218
3220
|
}, {
|
|
3219
3221
|
default: m(() => [
|
|
3220
|
-
x(r(
|
|
3222
|
+
x(r(Dt), {
|
|
3221
3223
|
"model-value": o.value,
|
|
3222
3224
|
min: e.min ?? void 0,
|
|
3223
3225
|
max: e.max ?? void 0,
|
|
@@ -3232,7 +3234,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3232
3234
|
_: 1
|
|
3233
3235
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3234
3236
|
}
|
|
3235
|
-
}),
|
|
3237
|
+
}), te = /* @__PURE__ */ L({
|
|
3236
3238
|
__name: "SelectField",
|
|
3237
3239
|
props: {
|
|
3238
3240
|
name: {},
|
|
@@ -3247,14 +3249,14 @@ const se = /* @__PURE__ */ L({
|
|
|
3247
3249
|
size: { default: "md" }
|
|
3248
3250
|
},
|
|
3249
3251
|
setup(e) {
|
|
3250
|
-
const t = e, n =
|
|
3252
|
+
const t = e, n = de(), o = p(() => {
|
|
3251
3253
|
const i = n.getField(t.name);
|
|
3252
3254
|
return i == null || i === "" ? null : i;
|
|
3253
3255
|
}), a = p(() => n.errors[t.name]?.[0]);
|
|
3254
3256
|
function l(i) {
|
|
3255
3257
|
n.setField(t.name, i);
|
|
3256
3258
|
}
|
|
3257
|
-
return (i, u) => (s(), w(r(
|
|
3259
|
+
return (i, u) => (s(), w(r(ye), {
|
|
3258
3260
|
label: e.label ?? void 0,
|
|
3259
3261
|
hint: e.help ?? void 0,
|
|
3260
3262
|
error: a.value,
|
|
@@ -3262,7 +3264,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3262
3264
|
disabled: e.disabled
|
|
3263
3265
|
}, {
|
|
3264
3266
|
default: m(() => [
|
|
3265
|
-
x(r(
|
|
3267
|
+
x(r(Ae), {
|
|
3266
3268
|
"model-value": o.value,
|
|
3267
3269
|
options: e.options,
|
|
3268
3270
|
placeholder: e.placeholder ?? void 0,
|
|
@@ -3276,7 +3278,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3276
3278
|
_: 1
|
|
3277
3279
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3278
3280
|
}
|
|
3279
|
-
}),
|
|
3281
|
+
}), ze = /* @__PURE__ */ L({
|
|
3280
3282
|
__name: "CheckboxField",
|
|
3281
3283
|
props: {
|
|
3282
3284
|
name: {},
|
|
@@ -3287,11 +3289,11 @@ const se = /* @__PURE__ */ L({
|
|
|
3287
3289
|
disabled: { type: Boolean, default: !1 }
|
|
3288
3290
|
},
|
|
3289
3291
|
setup(e) {
|
|
3290
|
-
const t = e, n =
|
|
3292
|
+
const t = e, n = de(), o = p(() => !!n.getField(t.name)), a = p(() => n.errors[t.name]?.[0]);
|
|
3291
3293
|
function l(i) {
|
|
3292
3294
|
n.setField(t.name, i);
|
|
3293
3295
|
}
|
|
3294
|
-
return (i, u) => (s(), w(r(
|
|
3296
|
+
return (i, u) => (s(), w(r(ye), {
|
|
3295
3297
|
label: e.label ?? void 0,
|
|
3296
3298
|
hint: e.help ?? void 0,
|
|
3297
3299
|
error: a.value,
|
|
@@ -3299,7 +3301,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3299
3301
|
disabled: e.disabled
|
|
3300
3302
|
}, {
|
|
3301
3303
|
default: m(() => [
|
|
3302
|
-
x(r(
|
|
3304
|
+
x(r(Se), {
|
|
3303
3305
|
"model-value": o.value,
|
|
3304
3306
|
disabled: e.disabled,
|
|
3305
3307
|
name: e.name,
|
|
@@ -3316,7 +3318,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3316
3318
|
_: 1
|
|
3317
3319
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3318
3320
|
}
|
|
3319
|
-
}),
|
|
3321
|
+
}), oe = /* @__PURE__ */ L({
|
|
3320
3322
|
__name: "DateField",
|
|
3321
3323
|
props: {
|
|
3322
3324
|
name: {},
|
|
@@ -3329,14 +3331,14 @@ const se = /* @__PURE__ */ L({
|
|
|
3329
3331
|
disabled: { type: Boolean, default: !1 }
|
|
3330
3332
|
},
|
|
3331
3333
|
setup(e) {
|
|
3332
|
-
const t = e, n =
|
|
3334
|
+
const t = e, n = de(), o = p(() => {
|
|
3333
3335
|
const i = n.getField(t.name);
|
|
3334
3336
|
return i == null || i === "" ? null : String(i);
|
|
3335
3337
|
}), a = p(() => n.errors[t.name]?.[0]);
|
|
3336
3338
|
function l(i) {
|
|
3337
3339
|
n.setField(t.name, i);
|
|
3338
3340
|
}
|
|
3339
|
-
return (i, u) => (s(), w(r(
|
|
3341
|
+
return (i, u) => (s(), w(r(ye), {
|
|
3340
3342
|
label: e.label ?? void 0,
|
|
3341
3343
|
hint: e.help ?? void 0,
|
|
3342
3344
|
error: a.value,
|
|
@@ -3344,7 +3346,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3344
3346
|
disabled: e.disabled
|
|
3345
3347
|
}, {
|
|
3346
3348
|
default: m(() => [
|
|
3347
|
-
x(r(
|
|
3349
|
+
x(r(Ot), {
|
|
3348
3350
|
"model-value": o.value,
|
|
3349
3351
|
min: e.min ?? void 0,
|
|
3350
3352
|
max: e.max ?? void 0,
|
|
@@ -3356,20 +3358,20 @@ const se = /* @__PURE__ */ L({
|
|
|
3356
3358
|
_: 1
|
|
3357
3359
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3358
3360
|
}
|
|
3359
|
-
}),
|
|
3361
|
+
}), nt = /* @__PURE__ */ L({
|
|
3360
3362
|
__name: "RowsLayout",
|
|
3361
3363
|
props: {
|
|
3362
3364
|
items: {},
|
|
3363
3365
|
gap: { default: "var(--uid-space-md)" }
|
|
3364
3366
|
},
|
|
3365
3367
|
setup(e) {
|
|
3366
|
-
return (t, n) => (s(), w(r(
|
|
3368
|
+
return (t, n) => (s(), w(r(Wt), {
|
|
3367
3369
|
direction: "column",
|
|
3368
3370
|
gap: e.gap,
|
|
3369
3371
|
align: "stretch"
|
|
3370
3372
|
}, {
|
|
3371
3373
|
default: m(() => [
|
|
3372
|
-
(s(!0), c(T, null, I(e.items, (o, a) => (s(), w(
|
|
3374
|
+
(s(!0), c(T, null, I(e.items, (o, a) => (s(), w(be, {
|
|
3373
3375
|
key: a,
|
|
3374
3376
|
node: o
|
|
3375
3377
|
}, null, 8, ["node"]))), 128))
|
|
@@ -3390,7 +3392,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3390
3392
|
const l = a.span;
|
|
3391
3393
|
return typeof l == "number" && l > 0 ? Math.min(l, t.cols) : n.value;
|
|
3392
3394
|
}
|
|
3393
|
-
return (a, l) => (s(), w(r(
|
|
3395
|
+
return (a, l) => (s(), w(r(jt), {
|
|
3394
3396
|
cols: e.cols,
|
|
3395
3397
|
gap: e.gap
|
|
3396
3398
|
}, {
|
|
@@ -3398,9 +3400,9 @@ const se = /* @__PURE__ */ L({
|
|
|
3398
3400
|
(s(!0), c(T, null, I(e.items, (i, u) => (s(), c("div", {
|
|
3399
3401
|
key: u,
|
|
3400
3402
|
class: "admin-columns__item",
|
|
3401
|
-
style:
|
|
3403
|
+
style: Fe({ gridColumn: `span ${o(i)} / span ${o(i)}` })
|
|
3402
3404
|
}, [
|
|
3403
|
-
x(
|
|
3405
|
+
x(be, { node: i }, null, 8, ["node"])
|
|
3404
3406
|
], 4))), 128))
|
|
3405
3407
|
]),
|
|
3406
3408
|
_: 1
|
|
@@ -3415,7 +3417,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3415
3417
|
}, Ts = {
|
|
3416
3418
|
key: 1,
|
|
3417
3419
|
class: "admin-section__description"
|
|
3418
|
-
}, Ms = { class: "admin-section__body" },
|
|
3420
|
+
}, Ms = { class: "admin-section__body" }, ge = /* @__PURE__ */ L({
|
|
3419
3421
|
__name: "SectionLayout",
|
|
3420
3422
|
props: {
|
|
3421
3423
|
items: {},
|
|
@@ -3433,7 +3435,7 @@ const se = /* @__PURE__ */ L({
|
|
|
3433
3435
|
e.description ? (s(), c("p", Ts, h(e.description), 1)) : F("", !0)
|
|
3434
3436
|
])) : F("", !0),
|
|
3435
3437
|
d("div", Ms, [
|
|
3436
|
-
(s(!0), c(T, null, I(e.items, (o, a) => (s(), w(
|
|
3438
|
+
(s(!0), c(T, null, I(e.items, (o, a) => (s(), w(be, {
|
|
3437
3439
|
key: a,
|
|
3438
3440
|
node: o
|
|
3439
3441
|
}, null, 8, ["node"]))), 128))
|
|
@@ -3458,12 +3460,12 @@ const se = /* @__PURE__ */ L({
|
|
|
3458
3460
|
function i(u) {
|
|
3459
3461
|
l.value = u, o("update:active", u);
|
|
3460
3462
|
}
|
|
3461
|
-
return (u, f) => (s(), w(r(
|
|
3463
|
+
return (u, f) => (s(), w(r(ut), {
|
|
3462
3464
|
"model-value": l.value,
|
|
3463
3465
|
"onUpdate:modelValue": i
|
|
3464
3466
|
}, {
|
|
3465
3467
|
list: m(() => [
|
|
3466
|
-
(s(!0), c(T, null, I(e.items, (v, b) => (s(), w(r(
|
|
3468
|
+
(s(!0), c(T, null, I(e.items, (v, b) => (s(), w(r(Ce), {
|
|
3467
3469
|
key: a(v, b),
|
|
3468
3470
|
value: a(v, b)
|
|
3469
3471
|
}, {
|
|
@@ -3474,13 +3476,13 @@ const se = /* @__PURE__ */ L({
|
|
|
3474
3476
|
}, 1032, ["value"]))), 128))
|
|
3475
3477
|
]),
|
|
3476
3478
|
default: m(() => [
|
|
3477
|
-
(s(!0), c(T, null, I(e.items, (v, b) => (s(), w(r(
|
|
3479
|
+
(s(!0), c(T, null, I(e.items, (v, b) => (s(), w(r(dt), {
|
|
3478
3480
|
key: `panel-${a(v, b)}`,
|
|
3479
3481
|
value: a(v, b)
|
|
3480
3482
|
}, {
|
|
3481
3483
|
default: m(() => [
|
|
3482
|
-
(s(!0), c(T, null, I(v.items, (S,
|
|
3483
|
-
key:
|
|
3484
|
+
(s(!0), c(T, null, I(v.items, (S, A) => (s(), w(be, {
|
|
3485
|
+
key: A,
|
|
3484
3486
|
node: S
|
|
3485
3487
|
}, null, 8, ["node"]))), 128))
|
|
3486
3488
|
]),
|
|
@@ -3492,29 +3494,60 @@ const se = /* @__PURE__ */ L({
|
|
|
3492
3494
|
}
|
|
3493
3495
|
});
|
|
3494
3496
|
function Is() {
|
|
3495
|
-
|
|
3497
|
+
Ua({
|
|
3496
3498
|
fields: {
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3499
|
+
// Backend Field-классы из dskripchenko/laravel-admin отдают эти fieldType()
|
|
3500
|
+
// строки. Соответствие см. core/src/Field/{Input,TextArea,Select,...}.php.
|
|
3501
|
+
input: X,
|
|
3502
|
+
text: X,
|
|
3503
|
+
email: X,
|
|
3504
|
+
url: X,
|
|
3505
|
+
password: X,
|
|
3506
|
+
tel: X,
|
|
3507
|
+
search: X,
|
|
3508
|
+
slug: X,
|
|
3509
|
+
hidden: X,
|
|
3510
|
+
label: X,
|
|
3511
|
+
textarea: $e,
|
|
3512
|
+
// Fallback для wysiwyg/markdown/code — обычный TextAreaField.
|
|
3513
|
+
// Реальный rich-editor host подключает через subpath:
|
|
3514
|
+
// import { QuillField } from '@dskripchenko/laravel-admin/quill'
|
|
3515
|
+
// registerField('wysiwyg', QuillField)
|
|
3516
|
+
wysiwyg: $e,
|
|
3517
|
+
markdown: $e,
|
|
3518
|
+
code: $e,
|
|
3519
|
+
number: Ve,
|
|
3520
|
+
slider: Ve,
|
|
3521
|
+
rating: Ve,
|
|
3522
|
+
select: te,
|
|
3523
|
+
combobox: te,
|
|
3524
|
+
radio: te,
|
|
3525
|
+
tags: te,
|
|
3526
|
+
"morph-switcher": te,
|
|
3527
|
+
relation: te,
|
|
3528
|
+
cascader: te,
|
|
3529
|
+
"tree-select": te,
|
|
3530
|
+
checkbox: ze,
|
|
3531
|
+
switcher: ze,
|
|
3532
|
+
boolean: ze,
|
|
3533
|
+
date: oe,
|
|
3534
|
+
datetime: oe,
|
|
3535
|
+
datepicker: oe,
|
|
3536
|
+
"date-range": oe,
|
|
3537
|
+
time: oe,
|
|
3538
|
+
"time-picker": oe,
|
|
3539
|
+
"color-picker": X
|
|
3511
3540
|
},
|
|
3512
3541
|
layouts: {
|
|
3513
|
-
rows:
|
|
3542
|
+
rows: nt,
|
|
3514
3543
|
columns: Fs,
|
|
3515
|
-
section:
|
|
3516
|
-
block:
|
|
3517
|
-
tabs: Ns
|
|
3544
|
+
section: ge,
|
|
3545
|
+
block: ge,
|
|
3546
|
+
tabs: Ns,
|
|
3547
|
+
accordion: ge,
|
|
3548
|
+
group: nt,
|
|
3549
|
+
step: ge,
|
|
3550
|
+
wizard: ge
|
|
3518
3551
|
}
|
|
3519
3552
|
});
|
|
3520
3553
|
}
|
|
@@ -3528,12 +3561,12 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3528
3561
|
mono: { type: Boolean, default: !1 }
|
|
3529
3562
|
},
|
|
3530
3563
|
setup(e) {
|
|
3531
|
-
const t = e, n =
|
|
3564
|
+
const t = e, n = Me(), o = p(() => {
|
|
3532
3565
|
let a = t.value;
|
|
3533
3566
|
return a === void 0 && n && t.name && (a = n[t.name]), a == null || a === "" ? t.placeholder : String(a);
|
|
3534
3567
|
});
|
|
3535
3568
|
return (a, l) => (s(), c("span", {
|
|
3536
|
-
class:
|
|
3569
|
+
class: Y(["admin-infolist-text", e.mono ? "admin-infolist-text--mono" : ""])
|
|
3537
3570
|
}, h(o.value), 3));
|
|
3538
3571
|
}
|
|
3539
3572
|
}), Vs = {
|
|
@@ -3549,11 +3582,11 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3549
3582
|
variant: { default: void 0 }
|
|
3550
3583
|
},
|
|
3551
3584
|
setup(e) {
|
|
3552
|
-
const t = e, n =
|
|
3585
|
+
const t = e, n = Me(), o = p(() => {
|
|
3553
3586
|
let l = t.value;
|
|
3554
3587
|
return l === void 0 && n && t.name && (l = n[t.name]), l == null ? "" : String(l);
|
|
3555
3588
|
}), a = p(() => t.variant ? t.variant : t.map[o.value] ?? "default");
|
|
3556
|
-
return (l, i) => o.value ? (s(), w(r(
|
|
3589
|
+
return (l, i) => o.value ? (s(), w(r(Ke), {
|
|
3557
3590
|
key: 0,
|
|
3558
3591
|
variant: a.value
|
|
3559
3592
|
}, {
|
|
@@ -3575,12 +3608,12 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3575
3608
|
falseLabel: { default: "" }
|
|
3576
3609
|
},
|
|
3577
3610
|
setup(e) {
|
|
3578
|
-
const t = e, n =
|
|
3611
|
+
const t = e, n = Me(), o = p(() => {
|
|
3579
3612
|
let i = t.value;
|
|
3580
3613
|
return i === void 0 && n && t.name && (i = n[t.name]), !!i;
|
|
3581
3614
|
}), a = p(() => o.value ? t.trueLabel : t.falseLabel), l = p(() => o.value ? t.trueIcon : t.falseIcon);
|
|
3582
3615
|
return (i, u) => (s(), c("span", {
|
|
3583
|
-
class:
|
|
3616
|
+
class: Y(["admin-infolist-icon", o.value ? "admin-infolist-icon--on" : "admin-infolist-icon--off"])
|
|
3584
3617
|
}, [
|
|
3585
3618
|
d("span", {
|
|
3586
3619
|
class: "admin-infolist-icon__glyph",
|
|
@@ -3592,7 +3625,7 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3592
3625
|
}), Ws = {
|
|
3593
3626
|
key: 1,
|
|
3594
3627
|
class: "admin-infolist-text"
|
|
3595
|
-
},
|
|
3628
|
+
}, at = /* @__PURE__ */ L({
|
|
3596
3629
|
__name: "KeyValueEntry",
|
|
3597
3630
|
props: {
|
|
3598
3631
|
name: { default: "" },
|
|
@@ -3600,20 +3633,20 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3600
3633
|
value: { default: void 0 }
|
|
3601
3634
|
},
|
|
3602
3635
|
setup(e) {
|
|
3603
|
-
const t = e, n =
|
|
3636
|
+
const t = e, n = Me(), o = p(() => {
|
|
3604
3637
|
let l = t.value;
|
|
3605
3638
|
return l === void 0 && n && t.name && (l = n[t.name]), l == null ? [] : typeof l != "object" ? [] : Object.entries(l);
|
|
3606
3639
|
});
|
|
3607
3640
|
function a(l) {
|
|
3608
3641
|
return l == null ? "—" : typeof l == "object" ? JSON.stringify(l) : String(l);
|
|
3609
3642
|
}
|
|
3610
|
-
return (l, i) => o.value.length > 0 ? (s(), w(r(
|
|
3643
|
+
return (l, i) => o.value.length > 0 ? (s(), w(r(Kt), {
|
|
3611
3644
|
key: 0,
|
|
3612
3645
|
direction: "vertical",
|
|
3613
3646
|
columns: 1
|
|
3614
3647
|
}, {
|
|
3615
3648
|
default: m(() => [
|
|
3616
|
-
(s(!0), c(T, null, I(o.value, ([u, f]) => (s(), w(r(
|
|
3649
|
+
(s(!0), c(T, null, I(o.value, ([u, f]) => (s(), w(r(Gt), {
|
|
3617
3650
|
key: u,
|
|
3618
3651
|
label: u
|
|
3619
3652
|
}, {
|
|
@@ -3628,55 +3661,57 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3628
3661
|
}
|
|
3629
3662
|
});
|
|
3630
3663
|
function js() {
|
|
3631
|
-
|
|
3664
|
+
Ia({
|
|
3632
3665
|
text: Bs,
|
|
3633
3666
|
badge: zs,
|
|
3634
3667
|
icon: Os,
|
|
3635
|
-
keyvalue:
|
|
3636
|
-
"key-value":
|
|
3668
|
+
keyvalue: at,
|
|
3669
|
+
"key-value": at
|
|
3637
3670
|
});
|
|
3638
3671
|
}
|
|
3639
3672
|
function no(e, t = {}) {
|
|
3640
|
-
const n = t.pages ?? {}, o = t.base ?? Ks(e.baseUrl) ?? "/admin", a =
|
|
3673
|
+
const n = t.pages ?? {}, o = t.base ?? Ks(e.baseUrl) ?? "/admin", a = gs({
|
|
3641
3674
|
baseURL: e.apiUrl,
|
|
3642
3675
|
csrfToken: e.csrf
|
|
3643
3676
|
});
|
|
3644
|
-
|
|
3645
|
-
const l =
|
|
3646
|
-
l.use(i),
|
|
3647
|
-
const u =
|
|
3677
|
+
Zt(a);
|
|
3678
|
+
const l = St(Sn), i = Rt();
|
|
3679
|
+
l.use(i), J().hydrate(e), He().hydrate(e), Ge().hydrate(e), Xe().hydrate(e), Is(), vs(), js();
|
|
3680
|
+
const u = Es({
|
|
3648
3681
|
base: o,
|
|
3649
|
-
history: t.router?.history ??
|
|
3682
|
+
history: t.router?.history ?? it(o),
|
|
3650
3683
|
components: {
|
|
3651
|
-
login: n.login ??
|
|
3652
|
-
home: n.home ??
|
|
3653
|
-
forbidden: n.forbidden ??
|
|
3654
|
-
notFound: n.notFound ??
|
|
3655
|
-
profile: n.profile ??
|
|
3656
|
-
resourceIndex: n.resourceIndex ??
|
|
3657
|
-
resourceCreate: n.resourceCreate ??
|
|
3658
|
-
resourceEdit: n.resourceEdit ??
|
|
3659
|
-
resourceView: n.resourceView ??
|
|
3660
|
-
dashboard: n.dashboard ??
|
|
3661
|
-
settings: n.settings ??
|
|
3662
|
-
screen: n.screen ??
|
|
3684
|
+
login: n.login ?? da,
|
|
3685
|
+
home: n.home ?? Tn,
|
|
3686
|
+
forbidden: n.forbidden ?? Nn,
|
|
3687
|
+
notFound: n.notFound ?? Bn,
|
|
3688
|
+
profile: n.profile ?? Cl,
|
|
3689
|
+
resourceIndex: n.resourceIndex ?? Ra,
|
|
3690
|
+
resourceCreate: n.resourceCreate ?? et,
|
|
3691
|
+
resourceEdit: n.resourceEdit ?? et,
|
|
3692
|
+
resourceView: n.resourceView ?? al,
|
|
3693
|
+
dashboard: n.dashboard ?? Il,
|
|
3694
|
+
settings: n.settings ?? On,
|
|
3695
|
+
screen: n.screen ?? Gn
|
|
3663
3696
|
},
|
|
3664
3697
|
extraRoutes: t.router?.extraRoutes,
|
|
3665
3698
|
authGuard: t.router?.authGuard,
|
|
3666
3699
|
titleGuard: t.router?.titleGuard
|
|
3667
3700
|
});
|
|
3668
3701
|
if (l.use(u), !t.skipManifestLoad) {
|
|
3669
|
-
const f =
|
|
3702
|
+
const f = se(), v = J(), b = () => {
|
|
3670
3703
|
f.load().then((S) => {
|
|
3671
3704
|
u.replaceManifestRoutes(S);
|
|
3705
|
+
const A = u.currentRoute.value;
|
|
3706
|
+
A.name === "admin.notFound" && A.fullPath !== "/" && u.replace(A.fullPath);
|
|
3672
3707
|
}).catch((S) => {
|
|
3673
3708
|
typeof console < "u" && console.error("[laravel-admin] manifest load failed:", S);
|
|
3674
3709
|
});
|
|
3675
3710
|
};
|
|
3676
|
-
v.isAuthenticated && b(),
|
|
3711
|
+
v.isAuthenticated && b(), ne(
|
|
3677
3712
|
() => v.user,
|
|
3678
|
-
(S,
|
|
3679
|
-
S && !
|
|
3713
|
+
(S, A) => {
|
|
3714
|
+
S && !A && b();
|
|
3680
3715
|
}
|
|
3681
3716
|
);
|
|
3682
3717
|
}
|
|
@@ -3699,7 +3734,7 @@ async function ao(e = {}) {
|
|
|
3699
3734
|
const n = e.xhrUrl ?? "/system/bootstrap";
|
|
3700
3735
|
return await e.client.get(n);
|
|
3701
3736
|
} catch (n) {
|
|
3702
|
-
if (n instanceof
|
|
3737
|
+
if (n instanceof Pe)
|
|
3703
3738
|
return null;
|
|
3704
3739
|
throw n;
|
|
3705
3740
|
}
|
|
@@ -3736,11 +3771,11 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3736
3771
|
},
|
|
3737
3772
|
emits: ["update:open", "select-item"],
|
|
3738
3773
|
setup(e, { emit: t }) {
|
|
3739
|
-
const n = e, o = t, a =
|
|
3774
|
+
const n = e, o = t, a = Xe();
|
|
3740
3775
|
function l(g) {
|
|
3741
3776
|
o("update:open", g);
|
|
3742
3777
|
}
|
|
3743
|
-
|
|
3778
|
+
ne(
|
|
3744
3779
|
() => n.open,
|
|
3745
3780
|
async (g) => {
|
|
3746
3781
|
g && await a.load(a.lastFilter ?? "all", 1).catch(() => {
|
|
@@ -3769,10 +3804,10 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3769
3804
|
const U = g.data.level;
|
|
3770
3805
|
return U === "success" || U === "warning" || U === "danger" ? U : "info";
|
|
3771
3806
|
}
|
|
3772
|
-
function
|
|
3807
|
+
function A(g) {
|
|
3773
3808
|
return g.data.title ?? "—";
|
|
3774
3809
|
}
|
|
3775
|
-
function
|
|
3810
|
+
function R(g) {
|
|
3776
3811
|
return g.data.body ?? "";
|
|
3777
3812
|
}
|
|
3778
3813
|
function _(g) {
|
|
@@ -3785,7 +3820,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3785
3820
|
const $ = Math.floor(y / 24);
|
|
3786
3821
|
return $ < 7 ? `${$} д назад` : U.toLocaleDateString("ru-RU");
|
|
3787
3822
|
}
|
|
3788
|
-
return (g, U) => (s(), w(r(
|
|
3823
|
+
return (g, U) => (s(), w(r(Ht), {
|
|
3789
3824
|
"model-value": e.open,
|
|
3790
3825
|
side: "right",
|
|
3791
3826
|
width: "400px",
|
|
@@ -3812,18 +3847,18 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3812
3847
|
])
|
|
3813
3848
|
]),
|
|
3814
3849
|
default: m(() => [
|
|
3815
|
-
x(r(
|
|
3850
|
+
x(r(ut), {
|
|
3816
3851
|
"model-value": i.value,
|
|
3817
3852
|
"onUpdate:modelValue": u
|
|
3818
3853
|
}, {
|
|
3819
3854
|
list: m(() => [
|
|
3820
|
-
x(r(
|
|
3855
|
+
x(r(Ce), { value: "all" }, {
|
|
3821
3856
|
default: m(() => [...U[2] || (U[2] = [
|
|
3822
3857
|
C("Все", -1)
|
|
3823
3858
|
])]),
|
|
3824
3859
|
_: 1
|
|
3825
3860
|
}),
|
|
3826
|
-
x(r(
|
|
3861
|
+
x(r(Ce), { value: "unread" }, {
|
|
3827
3862
|
default: m(() => [
|
|
3828
3863
|
U[3] || (U[3] = C(" Непрочитанные", -1)),
|
|
3829
3864
|
r(a).unreadCount > 0 ? (s(), c(T, { key: 0 }, [
|
|
@@ -3832,7 +3867,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3832
3867
|
]),
|
|
3833
3868
|
_: 1
|
|
3834
3869
|
}),
|
|
3835
|
-
x(r(
|
|
3870
|
+
x(r(Ce), { value: "read" }, {
|
|
3836
3871
|
default: m(() => [...U[4] || (U[4] = [
|
|
3837
3872
|
C("Прочитанные", -1)
|
|
3838
3873
|
])]),
|
|
@@ -3840,7 +3875,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3840
3875
|
})
|
|
3841
3876
|
]),
|
|
3842
3877
|
default: m(() => [
|
|
3843
|
-
(s(), c(T, null, I(["all", "unread", "read"], (P) => x(r(
|
|
3878
|
+
(s(), c(T, null, I(["all", "unread", "read"], (P) => x(r(dt), {
|
|
3844
3879
|
key: P,
|
|
3845
3880
|
value: P
|
|
3846
3881
|
}, {
|
|
@@ -3849,7 +3884,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3849
3884
|
r(a).loading ? (s(), c("li", Qs, " Загрузка… ")) : r(a).items.length === 0 ? (s(), c("li", Zs, " Нет уведомлений ")) : F("", !0),
|
|
3850
3885
|
(s(!0), c(T, null, I(r(a).items, (k) => (s(), c("li", {
|
|
3851
3886
|
key: k.id,
|
|
3852
|
-
class:
|
|
3887
|
+
class: Y([
|
|
3853
3888
|
"admin-notifs__item",
|
|
3854
3889
|
`admin-notifs__item--${S(k)}`,
|
|
3855
3890
|
{ "admin-notifs__item--unread": !k.read_at }
|
|
@@ -3862,10 +3897,10 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3862
3897
|
}, null, 8, ti),
|
|
3863
3898
|
d("div", ni, [
|
|
3864
3899
|
d("div", ai, [
|
|
3865
|
-
k.read_at ? (s(), c("span", si, h(
|
|
3900
|
+
k.read_at ? (s(), c("span", si, h(A(k)), 1)) : (s(), c("strong", li, h(A(k)), 1)),
|
|
3866
3901
|
d("span", ii, h(_(k.created_at)), 1)
|
|
3867
3902
|
]),
|
|
3868
|
-
|
|
3903
|
+
R(k) ? (s(), c("p", oi, h(R(k)), 1)) : F("", !0)
|
|
3869
3904
|
]),
|
|
3870
3905
|
d("button", {
|
|
3871
3906
|
type: "button",
|
|
@@ -3930,14 +3965,14 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3930
3965
|
function S(y, $) {
|
|
3931
3966
|
b.value[y] = $ === null || $ === "" ? null : String($);
|
|
3932
3967
|
}
|
|
3933
|
-
function
|
|
3968
|
+
function A() {
|
|
3934
3969
|
return n.headers.map((y) => ({
|
|
3935
3970
|
source: y.key,
|
|
3936
3971
|
target: b.value[y.key] ?? null
|
|
3937
3972
|
}));
|
|
3938
3973
|
}
|
|
3939
|
-
function
|
|
3940
|
-
o("mapping-submit",
|
|
3974
|
+
function R() {
|
|
3975
|
+
o("mapping-submit", A()), u(2);
|
|
3941
3976
|
}
|
|
3942
3977
|
function _() {
|
|
3943
3978
|
o("run-import"), u(3);
|
|
@@ -3977,7 +4012,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3977
4012
|
})
|
|
3978
4013
|
])
|
|
3979
4014
|
]),
|
|
3980
|
-
x(r(
|
|
4015
|
+
x(r(Xt), {
|
|
3981
4016
|
steps: a,
|
|
3982
4017
|
current: i.value
|
|
3983
4018
|
}, null, 8, ["current"]),
|
|
@@ -3991,7 +4026,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3991
4026
|
d("h3", null, "1. Загрузите файл"),
|
|
3992
4027
|
d("p", null, "CSV / TSV / XLSX, до 50 MB")
|
|
3993
4028
|
], -1)),
|
|
3994
|
-
x(r(
|
|
4029
|
+
x(r(Jt), {
|
|
3995
4030
|
"model-value": f.value,
|
|
3996
4031
|
accept: ".csv,.tsv,.xlsx",
|
|
3997
4032
|
"max-size": 50 * 1024 * 1024,
|
|
@@ -4022,11 +4057,11 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4022
4057
|
V.sample ? (s(), c("span", hi, " «" + h(V.sample) + "» ", 1)) : F("", !0)
|
|
4023
4058
|
]),
|
|
4024
4059
|
$[4] || ($[4] = d("span", { class: "admin-import-wizard__map-arrow" }, "→", -1)),
|
|
4025
|
-
x(r(
|
|
4060
|
+
x(r(Ae), {
|
|
4026
4061
|
"model-value": b.value[V.key] ?? "",
|
|
4027
4062
|
options: P.value,
|
|
4028
4063
|
placeholder: "Не импортировать",
|
|
4029
|
-
"onUpdate:modelValue": (
|
|
4064
|
+
"onUpdate:modelValue": (K) => S(V.key, K)
|
|
4030
4065
|
}, null, 8, ["model-value", "options", "onUpdate:modelValue"])
|
|
4031
4066
|
]))), 128))
|
|
4032
4067
|
]))
|
|
@@ -4042,7 +4077,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4042
4077
|
$[6] || ($[6] = d("h3", null, "3. Предпросмотр", -1)),
|
|
4043
4078
|
d("p", null, "Первые " + h(e.preview.length) + " строк перед импортом", 1)
|
|
4044
4079
|
]),
|
|
4045
|
-
e.preview.some((V) => V.__warning) ? (s(), w(r(
|
|
4080
|
+
e.preview.some((V) => V.__warning) ? (s(), w(r(Q), {
|
|
4046
4081
|
key: 0,
|
|
4047
4082
|
variant: "warning",
|
|
4048
4083
|
style: { "margin-bottom": "var(--uid-space-md)" }
|
|
@@ -4052,7 +4087,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4052
4087
|
])]),
|
|
4053
4088
|
_: 1
|
|
4054
4089
|
})) : F("", !0),
|
|
4055
|
-
e.previewColumns.length > 0 ? (s(), w(r(
|
|
4090
|
+
e.previewColumns.length > 0 ? (s(), w(r(je), {
|
|
4056
4091
|
key: 1,
|
|
4057
4092
|
columns: e.previewColumns,
|
|
4058
4093
|
data: e.preview
|
|
@@ -4069,23 +4104,23 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4069
4104
|
d("h3", null, "4. Импорт")
|
|
4070
4105
|
], -1)),
|
|
4071
4106
|
e.progress ? (s(), c(T, { key: 1 }, [
|
|
4072
|
-
e.progress.total > 0 ? (s(), w(r(
|
|
4107
|
+
e.progress.total > 0 ? (s(), w(r(Yt), {
|
|
4073
4108
|
key: 0,
|
|
4074
4109
|
"model-value": e.progress.created + e.progress.updated + e.progress.errors,
|
|
4075
4110
|
max: e.progress.total
|
|
4076
4111
|
}, null, 8, ["model-value", "max"])) : F("", !0),
|
|
4077
4112
|
d("div", ki, [
|
|
4078
|
-
x(r(
|
|
4113
|
+
x(r(xe), {
|
|
4079
4114
|
title: "Создано",
|
|
4080
4115
|
value: e.progress.created,
|
|
4081
4116
|
tone: "success"
|
|
4082
4117
|
}, null, 8, ["value"]),
|
|
4083
|
-
x(r(
|
|
4118
|
+
x(r(xe), {
|
|
4084
4119
|
title: "Обновлено",
|
|
4085
4120
|
value: e.progress.updated,
|
|
4086
4121
|
tone: "info"
|
|
4087
4122
|
}, null, 8, ["value"]),
|
|
4088
|
-
x(r(
|
|
4123
|
+
x(r(xe), {
|
|
4089
4124
|
title: "Ошибки",
|
|
4090
4125
|
value: e.progress.errors,
|
|
4091
4126
|
tone: "danger"
|
|
@@ -4121,7 +4156,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4121
4156
|
key: 2,
|
|
4122
4157
|
variant: "primary",
|
|
4123
4158
|
disabled: !U.value,
|
|
4124
|
-
onClick:
|
|
4159
|
+
onClick: R
|
|
4125
4160
|
}, {
|
|
4126
4161
|
default: m(() => [...$[11] || ($[11] = [
|
|
4127
4162
|
C(" Подтвердить mapping ", -1)
|
|
@@ -4204,10 +4239,10 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4204
4239
|
node: { type: "date", name: "demo_date", label: "Дата публикации", inputType: "date" },
|
|
4205
4240
|
initial: { demo_date: "2026-05-01" }
|
|
4206
4241
|
}
|
|
4207
|
-
], n = t.reduce((a, l) => (a[l.group] || (a[l.group] = []), a[l.group].push(l), a), {}), o =
|
|
4242
|
+
], n = t.reduce((a, l) => (a[l.group] || (a[l.group] = []), a[l.group].push(l), a), {}), o = At(
|
|
4208
4243
|
t.reduce((a, l) => Object.assign(a, l.initial), {})
|
|
4209
4244
|
);
|
|
4210
|
-
return
|
|
4245
|
+
return ct(o), (a, l) => (s(), c("section", $i, [
|
|
4211
4246
|
l[0] || (l[0] = d("header", { class: "admin-page__hd" }, [
|
|
4212
4247
|
d("div", { class: "admin-page__title-wrap" }, [
|
|
4213
4248
|
d("h1", { class: "admin-page__title" }, "Field Gallery"),
|
|
@@ -4232,7 +4267,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4232
4267
|
]),
|
|
4233
4268
|
d("p", Ui, h(f.description), 1),
|
|
4234
4269
|
d("div", Ei, [
|
|
4235
|
-
x(
|
|
4270
|
+
x(_t, {
|
|
4236
4271
|
node: f.node
|
|
4237
4272
|
}, null, 8, ["node"])
|
|
4238
4273
|
])
|
|
@@ -4245,118 +4280,118 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4245
4280
|
}
|
|
4246
4281
|
});
|
|
4247
4282
|
export {
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4283
|
+
Sn as AdminApp,
|
|
4284
|
+
Cn as AdminShell,
|
|
4285
|
+
wn as AdminSidebar,
|
|
4286
|
+
fn as AdminTopBar,
|
|
4287
|
+
Z as ApiError,
|
|
4253
4288
|
zs as BadgeEntry,
|
|
4254
|
-
|
|
4255
|
-
|
|
4289
|
+
Wl as BarChartWidget,
|
|
4290
|
+
ze as CheckboxField,
|
|
4256
4291
|
Fs as ColumnsLayout,
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4292
|
+
Il as DashboardPage,
|
|
4293
|
+
oe as DateField,
|
|
4294
|
+
Zl as DonutChartWidget,
|
|
4260
4295
|
oo as FieldGalleryPage,
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4296
|
+
_t as FieldRenderer,
|
|
4297
|
+
sn as ForbiddenError,
|
|
4298
|
+
Nn as ForbiddenPage,
|
|
4299
|
+
us as GaugeWidget,
|
|
4300
|
+
ss as HeatmapWidget,
|
|
4301
|
+
Tn as HomePage,
|
|
4267
4302
|
Os as IconEntry,
|
|
4268
4303
|
io as ImportWizardPage,
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4304
|
+
Xa as InfolistRenderer,
|
|
4305
|
+
at as KeyValueEntry,
|
|
4306
|
+
be as LayoutRenderer,
|
|
4307
|
+
ft as LocaleSwitcher,
|
|
4308
|
+
Qn as LoginForm,
|
|
4309
|
+
da as LoginPage,
|
|
4310
|
+
fs as MarkdownWidget,
|
|
4311
|
+
Pe as NetworkError,
|
|
4312
|
+
on as NotFoundError,
|
|
4313
|
+
Bn as NotFoundPage,
|
|
4314
|
+
ln as NotificationBell,
|
|
4280
4315
|
so as NotificationsDrawer,
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4316
|
+
Ve as NumberField,
|
|
4317
|
+
Cl as ProfilePage,
|
|
4318
|
+
ns as RecentTableWidget,
|
|
4319
|
+
et as ResourceFormPage,
|
|
4320
|
+
Ra as ResourceIndexPage,
|
|
4321
|
+
al as ResourceViewPage,
|
|
4322
|
+
nt as RowsLayout,
|
|
4323
|
+
ge as SectionLayout,
|
|
4324
|
+
te as SelectField,
|
|
4325
|
+
On as SettingsPage,
|
|
4326
|
+
Bl as StatWidget,
|
|
4292
4327
|
Ns as TabsLayout,
|
|
4293
|
-
|
|
4328
|
+
$e as TextAreaField,
|
|
4294
4329
|
Bs as TextEntry,
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4330
|
+
X as TextField,
|
|
4331
|
+
mt as ThemeToggle,
|
|
4332
|
+
ta as TwoFactorForm,
|
|
4333
|
+
vt as UnauthenticatedError,
|
|
4334
|
+
Ba as UnknownEntry,
|
|
4335
|
+
ht as UnknownField,
|
|
4336
|
+
Gn as UnknownScreenPage,
|
|
4337
|
+
Rl as UnknownWidget,
|
|
4338
|
+
un as UserMenu,
|
|
4339
|
+
Le as ValidationError,
|
|
4340
|
+
Ul as WidgetRenderer,
|
|
4341
|
+
Cs as buildRoutesFromManifest,
|
|
4307
4342
|
Ii as clearAdminClient,
|
|
4308
4343
|
Xi as clearInfolistRegistry,
|
|
4309
4344
|
ji as clearRegistry,
|
|
4310
4345
|
eo as clearWidgetRegistry,
|
|
4311
4346
|
no as createAdminApp,
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4347
|
+
gs as createAdminClient,
|
|
4348
|
+
Es as createAdminRouter,
|
|
4349
|
+
Ss as createAuthGuard,
|
|
4350
|
+
As as createTitleGuard,
|
|
4316
4351
|
W as getAdminClient,
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4352
|
+
gt as getField,
|
|
4353
|
+
tt as getInfolistEntry,
|
|
4354
|
+
Ze as getLayout,
|
|
4355
|
+
Sl as getWidget,
|
|
4321
4356
|
Bi as hasAdminClient,
|
|
4322
4357
|
zi as hasField,
|
|
4323
4358
|
Gi as hasInfolistEntry,
|
|
4324
4359
|
Oi as hasLayout,
|
|
4325
4360
|
Qi as hasWidget,
|
|
4326
4361
|
to as isError,
|
|
4327
|
-
|
|
4362
|
+
ps as isSuccess,
|
|
4328
4363
|
qi as listFields,
|
|
4329
4364
|
Hi as listInfolistEntries,
|
|
4330
4365
|
Wi as listLayouts,
|
|
4331
4366
|
Zi as listWidgets,
|
|
4332
4367
|
ao as loadBootstrap,
|
|
4333
|
-
|
|
4334
|
-
|
|
4368
|
+
ct as provideFormState,
|
|
4369
|
+
Ja as provideRecord,
|
|
4335
4370
|
lo as readCsrfFromMeta,
|
|
4336
4371
|
Gs as readInlineBootstrap,
|
|
4337
4372
|
Is as registerBuiltinComponents,
|
|
4338
4373
|
js as registerBuiltinInfolistEntries,
|
|
4339
|
-
|
|
4340
|
-
|
|
4374
|
+
vs as registerBuiltinWidgets,
|
|
4375
|
+
Ua as registerComponents,
|
|
4341
4376
|
Vi as registerField,
|
|
4342
|
-
|
|
4377
|
+
Ia as registerInfolistEntries,
|
|
4343
4378
|
Ki as registerInfolistEntry,
|
|
4344
4379
|
Di as registerLayout,
|
|
4345
4380
|
Yi as registerWidget,
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4381
|
+
Al as registerWidgets,
|
|
4382
|
+
Zt as setAdminClient,
|
|
4383
|
+
Ye as toApiError,
|
|
4349
4384
|
co as tryUseFormState,
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4385
|
+
Me as tryUseRecord,
|
|
4386
|
+
J as useAuthStore,
|
|
4387
|
+
de as useFormState,
|
|
4388
|
+
He as useLocaleStore,
|
|
4389
|
+
se as useManifestStore,
|
|
4390
|
+
vn as useMenuStore,
|
|
4391
|
+
Xe as useNotificationsStore,
|
|
4357
4392
|
Ji as useRecord,
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4393
|
+
pt as useResourceFormStore,
|
|
4394
|
+
ca as useResourceIndexStore,
|
|
4395
|
+
Ge as useThemeStore
|
|
4361
4396
|
};
|
|
4362
4397
|
//# sourceMappingURL=index.mjs.map
|