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