@dskripchenko/laravel-admin 1.1.7 → 1.1.9
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/components/infolist/builtin.d.ts +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +892 -853
- 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
|
|
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 B, createTextVNode as C, toDisplayString as h, createCommentVNode as F, createVNode as x, renderSlot as X, resolveDynamicComponent as de, normalizeClass as Q, createSlots as De, h as $t, watch as ae, onBeforeUnmount as xt, resolveComponent as st, withModifiers as We, nextTick as Be, onMounted as Ue, withKeys as Ct, normalizeProps as Ee, mergeProps as Fe, normalizeStyle as Le, inject as it, provide as St, createApp as At, reactive as Rt } from "vue";
|
|
2
|
+
import { defineStore as le, createPinia as Ut } from "pinia";
|
|
3
|
+
import { RouterLink as Et, useRouter as se, useRoute as ye, createWebHistory as ot, createRouter as Ft } from "vue-router";
|
|
4
|
+
import { UidMenu as rt, UidMenuItem as Oe, UidMenuSeparator as Lt, UidAvatar as ut, UidSidebar as Pt, UidSidebarGroup as Tt, UidSidebarItem as Mt, UidSidebarLayout as Nt, UidCard as D, UidButton as V, UidAlert as Z, UidInput as ue, UidCheckbox as Ae, UidSkeleton as je, UidErrorState as It, UidEmptyState as Bt, UidTable as Ke, UidPagination as Vt, UidBadge as Ge, UidSelect as Re, UidStat as Ce, UidHeatmap as zt, UidGauge as qt, UidFormField as be, UidTextarea as Dt, UidNumberInput as Ot, UidDatePicker as Wt, UidStack as jt, UidGrid as Kt, UidTabs as dt, UidTabPanel as ct, UidTab as Se, UidDescriptionList as Gt, UidDescriptionItem as Ht, UidDrawer as Xt, UidStepper as Jt, UidFileUpload as Yt, UidProgress as Qt } from "@dskripchenko/ui";
|
|
5
|
+
import Zt from "axios";
|
|
6
|
+
import { p as mt, u as ce } from "./formState-DGNcH1XQ.js";
|
|
7
7
|
import { t as co } from "./formState-DGNcH1XQ.js";
|
|
8
|
-
let
|
|
9
|
-
function
|
|
10
|
-
|
|
8
|
+
let _e = null;
|
|
9
|
+
function en(e) {
|
|
10
|
+
_e = e;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (
|
|
12
|
+
function j() {
|
|
13
|
+
if (_e === null)
|
|
14
14
|
throw new Error(
|
|
15
15
|
"[admin] AdminClient is not registered. Call setAdminClient(...) before using stores."
|
|
16
16
|
);
|
|
17
|
-
return
|
|
17
|
+
return _e;
|
|
18
18
|
}
|
|
19
19
|
function Ii() {
|
|
20
|
-
|
|
20
|
+
_e = null;
|
|
21
21
|
}
|
|
22
22
|
function Bi() {
|
|
23
|
-
return
|
|
23
|
+
return _e !== null;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const He = le("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);
|
|
@@ -38,7 +38,7 @@ const Ge = ne("admin-theme", () => {
|
|
|
38
38
|
const f = e.value;
|
|
39
39
|
a(u);
|
|
40
40
|
try {
|
|
41
|
-
await
|
|
41
|
+
await j().post("/system/setTheme", { theme: u });
|
|
42
42
|
} catch (v) {
|
|
43
43
|
throw a(f), v;
|
|
44
44
|
}
|
|
@@ -54,10 +54,10 @@ const Ge = ne("admin-theme", () => {
|
|
|
54
54
|
applyLocal: a,
|
|
55
55
|
setTheme: l
|
|
56
56
|
};
|
|
57
|
-
}),
|
|
57
|
+
}), tn = ["aria-label", "aria-pressed"], nn = ["data-icon"], ft = /* @__PURE__ */ L({
|
|
58
58
|
__name: "ThemeToggle",
|
|
59
59
|
setup(e) {
|
|
60
|
-
const t =
|
|
60
|
+
const t = He(), 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 Ge = ne("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, nn)
|
|
78
|
+
], 8, tn));
|
|
79
79
|
}
|
|
80
|
-
}),
|
|
80
|
+
}), Xe = le("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);
|
|
@@ -93,7 +93,7 @@ const Ge = ne("admin-theme", () => {
|
|
|
93
93
|
const u = e.value;
|
|
94
94
|
o(i);
|
|
95
95
|
try {
|
|
96
|
-
await
|
|
96
|
+
await j().post("/system/setLocale", { locale: i });
|
|
97
97
|
} catch (f) {
|
|
98
98
|
throw o(u), f;
|
|
99
99
|
}
|
|
@@ -101,7 +101,7 @@ const Ge = ne("admin-theme", () => {
|
|
|
101
101
|
function l(i) {
|
|
102
102
|
typeof document < "u" && document.documentElement && document.documentElement.setAttribute("lang", i);
|
|
103
103
|
try {
|
|
104
|
-
|
|
104
|
+
j().setLocale(i);
|
|
105
105
|
} catch {
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -112,21 +112,21 @@ const Ge = ne("admin-theme", () => {
|
|
|
112
112
|
applyLocal: o,
|
|
113
113
|
setLocale: a
|
|
114
114
|
};
|
|
115
|
-
}),
|
|
115
|
+
}), an = {
|
|
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
|
+
}, vt = /* @__PURE__ */ L({
|
|
121
121
|
__name: "LocaleSwitcher",
|
|
122
122
|
setup(e) {
|
|
123
|
-
const t =
|
|
123
|
+
const t = Xe();
|
|
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(rt), null, {
|
|
128
128
|
trigger: m(() => [
|
|
129
|
-
d("button",
|
|
129
|
+
d("button", an, [
|
|
130
130
|
a[0] || (a[0] = d("span", {
|
|
131
131
|
class: "admin-topbar__icon",
|
|
132
132
|
"data-icon": "globe"
|
|
@@ -135,7 +135,7 @@ const Ge = ne("admin-theme", () => {
|
|
|
135
135
|
])
|
|
136
136
|
]),
|
|
137
137
|
default: m(() => [
|
|
138
|
-
(s(!0), c(T, null,
|
|
138
|
+
(s(!0), c(T, null, B(r(t).available, (l) => (s(), w(r(Oe), {
|
|
139
139
|
key: l,
|
|
140
140
|
onClick: (i) => n(l)
|
|
141
141
|
}, {
|
|
@@ -148,7 +148,7 @@ const Ge = ne("admin-theme", () => {
|
|
|
148
148
|
_: 1
|
|
149
149
|
}));
|
|
150
150
|
}
|
|
151
|
-
}),
|
|
151
|
+
}), Je = le("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
153
|
function i(A) {
|
|
154
154
|
t.value = A.unread_notifications_count;
|
|
@@ -156,7 +156,7 @@ const Ge = ne("admin-theme", () => {
|
|
|
156
156
|
async function u(A = "all", R = 1) {
|
|
157
157
|
n.value = !0;
|
|
158
158
|
try {
|
|
159
|
-
const g = await
|
|
159
|
+
const g = await j().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,
|
|
@@ -168,25 +168,25 @@ const Ge = ne("admin-theme", () => {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
async function f() {
|
|
171
|
-
const R = await
|
|
171
|
+
const R = await j().get(
|
|
172
172
|
"/notifications/unread"
|
|
173
173
|
);
|
|
174
174
|
t.value = R.count, o.value === "unread" && (e.value = R.data);
|
|
175
175
|
}
|
|
176
176
|
async function v(A) {
|
|
177
|
-
await
|
|
177
|
+
await j().post("/notifications/markAsRead", { id: A });
|
|
178
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
|
-
await
|
|
182
|
+
await j().post("/notifications/markAllAsRead");
|
|
183
183
|
const R = (/* @__PURE__ */ new Date()).toISOString();
|
|
184
184
|
for (const _ of e.value)
|
|
185
185
|
_.read_at === null && (_.read_at = R);
|
|
186
186
|
t.value = 0;
|
|
187
187
|
}
|
|
188
188
|
async function S(A) {
|
|
189
|
-
await
|
|
189
|
+
await j().post("/notifications/destroy", { id: A });
|
|
190
190
|
const _ = e.value.findIndex((g) => g.id === A);
|
|
191
191
|
if (_ !== -1) {
|
|
192
192
|
const g = e.value[_].read_at === null;
|
|
@@ -207,14 +207,14 @@ const Ge = ne("admin-theme", () => {
|
|
|
207
207
|
markAllAsRead: b,
|
|
208
208
|
destroy: S
|
|
209
209
|
};
|
|
210
|
-
}),
|
|
210
|
+
}), ln = ["title"], sn = /* @__PURE__ */ L({
|
|
211
211
|
__name: "NotificationBell",
|
|
212
212
|
setup(e) {
|
|
213
|
-
const t =
|
|
213
|
+
const t = Je(), 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(Et), {
|
|
218
218
|
to: "/notifications",
|
|
219
219
|
class: "admin-topbar__icon-btn",
|
|
220
220
|
"aria-label": "Уведомления"
|
|
@@ -228,13 +228,13 @@ const Ge = ne("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, ln)) : F("", !0)
|
|
232
232
|
]),
|
|
233
233
|
_: 1
|
|
234
234
|
}));
|
|
235
235
|
}
|
|
236
236
|
});
|
|
237
|
-
class
|
|
237
|
+
class ee extends Error {
|
|
238
238
|
status;
|
|
239
239
|
errorKey;
|
|
240
240
|
payload;
|
|
@@ -242,22 +242,22 @@ class Z 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 pt extends ee {
|
|
246
246
|
constructor(t) {
|
|
247
247
|
super(401, t), this.name = "UnauthenticatedError";
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
class
|
|
250
|
+
class on extends ee {
|
|
251
251
|
constructor(t) {
|
|
252
252
|
super(403, t), this.name = "ForbiddenError";
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
class
|
|
255
|
+
class rn extends ee {
|
|
256
256
|
constructor(t) {
|
|
257
257
|
super(404, t), this.name = "NotFoundError";
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
class
|
|
260
|
+
class Pe extends ee {
|
|
261
261
|
/** Field-keyed map of error messages. */
|
|
262
262
|
fields;
|
|
263
263
|
constructor(t) {
|
|
@@ -271,26 +271,26 @@ class Le extends Z {
|
|
|
271
271
|
return null;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
class
|
|
274
|
+
class Te extends Error {
|
|
275
275
|
constructor(t = "Network error") {
|
|
276
276
|
super(t), this.name = "NetworkError";
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Qe(e, t) {
|
|
280
280
|
switch (e) {
|
|
281
281
|
case 401:
|
|
282
|
-
return new
|
|
282
|
+
return new pt(t);
|
|
283
283
|
case 403:
|
|
284
|
-
return new sn(t);
|
|
285
|
-
case 404:
|
|
286
284
|
return new on(t);
|
|
285
|
+
case 404:
|
|
286
|
+
return new rn(t);
|
|
287
287
|
case 422:
|
|
288
|
-
return new
|
|
288
|
+
return new Pe(t);
|
|
289
289
|
default:
|
|
290
|
-
return new
|
|
290
|
+
return new ee(e, t);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
const
|
|
293
|
+
const Y = le("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;
|
|
@@ -309,7 +309,7 @@ const J = ne("admin-auth", () => {
|
|
|
309
309
|
return _.every(i);
|
|
310
310
|
}
|
|
311
311
|
async function v(_) {
|
|
312
|
-
const g =
|
|
312
|
+
const g = j();
|
|
313
313
|
try {
|
|
314
314
|
const U = await g.post(
|
|
315
315
|
"/auth/login",
|
|
@@ -317,7 +317,7 @@ const J = ne("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 ee && 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 : "",
|
|
@@ -330,7 +330,7 @@ const J = ne("admin-auth", () => {
|
|
|
330
330
|
async function b(_) {
|
|
331
331
|
if (n.value === null)
|
|
332
332
|
throw new Error("No pending 2FA challenge");
|
|
333
|
-
const U = await
|
|
333
|
+
const U = await j().post("/auth/twoFactorChallenge", {
|
|
334
334
|
challenge_token: n.value.challengeToken,
|
|
335
335
|
code: _
|
|
336
336
|
});
|
|
@@ -339,7 +339,7 @@ const J = ne("admin-auth", () => {
|
|
|
339
339
|
async function S(_) {
|
|
340
340
|
if (n.value === null)
|
|
341
341
|
throw new Error("No pending 2FA challenge");
|
|
342
|
-
const U = await
|
|
342
|
+
const U = await j().post("/auth/twoFactorRecovery", {
|
|
343
343
|
challenge_token: n.value.challengeToken,
|
|
344
344
|
recovery_code: _
|
|
345
345
|
});
|
|
@@ -349,7 +349,7 @@ const J = ne("admin-auth", () => {
|
|
|
349
349
|
n.value = null;
|
|
350
350
|
}
|
|
351
351
|
async function R() {
|
|
352
|
-
const _ =
|
|
352
|
+
const _ = j();
|
|
353
353
|
try {
|
|
354
354
|
await _.post("/auth/logout");
|
|
355
355
|
} finally {
|
|
@@ -375,16 +375,16 @@ const J = ne("admin-auth", () => {
|
|
|
375
375
|
cancelChallenge: A,
|
|
376
376
|
logout: R
|
|
377
377
|
};
|
|
378
|
-
}),
|
|
378
|
+
}), un = {
|
|
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
|
+
}, dn = /* @__PURE__ */ L({
|
|
385
385
|
__name: "UserMenu",
|
|
386
386
|
setup(e) {
|
|
387
|
-
const t =
|
|
387
|
+
const t = Y(), n = se();
|
|
388
388
|
async function o() {
|
|
389
389
|
try {
|
|
390
390
|
await t.logout();
|
|
@@ -395,10 +395,10 @@ const J = ne("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(rt), null, {
|
|
399
399
|
trigger: m(() => [
|
|
400
|
-
d("button",
|
|
401
|
-
x(r(
|
|
400
|
+
d("button", un, [
|
|
401
|
+
x(r(ut), {
|
|
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 J = ne("admin-auth", () => {
|
|
|
407
407
|
])
|
|
408
408
|
]),
|
|
409
409
|
default: m(() => [
|
|
410
|
-
x(r(
|
|
410
|
+
x(r(Oe), { 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(Lt)),
|
|
417
|
+
x(r(Oe), {
|
|
418
418
|
variant: "danger",
|
|
419
419
|
onClick: o
|
|
420
420
|
}, {
|
|
@@ -427,10 +427,10 @@ const J = ne("admin-auth", () => {
|
|
|
427
427
|
_: 1
|
|
428
428
|
}));
|
|
429
429
|
}
|
|
430
|
-
}),
|
|
430
|
+
}), cn = { class: "admin-topbar" }, mn = { class: "admin-topbar__breadcrumbs" }, fn = {
|
|
431
431
|
key: 0,
|
|
432
432
|
class: "sep"
|
|
433
|
-
},
|
|
433
|
+
}, vn = /* @__PURE__ */ L({
|
|
434
434
|
__name: "AdminTopBar",
|
|
435
435
|
props: {
|
|
436
436
|
breadcrumbs: { default: () => [] },
|
|
@@ -439,7 +439,7 @@ const J = ne("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", cn, [
|
|
443
443
|
e.showCollapseToggle ? (s(), c("button", {
|
|
444
444
|
key: 0,
|
|
445
445
|
type: "button",
|
|
@@ -452,13 +452,13 @@ const J = ne("admin-auth", () => {
|
|
|
452
452
|
"data-icon": "panel-left"
|
|
453
453
|
}, null, -1)
|
|
454
454
|
])])) : F("", !0),
|
|
455
|
-
d("div",
|
|
456
|
-
|
|
457
|
-
(s(!0), c(T, null,
|
|
458
|
-
f > 0 ? (s(), c("span",
|
|
459
|
-
(s(), w(
|
|
455
|
+
d("div", mn, [
|
|
456
|
+
X(l.$slots, "breadcrumbs", {}, () => [
|
|
457
|
+
(s(!0), c(T, null, B(e.breadcrumbs, (u, f) => (s(), c(T, { key: f }, [
|
|
458
|
+
f > 0 ? (s(), c("span", fn, "›")) : F("", !0),
|
|
459
|
+
(s(), w(de(u.to ? "a" : "span"), {
|
|
460
460
|
href: typeof u.to == "string" ? u.to : void 0,
|
|
461
|
-
class:
|
|
461
|
+
class: Q(f === a.value ? "cur" : "")
|
|
462
462
|
}, {
|
|
463
463
|
default: m(() => [
|
|
464
464
|
C(h(u.label), 1)
|
|
@@ -469,7 +469,7 @@ const J = ne("admin-auth", () => {
|
|
|
469
469
|
])
|
|
470
470
|
]),
|
|
471
471
|
i[3] || (i[3] = d("div", { class: "admin-topbar__spacer" }, null, -1)),
|
|
472
|
-
|
|
472
|
+
X(l.$slots, "search", {}, () => [
|
|
473
473
|
i[2] || (i[2] = d("div", {
|
|
474
474
|
class: "admin-topbar__search",
|
|
475
475
|
role: "button",
|
|
@@ -483,16 +483,16 @@ const J = ne("admin-auth", () => {
|
|
|
483
483
|
d("kbd", null, "⌘K")
|
|
484
484
|
], -1))
|
|
485
485
|
]),
|
|
486
|
-
|
|
487
|
-
x(
|
|
488
|
-
x(mt),
|
|
486
|
+
X(l.$slots, "actions"),
|
|
487
|
+
x(sn),
|
|
489
488
|
x(ft),
|
|
490
|
-
x(
|
|
489
|
+
x(vt),
|
|
490
|
+
x(dn)
|
|
491
491
|
]));
|
|
492
492
|
}
|
|
493
|
-
}),
|
|
493
|
+
}), pn = le("admin-menu", () => {
|
|
494
494
|
const e = E([]), t = E(!1), n = E(null), o = E(!1), a = p(() => {
|
|
495
|
-
const v =
|
|
495
|
+
const v = Y(), b = (S) => {
|
|
496
496
|
if (Array.isArray(S.permissions) && S.permissions.length > 0 && !v.hasAnyPermission(S.permissions))
|
|
497
497
|
return null;
|
|
498
498
|
const A = (S.children ?? []).map(b).filter((R) => R !== null);
|
|
@@ -517,7 +517,7 @@ const J = ne("admin-auth", () => {
|
|
|
517
517
|
if (o.value && !v) return e.value;
|
|
518
518
|
t.value = !0, n.value = null;
|
|
519
519
|
try {
|
|
520
|
-
const S = await
|
|
520
|
+
const S = await j().get("/system/menu");
|
|
521
521
|
return e.value = Array.isArray(S.items) ? S.items : [], o.value = !0, e.value;
|
|
522
522
|
} catch (b) {
|
|
523
523
|
throw n.value = b instanceof Error ? b : new Error(String(b)), b;
|
|
@@ -542,16 +542,16 @@ const J = ne("admin-auth", () => {
|
|
|
542
542
|
setItems: u,
|
|
543
543
|
reset: f
|
|
544
544
|
};
|
|
545
|
-
}),
|
|
545
|
+
}), gn = { class: "admin-sidebar-brand" }, hn = { class: "admin-sidebar-brand__mark" }, _n = {
|
|
546
546
|
key: 0,
|
|
547
547
|
class: "admin-sidebar-brand__name"
|
|
548
|
-
},
|
|
548
|
+
}, yn = {
|
|
549
549
|
key: 0,
|
|
550
550
|
class: "admin-sidebar-tenant"
|
|
551
|
-
},
|
|
551
|
+
}, bn = { class: "admin-sidebar-foot" }, kn = {
|
|
552
552
|
key: 0,
|
|
553
553
|
class: "admin-sidebar-foot__text"
|
|
554
|
-
},
|
|
554
|
+
}, wn = ["href"], $n = /* @__PURE__ */ L({
|
|
555
555
|
__name: "AdminSidebar",
|
|
556
556
|
props: {
|
|
557
557
|
collapsed: { type: Boolean, default: !1 },
|
|
@@ -562,41 +562,41 @@ const J = ne("admin-auth", () => {
|
|
|
562
562
|
docsUrl: { default: null }
|
|
563
563
|
},
|
|
564
564
|
setup(e) {
|
|
565
|
-
const t =
|
|
565
|
+
const t = pn(), n = ye(), 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 () => $t("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(Pt), { collapsed: e.collapsed }, De({
|
|
578
578
|
header: m(() => [
|
|
579
|
-
d("div",
|
|
580
|
-
d("div",
|
|
581
|
-
e.collapsed ? F("", !0) : (s(), c("div",
|
|
579
|
+
d("div", gn, [
|
|
580
|
+
d("div", hn, h(e.brandMark), 1),
|
|
581
|
+
e.collapsed ? F("", !0) : (s(), c("div", _n, h(e.brandName), 1))
|
|
582
582
|
]),
|
|
583
|
-
e.tenant && !e.collapsed ? (s(), c("div",
|
|
583
|
+
e.tenant && !e.collapsed ? (s(), c("div", yn, [
|
|
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,
|
|
589
|
+
(s(!0), c(T, null, B(o.value, (v, b) => (s(), w(r(Tt), {
|
|
590
590
|
key: `grp-${b}`,
|
|
591
591
|
title: v.group ?? void 0
|
|
592
592
|
}, {
|
|
593
593
|
default: m(() => [
|
|
594
|
-
(s(!0), c(T, null,
|
|
594
|
+
(s(!0), c(T, null, B(v.items, (S) => (s(), w(r(Mt), {
|
|
595
595
|
key: S.key,
|
|
596
596
|
to: i(S),
|
|
597
597
|
active: a(S),
|
|
598
598
|
badge: S.badge ?? void 0
|
|
599
|
-
},
|
|
599
|
+
}, De({
|
|
600
600
|
default: m(() => [
|
|
601
601
|
C(" " + h(S.label), 1)
|
|
602
602
|
]),
|
|
@@ -605,7 +605,7 @@ const J = ne("admin-auth", () => {
|
|
|
605
605
|
S.icon ? {
|
|
606
606
|
name: "icon",
|
|
607
607
|
fn: m(() => [
|
|
608
|
-
(s(), w(
|
|
608
|
+
(s(), w(de(l(S.icon))))
|
|
609
609
|
]),
|
|
610
610
|
key: "0"
|
|
611
611
|
} : void 0
|
|
@@ -619,24 +619,24 @@ const J = ne("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", bn, [
|
|
623
|
+
e.version ? (s(), c("span", kn, 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, wn)) : F("", !0)
|
|
629
629
|
])
|
|
630
630
|
]),
|
|
631
631
|
key: "0"
|
|
632
632
|
} : void 0
|
|
633
633
|
]), 1032, ["collapsed"]));
|
|
634
634
|
}
|
|
635
|
-
}),
|
|
635
|
+
}), xn = { class: "admin-shell-root" }, Cn = {
|
|
636
636
|
key: 0,
|
|
637
637
|
class: "admin-impersonation-banner",
|
|
638
638
|
role: "status"
|
|
639
|
-
},
|
|
639
|
+
}, Ve = "data-admin-impersonating", Sn = /* @__PURE__ */ L({
|
|
640
640
|
__name: "AdminShell",
|
|
641
641
|
props: {
|
|
642
642
|
collapsed: { type: Boolean, default: !1 },
|
|
@@ -651,16 +651,16 @@ const J = ne("admin-auth", () => {
|
|
|
651
651
|
function l() {
|
|
652
652
|
o("exit-impersonation");
|
|
653
653
|
}
|
|
654
|
-
return
|
|
654
|
+
return ae(
|
|
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(Ve, "true") : document.documentElement.removeAttribute(Ve));
|
|
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
|
+
), xt(() => {
|
|
661
|
+
typeof document < "u" && document.documentElement.removeAttribute(Ve);
|
|
662
|
+
}), (i, u) => (s(), c("div", xn, [
|
|
663
|
+
e.impersonation ? (s(), c("div", Cn, [
|
|
664
664
|
d("span", null, [
|
|
665
665
|
u[1] || (u[1] = C(" Вы вошли как ", -1)),
|
|
666
666
|
d("b", null, h(e.impersonation.asName), 1),
|
|
@@ -672,36 +672,36 @@ const J = ne("admin-auth", () => {
|
|
|
672
672
|
onClick: l
|
|
673
673
|
}, " Выйти из режима ")
|
|
674
674
|
])) : F("", !0),
|
|
675
|
-
x(r(
|
|
675
|
+
x(r(Nt), {
|
|
676
676
|
"model-value": e.collapsed,
|
|
677
677
|
"onUpdate:modelValue": a
|
|
678
678
|
}, {
|
|
679
679
|
sidebar: m(() => [
|
|
680
|
-
|
|
681
|
-
x(
|
|
680
|
+
X(i.$slots, "sidebar", {}, () => [
|
|
681
|
+
x($n, { collapsed: e.collapsed }, null, 8, ["collapsed"])
|
|
682
682
|
])
|
|
683
683
|
]),
|
|
684
684
|
header: m(() => [
|
|
685
|
-
|
|
686
|
-
x(
|
|
685
|
+
X(i.$slots, "topbar", {}, () => [
|
|
686
|
+
x(vn, {
|
|
687
687
|
onToggleSidebar: u[0] || (u[0] = (f) => a(!e.collapsed))
|
|
688
688
|
})
|
|
689
689
|
])
|
|
690
690
|
]),
|
|
691
691
|
default: m(() => [
|
|
692
|
-
|
|
692
|
+
X(i.$slots, "default")
|
|
693
693
|
]),
|
|
694
694
|
_: 3
|
|
695
695
|
}, 8, ["model-value"])
|
|
696
696
|
]));
|
|
697
697
|
}
|
|
698
|
-
}),
|
|
698
|
+
}), An = /* @__PURE__ */ L({
|
|
699
699
|
__name: "AdminApp",
|
|
700
700
|
setup(e) {
|
|
701
|
-
const t =
|
|
701
|
+
const t = ye(), 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 = st("router-view");
|
|
704
|
+
return n.value ? (s(), w(Sn, { key: 0 }, {
|
|
705
705
|
default: m(() => [
|
|
706
706
|
x(l)
|
|
707
707
|
]),
|
|
@@ -709,7 +709,7 @@ const J = ne("admin-auth", () => {
|
|
|
709
709
|
})) : (s(), w(l, { key: 1 }));
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
}),
|
|
712
|
+
}), ie = le("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;
|
|
@@ -725,7 +725,7 @@ const J = ne("admin-auth", () => {
|
|
|
725
725
|
return e.value;
|
|
726
726
|
t.value = !0, n.value = null;
|
|
727
727
|
try {
|
|
728
|
-
const U = await
|
|
728
|
+
const U = await j().get("/system/manifest");
|
|
729
729
|
return e.value = U, U;
|
|
730
730
|
} catch (g) {
|
|
731
731
|
throw n.value = g instanceof Error ? g : new Error(String(g)), g;
|
|
@@ -755,28 +755,28 @@ const J = ne("admin-auth", () => {
|
|
|
755
755
|
load: A,
|
|
756
756
|
reset: R
|
|
757
757
|
};
|
|
758
|
-
}),
|
|
758
|
+
}), Rn = { class: "admin-home" }, Un = { class: "admin-home__title" }, En = {
|
|
759
759
|
key: 0,
|
|
760
760
|
class: "admin-home__resources"
|
|
761
|
-
},
|
|
761
|
+
}, Fn = { class: "admin-home__grid" }, Ln = ["onClick"], Pn = { class: "admin-home__card-label" }, Tn = { class: "admin-home__card-slug" }, Mn = /* @__PURE__ */ L({
|
|
762
762
|
__name: "HomePage",
|
|
763
763
|
setup(e) {
|
|
764
|
-
const t =
|
|
765
|
-
return (i, u) => (s(), c("div",
|
|
766
|
-
x(r(
|
|
764
|
+
const t = ie(), n = Y(), o = se(), a = p(() => n.user?.name ?? ""), l = p(() => t.manifest?.resources ?? []);
|
|
765
|
+
return (i, u) => (s(), c("div", Rn, [
|
|
766
|
+
x(r(D), {
|
|
767
767
|
padding: "lg",
|
|
768
768
|
class: "admin-home__hero"
|
|
769
769
|
}, {
|
|
770
770
|
default: m(() => [
|
|
771
|
-
d("h1",
|
|
771
|
+
d("h1", Un, "Добро пожаловать" + 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", En, [
|
|
777
777
|
u[1] || (u[1] = d("h2", { class: "admin-home__heading" }, "Ресурсы", -1)),
|
|
778
|
-
d("ul",
|
|
779
|
-
(s(!0), c(T, null,
|
|
778
|
+
d("ul", Fn, [
|
|
779
|
+
(s(!0), c(T, null, B(l.value, (f) => (s(), c("li", {
|
|
780
780
|
key: f.slug
|
|
781
781
|
}, [
|
|
782
782
|
d("button", {
|
|
@@ -784,27 +784,27 @@ const J = ne("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", Pn, h(f.label), 1),
|
|
788
|
+
d("span", Tn, h(f.slug), 1)
|
|
789
|
+
], 8, Ln)
|
|
790
790
|
]))), 128))
|
|
791
791
|
])
|
|
792
792
|
])) : F("", !0)
|
|
793
793
|
]));
|
|
794
794
|
}
|
|
795
|
-
}),
|
|
795
|
+
}), Nn = { class: "admin-status-page" }, In = /* @__PURE__ */ L({
|
|
796
796
|
__name: "ForbiddenPage",
|
|
797
797
|
setup(e) {
|
|
798
|
-
const t =
|
|
799
|
-
return (n, o) => (s(), c("div",
|
|
800
|
-
x(r(
|
|
798
|
+
const t = se();
|
|
799
|
+
return (n, o) => (s(), c("div", Nn, [
|
|
800
|
+
x(r(D), {
|
|
801
801
|
padding: "lg",
|
|
802
802
|
class: "admin-status-page__card"
|
|
803
803
|
}, {
|
|
804
804
|
default: m(() => [
|
|
805
805
|
o[2] || (o[2] = d("h1", { class: "admin-status-page__code" }, "403", -1)),
|
|
806
806
|
o[3] || (o[3] = d("p", { class: "admin-status-page__message" }, "Доступ запрещён.", -1)),
|
|
807
|
-
x(r(
|
|
807
|
+
x(r(V), {
|
|
808
808
|
variant: "ghost",
|
|
809
809
|
onClick: o[0] || (o[0] = (a) => r(t).replace({ name: "admin.home" }))
|
|
810
810
|
}, {
|
|
@@ -818,19 +818,19 @@ const J = ne("admin-auth", () => {
|
|
|
818
818
|
})
|
|
819
819
|
]));
|
|
820
820
|
}
|
|
821
|
-
}),
|
|
821
|
+
}), Bn = { class: "admin-status-page" }, Vn = /* @__PURE__ */ L({
|
|
822
822
|
__name: "NotFoundPage",
|
|
823
823
|
setup(e) {
|
|
824
|
-
const t =
|
|
825
|
-
return (n, o) => (s(), c("div",
|
|
826
|
-
x(r(
|
|
824
|
+
const t = se();
|
|
825
|
+
return (n, o) => (s(), c("div", Bn, [
|
|
826
|
+
x(r(D), {
|
|
827
827
|
padding: "lg",
|
|
828
828
|
class: "admin-status-page__card"
|
|
829
829
|
}, {
|
|
830
830
|
default: m(() => [
|
|
831
831
|
o[2] || (o[2] = d("h1", { class: "admin-status-page__code" }, "404", -1)),
|
|
832
832
|
o[3] || (o[3] = d("p", { class: "admin-status-page__message" }, "Страница не найдена.", -1)),
|
|
833
|
-
x(r(
|
|
833
|
+
x(r(V), {
|
|
834
834
|
variant: "ghost",
|
|
835
835
|
onClick: o[0] || (o[0] = (a) => r(t).replace({ name: "admin.home" }))
|
|
836
836
|
}, {
|
|
@@ -844,38 +844,38 @@ const J = ne("admin-auth", () => {
|
|
|
844
844
|
})
|
|
845
845
|
]));
|
|
846
846
|
}
|
|
847
|
-
}),
|
|
847
|
+
}), zn = { class: "admin-settings-page" }, qn = { class: "admin-settings-page__title" }, Dn = {
|
|
848
848
|
key: 0,
|
|
849
849
|
class: "admin-settings-page__hint"
|
|
850
|
-
},
|
|
850
|
+
}, On = {
|
|
851
851
|
key: 1,
|
|
852
852
|
class: "admin-settings-page__debug"
|
|
853
|
-
},
|
|
853
|
+
}, Wn = /* @__PURE__ */ L({
|
|
854
854
|
__name: "SettingsPage",
|
|
855
855
|
setup(e) {
|
|
856
|
-
const t =
|
|
857
|
-
return (l, i) => (s(), c("div",
|
|
858
|
-
x(r(
|
|
856
|
+
const t = ye(), n = ie(), 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", zn, [
|
|
858
|
+
x(r(D), { padding: "lg" }, {
|
|
859
859
|
default: m(() => [
|
|
860
|
-
d("h1",
|
|
861
|
-
a.value ? (s(), c("pre",
|
|
860
|
+
d("h1", qn, h(a.value?.label ?? o.value), 1),
|
|
861
|
+
a.value ? (s(), c("pre", On, h(JSON.stringify(a.value.fields, null, 2)), 1)) : (s(), c("p", Dn, " Settings «" + h(o.value) + "» не найдено в manifest'е. ", 1))
|
|
862
862
|
]),
|
|
863
863
|
_: 1
|
|
864
864
|
})
|
|
865
865
|
]));
|
|
866
866
|
}
|
|
867
|
-
}),
|
|
867
|
+
}), jn = { class: "admin-status-page" }, Kn = { class: "admin-status-page__title" }, Gn = { class: "admin-status-page__hint" }, Hn = /* @__PURE__ */ L({
|
|
868
868
|
__name: "UnknownScreenPage",
|
|
869
869
|
setup(e) {
|
|
870
|
-
const t =
|
|
871
|
-
return (a, l) => (s(), c("div",
|
|
872
|
-
x(r(
|
|
870
|
+
const t = ye(), n = p(() => String(t.params.slug ?? "")), o = p(() => String(t.meta?.title ?? n.value));
|
|
871
|
+
return (a, l) => (s(), c("div", jn, [
|
|
872
|
+
x(r(D), {
|
|
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", Kn, h(o.value), 1),
|
|
878
|
+
d("p", Gn, [
|
|
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 J = ne("admin-auth", () => {
|
|
|
885
885
|
})
|
|
886
886
|
]));
|
|
887
887
|
}
|
|
888
|
-
}),
|
|
888
|
+
}), Xn = { class: "admin-auth-card__row" }, Jn = ["href"], Yn = {
|
|
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
|
+
}, Qn = ["href"], Zn = /* @__PURE__ */ L({
|
|
892
892
|
__name: "LoginForm",
|
|
893
893
|
props: {
|
|
894
894
|
forgotUrl: { default: null },
|
|
@@ -897,7 +897,7 @@ const J = ne("admin-auth", () => {
|
|
|
897
897
|
},
|
|
898
898
|
emits: ["success"],
|
|
899
899
|
setup(e, { emit: t }) {
|
|
900
|
-
const n = t, o =
|
|
900
|
+
const n = t, o = Y(), 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
901
|
async function A() {
|
|
902
902
|
if (!u.value) {
|
|
903
903
|
u.value = !0, f.value = null, v.value = {};
|
|
@@ -909,7 +909,7 @@ const J = ne("admin-auth", () => {
|
|
|
909
909
|
});
|
|
910
910
|
n("success", R);
|
|
911
911
|
} catch (R) {
|
|
912
|
-
R instanceof
|
|
912
|
+
R instanceof Pe ? (v.value = R.fields, f.value = R.firstFieldMessage()) : R instanceof Te ? f.value = "Нет соединения с сервером" : R instanceof ee ? f.value = R.message || "Не удалось войти" : f.value = R.message;
|
|
913
913
|
} finally {
|
|
914
914
|
u.value = !1;
|
|
915
915
|
}
|
|
@@ -918,9 +918,9 @@ const J = ne("admin-auth", () => {
|
|
|
918
918
|
return (R, _) => (s(), c("form", {
|
|
919
919
|
class: "admin-auth-card__bd",
|
|
920
920
|
novalidate: "",
|
|
921
|
-
onSubmit:
|
|
921
|
+
onSubmit: We(A, ["prevent"])
|
|
922
922
|
}, [
|
|
923
|
-
f.value ? (s(), w(r(
|
|
923
|
+
f.value ? (s(), w(r(Z), {
|
|
924
924
|
key: 0,
|
|
925
925
|
variant: "danger",
|
|
926
926
|
class: "admin-auth-card__alert",
|
|
@@ -931,7 +931,7 @@ const J = ne("admin-auth", () => {
|
|
|
931
931
|
]),
|
|
932
932
|
_: 1
|
|
933
933
|
})) : F("", !0),
|
|
934
|
-
x(r(
|
|
934
|
+
x(r(ue), {
|
|
935
935
|
modelValue: a.value,
|
|
936
936
|
"onUpdate:modelValue": _[0] || (_[0] = (g) => a.value = g),
|
|
937
937
|
type: "email",
|
|
@@ -943,7 +943,7 @@ const J = ne("admin-auth", () => {
|
|
|
943
943
|
error: b.value,
|
|
944
944
|
name: "email"
|
|
945
945
|
}, null, 8, ["modelValue", "disabled", "error"]),
|
|
946
|
-
x(r(
|
|
946
|
+
x(r(ue), {
|
|
947
947
|
modelValue: l.value,
|
|
948
948
|
"onUpdate:modelValue": _[1] || (_[1] = (g) => l.value = g),
|
|
949
949
|
type: "password",
|
|
@@ -954,8 +954,8 @@ const J = ne("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", Xn, [
|
|
958
|
+
x(r(Ae), {
|
|
959
959
|
modelValue: i.value,
|
|
960
960
|
"onUpdate:modelValue": _[2] || (_[2] = (g) => i.value = g),
|
|
961
961
|
disabled: u.value
|
|
@@ -969,9 +969,9 @@ const J = ne("admin-auth", () => {
|
|
|
969
969
|
key: 0,
|
|
970
970
|
href: e.forgotUrl,
|
|
971
971
|
class: "admin-auth-card__link"
|
|
972
|
-
}, " Забыли пароль? ", 8,
|
|
972
|
+
}, " Забыли пароль? ", 8, Jn)) : F("", !0)
|
|
973
973
|
]),
|
|
974
|
-
x(r(
|
|
974
|
+
x(r(V), {
|
|
975
975
|
type: "submit",
|
|
976
976
|
variant: "primary",
|
|
977
977
|
size: "lg",
|
|
@@ -983,38 +983,38 @@ const J = ne("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", Yn, [
|
|
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, Qn)
|
|
992
992
|
])) : F("", !0)
|
|
993
993
|
], 32));
|
|
994
994
|
}
|
|
995
|
-
}),
|
|
995
|
+
}), ea = ["value", "disabled", "aria-label", "onInput", "onKeydown"], ta = { class: "admin-auth-card__row" }, na = /* @__PURE__ */ L({
|
|
996
996
|
__name: "TwoFactorForm",
|
|
997
997
|
emits: ["success", "cancel"],
|
|
998
998
|
setup(e, { emit: t }) {
|
|
999
|
-
const n = t, o =
|
|
1000
|
-
function R($,
|
|
1001
|
-
|
|
999
|
+
const n = t, o = Y(), 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($, z) {
|
|
1001
|
+
z instanceof HTMLInputElement && (u.value[$] = z);
|
|
1002
1002
|
}
|
|
1003
|
-
function _($,
|
|
1004
|
-
const
|
|
1005
|
-
l.value[$] =
|
|
1003
|
+
function _($, z) {
|
|
1004
|
+
const G = z.target, O = G.value.replace(/\D/g, "").slice(-1);
|
|
1005
|
+
l.value[$] = O, G.value = O, O && $ < l.value.length - 1 && Be(() => u.value[$ + 1]?.focus()), S.value.length === l.value.length && P();
|
|
1006
1006
|
}
|
|
1007
|
-
function g($,
|
|
1008
|
-
|
|
1007
|
+
function g($, z) {
|
|
1008
|
+
z.key === "Backspace" && !l.value[$] && $ > 0 ? Be(() => u.value[$ - 1]?.focus()) : z.key === "ArrowLeft" && $ > 0 ? (u.value[$ - 1]?.focus(), z.preventDefault()) : z.key === "ArrowRight" && $ < l.value.length - 1 && (u.value[$ + 1]?.focus(), z.preventDefault());
|
|
1009
1009
|
}
|
|
1010
1010
|
function U($) {
|
|
1011
|
-
const
|
|
1012
|
-
if (
|
|
1011
|
+
const G = ($.clipboardData?.getData("text") ?? "").replace(/\D/g, "").slice(0, l.value.length);
|
|
1012
|
+
if (G.length !== 0) {
|
|
1013
1013
|
$.preventDefault();
|
|
1014
|
-
for (let
|
|
1015
|
-
l.value[
|
|
1016
|
-
|
|
1017
|
-
u.value[Math.min(
|
|
1014
|
+
for (let O = 0; O < l.value.length; O++)
|
|
1015
|
+
l.value[O] = G[O] ?? "";
|
|
1016
|
+
Be(() => {
|
|
1017
|
+
u.value[Math.min(G.length, l.value.length - 1)]?.focus(), G.length === l.value.length && P();
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
@@ -1030,7 +1030,7 @@ const J = ne("admin-auth", () => {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
n("success");
|
|
1032
1032
|
} catch ($) {
|
|
1033
|
-
$ instanceof
|
|
1033
|
+
$ instanceof Pe ? v.value = $.firstFieldMessage() ?? "Неверный код" : $ instanceof Te ? v.value = "Нет соединения с сервером" : $ instanceof ee ? v.value = $.message || "Не удалось проверить код" : v.value = $.message;
|
|
1034
1034
|
} finally {
|
|
1035
1035
|
f.value = !1;
|
|
1036
1036
|
}
|
|
@@ -1042,12 +1042,12 @@ const J = ne("admin-auth", () => {
|
|
|
1042
1042
|
function y() {
|
|
1043
1043
|
a.value = a.value === "totp" ? "recovery" : "totp", v.value = null;
|
|
1044
1044
|
}
|
|
1045
|
-
return ($,
|
|
1045
|
+
return ($, z) => (s(), c("form", {
|
|
1046
1046
|
class: "admin-auth-card__bd",
|
|
1047
1047
|
novalidate: "",
|
|
1048
|
-
onSubmit:
|
|
1048
|
+
onSubmit: We(P, ["prevent"])
|
|
1049
1049
|
}, [
|
|
1050
|
-
v.value ? (s(), w(r(
|
|
1050
|
+
v.value ? (s(), w(r(Z), {
|
|
1051
1051
|
key: 0,
|
|
1052
1052
|
variant: "danger",
|
|
1053
1053
|
class: "admin-auth-card__alert",
|
|
@@ -1058,7 +1058,7 @@ const J = ne("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(Z), {
|
|
1062
1062
|
key: 1,
|
|
1063
1063
|
variant: "info",
|
|
1064
1064
|
class: "admin-auth-card__alert",
|
|
@@ -1074,31 +1074,31 @@ const J = ne("admin-auth", () => {
|
|
|
1074
1074
|
class: "admin-code-input",
|
|
1075
1075
|
onPaste: U
|
|
1076
1076
|
}, [
|
|
1077
|
-
(s(!0), c(T, null,
|
|
1078
|
-
key:
|
|
1077
|
+
(s(!0), c(T, null, B(l.value, (G, O) => (s(), c("input", {
|
|
1078
|
+
key: O,
|
|
1079
1079
|
ref_for: !0,
|
|
1080
|
-
ref: (M) => R(
|
|
1081
|
-
value: l.value[
|
|
1080
|
+
ref: (M) => R(O, M),
|
|
1081
|
+
value: l.value[O],
|
|
1082
1082
|
type: "text",
|
|
1083
1083
|
inputmode: "numeric",
|
|
1084
1084
|
autocomplete: "one-time-code",
|
|
1085
1085
|
maxlength: "1",
|
|
1086
1086
|
disabled: f.value,
|
|
1087
|
-
"aria-label": `Цифра ${
|
|
1088
|
-
onInput: (M) => _(
|
|
1089
|
-
onKeydown: (M) => g(
|
|
1090
|
-
}, null, 40,
|
|
1091
|
-
], 32)) : (s(), w(r(
|
|
1087
|
+
"aria-label": `Цифра ${O + 1}`,
|
|
1088
|
+
onInput: (M) => _(O, M),
|
|
1089
|
+
onKeydown: (M) => g(O, M)
|
|
1090
|
+
}, null, 40, ea))), 128))
|
|
1091
|
+
], 32)) : (s(), w(r(ue), {
|
|
1092
1092
|
key: 3,
|
|
1093
1093
|
modelValue: i.value,
|
|
1094
|
-
"onUpdate:modelValue":
|
|
1094
|
+
"onUpdate:modelValue": z[0] || (z[0] = (G) => i.value = G),
|
|
1095
1095
|
type: "text",
|
|
1096
1096
|
label: "Recovery-код",
|
|
1097
1097
|
autocomplete: "one-time-code",
|
|
1098
1098
|
disabled: f.value,
|
|
1099
1099
|
name: "recovery-code"
|
|
1100
1100
|
}, null, 8, ["modelValue", "disabled"])),
|
|
1101
|
-
x(r(
|
|
1101
|
+
x(r(V), {
|
|
1102
1102
|
type: "submit",
|
|
1103
1103
|
variant: "primary",
|
|
1104
1104
|
size: "lg",
|
|
@@ -1110,7 +1110,7 @@ const J = ne("admin-auth", () => {
|
|
|
1110
1110
|
]),
|
|
1111
1111
|
_: 1
|
|
1112
1112
|
}, 8, ["loading", "disabled"]),
|
|
1113
|
-
d("div",
|
|
1113
|
+
d("div", ta, [
|
|
1114
1114
|
d("button", {
|
|
1115
1115
|
type: "button",
|
|
1116
1116
|
class: "admin-auth-card__link",
|
|
@@ -1130,13 +1130,13 @@ const J = ne("admin-auth", () => {
|
|
|
1130
1130
|
])
|
|
1131
1131
|
], 32));
|
|
1132
1132
|
}
|
|
1133
|
-
}),
|
|
1133
|
+
}), aa = { class: "admin-auth-page" }, la = {
|
|
1134
1134
|
key: 0,
|
|
1135
1135
|
class: "admin-auth-page__corner"
|
|
1136
|
-
},
|
|
1136
|
+
}, sa = { class: "admin-auth-card__hd" }, ia = ["src", "alt"], oa = {
|
|
1137
1137
|
key: 1,
|
|
1138
1138
|
"aria-hidden": "true"
|
|
1139
|
-
},
|
|
1139
|
+
}, ra = { key: 2 }, ua = { class: "admin-auth-card__title" }, da = { class: "admin-auth-card__sub" }, ca = /* @__PURE__ */ L({
|
|
1140
1140
|
__name: "LoginPage",
|
|
1141
1141
|
props: {
|
|
1142
1142
|
brandName: { default: "Laravel Admin" },
|
|
@@ -1150,7 +1150,7 @@ const J = ne("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 = Y(), o = se(), a = ye();
|
|
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 J = ne("admin-auth", () => {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
await o.push({ name: t.homeRouteName });
|
|
1161
1161
|
}
|
|
1162
|
-
return
|
|
1162
|
+
return ae(
|
|
1163
1163
|
() => n.isAuthenticated,
|
|
1164
1164
|
(i) => {
|
|
1165
1165
|
i && l();
|
|
1166
1166
|
}
|
|
1167
|
-
),
|
|
1167
|
+
), Ue(() => {
|
|
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", aa, [
|
|
1170
|
+
e.showCornerActions ? (s(), c("div", la, [
|
|
1171
|
+
x(ft),
|
|
1172
|
+
x(vt)
|
|
1173
1173
|
])) : F("", !0),
|
|
1174
|
-
x(r(
|
|
1175
|
-
class:
|
|
1174
|
+
x(r(D), {
|
|
1175
|
+
class: Q(["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", sa, [
|
|
1180
1180
|
d("div", {
|
|
1181
|
-
class:
|
|
1181
|
+
class: Q(["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, ia)) : r(n).isChallengePending ? (s(), c("span", oa, "🛡")) : (s(), c("span", ra, h(e.brandMark), 1))
|
|
1188
1188
|
], 2),
|
|
1189
|
-
d("div",
|
|
1189
|
+
d("div", ua, [
|
|
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", da, [
|
|
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 J = ne("admin-auth", () => {
|
|
|
1201
1201
|
], 64))
|
|
1202
1202
|
])
|
|
1203
1203
|
]),
|
|
1204
|
-
r(n).isChallengePending ? (s(), w(
|
|
1204
|
+
r(n).isChallengePending ? (s(), w(na, {
|
|
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(Zn, {
|
|
1211
1211
|
key: 1,
|
|
1212
1212
|
"forgot-url": e.forgotUrl,
|
|
1213
1213
|
"sso-link-label": e.ssoLinkLabel,
|
|
@@ -1220,8 +1220,8 @@ const J = ne("admin-auth", () => {
|
|
|
1220
1220
|
}, 8, ["class"])
|
|
1221
1221
|
]));
|
|
1222
1222
|
}
|
|
1223
|
-
}),
|
|
1224
|
-
const e = E(null), t = E([]), n = E({ ...
|
|
1223
|
+
}), Ze = { page: 1, per_page: 20, total: 0, last_page: 1 }, ma = le("admin-resource-index", () => {
|
|
1224
|
+
const e = E(null), t = E([]), n = E({ ...Ze }), 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((q) => v.value.has(g(q))) ? "all" : "mixed");
|
|
1225
1225
|
function g(N) {
|
|
1226
1226
|
return N.id ?? N.key ?? "";
|
|
1227
1227
|
}
|
|
@@ -1229,30 +1229,30 @@ const J = ne("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 = { ...Ze }, 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
|
-
const
|
|
1235
|
+
const q = {
|
|
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
|
+
}, we = N.search ?? l.value;
|
|
1239
|
+
we && (q.q = we);
|
|
1240
|
+
const ge = N.sort ?? u.value;
|
|
1241
|
+
ge && (q.order = [{ column: ge, direction: N.direction ?? f.value }]);
|
|
1242
|
+
const kt = N.filters ?? i.value, Ie = {};
|
|
1243
|
+
for (const [wt, oe] of Object.entries(kt))
|
|
1244
|
+
oe == null || oe === "" || (Ie[wt] = Array.isArray(oe) ? oe.join(",") : oe);
|
|
1245
|
+
return Object.keys(Ie).length > 0 && (q.filters = Ie), q;
|
|
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
|
|
1253
|
-
t.value =
|
|
1254
|
-
} catch (
|
|
1255
|
-
throw a.value =
|
|
1252
|
+
const q = j(), we = k(N), ge = await q.post(`/${e.value}/search`, we);
|
|
1253
|
+
t.value = ge.data, n.value = ge.meta;
|
|
1254
|
+
} catch (q) {
|
|
1255
|
+
throw a.value = q instanceof Error ? q : new Error(String(q)), q;
|
|
1256
1256
|
} finally {
|
|
1257
1257
|
o.value = !1;
|
|
1258
1258
|
}
|
|
@@ -1260,24 +1260,24 @@ const J = ne("admin-auth", () => {
|
|
|
1260
1260
|
async function $(N) {
|
|
1261
1261
|
l.value = N, n.value.page = 1, await y();
|
|
1262
1262
|
}
|
|
1263
|
-
async function
|
|
1264
|
-
|
|
1263
|
+
async function z(N, q) {
|
|
1264
|
+
q == null || q === "" ? delete i.value[N] : i.value[N] = q, n.value.page = 1, await y();
|
|
1265
1265
|
}
|
|
1266
|
-
async function
|
|
1266
|
+
async function G() {
|
|
1267
1267
|
i.value = {}, n.value.page = 1, await y();
|
|
1268
1268
|
}
|
|
1269
|
-
async function
|
|
1270
|
-
u.value = N, f.value =
|
|
1269
|
+
async function O(N, q = "asc") {
|
|
1270
|
+
u.value = N, f.value = q, await y();
|
|
1271
1271
|
}
|
|
1272
1272
|
async function M(N) {
|
|
1273
1273
|
u.value === N ? f.value = f.value === "asc" ? "desc" : "asc" : (u.value = N, f.value = "asc"), await y();
|
|
1274
1274
|
}
|
|
1275
|
-
async function
|
|
1275
|
+
async function W(N) {
|
|
1276
1276
|
n.value.page = N, await y();
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1278
|
+
function H(N) {
|
|
1279
|
+
const q = new Set(v.value);
|
|
1280
|
+
q.has(N) ? q.delete(N) : q.add(N), v.value = q;
|
|
1281
1281
|
}
|
|
1282
1282
|
function K() {
|
|
1283
1283
|
if (_.value === "all") {
|
|
@@ -1285,13 +1285,13 @@ const J = ne("admin-auth", () => {
|
|
|
1285
1285
|
return;
|
|
1286
1286
|
}
|
|
1287
1287
|
const N = new Set(v.value);
|
|
1288
|
-
for (const
|
|
1288
|
+
for (const q of t.value) N.add(g(q));
|
|
1289
1289
|
v.value = N;
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1291
|
+
function te() {
|
|
1292
1292
|
v.value = /* @__PURE__ */ new Set();
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function bt(N) {
|
|
1295
1295
|
return v.value.has(N);
|
|
1296
1296
|
}
|
|
1297
1297
|
return {
|
|
@@ -1317,37 +1317,37 @@ const J = ne("admin-auth", () => {
|
|
|
1317
1317
|
reset: P,
|
|
1318
1318
|
load: y,
|
|
1319
1319
|
setSearch: $,
|
|
1320
|
-
setFilter:
|
|
1321
|
-
clearFilters:
|
|
1322
|
-
setSort:
|
|
1320
|
+
setFilter: z,
|
|
1321
|
+
clearFilters: G,
|
|
1322
|
+
setSort: O,
|
|
1323
1323
|
toggleSort: M,
|
|
1324
|
-
setPage:
|
|
1325
|
-
toggleRow:
|
|
1324
|
+
setPage: W,
|
|
1325
|
+
toggleRow: H,
|
|
1326
1326
|
toggleAllOnPage: K,
|
|
1327
|
-
clearSelection:
|
|
1328
|
-
isSelected:
|
|
1327
|
+
clearSelection: te,
|
|
1328
|
+
isSelected: bt,
|
|
1329
1329
|
rowId: g
|
|
1330
1330
|
};
|
|
1331
|
-
}),
|
|
1331
|
+
}), fa = { class: "admin-page admin-resource-index" }, va = { class: "admin-page__hd" }, pa = { class: "admin-page__title-wrap" }, ga = { class: "admin-page__title" }, ha = {
|
|
1332
1332
|
key: 0,
|
|
1333
1333
|
class: "admin-page__count"
|
|
1334
|
-
},
|
|
1334
|
+
}, _a = { class: "admin-page__actions" }, ya = {
|
|
1335
1335
|
key: 0,
|
|
1336
1336
|
class: "admin-bulk-toolbar",
|
|
1337
1337
|
role: "toolbar"
|
|
1338
|
-
},
|
|
1338
|
+
}, ba = { class: "admin-bulk-toolbar__count" }, ka = {
|
|
1339
1339
|
key: 1,
|
|
1340
1340
|
class: "admin-filter-bar"
|
|
1341
|
-
},
|
|
1341
|
+
}, wa = ["value"], $a = {
|
|
1342
1342
|
key: 2,
|
|
1343
1343
|
class: "admin-resource-index__loading"
|
|
1344
|
-
},
|
|
1344
|
+
}, xa = {
|
|
1345
1345
|
key: 5,
|
|
1346
1346
|
class: "admin-resource-index__table"
|
|
1347
|
-
},
|
|
1347
|
+
}, Ca = { class: "admin-resource-index__select-header" }, Sa = { class: "admin-resource-index__select-overlay" }, Aa = ["onClick"], Ra = {
|
|
1348
1348
|
key: 6,
|
|
1349
1349
|
class: "admin-resource-index__footer"
|
|
1350
|
-
},
|
|
1350
|
+
}, Ua = /* @__PURE__ */ L({
|
|
1351
1351
|
__name: "ResourceIndexPage",
|
|
1352
1352
|
props: {
|
|
1353
1353
|
slug: {},
|
|
@@ -1358,7 +1358,7 @@ const J = ne("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 = ma(), l = ie(), 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 J = ne("admin-auth", () => {
|
|
|
1373
1373
|
const P = a.meta.total;
|
|
1374
1374
|
return P === 0 ? "" : `${a.items.length} из ${P}`;
|
|
1375
1375
|
});
|
|
1376
|
-
|
|
1376
|
+
Ue(async () => {
|
|
1377
1377
|
a.setSlug(n.slug), l.manifest === null && await l.load().catch(() => {
|
|
1378
1378
|
}), await a.load().catch(() => {
|
|
1379
1379
|
});
|
|
1380
|
-
}),
|
|
1380
|
+
}), ae(
|
|
1381
1381
|
() => n.slug,
|
|
1382
1382
|
async (P, k) => {
|
|
1383
1383
|
P !== k && (a.setSlug(P), await a.load().catch(() => {
|
|
@@ -1406,11 +1406,11 @@ const J = ne("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", fa, [
|
|
1410
|
+
d("header", va, [
|
|
1411
|
+
d("div", pa, [
|
|
1412
|
+
d("h1", ga, h(u.value), 1),
|
|
1413
|
+
e.subtitle || v.value ? (s(), c("div", ha, [
|
|
1414
1414
|
e.subtitle ? (s(), c(T, { key: 0 }, [
|
|
1415
1415
|
C(h(e.subtitle), 1)
|
|
1416
1416
|
], 64)) : F("", !0),
|
|
@@ -1422,9 +1422,9 @@ const J = ne("admin-auth", () => {
|
|
|
1422
1422
|
], 64)) : F("", !0)
|
|
1423
1423
|
])) : F("", !0)
|
|
1424
1424
|
]),
|
|
1425
|
-
d("div",
|
|
1426
|
-
|
|
1427
|
-
e.createRouteName ? (s(), w(r(
|
|
1425
|
+
d("div", _a, [
|
|
1426
|
+
X(P.$slots, "actions"),
|
|
1427
|
+
e.createRouteName ? (s(), w(r(V), {
|
|
1428
1428
|
key: 0,
|
|
1429
1429
|
variant: "primary",
|
|
1430
1430
|
onClick: k[0] || (k[0] = (y) => P.$router.push({ name: e.createRouteName }))
|
|
@@ -1436,13 +1436,13 @@ const J = ne("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", ya, [
|
|
1440
|
+
d("span", ba, [
|
|
1441
1441
|
k[8] || (k[8] = C(" Выбрано ", -1)),
|
|
1442
1442
|
d("b", null, h(r(a).selectedCount), 1)
|
|
1443
1443
|
]),
|
|
1444
1444
|
k[14] || (k[14] = d("span", { class: "admin-bulk-toolbar__divider" }, null, -1)),
|
|
1445
|
-
x(r(
|
|
1445
|
+
x(r(V), {
|
|
1446
1446
|
size: "sm",
|
|
1447
1447
|
variant: "ghost",
|
|
1448
1448
|
onClick: k[1] || (k[1] = (y) => g("publish"))
|
|
@@ -1452,7 +1452,7 @@ const J = ne("admin-auth", () => {
|
|
|
1452
1452
|
])]),
|
|
1453
1453
|
_: 1
|
|
1454
1454
|
}),
|
|
1455
|
-
x(r(
|
|
1455
|
+
x(r(V), {
|
|
1456
1456
|
size: "sm",
|
|
1457
1457
|
variant: "ghost",
|
|
1458
1458
|
onClick: k[2] || (k[2] = (y) => g("archive"))
|
|
@@ -1462,7 +1462,7 @@ const J = ne("admin-auth", () => {
|
|
|
1462
1462
|
])]),
|
|
1463
1463
|
_: 1
|
|
1464
1464
|
}),
|
|
1465
|
-
x(r(
|
|
1465
|
+
x(r(V), {
|
|
1466
1466
|
size: "sm",
|
|
1467
1467
|
variant: "ghost",
|
|
1468
1468
|
onClick: k[3] || (k[3] = (y) => g("export"))
|
|
@@ -1472,7 +1472,7 @@ const J = ne("admin-auth", () => {
|
|
|
1472
1472
|
])]),
|
|
1473
1473
|
_: 1
|
|
1474
1474
|
}),
|
|
1475
|
-
x(r(
|
|
1475
|
+
x(r(V), {
|
|
1476
1476
|
size: "sm",
|
|
1477
1477
|
variant: "danger",
|
|
1478
1478
|
onClick: k[4] || (k[4] = (y) => g("delete"))
|
|
@@ -1483,7 +1483,7 @@ const J = ne("admin-auth", () => {
|
|
|
1483
1483
|
_: 1
|
|
1484
1484
|
}),
|
|
1485
1485
|
k[15] || (k[15] = d("span", { class: "admin-bulk-toolbar__spacer" }, null, -1)),
|
|
1486
|
-
x(r(
|
|
1486
|
+
x(r(V), {
|
|
1487
1487
|
size: "sm",
|
|
1488
1488
|
variant: "ghost",
|
|
1489
1489
|
onClick: r(a).clearSelection
|
|
@@ -1493,20 +1493,20 @@ const J = ne("admin-auth", () => {
|
|
|
1493
1493
|
])]),
|
|
1494
1494
|
_: 1
|
|
1495
1495
|
}, 8, ["onClick"])
|
|
1496
|
-
])) : (s(), c("div",
|
|
1496
|
+
])) : (s(), c("div", ka, [
|
|
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,
|
|
1504
|
-
|
|
1502
|
+
onKeydown: k[5] || (k[5] = Ct((y) => r(a).setSearch(y.target.value), ["enter"]))
|
|
1503
|
+
}, null, 40, wa),
|
|
1504
|
+
X(P.$slots, "filters", {
|
|
1505
1505
|
filters: r(a).filters,
|
|
1506
1506
|
setFilter: r(a).setFilter
|
|
1507
1507
|
}),
|
|
1508
1508
|
k[17] || (k[17] = d("span", { class: "admin-filter-bar__spacer" }, null, -1)),
|
|
1509
|
-
Object.keys(r(a).filters).length > 0 ? (s(), w(r(
|
|
1509
|
+
Object.keys(r(a).filters).length > 0 ? (s(), w(r(V), {
|
|
1510
1510
|
key: 0,
|
|
1511
1511
|
size: "sm",
|
|
1512
1512
|
variant: "ghost",
|
|
@@ -1518,19 +1518,19 @@ const J = ne("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,
|
|
1521
|
+
r(a).loading ? (s(), c("div", $a, [
|
|
1522
|
+
(s(), c(T, null, B(8, (y) => x(r(je), {
|
|
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(It), {
|
|
1527
1527
|
key: 3,
|
|
1528
1528
|
title: "Не удалось загрузить данные",
|
|
1529
1529
|
description: r(a).error?.message ?? "Попробуйте обновить страницу.",
|
|
1530
1530
|
class: "admin-resource-index__state"
|
|
1531
1531
|
}, {
|
|
1532
1532
|
actions: m(() => [
|
|
1533
|
-
x(r(
|
|
1533
|
+
x(r(V), {
|
|
1534
1534
|
variant: "primary",
|
|
1535
1535
|
onClick: U
|
|
1536
1536
|
}, {
|
|
@@ -1541,14 +1541,14 @@ const J = ne("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(Bt), {
|
|
1545
1545
|
key: 4,
|
|
1546
1546
|
title: "Пока пусто",
|
|
1547
1547
|
description: "Создайте первую запись или измените фильтры.",
|
|
1548
1548
|
class: "admin-resource-index__state"
|
|
1549
1549
|
}, {
|
|
1550
1550
|
actions: m(() => [
|
|
1551
|
-
e.createRouteName ? (s(), w(r(
|
|
1551
|
+
e.createRouteName ? (s(), w(r(V), {
|
|
1552
1552
|
key: 0,
|
|
1553
1553
|
variant: "primary",
|
|
1554
1554
|
onClick: k[6] || (k[6] = (y) => P.$router.push({ name: e.createRouteName }))
|
|
@@ -1560,52 +1560,52 @@ const J = ne("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", xa, [
|
|
1564
|
+
d("div", Ca, [
|
|
1565
|
+
x(r(Ae), {
|
|
1566
1566
|
"model-value": r(a).selectionState === "all",
|
|
1567
1567
|
indeterminate: r(a).selectionState === "mixed",
|
|
1568
1568
|
"aria-label": "Выделить всё",
|
|
1569
1569
|
"onUpdate:modelValue": A
|
|
1570
1570
|
}, null, 8, ["model-value", "indeterminate"])
|
|
1571
1571
|
]),
|
|
1572
|
-
x(r(
|
|
1572
|
+
x(r(Ke), {
|
|
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
|
-
},
|
|
1579
|
-
|
|
1578
|
+
}, De({ _: 2 }, [
|
|
1579
|
+
B(f.value, (y) => ({
|
|
1580
1580
|
name: `cell-${y.key}`,
|
|
1581
1581
|
fn: m(($) => [
|
|
1582
|
-
|
|
1582
|
+
X(P.$slots, `cell-${y.key}`, { row: $ }, () => [
|
|
1583
1583
|
C(h($?.[y.key]), 1)
|
|
1584
1584
|
])
|
|
1585
1585
|
])
|
|
1586
1586
|
}))
|
|
1587
1587
|
]), 1032, ["columns", "data", "sort-key", "sort-direction"]),
|
|
1588
|
-
d("div",
|
|
1589
|
-
(s(!0), c(T, null,
|
|
1588
|
+
d("div", Sa, [
|
|
1589
|
+
(s(!0), c(T, null, B(r(a).items, (y) => (s(), c("div", {
|
|
1590
1590
|
key: String(r(a).rowId(y)),
|
|
1591
|
-
class:
|
|
1591
|
+
class: Q([
|
|
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(Ae), {
|
|
1598
1598
|
"model-value": r(a).isSelected(r(a).rowId(y)),
|
|
1599
1599
|
"aria-label": `Строка ${r(a).rowId(y)}`,
|
|
1600
1600
|
"onUpdate:modelValue": ($) => R(r(a).rowId(y)),
|
|
1601
|
-
onClick: k[7] || (k[7] =
|
|
1601
|
+
onClick: k[7] || (k[7] = We(() => {
|
|
1602
1602
|
}, ["stop"]))
|
|
1603
1603
|
}, null, 8, ["model-value", "aria-label", "onUpdate:modelValue"])
|
|
1604
|
-
], 10,
|
|
1604
|
+
], 10, Aa))), 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", Ra, [
|
|
1608
|
+
x(r(Vt), {
|
|
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,72 +1614,74 @@ const J = ne("admin-auth", () => {
|
|
|
1614
1614
|
])) : F("", !0)
|
|
1615
1615
|
]));
|
|
1616
1616
|
}
|
|
1617
|
-
}),
|
|
1617
|
+
}), gt = le("admin-resource-form", () => {
|
|
1618
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
|
-
const M = o.value,
|
|
1620
|
-
for (const K of
|
|
1621
|
-
if (!Object.is(M[K],
|
|
1622
|
-
if (typeof M[K] == "object" || typeof
|
|
1623
|
-
if (JSON.stringify(M[K]) !== JSON.stringify(
|
|
1619
|
+
const M = o.value, W = a.value, H = /* @__PURE__ */ new Set([...Object.keys(M), ...Object.keys(W)]);
|
|
1620
|
+
for (const K of H)
|
|
1621
|
+
if (!Object.is(M[K], W[K]))
|
|
1622
|
+
if (typeof M[K] == "object" || typeof W[K] == "object") {
|
|
1623
|
+
if (JSON.stringify(M[K]) !== JSON.stringify(W[K])) return !0;
|
|
1624
1624
|
} else
|
|
1625
1625
|
return !0;
|
|
1626
1626
|
return !1;
|
|
1627
1627
|
});
|
|
1628
|
-
function g(M,
|
|
1629
|
-
for (const
|
|
1630
|
-
Object.assign(M,
|
|
1628
|
+
function g(M, W) {
|
|
1629
|
+
for (const H of Object.keys(M)) delete M[H];
|
|
1630
|
+
Object.assign(M, W);
|
|
1631
1631
|
}
|
|
1632
1632
|
function U() {
|
|
1633
1633
|
g(o.value, {}), g(a.value, {}), l.value = {}, i.value = !1, u.value = !1, f.value = !1, v.value = null, n.value = null;
|
|
1634
1634
|
}
|
|
1635
|
-
function P(M,
|
|
1636
|
-
e.value = M, t.value = "create", n.value = null, g(o.value,
|
|
1635
|
+
function P(M, W = {}) {
|
|
1636
|
+
e.value = M, t.value = "create", n.value = null, g(o.value, W), g(a.value, W), l.value = {}, v.value = null;
|
|
1637
1637
|
}
|
|
1638
|
-
async function k(M,
|
|
1639
|
-
e.value = M, t.value =
|
|
1638
|
+
async function k(M, W, H = "edit") {
|
|
1639
|
+
e.value = M, t.value = H, n.value = W, i.value = !0, v.value = null, l.value = {};
|
|
1640
1640
|
try {
|
|
1641
|
-
const
|
|
1642
|
-
params: { id:
|
|
1641
|
+
const te = await j().get(`/${M}/read`, {
|
|
1642
|
+
params: { id: W }
|
|
1643
1643
|
});
|
|
1644
|
-
g(o.value,
|
|
1644
|
+
g(o.value, te.record), g(a.value, te.record);
|
|
1645
1645
|
} catch (K) {
|
|
1646
1646
|
throw v.value = K instanceof Error ? K : new Error(String(K)), K;
|
|
1647
1647
|
} finally {
|
|
1648
1648
|
i.value = !1;
|
|
1649
1649
|
}
|
|
1650
1650
|
}
|
|
1651
|
-
function y(M,
|
|
1652
|
-
if (o.value[M] =
|
|
1653
|
-
const
|
|
1654
|
-
delete
|
|
1651
|
+
function y(M, W) {
|
|
1652
|
+
if (o.value[M] = W, l.value[M]) {
|
|
1653
|
+
const H = { ...l.value };
|
|
1654
|
+
delete H[M], l.value = H;
|
|
1655
1655
|
}
|
|
1656
1656
|
}
|
|
1657
1657
|
function $(M) {
|
|
1658
1658
|
l.value = { ...M };
|
|
1659
1659
|
}
|
|
1660
|
-
function
|
|
1660
|
+
function z() {
|
|
1661
1661
|
l.value = {};
|
|
1662
1662
|
}
|
|
1663
|
-
async function
|
|
1663
|
+
async function G() {
|
|
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 =
|
|
1669
|
-
|
|
1668
|
+
const M = j(), W = t.value === "create" ? `/${e.value}/create` : `/${e.value}/update`, H = t.value === "create" ? o.value : { id: n.value, ...o.value }, K = await M.post(W, H), te = K.record?.id ?? K.id;
|
|
1669
|
+
if (te === void 0)
|
|
1670
|
+
throw new Error("save: backend response does not contain record.id");
|
|
1671
|
+
return n.value = te, g(a.value, { ...o.value }), t.value = "edit", te;
|
|
1670
1672
|
} catch (M) {
|
|
1671
|
-
throw M instanceof
|
|
1673
|
+
throw M instanceof Pe ? l.value = { ...M.fields } : (M instanceof ee || M instanceof Error) && (v.value = M), M;
|
|
1672
1674
|
} finally {
|
|
1673
1675
|
u.value = !1;
|
|
1674
1676
|
}
|
|
1675
1677
|
}
|
|
1676
|
-
async function
|
|
1678
|
+
async function O() {
|
|
1677
1679
|
if (!e.value || n.value === null)
|
|
1678
1680
|
throw new Error("Nothing to delete");
|
|
1679
1681
|
if (f.value) throw new Error("Already deleting");
|
|
1680
1682
|
f.value = !0, v.value = null;
|
|
1681
1683
|
try {
|
|
1682
|
-
await
|
|
1684
|
+
await j().post(`/${e.value}/delete`, { id: n.value });
|
|
1683
1685
|
} catch (M) {
|
|
1684
1686
|
throw M instanceof Error && (v.value = M), M;
|
|
1685
1687
|
} finally {
|
|
@@ -1710,12 +1712,12 @@ const J = ne("admin-auth", () => {
|
|
|
1710
1712
|
load: k,
|
|
1711
1713
|
setField: y,
|
|
1712
1714
|
setErrors: $,
|
|
1713
|
-
clearErrors:
|
|
1714
|
-
save:
|
|
1715
|
-
destroy:
|
|
1715
|
+
clearErrors: z,
|
|
1716
|
+
save: G,
|
|
1717
|
+
destroy: O
|
|
1716
1718
|
};
|
|
1717
1719
|
});
|
|
1718
|
-
function
|
|
1720
|
+
function Me() {
|
|
1719
1721
|
const e = /* @__PURE__ */ new Map();
|
|
1720
1722
|
return {
|
|
1721
1723
|
register(t, n) {
|
|
@@ -1739,21 +1741,21 @@ function Te() {
|
|
|
1739
1741
|
}
|
|
1740
1742
|
};
|
|
1741
1743
|
}
|
|
1742
|
-
const
|
|
1744
|
+
const me = Me(), fe = Me(), Vi = me.register, ht = me.get, zi = me.has, qi = me.list, Di = fe.register, et = fe.get, Oi = fe.has, Wi = fe.list;
|
|
1743
1745
|
function ji() {
|
|
1744
|
-
|
|
1746
|
+
me.clear(), fe.clear();
|
|
1745
1747
|
}
|
|
1746
|
-
function
|
|
1747
|
-
e.fields &&
|
|
1748
|
+
function Ea(e) {
|
|
1749
|
+
e.fields && me.registerBundle(e.fields), e.layouts && fe.registerBundle(e.layouts);
|
|
1748
1750
|
}
|
|
1749
|
-
const
|
|
1751
|
+
const _t = /* @__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(Z), { variant: "warning" }, {
|
|
1757
1759
|
title: m(() => [
|
|
1758
1760
|
C("Неизвестный тип поля: " + h(e.type), 1)
|
|
1759
1761
|
]),
|
|
@@ -1768,23 +1770,23 @@ const ht = /* @__PURE__ */ L({
|
|
|
1768
1770
|
_: 1
|
|
1769
1771
|
}));
|
|
1770
1772
|
}
|
|
1771
|
-
}),
|
|
1773
|
+
}), yt = /* @__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(() => ht(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(de(n.value), Ee(Fe({ key: 0 }, o.value)), null, 16)) : (s(), w(_t, {
|
|
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
|
+
}), ke = /* @__PURE__ */ L({
|
|
1788
1790
|
__name: "LayoutRenderer",
|
|
1789
1791
|
props: {
|
|
1790
1792
|
node: {}
|
|
@@ -1794,31 +1796,31 @@ const ht = /* @__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 = et(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 = et(t.node.type);
|
|
1803
|
+
return l ? { kind: "layout", component: l } : ht(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(de(n.value.component), Ee(Fe({ key: 0 }, o.value)), null, 16)) : n.value.kind === "field" ? (s(), w(yt, {
|
|
1807
1809
|
key: 1,
|
|
1808
1810
|
node: a.value
|
|
1809
|
-
}, null, 8, ["node"])) : (s(), w(
|
|
1811
|
+
}, null, 8, ["node"])) : (s(), w(_t, {
|
|
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
|
+
}), Fa = { class: "admin-page admin-resource-form" }, La = { class: "admin-page__hd" }, Pa = { class: "admin-page__title-wrap" }, Ta = { class: "admin-page__title" }, Ma = { class: "admin-page__actions" }, Na = {
|
|
1816
1818
|
key: 1,
|
|
1817
1819
|
class: "admin-resource-form__loading"
|
|
1818
|
-
},
|
|
1820
|
+
}, Ia = {
|
|
1819
1821
|
key: 3,
|
|
1820
1822
|
class: "admin-resource-form__savebar"
|
|
1821
|
-
},
|
|
1823
|
+
}, tt = /* @__PURE__ */ L({
|
|
1822
1824
|
__name: "ResourceFormPage",
|
|
1823
1825
|
props: {
|
|
1824
1826
|
slug: {},
|
|
@@ -1826,8 +1828,8 @@ const ht = /* @__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 = gt(), o = ie(), a = se(), l = mt(n.state, n.errors);
|
|
1832
|
+
ae(
|
|
1831
1833
|
() => n.errors,
|
|
1832
1834
|
(_) => {
|
|
1833
1835
|
l.setErrors({ ..._ });
|
|
@@ -1851,11 +1853,11 @@ const ht = /* @__PURE__ */ L({
|
|
|
1851
1853
|
return "default";
|
|
1852
1854
|
}
|
|
1853
1855
|
});
|
|
1854
|
-
|
|
1856
|
+
Ue(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
|
+
}), ae(
|
|
1859
1861
|
() => [t.slug, t.id],
|
|
1860
1862
|
async ([_, g]) => {
|
|
1861
1863
|
g != null ? await n.load(_, g, "edit").catch(() => {
|
|
@@ -1882,15 +1884,15 @@ const ht = /* @__PURE__ */ L({
|
|
|
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", Fa, [
|
|
1888
|
+
d("header", La, [
|
|
1889
|
+
d("div", Pa, [
|
|
1888
1890
|
d("a", {
|
|
1889
1891
|
class: "admin-resource-form__back",
|
|
1890
1892
|
onClick: R
|
|
1891
1893
|
}, "← Назад"),
|
|
1892
|
-
d("h1",
|
|
1893
|
-
v.value ? (s(), w(r(
|
|
1894
|
+
d("h1", Ta, h(f.value), 1),
|
|
1895
|
+
v.value ? (s(), w(r(Ge), {
|
|
1894
1896
|
key: 0,
|
|
1895
1897
|
variant: b.value
|
|
1896
1898
|
}, {
|
|
@@ -1900,8 +1902,8 @@ const ht = /* @__PURE__ */ L({
|
|
|
1900
1902
|
_: 1
|
|
1901
1903
|
}, 8, ["variant"])) : F("", !0)
|
|
1902
1904
|
]),
|
|
1903
|
-
d("div",
|
|
1904
|
-
x(r(
|
|
1905
|
+
d("div", Ma, [
|
|
1906
|
+
x(r(V), {
|
|
1905
1907
|
variant: "ghost",
|
|
1906
1908
|
disabled: r(n).saving || r(n).deleting,
|
|
1907
1909
|
onClick: R
|
|
@@ -1911,7 +1913,7 @@ const ht = /* @__PURE__ */ L({
|
|
|
1911
1913
|
])]),
|
|
1912
1914
|
_: 1
|
|
1913
1915
|
}, 8, ["disabled"]),
|
|
1914
|
-
r(n).isEdit ? (s(), w(r(
|
|
1916
|
+
r(n).isEdit ? (s(), w(r(V), {
|
|
1915
1917
|
key: 0,
|
|
1916
1918
|
variant: "danger",
|
|
1917
1919
|
disabled: r(n).saving || r(n).deleting,
|
|
@@ -1923,7 +1925,7 @@ const ht = /* @__PURE__ */ L({
|
|
|
1923
1925
|
])]),
|
|
1924
1926
|
_: 1
|
|
1925
1927
|
}, 8, ["disabled", "loading"])) : F("", !0),
|
|
1926
|
-
x(r(
|
|
1928
|
+
x(r(V), {
|
|
1927
1929
|
variant: "primary",
|
|
1928
1930
|
disabled: r(n).saving || r(n).loading,
|
|
1929
1931
|
loading: r(n).saving,
|
|
@@ -1936,7 +1938,7 @@ const ht = /* @__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(Z), {
|
|
1940
1942
|
key: 0,
|
|
1941
1943
|
variant: "danger",
|
|
1942
1944
|
class: "admin-resource-form__alert",
|
|
@@ -1947,27 +1949,27 @@ const ht = /* @__PURE__ */ L({
|
|
|
1947
1949
|
]),
|
|
1948
1950
|
_: 1
|
|
1949
1951
|
})) : F("", !0),
|
|
1950
|
-
r(n).loading ? (s(), c("div",
|
|
1951
|
-
(s(), c(T, null,
|
|
1952
|
+
r(n).loading ? (s(), c("div", Na, [
|
|
1953
|
+
(s(), c(T, null, B(6, (U) => x(r(je), {
|
|
1952
1954
|
key: U,
|
|
1953
1955
|
height: "40px"
|
|
1954
1956
|
})), 64))
|
|
1955
|
-
])) : (s(), w(r(
|
|
1957
|
+
])) : (s(), w(r(D), {
|
|
1956
1958
|
key: 2,
|
|
1957
1959
|
padding: "md",
|
|
1958
1960
|
class: "admin-resource-form__body"
|
|
1959
1961
|
}, {
|
|
1960
1962
|
default: m(() => [
|
|
1961
|
-
(s(!0), c(T, null,
|
|
1963
|
+
(s(!0), c(T, null, B(u.value, (U, P) => (s(), w(ke, {
|
|
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", Ia, [
|
|
1969
1971
|
g[4] || (g[4] = d("span", { class: "admin-resource-form__savebar-hint" }, " Есть несохранённые изменения ", -1)),
|
|
1970
|
-
x(r(
|
|
1972
|
+
x(r(V), {
|
|
1971
1973
|
variant: "ghost",
|
|
1972
1974
|
size: "sm",
|
|
1973
1975
|
onClick: R
|
|
@@ -1977,7 +1979,7 @@ const ht = /* @__PURE__ */ L({
|
|
|
1977
1979
|
])]),
|
|
1978
1980
|
_: 1
|
|
1979
1981
|
}),
|
|
1980
|
-
x(r(
|
|
1982
|
+
x(r(V), {
|
|
1981
1983
|
variant: "primary",
|
|
1982
1984
|
size: "sm",
|
|
1983
1985
|
loading: r(n).saving,
|
|
@@ -1992,14 +1994,14 @@ const ht = /* @__PURE__ */ L({
|
|
|
1992
1994
|
])) : F("", !0)
|
|
1993
1995
|
]));
|
|
1994
1996
|
}
|
|
1995
|
-
}),
|
|
1997
|
+
}), ve = Me(), Ki = ve.register, nt = ve.get, Gi = ve.has, Hi = ve.list, Xi = ve.clear, Ba = ve.registerBundle, Va = /* @__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(Z), { variant: "warning" }, {
|
|
2003
2005
|
title: m(() => [
|
|
2004
2006
|
C("Неизвестный тип infolist-entry: " + h(e.type), 1)
|
|
2005
2007
|
]),
|
|
@@ -2011,31 +2013,31 @@ const ht = /* @__PURE__ */ L({
|
|
|
2011
2013
|
_: 1
|
|
2012
2014
|
}));
|
|
2013
2015
|
}
|
|
2014
|
-
}),
|
|
2016
|
+
}), za = {
|
|
2015
2017
|
key: 1,
|
|
2016
2018
|
class: "admin-infolist-rows"
|
|
2017
|
-
},
|
|
2019
|
+
}, qa = {
|
|
2018
2020
|
key: 2,
|
|
2019
2021
|
class: "admin-infolist-cols"
|
|
2020
|
-
},
|
|
2022
|
+
}, Da = {
|
|
2021
2023
|
key: 3,
|
|
2022
2024
|
class: "admin-infolist-section"
|
|
2023
|
-
},
|
|
2025
|
+
}, Oa = {
|
|
2024
2026
|
key: 0,
|
|
2025
2027
|
class: "admin-infolist-section__hd"
|
|
2026
|
-
},
|
|
2028
|
+
}, Wa = {
|
|
2027
2029
|
key: 0,
|
|
2028
2030
|
class: "admin-infolist-section__title"
|
|
2029
|
-
},
|
|
2031
|
+
}, ja = {
|
|
2030
2032
|
key: 1,
|
|
2031
2033
|
class: "admin-infolist-section__description"
|
|
2032
|
-
},
|
|
2034
|
+
}, Ka = { class: "admin-infolist-section__body" }, Ga = {
|
|
2033
2035
|
key: 4,
|
|
2034
2036
|
class: "admin-infolist-tabs"
|
|
2035
|
-
},
|
|
2037
|
+
}, Ha = {
|
|
2036
2038
|
class: "admin-infolist-tabs__list",
|
|
2037
2039
|
role: "tablist"
|
|
2038
|
-
},
|
|
2040
|
+
}, Xa = { class: "admin-infolist-tabs__panel" }, Ja = /* @__PURE__ */ L({
|
|
2039
2041
|
__name: "InfolistRenderer",
|
|
2040
2042
|
props: {
|
|
2041
2043
|
node: {}
|
|
@@ -2043,14 +2045,14 @@ const ht = /* @__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 = nt(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 = nt(t.node.type);
|
|
2054
2056
|
return b ? { kind: "entry", component: b } : { kind: "unknown" };
|
|
2055
2057
|
}), a = p(() => {
|
|
2056
2058
|
const { type: b, kind: S, items: A, ...R } = t.node;
|
|
@@ -2064,73 +2066,73 @@ const ht = /* @__PURE__ */ L({
|
|
|
2064
2066
|
return typeof b == "number" ? b : 0;
|
|
2065
2067
|
}), v = p(() => t.node.items ?? []);
|
|
2066
2068
|
return (b, S) => {
|
|
2067
|
-
const A =
|
|
2068
|
-
return o.value.kind === "entry" ? (s(), w(
|
|
2069
|
-
(s(!0), c(T, null,
|
|
2069
|
+
const A = st("InfolistRenderer", !0);
|
|
2070
|
+
return o.value.kind === "entry" ? (s(), w(de(o.value.component), Ee(Fe({ key: 0 }, a.value)), null, 16)) : o.value.kind === "layout" && o.value.layoutType === "rows" ? (s(), c("div", za, [
|
|
2071
|
+
(s(!0), c(T, null, B(l.value, (R, _) => (s(), w(A, {
|
|
2070
2072
|
key: _,
|
|
2071
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,
|
|
2075
|
+
])) : o.value.kind === "layout" && o.value.layoutType === "columns" ? (s(), c("div", qa, [
|
|
2076
|
+
(s(!0), c(T, null, B(l.value, (R, _) => (s(), c("div", {
|
|
2075
2077
|
key: _,
|
|
2076
2078
|
class: "admin-infolist-cols__item",
|
|
2077
|
-
style:
|
|
2079
|
+
style: Le({
|
|
2078
2080
|
gridColumn: `span ${typeof R.span == "number" ? R.span : Math.max(1, Math.floor(12 / l.value.length))}`
|
|
2079
2081
|
})
|
|
2080
2082
|
}, [
|
|
2081
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", Da, [
|
|
2086
|
+
i.value || u.value ? (s(), c("header", Oa, [
|
|
2087
|
+
i.value ? (s(), c("h3", Wa, h(i.value), 1)) : F("", !0),
|
|
2088
|
+
u.value ? (s(), c("p", ja, h(u.value), 1)) : F("", !0)
|
|
2087
2089
|
])) : F("", !0),
|
|
2088
|
-
d("div",
|
|
2089
|
-
(s(!0), c(T, null,
|
|
2090
|
+
d("div", Ka, [
|
|
2091
|
+
(s(!0), c(T, null, B(l.value, (R, _) => (s(), w(A, {
|
|
2090
2092
|
key: _,
|
|
2091
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,
|
|
2096
|
+
])) : o.value.kind === "layout" && o.value.layoutType === "tabs" ? (s(), c("div", Ga, [
|
|
2097
|
+
d("ul", Ha, [
|
|
2098
|
+
(s(!0), c(T, null, B(v.value, (R, _) => (s(), c("li", {
|
|
2097
2099
|
key: R.key ?? _,
|
|
2098
|
-
class:
|
|
2100
|
+
class: Q([
|
|
2099
2101
|
"admin-infolist-tabs__tab",
|
|
2100
2102
|
{ "admin-infolist-tabs__tab--active": _ === f.value }
|
|
2101
2103
|
])
|
|
2102
2104
|
}, h(R.label), 3))), 128))
|
|
2103
2105
|
]),
|
|
2104
|
-
d("div",
|
|
2105
|
-
(s(!0), c(T, null,
|
|
2106
|
+
d("div", Xa, [
|
|
2107
|
+
(s(!0), c(T, null, B(v.value[f.value]?.items ?? [], (R, _) => (s(), w(A, {
|
|
2106
2108
|
key: _,
|
|
2107
2109
|
node: R
|
|
2108
2110
|
}, null, 8, ["node"]))), 128))
|
|
2109
2111
|
])
|
|
2110
|
-
])) : (s(), w(
|
|
2112
|
+
])) : (s(), w(Va, {
|
|
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
|
+
}), Ye = /* @__PURE__ */ Symbol("admin.infolist-record");
|
|
2120
|
+
function Ya(e) {
|
|
2121
|
+
St(Ye, e);
|
|
2120
2122
|
}
|
|
2121
2123
|
function Ji() {
|
|
2122
|
-
const e =
|
|
2124
|
+
const e = it(Ye);
|
|
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 Ne() {
|
|
2130
|
+
return it(Ye, null);
|
|
2129
2131
|
}
|
|
2130
|
-
const
|
|
2132
|
+
const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-page__hd" }, el = { class: "admin-page__title-wrap" }, tl = { class: "admin-page__title" }, nl = { class: "admin-page__actions" }, al = {
|
|
2131
2133
|
key: 1,
|
|
2132
2134
|
class: "admin-resource-view__loading"
|
|
2133
|
-
},
|
|
2135
|
+
}, ll = /* @__PURE__ */ L({
|
|
2134
2136
|
__name: "ResourceViewPage",
|
|
2135
2137
|
props: {
|
|
2136
2138
|
slug: {},
|
|
@@ -2139,18 +2141,18 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { 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 = gt(), o = ie(), a = se();
|
|
2145
|
+
Ya(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
|
+
Ue(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
|
+
}), ae(
|
|
2154
2156
|
() => [t.slug, t.id],
|
|
2155
2157
|
async ([b, S]) => {
|
|
2156
2158
|
await n.load(b, S, "view").catch(() => {
|
|
@@ -2171,13 +2173,13 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { 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", Qa, [
|
|
2177
|
+
d("header", Za, [
|
|
2178
|
+
d("div", el, [
|
|
2179
|
+
d("h1", tl, h(u.value), 1)
|
|
2178
2180
|
]),
|
|
2179
|
-
d("div",
|
|
2180
|
-
x(r(
|
|
2181
|
+
d("div", nl, [
|
|
2182
|
+
x(r(V), {
|
|
2181
2183
|
variant: "ghost",
|
|
2182
2184
|
onClick: f
|
|
2183
2185
|
}, {
|
|
@@ -2186,7 +2188,7 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2186
2188
|
])]),
|
|
2187
2189
|
_: 1
|
|
2188
2190
|
}),
|
|
2189
|
-
x(r(
|
|
2191
|
+
x(r(V), {
|
|
2190
2192
|
variant: "danger",
|
|
2191
2193
|
loading: r(n).deleting,
|
|
2192
2194
|
disabled: r(n).deleting,
|
|
@@ -2199,7 +2201,7 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { 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(Z), {
|
|
2203
2205
|
key: 0,
|
|
2204
2206
|
variant: "danger",
|
|
2205
2207
|
class: "admin-resource-view__alert",
|
|
@@ -2210,18 +2212,18 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2210
2212
|
]),
|
|
2211
2213
|
_: 1
|
|
2212
2214
|
})) : F("", !0),
|
|
2213
|
-
r(n).loading ? (s(), c("div",
|
|
2214
|
-
(s(), c(T, null,
|
|
2215
|
+
r(n).loading ? (s(), c("div", al, [
|
|
2216
|
+
(s(), c(T, null, B(8, (A) => x(r(je), {
|
|
2215
2217
|
key: A,
|
|
2216
2218
|
height: "24px"
|
|
2217
2219
|
})), 64))
|
|
2218
|
-
])) : (s(), w(r(
|
|
2220
|
+
])) : (s(), w(r(D), {
|
|
2219
2221
|
key: 2,
|
|
2220
2222
|
padding: "md",
|
|
2221
2223
|
class: "admin-resource-view__body"
|
|
2222
2224
|
}, {
|
|
2223
2225
|
default: m(() => [
|
|
2224
|
-
(s(!0), c(T, null,
|
|
2226
|
+
(s(!0), c(T, null, B(i.value, (A, R) => (s(), w(Ja, {
|
|
2225
2227
|
key: R,
|
|
2226
2228
|
node: A
|
|
2227
2229
|
}, null, 8, ["node"]))), 128))
|
|
@@ -2230,16 +2232,16 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2230
2232
|
}))
|
|
2231
2233
|
]));
|
|
2232
2234
|
}
|
|
2233
|
-
}),
|
|
2235
|
+
}), sl = { class: "admin-page admin-profile" }, il = { class: "admin-page__hd" }, ol = { class: "admin-page__title-wrap" }, rl = { class: "admin-page__title" }, ul = { class: "admin-page__count" }, dl = { class: "admin-profile__layout" }, cl = {
|
|
2234
2236
|
class: "admin-profile__nav",
|
|
2235
2237
|
"aria-label": "Profile sections"
|
|
2236
|
-
},
|
|
2238
|
+
}, ml = ["onClick"], fl = ["data-icon"], vl = { class: "admin-profile__content" }, pl = { class: "admin-profile__hero" }, gl = { class: "admin-profile__hero-text" }, hl = { class: "admin-profile__hero-name" }, _l = { class: "admin-profile__hero-meta" }, yl = { class: "admin-profile__form" }, bl = { class: "admin-profile__card-ft" }, kl = { class: "admin-profile__card-hd" }, wl = {
|
|
2237
2239
|
key: 0,
|
|
2238
2240
|
class: "admin-profile__hint"
|
|
2239
|
-
},
|
|
2241
|
+
}, $l = {
|
|
2240
2242
|
key: 1,
|
|
2241
2243
|
class: "admin-profile__hint"
|
|
2242
|
-
},
|
|
2244
|
+
}, xl = { class: "admin-profile__card-ft" }, Cl = { class: "admin-profile__hint" }, Sl = /* @__PURE__ */ L({
|
|
2243
2245
|
__name: "ProfilePage",
|
|
2244
2246
|
props: {
|
|
2245
2247
|
title: { default: "Profile" },
|
|
@@ -2248,7 +2250,7 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { 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 = Y(), l = He(), i = Xe(), u = [
|
|
2252
2254
|
{ id: "general", label: "Основное", icon: "user" },
|
|
2253
2255
|
{ id: "security", label: "Безопасность", icon: "shield" },
|
|
2254
2256
|
{ id: "tokens", label: "API токены", icon: "key" },
|
|
@@ -2280,33 +2282,33 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { 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", sl, [
|
|
2286
|
+
d("header", il, [
|
|
2287
|
+
d("div", ol, [
|
|
2288
|
+
d("h1", rl, h(e.title), 1),
|
|
2289
|
+
d("div", ul, h(e.subtitle), 1)
|
|
2288
2290
|
])
|
|
2289
2291
|
]),
|
|
2290
|
-
d("div",
|
|
2291
|
-
d("nav",
|
|
2292
|
-
(s(), c(T, null,
|
|
2292
|
+
d("div", dl, [
|
|
2293
|
+
d("nav", cl, [
|
|
2294
|
+
(s(), c(T, null, B(u, ($) => d("button", {
|
|
2293
2295
|
key: $.id,
|
|
2294
2296
|
type: "button",
|
|
2295
|
-
class:
|
|
2297
|
+
class: Q([
|
|
2296
2298
|
"admin-profile__nav-item",
|
|
2297
2299
|
{ "admin-profile__nav-item--active": f.value === $.id }
|
|
2298
2300
|
]),
|
|
2299
|
-
onClick: (
|
|
2301
|
+
onClick: (z) => v($.id)
|
|
2300
2302
|
}, [
|
|
2301
2303
|
d("span", {
|
|
2302
2304
|
class: "admin-profile__nav-icon",
|
|
2303
2305
|
"data-icon": $.icon
|
|
2304
|
-
}, null, 8,
|
|
2306
|
+
}, null, 8, fl),
|
|
2305
2307
|
d("span", null, h($.label), 1)
|
|
2306
|
-
], 10,
|
|
2308
|
+
], 10, ml)), 64))
|
|
2307
2309
|
]),
|
|
2308
|
-
d("div",
|
|
2309
|
-
f.value === "general" ? (s(), w(r(
|
|
2310
|
+
d("div", vl, [
|
|
2311
|
+
f.value === "general" ? (s(), w(r(D), {
|
|
2310
2312
|
key: 0,
|
|
2311
2313
|
padding: "md"
|
|
2312
2314
|
}, {
|
|
@@ -2314,18 +2316,18 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { 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", pl, [
|
|
2320
|
+
x(r(ut), {
|
|
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", gl, [
|
|
2326
|
+
d("div", hl, h(r(a).user?.name ?? "—"), 1),
|
|
2327
|
+
d("div", _l, h(r(a).user?.email ?? "—"), 1)
|
|
2326
2328
|
]),
|
|
2327
2329
|
y[5] || (y[5] = d("div", { style: { flex: "1" } }, null, -1)),
|
|
2328
|
-
x(r(
|
|
2330
|
+
x(r(V), {
|
|
2329
2331
|
variant: "ghost",
|
|
2330
2332
|
size: "sm",
|
|
2331
2333
|
onClick: _
|
|
@@ -2336,35 +2338,35 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2336
2338
|
_: 1
|
|
2337
2339
|
})
|
|
2338
2340
|
]),
|
|
2339
|
-
d("div",
|
|
2340
|
-
x(r(
|
|
2341
|
+
d("div", yl, [
|
|
2342
|
+
x(r(ue), {
|
|
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(ue), {
|
|
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(Re), {
|
|
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(Re), {
|
|
2360
2362
|
modelValue: b.value.theme,
|
|
2361
2363
|
"onUpdate:modelValue": y[3] || (y[3] = ($) => b.value.theme = $),
|
|
2362
2364
|
options: A.value,
|
|
2363
2365
|
label: "Тема"
|
|
2364
2366
|
}, null, 8, ["modelValue", "options"])
|
|
2365
2367
|
]),
|
|
2366
|
-
d("footer",
|
|
2367
|
-
x(r(
|
|
2368
|
+
d("footer", bl, [
|
|
2369
|
+
x(r(V), {
|
|
2368
2370
|
variant: "primary",
|
|
2369
2371
|
onClick: R
|
|
2370
2372
|
}, {
|
|
@@ -2376,14 +2378,14 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2376
2378
|
])
|
|
2377
2379
|
]),
|
|
2378
2380
|
_: 1
|
|
2379
|
-
})) : f.value === "security" ? (s(), w(r(
|
|
2381
|
+
})) : f.value === "security" ? (s(), w(r(D), {
|
|
2380
2382
|
key: 1,
|
|
2381
2383
|
padding: "md"
|
|
2382
2384
|
}, {
|
|
2383
2385
|
default: m(() => [
|
|
2384
|
-
d("header",
|
|
2386
|
+
d("header", kl, [
|
|
2385
2387
|
y[8] || (y[8] = d("h3", { class: "admin-profile__card-title" }, "Двухфакторная аутентификация", -1)),
|
|
2386
|
-
x(r(
|
|
2388
|
+
x(r(Ge), {
|
|
2387
2389
|
variant: P.value ? "success" : "default"
|
|
2388
2390
|
}, {
|
|
2389
2391
|
default: m(() => [
|
|
@@ -2392,10 +2394,10 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { 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", wl, " 2FA включена. У вас остались recovery-коды на случай потери устройства. ")) : (s(), c("p", $l, " Включите 2FA для дополнительной защиты аккаунта. ")),
|
|
2398
|
+
d("footer", xl, [
|
|
2397
2399
|
P.value ? (s(), c(T, { key: 0 }, [
|
|
2398
|
-
x(r(
|
|
2400
|
+
x(r(V), {
|
|
2399
2401
|
variant: "ghost",
|
|
2400
2402
|
size: "sm",
|
|
2401
2403
|
onClick: U
|
|
@@ -2405,7 +2407,7 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2405
2407
|
])]),
|
|
2406
2408
|
_: 1
|
|
2407
2409
|
}),
|
|
2408
|
-
x(r(
|
|
2410
|
+
x(r(V), {
|
|
2409
2411
|
variant: "danger",
|
|
2410
2412
|
size: "sm",
|
|
2411
2413
|
onClick: g
|
|
@@ -2415,8 +2417,8 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2415
2417
|
])]),
|
|
2416
2418
|
_: 1
|
|
2417
2419
|
})
|
|
2418
|
-
], 64)) :
|
|
2419
|
-
x(r(
|
|
2420
|
+
], 64)) : X(k.$slots, "enable-2fa", { key: 1 }, () => [
|
|
2421
|
+
x(r(V), {
|
|
2420
2422
|
variant: "primary",
|
|
2421
2423
|
disabled: ""
|
|
2422
2424
|
}, {
|
|
@@ -2429,13 +2431,13 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2429
2431
|
])
|
|
2430
2432
|
]),
|
|
2431
2433
|
_: 3
|
|
2432
|
-
})) :
|
|
2434
|
+
})) : X(k.$slots, f.value, {
|
|
2433
2435
|
key: 2,
|
|
2434
2436
|
section: f.value
|
|
2435
2437
|
}, () => [
|
|
2436
|
-
x(r(
|
|
2438
|
+
x(r(D), { padding: "md" }, {
|
|
2437
2439
|
default: m(() => [
|
|
2438
|
-
d("p",
|
|
2440
|
+
d("p", Cl, " Section «" + h(f.value) + "» не реализована библиотекой — host-проект подключает её через slot " + h(f.value) + ". ", 1)
|
|
2439
2441
|
]),
|
|
2440
2442
|
_: 1
|
|
2441
2443
|
})
|
|
@@ -2444,13 +2446,13 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2444
2446
|
])
|
|
2445
2447
|
]));
|
|
2446
2448
|
}
|
|
2447
|
-
}),
|
|
2449
|
+
}), pe = Me(), Yi = pe.register, Al = pe.get, Qi = pe.has, Zi = pe.list, eo = pe.clear, Rl = pe.registerBundle, Ul = /* @__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(Z), { variant: "warning" }, {
|
|
2454
2456
|
title: m(() => [
|
|
2455
2457
|
C("Неизвестный widget-тип: " + h(e.type), 1)
|
|
2456
2458
|
]),
|
|
@@ -2462,25 +2464,25 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2462
2464
|
_: 1
|
|
2463
2465
|
}));
|
|
2464
2466
|
}
|
|
2465
|
-
}),
|
|
2467
|
+
}), El = /* @__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(() => Al(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(de(n.value), Ee(Fe({ key: 0 }, o.value)), null, 16)) : (s(), w(Ul, {
|
|
2476
2478
|
key: 1,
|
|
2477
2479
|
type: e.node.type
|
|
2478
2480
|
}, null, 8, ["type"]));
|
|
2479
2481
|
}
|
|
2480
|
-
}),
|
|
2482
|
+
}), Fl = { class: "admin-page admin-dashboard" }, Ll = { class: "admin-page__hd" }, Pl = { class: "admin-page__title-wrap" }, Tl = { class: "admin-page__title" }, Ml = {
|
|
2481
2483
|
key: 0,
|
|
2482
2484
|
class: "admin-page__count"
|
|
2483
|
-
},
|
|
2485
|
+
}, Nl = { class: "admin-page__actions" }, Il = { class: "admin-dashboard__grid" }, Bl = /* @__PURE__ */ L({
|
|
2484
2486
|
__name: "DashboardPage",
|
|
2485
2487
|
props: {
|
|
2486
2488
|
slug: { default: void 0 },
|
|
@@ -2489,7 +2491,7 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { 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 = ie(), 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 Ya = { class: "admin-page admin-resource-view" }, Qa = { 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", Fl, [
|
|
2504
|
+
d("header", Ll, [
|
|
2505
|
+
d("div", Pl, [
|
|
2506
|
+
d("h1", Tl, h(l.value), 1),
|
|
2507
|
+
i.value ? (s(), c("div", Ml, h(i.value), 1)) : F("", !0)
|
|
2506
2508
|
]),
|
|
2507
|
-
d("div",
|
|
2508
|
-
|
|
2509
|
+
d("div", Nl, [
|
|
2510
|
+
X(f.$slots, "actions")
|
|
2509
2511
|
])
|
|
2510
2512
|
]),
|
|
2511
|
-
d("div",
|
|
2512
|
-
(s(!0), c(T, null,
|
|
2513
|
+
d("div", Il, [
|
|
2514
|
+
(s(!0), c(T, null, B(a.value, (b, S) => (s(), c("div", {
|
|
2513
2515
|
key: S,
|
|
2514
2516
|
class: "admin-dashboard__cell",
|
|
2515
|
-
style:
|
|
2517
|
+
style: Le({ gridColumn: `span ${u(b)} / span ${u(b)}` })
|
|
2516
2518
|
}, [
|
|
2517
|
-
x(
|
|
2519
|
+
x(El, { node: b }, null, 8, ["node"])
|
|
2518
2520
|
], 4))), 128))
|
|
2519
2521
|
])
|
|
2520
2522
|
]));
|
|
2521
2523
|
}
|
|
2522
|
-
}),
|
|
2524
|
+
}), Vl = /* @__PURE__ */ L({
|
|
2523
2525
|
__name: "StatWidget",
|
|
2524
2526
|
props: {
|
|
2525
2527
|
title: { default: "" },
|
|
@@ -2539,7 +2541,7 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { 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(Ce), {
|
|
2543
2545
|
title: e.title,
|
|
2544
2546
|
value: e.value,
|
|
2545
2547
|
prefix: e.prefix,
|
|
@@ -2550,16 +2552,16 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2550
2552
|
loading: e.loading
|
|
2551
2553
|
}, null, 8, ["title", "value", "prefix", "suffix", "trend", "precision", "tone", "loading"]));
|
|
2552
2554
|
}
|
|
2553
|
-
}),
|
|
2555
|
+
}), zl = {
|
|
2554
2556
|
key: 0,
|
|
2555
2557
|
class: "admin-widget__hd"
|
|
2556
|
-
},
|
|
2558
|
+
}, ql = {
|
|
2557
2559
|
key: 0,
|
|
2558
2560
|
class: "admin-widget__title"
|
|
2559
|
-
},
|
|
2561
|
+
}, Dl = {
|
|
2560
2562
|
key: 1,
|
|
2561
2563
|
class: "admin-widget__desc"
|
|
2562
|
-
},
|
|
2564
|
+
}, Ol = ["viewBox", "height", "aria-label"], Wl = ["x", "y", "width", "height", "fill", "data-label", "data-value"], jl = /* @__PURE__ */ L({
|
|
2563
2565
|
__name: "BarChartWidget",
|
|
2564
2566
|
props: {
|
|
2565
2567
|
title: { default: "" },
|
|
@@ -2579,14 +2581,14 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2579
2581
|
heightPct: i.value / n.value * 100
|
|
2580
2582
|
}));
|
|
2581
2583
|
});
|
|
2582
|
-
return (a, l) => (s(), w(r(
|
|
2584
|
+
return (a, l) => (s(), w(r(D), {
|
|
2583
2585
|
padding: "md",
|
|
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", zl, [
|
|
2590
|
+
e.title ? (s(), c("h3", ql, h(e.title), 1)) : F("", !0),
|
|
2591
|
+
e.description ? (s(), c("p", Dl, h(e.description), 1)) : F("", !0)
|
|
2590
2592
|
])) : F("", !0),
|
|
2591
2593
|
(s(), c("svg", {
|
|
2592
2594
|
class: "admin-widget-bar-chart",
|
|
@@ -2597,7 +2599,7 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2597
2599
|
role: "img",
|
|
2598
2600
|
"aria-label": e.title || "Bar chart"
|
|
2599
2601
|
}, [
|
|
2600
|
-
(s(!0), c(T, null,
|
|
2602
|
+
(s(!0), c(T, null, B(o.value, (i, u) => (s(), c("rect", {
|
|
2601
2603
|
key: u,
|
|
2602
2604
|
x: i.x,
|
|
2603
2605
|
y: e.height - i.heightPct / 100 * e.height,
|
|
@@ -2609,16 +2611,16 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { 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, Wl))), 128))
|
|
2615
|
+
], 8, Ol))
|
|
2614
2616
|
]),
|
|
2615
2617
|
_: 1
|
|
2616
2618
|
}));
|
|
2617
2619
|
}
|
|
2618
|
-
}),
|
|
2620
|
+
}), Kl = {
|
|
2619
2621
|
key: 0,
|
|
2620
2622
|
class: "admin-widget__hd"
|
|
2621
|
-
},
|
|
2623
|
+
}, Gl = { class: "admin-widget__title" }, Hl = { class: "admin-donut-widget__row" }, Xl = ["aria-label"], Jl = ["d", "fill"], Yl = { class: "admin-donut-widget__legend" }, Ql = { class: "admin-donut-widget__label" }, Zl = { class: "admin-donut-widget__value" }, es = /* @__PURE__ */ L({
|
|
2622
2624
|
__name: "DonutChartWidget",
|
|
2623
2625
|
props: {
|
|
2624
2626
|
title: { default: "" },
|
|
@@ -2645,43 +2647,43 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2645
2647
|
};
|
|
2646
2648
|
});
|
|
2647
2649
|
});
|
|
2648
|
-
return (l, i) => (s(), w(r(
|
|
2650
|
+
return (l, i) => (s(), w(r(D), {
|
|
2649
2651
|
padding: "md",
|
|
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", Kl, [
|
|
2656
|
+
d("h3", Gl, h(e.title), 1)
|
|
2655
2657
|
])) : F("", !0),
|
|
2656
|
-
d("div",
|
|
2658
|
+
d("div", Hl, [
|
|
2657
2659
|
(s(), c("svg", {
|
|
2658
2660
|
viewBox: "0 0 120 120",
|
|
2659
2661
|
class: "admin-donut-widget__svg",
|
|
2660
2662
|
role: "img",
|
|
2661
2663
|
"aria-label": e.title
|
|
2662
2664
|
}, [
|
|
2663
|
-
(s(!0), c(T, null,
|
|
2665
|
+
(s(!0), c(T, null, B(a.value, (u, f) => (s(), c("path", {
|
|
2664
2666
|
key: f,
|
|
2665
2667
|
d: u.path,
|
|
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, Jl))), 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
|
-
(s(!0), c(T, null,
|
|
2678
|
+
], 8, Xl)),
|
|
2679
|
+
d("ul", Yl, [
|
|
2680
|
+
(s(!0), c(T, null, B(a.value, (u, f) => (s(), c("li", { key: f }, [
|
|
2679
2681
|
d("span", {
|
|
2680
2682
|
class: "admin-donut-widget__dot",
|
|
2681
|
-
style:
|
|
2683
|
+
style: Le({ background: u.color })
|
|
2682
2684
|
}, null, 4),
|
|
2683
|
-
d("span",
|
|
2684
|
-
d("span",
|
|
2685
|
+
d("span", Ql, h(u.label), 1),
|
|
2686
|
+
d("span", Zl, h(u.pct) + "%", 1)
|
|
2685
2687
|
]))), 128))
|
|
2686
2688
|
])
|
|
2687
2689
|
])
|
|
@@ -2689,10 +2691,10 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2689
2691
|
_: 1
|
|
2690
2692
|
}));
|
|
2691
2693
|
}
|
|
2692
|
-
}),
|
|
2694
|
+
}), ts = {
|
|
2693
2695
|
key: 0,
|
|
2694
2696
|
class: "admin-widget__hd"
|
|
2695
|
-
},
|
|
2697
|
+
}, ns = { class: "admin-widget__title" }, as = /* @__PURE__ */ L({
|
|
2696
2698
|
__name: "RecentTableWidget",
|
|
2697
2699
|
props: {
|
|
2698
2700
|
title: { default: "" },
|
|
@@ -2701,15 +2703,15 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2701
2703
|
emptyText: { default: "Нет данных" }
|
|
2702
2704
|
},
|
|
2703
2705
|
setup(e) {
|
|
2704
|
-
return (t, n) => (s(), w(r(
|
|
2706
|
+
return (t, n) => (s(), w(r(D), {
|
|
2705
2707
|
padding: "md",
|
|
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", ts, [
|
|
2712
|
+
d("h3", ns, h(e.title), 1)
|
|
2711
2713
|
])) : F("", !0),
|
|
2712
|
-
x(r(
|
|
2714
|
+
x(r(Ke), {
|
|
2713
2715
|
columns: e.columns,
|
|
2714
2716
|
data: e.rows,
|
|
2715
2717
|
"empty-text": e.emptyText
|
|
@@ -2718,10 +2720,10 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2718
2720
|
_: 1
|
|
2719
2721
|
}));
|
|
2720
2722
|
}
|
|
2721
|
-
}),
|
|
2723
|
+
}), ls = {
|
|
2722
2724
|
key: 0,
|
|
2723
2725
|
class: "admin-widget__hd"
|
|
2724
|
-
},
|
|
2726
|
+
}, ss = { class: "admin-widget__title" }, is = /* @__PURE__ */ L({
|
|
2725
2727
|
__name: "HeatmapWidget",
|
|
2726
2728
|
props: {
|
|
2727
2729
|
title: { default: "" },
|
|
@@ -2731,15 +2733,15 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2731
2733
|
gap: { default: 2 }
|
|
2732
2734
|
},
|
|
2733
2735
|
setup(e) {
|
|
2734
|
-
return (t, n) => (s(), w(r(
|
|
2736
|
+
return (t, n) => (s(), w(r(D), {
|
|
2735
2737
|
padding: "md",
|
|
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", ls, [
|
|
2742
|
+
d("h3", ss, h(e.title), 1)
|
|
2741
2743
|
])) : F("", !0),
|
|
2742
|
-
x(r(
|
|
2744
|
+
x(r(zt), {
|
|
2743
2745
|
data: e.data,
|
|
2744
2746
|
levels: e.levels,
|
|
2745
2747
|
color: e.color,
|
|
@@ -2749,10 +2751,10 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2749
2751
|
_: 1
|
|
2750
2752
|
}));
|
|
2751
2753
|
}
|
|
2752
|
-
}),
|
|
2754
|
+
}), os = {
|
|
2753
2755
|
key: 0,
|
|
2754
2756
|
class: "admin-widget__hd"
|
|
2755
|
-
},
|
|
2757
|
+
}, rs = { class: "admin-widget__title" }, us = { style: { display: "flex", "justify-content": "center" } }, ds = /* @__PURE__ */ L({
|
|
2756
2758
|
__name: "GaugeWidget",
|
|
2757
2759
|
props: {
|
|
2758
2760
|
title: { default: "" },
|
|
@@ -2774,16 +2776,16 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2774
2776
|
warning: "warning",
|
|
2775
2777
|
negative: "danger"
|
|
2776
2778
|
}, o = p(() => n[t.tone]);
|
|
2777
|
-
return (a, l) => (s(), w(r(
|
|
2779
|
+
return (a, l) => (s(), w(r(D), {
|
|
2778
2780
|
padding: "md",
|
|
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", os, [
|
|
2785
|
+
d("h3", rs, h(e.title), 1)
|
|
2784
2786
|
])) : F("", !0),
|
|
2785
|
-
d("div",
|
|
2786
|
-
x(r(
|
|
2787
|
+
d("div", us, [
|
|
2788
|
+
x(r(qt), {
|
|
2787
2789
|
value: e.value,
|
|
2788
2790
|
min: e.min,
|
|
2789
2791
|
max: e.max,
|
|
@@ -2800,49 +2802,49 @@ const Ya = { class: "admin-page admin-resource-view" }, Qa = { class: "admin-pag
|
|
|
2800
2802
|
_: 1
|
|
2801
2803
|
}));
|
|
2802
2804
|
}
|
|
2803
|
-
}),
|
|
2805
|
+
}), cs = {
|
|
2804
2806
|
key: 0,
|
|
2805
2807
|
class: "admin-widget__hd"
|
|
2806
|
-
},
|
|
2808
|
+
}, ms = { class: "admin-widget__title" }, fs = { class: "admin-markdown-widget" }, vs = /* @__PURE__ */ L({
|
|
2807
2809
|
__name: "MarkdownWidget",
|
|
2808
2810
|
props: {
|
|
2809
2811
|
title: { default: "" },
|
|
2810
2812
|
content: {}
|
|
2811
2813
|
},
|
|
2812
2814
|
setup(e) {
|
|
2813
|
-
return (t, n) => (s(), w(r(
|
|
2815
|
+
return (t, n) => (s(), w(r(D), {
|
|
2814
2816
|
padding: "md",
|
|
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", cs, [
|
|
2821
|
+
d("h3", ms, h(e.title), 1)
|
|
2820
2822
|
])) : F("", !0),
|
|
2821
|
-
d("div",
|
|
2823
|
+
d("div", fs, 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 ps() {
|
|
2830
|
+
Rl({
|
|
2831
|
+
stat: Vl,
|
|
2832
|
+
"bar-chart": jl,
|
|
2833
|
+
"donut-chart": es,
|
|
2834
|
+
"recent-table": as,
|
|
2835
|
+
heatmap: is,
|
|
2836
|
+
gauge: ds,
|
|
2837
|
+
markdown: vs
|
|
2836
2838
|
});
|
|
2837
2839
|
}
|
|
2838
|
-
function
|
|
2840
|
+
function gs(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 hs(e) {
|
|
2847
|
+
const t = Zt.create({
|
|
2846
2848
|
baseURL: e.baseURL,
|
|
2847
2849
|
withCredentials: !0,
|
|
2848
2850
|
headers: {
|
|
@@ -2851,15 +2853,15 @@ function gs(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 = _s("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 (gs(l))
|
|
2861
2863
|
return a.data = l.payload, a;
|
|
2862
|
-
throw
|
|
2864
|
+
throw Qe(a.status, l.payload);
|
|
2863
2865
|
}
|
|
2864
2866
|
return a;
|
|
2865
2867
|
},
|
|
@@ -2868,10 +2870,10 @@ function gs(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 = Qe(l, i);
|
|
2874
|
+
return u instanceof pt && e.onUnauthenticated?.(), Promise.reject(u);
|
|
2873
2875
|
}
|
|
2874
|
-
return Promise.reject(new
|
|
2876
|
+
return Promise.reject(new Te(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 gs(e) {
|
|
|
2887
2889
|
}
|
|
2888
2890
|
};
|
|
2889
2891
|
}
|
|
2890
|
-
function
|
|
2892
|
+
function _s(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("(^|; )" + ys(e) + "=([^;]*)"));
|
|
2893
2895
|
return t ? t[2] : null;
|
|
2894
2896
|
}
|
|
2895
|
-
function
|
|
2897
|
+
function ys(e) {
|
|
2896
2898
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2897
2899
|
}
|
|
2898
|
-
function
|
|
2900
|
+
function $e(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 bs(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 ks(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 ws(e, t) {
|
|
2910
2912
|
const n = e.slug, o = `/r/${n}`;
|
|
2911
2913
|
return [
|
|
2912
2914
|
{
|
|
@@ -2918,7 +2920,7 @@ function ks(e, t) {
|
|
|
2918
2920
|
kind: "resource",
|
|
2919
2921
|
slug: n,
|
|
2920
2922
|
title: e.label,
|
|
2921
|
-
permissions:
|
|
2923
|
+
permissions: $e(e, "view")
|
|
2922
2924
|
},
|
|
2923
2925
|
// slug передаётся в page-component'ы как prop. Конкретный slug запекаем в
|
|
2924
2926
|
// function-mode, чтобы page видел его одинаково и через named-route, и через
|
|
@@ -2934,7 +2936,7 @@ function ks(e, t) {
|
|
|
2934
2936
|
kind: "resource",
|
|
2935
2937
|
slug: n,
|
|
2936
2938
|
title: `${e.label}: создать`,
|
|
2937
|
-
permissions:
|
|
2939
|
+
permissions: $e(e, "create")
|
|
2938
2940
|
},
|
|
2939
2941
|
props: { slug: n }
|
|
2940
2942
|
},
|
|
@@ -2947,7 +2949,7 @@ function ks(e, t) {
|
|
|
2947
2949
|
kind: "resource",
|
|
2948
2950
|
slug: n,
|
|
2949
2951
|
title: `${e.label}: редактирование`,
|
|
2950
|
-
permissions:
|
|
2952
|
+
permissions: $e(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 ks(e, t) {
|
|
|
2961
2963
|
kind: "resource",
|
|
2962
2964
|
slug: n,
|
|
2963
2965
|
title: e.label,
|
|
2964
|
-
permissions:
|
|
2966
|
+
permissions: $e(e, "view")
|
|
2965
2967
|
},
|
|
2966
2968
|
props: (a) => ({ slug: n, id: a.params.id })
|
|
2967
2969
|
}
|
|
2968
2970
|
];
|
|
2969
2971
|
}
|
|
2970
|
-
function
|
|
2972
|
+
function $s(e, t) {
|
|
2971
2973
|
return {
|
|
2972
2974
|
path: `/screens/${e.slug}`,
|
|
2973
2975
|
name: `admin.screen.${e.slug}`,
|
|
@@ -2977,11 +2979,11 @@ function ws(e, t) {
|
|
|
2977
2979
|
kind: "screen",
|
|
2978
2980
|
slug: e.slug,
|
|
2979
2981
|
title: e.name,
|
|
2980
|
-
permissions:
|
|
2982
|
+
permissions: ks(e)
|
|
2981
2983
|
}
|
|
2982
2984
|
};
|
|
2983
2985
|
}
|
|
2984
|
-
function
|
|
2986
|
+
function xs(e, t) {
|
|
2985
2987
|
return {
|
|
2986
2988
|
path: `/settings/${e.slug}`,
|
|
2987
2989
|
name: `admin.settings.${e.slug}`,
|
|
@@ -2991,11 +2993,11 @@ function $s(e, t) {
|
|
|
2991
2993
|
kind: "settings",
|
|
2992
2994
|
slug: e.slug,
|
|
2993
2995
|
title: e.label,
|
|
2994
|
-
permissions:
|
|
2996
|
+
permissions: bs(e, "view")
|
|
2995
2997
|
}
|
|
2996
2998
|
};
|
|
2997
2999
|
}
|
|
2998
|
-
function
|
|
3000
|
+
function Cs(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 xs(e, t) {
|
|
|
3011
3013
|
}
|
|
3012
3014
|
};
|
|
3013
3015
|
}
|
|
3014
|
-
function
|
|
3016
|
+
function Ss(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(...ws(o, t));
|
|
3019
3021
|
for (const o of e.screens)
|
|
3020
|
-
n.push(ws(o, t));
|
|
3021
|
-
for (const o of e.settings)
|
|
3022
3022
|
n.push($s(o, t));
|
|
3023
|
+
for (const o of e.settings)
|
|
3024
|
+
n.push(xs(o, t));
|
|
3023
3025
|
for (const o of e.dashboards) {
|
|
3024
|
-
const a =
|
|
3026
|
+
const a = Cs(o, t);
|
|
3025
3027
|
a && n.push(a);
|
|
3026
3028
|
}
|
|
3027
3029
|
return n;
|
|
3028
3030
|
}
|
|
3029
|
-
function
|
|
3031
|
+
function As(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 = Y();
|
|
3035
3037
|
if (a.meta?.requiresAuth === !0 && !l.isAuthenticated)
|
|
3036
3038
|
return {
|
|
3037
3039
|
name: t,
|
|
@@ -3046,7 +3048,7 @@ function Ss(e = {}) {
|
|
|
3046
3048
|
return Array.isArray(u) && u.length > 0 && !l.hasAnyPermission(u) ? { name: n } : !0;
|
|
3047
3049
|
};
|
|
3048
3050
|
}
|
|
3049
|
-
function
|
|
3051
|
+
function Rs(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 As(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 Us = [
|
|
3059
3061
|
"admin.resource.",
|
|
3060
3062
|
"admin.screen.",
|
|
3061
3063
|
"admin.settings.",
|
|
3062
3064
|
"admin.dashboard."
|
|
3063
3065
|
];
|
|
3064
|
-
function Us(e) {
|
|
3065
|
-
return typeof e != "string" ? !1 : Rs.some((t) => e.startsWith(t));
|
|
3066
|
-
}
|
|
3067
3066
|
function Es(e) {
|
|
3068
|
-
|
|
3067
|
+
return typeof e != "string" ? !1 : Us.some((t) => e.startsWith(t));
|
|
3068
|
+
}
|
|
3069
|
+
function Fs(e) {
|
|
3070
|
+
const t = e.base ?? "/admin", n = e.history ?? ot(t), o = [
|
|
3069
3071
|
{
|
|
3070
3072
|
path: "/login",
|
|
3071
3073
|
name: "admin.login",
|
|
@@ -3101,22 +3103,22 @@ function Es(e) {
|
|
|
3101
3103
|
name: "admin.notFound",
|
|
3102
3104
|
component: e.components.notFound,
|
|
3103
3105
|
meta: { kind: "system", title: "404" }
|
|
3104
|
-
}, l =
|
|
3106
|
+
}, l = Ft({
|
|
3105
3107
|
history: n,
|
|
3106
3108
|
routes: [...o, ...e.extraRoutes ?? [], a]
|
|
3107
3109
|
});
|
|
3108
|
-
return l.beforeEach(
|
|
3110
|
+
return l.beforeEach(As(e.authGuard)), l.afterEach(Rs(e.titleGuard)), l.replaceManifestRoutes = (i) => {
|
|
3109
3111
|
const u = l.getRoutes();
|
|
3110
3112
|
for (const v of u)
|
|
3111
|
-
|
|
3113
|
+
Es(v.name) && l.removeRoute(v.name);
|
|
3112
3114
|
l.hasRoute("admin.notFound") && l.removeRoute("admin.notFound");
|
|
3113
|
-
const f =
|
|
3115
|
+
const f = Ss(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 J = /* @__PURE__ */ L({
|
|
3120
3122
|
__name: "TextField",
|
|
3121
3123
|
props: {
|
|
3122
3124
|
name: {},
|
|
@@ -3130,11 +3132,11 @@ const X = /* @__PURE__ */ L({
|
|
|
3130
3132
|
autocomplete: { default: null }
|
|
3131
3133
|
},
|
|
3132
3134
|
setup(e) {
|
|
3133
|
-
const t = e, n =
|
|
3135
|
+
const t = e, n = ce(), 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(ue), {
|
|
3138
3140
|
"model-value": o.value,
|
|
3139
3141
|
type: e.inputType,
|
|
3140
3142
|
label: e.label ?? void 0,
|
|
@@ -3149,7 +3151,7 @@ const X = /* @__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
|
+
}), xe = /* @__PURE__ */ L({
|
|
3153
3155
|
__name: "TextAreaField",
|
|
3154
3156
|
props: {
|
|
3155
3157
|
name: {},
|
|
@@ -3162,11 +3164,11 @@ const X = /* @__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 = ce(), 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(be), {
|
|
3170
3172
|
label: e.label ?? void 0,
|
|
3171
3173
|
hint: e.help ?? void 0,
|
|
3172
3174
|
error: a.value,
|
|
@@ -3174,7 +3176,7 @@ const X = /* @__PURE__ */ L({
|
|
|
3174
3176
|
disabled: e.disabled
|
|
3175
3177
|
}, {
|
|
3176
3178
|
default: m(() => [
|
|
3177
|
-
x(r(
|
|
3179
|
+
x(r(Dt), {
|
|
3178
3180
|
"model-value": o.value,
|
|
3179
3181
|
rows: e.rows,
|
|
3180
3182
|
placeholder: e.placeholder ?? void 0,
|
|
@@ -3187,7 +3189,7 @@ const X = /* @__PURE__ */ L({
|
|
|
3187
3189
|
_: 1
|
|
3188
3190
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3189
3191
|
}
|
|
3190
|
-
}),
|
|
3192
|
+
}), ze = /* @__PURE__ */ L({
|
|
3191
3193
|
__name: "NumberField",
|
|
3192
3194
|
props: {
|
|
3193
3195
|
name: {},
|
|
@@ -3202,14 +3204,14 @@ const X = /* @__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 = ce(), 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(be), {
|
|
3213
3215
|
label: e.label ?? void 0,
|
|
3214
3216
|
hint: e.help ?? void 0,
|
|
3215
3217
|
error: a.value,
|
|
@@ -3217,7 +3219,7 @@ const X = /* @__PURE__ */ L({
|
|
|
3217
3219
|
disabled: e.disabled
|
|
3218
3220
|
}, {
|
|
3219
3221
|
default: m(() => [
|
|
3220
|
-
x(r(
|
|
3222
|
+
x(r(Ot), {
|
|
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 X = /* @__PURE__ */ L({
|
|
|
3232
3234
|
_: 1
|
|
3233
3235
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3234
3236
|
}
|
|
3235
|
-
}),
|
|
3237
|
+
}), ne = /* @__PURE__ */ L({
|
|
3236
3238
|
__name: "SelectField",
|
|
3237
3239
|
props: {
|
|
3238
3240
|
name: {},
|
|
@@ -3247,14 +3249,14 @@ const X = /* @__PURE__ */ L({
|
|
|
3247
3249
|
size: { default: "md" }
|
|
3248
3250
|
},
|
|
3249
3251
|
setup(e) {
|
|
3250
|
-
const t = e, n =
|
|
3252
|
+
const t = e, n = ce(), 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(be), {
|
|
3258
3260
|
label: e.label ?? void 0,
|
|
3259
3261
|
hint: e.help ?? void 0,
|
|
3260
3262
|
error: a.value,
|
|
@@ -3262,7 +3264,7 @@ const X = /* @__PURE__ */ L({
|
|
|
3262
3264
|
disabled: e.disabled
|
|
3263
3265
|
}, {
|
|
3264
3266
|
default: m(() => [
|
|
3265
|
-
x(r(
|
|
3267
|
+
x(r(Re), {
|
|
3266
3268
|
"model-value": o.value,
|
|
3267
3269
|
options: e.options,
|
|
3268
3270
|
placeholder: e.placeholder ?? void 0,
|
|
@@ -3276,7 +3278,7 @@ const X = /* @__PURE__ */ L({
|
|
|
3276
3278
|
_: 1
|
|
3277
3279
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3278
3280
|
}
|
|
3279
|
-
}),
|
|
3281
|
+
}), qe = /* @__PURE__ */ L({
|
|
3280
3282
|
__name: "CheckboxField",
|
|
3281
3283
|
props: {
|
|
3282
3284
|
name: {},
|
|
@@ -3287,11 +3289,11 @@ const X = /* @__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 = ce(), 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(be), {
|
|
3295
3297
|
label: e.label ?? void 0,
|
|
3296
3298
|
hint: e.help ?? void 0,
|
|
3297
3299
|
error: a.value,
|
|
@@ -3299,7 +3301,7 @@ const X = /* @__PURE__ */ L({
|
|
|
3299
3301
|
disabled: e.disabled
|
|
3300
3302
|
}, {
|
|
3301
3303
|
default: m(() => [
|
|
3302
|
-
x(r(
|
|
3304
|
+
x(r(Ae), {
|
|
3303
3305
|
"model-value": o.value,
|
|
3304
3306
|
disabled: e.disabled,
|
|
3305
3307
|
name: e.name,
|
|
@@ -3316,7 +3318,7 @@ const X = /* @__PURE__ */ L({
|
|
|
3316
3318
|
_: 1
|
|
3317
3319
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3318
3320
|
}
|
|
3319
|
-
}),
|
|
3321
|
+
}), re = /* @__PURE__ */ L({
|
|
3320
3322
|
__name: "DateField",
|
|
3321
3323
|
props: {
|
|
3322
3324
|
name: {},
|
|
@@ -3329,14 +3331,14 @@ const X = /* @__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 = ce(), 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(be), {
|
|
3340
3342
|
label: e.label ?? void 0,
|
|
3341
3343
|
hint: e.help ?? void 0,
|
|
3342
3344
|
error: a.value,
|
|
@@ -3344,7 +3346,7 @@ const X = /* @__PURE__ */ L({
|
|
|
3344
3346
|
disabled: e.disabled
|
|
3345
3347
|
}, {
|
|
3346
3348
|
default: m(() => [
|
|
3347
|
-
x(r(
|
|
3349
|
+
x(r(Wt), {
|
|
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 X = /* @__PURE__ */ L({
|
|
|
3356
3358
|
_: 1
|
|
3357
3359
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3358
3360
|
}
|
|
3359
|
-
}),
|
|
3361
|
+
}), at = /* @__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(jt), {
|
|
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,
|
|
3374
|
+
(s(!0), c(T, null, B(e.items, (o, a) => (s(), w(ke, {
|
|
3373
3375
|
key: a,
|
|
3374
3376
|
node: o
|
|
3375
3377
|
}, null, 8, ["node"]))), 128))
|
|
@@ -3377,7 +3379,7 @@ const X = /* @__PURE__ */ L({
|
|
|
3377
3379
|
_: 1
|
|
3378
3380
|
}, 8, ["gap"]));
|
|
3379
3381
|
}
|
|
3380
|
-
}),
|
|
3382
|
+
}), Ls = /* @__PURE__ */ L({
|
|
3381
3383
|
__name: "ColumnsLayout",
|
|
3382
3384
|
props: {
|
|
3383
3385
|
items: {},
|
|
@@ -3390,32 +3392,32 @@ const X = /* @__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(Kt), {
|
|
3394
3396
|
cols: e.cols,
|
|
3395
3397
|
gap: e.gap
|
|
3396
3398
|
}, {
|
|
3397
3399
|
default: m(() => [
|
|
3398
|
-
(s(!0), c(T, null,
|
|
3400
|
+
(s(!0), c(T, null, B(e.items, (i, u) => (s(), c("div", {
|
|
3399
3401
|
key: u,
|
|
3400
3402
|
class: "admin-columns__item",
|
|
3401
|
-
style:
|
|
3403
|
+
style: Le({ gridColumn: `span ${o(i)} / span ${o(i)}` })
|
|
3402
3404
|
}, [
|
|
3403
|
-
x(
|
|
3405
|
+
x(ke, { node: i }, null, 8, ["node"])
|
|
3404
3406
|
], 4))), 128))
|
|
3405
3407
|
]),
|
|
3406
3408
|
_: 1
|
|
3407
3409
|
}, 8, ["cols", "gap"]));
|
|
3408
3410
|
}
|
|
3409
|
-
}),
|
|
3411
|
+
}), Ps = {
|
|
3410
3412
|
key: 0,
|
|
3411
3413
|
class: "admin-section__header"
|
|
3412
|
-
},
|
|
3414
|
+
}, Ts = {
|
|
3413
3415
|
key: 0,
|
|
3414
3416
|
class: "admin-section__title"
|
|
3415
|
-
},
|
|
3417
|
+
}, Ms = {
|
|
3416
3418
|
key: 1,
|
|
3417
3419
|
class: "admin-section__description"
|
|
3418
|
-
},
|
|
3420
|
+
}, Ns = { class: "admin-section__body" }, he = /* @__PURE__ */ L({
|
|
3419
3421
|
__name: "SectionLayout",
|
|
3420
3422
|
props: {
|
|
3421
3423
|
items: {},
|
|
@@ -3423,17 +3425,17 @@ const X = /* @__PURE__ */ L({
|
|
|
3423
3425
|
description: { default: null }
|
|
3424
3426
|
},
|
|
3425
3427
|
setup(e) {
|
|
3426
|
-
return (t, n) => (s(), w(r(
|
|
3428
|
+
return (t, n) => (s(), w(r(D), {
|
|
3427
3429
|
padding: "md",
|
|
3428
3430
|
class: "admin-section"
|
|
3429
3431
|
}, {
|
|
3430
3432
|
default: m(() => [
|
|
3431
|
-
e.title || e.description ? (s(), c("header",
|
|
3432
|
-
e.title ? (s(), c("h3",
|
|
3433
|
-
e.description ? (s(), c("p",
|
|
3433
|
+
e.title || e.description ? (s(), c("header", Ps, [
|
|
3434
|
+
e.title ? (s(), c("h3", Ts, h(e.title), 1)) : F("", !0),
|
|
3435
|
+
e.description ? (s(), c("p", Ms, h(e.description), 1)) : F("", !0)
|
|
3434
3436
|
])) : F("", !0),
|
|
3435
|
-
d("div",
|
|
3436
|
-
(s(!0), c(T, null,
|
|
3437
|
+
d("div", Ns, [
|
|
3438
|
+
(s(!0), c(T, null, B(e.items, (o, a) => (s(), w(ke, {
|
|
3437
3439
|
key: a,
|
|
3438
3440
|
node: o
|
|
3439
3441
|
}, null, 8, ["node"]))), 128))
|
|
@@ -3442,7 +3444,7 @@ const X = /* @__PURE__ */ L({
|
|
|
3442
3444
|
_: 1
|
|
3443
3445
|
}));
|
|
3444
3446
|
}
|
|
3445
|
-
}),
|
|
3447
|
+
}), Is = /* @__PURE__ */ L({
|
|
3446
3448
|
__name: "TabsLayout",
|
|
3447
3449
|
props: {
|
|
3448
3450
|
items: {},
|
|
@@ -3458,12 +3460,12 @@ const X = /* @__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(dt), {
|
|
3462
3464
|
"model-value": l.value,
|
|
3463
3465
|
"onUpdate:modelValue": i
|
|
3464
3466
|
}, {
|
|
3465
3467
|
list: m(() => [
|
|
3466
|
-
(s(!0), c(T, null,
|
|
3468
|
+
(s(!0), c(T, null, B(e.items, (v, b) => (s(), w(r(Se), {
|
|
3467
3469
|
key: a(v, b),
|
|
3468
3470
|
value: a(v, b)
|
|
3469
3471
|
}, {
|
|
@@ -3474,12 +3476,12 @@ const X = /* @__PURE__ */ L({
|
|
|
3474
3476
|
}, 1032, ["value"]))), 128))
|
|
3475
3477
|
]),
|
|
3476
3478
|
default: m(() => [
|
|
3477
|
-
(s(!0), c(T, null,
|
|
3479
|
+
(s(!0), c(T, null, B(e.items, (v, b) => (s(), w(r(ct), {
|
|
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,
|
|
3484
|
+
(s(!0), c(T, null, B(v.items, (S, A) => (s(), w(ke, {
|
|
3483
3485
|
key: A,
|
|
3484
3486
|
node: S
|
|
3485
3487
|
}, null, 8, ["node"]))), 128))
|
|
@@ -3491,65 +3493,65 @@ const X = /* @__PURE__ */ L({
|
|
|
3491
3493
|
}, 8, ["model-value"]));
|
|
3492
3494
|
}
|
|
3493
3495
|
});
|
|
3494
|
-
function
|
|
3495
|
-
|
|
3496
|
+
function Bs() {
|
|
3497
|
+
Ea({
|
|
3496
3498
|
fields: {
|
|
3497
3499
|
// Backend Field-классы из dskripchenko/laravel-admin отдают эти fieldType()
|
|
3498
3500
|
// строки. Соответствие см. core/src/Field/{Input,TextArea,Select,...}.php.
|
|
3499
|
-
input:
|
|
3500
|
-
text:
|
|
3501
|
-
email:
|
|
3502
|
-
url:
|
|
3503
|
-
password:
|
|
3504
|
-
tel:
|
|
3505
|
-
search:
|
|
3506
|
-
slug:
|
|
3507
|
-
hidden:
|
|
3508
|
-
label:
|
|
3509
|
-
textarea:
|
|
3501
|
+
input: J,
|
|
3502
|
+
text: J,
|
|
3503
|
+
email: J,
|
|
3504
|
+
url: J,
|
|
3505
|
+
password: J,
|
|
3506
|
+
tel: J,
|
|
3507
|
+
search: J,
|
|
3508
|
+
slug: J,
|
|
3509
|
+
hidden: J,
|
|
3510
|
+
label: J,
|
|
3511
|
+
textarea: xe,
|
|
3510
3512
|
// Fallback для wysiwyg/markdown/code — обычный TextAreaField.
|
|
3511
3513
|
// Реальный rich-editor host подключает через subpath:
|
|
3512
3514
|
// import { QuillField } from '@dskripchenko/laravel-admin/quill'
|
|
3513
3515
|
// registerField('wysiwyg', QuillField)
|
|
3514
|
-
wysiwyg:
|
|
3515
|
-
markdown:
|
|
3516
|
-
code:
|
|
3517
|
-
number:
|
|
3518
|
-
slider:
|
|
3519
|
-
rating:
|
|
3520
|
-
select:
|
|
3521
|
-
combobox:
|
|
3522
|
-
radio:
|
|
3523
|
-
tags:
|
|
3524
|
-
"morph-switcher":
|
|
3525
|
-
relation:
|
|
3526
|
-
cascader:
|
|
3527
|
-
"tree-select":
|
|
3528
|
-
checkbox:
|
|
3529
|
-
switcher:
|
|
3530
|
-
boolean:
|
|
3531
|
-
date:
|
|
3532
|
-
datetime:
|
|
3533
|
-
datepicker:
|
|
3534
|
-
"date-range":
|
|
3535
|
-
time:
|
|
3536
|
-
"time-picker":
|
|
3537
|
-
"color-picker":
|
|
3516
|
+
wysiwyg: xe,
|
|
3517
|
+
markdown: xe,
|
|
3518
|
+
code: xe,
|
|
3519
|
+
number: ze,
|
|
3520
|
+
slider: ze,
|
|
3521
|
+
rating: ze,
|
|
3522
|
+
select: ne,
|
|
3523
|
+
combobox: ne,
|
|
3524
|
+
radio: ne,
|
|
3525
|
+
tags: ne,
|
|
3526
|
+
"morph-switcher": ne,
|
|
3527
|
+
relation: ne,
|
|
3528
|
+
cascader: ne,
|
|
3529
|
+
"tree-select": ne,
|
|
3530
|
+
checkbox: qe,
|
|
3531
|
+
switcher: qe,
|
|
3532
|
+
boolean: qe,
|
|
3533
|
+
date: re,
|
|
3534
|
+
datetime: re,
|
|
3535
|
+
datepicker: re,
|
|
3536
|
+
"date-range": re,
|
|
3537
|
+
time: re,
|
|
3538
|
+
"time-picker": re,
|
|
3539
|
+
"color-picker": J
|
|
3538
3540
|
},
|
|
3539
3541
|
layouts: {
|
|
3540
|
-
rows:
|
|
3541
|
-
columns:
|
|
3542
|
-
section:
|
|
3543
|
-
block:
|
|
3544
|
-
tabs:
|
|
3545
|
-
accordion:
|
|
3546
|
-
group:
|
|
3547
|
-
step:
|
|
3548
|
-
wizard:
|
|
3542
|
+
rows: at,
|
|
3543
|
+
columns: Ls,
|
|
3544
|
+
section: he,
|
|
3545
|
+
block: he,
|
|
3546
|
+
tabs: Is,
|
|
3547
|
+
accordion: he,
|
|
3548
|
+
group: at,
|
|
3549
|
+
step: he,
|
|
3550
|
+
wizard: he
|
|
3549
3551
|
}
|
|
3550
3552
|
});
|
|
3551
3553
|
}
|
|
3552
|
-
const
|
|
3554
|
+
const I = /* @__PURE__ */ L({
|
|
3553
3555
|
__name: "TextEntry",
|
|
3554
3556
|
props: {
|
|
3555
3557
|
name: { default: "" },
|
|
@@ -3559,12 +3561,12 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3559
3561
|
mono: { type: Boolean, default: !1 }
|
|
3560
3562
|
},
|
|
3561
3563
|
setup(e) {
|
|
3562
|
-
const t = e, n =
|
|
3564
|
+
const t = e, n = Ne(), o = p(() => {
|
|
3563
3565
|
let a = t.value;
|
|
3564
3566
|
return a === void 0 && n && t.name && (a = n[t.name]), a == null || a === "" ? t.placeholder : String(a);
|
|
3565
3567
|
});
|
|
3566
3568
|
return (a, l) => (s(), c("span", {
|
|
3567
|
-
class:
|
|
3569
|
+
class: Q(["admin-infolist-text", e.mono ? "admin-infolist-text--mono" : ""])
|
|
3568
3570
|
}, h(o.value), 3));
|
|
3569
3571
|
}
|
|
3570
3572
|
}), Vs = {
|
|
@@ -3580,11 +3582,11 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3580
3582
|
variant: { default: void 0 }
|
|
3581
3583
|
},
|
|
3582
3584
|
setup(e) {
|
|
3583
|
-
const t = e, n =
|
|
3585
|
+
const t = e, n = Ne(), o = p(() => {
|
|
3584
3586
|
let l = t.value;
|
|
3585
3587
|
return l === void 0 && n && t.name && (l = n[t.name]), l == null ? "" : String(l);
|
|
3586
3588
|
}), a = p(() => t.variant ? t.variant : t.map[o.value] ?? "default");
|
|
3587
|
-
return (l, i) => o.value ? (s(), w(r(
|
|
3589
|
+
return (l, i) => o.value ? (s(), w(r(Ge), {
|
|
3588
3590
|
key: 0,
|
|
3589
3591
|
variant: a.value
|
|
3590
3592
|
}, {
|
|
@@ -3606,12 +3608,12 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3606
3608
|
falseLabel: { default: "" }
|
|
3607
3609
|
},
|
|
3608
3610
|
setup(e) {
|
|
3609
|
-
const t = e, n =
|
|
3611
|
+
const t = e, n = Ne(), o = p(() => {
|
|
3610
3612
|
let i = t.value;
|
|
3611
3613
|
return i === void 0 && n && t.name && (i = n[t.name]), !!i;
|
|
3612
3614
|
}), a = p(() => o.value ? t.trueLabel : t.falseLabel), l = p(() => o.value ? t.trueIcon : t.falseIcon);
|
|
3613
3615
|
return (i, u) => (s(), c("span", {
|
|
3614
|
-
class:
|
|
3616
|
+
class: Q(["admin-infolist-icon", o.value ? "admin-infolist-icon--on" : "admin-infolist-icon--off"])
|
|
3615
3617
|
}, [
|
|
3616
3618
|
d("span", {
|
|
3617
3619
|
class: "admin-infolist-icon__glyph",
|
|
@@ -3623,7 +3625,7 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3623
3625
|
}), Ws = {
|
|
3624
3626
|
key: 1,
|
|
3625
3627
|
class: "admin-infolist-text"
|
|
3626
|
-
},
|
|
3628
|
+
}, lt = /* @__PURE__ */ L({
|
|
3627
3629
|
__name: "KeyValueEntry",
|
|
3628
3630
|
props: {
|
|
3629
3631
|
name: { default: "" },
|
|
@@ -3631,20 +3633,20 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3631
3633
|
value: { default: void 0 }
|
|
3632
3634
|
},
|
|
3633
3635
|
setup(e) {
|
|
3634
|
-
const t = e, n =
|
|
3636
|
+
const t = e, n = Ne(), o = p(() => {
|
|
3635
3637
|
let l = t.value;
|
|
3636
3638
|
return l === void 0 && n && t.name && (l = n[t.name]), l == null ? [] : typeof l != "object" ? [] : Object.entries(l);
|
|
3637
3639
|
});
|
|
3638
3640
|
function a(l) {
|
|
3639
3641
|
return l == null ? "—" : typeof l == "object" ? JSON.stringify(l) : String(l);
|
|
3640
3642
|
}
|
|
3641
|
-
return (l, i) => o.value.length > 0 ? (s(), w(r(
|
|
3643
|
+
return (l, i) => o.value.length > 0 ? (s(), w(r(Gt), {
|
|
3642
3644
|
key: 0,
|
|
3643
3645
|
direction: "vertical",
|
|
3644
3646
|
columns: 1
|
|
3645
3647
|
}, {
|
|
3646
3648
|
default: m(() => [
|
|
3647
|
-
(s(!0), c(T, null,
|
|
3649
|
+
(s(!0), c(T, null, B(o.value, ([u, f]) => (s(), w(r(Ht), {
|
|
3648
3650
|
key: u,
|
|
3649
3651
|
label: u
|
|
3650
3652
|
}, {
|
|
@@ -3659,45 +3661,82 @@ const Bs = /* @__PURE__ */ L({
|
|
|
3659
3661
|
}
|
|
3660
3662
|
});
|
|
3661
3663
|
function js() {
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
+
Ba({
|
|
3665
|
+
// Дефолтные типы infolist (BadgeEntry::make() и т.п.).
|
|
3666
|
+
text: I,
|
|
3664
3667
|
badge: zs,
|
|
3665
3668
|
icon: Os,
|
|
3666
|
-
keyvalue:
|
|
3667
|
-
"key-value":
|
|
3669
|
+
keyvalue: lt,
|
|
3670
|
+
"key-value": lt,
|
|
3671
|
+
// Маппинг от backend Field::fieldType() → TextEntry для view-режима.
|
|
3672
|
+
// Host'ы могут перебить registerInfolistEntry('wysiwyg', WysiwygEntry).
|
|
3673
|
+
input: I,
|
|
3674
|
+
email: I,
|
|
3675
|
+
url: I,
|
|
3676
|
+
password: I,
|
|
3677
|
+
tel: I,
|
|
3678
|
+
search: I,
|
|
3679
|
+
slug: I,
|
|
3680
|
+
hidden: I,
|
|
3681
|
+
label: I,
|
|
3682
|
+
textarea: I,
|
|
3683
|
+
wysiwyg: I,
|
|
3684
|
+
markdown: I,
|
|
3685
|
+
code: I,
|
|
3686
|
+
number: I,
|
|
3687
|
+
slider: I,
|
|
3688
|
+
rating: I,
|
|
3689
|
+
select: I,
|
|
3690
|
+
combobox: I,
|
|
3691
|
+
radio: I,
|
|
3692
|
+
tags: I,
|
|
3693
|
+
"morph-switcher": I,
|
|
3694
|
+
relation: I,
|
|
3695
|
+
cascader: I,
|
|
3696
|
+
"tree-select": I,
|
|
3697
|
+
checkbox: I,
|
|
3698
|
+
switcher: I,
|
|
3699
|
+
boolean: I,
|
|
3700
|
+
date: I,
|
|
3701
|
+
datetime: I,
|
|
3702
|
+
datepicker: I,
|
|
3703
|
+
"date-range": I,
|
|
3704
|
+
time: I,
|
|
3705
|
+
"time-picker": I,
|
|
3706
|
+
"color-picker": I
|
|
3668
3707
|
});
|
|
3669
3708
|
}
|
|
3670
3709
|
function no(e, t = {}) {
|
|
3671
|
-
const n = t.pages ?? {}, o = t.base ?? Ks(e.baseUrl) ?? "/admin", a =
|
|
3710
|
+
const n = t.pages ?? {}, o = t.base ?? Ks(e.baseUrl) ?? "/admin", a = hs({
|
|
3672
3711
|
baseURL: e.apiUrl,
|
|
3673
3712
|
csrfToken: e.csrf
|
|
3674
3713
|
});
|
|
3675
|
-
|
|
3676
|
-
const l =
|
|
3677
|
-
l.use(i),
|
|
3678
|
-
const u =
|
|
3714
|
+
en(a);
|
|
3715
|
+
const l = At(An), i = Ut();
|
|
3716
|
+
l.use(i), Y().hydrate(e), Xe().hydrate(e), He().hydrate(e), Je().hydrate(e), Bs(), ps(), js();
|
|
3717
|
+
const u = Fs({
|
|
3679
3718
|
base: o,
|
|
3680
|
-
history: t.router?.history ??
|
|
3719
|
+
history: t.router?.history ?? ot(o),
|
|
3681
3720
|
components: {
|
|
3682
|
-
login: n.login ??
|
|
3683
|
-
home: n.home ??
|
|
3684
|
-
forbidden: n.forbidden ??
|
|
3685
|
-
notFound: n.notFound ??
|
|
3686
|
-
profile: n.profile ??
|
|
3687
|
-
resourceIndex: n.resourceIndex ??
|
|
3688
|
-
resourceCreate: n.resourceCreate ??
|
|
3689
|
-
resourceEdit: n.resourceEdit ??
|
|
3690
|
-
resourceView: n.resourceView ??
|
|
3691
|
-
dashboard: n.dashboard ??
|
|
3692
|
-
settings: n.settings ??
|
|
3693
|
-
screen: n.screen ??
|
|
3721
|
+
login: n.login ?? ca,
|
|
3722
|
+
home: n.home ?? Mn,
|
|
3723
|
+
forbidden: n.forbidden ?? In,
|
|
3724
|
+
notFound: n.notFound ?? Vn,
|
|
3725
|
+
profile: n.profile ?? Sl,
|
|
3726
|
+
resourceIndex: n.resourceIndex ?? Ua,
|
|
3727
|
+
resourceCreate: n.resourceCreate ?? tt,
|
|
3728
|
+
resourceEdit: n.resourceEdit ?? tt,
|
|
3729
|
+
resourceView: n.resourceView ?? ll,
|
|
3730
|
+
dashboard: n.dashboard ?? Bl,
|
|
3731
|
+
settings: n.settings ?? Wn,
|
|
3732
|
+
screen: n.screen ?? Hn
|
|
3694
3733
|
},
|
|
3695
3734
|
extraRoutes: t.router?.extraRoutes,
|
|
3696
3735
|
authGuard: t.router?.authGuard,
|
|
3697
3736
|
titleGuard: t.router?.titleGuard
|
|
3698
3737
|
});
|
|
3699
3738
|
if (l.use(u), !t.skipManifestLoad) {
|
|
3700
|
-
const f =
|
|
3739
|
+
const f = ie(), v = Y(), b = () => {
|
|
3701
3740
|
f.load().then((S) => {
|
|
3702
3741
|
u.replaceManifestRoutes(S);
|
|
3703
3742
|
const A = u.currentRoute.value;
|
|
@@ -3706,7 +3745,7 @@ function no(e, t = {}) {
|
|
|
3706
3745
|
typeof console < "u" && console.error("[laravel-admin] manifest load failed:", S);
|
|
3707
3746
|
});
|
|
3708
3747
|
};
|
|
3709
|
-
v.isAuthenticated && b(),
|
|
3748
|
+
v.isAuthenticated && b(), ae(
|
|
3710
3749
|
() => v.user,
|
|
3711
3750
|
(S, A) => {
|
|
3712
3751
|
S && !A && b();
|
|
@@ -3732,7 +3771,7 @@ async function ao(e = {}) {
|
|
|
3732
3771
|
const n = e.xhrUrl ?? "/system/bootstrap";
|
|
3733
3772
|
return await e.client.get(n);
|
|
3734
3773
|
} catch (n) {
|
|
3735
|
-
if (n instanceof
|
|
3774
|
+
if (n instanceof Te)
|
|
3736
3775
|
return null;
|
|
3737
3776
|
throw n;
|
|
3738
3777
|
}
|
|
@@ -3769,11 +3808,11 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3769
3808
|
},
|
|
3770
3809
|
emits: ["update:open", "select-item"],
|
|
3771
3810
|
setup(e, { emit: t }) {
|
|
3772
|
-
const n = e, o = t, a =
|
|
3811
|
+
const n = e, o = t, a = Je();
|
|
3773
3812
|
function l(g) {
|
|
3774
3813
|
o("update:open", g);
|
|
3775
3814
|
}
|
|
3776
|
-
|
|
3815
|
+
ae(
|
|
3777
3816
|
() => n.open,
|
|
3778
3817
|
async (g) => {
|
|
3779
3818
|
g && await a.load(a.lastFilter ?? "all", 1).catch(() => {
|
|
@@ -3818,7 +3857,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3818
3857
|
const $ = Math.floor(y / 24);
|
|
3819
3858
|
return $ < 7 ? `${$} д назад` : U.toLocaleDateString("ru-RU");
|
|
3820
3859
|
}
|
|
3821
|
-
return (g, U) => (s(), w(r(
|
|
3860
|
+
return (g, U) => (s(), w(r(Xt), {
|
|
3822
3861
|
"model-value": e.open,
|
|
3823
3862
|
side: "right",
|
|
3824
3863
|
width: "400px",
|
|
@@ -3831,7 +3870,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3831
3870
|
U[0] || (U[0] = C(" Уведомления ", -1)),
|
|
3832
3871
|
r(a).unreadCount > 0 ? (s(), c("span", Js, " (" + h(r(a).unreadCount) + ") ", 1)) : F("", !0)
|
|
3833
3872
|
]),
|
|
3834
|
-
r(a).unreadCount > 0 ? (s(), w(r(
|
|
3873
|
+
r(a).unreadCount > 0 ? (s(), w(r(V), {
|
|
3835
3874
|
key: 0,
|
|
3836
3875
|
variant: "ghost",
|
|
3837
3876
|
size: "sm",
|
|
@@ -3845,18 +3884,18 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3845
3884
|
])
|
|
3846
3885
|
]),
|
|
3847
3886
|
default: m(() => [
|
|
3848
|
-
x(r(
|
|
3887
|
+
x(r(dt), {
|
|
3849
3888
|
"model-value": i.value,
|
|
3850
3889
|
"onUpdate:modelValue": u
|
|
3851
3890
|
}, {
|
|
3852
3891
|
list: m(() => [
|
|
3853
|
-
x(r(
|
|
3892
|
+
x(r(Se), { value: "all" }, {
|
|
3854
3893
|
default: m(() => [...U[2] || (U[2] = [
|
|
3855
3894
|
C("Все", -1)
|
|
3856
3895
|
])]),
|
|
3857
3896
|
_: 1
|
|
3858
3897
|
}),
|
|
3859
|
-
x(r(
|
|
3898
|
+
x(r(Se), { value: "unread" }, {
|
|
3860
3899
|
default: m(() => [
|
|
3861
3900
|
U[3] || (U[3] = C(" Непрочитанные", -1)),
|
|
3862
3901
|
r(a).unreadCount > 0 ? (s(), c(T, { key: 0 }, [
|
|
@@ -3865,7 +3904,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3865
3904
|
]),
|
|
3866
3905
|
_: 1
|
|
3867
3906
|
}),
|
|
3868
|
-
x(r(
|
|
3907
|
+
x(r(Se), { value: "read" }, {
|
|
3869
3908
|
default: m(() => [...U[4] || (U[4] = [
|
|
3870
3909
|
C("Прочитанные", -1)
|
|
3871
3910
|
])]),
|
|
@@ -3873,16 +3912,16 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3873
3912
|
})
|
|
3874
3913
|
]),
|
|
3875
3914
|
default: m(() => [
|
|
3876
|
-
(s(), c(T, null,
|
|
3915
|
+
(s(), c(T, null, B(["all", "unread", "read"], (P) => x(r(ct), {
|
|
3877
3916
|
key: P,
|
|
3878
3917
|
value: P
|
|
3879
3918
|
}, {
|
|
3880
3919
|
default: m(() => [
|
|
3881
3920
|
d("ul", Ys, [
|
|
3882
3921
|
r(a).loading ? (s(), c("li", Qs, " Загрузка… ")) : r(a).items.length === 0 ? (s(), c("li", Zs, " Нет уведомлений ")) : F("", !0),
|
|
3883
|
-
(s(!0), c(T, null,
|
|
3922
|
+
(s(!0), c(T, null, B(r(a).items, (k) => (s(), c("li", {
|
|
3884
3923
|
key: k.id,
|
|
3885
|
-
class:
|
|
3924
|
+
class: Q([
|
|
3886
3925
|
"admin-notifs__item",
|
|
3887
3926
|
`admin-notifs__item--${S(k)}`,
|
|
3888
3927
|
{ "admin-notifs__item--unread": !k.read_at }
|
|
@@ -3999,7 +4038,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3999
4038
|
d("h1", mi, h(e.title), 1)
|
|
4000
4039
|
]),
|
|
4001
4040
|
d("div", fi, [
|
|
4002
|
-
x(r(
|
|
4041
|
+
x(r(V), {
|
|
4003
4042
|
variant: "ghost",
|
|
4004
4043
|
onClick: k
|
|
4005
4044
|
}, {
|
|
@@ -4010,11 +4049,11 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4010
4049
|
})
|
|
4011
4050
|
])
|
|
4012
4051
|
]),
|
|
4013
|
-
x(r(
|
|
4052
|
+
x(r(Jt), {
|
|
4014
4053
|
steps: a,
|
|
4015
4054
|
current: i.value
|
|
4016
4055
|
}, null, 8, ["current"]),
|
|
4017
|
-
i.value === 0 ? (s(), w(r(
|
|
4056
|
+
i.value === 0 ? (s(), w(r(D), {
|
|
4018
4057
|
key: 0,
|
|
4019
4058
|
padding: "md",
|
|
4020
4059
|
class: "admin-import-wizard__card"
|
|
@@ -4024,7 +4063,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4024
4063
|
d("h3", null, "1. Загрузите файл"),
|
|
4025
4064
|
d("p", null, "CSV / TSV / XLSX, до 50 MB")
|
|
4026
4065
|
], -1)),
|
|
4027
|
-
x(r(
|
|
4066
|
+
x(r(Yt), {
|
|
4028
4067
|
"model-value": f.value,
|
|
4029
4068
|
accept: ".csv,.tsv,.xlsx",
|
|
4030
4069
|
"max-size": 50 * 1024 * 1024,
|
|
@@ -4035,7 +4074,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4035
4074
|
}, null, 8, ["model-value"])
|
|
4036
4075
|
]),
|
|
4037
4076
|
_: 1
|
|
4038
|
-
})) : i.value === 1 ? (s(), w(r(
|
|
4077
|
+
})) : i.value === 1 ? (s(), w(r(D), {
|
|
4039
4078
|
key: 1,
|
|
4040
4079
|
padding: "md",
|
|
4041
4080
|
class: "admin-import-wizard__card"
|
|
@@ -4046,26 +4085,26 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4046
4085
|
d("p", null, "Выберите поле ресурса для каждой колонки файла")
|
|
4047
4086
|
], -1)),
|
|
4048
4087
|
e.headers.length === 0 ? (s(), c("div", vi, " Нет данных — host ещё не отдал headers. Загрузите файл сначала. ")) : (s(), c("div", pi, [
|
|
4049
|
-
(s(!0), c(T, null,
|
|
4050
|
-
key:
|
|
4088
|
+
(s(!0), c(T, null, B(e.headers, (z) => (s(), c("div", {
|
|
4089
|
+
key: z.key,
|
|
4051
4090
|
class: "admin-import-wizard__map-row"
|
|
4052
4091
|
}, [
|
|
4053
4092
|
d("div", gi, [
|
|
4054
|
-
d("strong", null, h(
|
|
4055
|
-
|
|
4093
|
+
d("strong", null, h(z.label), 1),
|
|
4094
|
+
z.sample ? (s(), c("span", hi, " «" + h(z.sample) + "» ", 1)) : F("", !0)
|
|
4056
4095
|
]),
|
|
4057
4096
|
$[4] || ($[4] = d("span", { class: "admin-import-wizard__map-arrow" }, "→", -1)),
|
|
4058
|
-
x(r(
|
|
4059
|
-
"model-value": b.value[
|
|
4097
|
+
x(r(Re), {
|
|
4098
|
+
"model-value": b.value[z.key] ?? "",
|
|
4060
4099
|
options: P.value,
|
|
4061
4100
|
placeholder: "Не импортировать",
|
|
4062
|
-
"onUpdate:modelValue": (
|
|
4101
|
+
"onUpdate:modelValue": (G) => S(z.key, G)
|
|
4063
4102
|
}, null, 8, ["model-value", "options", "onUpdate:modelValue"])
|
|
4064
4103
|
]))), 128))
|
|
4065
4104
|
]))
|
|
4066
4105
|
]),
|
|
4067
4106
|
_: 1
|
|
4068
|
-
})) : i.value === 2 ? (s(), w(r(
|
|
4107
|
+
})) : i.value === 2 ? (s(), w(r(D), {
|
|
4069
4108
|
key: 2,
|
|
4070
4109
|
padding: "md",
|
|
4071
4110
|
class: "admin-import-wizard__card"
|
|
@@ -4075,7 +4114,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4075
4114
|
$[6] || ($[6] = d("h3", null, "3. Предпросмотр", -1)),
|
|
4076
4115
|
d("p", null, "Первые " + h(e.preview.length) + " строк перед импортом", 1)
|
|
4077
4116
|
]),
|
|
4078
|
-
e.preview.some((
|
|
4117
|
+
e.preview.some((z) => z.__warning) ? (s(), w(r(Z), {
|
|
4079
4118
|
key: 0,
|
|
4080
4119
|
variant: "warning",
|
|
4081
4120
|
style: { "margin-bottom": "var(--uid-space-md)" }
|
|
@@ -4085,14 +4124,14 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4085
4124
|
])]),
|
|
4086
4125
|
_: 1
|
|
4087
4126
|
})) : F("", !0),
|
|
4088
|
-
e.previewColumns.length > 0 ? (s(), w(r(
|
|
4127
|
+
e.previewColumns.length > 0 ? (s(), w(r(Ke), {
|
|
4089
4128
|
key: 1,
|
|
4090
4129
|
columns: e.previewColumns,
|
|
4091
4130
|
data: e.preview
|
|
4092
4131
|
}, null, 8, ["columns", "data"])) : (s(), c("div", yi, " Host не передал previewColumns/preview. "))
|
|
4093
4132
|
]),
|
|
4094
4133
|
_: 1
|
|
4095
|
-
})) : (s(), w(r(
|
|
4134
|
+
})) : (s(), w(r(D), {
|
|
4096
4135
|
key: 3,
|
|
4097
4136
|
padding: "md",
|
|
4098
4137
|
class: "admin-import-wizard__card"
|
|
@@ -4102,23 +4141,23 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4102
4141
|
d("h3", null, "4. Импорт")
|
|
4103
4142
|
], -1)),
|
|
4104
4143
|
e.progress ? (s(), c(T, { key: 1 }, [
|
|
4105
|
-
e.progress.total > 0 ? (s(), w(r(
|
|
4144
|
+
e.progress.total > 0 ? (s(), w(r(Qt), {
|
|
4106
4145
|
key: 0,
|
|
4107
4146
|
"model-value": e.progress.created + e.progress.updated + e.progress.errors,
|
|
4108
4147
|
max: e.progress.total
|
|
4109
4148
|
}, null, 8, ["model-value", "max"])) : F("", !0),
|
|
4110
4149
|
d("div", ki, [
|
|
4111
|
-
x(r(
|
|
4150
|
+
x(r(Ce), {
|
|
4112
4151
|
title: "Создано",
|
|
4113
4152
|
value: e.progress.created,
|
|
4114
4153
|
tone: "success"
|
|
4115
4154
|
}, null, 8, ["value"]),
|
|
4116
|
-
x(r(
|
|
4155
|
+
x(r(Ce), {
|
|
4117
4156
|
title: "Обновлено",
|
|
4118
4157
|
value: e.progress.updated,
|
|
4119
4158
|
tone: "info"
|
|
4120
4159
|
}, null, 8, ["value"]),
|
|
4121
|
-
x(r(
|
|
4160
|
+
x(r(Ce), {
|
|
4122
4161
|
title: "Ошибки",
|
|
4123
4162
|
value: e.progress.errors,
|
|
4124
4163
|
tone: "danger"
|
|
@@ -4129,10 +4168,10 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4129
4168
|
_: 1
|
|
4130
4169
|
})),
|
|
4131
4170
|
d("footer", wi, [
|
|
4132
|
-
g.value ? (s(), w(r(
|
|
4171
|
+
g.value ? (s(), w(r(V), {
|
|
4133
4172
|
key: 0,
|
|
4134
4173
|
variant: "ghost",
|
|
4135
|
-
onClick: $[0] || ($[0] = (
|
|
4174
|
+
onClick: $[0] || ($[0] = (z) => u(i.value - 1))
|
|
4136
4175
|
}, {
|
|
4137
4176
|
default: m(() => [...$[9] || ($[9] = [
|
|
4138
4177
|
C(" Назад ", -1)
|
|
@@ -4140,17 +4179,17 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4140
4179
|
_: 1
|
|
4141
4180
|
})) : F("", !0),
|
|
4142
4181
|
$[13] || ($[13] = d("span", { style: { flex: "1" } }, null, -1)),
|
|
4143
|
-
i.value === 0 ? (s(), w(r(
|
|
4182
|
+
i.value === 0 ? (s(), w(r(V), {
|
|
4144
4183
|
key: 1,
|
|
4145
4184
|
variant: "primary",
|
|
4146
4185
|
disabled: !U.value,
|
|
4147
|
-
onClick: $[1] || ($[1] = (
|
|
4186
|
+
onClick: $[1] || ($[1] = (z) => u(1))
|
|
4148
4187
|
}, {
|
|
4149
4188
|
default: m(() => [...$[10] || ($[10] = [
|
|
4150
4189
|
C(" Далее ", -1)
|
|
4151
4190
|
])]),
|
|
4152
4191
|
_: 1
|
|
4153
|
-
}, 8, ["disabled"])) : i.value === 1 ? (s(), w(r(
|
|
4192
|
+
}, 8, ["disabled"])) : i.value === 1 ? (s(), w(r(V), {
|
|
4154
4193
|
key: 2,
|
|
4155
4194
|
variant: "primary",
|
|
4156
4195
|
disabled: !U.value,
|
|
@@ -4160,7 +4199,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4160
4199
|
C(" Подтвердить mapping ", -1)
|
|
4161
4200
|
])]),
|
|
4162
4201
|
_: 1
|
|
4163
|
-
}, 8, ["disabled"])) : i.value === 2 ? (s(), w(r(
|
|
4202
|
+
}, 8, ["disabled"])) : i.value === 2 ? (s(), w(r(V), {
|
|
4164
4203
|
key: 3,
|
|
4165
4204
|
variant: "primary",
|
|
4166
4205
|
onClick: _
|
|
@@ -4237,23 +4276,23 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4237
4276
|
node: { type: "date", name: "demo_date", label: "Дата публикации", inputType: "date" },
|
|
4238
4277
|
initial: { demo_date: "2026-05-01" }
|
|
4239
4278
|
}
|
|
4240
|
-
], n = t.reduce((a, l) => (a[l.group] || (a[l.group] = []), a[l.group].push(l), a), {}), o =
|
|
4279
|
+
], n = t.reduce((a, l) => (a[l.group] || (a[l.group] = []), a[l.group].push(l), a), {}), o = Rt(
|
|
4241
4280
|
t.reduce((a, l) => Object.assign(a, l.initial), {})
|
|
4242
4281
|
);
|
|
4243
|
-
return
|
|
4282
|
+
return mt(o), (a, l) => (s(), c("section", $i, [
|
|
4244
4283
|
l[0] || (l[0] = d("header", { class: "admin-page__hd" }, [
|
|
4245
4284
|
d("div", { class: "admin-page__title-wrap" }, [
|
|
4246
4285
|
d("h1", { class: "admin-page__title" }, "Field Gallery"),
|
|
4247
4286
|
d("div", { class: "admin-page__count" }, " Каталог встроенных field-компонентов library + примеры использования ")
|
|
4248
4287
|
])
|
|
4249
4288
|
], -1)),
|
|
4250
|
-
(s(!0), c(T, null,
|
|
4289
|
+
(s(!0), c(T, null, B(r(n), (i, u) => (s(), c("section", {
|
|
4251
4290
|
key: u,
|
|
4252
4291
|
class: "admin-gallery__group"
|
|
4253
4292
|
}, [
|
|
4254
4293
|
d("h2", xi, h(u), 1),
|
|
4255
4294
|
d("div", Ci, [
|
|
4256
|
-
(s(!0), c(T, null,
|
|
4295
|
+
(s(!0), c(T, null, B(i, (f) => (s(), w(r(D), {
|
|
4257
4296
|
key: f.type + f.title,
|
|
4258
4297
|
padding: "md",
|
|
4259
4298
|
class: "admin-gallery__card"
|
|
@@ -4265,7 +4304,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4265
4304
|
]),
|
|
4266
4305
|
d("p", Ui, h(f.description), 1),
|
|
4267
4306
|
d("div", Ei, [
|
|
4268
|
-
x(
|
|
4307
|
+
x(yt, {
|
|
4269
4308
|
node: f.node
|
|
4270
4309
|
}, null, 8, ["node"])
|
|
4271
4310
|
])
|
|
@@ -4278,118 +4317,118 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4278
4317
|
}
|
|
4279
4318
|
});
|
|
4280
4319
|
export {
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4320
|
+
An as AdminApp,
|
|
4321
|
+
Sn as AdminShell,
|
|
4322
|
+
$n as AdminSidebar,
|
|
4323
|
+
vn as AdminTopBar,
|
|
4324
|
+
ee as ApiError,
|
|
4286
4325
|
zs as BadgeEntry,
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4326
|
+
jl as BarChartWidget,
|
|
4327
|
+
qe as CheckboxField,
|
|
4328
|
+
Ls as ColumnsLayout,
|
|
4329
|
+
Bl as DashboardPage,
|
|
4330
|
+
re as DateField,
|
|
4331
|
+
es as DonutChartWidget,
|
|
4293
4332
|
oo as FieldGalleryPage,
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4333
|
+
yt as FieldRenderer,
|
|
4334
|
+
on as ForbiddenError,
|
|
4335
|
+
In as ForbiddenPage,
|
|
4336
|
+
ds as GaugeWidget,
|
|
4337
|
+
is as HeatmapWidget,
|
|
4338
|
+
Mn as HomePage,
|
|
4300
4339
|
Os as IconEntry,
|
|
4301
4340
|
io as ImportWizardPage,
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4341
|
+
Ja as InfolistRenderer,
|
|
4342
|
+
lt as KeyValueEntry,
|
|
4343
|
+
ke as LayoutRenderer,
|
|
4344
|
+
vt as LocaleSwitcher,
|
|
4345
|
+
Zn as LoginForm,
|
|
4346
|
+
ca as LoginPage,
|
|
4347
|
+
vs as MarkdownWidget,
|
|
4348
|
+
Te as NetworkError,
|
|
4349
|
+
rn as NotFoundError,
|
|
4350
|
+
Vn as NotFoundPage,
|
|
4351
|
+
sn as NotificationBell,
|
|
4313
4352
|
so as NotificationsDrawer,
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4353
|
+
ze as NumberField,
|
|
4354
|
+
Sl as ProfilePage,
|
|
4355
|
+
as as RecentTableWidget,
|
|
4356
|
+
tt as ResourceFormPage,
|
|
4357
|
+
Ua as ResourceIndexPage,
|
|
4358
|
+
ll as ResourceViewPage,
|
|
4359
|
+
at as RowsLayout,
|
|
4360
|
+
he as SectionLayout,
|
|
4361
|
+
ne as SelectField,
|
|
4362
|
+
Wn as SettingsPage,
|
|
4363
|
+
Vl as StatWidget,
|
|
4364
|
+
Is as TabsLayout,
|
|
4365
|
+
xe as TextAreaField,
|
|
4366
|
+
I as TextEntry,
|
|
4367
|
+
J as TextField,
|
|
4368
|
+
ft as ThemeToggle,
|
|
4369
|
+
na as TwoFactorForm,
|
|
4370
|
+
pt as UnauthenticatedError,
|
|
4371
|
+
Va as UnknownEntry,
|
|
4372
|
+
_t as UnknownField,
|
|
4373
|
+
Hn as UnknownScreenPage,
|
|
4374
|
+
Ul as UnknownWidget,
|
|
4375
|
+
dn as UserMenu,
|
|
4376
|
+
Pe as ValidationError,
|
|
4377
|
+
El as WidgetRenderer,
|
|
4378
|
+
Ss as buildRoutesFromManifest,
|
|
4340
4379
|
Ii as clearAdminClient,
|
|
4341
4380
|
Xi as clearInfolistRegistry,
|
|
4342
4381
|
ji as clearRegistry,
|
|
4343
4382
|
eo as clearWidgetRegistry,
|
|
4344
4383
|
no as createAdminApp,
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4384
|
+
hs as createAdminClient,
|
|
4385
|
+
Fs as createAdminRouter,
|
|
4386
|
+
As as createAuthGuard,
|
|
4387
|
+
Rs as createTitleGuard,
|
|
4388
|
+
j as getAdminClient,
|
|
4389
|
+
ht as getField,
|
|
4390
|
+
nt as getInfolistEntry,
|
|
4391
|
+
et as getLayout,
|
|
4392
|
+
Al as getWidget,
|
|
4354
4393
|
Bi as hasAdminClient,
|
|
4355
4394
|
zi as hasField,
|
|
4356
4395
|
Gi as hasInfolistEntry,
|
|
4357
4396
|
Oi as hasLayout,
|
|
4358
4397
|
Qi as hasWidget,
|
|
4359
4398
|
to as isError,
|
|
4360
|
-
|
|
4399
|
+
gs as isSuccess,
|
|
4361
4400
|
qi as listFields,
|
|
4362
4401
|
Hi as listInfolistEntries,
|
|
4363
4402
|
Wi as listLayouts,
|
|
4364
4403
|
Zi as listWidgets,
|
|
4365
4404
|
ao as loadBootstrap,
|
|
4366
|
-
|
|
4367
|
-
|
|
4405
|
+
mt as provideFormState,
|
|
4406
|
+
Ya as provideRecord,
|
|
4368
4407
|
lo as readCsrfFromMeta,
|
|
4369
4408
|
Gs as readInlineBootstrap,
|
|
4370
|
-
|
|
4409
|
+
Bs as registerBuiltinComponents,
|
|
4371
4410
|
js as registerBuiltinInfolistEntries,
|
|
4372
|
-
|
|
4373
|
-
|
|
4411
|
+
ps as registerBuiltinWidgets,
|
|
4412
|
+
Ea as registerComponents,
|
|
4374
4413
|
Vi as registerField,
|
|
4375
|
-
|
|
4414
|
+
Ba as registerInfolistEntries,
|
|
4376
4415
|
Ki as registerInfolistEntry,
|
|
4377
4416
|
Di as registerLayout,
|
|
4378
4417
|
Yi as registerWidget,
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4418
|
+
Rl as registerWidgets,
|
|
4419
|
+
en as setAdminClient,
|
|
4420
|
+
Qe as toApiError,
|
|
4382
4421
|
co as tryUseFormState,
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4422
|
+
Ne as tryUseRecord,
|
|
4423
|
+
Y as useAuthStore,
|
|
4424
|
+
ce as useFormState,
|
|
4425
|
+
Xe as useLocaleStore,
|
|
4426
|
+
ie as useManifestStore,
|
|
4427
|
+
pn as useMenuStore,
|
|
4428
|
+
Je as useNotificationsStore,
|
|
4390
4429
|
Ji as useRecord,
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4430
|
+
gt as useResourceFormStore,
|
|
4431
|
+
ma as useResourceIndexStore,
|
|
4432
|
+
He as useThemeStore
|
|
4394
4433
|
};
|
|
4395
4434
|
//# sourceMappingURL=index.mjs.map
|