@dskripchenko/laravel-admin 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/resource/ResourceIndexPage.vue.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +820 -820
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as E, computed as p, defineComponent as P, openBlock as s, createElementBlock as c, createElementVNode as d, createBlock as b, unref as r, withCtx as f, Fragment as T, renderList as I, createTextVNode as C, toDisplayString as h, createCommentVNode as F, createVNode as x, renderSlot as X, resolveDynamicComponent as de, normalizeClass as ne, createSlots as De, h as Ct, watch as ae, onBeforeUnmount as St, resolveComponent as lt, withModifiers as st, nextTick as _e, onMounted as Ue, withKeys as At, normalizeProps as Ee, mergeProps as Fe, normalizeStyle as Le, inject as it, provide as Rt, createApp as Ut, reactive as Et } from "vue";
|
|
2
2
|
import { defineStore as le, createPinia as Ft } from "pinia";
|
|
3
|
-
import { RouterLink as Lt, useRouter as se, useRoute as
|
|
4
|
-
import { UidMenu as rt, UidMenuItem as
|
|
3
|
+
import { RouterLink as Lt, useRouter as se, useRoute as be, createWebHistory as ot, createRouter as Pt } from "vue-router";
|
|
4
|
+
import { UidMenu as rt, UidMenuItem as qe, UidMenuSeparator as Tt, UidAvatar as ut, UidSidebar as Mt, UidSidebarGroup as Nt, UidSidebarItem as Bt, UidSidebarLayout as It, UidCard as q, UidButton as V, UidAlert as Q, UidInput as ue, UidCheckbox as dt, UidSkeleton as Oe, UidErrorState as Vt, UidEmptyState as zt, UidTable as We, UidPagination as Dt, UidBadge as Ke, UidSelect as Re, UidStat as Se, UidHeatmap as qt, UidGauge as Ot, UidFormField as ke, UidTextarea as Wt, UidNumberInput as Kt, UidDatePicker as jt, UidStack as Gt, UidGrid as Ht, UidTabs as ct, UidTabPanel as mt, UidTab as Ae, UidDescriptionList as Xt, UidDescriptionItem as Jt, UidDrawer as Yt, UidStepper as Qt, UidFileUpload as Zt, UidProgress as en } from "@dskripchenko/ui";
|
|
5
5
|
import tn from "axios";
|
|
6
6
|
import { p as ft, u as ce } from "./formState-DGNcH1XQ.js";
|
|
7
7
|
import { t as ro } from "./formState-DGNcH1XQ.js";
|
|
8
|
-
let
|
|
8
|
+
let ye = null;
|
|
9
9
|
function nn(e) {
|
|
10
|
-
|
|
10
|
+
ye = e;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (
|
|
12
|
+
function K() {
|
|
13
|
+
if (ye === null)
|
|
14
14
|
throw new Error(
|
|
15
15
|
"[admin] AdminClient is not registered. Call setAdminClient(...) before using stores."
|
|
16
16
|
);
|
|
17
|
-
return
|
|
17
|
+
return ye;
|
|
18
18
|
}
|
|
19
19
|
function Mi() {
|
|
20
|
-
|
|
20
|
+
ye = null;
|
|
21
21
|
}
|
|
22
22
|
function Ni() {
|
|
23
|
-
return
|
|
23
|
+
return ye !== null;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
const e =
|
|
25
|
+
const je = le("admin-theme", () => {
|
|
26
|
+
const e = E("light"), t = E(["light", "dark"]), n = p(() => e.value === "dark");
|
|
27
27
|
function o(u) {
|
|
28
28
|
e.value = u.theme, t.value = u.availableThemes, i(u.theme);
|
|
29
29
|
}
|
|
@@ -38,7 +38,7 @@ const Ke = le("admin-theme", () => {
|
|
|
38
38
|
const m = e.value;
|
|
39
39
|
a(u);
|
|
40
40
|
try {
|
|
41
|
-
await
|
|
41
|
+
await K().post("/system/setTheme", { theme: u });
|
|
42
42
|
} catch (v) {
|
|
43
43
|
throw a(m), v;
|
|
44
44
|
}
|
|
@@ -57,7 +57,7 @@ const Ke = le("admin-theme", () => {
|
|
|
57
57
|
}), an = ["aria-label", "aria-pressed"], ln = ["data-icon"], vt = /* @__PURE__ */ P({
|
|
58
58
|
__name: "ThemeToggle",
|
|
59
59
|
setup(e) {
|
|
60
|
-
const t =
|
|
60
|
+
const t = je(), n = p(() => t.current === "dark"), o = p(() => n.value ? "sun" : "moon"), a = p(
|
|
61
61
|
() => n.value ? "Переключить на светлую тему" : "Переключить на тёмную тему"
|
|
62
62
|
);
|
|
63
63
|
async function l() {
|
|
@@ -78,7 +78,7 @@ const Ke = le("admin-theme", () => {
|
|
|
78
78
|
], 8, an));
|
|
79
79
|
}
|
|
80
80
|
}), Ge = le("admin-locale", () => {
|
|
81
|
-
const e =
|
|
81
|
+
const e = E("ru"), t = E(["ru", "en"]);
|
|
82
82
|
function n(i) {
|
|
83
83
|
e.value = i.locale, t.value = i.availableLocales, l(i.locale);
|
|
84
84
|
}
|
|
@@ -93,7 +93,7 @@ const Ke = le("admin-theme", () => {
|
|
|
93
93
|
const u = e.value;
|
|
94
94
|
o(i);
|
|
95
95
|
try {
|
|
96
|
-
await
|
|
96
|
+
await K().post("/system/setLocale", { locale: i });
|
|
97
97
|
} catch (m) {
|
|
98
98
|
throw o(u), m;
|
|
99
99
|
}
|
|
@@ -101,7 +101,7 @@ const Ke = le("admin-theme", () => {
|
|
|
101
101
|
function l(i) {
|
|
102
102
|
typeof document < "u" && document.documentElement && document.documentElement.setAttribute("lang", i);
|
|
103
103
|
try {
|
|
104
|
-
|
|
104
|
+
K().setLocale(i);
|
|
105
105
|
} catch {
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -131,16 +131,16 @@ const Ke = le("admin-theme", () => {
|
|
|
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: f(() => [
|
|
138
|
-
(s(!0), c(T, null, I(r(t).available, (l) => (s(), b(r(
|
|
138
|
+
(s(!0), c(T, null, I(r(t).available, (l) => (s(), b(r(qe), {
|
|
139
139
|
key: l,
|
|
140
140
|
onClick: (i) => n(l)
|
|
141
141
|
}, {
|
|
142
142
|
default: f(() => [
|
|
143
|
-
|
|
143
|
+
C(h(l.toUpperCase()), 1)
|
|
144
144
|
]),
|
|
145
145
|
_: 2
|
|
146
146
|
}, 1032, ["onClick"]))), 128))
|
|
@@ -149,48 +149,48 @@ const Ke = le("admin-theme", () => {
|
|
|
149
149
|
}));
|
|
150
150
|
}
|
|
151
151
|
}), He = le("admin-notifications", () => {
|
|
152
|
-
const e =
|
|
152
|
+
const e = E([]), t = E(0), n = E(!1), o = E("all"), a = E(null), l = p(() => t.value > 0);
|
|
153
153
|
function i(R) {
|
|
154
154
|
t.value = R.unread_notifications_count;
|
|
155
155
|
}
|
|
156
|
-
async function u(R = "all",
|
|
156
|
+
async function u(R = "all", A = 1) {
|
|
157
157
|
n.value = !0;
|
|
158
158
|
try {
|
|
159
|
-
const
|
|
160
|
-
e.value =
|
|
161
|
-
page:
|
|
162
|
-
per_page:
|
|
163
|
-
total:
|
|
164
|
-
last_page:
|
|
159
|
+
const g = await K().get(`/notifications/list?type=${R}&page=${A}`);
|
|
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
165
|
}, o.value = R;
|
|
166
166
|
} finally {
|
|
167
167
|
n.value = !1;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
async function m() {
|
|
171
|
-
const
|
|
171
|
+
const A = await K().get(
|
|
172
172
|
"/notifications/unread"
|
|
173
173
|
);
|
|
174
|
-
t.value =
|
|
174
|
+
t.value = A.count, o.value === "unread" && (e.value = A.data);
|
|
175
175
|
}
|
|
176
176
|
async function v(R) {
|
|
177
|
-
await
|
|
178
|
-
const _ = e.value.find((
|
|
177
|
+
await K().post("/notifications/markAsRead", { id: R });
|
|
178
|
+
const _ = e.value.find((g) => g.id === R);
|
|
179
179
|
_ && _.read_at === null && (_.read_at = (/* @__PURE__ */ new Date()).toISOString(), t.value = Math.max(0, t.value - 1));
|
|
180
180
|
}
|
|
181
181
|
async function y() {
|
|
182
|
-
await
|
|
183
|
-
const
|
|
182
|
+
await K().post("/notifications/markAllAsRead");
|
|
183
|
+
const A = (/* @__PURE__ */ new Date()).toISOString();
|
|
184
184
|
for (const _ of e.value)
|
|
185
|
-
_.read_at === null && (_.read_at =
|
|
185
|
+
_.read_at === null && (_.read_at = A);
|
|
186
186
|
t.value = 0;
|
|
187
187
|
}
|
|
188
|
-
async function
|
|
189
|
-
await
|
|
190
|
-
const _ = e.value.findIndex((
|
|
188
|
+
async function S(R) {
|
|
189
|
+
await K().post("/notifications/destroy", { id: R });
|
|
190
|
+
const _ = e.value.findIndex((g) => g.id === R);
|
|
191
191
|
if (_ !== -1) {
|
|
192
|
-
const
|
|
193
|
-
e.value.splice(_, 1),
|
|
192
|
+
const g = e.value[_].read_at === null;
|
|
193
|
+
e.value.splice(_, 1), g && (t.value = Math.max(0, t.value - 1));
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
return {
|
|
@@ -205,7 +205,7 @@ const Ke = le("admin-theme", () => {
|
|
|
205
205
|
loadUnread: m,
|
|
206
206
|
markAsRead: v,
|
|
207
207
|
markAllAsRead: y,
|
|
208
|
-
destroy:
|
|
208
|
+
destroy: S
|
|
209
209
|
};
|
|
210
210
|
}), on = ["title"], rn = /* @__PURE__ */ P({
|
|
211
211
|
__name: "NotificationBell",
|
|
@@ -228,7 +228,7 @@ const Ke = le("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, on)) : F("", !0)
|
|
232
232
|
]),
|
|
233
233
|
_: 1
|
|
234
234
|
}));
|
|
@@ -257,7 +257,7 @@ class dn extends Z {
|
|
|
257
257
|
super(404, t), this.name = "NotFoundError";
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
class
|
|
260
|
+
class Pe extends Z {
|
|
261
261
|
/** Field-keyed map of error messages. */
|
|
262
262
|
fields;
|
|
263
263
|
constructor(t) {
|
|
@@ -271,7 +271,7 @@ class Le extends Z {
|
|
|
271
271
|
return null;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
class
|
|
274
|
+
class Te extends Error {
|
|
275
275
|
constructor(t = "Network error") {
|
|
276
276
|
super(t), this.name = "NetworkError";
|
|
277
277
|
}
|
|
@@ -285,21 +285,21 @@ function Ye(e, t) {
|
|
|
285
285
|
case 404:
|
|
286
286
|
return new dn(t);
|
|
287
287
|
case 422:
|
|
288
|
-
return new
|
|
288
|
+
return new Pe(t);
|
|
289
289
|
default:
|
|
290
290
|
return new Z(e, t);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
const Y = le("admin-auth", () => {
|
|
294
|
-
const e =
|
|
294
|
+
const e = E(null), t = E([]), n = E(null), o = p(() => e.value !== null), a = p(() => n.value !== null);
|
|
295
295
|
function l(_) {
|
|
296
296
|
e.value = _.user, t.value = _.permissions;
|
|
297
297
|
}
|
|
298
298
|
function i(_) {
|
|
299
|
-
return t.value.includes("*") || t.value.includes(_) ? !0 : t.value.some((
|
|
300
|
-
if (!
|
|
301
|
-
const
|
|
302
|
-
return _.startsWith(
|
|
299
|
+
return t.value.includes("*") || t.value.includes(_) ? !0 : t.value.some((g) => {
|
|
300
|
+
if (!g.endsWith(".*")) return !1;
|
|
301
|
+
const U = g.slice(0, -1);
|
|
302
|
+
return _.startsWith(U);
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
305
|
function u(_) {
|
|
@@ -309,47 +309,47 @@ const Y = le("admin-auth", () => {
|
|
|
309
309
|
return _.every(i);
|
|
310
310
|
}
|
|
311
311
|
async function v(_) {
|
|
312
|
-
const
|
|
312
|
+
const g = K();
|
|
313
313
|
try {
|
|
314
|
-
const
|
|
314
|
+
const U = await g.post(
|
|
315
315
|
"/auth/login",
|
|
316
316
|
_
|
|
317
317
|
);
|
|
318
|
-
return
|
|
319
|
-
} catch (
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
318
|
+
return U?.user && (e.value = U.user), Array.isArray(U?.permissions) && (t.value = U.permissions), n.value = null, "authenticated";
|
|
319
|
+
} catch (U) {
|
|
320
|
+
if (U instanceof Z && U.errorKey === "two_factor_required") {
|
|
321
|
+
const L = U.payload.challenge_token;
|
|
322
322
|
return n.value = {
|
|
323
|
-
challengeToken: typeof
|
|
323
|
+
challengeToken: typeof L == "string" ? L : "",
|
|
324
324
|
remember: _.remember ?? !1
|
|
325
325
|
}, "two_factor_required";
|
|
326
326
|
}
|
|
327
|
-
throw
|
|
327
|
+
throw U;
|
|
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 U = await K().post("/auth/twoFactorChallenge", {
|
|
334
334
|
challenge_token: n.value.challengeToken,
|
|
335
335
|
code: _
|
|
336
336
|
});
|
|
337
|
-
e.value =
|
|
337
|
+
e.value = U.user, n.value = null;
|
|
338
338
|
}
|
|
339
|
-
async function
|
|
339
|
+
async function S(_) {
|
|
340
340
|
if (n.value === null)
|
|
341
341
|
throw new Error("No pending 2FA challenge");
|
|
342
|
-
const
|
|
342
|
+
const U = await K().post("/auth/twoFactorRecovery", {
|
|
343
343
|
challenge_token: n.value.challengeToken,
|
|
344
344
|
recovery_code: _
|
|
345
345
|
});
|
|
346
|
-
return e.value =
|
|
346
|
+
return e.value = U.user, n.value = null, { remaining: U.recovery_codes_remaining };
|
|
347
347
|
}
|
|
348
348
|
function R() {
|
|
349
349
|
n.value = null;
|
|
350
350
|
}
|
|
351
|
-
async function
|
|
352
|
-
const _ =
|
|
351
|
+
async function A() {
|
|
352
|
+
const _ = K();
|
|
353
353
|
try {
|
|
354
354
|
await _.post("/auth/logout");
|
|
355
355
|
} finally {
|
|
@@ -371,9 +371,9 @@ const Y = le("admin-auth", () => {
|
|
|
371
371
|
hasAllPermissions: m,
|
|
372
372
|
login: v,
|
|
373
373
|
twoFactorChallenge: y,
|
|
374
|
-
twoFactorRecovery:
|
|
374
|
+
twoFactorRecovery: S,
|
|
375
375
|
cancelChallenge: R,
|
|
376
|
-
logout:
|
|
376
|
+
logout: A
|
|
377
377
|
};
|
|
378
378
|
}), cn = {
|
|
379
379
|
type: "button",
|
|
@@ -398,7 +398,7 @@ const Y = le("admin-auth", () => {
|
|
|
398
398
|
return (l, i) => (s(), b(r(rt), null, {
|
|
399
399
|
trigger: f(() => [
|
|
400
400
|
d("button", cn, [
|
|
401
|
-
|
|
401
|
+
x(r(ut), {
|
|
402
402
|
src: r(t).user?.avatar ?? void 0,
|
|
403
403
|
name: r(t).user?.name ?? "?",
|
|
404
404
|
alt: r(t).user?.name ?? "User",
|
|
@@ -407,19 +407,19 @@ const Y = le("admin-auth", () => {
|
|
|
407
407
|
])
|
|
408
408
|
]),
|
|
409
409
|
default: f(() => [
|
|
410
|
-
|
|
410
|
+
x(r(qe), { onClick: a }, {
|
|
411
411
|
default: f(() => [...i[0] || (i[0] = [
|
|
412
|
-
|
|
412
|
+
C("Профиль", -1)
|
|
413
413
|
])]),
|
|
414
414
|
_: 1
|
|
415
415
|
}),
|
|
416
|
-
|
|
417
|
-
|
|
416
|
+
x(r(Tt)),
|
|
417
|
+
x(r(qe), {
|
|
418
418
|
variant: "danger",
|
|
419
419
|
onClick: o
|
|
420
420
|
}, {
|
|
421
421
|
default: f(() => [...i[1] || (i[1] = [
|
|
422
|
-
|
|
422
|
+
C("Выйти", -1)
|
|
423
423
|
])]),
|
|
424
424
|
_: 1
|
|
425
425
|
})
|
|
@@ -451,17 +451,17 @@ const Y = le("admin-auth", () => {
|
|
|
451
451
|
class: "admin-topbar__icon",
|
|
452
452
|
"data-icon": "panel-left"
|
|
453
453
|
}, null, -1)
|
|
454
|
-
])])) :
|
|
454
|
+
])])) : F("", !0),
|
|
455
455
|
d("div", vn, [
|
|
456
456
|
X(l.$slots, "breadcrumbs", {}, () => [
|
|
457
457
|
(s(!0), c(T, null, I(e.breadcrumbs, (u, m) => (s(), c(T, { key: m }, [
|
|
458
|
-
m > 0 ? (s(), c("span", pn, "›")) :
|
|
458
|
+
m > 0 ? (s(), c("span", pn, "›")) : F("", !0),
|
|
459
459
|
(s(), b(de(u.to ? "a" : "span"), {
|
|
460
460
|
href: typeof u.to == "string" ? u.to : void 0,
|
|
461
461
|
class: ne(m === a.value ? "cur" : "")
|
|
462
462
|
}, {
|
|
463
463
|
default: f(() => [
|
|
464
|
-
|
|
464
|
+
C(h(u.label), 1)
|
|
465
465
|
]),
|
|
466
466
|
_: 2
|
|
467
467
|
}, 1032, ["href", "class"]))
|
|
@@ -484,41 +484,41 @@ const Y = le("admin-auth", () => {
|
|
|
484
484
|
], -1))
|
|
485
485
|
]),
|
|
486
486
|
X(l.$slots, "actions"),
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
487
|
+
x(rn),
|
|
488
|
+
x(vt),
|
|
489
|
+
x(pt),
|
|
490
|
+
x(mn)
|
|
491
491
|
]));
|
|
492
492
|
}
|
|
493
493
|
}), ht = le("admin-menu", () => {
|
|
494
|
-
const e =
|
|
495
|
-
const v = Y(), y = (
|
|
496
|
-
if (Array.isArray(
|
|
494
|
+
const e = E([]), t = E(!1), n = E(null), o = E(!1), a = p(() => {
|
|
495
|
+
const v = Y(), y = (S) => {
|
|
496
|
+
if (Array.isArray(S.permissions) && S.permissions.length > 0 && !v.hasAnyPermission(S.permissions))
|
|
497
497
|
return null;
|
|
498
|
-
const R = (
|
|
499
|
-
return { ...
|
|
498
|
+
const R = (S.children ?? []).map(y).filter((A) => A !== null);
|
|
499
|
+
return { ...S, children: R };
|
|
500
500
|
};
|
|
501
|
-
return e.value.map(y).filter((
|
|
501
|
+
return e.value.map(y).filter((S) => S !== null);
|
|
502
502
|
}), l = p(() => {
|
|
503
503
|
const v = /* @__PURE__ */ new Map();
|
|
504
|
-
for (const
|
|
505
|
-
const R =
|
|
506
|
-
v.has(R) || v.set(R, []), v.get(R).push(
|
|
504
|
+
for (const S of a.value) {
|
|
505
|
+
const R = S.group ?? null;
|
|
506
|
+
v.has(R) || v.set(R, []), v.get(R).push(S);
|
|
507
507
|
}
|
|
508
508
|
const y = [];
|
|
509
|
-
for (const [
|
|
510
|
-
R.sort((
|
|
511
|
-
const
|
|
512
|
-
return
|
|
513
|
-
}), y.push({ group:
|
|
509
|
+
for (const [S, R] of v)
|
|
510
|
+
R.sort((A, _) => {
|
|
511
|
+
const g = (A.order ?? 0) - (_.order ?? 0);
|
|
512
|
+
return g !== 0 ? g : A.label.localeCompare(_.label);
|
|
513
|
+
}), y.push({ group: S, items: R });
|
|
514
514
|
return y;
|
|
515
515
|
});
|
|
516
516
|
async function i(v = !1) {
|
|
517
517
|
if (o.value && !v) return e.value;
|
|
518
518
|
t.value = !0, n.value = null;
|
|
519
519
|
try {
|
|
520
|
-
const
|
|
521
|
-
return e.value = Array.isArray(
|
|
520
|
+
const S = await K().get("/system/menu");
|
|
521
|
+
return e.value = Array.isArray(S.items) ? S.items : [], o.value = !0, e.value;
|
|
522
522
|
} catch (y) {
|
|
523
523
|
throw n.value = y instanceof Error ? y : new Error(String(y)), y;
|
|
524
524
|
} finally {
|
|
@@ -562,7 +562,7 @@ const Y = le("admin-auth", () => {
|
|
|
562
562
|
docsUrl: { default: null }
|
|
563
563
|
},
|
|
564
564
|
setup(e) {
|
|
565
|
-
const t = ht(), n =
|
|
565
|
+
const t = ht(), n = be(), o = p(() => t.groupedItems);
|
|
566
566
|
function a(u) {
|
|
567
567
|
return !!(u.routeName && n.name === u.routeName || u.url && n.path === u.url);
|
|
568
568
|
}
|
|
@@ -574,16 +574,16 @@ const Y = le("admin-auth", () => {
|
|
|
574
574
|
if (u.url) return u.url;
|
|
575
575
|
if (u.routeName) return { name: u.routeName };
|
|
576
576
|
}
|
|
577
|
-
return (u, m) => (s(), b(r(Mt), { collapsed: e.collapsed },
|
|
577
|
+
return (u, m) => (s(), b(r(Mt), { collapsed: e.collapsed }, De({
|
|
578
578
|
header: f(() => [
|
|
579
579
|
d("div", hn, [
|
|
580
|
-
d("div", _n,
|
|
581
|
-
e.collapsed ?
|
|
580
|
+
d("div", _n, h(e.brandMark), 1),
|
|
581
|
+
e.collapsed ? F("", !0) : (s(), c("div", yn, h(e.brandName), 1))
|
|
582
582
|
]),
|
|
583
583
|
e.tenant && !e.collapsed ? (s(), c("div", bn, [
|
|
584
|
-
d("span", null,
|
|
585
|
-
d("b", null,
|
|
586
|
-
])) :
|
|
584
|
+
d("span", null, h(e.tenant.label), 1),
|
|
585
|
+
d("b", null, h(e.tenant.name), 1)
|
|
586
|
+
])) : F("", !0)
|
|
587
587
|
]),
|
|
588
588
|
nav: f(() => [
|
|
589
589
|
(s(!0), c(T, null, I(o.value, (v, y) => (s(), b(r(Nt), {
|
|
@@ -591,21 +591,21 @@ const Y = le("admin-auth", () => {
|
|
|
591
591
|
title: v.group ?? void 0
|
|
592
592
|
}, {
|
|
593
593
|
default: f(() => [
|
|
594
|
-
(s(!0), c(T, null, I(v.items, (
|
|
595
|
-
key:
|
|
596
|
-
to: i(
|
|
597
|
-
active: a(
|
|
598
|
-
badge:
|
|
599
|
-
},
|
|
594
|
+
(s(!0), c(T, null, I(v.items, (S) => (s(), b(r(Bt), {
|
|
595
|
+
key: S.key,
|
|
596
|
+
to: i(S),
|
|
597
|
+
active: a(S),
|
|
598
|
+
badge: S.badge ?? void 0
|
|
599
|
+
}, De({
|
|
600
600
|
default: f(() => [
|
|
601
|
-
|
|
601
|
+
C(" " + h(S.label), 1)
|
|
602
602
|
]),
|
|
603
603
|
_: 2
|
|
604
604
|
}, [
|
|
605
|
-
|
|
605
|
+
S.icon ? {
|
|
606
606
|
name: "icon",
|
|
607
607
|
fn: f(() => [
|
|
608
|
-
(s(), b(de(l(
|
|
608
|
+
(s(), b(de(l(S.icon))))
|
|
609
609
|
]),
|
|
610
610
|
key: "0"
|
|
611
611
|
} : void 0
|
|
@@ -620,12 +620,12 @@ const Y = le("admin-auth", () => {
|
|
|
620
620
|
name: "footer",
|
|
621
621
|
fn: f(() => [
|
|
622
622
|
d("div", kn, [
|
|
623
|
-
e.version ? (s(), c("span", wn,
|
|
623
|
+
e.version ? (s(), c("span", wn, h(e.version), 1)) : F("", !0),
|
|
624
624
|
e.docsUrl ? (s(), c("a", {
|
|
625
625
|
key: 1,
|
|
626
626
|
href: e.docsUrl,
|
|
627
627
|
class: "admin-sidebar-foot__text admin-sidebar-foot__link"
|
|
628
|
-
}, " Docs ", 8, $n)) :
|
|
628
|
+
}, " Docs ", 8, $n)) : F("", !0)
|
|
629
629
|
])
|
|
630
630
|
]),
|
|
631
631
|
key: "0"
|
|
@@ -662,28 +662,28 @@ const Y = le("admin-auth", () => {
|
|
|
662
662
|
}), (i, u) => (s(), c("div", Cn, [
|
|
663
663
|
e.impersonation ? (s(), c("div", Sn, [
|
|
664
664
|
d("span", null, [
|
|
665
|
-
u[1] || (u[1] =
|
|
666
|
-
d("b", null,
|
|
667
|
-
u[2] || (u[2] =
|
|
665
|
+
u[1] || (u[1] = C(" Вы вошли как ", -1)),
|
|
666
|
+
d("b", null, h(e.impersonation.asName), 1),
|
|
667
|
+
u[2] || (u[2] = C(" · режим имперсонации ", -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
|
-
])) :
|
|
675
|
-
|
|
674
|
+
])) : F("", !0),
|
|
675
|
+
x(r(It), {
|
|
676
676
|
"model-value": e.collapsed,
|
|
677
677
|
"onUpdate:modelValue": a
|
|
678
678
|
}, {
|
|
679
679
|
sidebar: f(() => [
|
|
680
680
|
X(i.$slots, "sidebar", {}, () => [
|
|
681
|
-
|
|
681
|
+
x(xn, { collapsed: e.collapsed }, null, 8, ["collapsed"])
|
|
682
682
|
])
|
|
683
683
|
]),
|
|
684
684
|
header: f(() => [
|
|
685
685
|
X(i.$slots, "topbar", {}, () => [
|
|
686
|
-
|
|
686
|
+
x(gn, {
|
|
687
687
|
onToggleSidebar: u[0] || (u[0] = (m) => a(!e.collapsed))
|
|
688
688
|
})
|
|
689
689
|
])
|
|
@@ -698,42 +698,42 @@ const Y = le("admin-auth", () => {
|
|
|
698
698
|
}), Rn = /* @__PURE__ */ P({
|
|
699
699
|
__name: "AdminApp",
|
|
700
700
|
setup(e) {
|
|
701
|
-
const t =
|
|
701
|
+
const t = be(), n = p(() => !(t.meta?.fullscreen === !0 || t.meta?.kind === "auth" || t.name === "admin.notFound"));
|
|
702
702
|
return (o, a) => {
|
|
703
703
|
const l = lt("router-view");
|
|
704
704
|
return n.value ? (s(), b(An, { key: 0 }, {
|
|
705
705
|
default: f(() => [
|
|
706
|
-
|
|
706
|
+
x(l)
|
|
707
707
|
]),
|
|
708
708
|
_: 1
|
|
709
709
|
})) : (s(), b(l, { key: 1 }));
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
712
|
}), ie = le("admin-manifest", () => {
|
|
713
|
-
const e =
|
|
713
|
+
const e = E(null), t = E(!1), n = E(null), o = p(() => e.value !== null), a = p(() => e.value?.version ?? null), l = p(() => e.value?.resources ?? []), i = p(() => e.value?.screens ?? []), u = p(() => e.value?.settings ?? []), m = p(() => e.value?.plugins ?? []);
|
|
714
714
|
function v(_) {
|
|
715
|
-
return l.value.find((
|
|
715
|
+
return l.value.find((g) => g.slug === _) ?? null;
|
|
716
716
|
}
|
|
717
717
|
function y(_) {
|
|
718
|
-
return i.value.find((
|
|
718
|
+
return i.value.find((g) => g.slug === _) ?? null;
|
|
719
719
|
}
|
|
720
|
-
function
|
|
721
|
-
return u.value.find((
|
|
720
|
+
function S(_) {
|
|
721
|
+
return u.value.find((g) => g.slug === _) ?? null;
|
|
722
722
|
}
|
|
723
723
|
async function R(_ = !1) {
|
|
724
724
|
if (e.value !== null && !_)
|
|
725
725
|
return e.value;
|
|
726
726
|
t.value = !0, n.value = null;
|
|
727
727
|
try {
|
|
728
|
-
const
|
|
729
|
-
return e.value =
|
|
730
|
-
} catch (
|
|
731
|
-
throw n.value =
|
|
728
|
+
const U = await K().get("/system/manifest");
|
|
729
|
+
return e.value = U, U;
|
|
730
|
+
} catch (g) {
|
|
731
|
+
throw n.value = g instanceof Error ? g : new Error(String(g)), g;
|
|
732
732
|
} finally {
|
|
733
733
|
t.value = !1;
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function A() {
|
|
737
737
|
e.value = null, n.value = null, t.value = !1;
|
|
738
738
|
}
|
|
739
739
|
return {
|
|
@@ -751,24 +751,24 @@ const Y = le("admin-auth", () => {
|
|
|
751
751
|
// actions
|
|
752
752
|
getResource: v,
|
|
753
753
|
getScreen: y,
|
|
754
|
-
getSettings:
|
|
754
|
+
getSettings: S,
|
|
755
755
|
load: R,
|
|
756
|
-
reset:
|
|
756
|
+
reset: A
|
|
757
757
|
};
|
|
758
|
-
}),
|
|
758
|
+
}), Un = { class: "admin-home" }, En = { class: "admin-home__title" }, Fn = {
|
|
759
759
|
key: 0,
|
|
760
760
|
class: "admin-home__resources"
|
|
761
761
|
}, Ln = { class: "admin-home__grid" }, Pn = ["onClick"], Tn = { class: "admin-home__card-label" }, Mn = { class: "admin-home__card-slug" }, Nn = /* @__PURE__ */ P({
|
|
762
762
|
__name: "HomePage",
|
|
763
763
|
setup(e) {
|
|
764
764
|
const t = ie(), n = Y(), o = se(), a = p(() => n.user?.name ?? ""), l = p(() => t.manifest?.resources ?? []);
|
|
765
|
-
return (i, u) => (s(), c("div",
|
|
766
|
-
|
|
765
|
+
return (i, u) => (s(), c("div", Un, [
|
|
766
|
+
x(r(q), {
|
|
767
767
|
padding: "lg",
|
|
768
768
|
class: "admin-home__hero"
|
|
769
769
|
}, {
|
|
770
770
|
default: f(() => [
|
|
771
|
-
d("h1",
|
|
771
|
+
d("h1", En, "Добро пожаловать" + h(a.value ? ", " + a.value : ""), 1),
|
|
772
772
|
u[0] || (u[0] = d("p", { class: "admin-home__lead" }, " Админ-панель готова. Воспользуйтесь сайдбаром или переходите к ресурсам ниже. ", -1))
|
|
773
773
|
]),
|
|
774
774
|
_: 1
|
|
@@ -784,12 +784,12 @@ const Y = le("admin-auth", () => {
|
|
|
784
784
|
class: "admin-home__card",
|
|
785
785
|
onClick: (v) => r(o).push({ name: `admin.resource.${m.slug}.index` })
|
|
786
786
|
}, [
|
|
787
|
-
d("span", Tn,
|
|
788
|
-
d("span", Mn,
|
|
787
|
+
d("span", Tn, h(m.label), 1),
|
|
788
|
+
d("span", Mn, h(m.slug), 1)
|
|
789
789
|
], 8, Pn)
|
|
790
790
|
]))), 128))
|
|
791
791
|
])
|
|
792
|
-
])) :
|
|
792
|
+
])) : F("", !0)
|
|
793
793
|
]));
|
|
794
794
|
}
|
|
795
795
|
}), Bn = { class: "admin-status-page" }, In = /* @__PURE__ */ P({
|
|
@@ -797,19 +797,19 @@ const Y = le("admin-auth", () => {
|
|
|
797
797
|
setup(e) {
|
|
798
798
|
const t = se();
|
|
799
799
|
return (n, o) => (s(), c("div", Bn, [
|
|
800
|
-
|
|
800
|
+
x(r(q), {
|
|
801
801
|
padding: "lg",
|
|
802
802
|
class: "admin-status-page__card"
|
|
803
803
|
}, {
|
|
804
804
|
default: f(() => [
|
|
805
805
|
o[2] || (o[2] = d("h1", { class: "admin-status-page__code" }, "403", -1)),
|
|
806
806
|
o[3] || (o[3] = d("p", { class: "admin-status-page__message" }, "Доступ запрещён.", -1)),
|
|
807
|
-
|
|
807
|
+
x(r(V), {
|
|
808
808
|
variant: "ghost",
|
|
809
809
|
onClick: o[0] || (o[0] = (a) => r(t).replace({ name: "admin.home" }))
|
|
810
810
|
}, {
|
|
811
811
|
default: f(() => [...o[1] || (o[1] = [
|
|
812
|
-
|
|
812
|
+
C(" На главную ", -1)
|
|
813
813
|
])]),
|
|
814
814
|
_: 1
|
|
815
815
|
})
|
|
@@ -823,19 +823,19 @@ const Y = le("admin-auth", () => {
|
|
|
823
823
|
setup(e) {
|
|
824
824
|
const t = se();
|
|
825
825
|
return (n, o) => (s(), c("div", Vn, [
|
|
826
|
-
|
|
826
|
+
x(r(q), {
|
|
827
827
|
padding: "lg",
|
|
828
828
|
class: "admin-status-page__card"
|
|
829
829
|
}, {
|
|
830
830
|
default: f(() => [
|
|
831
831
|
o[2] || (o[2] = d("h1", { class: "admin-status-page__code" }, "404", -1)),
|
|
832
832
|
o[3] || (o[3] = d("p", { class: "admin-status-page__message" }, "Страница не найдена.", -1)),
|
|
833
|
-
|
|
833
|
+
x(r(V), {
|
|
834
834
|
variant: "ghost",
|
|
835
835
|
onClick: o[0] || (o[0] = (a) => r(t).replace({ name: "admin.home" }))
|
|
836
836
|
}, {
|
|
837
837
|
default: f(() => [...o[1] || (o[1] = [
|
|
838
|
-
|
|
838
|
+
C(" На главную ", -1)
|
|
839
839
|
])]),
|
|
840
840
|
_: 1
|
|
841
841
|
})
|
|
@@ -844,41 +844,41 @@ const Y = le("admin-auth", () => {
|
|
|
844
844
|
})
|
|
845
845
|
]));
|
|
846
846
|
}
|
|
847
|
-
}),
|
|
847
|
+
}), Dn = { class: "admin-settings-page" }, qn = { class: "admin-settings-page__title" }, On = {
|
|
848
848
|
key: 0,
|
|
849
849
|
class: "admin-settings-page__hint"
|
|
850
850
|
}, Wn = {
|
|
851
851
|
key: 1,
|
|
852
852
|
class: "admin-settings-page__debug"
|
|
853
|
-
},
|
|
853
|
+
}, Kn = /* @__PURE__ */ P({
|
|
854
854
|
__name: "SettingsPage",
|
|
855
855
|
setup(e) {
|
|
856
|
-
const t =
|
|
857
|
-
return (l, i) => (s(), c("div",
|
|
858
|
-
|
|
856
|
+
const t = be(), n = ie(), o = p(() => String(t.params.slug ?? "")), a = p(() => n.manifest?.settings?.find((l) => l.slug === o.value) ?? null);
|
|
857
|
+
return (l, i) => (s(), c("div", Dn, [
|
|
858
|
+
x(r(q), { padding: "lg" }, {
|
|
859
859
|
default: f(() => [
|
|
860
|
-
d("h1",
|
|
861
|
-
a.value ? (s(), c("pre", Wn,
|
|
860
|
+
d("h1", qn, h(a.value?.label ?? o.value), 1),
|
|
861
|
+
a.value ? (s(), c("pre", Wn, h(JSON.stringify(a.value.fields, null, 2)), 1)) : (s(), c("p", On, " Settings «" + h(o.value) + "» не найдено в manifest'е. ", 1))
|
|
862
862
|
]),
|
|
863
863
|
_: 1
|
|
864
864
|
})
|
|
865
865
|
]));
|
|
866
866
|
}
|
|
867
|
-
}),
|
|
867
|
+
}), jn = { class: "admin-status-page" }, Gn = { class: "admin-status-page__title" }, Hn = { class: "admin-status-page__hint" }, Xn = /* @__PURE__ */ P({
|
|
868
868
|
__name: "UnknownScreenPage",
|
|
869
869
|
setup(e) {
|
|
870
|
-
const t =
|
|
871
|
-
return (a, l) => (s(), c("div",
|
|
872
|
-
|
|
870
|
+
const t = be(), n = p(() => String(t.params.slug ?? "")), o = p(() => String(t.meta?.title ?? n.value));
|
|
871
|
+
return (a, l) => (s(), c("div", jn, [
|
|
872
|
+
x(r(q), {
|
|
873
873
|
padding: "lg",
|
|
874
874
|
class: "admin-status-page__card"
|
|
875
875
|
}, {
|
|
876
876
|
default: f(() => [
|
|
877
|
-
d("h1", Gn,
|
|
877
|
+
d("h1", Gn, h(o.value), 1),
|
|
878
878
|
d("p", Hn, [
|
|
879
|
-
|
|
880
|
-
l[0] || (l[0] = d("code", null, "createAdminApp(" +
|
|
881
|
-
l[1] || (l[1] =
|
|
879
|
+
C(" Это заглушка для screen «" + h(n.value) + "». Передайте свой компонент через ", 1),
|
|
880
|
+
l[0] || (l[0] = d("code", null, "createAdminApp(" + h("{") + " pages: " + h("{") + " screen: MyScreen " + h("}") + " " + h("}") + ")", -1)),
|
|
881
|
+
l[1] || (l[1] = C(". ", -1))
|
|
882
882
|
])
|
|
883
883
|
]),
|
|
884
884
|
_: 1
|
|
@@ -897,25 +897,25 @@ const Y = le("admin-auth", () => {
|
|
|
897
897
|
},
|
|
898
898
|
emits: ["success"],
|
|
899
899
|
setup(e, { emit: t }) {
|
|
900
|
-
const n = t, o = Y(), a =
|
|
900
|
+
const n = t, o = Y(), a = E(""), l = E(""), i = E(!1), u = E(!1), m = E(null), v = E({}), y = p(() => v.value.email?.[0]), S = p(() => v.value.password?.[0]);
|
|
901
901
|
async function R() {
|
|
902
902
|
if (!u.value) {
|
|
903
903
|
u.value = !0, m.value = null, v.value = {};
|
|
904
904
|
try {
|
|
905
|
-
const
|
|
905
|
+
const A = await o.login({
|
|
906
906
|
email: a.value,
|
|
907
907
|
password: l.value,
|
|
908
908
|
remember: i.value
|
|
909
909
|
});
|
|
910
|
-
n("success",
|
|
911
|
-
} catch (
|
|
912
|
-
|
|
910
|
+
n("success", A);
|
|
911
|
+
} catch (A) {
|
|
912
|
+
A instanceof Pe ? (v.value = A.fields, m.value = A.firstFieldMessage()) : A instanceof Te ? m.value = "Нет соединения с сервером" : A instanceof Z ? m.value = A.message || "Не удалось войти" : m.value = A.message;
|
|
913
913
|
} finally {
|
|
914
914
|
u.value = !1;
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
|
-
return (
|
|
918
|
+
return (A, _) => (s(), c("form", {
|
|
919
919
|
class: "admin-auth-card__bd",
|
|
920
920
|
novalidate: "",
|
|
921
921
|
onSubmit: st(R, ["prevent"])
|
|
@@ -927,13 +927,13 @@ const Y = le("admin-auth", () => {
|
|
|
927
927
|
role: "alert"
|
|
928
928
|
}, {
|
|
929
929
|
default: f(() => [
|
|
930
|
-
|
|
930
|
+
C(h(m.value), 1)
|
|
931
931
|
]),
|
|
932
932
|
_: 1
|
|
933
|
-
})) :
|
|
934
|
-
|
|
933
|
+
})) : F("", !0),
|
|
934
|
+
x(r(ue), {
|
|
935
935
|
modelValue: a.value,
|
|
936
|
-
"onUpdate:modelValue": _[0] || (_[0] = (
|
|
936
|
+
"onUpdate:modelValue": _[0] || (_[0] = (g) => a.value = g),
|
|
937
937
|
type: "email",
|
|
938
938
|
label: "Email",
|
|
939
939
|
placeholder: "you@company.com",
|
|
@@ -943,25 +943,25 @@ const Y = le("admin-auth", () => {
|
|
|
943
943
|
error: y.value,
|
|
944
944
|
name: "email"
|
|
945
945
|
}, null, 8, ["modelValue", "disabled", "error"]),
|
|
946
|
-
|
|
946
|
+
x(r(ue), {
|
|
947
947
|
modelValue: l.value,
|
|
948
|
-
"onUpdate:modelValue": _[1] || (_[1] = (
|
|
948
|
+
"onUpdate:modelValue": _[1] || (_[1] = (g) => l.value = g),
|
|
949
949
|
type: "password",
|
|
950
950
|
label: "Пароль",
|
|
951
951
|
autocomplete: "current-password",
|
|
952
952
|
required: !0,
|
|
953
953
|
disabled: u.value,
|
|
954
|
-
error:
|
|
954
|
+
error: S.value,
|
|
955
955
|
name: "password"
|
|
956
956
|
}, null, 8, ["modelValue", "disabled", "error"]),
|
|
957
957
|
d("div", Jn, [
|
|
958
|
-
|
|
958
|
+
x(r(dt), {
|
|
959
959
|
modelValue: i.value,
|
|
960
|
-
"onUpdate:modelValue": _[2] || (_[2] = (
|
|
960
|
+
"onUpdate:modelValue": _[2] || (_[2] = (g) => i.value = g),
|
|
961
961
|
disabled: u.value
|
|
962
962
|
}, {
|
|
963
963
|
default: f(() => [..._[3] || (_[3] = [
|
|
964
|
-
|
|
964
|
+
C(" Запомнить меня ", -1)
|
|
965
965
|
])]),
|
|
966
966
|
_: 1
|
|
967
967
|
}, 8, ["modelValue", "disabled"]),
|
|
@@ -969,9 +969,9 @@ const Y = le("admin-auth", () => {
|
|
|
969
969
|
key: 0,
|
|
970
970
|
href: e.forgotUrl,
|
|
971
971
|
class: "admin-auth-card__link"
|
|
972
|
-
}, " Забыли пароль? ", 8, Yn)) :
|
|
972
|
+
}, " Забыли пароль? ", 8, Yn)) : F("", !0)
|
|
973
973
|
]),
|
|
974
|
-
|
|
974
|
+
x(r(V), {
|
|
975
975
|
type: "submit",
|
|
976
976
|
variant: "primary",
|
|
977
977
|
size: "lg",
|
|
@@ -979,73 +979,73 @@ const Y = le("admin-auth", () => {
|
|
|
979
979
|
disabled: u.value
|
|
980
980
|
}, {
|
|
981
981
|
default: f(() => [
|
|
982
|
-
|
|
982
|
+
C(h(u.value ? "Вход…" : "Войти"), 1)
|
|
983
983
|
]),
|
|
984
984
|
_: 1
|
|
985
985
|
}, 8, ["loading", "disabled"]),
|
|
986
986
|
e.ssoLinkLabel && e.ssoUrl ? (s(), c("div", Qn, [
|
|
987
|
-
_[4] || (_[4] =
|
|
987
|
+
_[4] || (_[4] = C(" или войдите через ", -1)),
|
|
988
988
|
d("a", {
|
|
989
989
|
href: e.ssoUrl,
|
|
990
990
|
class: "admin-auth-card__link"
|
|
991
|
-
},
|
|
992
|
-
])) :
|
|
991
|
+
}, h(e.ssoLinkLabel), 9, Zn)
|
|
992
|
+
])) : F("", !0)
|
|
993
993
|
], 32));
|
|
994
994
|
}
|
|
995
995
|
}), ta = ["value", "disabled", "aria-label", "onInput", "onKeydown"], na = { class: "admin-auth-card__row" }, aa = /* @__PURE__ */ P({
|
|
996
996
|
__name: "TwoFactorForm",
|
|
997
997
|
emits: ["success", "cancel"],
|
|
998
998
|
setup(e, { emit: t }) {
|
|
999
|
-
const n = t, o = Y(), a =
|
|
1000
|
-
function
|
|
1001
|
-
z instanceof HTMLInputElement && (u.value[
|
|
999
|
+
const n = t, o = Y(), a = E("totp"), l = E(["", "", "", "", "", ""]), i = E(""), u = E([]), m = E(!1), v = E(null), y = E(null), S = p(() => l.value.join("")), R = p(() => a.value === "totp" ? S.value.length === 6 : i.value.trim().length > 0);
|
|
1000
|
+
function A($, z) {
|
|
1001
|
+
z instanceof HTMLInputElement && (u.value[$] = z);
|
|
1002
1002
|
}
|
|
1003
|
-
function _(
|
|
1003
|
+
function _($, z) {
|
|
1004
1004
|
const G = z.target, O = G.value.replace(/\D/g, "").slice(-1);
|
|
1005
|
-
l.value[
|
|
1005
|
+
l.value[$] = O, G.value = O, O && $ < l.value.length - 1 && _e(() => u.value[$ + 1]?.focus()), S.value.length === l.value.length && L();
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1008
|
-
z.key === "Backspace" && !l.value[
|
|
1007
|
+
function g($, z) {
|
|
1008
|
+
z.key === "Backspace" && !l.value[$] && $ > 0 ? _e(() => u.value[$ - 1]?.focus()) : z.key === "ArrowLeft" && $ > 0 ? (u.value[$ - 1]?.focus(), z.preventDefault()) : z.key === "ArrowRight" && $ < l.value.length - 1 && (u.value[$ + 1]?.focus(), z.preventDefault());
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1011
|
-
const G = (
|
|
1010
|
+
function U($) {
|
|
1011
|
+
const G = ($.clipboardData?.getData("text") ?? "").replace(/\D/g, "").slice(0, l.value.length);
|
|
1012
1012
|
if (G.length !== 0) {
|
|
1013
|
-
|
|
1013
|
+
$.preventDefault();
|
|
1014
1014
|
for (let O = 0; O < l.value.length; O++)
|
|
1015
1015
|
l.value[O] = G[O] ?? "";
|
|
1016
|
-
|
|
1017
|
-
u.value[Math.min(G.length, l.value.length - 1)]?.focus(), G.length === l.value.length &&
|
|
1016
|
+
_e(() => {
|
|
1017
|
+
u.value[Math.min(G.length, l.value.length - 1)]?.focus(), G.length === l.value.length && L();
|
|
1018
1018
|
});
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
|
-
async function
|
|
1021
|
+
async function L() {
|
|
1022
1022
|
if (!(m.value || !R.value)) {
|
|
1023
1023
|
m.value = !0, v.value = null;
|
|
1024
1024
|
try {
|
|
1025
1025
|
if (a.value === "totp")
|
|
1026
|
-
await o.twoFactorChallenge(
|
|
1026
|
+
await o.twoFactorChallenge(S.value);
|
|
1027
1027
|
else {
|
|
1028
|
-
const
|
|
1029
|
-
y.value =
|
|
1028
|
+
const $ = await o.twoFactorRecovery(i.value.trim());
|
|
1029
|
+
y.value = $.remaining;
|
|
1030
1030
|
}
|
|
1031
1031
|
n("success");
|
|
1032
|
-
} catch (
|
|
1033
|
-
|
|
1032
|
+
} catch ($) {
|
|
1033
|
+
$ instanceof Pe ? v.value = $.firstFieldMessage() ?? "Неверный код" : $ instanceof Te ? v.value = "Нет соединения с сервером" : $ instanceof Z ? v.value = $.message || "Не удалось проверить код" : v.value = $.message;
|
|
1034
1034
|
} finally {
|
|
1035
1035
|
m.value = !1;
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function k() {
|
|
1040
1040
|
o.cancelChallenge(), n("cancel");
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1042
|
+
function w() {
|
|
1043
1043
|
a.value = a.value === "totp" ? "recovery" : "totp", v.value = null;
|
|
1044
1044
|
}
|
|
1045
|
-
return (
|
|
1045
|
+
return ($, z) => (s(), c("form", {
|
|
1046
1046
|
class: "admin-auth-card__bd",
|
|
1047
1047
|
novalidate: "",
|
|
1048
|
-
onSubmit: st(
|
|
1048
|
+
onSubmit: st(L, ["prevent"])
|
|
1049
1049
|
}, [
|
|
1050
1050
|
v.value ? (s(), b(r(Q), {
|
|
1051
1051
|
key: 0,
|
|
@@ -1054,10 +1054,10 @@ const Y = le("admin-auth", () => {
|
|
|
1054
1054
|
role: "alert"
|
|
1055
1055
|
}, {
|
|
1056
1056
|
default: f(() => [
|
|
1057
|
-
|
|
1057
|
+
C(h(v.value), 1)
|
|
1058
1058
|
]),
|
|
1059
1059
|
_: 1
|
|
1060
|
-
})) :
|
|
1060
|
+
})) : F("", !0),
|
|
1061
1061
|
y.value !== null ? (s(), b(r(Q), {
|
|
1062
1062
|
key: 1,
|
|
1063
1063
|
variant: "info",
|
|
@@ -1065,19 +1065,19 @@ const Y = le("admin-auth", () => {
|
|
|
1065
1065
|
role: "status"
|
|
1066
1066
|
}, {
|
|
1067
1067
|
default: f(() => [
|
|
1068
|
-
|
|
1068
|
+
C(" Использован recovery-код. Осталось: " + h(y.value), 1)
|
|
1069
1069
|
]),
|
|
1070
1070
|
_: 1
|
|
1071
|
-
})) :
|
|
1071
|
+
})) : F("", !0),
|
|
1072
1072
|
a.value === "totp" ? (s(), c("div", {
|
|
1073
1073
|
key: 2,
|
|
1074
1074
|
class: "admin-code-input",
|
|
1075
|
-
onPaste:
|
|
1075
|
+
onPaste: U
|
|
1076
1076
|
}, [
|
|
1077
1077
|
(s(!0), c(T, null, I(l.value, (G, O) => (s(), c("input", {
|
|
1078
1078
|
key: O,
|
|
1079
1079
|
ref_for: !0,
|
|
1080
|
-
ref: (M) =>
|
|
1080
|
+
ref: (M) => A(O, M),
|
|
1081
1081
|
value: l.value[O],
|
|
1082
1082
|
type: "text",
|
|
1083
1083
|
inputmode: "numeric",
|
|
@@ -1086,7 +1086,7 @@ const Y = le("admin-auth", () => {
|
|
|
1086
1086
|
disabled: m.value,
|
|
1087
1087
|
"aria-label": `Цифра ${O + 1}`,
|
|
1088
1088
|
onInput: (M) => _(O, M),
|
|
1089
|
-
onKeydown: (M) =>
|
|
1089
|
+
onKeydown: (M) => g(O, M)
|
|
1090
1090
|
}, null, 40, ta))), 128))
|
|
1091
1091
|
], 32)) : (s(), b(r(ue), {
|
|
1092
1092
|
key: 3,
|
|
@@ -1098,7 +1098,7 @@ const Y = le("admin-auth", () => {
|
|
|
1098
1098
|
disabled: m.value,
|
|
1099
1099
|
name: "recovery-code"
|
|
1100
1100
|
}, null, 8, ["modelValue", "disabled"])),
|
|
1101
|
-
|
|
1101
|
+
x(r(V), {
|
|
1102
1102
|
type: "submit",
|
|
1103
1103
|
variant: "primary",
|
|
1104
1104
|
size: "lg",
|
|
@@ -1106,7 +1106,7 @@ const Y = le("admin-auth", () => {
|
|
|
1106
1106
|
disabled: m.value || !R.value
|
|
1107
1107
|
}, {
|
|
1108
1108
|
default: f(() => [
|
|
1109
|
-
|
|
1109
|
+
C(h(m.value ? "Проверка…" : "Подтвердить"), 1)
|
|
1110
1110
|
]),
|
|
1111
1111
|
_: 1
|
|
1112
1112
|
}, 8, ["loading", "disabled"]),
|
|
@@ -1114,18 +1114,18 @@ const Y = le("admin-auth", () => {
|
|
|
1114
1114
|
d("button", {
|
|
1115
1115
|
type: "button",
|
|
1116
1116
|
class: "admin-auth-card__link",
|
|
1117
|
-
onClick:
|
|
1117
|
+
onClick: w
|
|
1118
1118
|
}, [
|
|
1119
1119
|
a.value === "totp" ? (s(), c(T, { key: 0 }, [
|
|
1120
|
-
|
|
1120
|
+
C("Использовать recovery-код")
|
|
1121
1121
|
], 64)) : (s(), c(T, { key: 1 }, [
|
|
1122
|
-
|
|
1122
|
+
C("Вернуться к коду из приложения")
|
|
1123
1123
|
], 64))
|
|
1124
1124
|
]),
|
|
1125
1125
|
d("button", {
|
|
1126
1126
|
type: "button",
|
|
1127
1127
|
class: "admin-auth-card__link",
|
|
1128
|
-
onClick:
|
|
1128
|
+
onClick: k
|
|
1129
1129
|
}, " Отмена ")
|
|
1130
1130
|
])
|
|
1131
1131
|
], 32));
|
|
@@ -1150,7 +1150,7 @@ const Y = le("admin-auth", () => {
|
|
|
1150
1150
|
showCornerActions: { type: Boolean, default: !0 }
|
|
1151
1151
|
},
|
|
1152
1152
|
setup(e) {
|
|
1153
|
-
const t = e, n = Y(), o = se(), a =
|
|
1153
|
+
const t = e, n = Y(), o = se(), a = be();
|
|
1154
1154
|
async function l() {
|
|
1155
1155
|
const i = a.query[t.redirectQueryKey];
|
|
1156
1156
|
if (typeof i == "string" && i.length > 0 && i.startsWith("/")) {
|
|
@@ -1164,14 +1164,14 @@ const Y = le("admin-auth", () => {
|
|
|
1164
1164
|
(i) => {
|
|
1165
1165
|
i && l();
|
|
1166
1166
|
}
|
|
1167
|
-
),
|
|
1167
|
+
), Ue(() => {
|
|
1168
1168
|
n.isAuthenticated && l();
|
|
1169
1169
|
}), (i, u) => (s(), c("div", la, [
|
|
1170
1170
|
e.showCornerActions ? (s(), c("div", sa, [
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
])) :
|
|
1174
|
-
|
|
1171
|
+
x(vt),
|
|
1172
|
+
x(pt)
|
|
1173
|
+
])) : F("", !0),
|
|
1174
|
+
x(r(q), {
|
|
1175
1175
|
class: ne(["admin-auth-card", r(n).isChallengePending ? "admin-auth-card--wide" : ""]),
|
|
1176
1176
|
padding: "none"
|
|
1177
1177
|
}, {
|
|
@@ -1184,20 +1184,20 @@ const Y = le("admin-auth", () => {
|
|
|
1184
1184
|
key: 0,
|
|
1185
1185
|
src: e.brandLogo,
|
|
1186
1186
|
alt: e.brandName
|
|
1187
|
-
}, null, 8, oa)) : r(n).isChallengePending ? (s(), c("span", ra, "🛡")) : (s(), c("span", ua,
|
|
1187
|
+
}, null, 8, oa)) : r(n).isChallengePending ? (s(), c("span", ra, "🛡")) : (s(), c("span", ua, h(e.brandMark), 1))
|
|
1188
1188
|
], 2),
|
|
1189
1189
|
d("div", da, [
|
|
1190
1190
|
r(n).isChallengePending ? (s(), c(T, { key: 0 }, [
|
|
1191
|
-
|
|
1191
|
+
C("Двухфакторная проверка")
|
|
1192
1192
|
], 64)) : (s(), c(T, { key: 1 }, [
|
|
1193
|
-
|
|
1193
|
+
C(h(e.brandName), 1)
|
|
1194
1194
|
], 64))
|
|
1195
1195
|
]),
|
|
1196
1196
|
d("div", ca, [
|
|
1197
1197
|
r(n).isChallengePending ? (s(), c(T, { key: 0 }, [
|
|
1198
|
-
|
|
1198
|
+
C(" Введите 6-значный код из приложения-аутентификатора ")
|
|
1199
1199
|
], 64)) : (s(), c(T, { key: 1 }, [
|
|
1200
|
-
|
|
1200
|
+
C("Войдите, чтобы продолжить работу")
|
|
1201
1201
|
], 64))
|
|
1202
1202
|
])
|
|
1203
1203
|
]),
|
|
@@ -1221,71 +1221,71 @@ const Y = le("admin-auth", () => {
|
|
|
1221
1221
|
]));
|
|
1222
1222
|
}
|
|
1223
1223
|
}), Qe = { page: 1, per_page: 20, total: 0, last_page: 1 }, fa = le("admin-resource-index", () => {
|
|
1224
|
-
const e =
|
|
1225
|
-
function
|
|
1224
|
+
const e = E(null), t = E([]), n = E({ ...Qe }), o = E(!1), a = E(null), l = E(""), i = E({}), u = E(null), m = E(null), v = E(/* @__PURE__ */ new Set()), y = p(() => !o.value && a.value === null && t.value.length === 0), S = p(() => v.value.size), R = p(() => v.value.size > 0), A = p(() => a.value !== null), _ = p(() => v.value.size === 0 || t.value.length === 0 ? "none" : t.value.every((D) => v.value.has(g(D))) ? "all" : "mixed");
|
|
1225
|
+
function g(N) {
|
|
1226
1226
|
return N.id ?? N.key ?? "";
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1229
|
-
e.value !== N && (e.value = N,
|
|
1228
|
+
function U(N) {
|
|
1229
|
+
e.value !== N && (e.value = N, L());
|
|
1230
1230
|
}
|
|
1231
|
-
function
|
|
1231
|
+
function L() {
|
|
1232
1232
|
t.value = [], n.value = { ...Qe }, o.value = !1, a.value = null, l.value = "", i.value = {}, u.value = null, m.value = null, v.value = /* @__PURE__ */ new Set();
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1235
|
-
const
|
|
1234
|
+
function k(N = {}) {
|
|
1235
|
+
const D = {
|
|
1236
1236
|
page: N.page ?? n.value.page,
|
|
1237
1237
|
per_page: N.per_page ?? n.value.per_page
|
|
1238
|
-
},
|
|
1239
|
-
|
|
1238
|
+
}, $e = N.search ?? l.value;
|
|
1239
|
+
$e && (D.q = $e);
|
|
1240
1240
|
const ge = N.sort ?? u.value, Je = N.direction ?? m.value;
|
|
1241
|
-
ge && Je !== null && (
|
|
1242
|
-
const $t = N.filters ?? i.value,
|
|
1241
|
+
ge && Je !== null && (D.order = [{ column: ge, direction: Je }]);
|
|
1242
|
+
const $t = N.filters ?? i.value, Be = {};
|
|
1243
1243
|
for (const [xt, oe] of Object.entries($t))
|
|
1244
|
-
oe == null || oe === "" || (
|
|
1245
|
-
return Object.keys(
|
|
1244
|
+
oe == null || oe === "" || (Be[xt] = Array.isArray(oe) ? oe.join(",") : oe);
|
|
1245
|
+
return Object.keys(Be).length > 0 && (D.filters = Be), D;
|
|
1246
1246
|
}
|
|
1247
|
-
async function
|
|
1247
|
+
async function w(N = {}) {
|
|
1248
1248
|
if (!e.value)
|
|
1249
1249
|
throw new Error("useResourceIndexStore.load() called before setSlug()");
|
|
1250
1250
|
o.value = !0, a.value = null;
|
|
1251
1251
|
try {
|
|
1252
|
-
const
|
|
1252
|
+
const D = K(), $e = k(N), ge = await D.post(`/${e.value}/search`, $e);
|
|
1253
1253
|
t.value = ge.data, n.value = ge.meta;
|
|
1254
|
-
} catch (
|
|
1255
|
-
throw a.value =
|
|
1254
|
+
} catch (D) {
|
|
1255
|
+
throw a.value = D instanceof Error ? D : new Error(String(D)), D;
|
|
1256
1256
|
} finally {
|
|
1257
1257
|
o.value = !1;
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
|
-
async function
|
|
1261
|
-
l.value = N, n.value.page = 1, await
|
|
1260
|
+
async function $(N) {
|
|
1261
|
+
l.value = N, n.value.page = 1, await w();
|
|
1262
1262
|
}
|
|
1263
|
-
async function z(N,
|
|
1264
|
-
|
|
1263
|
+
async function z(N, D) {
|
|
1264
|
+
D == null || D === "" ? delete i.value[N] : i.value[N] = D, n.value.page = 1, await w();
|
|
1265
1265
|
}
|
|
1266
1266
|
async function G() {
|
|
1267
|
-
i.value = {}, n.value.page = 1, await
|
|
1267
|
+
i.value = {}, n.value.page = 1, await w();
|
|
1268
1268
|
}
|
|
1269
|
-
async function O(N,
|
|
1270
|
-
u.value = N, m.value =
|
|
1269
|
+
async function O(N, D = "asc") {
|
|
1270
|
+
u.value = N, m.value = D, await w();
|
|
1271
1271
|
}
|
|
1272
1272
|
async function M(N) {
|
|
1273
|
-
u.value === N ? m.value === "asc" ? m.value = "desc" : m.value === "desc" ? (u.value = null, m.value = null) : m.value = "asc" : (u.value = N, m.value = "asc"), await
|
|
1273
|
+
u.value === N ? m.value === "asc" ? m.value = "desc" : m.value === "desc" ? (u.value = null, m.value = null) : m.value = "asc" : (u.value = N, m.value = "asc"), await w();
|
|
1274
1274
|
}
|
|
1275
1275
|
async function W(N) {
|
|
1276
|
-
n.value.page = N, await
|
|
1276
|
+
n.value.page = N, await w();
|
|
1277
1277
|
}
|
|
1278
1278
|
function H(N) {
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1279
|
+
const D = new Set(v.value);
|
|
1280
|
+
D.has(N) ? D.delete(N) : D.add(N), v.value = D;
|
|
1281
1281
|
}
|
|
1282
|
-
function
|
|
1282
|
+
function j() {
|
|
1283
1283
|
if (_.value === "all") {
|
|
1284
1284
|
v.value = /* @__PURE__ */ new Set();
|
|
1285
1285
|
return;
|
|
1286
1286
|
}
|
|
1287
1287
|
const N = new Set(v.value);
|
|
1288
|
-
for (const
|
|
1288
|
+
for (const D of t.value) N.add(g(D));
|
|
1289
1289
|
v.value = N;
|
|
1290
1290
|
}
|
|
1291
1291
|
function ee() {
|
|
@@ -1308,25 +1308,25 @@ const Y = le("admin-auth", () => {
|
|
|
1308
1308
|
selection: v,
|
|
1309
1309
|
// getters
|
|
1310
1310
|
isEmpty: y,
|
|
1311
|
-
hasError:
|
|
1311
|
+
hasError: A,
|
|
1312
1312
|
hasSelection: R,
|
|
1313
|
-
selectedCount:
|
|
1313
|
+
selectedCount: S,
|
|
1314
1314
|
selectionState: _,
|
|
1315
1315
|
// actions
|
|
1316
|
-
setSlug:
|
|
1317
|
-
reset:
|
|
1318
|
-
load:
|
|
1319
|
-
setSearch:
|
|
1316
|
+
setSlug: U,
|
|
1317
|
+
reset: L,
|
|
1318
|
+
load: w,
|
|
1319
|
+
setSearch: $,
|
|
1320
1320
|
setFilter: z,
|
|
1321
1321
|
clearFilters: G,
|
|
1322
1322
|
setSort: O,
|
|
1323
1323
|
toggleSort: M,
|
|
1324
1324
|
setPage: W,
|
|
1325
1325
|
toggleRow: H,
|
|
1326
|
-
toggleAllOnPage:
|
|
1326
|
+
toggleAllOnPage: j,
|
|
1327
1327
|
clearSelection: ee,
|
|
1328
1328
|
isSelected: wt,
|
|
1329
|
-
rowId:
|
|
1329
|
+
rowId: g
|
|
1330
1330
|
};
|
|
1331
1331
|
}), va = { class: "admin-page admin-resource-index" }, pa = { class: "admin-page__hd" }, ga = { class: "admin-page__title-wrap" }, ha = { class: "admin-page__title" }, _a = {
|
|
1332
1332
|
key: 0,
|
|
@@ -1360,137 +1360,136 @@ const Y = le("admin-auth", () => {
|
|
|
1360
1360
|
setup(e, { emit: t }) {
|
|
1361
1361
|
const n = e, o = t, a = fa(), l = ie(), i = p(() => l.getResource(n.slug)), u = p(
|
|
1362
1362
|
() => n.title ?? i.value?.label ?? n.slug
|
|
1363
|
-
), m = p(() => (i.value?.columns ?? []).map((
|
|
1364
|
-
const
|
|
1363
|
+
), m = p(() => (i.value?.columns ?? []).map((k) => {
|
|
1364
|
+
const w = k;
|
|
1365
1365
|
return {
|
|
1366
|
-
key: String(
|
|
1367
|
-
label: String(
|
|
1368
|
-
sortable: !!
|
|
1369
|
-
align:
|
|
1370
|
-
width: typeof
|
|
1366
|
+
key: String(w.key ?? w.name ?? ""),
|
|
1367
|
+
label: String(w.label ?? w.name ?? ""),
|
|
1368
|
+
sortable: !!w.sortable,
|
|
1369
|
+
align: w.align ?? "left",
|
|
1370
|
+
width: typeof w.width == "string" ? w.width : void 0
|
|
1371
1371
|
};
|
|
1372
|
-
}).filter((
|
|
1373
|
-
const
|
|
1374
|
-
return
|
|
1372
|
+
}).filter((k) => k.key)), v = p(() => {
|
|
1373
|
+
const L = a.meta.total;
|
|
1374
|
+
return L === 0 ? "" : `${a.items.length} из ${L}`;
|
|
1375
1375
|
});
|
|
1376
|
-
|
|
1376
|
+
Ue(async () => {
|
|
1377
1377
|
a.setSlug(n.slug), l.manifest === null && await l.load().catch(() => {
|
|
1378
1378
|
}), await a.load().catch(() => {
|
|
1379
1379
|
});
|
|
1380
1380
|
}), ae(
|
|
1381
1381
|
() => n.slug,
|
|
1382
|
-
async (
|
|
1383
|
-
|
|
1382
|
+
async (L, k) => {
|
|
1383
|
+
L !== k && (a.setSlug(L), await a.load().catch(() => {
|
|
1384
1384
|
}));
|
|
1385
1385
|
}
|
|
1386
1386
|
);
|
|
1387
|
-
async function y(
|
|
1388
|
-
|
|
1389
|
-
await a.setSort(null, null);
|
|
1390
|
-
return;
|
|
1391
|
-
}
|
|
1392
|
-
await a.toggleSort(k);
|
|
1387
|
+
async function y(L) {
|
|
1388
|
+
await _e(), await a.setSort(L, a.sortDirection);
|
|
1393
1389
|
}
|
|
1394
|
-
function
|
|
1395
|
-
a.
|
|
1390
|
+
async function S(L) {
|
|
1391
|
+
await _e(), await a.setSort(a.sortKey, L);
|
|
1396
1392
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1393
|
+
function R(L) {
|
|
1394
|
+
a.selection = L;
|
|
1399
1395
|
}
|
|
1400
|
-
function
|
|
1401
|
-
|
|
1396
|
+
async function A(L) {
|
|
1397
|
+
await a.setPage(L);
|
|
1402
1398
|
}
|
|
1403
|
-
function _(
|
|
1404
|
-
o("
|
|
1399
|
+
function _(L) {
|
|
1400
|
+
o("row-click", L);
|
|
1405
1401
|
}
|
|
1406
|
-
|
|
1402
|
+
function g(L) {
|
|
1403
|
+
o("bulk-action", L, [...a.selection]);
|
|
1404
|
+
}
|
|
1405
|
+
async function U() {
|
|
1407
1406
|
await a.load().catch(() => {
|
|
1408
1407
|
});
|
|
1409
1408
|
}
|
|
1410
|
-
return (
|
|
1409
|
+
return (L, k) => (s(), c("section", va, [
|
|
1411
1410
|
d("header", pa, [
|
|
1412
1411
|
d("div", ga, [
|
|
1413
|
-
d("h1", ha,
|
|
1412
|
+
d("h1", ha, h(u.value), 1),
|
|
1414
1413
|
e.subtitle || v.value ? (s(), c("div", _a, [
|
|
1415
1414
|
e.subtitle ? (s(), c(T, { key: 0 }, [
|
|
1416
|
-
|
|
1417
|
-
], 64)) :
|
|
1415
|
+
C(h(e.subtitle), 1)
|
|
1416
|
+
], 64)) : F("", !0),
|
|
1418
1417
|
e.subtitle && v.value ? (s(), c(T, { key: 1 }, [
|
|
1419
|
-
|
|
1420
|
-
], 64)) :
|
|
1418
|
+
C(" · ")
|
|
1419
|
+
], 64)) : F("", !0),
|
|
1421
1420
|
v.value ? (s(), c(T, { key: 2 }, [
|
|
1422
|
-
|
|
1423
|
-
], 64)) :
|
|
1424
|
-
])) :
|
|
1421
|
+
C(h(v.value), 1)
|
|
1422
|
+
], 64)) : F("", !0)
|
|
1423
|
+
])) : F("", !0)
|
|
1425
1424
|
]),
|
|
1426
1425
|
d("div", ya, [
|
|
1427
|
-
X(
|
|
1426
|
+
X(L.$slots, "actions"),
|
|
1428
1427
|
e.createRouteName ? (s(), b(r(V), {
|
|
1429
1428
|
key: 0,
|
|
1430
1429
|
variant: "primary",
|
|
1431
|
-
onClick:
|
|
1430
|
+
onClick: k[0] || (k[0] = (w) => L.$router.push({ name: e.createRouteName }))
|
|
1432
1431
|
}, {
|
|
1433
1432
|
default: f(() => [
|
|
1434
|
-
|
|
1433
|
+
C(h(e.createLabel), 1)
|
|
1435
1434
|
]),
|
|
1436
1435
|
_: 1
|
|
1437
|
-
})) :
|
|
1436
|
+
})) : F("", !0)
|
|
1438
1437
|
])
|
|
1439
1438
|
]),
|
|
1440
1439
|
r(a).hasSelection ? (s(), c("div", ba, [
|
|
1441
1440
|
d("span", ka, [
|
|
1442
|
-
|
|
1443
|
-
d("b", null,
|
|
1441
|
+
k[7] || (k[7] = C(" Выбрано ", -1)),
|
|
1442
|
+
d("b", null, h(r(a).selectedCount), 1)
|
|
1444
1443
|
]),
|
|
1445
|
-
|
|
1446
|
-
|
|
1444
|
+
k[13] || (k[13] = d("span", { class: "admin-bulk-toolbar__divider" }, null, -1)),
|
|
1445
|
+
x(r(V), {
|
|
1447
1446
|
size: "sm",
|
|
1448
1447
|
variant: "ghost",
|
|
1449
|
-
onClick:
|
|
1448
|
+
onClick: k[1] || (k[1] = (w) => g("publish"))
|
|
1450
1449
|
}, {
|
|
1451
|
-
default: f(() => [...
|
|
1452
|
-
|
|
1450
|
+
default: f(() => [...k[8] || (k[8] = [
|
|
1451
|
+
C("Опубликовать", -1)
|
|
1453
1452
|
])]),
|
|
1454
1453
|
_: 1
|
|
1455
1454
|
}),
|
|
1456
|
-
|
|
1455
|
+
x(r(V), {
|
|
1457
1456
|
size: "sm",
|
|
1458
1457
|
variant: "ghost",
|
|
1459
|
-
onClick:
|
|
1458
|
+
onClick: k[2] || (k[2] = (w) => g("archive"))
|
|
1460
1459
|
}, {
|
|
1461
|
-
default: f(() => [...
|
|
1462
|
-
|
|
1460
|
+
default: f(() => [...k[9] || (k[9] = [
|
|
1461
|
+
C("Архивировать", -1)
|
|
1463
1462
|
])]),
|
|
1464
1463
|
_: 1
|
|
1465
1464
|
}),
|
|
1466
|
-
|
|
1465
|
+
x(r(V), {
|
|
1467
1466
|
size: "sm",
|
|
1468
1467
|
variant: "ghost",
|
|
1469
|
-
onClick:
|
|
1468
|
+
onClick: k[3] || (k[3] = (w) => g("export"))
|
|
1470
1469
|
}, {
|
|
1471
|
-
default: f(() => [...
|
|
1472
|
-
|
|
1470
|
+
default: f(() => [...k[10] || (k[10] = [
|
|
1471
|
+
C("Экспорт", -1)
|
|
1473
1472
|
])]),
|
|
1474
1473
|
_: 1
|
|
1475
1474
|
}),
|
|
1476
|
-
|
|
1475
|
+
x(r(V), {
|
|
1477
1476
|
size: "sm",
|
|
1478
1477
|
variant: "danger",
|
|
1479
|
-
onClick:
|
|
1478
|
+
onClick: k[4] || (k[4] = (w) => g("delete"))
|
|
1480
1479
|
}, {
|
|
1481
|
-
default: f(() => [...
|
|
1482
|
-
|
|
1480
|
+
default: f(() => [...k[11] || (k[11] = [
|
|
1481
|
+
C("Удалить", -1)
|
|
1483
1482
|
])]),
|
|
1484
1483
|
_: 1
|
|
1485
1484
|
}),
|
|
1486
|
-
|
|
1487
|
-
|
|
1485
|
+
k[14] || (k[14] = d("span", { class: "admin-bulk-toolbar__spacer" }, null, -1)),
|
|
1486
|
+
x(r(V), {
|
|
1488
1487
|
size: "sm",
|
|
1489
1488
|
variant: "ghost",
|
|
1490
1489
|
onClick: r(a).clearSelection
|
|
1491
1490
|
}, {
|
|
1492
|
-
default: f(() => [...
|
|
1493
|
-
|
|
1491
|
+
default: f(() => [...k[12] || (k[12] = [
|
|
1492
|
+
C(" Снять выделение ", -1)
|
|
1494
1493
|
])]),
|
|
1495
1494
|
_: 1
|
|
1496
1495
|
}, 8, ["onClick"])
|
|
@@ -1500,28 +1499,28 @@ const Y = le("admin-auth", () => {
|
|
|
1500
1499
|
type: "search",
|
|
1501
1500
|
placeholder: "Поиск…",
|
|
1502
1501
|
class: "admin-filter-bar__search",
|
|
1503
|
-
onKeydown:
|
|
1502
|
+
onKeydown: k[5] || (k[5] = At((w) => r(a).setSearch(w.target.value), ["enter"]))
|
|
1504
1503
|
}, null, 40, $a),
|
|
1505
|
-
X(
|
|
1504
|
+
X(L.$slots, "filters", {
|
|
1506
1505
|
filters: r(a).filters,
|
|
1507
1506
|
setFilter: r(a).setFilter
|
|
1508
1507
|
}),
|
|
1509
|
-
|
|
1508
|
+
k[16] || (k[16] = d("span", { class: "admin-filter-bar__spacer" }, null, -1)),
|
|
1510
1509
|
Object.keys(r(a).filters).length > 0 ? (s(), b(r(V), {
|
|
1511
1510
|
key: 0,
|
|
1512
1511
|
size: "sm",
|
|
1513
1512
|
variant: "ghost",
|
|
1514
1513
|
onClick: r(a).clearFilters
|
|
1515
1514
|
}, {
|
|
1516
|
-
default: f(() => [...
|
|
1517
|
-
|
|
1515
|
+
default: f(() => [...k[15] || (k[15] = [
|
|
1516
|
+
C(" Сброс ", -1)
|
|
1518
1517
|
])]),
|
|
1519
1518
|
_: 1
|
|
1520
|
-
}, 8, ["onClick"])) :
|
|
1519
|
+
}, 8, ["onClick"])) : F("", !0)
|
|
1521
1520
|
])),
|
|
1522
1521
|
r(a).loading ? (s(), c("div", xa, [
|
|
1523
|
-
(s(), c(T, null, I(8, (
|
|
1524
|
-
key:
|
|
1522
|
+
(s(), c(T, null, I(8, (w) => x(r(Oe), {
|
|
1523
|
+
key: w,
|
|
1525
1524
|
height: "40px"
|
|
1526
1525
|
})), 64))
|
|
1527
1526
|
])) : r(a).hasError ? (s(), b(r(Vt), {
|
|
@@ -1531,12 +1530,12 @@ const Y = le("admin-auth", () => {
|
|
|
1531
1530
|
class: "admin-resource-index__state"
|
|
1532
1531
|
}, {
|
|
1533
1532
|
actions: f(() => [
|
|
1534
|
-
|
|
1533
|
+
x(r(V), {
|
|
1535
1534
|
variant: "primary",
|
|
1536
|
-
onClick:
|
|
1535
|
+
onClick: U
|
|
1537
1536
|
}, {
|
|
1538
|
-
default: f(() => [...
|
|
1539
|
-
|
|
1537
|
+
default: f(() => [...k[17] || (k[17] = [
|
|
1538
|
+
C("Обновить", -1)
|
|
1540
1539
|
])]),
|
|
1541
1540
|
_: 1
|
|
1542
1541
|
})
|
|
@@ -1552,89 +1551,90 @@ const Y = le("admin-auth", () => {
|
|
|
1552
1551
|
e.createRouteName ? (s(), b(r(V), {
|
|
1553
1552
|
key: 0,
|
|
1554
1553
|
variant: "primary",
|
|
1555
|
-
onClick:
|
|
1554
|
+
onClick: k[6] || (k[6] = (w) => L.$router.push({ name: e.createRouteName }))
|
|
1556
1555
|
}, {
|
|
1557
1556
|
default: f(() => [
|
|
1558
|
-
|
|
1557
|
+
C(h(e.createLabel), 1)
|
|
1559
1558
|
]),
|
|
1560
1559
|
_: 1
|
|
1561
|
-
})) :
|
|
1560
|
+
})) : F("", !0)
|
|
1562
1561
|
]),
|
|
1563
1562
|
_: 1
|
|
1564
1563
|
})) : (s(), c("div", Ca, [
|
|
1565
|
-
|
|
1564
|
+
x(r(We), {
|
|
1566
1565
|
columns: m.value,
|
|
1567
1566
|
data: r(a).items,
|
|
1568
1567
|
"sort-key": r(a).sortKey,
|
|
1569
1568
|
"sort-direction": r(a).sortDirection,
|
|
1570
1569
|
selectable: "",
|
|
1571
1570
|
selection: r(a).selection,
|
|
1572
|
-
"row-key": (
|
|
1571
|
+
"row-key": (w) => r(a).rowId(w),
|
|
1573
1572
|
"onUpdate:sortKey": y,
|
|
1574
|
-
"onUpdate:
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1573
|
+
"onUpdate:sortDirection": S,
|
|
1574
|
+
"onUpdate:selection": R,
|
|
1575
|
+
onRowClick: _
|
|
1576
|
+
}, De({ _: 2 }, [
|
|
1577
|
+
I(m.value, (w) => ({
|
|
1578
|
+
name: `cell-${w.key}`,
|
|
1579
|
+
fn: f(($) => [
|
|
1580
|
+
X(L.$slots, `cell-${w.key}`, { row: $ }, () => [
|
|
1581
|
+
C(h($?.[w.key]), 1)
|
|
1582
1582
|
])
|
|
1583
1583
|
])
|
|
1584
1584
|
}))
|
|
1585
1585
|
]), 1032, ["columns", "data", "sort-key", "sort-direction", "selection", "row-key"])
|
|
1586
1586
|
])),
|
|
1587
1587
|
!r(a).loading && !r(a).hasError && !r(a).isEmpty ? (s(), c("footer", Sa, [
|
|
1588
|
-
|
|
1588
|
+
x(r(Dt), {
|
|
1589
1589
|
"model-value": r(a).meta.page,
|
|
1590
1590
|
total: r(a).meta.total,
|
|
1591
1591
|
"per-page": r(a).meta.per_page,
|
|
1592
|
-
"onUpdate:modelValue":
|
|
1592
|
+
"onUpdate:modelValue": A
|
|
1593
1593
|
}, null, 8, ["model-value", "total", "per-page"])
|
|
1594
|
-
])) :
|
|
1594
|
+
])) : F("", !0)
|
|
1595
1595
|
]));
|
|
1596
1596
|
}
|
|
1597
1597
|
}), _t = le("admin-resource-form", () => {
|
|
1598
|
-
const e =
|
|
1598
|
+
const e = E(null), t = E("create"), n = E(null), o = E({}), a = E({}), l = E({}), i = E(!1), u = E(!1), m = E(!1), v = E(null), y = p(() => t.value === "create"), S = p(() => t.value === "edit"), R = p(() => t.value === "view"), A = p(() => v.value !== null), _ = p(() => {
|
|
1599
1599
|
const M = o.value, W = a.value, H = /* @__PURE__ */ new Set([...Object.keys(M), ...Object.keys(W)]);
|
|
1600
|
-
for (const
|
|
1601
|
-
if (!Object.is(M[
|
|
1602
|
-
if (typeof M[
|
|
1603
|
-
if (JSON.stringify(M[
|
|
1600
|
+
for (const j of H)
|
|
1601
|
+
if (!Object.is(M[j], W[j]))
|
|
1602
|
+
if (typeof M[j] == "object" || typeof W[j] == "object") {
|
|
1603
|
+
if (JSON.stringify(M[j]) !== JSON.stringify(W[j])) return !0;
|
|
1604
1604
|
} else
|
|
1605
1605
|
return !0;
|
|
1606
1606
|
return !1;
|
|
1607
1607
|
});
|
|
1608
|
-
function
|
|
1608
|
+
function g(M, W) {
|
|
1609
1609
|
for (const H of Object.keys(M)) delete M[H];
|
|
1610
1610
|
Object.assign(M, W);
|
|
1611
1611
|
}
|
|
1612
|
-
function
|
|
1613
|
-
|
|
1612
|
+
function U() {
|
|
1613
|
+
g(o.value, {}), g(a.value, {}), l.value = {}, i.value = !1, u.value = !1, m.value = !1, v.value = null, n.value = null;
|
|
1614
1614
|
}
|
|
1615
|
-
function
|
|
1616
|
-
e.value = M, t.value = "create", n.value = null,
|
|
1615
|
+
function L(M, W = {}) {
|
|
1616
|
+
e.value = M, t.value = "create", n.value = null, g(o.value, W), g(a.value, W), l.value = {}, v.value = null;
|
|
1617
1617
|
}
|
|
1618
|
-
async function
|
|
1618
|
+
async function k(M, W, H = "edit") {
|
|
1619
1619
|
e.value = M, t.value = H, n.value = W, i.value = !0, v.value = null, l.value = {};
|
|
1620
1620
|
try {
|
|
1621
|
-
const ee = await
|
|
1621
|
+
const ee = await K().get(`/${M}/read`, {
|
|
1622
1622
|
params: { id: W }
|
|
1623
1623
|
});
|
|
1624
|
-
|
|
1625
|
-
} catch (
|
|
1626
|
-
throw v.value =
|
|
1624
|
+
g(o.value, ee.record), g(a.value, ee.record);
|
|
1625
|
+
} catch (j) {
|
|
1626
|
+
throw v.value = j instanceof Error ? j : new Error(String(j)), j;
|
|
1627
1627
|
} finally {
|
|
1628
1628
|
i.value = !1;
|
|
1629
1629
|
}
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1631
|
+
function w(M, W) {
|
|
1632
1632
|
if (o.value[M] = W, l.value[M]) {
|
|
1633
1633
|
const H = { ...l.value };
|
|
1634
1634
|
delete H[M], l.value = H;
|
|
1635
1635
|
}
|
|
1636
1636
|
}
|
|
1637
|
-
function
|
|
1637
|
+
function $(M) {
|
|
1638
1638
|
l.value = { ...M };
|
|
1639
1639
|
}
|
|
1640
1640
|
function z() {
|
|
@@ -1645,12 +1645,12 @@ const Y = le("admin-auth", () => {
|
|
|
1645
1645
|
if (u.value) throw new Error("Already saving");
|
|
1646
1646
|
u.value = !0, v.value = null, l.value = {};
|
|
1647
1647
|
try {
|
|
1648
|
-
const M =
|
|
1648
|
+
const M = K(), W = t.value === "create" ? `/${e.value}/create` : `/${e.value}/update`, H = t.value === "create" ? o.value : { id: n.value, ...o.value }, j = await M.post(W, H), ee = j.record?.id ?? j.id;
|
|
1649
1649
|
if (ee === void 0)
|
|
1650
1650
|
throw new Error("save: backend response does not contain record.id");
|
|
1651
|
-
return n.value = ee,
|
|
1651
|
+
return n.value = ee, g(a.value, { ...o.value }), t.value = "edit", ee;
|
|
1652
1652
|
} catch (M) {
|
|
1653
|
-
throw M instanceof
|
|
1653
|
+
throw M instanceof Pe ? l.value = { ...M.fields } : (M instanceof Z || M instanceof Error) && (v.value = M), M;
|
|
1654
1654
|
} finally {
|
|
1655
1655
|
u.value = !1;
|
|
1656
1656
|
}
|
|
@@ -1661,7 +1661,7 @@ const Y = le("admin-auth", () => {
|
|
|
1661
1661
|
if (m.value) throw new Error("Already deleting");
|
|
1662
1662
|
m.value = !0, v.value = null;
|
|
1663
1663
|
try {
|
|
1664
|
-
await
|
|
1664
|
+
await K().post(`/${e.value}/delete`, { id: n.value });
|
|
1665
1665
|
} catch (M) {
|
|
1666
1666
|
throw M instanceof Error && (v.value = M), M;
|
|
1667
1667
|
} finally {
|
|
@@ -1682,22 +1682,22 @@ const Y = le("admin-auth", () => {
|
|
|
1682
1682
|
error: v,
|
|
1683
1683
|
// getters
|
|
1684
1684
|
isCreate: y,
|
|
1685
|
-
isEdit:
|
|
1685
|
+
isEdit: S,
|
|
1686
1686
|
isView: R,
|
|
1687
1687
|
isDirty: _,
|
|
1688
|
-
hasError:
|
|
1688
|
+
hasError: A,
|
|
1689
1689
|
// actions
|
|
1690
|
-
reset:
|
|
1691
|
-
prepareCreate:
|
|
1692
|
-
load:
|
|
1693
|
-
setField:
|
|
1694
|
-
setErrors:
|
|
1690
|
+
reset: U,
|
|
1691
|
+
prepareCreate: L,
|
|
1692
|
+
load: k,
|
|
1693
|
+
setField: w,
|
|
1694
|
+
setErrors: $,
|
|
1695
1695
|
clearErrors: z,
|
|
1696
1696
|
save: G,
|
|
1697
1697
|
destroy: O
|
|
1698
1698
|
};
|
|
1699
1699
|
});
|
|
1700
|
-
function
|
|
1700
|
+
function Me() {
|
|
1701
1701
|
const e = /* @__PURE__ */ new Map();
|
|
1702
1702
|
return {
|
|
1703
1703
|
register(t, n) {
|
|
@@ -1721,7 +1721,7 @@ function Te() {
|
|
|
1721
1721
|
}
|
|
1722
1722
|
};
|
|
1723
1723
|
}
|
|
1724
|
-
const me =
|
|
1724
|
+
const me = Me(), fe = Me(), Bi = me.register, yt = me.get, Ii = me.has, Vi = me.list, zi = fe.register, Ze = fe.get, Di = fe.has, qi = fe.list;
|
|
1725
1725
|
function Oi() {
|
|
1726
1726
|
me.clear(), fe.clear();
|
|
1727
1727
|
}
|
|
@@ -1737,15 +1737,15 @@ const bt = /* @__PURE__ */ P({
|
|
|
1737
1737
|
setup(e) {
|
|
1738
1738
|
return (t, n) => (s(), b(r(Q), { variant: "warning" }, {
|
|
1739
1739
|
title: f(() => [
|
|
1740
|
-
|
|
1740
|
+
C("Неизвестный тип поля: " + h(e.type), 1)
|
|
1741
1741
|
]),
|
|
1742
1742
|
default: f(() => [
|
|
1743
1743
|
e.name ? (s(), c(T, { key: 0 }, [
|
|
1744
|
-
d("code", null,
|
|
1745
|
-
n[0] || (n[0] =
|
|
1746
|
-
d("code", null, "registerField('" +
|
|
1747
|
-
n[1] || (n[1] =
|
|
1748
|
-
], 64)) :
|
|
1744
|
+
d("code", null, h(e.name), 1),
|
|
1745
|
+
n[0] || (n[0] = C(" — зарегистрируйте field-компонент через ", -1)),
|
|
1746
|
+
d("code", null, "registerField('" + h(e.type) + "', YourComponent)", 1),
|
|
1747
|
+
n[1] || (n[1] = C(". ", -1))
|
|
1748
|
+
], 64)) : F("", !0)
|
|
1749
1749
|
]),
|
|
1750
1750
|
_: 1
|
|
1751
1751
|
}));
|
|
@@ -1760,13 +1760,13 @@ const bt = /* @__PURE__ */ P({
|
|
|
1760
1760
|
const { type: a, ...l } = t.node;
|
|
1761
1761
|
return l;
|
|
1762
1762
|
});
|
|
1763
|
-
return (a, l) => n.value ? (s(), b(de(n.value), Ee(
|
|
1763
|
+
return (a, l) => n.value ? (s(), b(de(n.value), Ee(Fe({ key: 0 }, o.value)), null, 16)) : (s(), b(bt, {
|
|
1764
1764
|
key: 1,
|
|
1765
1765
|
type: e.node.type,
|
|
1766
1766
|
name: e.node.name
|
|
1767
1767
|
}, null, 8, ["type", "name"]));
|
|
1768
1768
|
}
|
|
1769
|
-
}),
|
|
1769
|
+
}), we = /* @__PURE__ */ P({
|
|
1770
1770
|
__name: "LayoutRenderer",
|
|
1771
1771
|
props: {
|
|
1772
1772
|
node: {}
|
|
@@ -1785,7 +1785,7 @@ const bt = /* @__PURE__ */ P({
|
|
|
1785
1785
|
const { type: l, kind: i, ...u } = t.node;
|
|
1786
1786
|
return u;
|
|
1787
1787
|
}), a = p(() => t.node);
|
|
1788
|
-
return (l, i) => n.value.kind === "layout" && n.value.component ? (s(), b(de(n.value.component), Ee(
|
|
1788
|
+
return (l, i) => n.value.kind === "layout" && n.value.component ? (s(), b(de(n.value.component), Ee(Fe({ key: 0 }, o.value)), null, 16)) : n.value.kind === "field" ? (s(), b(kt, {
|
|
1789
1789
|
key: 1,
|
|
1790
1790
|
node: a.value
|
|
1791
1791
|
}, null, 8, ["node"])) : (s(), b(bt, {
|
|
@@ -1794,7 +1794,7 @@ const bt = /* @__PURE__ */ P({
|
|
|
1794
1794
|
name: e.node.name
|
|
1795
1795
|
}, null, 8, ["type", "name"]));
|
|
1796
1796
|
}
|
|
1797
|
-
}),
|
|
1797
|
+
}), Ua = { class: "admin-page admin-resource-form" }, Ea = { class: "admin-page__hd" }, Fa = { class: "admin-page__title-wrap" }, La = { class: "admin-page__title" }, Pa = { class: "admin-page__actions" }, Ta = {
|
|
1798
1798
|
key: 1,
|
|
1799
1799
|
class: "admin-resource-form__loading"
|
|
1800
1800
|
}, Ma = {
|
|
@@ -1833,18 +1833,18 @@ const bt = /* @__PURE__ */ P({
|
|
|
1833
1833
|
return "default";
|
|
1834
1834
|
}
|
|
1835
1835
|
});
|
|
1836
|
-
|
|
1836
|
+
Ue(async () => {
|
|
1837
1837
|
o.manifest === null && await o.load().catch(() => {
|
|
1838
1838
|
}), t.id !== null && t.id !== void 0 ? await n.load(t.slug, t.id, "edit").catch(() => {
|
|
1839
1839
|
}) : n.prepareCreate(t.slug);
|
|
1840
1840
|
}), ae(
|
|
1841
1841
|
() => [t.slug, t.id],
|
|
1842
|
-
async ([_,
|
|
1843
|
-
|
|
1842
|
+
async ([_, g]) => {
|
|
1843
|
+
g != null ? await n.load(_, g, "edit").catch(() => {
|
|
1844
1844
|
}) : n.prepareCreate(_);
|
|
1845
1845
|
}
|
|
1846
1846
|
);
|
|
1847
|
-
async function
|
|
1847
|
+
async function S() {
|
|
1848
1848
|
try {
|
|
1849
1849
|
const _ = await n.save();
|
|
1850
1850
|
n.isCreate && a.push({
|
|
@@ -1860,36 +1860,36 @@ const bt = /* @__PURE__ */ P({
|
|
|
1860
1860
|
}), n.hasError || a.push({ name: t.indexRouteName }).catch(() => {
|
|
1861
1861
|
}));
|
|
1862
1862
|
}
|
|
1863
|
-
function
|
|
1863
|
+
function A() {
|
|
1864
1864
|
n.isDirty && !confirm("Несохранённые изменения будут потеряны. Продолжить?") || a.push({ name: t.indexRouteName }).catch(() => {
|
|
1865
1865
|
});
|
|
1866
1866
|
}
|
|
1867
|
-
return (_,
|
|
1868
|
-
d("header",
|
|
1867
|
+
return (_, g) => (s(), c("section", Ua, [
|
|
1868
|
+
d("header", Ea, [
|
|
1869
1869
|
d("div", Fa, [
|
|
1870
1870
|
d("a", {
|
|
1871
1871
|
class: "admin-resource-form__back",
|
|
1872
|
-
onClick:
|
|
1872
|
+
onClick: A
|
|
1873
1873
|
}, "← Назад"),
|
|
1874
|
-
d("h1", La,
|
|
1875
|
-
v.value ? (s(), b(r(
|
|
1874
|
+
d("h1", La, h(m.value), 1),
|
|
1875
|
+
v.value ? (s(), b(r(Ke), {
|
|
1876
1876
|
key: 0,
|
|
1877
1877
|
variant: y.value
|
|
1878
1878
|
}, {
|
|
1879
1879
|
default: f(() => [
|
|
1880
|
-
|
|
1880
|
+
C(h(v.value), 1)
|
|
1881
1881
|
]),
|
|
1882
1882
|
_: 1
|
|
1883
|
-
}, 8, ["variant"])) :
|
|
1883
|
+
}, 8, ["variant"])) : F("", !0)
|
|
1884
1884
|
]),
|
|
1885
1885
|
d("div", Pa, [
|
|
1886
|
-
|
|
1886
|
+
x(r(V), {
|
|
1887
1887
|
variant: "ghost",
|
|
1888
1888
|
disabled: r(n).saving || r(n).deleting,
|
|
1889
|
-
onClick:
|
|
1889
|
+
onClick: A
|
|
1890
1890
|
}, {
|
|
1891
|
-
default: f(() => [...
|
|
1892
|
-
|
|
1891
|
+
default: f(() => [...g[0] || (g[0] = [
|
|
1892
|
+
C(" Отмена ", -1)
|
|
1893
1893
|
])]),
|
|
1894
1894
|
_: 1
|
|
1895
1895
|
}, 8, ["disabled"]),
|
|
@@ -1900,19 +1900,19 @@ const bt = /* @__PURE__ */ P({
|
|
|
1900
1900
|
loading: r(n).deleting,
|
|
1901
1901
|
onClick: R
|
|
1902
1902
|
}, {
|
|
1903
|
-
default: f(() => [...
|
|
1904
|
-
|
|
1903
|
+
default: f(() => [...g[1] || (g[1] = [
|
|
1904
|
+
C(" Удалить ", -1)
|
|
1905
1905
|
])]),
|
|
1906
1906
|
_: 1
|
|
1907
|
-
}, 8, ["disabled", "loading"])) :
|
|
1908
|
-
|
|
1907
|
+
}, 8, ["disabled", "loading"])) : F("", !0),
|
|
1908
|
+
x(r(V), {
|
|
1909
1909
|
variant: "primary",
|
|
1910
1910
|
disabled: r(n).saving || r(n).loading,
|
|
1911
1911
|
loading: r(n).saving,
|
|
1912
|
-
onClick:
|
|
1912
|
+
onClick: S
|
|
1913
1913
|
}, {
|
|
1914
1914
|
default: f(() => [
|
|
1915
|
-
|
|
1915
|
+
C(h(r(n).isCreate ? "Создать" : "Сохранить"), 1)
|
|
1916
1916
|
]),
|
|
1917
1917
|
_: 1
|
|
1918
1918
|
}, 8, ["disabled", "loading"])
|
|
@@ -1925,56 +1925,56 @@ const bt = /* @__PURE__ */ P({
|
|
|
1925
1925
|
role: "alert"
|
|
1926
1926
|
}, {
|
|
1927
1927
|
default: f(() => [
|
|
1928
|
-
|
|
1928
|
+
C(h(r(n).error?.message ?? "Не удалось сохранить запись"), 1)
|
|
1929
1929
|
]),
|
|
1930
1930
|
_: 1
|
|
1931
|
-
})) :
|
|
1931
|
+
})) : F("", !0),
|
|
1932
1932
|
r(n).loading ? (s(), c("div", Ta, [
|
|
1933
|
-
(s(), c(T, null, I(6, (
|
|
1934
|
-
key:
|
|
1933
|
+
(s(), c(T, null, I(6, (U) => x(r(Oe), {
|
|
1934
|
+
key: U,
|
|
1935
1935
|
height: "40px"
|
|
1936
1936
|
})), 64))
|
|
1937
|
-
])) : (s(), b(r(
|
|
1937
|
+
])) : (s(), b(r(q), {
|
|
1938
1938
|
key: 2,
|
|
1939
1939
|
padding: "md",
|
|
1940
1940
|
class: "admin-resource-form__body"
|
|
1941
1941
|
}, {
|
|
1942
1942
|
default: f(() => [
|
|
1943
|
-
(s(!0), c(T, null, I(u.value, (
|
|
1944
|
-
key:
|
|
1945
|
-
node:
|
|
1943
|
+
(s(!0), c(T, null, I(u.value, (U, L) => (s(), b(we, {
|
|
1944
|
+
key: L,
|
|
1945
|
+
node: U
|
|
1946
1946
|
}, null, 8, ["node"]))), 128))
|
|
1947
1947
|
]),
|
|
1948
1948
|
_: 1
|
|
1949
1949
|
})),
|
|
1950
1950
|
r(n).isDirty && !r(n).loading ? (s(), c("div", Ma, [
|
|
1951
|
-
|
|
1952
|
-
|
|
1951
|
+
g[4] || (g[4] = d("span", { class: "admin-resource-form__savebar-hint" }, " Есть несохранённые изменения ", -1)),
|
|
1952
|
+
x(r(V), {
|
|
1953
1953
|
variant: "ghost",
|
|
1954
1954
|
size: "sm",
|
|
1955
|
-
onClick:
|
|
1955
|
+
onClick: A
|
|
1956
1956
|
}, {
|
|
1957
|
-
default: f(() => [...
|
|
1958
|
-
|
|
1957
|
+
default: f(() => [...g[2] || (g[2] = [
|
|
1958
|
+
C("Отмена", -1)
|
|
1959
1959
|
])]),
|
|
1960
1960
|
_: 1
|
|
1961
1961
|
}),
|
|
1962
|
-
|
|
1962
|
+
x(r(V), {
|
|
1963
1963
|
variant: "primary",
|
|
1964
1964
|
size: "sm",
|
|
1965
1965
|
loading: r(n).saving,
|
|
1966
1966
|
disabled: r(n).saving,
|
|
1967
|
-
onClick:
|
|
1967
|
+
onClick: S
|
|
1968
1968
|
}, {
|
|
1969
|
-
default: f(() => [...
|
|
1970
|
-
|
|
1969
|
+
default: f(() => [...g[3] || (g[3] = [
|
|
1970
|
+
C(" Сохранить ", -1)
|
|
1971
1971
|
])]),
|
|
1972
1972
|
_: 1
|
|
1973
1973
|
}, 8, ["loading", "disabled"])
|
|
1974
|
-
])) :
|
|
1974
|
+
])) : F("", !0)
|
|
1975
1975
|
]));
|
|
1976
1976
|
}
|
|
1977
|
-
}), ve =
|
|
1977
|
+
}), ve = Me(), Wi = ve.register, tt = ve.get, Ki = ve.has, ji = ve.list, Gi = ve.clear, Na = ve.registerBundle, Ba = /* @__PURE__ */ P({
|
|
1978
1978
|
__name: "UnknownEntry",
|
|
1979
1979
|
props: {
|
|
1980
1980
|
type: {},
|
|
@@ -1983,12 +1983,12 @@ const bt = /* @__PURE__ */ P({
|
|
|
1983
1983
|
setup(e) {
|
|
1984
1984
|
return (t, n) => (s(), b(r(Q), { variant: "warning" }, {
|
|
1985
1985
|
title: f(() => [
|
|
1986
|
-
|
|
1986
|
+
C("Неизвестный тип infolist-entry: " + h(e.type), 1)
|
|
1987
1987
|
]),
|
|
1988
1988
|
default: f(() => [
|
|
1989
|
-
n[0] || (n[0] =
|
|
1990
|
-
d("code", null, "registerInfolistEntry('" +
|
|
1991
|
-
n[1] || (n[1] =
|
|
1989
|
+
n[0] || (n[0] = C(" Зарегистрируйте через ", -1)),
|
|
1990
|
+
d("code", null, "registerInfolistEntry('" + h(e.type) + "', YourComponent)", 1),
|
|
1991
|
+
n[1] || (n[1] = C(". ", -1))
|
|
1992
1992
|
]),
|
|
1993
1993
|
_: 1
|
|
1994
1994
|
}));
|
|
@@ -2002,19 +2002,19 @@ const bt = /* @__PURE__ */ P({
|
|
|
2002
2002
|
}, za = {
|
|
2003
2003
|
key: 3,
|
|
2004
2004
|
class: "admin-infolist-section"
|
|
2005
|
-
},
|
|
2005
|
+
}, Da = {
|
|
2006
2006
|
key: 0,
|
|
2007
2007
|
class: "admin-infolist-section__hd"
|
|
2008
|
-
},
|
|
2008
|
+
}, qa = {
|
|
2009
2009
|
key: 0,
|
|
2010
2010
|
class: "admin-infolist-section__title"
|
|
2011
2011
|
}, Oa = {
|
|
2012
2012
|
key: 1,
|
|
2013
2013
|
class: "admin-infolist-section__description"
|
|
2014
|
-
}, Wa = { class: "admin-infolist-section__body" },
|
|
2014
|
+
}, Wa = { class: "admin-infolist-section__body" }, Ka = {
|
|
2015
2015
|
key: 4,
|
|
2016
2016
|
class: "admin-infolist-tabs"
|
|
2017
|
-
},
|
|
2017
|
+
}, ja = {
|
|
2018
2018
|
class: "admin-infolist-tabs__list",
|
|
2019
2019
|
role: "tablist"
|
|
2020
2020
|
}, Ga = { class: "admin-infolist-tabs__panel" }, Ha = /* @__PURE__ */ P({
|
|
@@ -2025,8 +2025,8 @@ const bt = /* @__PURE__ */ P({
|
|
|
2025
2025
|
setup(e) {
|
|
2026
2026
|
const t = e, n = /* @__PURE__ */ new Set(["rows", "columns", "section", "block", "tabs"]), o = p(() => {
|
|
2027
2027
|
if (t.node.kind === "entry") {
|
|
2028
|
-
const
|
|
2029
|
-
return
|
|
2028
|
+
const S = tt(t.node.type);
|
|
2029
|
+
return S ? { kind: "entry", component: S } : { kind: "unknown" };
|
|
2030
2030
|
}
|
|
2031
2031
|
if (t.node.kind === "layout")
|
|
2032
2032
|
return n.has(t.node.type) ? { kind: "layout", layoutType: t.node.type } : { kind: "unknown" };
|
|
@@ -2035,8 +2035,8 @@ const bt = /* @__PURE__ */ P({
|
|
|
2035
2035
|
const y = tt(t.node.type);
|
|
2036
2036
|
return y ? { kind: "entry", component: y } : { kind: "unknown" };
|
|
2037
2037
|
}), a = p(() => {
|
|
2038
|
-
const { type: y, kind:
|
|
2039
|
-
return
|
|
2038
|
+
const { type: y, kind: S, items: R, ...A } = t.node;
|
|
2039
|
+
return A;
|
|
2040
2040
|
}), l = p(
|
|
2041
2041
|
() => t.node.items ?? []
|
|
2042
2042
|
), i = p(() => t.node.title ?? null), u = p(
|
|
@@ -2045,48 +2045,48 @@ const bt = /* @__PURE__ */ P({
|
|
|
2045
2045
|
const y = t.node.active;
|
|
2046
2046
|
return typeof y == "number" ? y : 0;
|
|
2047
2047
|
}), v = p(() => t.node.items ?? []);
|
|
2048
|
-
return (y,
|
|
2048
|
+
return (y, S) => {
|
|
2049
2049
|
const R = lt("InfolistRenderer", !0);
|
|
2050
|
-
return o.value.kind === "entry" ? (s(), b(de(o.value.component), Ee(
|
|
2051
|
-
(s(!0), c(T, null, I(l.value, (
|
|
2050
|
+
return o.value.kind === "entry" ? (s(), b(de(o.value.component), Ee(Fe({ key: 0 }, a.value)), null, 16)) : o.value.kind === "layout" && o.value.layoutType === "rows" ? (s(), c("div", Ia, [
|
|
2051
|
+
(s(!0), c(T, null, I(l.value, (A, _) => (s(), b(R, {
|
|
2052
2052
|
key: _,
|
|
2053
|
-
node:
|
|
2053
|
+
node: A
|
|
2054
2054
|
}, null, 8, ["node"]))), 128))
|
|
2055
2055
|
])) : o.value.kind === "layout" && o.value.layoutType === "columns" ? (s(), c("div", Va, [
|
|
2056
|
-
(s(!0), c(T, null, I(l.value, (
|
|
2056
|
+
(s(!0), c(T, null, I(l.value, (A, _) => (s(), c("div", {
|
|
2057
2057
|
key: _,
|
|
2058
2058
|
class: "admin-infolist-cols__item",
|
|
2059
|
-
style:
|
|
2060
|
-
gridColumn: `span ${typeof
|
|
2059
|
+
style: Le({
|
|
2060
|
+
gridColumn: `span ${typeof A.span == "number" ? A.span : Math.max(1, Math.floor(12 / l.value.length))}`
|
|
2061
2061
|
})
|
|
2062
2062
|
}, [
|
|
2063
|
-
|
|
2063
|
+
x(R, { node: A }, null, 8, ["node"])
|
|
2064
2064
|
], 4))), 128))
|
|
2065
2065
|
])) : o.value.kind === "layout" && (o.value.layoutType === "section" || o.value.layoutType === "block") ? (s(), c("section", za, [
|
|
2066
|
-
i.value || u.value ? (s(), c("header",
|
|
2067
|
-
i.value ? (s(), c("h3",
|
|
2068
|
-
u.value ? (s(), c("p", Oa,
|
|
2069
|
-
])) :
|
|
2066
|
+
i.value || u.value ? (s(), c("header", Da, [
|
|
2067
|
+
i.value ? (s(), c("h3", qa, h(i.value), 1)) : F("", !0),
|
|
2068
|
+
u.value ? (s(), c("p", Oa, h(u.value), 1)) : F("", !0)
|
|
2069
|
+
])) : F("", !0),
|
|
2070
2070
|
d("div", Wa, [
|
|
2071
|
-
(s(!0), c(T, null, I(l.value, (
|
|
2071
|
+
(s(!0), c(T, null, I(l.value, (A, _) => (s(), b(R, {
|
|
2072
2072
|
key: _,
|
|
2073
|
-
node:
|
|
2073
|
+
node: A
|
|
2074
2074
|
}, null, 8, ["node"]))), 128))
|
|
2075
2075
|
])
|
|
2076
|
-
])) : o.value.kind === "layout" && o.value.layoutType === "tabs" ? (s(), c("div",
|
|
2077
|
-
d("ul",
|
|
2078
|
-
(s(!0), c(T, null, I(v.value, (
|
|
2079
|
-
key:
|
|
2076
|
+
])) : o.value.kind === "layout" && o.value.layoutType === "tabs" ? (s(), c("div", Ka, [
|
|
2077
|
+
d("ul", ja, [
|
|
2078
|
+
(s(!0), c(T, null, I(v.value, (A, _) => (s(), c("li", {
|
|
2079
|
+
key: A.key ?? _,
|
|
2080
2080
|
class: ne([
|
|
2081
2081
|
"admin-infolist-tabs__tab",
|
|
2082
2082
|
{ "admin-infolist-tabs__tab--active": _ === m.value }
|
|
2083
2083
|
])
|
|
2084
|
-
},
|
|
2084
|
+
}, h(A.label), 3))), 128))
|
|
2085
2085
|
]),
|
|
2086
2086
|
d("div", Ga, [
|
|
2087
|
-
(s(!0), c(T, null, I(v.value[m.value]?.items ?? [], (
|
|
2087
|
+
(s(!0), c(T, null, I(v.value[m.value]?.items ?? [], (A, _) => (s(), b(R, {
|
|
2088
2088
|
key: _,
|
|
2089
|
-
node:
|
|
2089
|
+
node: A
|
|
2090
2090
|
}, null, 8, ["node"]))), 128))
|
|
2091
2091
|
])
|
|
2092
2092
|
])) : (s(), b(Ba, {
|
|
@@ -2106,7 +2106,7 @@ function Hi() {
|
|
|
2106
2106
|
throw new Error("useRecord() called outside of provideRecord() scope");
|
|
2107
2107
|
return e;
|
|
2108
2108
|
}
|
|
2109
|
-
function
|
|
2109
|
+
function Ne() {
|
|
2110
2110
|
return it(Xe, null);
|
|
2111
2111
|
}
|
|
2112
2112
|
const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-page__hd" }, Qa = { class: "admin-page__title-wrap" }, Za = { class: "admin-page__title" }, el = { class: "admin-page__actions" }, tl = {
|
|
@@ -2128,14 +2128,14 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2128
2128
|
), u = p(
|
|
2129
2129
|
() => `${l.value?.label ?? t.slug}: запись #${t.id}`
|
|
2130
2130
|
);
|
|
2131
|
-
|
|
2131
|
+
Ue(async () => {
|
|
2132
2132
|
o.manifest === null && await o.load().catch(() => {
|
|
2133
2133
|
}), await n.load(t.slug, t.id, "view").catch(() => {
|
|
2134
2134
|
});
|
|
2135
2135
|
}), ae(
|
|
2136
2136
|
() => [t.slug, t.id],
|
|
2137
|
-
async ([y,
|
|
2138
|
-
await n.load(y,
|
|
2137
|
+
async ([y, S]) => {
|
|
2138
|
+
await n.load(y, S, "view").catch(() => {
|
|
2139
2139
|
});
|
|
2140
2140
|
}
|
|
2141
2141
|
);
|
|
@@ -2153,29 +2153,29 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2153
2153
|
}), n.hasError || a.push({ name: t.indexRouteName }).catch(() => {
|
|
2154
2154
|
}));
|
|
2155
2155
|
}
|
|
2156
|
-
return (y,
|
|
2156
|
+
return (y, S) => (s(), c("section", Ja, [
|
|
2157
2157
|
d("header", Ya, [
|
|
2158
2158
|
d("div", Qa, [
|
|
2159
|
-
d("h1", Za,
|
|
2159
|
+
d("h1", Za, h(u.value), 1)
|
|
2160
2160
|
]),
|
|
2161
2161
|
d("div", el, [
|
|
2162
|
-
|
|
2162
|
+
x(r(V), {
|
|
2163
2163
|
variant: "ghost",
|
|
2164
2164
|
onClick: m
|
|
2165
2165
|
}, {
|
|
2166
|
-
default: f(() => [...
|
|
2167
|
-
|
|
2166
|
+
default: f(() => [...S[0] || (S[0] = [
|
|
2167
|
+
C("Редактировать", -1)
|
|
2168
2168
|
])]),
|
|
2169
2169
|
_: 1
|
|
2170
2170
|
}),
|
|
2171
|
-
|
|
2171
|
+
x(r(V), {
|
|
2172
2172
|
variant: "danger",
|
|
2173
2173
|
loading: r(n).deleting,
|
|
2174
2174
|
disabled: r(n).deleting,
|
|
2175
2175
|
onClick: v
|
|
2176
2176
|
}, {
|
|
2177
|
-
default: f(() => [...
|
|
2178
|
-
|
|
2177
|
+
default: f(() => [...S[1] || (S[1] = [
|
|
2178
|
+
C(" Удалить ", -1)
|
|
2179
2179
|
])]),
|
|
2180
2180
|
_: 1
|
|
2181
2181
|
}, 8, ["loading", "disabled"])
|
|
@@ -2188,23 +2188,23 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2188
2188
|
role: "alert"
|
|
2189
2189
|
}, {
|
|
2190
2190
|
default: f(() => [
|
|
2191
|
-
|
|
2191
|
+
C(h(r(n).error?.message ?? "Не удалось загрузить запись"), 1)
|
|
2192
2192
|
]),
|
|
2193
2193
|
_: 1
|
|
2194
|
-
})) :
|
|
2194
|
+
})) : F("", !0),
|
|
2195
2195
|
r(n).loading ? (s(), c("div", tl, [
|
|
2196
|
-
(s(), c(T, null, I(8, (R) =>
|
|
2196
|
+
(s(), c(T, null, I(8, (R) => x(r(Oe), {
|
|
2197
2197
|
key: R,
|
|
2198
2198
|
height: "24px"
|
|
2199
2199
|
})), 64))
|
|
2200
|
-
])) : (s(), b(r(
|
|
2200
|
+
])) : (s(), b(r(q), {
|
|
2201
2201
|
key: 2,
|
|
2202
2202
|
padding: "md",
|
|
2203
2203
|
class: "admin-resource-view__body"
|
|
2204
2204
|
}, {
|
|
2205
2205
|
default: f(() => [
|
|
2206
|
-
(s(!0), c(T, null, I(i.value, (R,
|
|
2207
|
-
key:
|
|
2206
|
+
(s(!0), c(T, null, I(i.value, (R, A) => (s(), b(Ha, {
|
|
2207
|
+
key: A,
|
|
2208
2208
|
node: R
|
|
2209
2209
|
}, null, 8, ["node"]))), 128))
|
|
2210
2210
|
]),
|
|
@@ -2230,180 +2230,180 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2230
2230
|
},
|
|
2231
2231
|
emits: ["update:section", "avatar-replace", "two-factor-disable", "two-factor-regenerate", "save"],
|
|
2232
2232
|
setup(e, { emit: t }) {
|
|
2233
|
-
const n = e, o = t, a = Y(), l =
|
|
2233
|
+
const n = e, o = t, a = Y(), l = je(), i = Ge(), u = [
|
|
2234
2234
|
{ id: "general", label: "Основное", icon: "user" },
|
|
2235
2235
|
{ id: "security", label: "Безопасность", icon: "shield" },
|
|
2236
2236
|
{ id: "tokens", label: "API токены", icon: "key" },
|
|
2237
2237
|
{ id: "sessions", label: "Сессии", icon: "monitor" }
|
|
2238
|
-
], m =
|
|
2239
|
-
function v(
|
|
2240
|
-
m.value =
|
|
2238
|
+
], m = E(n.section);
|
|
2239
|
+
function v(k) {
|
|
2240
|
+
m.value = k, o("update:section", k);
|
|
2241
2241
|
}
|
|
2242
|
-
const y =
|
|
2242
|
+
const y = E({
|
|
2243
2243
|
name: a.user?.name ?? "",
|
|
2244
2244
|
email: a.user?.email ?? "",
|
|
2245
2245
|
locale: i.current,
|
|
2246
2246
|
theme: l.current
|
|
2247
|
-
}),
|
|
2248
|
-
() => i.available.map((
|
|
2247
|
+
}), S = p(
|
|
2248
|
+
() => i.available.map((k) => ({ value: k, label: k.toUpperCase() }))
|
|
2249
2249
|
), R = p(
|
|
2250
|
-
() => l.available.map((
|
|
2250
|
+
() => l.available.map((k) => ({ value: k, label: k === "dark" ? "Тёмная" : k === "light" ? "Светлая" : k }))
|
|
2251
2251
|
);
|
|
2252
|
-
function
|
|
2252
|
+
function A() {
|
|
2253
2253
|
o("save", { ...y.value });
|
|
2254
2254
|
}
|
|
2255
2255
|
function _() {
|
|
2256
2256
|
o("avatar-replace");
|
|
2257
2257
|
}
|
|
2258
|
-
function
|
|
2258
|
+
function g() {
|
|
2259
2259
|
o("two-factor-disable");
|
|
2260
2260
|
}
|
|
2261
|
-
function
|
|
2261
|
+
function U() {
|
|
2262
2262
|
o("two-factor-regenerate");
|
|
2263
2263
|
}
|
|
2264
|
-
const
|
|
2265
|
-
return (
|
|
2264
|
+
const L = p(() => !!a.user?.twoFactorEnabled);
|
|
2265
|
+
return (k, w) => (s(), c("section", al, [
|
|
2266
2266
|
d("header", ll, [
|
|
2267
2267
|
d("div", sl, [
|
|
2268
|
-
d("h1", il,
|
|
2269
|
-
d("div", ol,
|
|
2268
|
+
d("h1", il, h(e.title), 1),
|
|
2269
|
+
d("div", ol, h(e.subtitle), 1)
|
|
2270
2270
|
])
|
|
2271
2271
|
]),
|
|
2272
2272
|
d("div", rl, [
|
|
2273
2273
|
d("nav", ul, [
|
|
2274
|
-
(s(), c(T, null, I(u, (
|
|
2275
|
-
key:
|
|
2274
|
+
(s(), c(T, null, I(u, ($) => d("button", {
|
|
2275
|
+
key: $.id,
|
|
2276
2276
|
type: "button",
|
|
2277
2277
|
class: ne([
|
|
2278
2278
|
"admin-profile__nav-item",
|
|
2279
|
-
{ "admin-profile__nav-item--active": m.value ===
|
|
2279
|
+
{ "admin-profile__nav-item--active": m.value === $.id }
|
|
2280
2280
|
]),
|
|
2281
|
-
onClick: (z) => v(
|
|
2281
|
+
onClick: (z) => v($.id)
|
|
2282
2282
|
}, [
|
|
2283
2283
|
d("span", {
|
|
2284
2284
|
class: "admin-profile__nav-icon",
|
|
2285
|
-
"data-icon":
|
|
2285
|
+
"data-icon": $.icon
|
|
2286
2286
|
}, null, 8, cl),
|
|
2287
|
-
d("span", null,
|
|
2287
|
+
d("span", null, h($.label), 1)
|
|
2288
2288
|
], 10, dl)), 64))
|
|
2289
2289
|
]),
|
|
2290
2290
|
d("div", ml, [
|
|
2291
|
-
m.value === "general" ? (s(), b(r(
|
|
2291
|
+
m.value === "general" ? (s(), b(r(q), {
|
|
2292
2292
|
key: 0,
|
|
2293
2293
|
padding: "md"
|
|
2294
2294
|
}, {
|
|
2295
2295
|
default: f(() => [
|
|
2296
|
-
|
|
2296
|
+
w[7] || (w[7] = d("header", { class: "admin-profile__card-hd" }, [
|
|
2297
2297
|
d("h3", { class: "admin-profile__card-title" }, "Профиль")
|
|
2298
2298
|
], -1)),
|
|
2299
2299
|
d("div", fl, [
|
|
2300
|
-
|
|
2300
|
+
x(r(ut), {
|
|
2301
2301
|
src: r(a).user?.avatar ?? void 0,
|
|
2302
2302
|
name: r(a).user?.name ?? "?",
|
|
2303
2303
|
size: "lg"
|
|
2304
2304
|
}, null, 8, ["src", "name"]),
|
|
2305
2305
|
d("div", vl, [
|
|
2306
|
-
d("div", pl,
|
|
2307
|
-
d("div", gl,
|
|
2306
|
+
d("div", pl, h(r(a).user?.name ?? "—"), 1),
|
|
2307
|
+
d("div", gl, h(r(a).user?.email ?? "—"), 1)
|
|
2308
2308
|
]),
|
|
2309
|
-
|
|
2310
|
-
|
|
2309
|
+
w[5] || (w[5] = d("div", { style: { flex: "1" } }, null, -1)),
|
|
2310
|
+
x(r(V), {
|
|
2311
2311
|
variant: "ghost",
|
|
2312
2312
|
size: "sm",
|
|
2313
2313
|
onClick: _
|
|
2314
2314
|
}, {
|
|
2315
|
-
default: f(() => [...
|
|
2316
|
-
|
|
2315
|
+
default: f(() => [...w[4] || (w[4] = [
|
|
2316
|
+
C(" Заменить ", -1)
|
|
2317
2317
|
])]),
|
|
2318
2318
|
_: 1
|
|
2319
2319
|
})
|
|
2320
2320
|
]),
|
|
2321
2321
|
d("div", hl, [
|
|
2322
|
-
|
|
2322
|
+
x(r(ue), {
|
|
2323
2323
|
modelValue: y.value.name,
|
|
2324
|
-
"onUpdate:modelValue":
|
|
2324
|
+
"onUpdate:modelValue": w[0] || (w[0] = ($) => y.value.name = $),
|
|
2325
2325
|
label: "Имя",
|
|
2326
2326
|
name: "name"
|
|
2327
2327
|
}, null, 8, ["modelValue"]),
|
|
2328
|
-
|
|
2328
|
+
x(r(ue), {
|
|
2329
2329
|
modelValue: y.value.email,
|
|
2330
|
-
"onUpdate:modelValue":
|
|
2330
|
+
"onUpdate:modelValue": w[1] || (w[1] = ($) => y.value.email = $),
|
|
2331
2331
|
label: "Email",
|
|
2332
2332
|
type: "email",
|
|
2333
2333
|
name: "email"
|
|
2334
2334
|
}, null, 8, ["modelValue"]),
|
|
2335
|
-
|
|
2335
|
+
x(r(Re), {
|
|
2336
2336
|
modelValue: y.value.locale,
|
|
2337
|
-
"onUpdate:modelValue":
|
|
2338
|
-
options:
|
|
2337
|
+
"onUpdate:modelValue": w[2] || (w[2] = ($) => y.value.locale = $),
|
|
2338
|
+
options: S.value,
|
|
2339
2339
|
label: "Язык"
|
|
2340
2340
|
}, null, 8, ["modelValue", "options"]),
|
|
2341
|
-
|
|
2341
|
+
x(r(Re), {
|
|
2342
2342
|
modelValue: y.value.theme,
|
|
2343
|
-
"onUpdate:modelValue":
|
|
2343
|
+
"onUpdate:modelValue": w[3] || (w[3] = ($) => y.value.theme = $),
|
|
2344
2344
|
options: R.value,
|
|
2345
2345
|
label: "Тема"
|
|
2346
2346
|
}, null, 8, ["modelValue", "options"])
|
|
2347
2347
|
]),
|
|
2348
2348
|
d("footer", _l, [
|
|
2349
|
-
|
|
2349
|
+
x(r(V), {
|
|
2350
2350
|
variant: "primary",
|
|
2351
|
-
onClick:
|
|
2351
|
+
onClick: A
|
|
2352
2352
|
}, {
|
|
2353
|
-
default: f(() => [...
|
|
2354
|
-
|
|
2353
|
+
default: f(() => [...w[6] || (w[6] = [
|
|
2354
|
+
C("Сохранить", -1)
|
|
2355
2355
|
])]),
|
|
2356
2356
|
_: 1
|
|
2357
2357
|
})
|
|
2358
2358
|
])
|
|
2359
2359
|
]),
|
|
2360
2360
|
_: 1
|
|
2361
|
-
})) : m.value === "security" ? (s(), b(r(
|
|
2361
|
+
})) : m.value === "security" ? (s(), b(r(q), {
|
|
2362
2362
|
key: 1,
|
|
2363
2363
|
padding: "md"
|
|
2364
2364
|
}, {
|
|
2365
2365
|
default: f(() => [
|
|
2366
2366
|
d("header", yl, [
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
variant:
|
|
2367
|
+
w[8] || (w[8] = d("h3", { class: "admin-profile__card-title" }, "Двухфакторная аутентификация", -1)),
|
|
2368
|
+
x(r(Ke), {
|
|
2369
|
+
variant: L.value ? "success" : "default"
|
|
2370
2370
|
}, {
|
|
2371
2371
|
default: f(() => [
|
|
2372
|
-
|
|
2372
|
+
C(h(L.value ? "Включена" : "Отключена"), 1)
|
|
2373
2373
|
]),
|
|
2374
2374
|
_: 1
|
|
2375
2375
|
}, 8, ["variant"])
|
|
2376
2376
|
]),
|
|
2377
|
-
|
|
2377
|
+
L.value ? (s(), c("p", bl, " 2FA включена. У вас остались recovery-коды на случай потери устройства. ")) : (s(), c("p", kl, " Включите 2FA для дополнительной защиты аккаунта. ")),
|
|
2378
2378
|
d("footer", wl, [
|
|
2379
|
-
|
|
2380
|
-
|
|
2379
|
+
L.value ? (s(), c(T, { key: 0 }, [
|
|
2380
|
+
x(r(V), {
|
|
2381
2381
|
variant: "ghost",
|
|
2382
2382
|
size: "sm",
|
|
2383
|
-
onClick:
|
|
2383
|
+
onClick: U
|
|
2384
2384
|
}, {
|
|
2385
|
-
default: f(() => [...
|
|
2386
|
-
|
|
2385
|
+
default: f(() => [...w[9] || (w[9] = [
|
|
2386
|
+
C(" Перегенерировать коды ", -1)
|
|
2387
2387
|
])]),
|
|
2388
2388
|
_: 1
|
|
2389
2389
|
}),
|
|
2390
|
-
|
|
2390
|
+
x(r(V), {
|
|
2391
2391
|
variant: "danger",
|
|
2392
2392
|
size: "sm",
|
|
2393
|
-
onClick:
|
|
2393
|
+
onClick: g
|
|
2394
2394
|
}, {
|
|
2395
|
-
default: f(() => [...
|
|
2396
|
-
|
|
2395
|
+
default: f(() => [...w[10] || (w[10] = [
|
|
2396
|
+
C(" Отключить 2FA ", -1)
|
|
2397
2397
|
])]),
|
|
2398
2398
|
_: 1
|
|
2399
2399
|
})
|
|
2400
|
-
], 64)) : X(
|
|
2401
|
-
|
|
2400
|
+
], 64)) : X(k.$slots, "enable-2fa", { key: 1 }, () => [
|
|
2401
|
+
x(r(V), {
|
|
2402
2402
|
variant: "primary",
|
|
2403
2403
|
disabled: ""
|
|
2404
2404
|
}, {
|
|
2405
|
-
default: f(() => [...
|
|
2406
|
-
|
|
2405
|
+
default: f(() => [...w[11] || (w[11] = [
|
|
2406
|
+
C(" Включить 2FA (host customize) ", -1)
|
|
2407
2407
|
])]),
|
|
2408
2408
|
_: 1
|
|
2409
2409
|
})
|
|
@@ -2411,13 +2411,13 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2411
2411
|
])
|
|
2412
2412
|
]),
|
|
2413
2413
|
_: 3
|
|
2414
|
-
})) : X(
|
|
2414
|
+
})) : X(k.$slots, m.value, {
|
|
2415
2415
|
key: 2,
|
|
2416
2416
|
section: m.value
|
|
2417
2417
|
}, () => [
|
|
2418
|
-
|
|
2418
|
+
x(r(q), { padding: "md" }, {
|
|
2419
2419
|
default: f(() => [
|
|
2420
|
-
d("p", $l, " Section «" +
|
|
2420
|
+
d("p", $l, " Section «" + h(m.value) + "» не реализована библиотекой — host-проект подключает её через slot " + h(m.value) + ". ", 1)
|
|
2421
2421
|
]),
|
|
2422
2422
|
_: 1
|
|
2423
2423
|
})
|
|
@@ -2426,7 +2426,7 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2426
2426
|
])
|
|
2427
2427
|
]));
|
|
2428
2428
|
}
|
|
2429
|
-
}), pe =
|
|
2429
|
+
}), pe = Me(), Xi = pe.register, Cl = pe.get, Ji = pe.has, Yi = pe.list, Qi = pe.clear, Sl = pe.registerBundle, Al = /* @__PURE__ */ P({
|
|
2430
2430
|
__name: "UnknownWidget",
|
|
2431
2431
|
props: {
|
|
2432
2432
|
type: {}
|
|
@@ -2434,12 +2434,12 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2434
2434
|
setup(e) {
|
|
2435
2435
|
return (t, n) => (s(), b(r(Q), { variant: "warning" }, {
|
|
2436
2436
|
title: f(() => [
|
|
2437
|
-
|
|
2437
|
+
C("Неизвестный widget-тип: " + h(e.type), 1)
|
|
2438
2438
|
]),
|
|
2439
2439
|
default: f(() => [
|
|
2440
|
-
n[0] || (n[0] =
|
|
2441
|
-
d("code", null, "registerWidget('" +
|
|
2442
|
-
n[1] || (n[1] =
|
|
2440
|
+
n[0] || (n[0] = C(" Зарегистрируйте через ", -1)),
|
|
2441
|
+
d("code", null, "registerWidget('" + h(e.type) + "', YourComponent)", 1),
|
|
2442
|
+
n[1] || (n[1] = C(". ", -1))
|
|
2443
2443
|
]),
|
|
2444
2444
|
_: 1
|
|
2445
2445
|
}));
|
|
@@ -2454,12 +2454,12 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2454
2454
|
const { type: a, span: l, ...i } = t.node;
|
|
2455
2455
|
return i;
|
|
2456
2456
|
});
|
|
2457
|
-
return (a, l) => n.value ? (s(), b(de(n.value), Ee(
|
|
2457
|
+
return (a, l) => n.value ? (s(), b(de(n.value), Ee(Fe({ key: 0 }, o.value)), null, 16)) : (s(), b(Al, {
|
|
2458
2458
|
key: 1,
|
|
2459
2459
|
type: e.node.type
|
|
2460
2460
|
}, null, 8, ["type"]));
|
|
2461
2461
|
}
|
|
2462
|
-
}),
|
|
2462
|
+
}), Ul = { class: "admin-page admin-dashboard" }, El = { class: "admin-page__hd" }, Fl = { class: "admin-page__title-wrap" }, Ll = { class: "admin-page__title" }, Pl = {
|
|
2463
2463
|
key: 0,
|
|
2464
2464
|
class: "admin-page__count"
|
|
2465
2465
|
}, Tl = { class: "admin-page__actions" }, Ml = { class: "admin-dashboard__grid" }, Nl = /* @__PURE__ */ P({
|
|
@@ -2480,23 +2480,23 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2480
2480
|
const v = typeof m.span == "number" ? m.span : 12;
|
|
2481
2481
|
return Math.max(1, Math.min(12, v));
|
|
2482
2482
|
}
|
|
2483
|
-
return (m, v) => (s(), c("section",
|
|
2484
|
-
d("header",
|
|
2483
|
+
return (m, v) => (s(), c("section", Ul, [
|
|
2484
|
+
d("header", El, [
|
|
2485
2485
|
d("div", Fl, [
|
|
2486
|
-
d("h1", Ll,
|
|
2487
|
-
i.value ? (s(), c("div", Pl,
|
|
2486
|
+
d("h1", Ll, h(l.value), 1),
|
|
2487
|
+
i.value ? (s(), c("div", Pl, h(i.value), 1)) : F("", !0)
|
|
2488
2488
|
]),
|
|
2489
2489
|
d("div", Tl, [
|
|
2490
2490
|
X(m.$slots, "actions")
|
|
2491
2491
|
])
|
|
2492
2492
|
]),
|
|
2493
2493
|
d("div", Ml, [
|
|
2494
|
-
(s(!0), c(T, null, I(a.value, (y,
|
|
2495
|
-
key:
|
|
2494
|
+
(s(!0), c(T, null, I(a.value, (y, S) => (s(), c("div", {
|
|
2495
|
+
key: S,
|
|
2496
2496
|
class: "admin-dashboard__cell",
|
|
2497
|
-
style:
|
|
2497
|
+
style: Le({ gridColumn: `span ${u(y)} / span ${u(y)}` })
|
|
2498
2498
|
}, [
|
|
2499
|
-
|
|
2499
|
+
x(Rl, { node: y }, null, 8, ["node"])
|
|
2500
2500
|
], 4))), 128))
|
|
2501
2501
|
])
|
|
2502
2502
|
]));
|
|
@@ -2521,7 +2521,7 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2521
2521
|
warning: "warning",
|
|
2522
2522
|
info: "info"
|
|
2523
2523
|
}, o = p(() => n[t.tone]);
|
|
2524
|
-
return (a, l) => (s(), b(r(
|
|
2524
|
+
return (a, l) => (s(), b(r(Se), {
|
|
2525
2525
|
title: e.title,
|
|
2526
2526
|
value: e.value,
|
|
2527
2527
|
prefix: e.prefix,
|
|
@@ -2541,7 +2541,7 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2541
2541
|
}, zl = {
|
|
2542
2542
|
key: 1,
|
|
2543
2543
|
class: "admin-widget__desc"
|
|
2544
|
-
},
|
|
2544
|
+
}, Dl = ["viewBox", "height", "aria-label"], ql = ["x", "y", "width", "height", "fill", "data-label", "data-value"], Ol = /* @__PURE__ */ P({
|
|
2545
2545
|
__name: "BarChartWidget",
|
|
2546
2546
|
props: {
|
|
2547
2547
|
title: { default: "" },
|
|
@@ -2561,15 +2561,15 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2561
2561
|
heightPct: i.value / n.value * 100
|
|
2562
2562
|
}));
|
|
2563
2563
|
});
|
|
2564
|
-
return (a, l) => (s(), b(r(
|
|
2564
|
+
return (a, l) => (s(), b(r(q), {
|
|
2565
2565
|
padding: "md",
|
|
2566
2566
|
class: "admin-widget"
|
|
2567
2567
|
}, {
|
|
2568
2568
|
default: f(() => [
|
|
2569
2569
|
e.title || e.description ? (s(), c("header", Il, [
|
|
2570
|
-
e.title ? (s(), c("h3", Vl,
|
|
2571
|
-
e.description ? (s(), c("p", zl,
|
|
2572
|
-
])) :
|
|
2570
|
+
e.title ? (s(), c("h3", Vl, h(e.title), 1)) : F("", !0),
|
|
2571
|
+
e.description ? (s(), c("p", zl, h(e.description), 1)) : F("", !0)
|
|
2572
|
+
])) : F("", !0),
|
|
2573
2573
|
(s(), c("svg", {
|
|
2574
2574
|
class: "admin-widget-bar-chart",
|
|
2575
2575
|
viewBox: `0 0 100 ${e.height}`,
|
|
@@ -2590,9 +2590,9 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2590
2590
|
"data-label": i.label,
|
|
2591
2591
|
"data-value": i.value
|
|
2592
2592
|
}, [
|
|
2593
|
-
d("title", null,
|
|
2594
|
-
], 8,
|
|
2595
|
-
], 8,
|
|
2593
|
+
d("title", null, h(i.label) + ": " + h(i.value), 1)
|
|
2594
|
+
], 8, ql))), 128))
|
|
2595
|
+
], 8, Dl))
|
|
2596
2596
|
]),
|
|
2597
2597
|
_: 1
|
|
2598
2598
|
}));
|
|
@@ -2600,7 +2600,7 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2600
2600
|
}), Wl = {
|
|
2601
2601
|
key: 0,
|
|
2602
2602
|
class: "admin-widget__hd"
|
|
2603
|
-
},
|
|
2603
|
+
}, Kl = { class: "admin-widget__title" }, jl = { class: "admin-donut-widget__row" }, Gl = ["aria-label"], Hl = ["d", "fill"], Xl = { class: "admin-donut-widget__legend" }, Jl = { class: "admin-donut-widget__label" }, Yl = { class: "admin-donut-widget__value" }, Ql = /* @__PURE__ */ P({
|
|
2604
2604
|
__name: "DonutChartWidget",
|
|
2605
2605
|
props: {
|
|
2606
2606
|
title: { default: "" },
|
|
@@ -2618,24 +2618,24 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2618
2618
|
return t.data.map((i, u) => {
|
|
2619
2619
|
const m = l / o.value * 2 * Math.PI;
|
|
2620
2620
|
l += i.value;
|
|
2621
|
-
const v = l / o.value * 2 * Math.PI, y = 50,
|
|
2621
|
+
const v = l / o.value * 2 * Math.PI, y = 50, S = 60, R = 60, A = S + y * Math.cos(m - Math.PI / 2), _ = R + y * Math.sin(m - Math.PI / 2), g = S + y * Math.cos(v - Math.PI / 2), U = R + y * Math.sin(v - Math.PI / 2), L = v - m > Math.PI ? 1 : 0, k = t.data.length === 1 ? `M ${S - y} ${R} a ${y} ${y} 0 1 0 ${y * 2} 0 a ${y} ${y} 0 1 0 ${-y * 2} 0` : `M ${S} ${R} L ${A} ${_} A ${y} ${y} 0 ${L} 1 ${g} ${U} Z`;
|
|
2622
2622
|
return {
|
|
2623
2623
|
...i,
|
|
2624
|
-
path:
|
|
2624
|
+
path: k,
|
|
2625
2625
|
color: i.color ?? n[u % n.length],
|
|
2626
2626
|
pct: (i.value / o.value * 100).toFixed(1)
|
|
2627
2627
|
};
|
|
2628
2628
|
});
|
|
2629
2629
|
});
|
|
2630
|
-
return (l, i) => (s(), b(r(
|
|
2630
|
+
return (l, i) => (s(), b(r(q), {
|
|
2631
2631
|
padding: "md",
|
|
2632
2632
|
class: "admin-widget admin-donut-widget"
|
|
2633
2633
|
}, {
|
|
2634
2634
|
default: f(() => [
|
|
2635
2635
|
e.title ? (s(), c("header", Wl, [
|
|
2636
|
-
d("h3",
|
|
2637
|
-
])) :
|
|
2638
|
-
d("div",
|
|
2636
|
+
d("h3", Kl, h(e.title), 1)
|
|
2637
|
+
])) : F("", !0),
|
|
2638
|
+
d("div", jl, [
|
|
2639
2639
|
(s(), c("svg", {
|
|
2640
2640
|
viewBox: "0 0 120 120",
|
|
2641
2641
|
class: "admin-donut-widget__svg",
|
|
@@ -2647,7 +2647,7 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2647
2647
|
d: u.path,
|
|
2648
2648
|
fill: u.color
|
|
2649
2649
|
}, [
|
|
2650
|
-
d("title", null,
|
|
2650
|
+
d("title", null, h(u.label) + ": " + h(u.value) + " (" + h(u.pct) + "%)", 1)
|
|
2651
2651
|
], 8, Hl))), 128)),
|
|
2652
2652
|
i[0] || (i[0] = d("circle", {
|
|
2653
2653
|
cx: "60",
|
|
@@ -2660,10 +2660,10 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2660
2660
|
(s(!0), c(T, null, I(a.value, (u, m) => (s(), c("li", { key: m }, [
|
|
2661
2661
|
d("span", {
|
|
2662
2662
|
class: "admin-donut-widget__dot",
|
|
2663
|
-
style:
|
|
2663
|
+
style: Le({ background: u.color })
|
|
2664
2664
|
}, null, 4),
|
|
2665
|
-
d("span", Jl,
|
|
2666
|
-
d("span", Yl,
|
|
2665
|
+
d("span", Jl, h(u.label), 1),
|
|
2666
|
+
d("span", Yl, h(u.pct) + "%", 1)
|
|
2667
2667
|
]))), 128))
|
|
2668
2668
|
])
|
|
2669
2669
|
])
|
|
@@ -2683,15 +2683,15 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2683
2683
|
emptyText: { default: "Нет данных" }
|
|
2684
2684
|
},
|
|
2685
2685
|
setup(e) {
|
|
2686
|
-
return (t, n) => (s(), b(r(
|
|
2686
|
+
return (t, n) => (s(), b(r(q), {
|
|
2687
2687
|
padding: "md",
|
|
2688
2688
|
class: "admin-widget"
|
|
2689
2689
|
}, {
|
|
2690
2690
|
default: f(() => [
|
|
2691
2691
|
e.title ? (s(), c("header", Zl, [
|
|
2692
|
-
d("h3", es,
|
|
2693
|
-
])) :
|
|
2694
|
-
|
|
2692
|
+
d("h3", es, h(e.title), 1)
|
|
2693
|
+
])) : F("", !0),
|
|
2694
|
+
x(r(We), {
|
|
2695
2695
|
columns: e.columns,
|
|
2696
2696
|
data: e.rows,
|
|
2697
2697
|
"empty-text": e.emptyText
|
|
@@ -2713,15 +2713,15 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2713
2713
|
gap: { default: 2 }
|
|
2714
2714
|
},
|
|
2715
2715
|
setup(e) {
|
|
2716
|
-
return (t, n) => (s(), b(r(
|
|
2716
|
+
return (t, n) => (s(), b(r(q), {
|
|
2717
2717
|
padding: "md",
|
|
2718
2718
|
class: "admin-widget"
|
|
2719
2719
|
}, {
|
|
2720
2720
|
default: f(() => [
|
|
2721
2721
|
e.title ? (s(), c("header", ns, [
|
|
2722
|
-
d("h3", as,
|
|
2723
|
-
])) :
|
|
2724
|
-
|
|
2722
|
+
d("h3", as, h(e.title), 1)
|
|
2723
|
+
])) : F("", !0),
|
|
2724
|
+
x(r(qt), {
|
|
2725
2725
|
data: e.data,
|
|
2726
2726
|
levels: e.levels,
|
|
2727
2727
|
color: e.color,
|
|
@@ -2756,16 +2756,16 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2756
2756
|
warning: "warning",
|
|
2757
2757
|
negative: "danger"
|
|
2758
2758
|
}, o = p(() => n[t.tone]);
|
|
2759
|
-
return (a, l) => (s(), b(r(
|
|
2759
|
+
return (a, l) => (s(), b(r(q), {
|
|
2760
2760
|
padding: "md",
|
|
2761
2761
|
class: "admin-widget"
|
|
2762
2762
|
}, {
|
|
2763
2763
|
default: f(() => [
|
|
2764
2764
|
e.title ? (s(), c("header", ss, [
|
|
2765
|
-
d("h3", is,
|
|
2766
|
-
])) :
|
|
2765
|
+
d("h3", is, h(e.title), 1)
|
|
2766
|
+
])) : F("", !0),
|
|
2767
2767
|
d("div", os, [
|
|
2768
|
-
|
|
2768
|
+
x(r(Ot), {
|
|
2769
2769
|
value: e.value,
|
|
2770
2770
|
min: e.min,
|
|
2771
2771
|
max: e.max,
|
|
@@ -2792,15 +2792,15 @@ const Ja = { class: "admin-page admin-resource-view" }, Ya = { class: "admin-pag
|
|
|
2792
2792
|
content: {}
|
|
2793
2793
|
},
|
|
2794
2794
|
setup(e) {
|
|
2795
|
-
return (t, n) => (s(), b(r(
|
|
2795
|
+
return (t, n) => (s(), b(r(q), {
|
|
2796
2796
|
padding: "md",
|
|
2797
2797
|
class: "admin-widget"
|
|
2798
2798
|
}, {
|
|
2799
2799
|
default: f(() => [
|
|
2800
2800
|
e.title ? (s(), c("header", us, [
|
|
2801
|
-
d("h3", ds,
|
|
2802
|
-
])) :
|
|
2803
|
-
d("div", cs,
|
|
2801
|
+
d("h3", ds, h(e.title), 1)
|
|
2802
|
+
])) : F("", !0),
|
|
2803
|
+
d("div", cs, h(e.content), 1)
|
|
2804
2804
|
]),
|
|
2805
2805
|
_: 1
|
|
2806
2806
|
}));
|
|
@@ -2853,7 +2853,7 @@ function ps(e) {
|
|
|
2853
2853
|
}, u = Ye(l, i);
|
|
2854
2854
|
return u instanceof gt && e.onUnauthenticated?.(), Promise.reject(u);
|
|
2855
2855
|
}
|
|
2856
|
-
return Promise.reject(new
|
|
2856
|
+
return Promise.reject(new Te(a.message));
|
|
2857
2857
|
}
|
|
2858
2858
|
);
|
|
2859
2859
|
const n = (a, l, i) => t[a](l, i).then((u) => u.data), o = (a, l, i, u) => t[a](l, i, u).then((m) => m.data);
|
|
@@ -2877,7 +2877,7 @@ function gs(e) {
|
|
|
2877
2877
|
function hs(e) {
|
|
2878
2878
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2879
2879
|
}
|
|
2880
|
-
function
|
|
2880
|
+
function xe(e, t) {
|
|
2881
2881
|
const n = e.permissions?.[t];
|
|
2882
2882
|
return typeof n == "string" && n.length > 0 ? [n] : [];
|
|
2883
2883
|
}
|
|
@@ -2900,7 +2900,7 @@ function bs(e, t) {
|
|
|
2900
2900
|
kind: "resource",
|
|
2901
2901
|
slug: n,
|
|
2902
2902
|
title: e.label,
|
|
2903
|
-
permissions:
|
|
2903
|
+
permissions: xe(e, "view")
|
|
2904
2904
|
},
|
|
2905
2905
|
// slug передаётся в page-component'ы как prop. Конкретный slug запекаем в
|
|
2906
2906
|
// function-mode, чтобы page видел его одинаково и через named-route, и через
|
|
@@ -2916,7 +2916,7 @@ function bs(e, t) {
|
|
|
2916
2916
|
kind: "resource",
|
|
2917
2917
|
slug: n,
|
|
2918
2918
|
title: `${e.label}: создать`,
|
|
2919
|
-
permissions:
|
|
2919
|
+
permissions: xe(e, "create")
|
|
2920
2920
|
},
|
|
2921
2921
|
props: { slug: n }
|
|
2922
2922
|
},
|
|
@@ -2929,7 +2929,7 @@ function bs(e, t) {
|
|
|
2929
2929
|
kind: "resource",
|
|
2930
2930
|
slug: n,
|
|
2931
2931
|
title: `${e.label}: редактирование`,
|
|
2932
|
-
permissions:
|
|
2932
|
+
permissions: xe(e, "update")
|
|
2933
2933
|
},
|
|
2934
2934
|
// slug запекаем, id из route-params.
|
|
2935
2935
|
props: (a) => ({ slug: n, id: a.params.id })
|
|
@@ -2943,7 +2943,7 @@ function bs(e, t) {
|
|
|
2943
2943
|
kind: "resource",
|
|
2944
2944
|
slug: n,
|
|
2945
2945
|
title: e.label,
|
|
2946
|
-
permissions:
|
|
2946
|
+
permissions: xe(e, "view")
|
|
2947
2947
|
},
|
|
2948
2948
|
props: (a) => ({ slug: n, id: a.params.id })
|
|
2949
2949
|
}
|
|
@@ -3046,7 +3046,7 @@ const As = [
|
|
|
3046
3046
|
function Rs(e) {
|
|
3047
3047
|
return typeof e != "string" ? !1 : As.some((t) => e.startsWith(t));
|
|
3048
3048
|
}
|
|
3049
|
-
function
|
|
3049
|
+
function Us(e) {
|
|
3050
3050
|
const t = e.base ?? "/admin", n = e.history ?? ot(t), o = [
|
|
3051
3051
|
{
|
|
3052
3052
|
path: "/login",
|
|
@@ -3131,7 +3131,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3131
3131
|
"onUpdate:modelValue": l
|
|
3132
3132
|
}, null, 8, ["model-value", "type", "label", "hint", "error", "placeholder", "required", "disabled", "readonly", "name", "autocomplete"]));
|
|
3133
3133
|
}
|
|
3134
|
-
}),
|
|
3134
|
+
}), Ce = /* @__PURE__ */ P({
|
|
3135
3135
|
__name: "TextAreaField",
|
|
3136
3136
|
props: {
|
|
3137
3137
|
name: {},
|
|
@@ -3148,7 +3148,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3148
3148
|
function l(i) {
|
|
3149
3149
|
n.setField(t.name, i);
|
|
3150
3150
|
}
|
|
3151
|
-
return (i, u) => (s(), b(r(
|
|
3151
|
+
return (i, u) => (s(), b(r(ke), {
|
|
3152
3152
|
label: e.label ?? void 0,
|
|
3153
3153
|
hint: e.help ?? void 0,
|
|
3154
3154
|
error: a.value,
|
|
@@ -3156,7 +3156,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3156
3156
|
disabled: e.disabled
|
|
3157
3157
|
}, {
|
|
3158
3158
|
default: f(() => [
|
|
3159
|
-
|
|
3159
|
+
x(r(Wt), {
|
|
3160
3160
|
"model-value": o.value,
|
|
3161
3161
|
rows: e.rows,
|
|
3162
3162
|
placeholder: e.placeholder ?? void 0,
|
|
@@ -3191,7 +3191,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3191
3191
|
function l(i) {
|
|
3192
3192
|
n.setField(t.name, i);
|
|
3193
3193
|
}
|
|
3194
|
-
return (i, u) => (s(), b(r(
|
|
3194
|
+
return (i, u) => (s(), b(r(ke), {
|
|
3195
3195
|
label: e.label ?? void 0,
|
|
3196
3196
|
hint: e.help ?? void 0,
|
|
3197
3197
|
error: a.value,
|
|
@@ -3199,7 +3199,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3199
3199
|
disabled: e.disabled
|
|
3200
3200
|
}, {
|
|
3201
3201
|
default: f(() => [
|
|
3202
|
-
|
|
3202
|
+
x(r(Kt), {
|
|
3203
3203
|
"model-value": o.value,
|
|
3204
3204
|
min: e.min ?? void 0,
|
|
3205
3205
|
max: e.max ?? void 0,
|
|
@@ -3236,7 +3236,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3236
3236
|
function l(i) {
|
|
3237
3237
|
n.setField(t.name, i);
|
|
3238
3238
|
}
|
|
3239
|
-
return (i, u) => (s(), b(r(
|
|
3239
|
+
return (i, u) => (s(), b(r(ke), {
|
|
3240
3240
|
label: e.label ?? void 0,
|
|
3241
3241
|
hint: e.help ?? void 0,
|
|
3242
3242
|
error: a.value,
|
|
@@ -3244,7 +3244,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3244
3244
|
disabled: e.disabled
|
|
3245
3245
|
}, {
|
|
3246
3246
|
default: f(() => [
|
|
3247
|
-
|
|
3247
|
+
x(r(Re), {
|
|
3248
3248
|
"model-value": o.value,
|
|
3249
3249
|
options: e.options,
|
|
3250
3250
|
placeholder: e.placeholder ?? void 0,
|
|
@@ -3273,7 +3273,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3273
3273
|
function l(i) {
|
|
3274
3274
|
n.setField(t.name, i);
|
|
3275
3275
|
}
|
|
3276
|
-
return (i, u) => (s(), b(r(
|
|
3276
|
+
return (i, u) => (s(), b(r(ke), {
|
|
3277
3277
|
label: e.label ?? void 0,
|
|
3278
3278
|
hint: e.help ?? void 0,
|
|
3279
3279
|
error: a.value,
|
|
@@ -3281,7 +3281,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3281
3281
|
disabled: e.disabled
|
|
3282
3282
|
}, {
|
|
3283
3283
|
default: f(() => [
|
|
3284
|
-
|
|
3284
|
+
x(r(dt), {
|
|
3285
3285
|
"model-value": o.value,
|
|
3286
3286
|
disabled: e.disabled,
|
|
3287
3287
|
name: e.name,
|
|
@@ -3289,8 +3289,8 @@ const J = /* @__PURE__ */ P({
|
|
|
3289
3289
|
}, {
|
|
3290
3290
|
default: f(() => [
|
|
3291
3291
|
e.inlineLabel ? (s(), c(T, { key: 0 }, [
|
|
3292
|
-
|
|
3293
|
-
], 64)) :
|
|
3292
|
+
C(h(e.inlineLabel), 1)
|
|
3293
|
+
], 64)) : F("", !0)
|
|
3294
3294
|
]),
|
|
3295
3295
|
_: 1
|
|
3296
3296
|
}, 8, ["model-value", "disabled", "name"])
|
|
@@ -3318,7 +3318,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3318
3318
|
function l(i) {
|
|
3319
3319
|
n.setField(t.name, i);
|
|
3320
3320
|
}
|
|
3321
|
-
return (i, u) => (s(), b(r(
|
|
3321
|
+
return (i, u) => (s(), b(r(ke), {
|
|
3322
3322
|
label: e.label ?? void 0,
|
|
3323
3323
|
hint: e.help ?? void 0,
|
|
3324
3324
|
error: a.value,
|
|
@@ -3326,7 +3326,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3326
3326
|
disabled: e.disabled
|
|
3327
3327
|
}, {
|
|
3328
3328
|
default: f(() => [
|
|
3329
|
-
|
|
3329
|
+
x(r(jt), {
|
|
3330
3330
|
"model-value": o.value,
|
|
3331
3331
|
min: e.min ?? void 0,
|
|
3332
3332
|
max: e.max ?? void 0,
|
|
@@ -3351,7 +3351,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3351
3351
|
align: "stretch"
|
|
3352
3352
|
}, {
|
|
3353
3353
|
default: f(() => [
|
|
3354
|
-
(s(!0), c(T, null, I(e.items, (o, a) => (s(), b(
|
|
3354
|
+
(s(!0), c(T, null, I(e.items, (o, a) => (s(), b(we, {
|
|
3355
3355
|
key: a,
|
|
3356
3356
|
node: o
|
|
3357
3357
|
}, null, 8, ["node"]))), 128))
|
|
@@ -3359,7 +3359,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3359
3359
|
_: 1
|
|
3360
3360
|
}, 8, ["gap"]));
|
|
3361
3361
|
}
|
|
3362
|
-
}),
|
|
3362
|
+
}), Es = /* @__PURE__ */ P({
|
|
3363
3363
|
__name: "ColumnsLayout",
|
|
3364
3364
|
props: {
|
|
3365
3365
|
items: {},
|
|
@@ -3380,9 +3380,9 @@ const J = /* @__PURE__ */ P({
|
|
|
3380
3380
|
(s(!0), c(T, null, I(e.items, (i, u) => (s(), c("div", {
|
|
3381
3381
|
key: u,
|
|
3382
3382
|
class: "admin-columns__item",
|
|
3383
|
-
style:
|
|
3383
|
+
style: Le({ gridColumn: `span ${o(i)} / span ${o(i)}` })
|
|
3384
3384
|
}, [
|
|
3385
|
-
|
|
3385
|
+
x(we, { node: i }, null, 8, ["node"])
|
|
3386
3386
|
], 4))), 128))
|
|
3387
3387
|
]),
|
|
3388
3388
|
_: 1
|
|
@@ -3405,17 +3405,17 @@ const J = /* @__PURE__ */ P({
|
|
|
3405
3405
|
description: { default: null }
|
|
3406
3406
|
},
|
|
3407
3407
|
setup(e) {
|
|
3408
|
-
return (t, n) => (s(), b(r(
|
|
3408
|
+
return (t, n) => (s(), b(r(q), {
|
|
3409
3409
|
padding: "md",
|
|
3410
3410
|
class: "admin-section"
|
|
3411
3411
|
}, {
|
|
3412
3412
|
default: f(() => [
|
|
3413
3413
|
e.title || e.description ? (s(), c("header", Fs, [
|
|
3414
|
-
e.title ? (s(), c("h3", Ls,
|
|
3415
|
-
e.description ? (s(), c("p", Ps,
|
|
3416
|
-
])) :
|
|
3414
|
+
e.title ? (s(), c("h3", Ls, h(e.title), 1)) : F("", !0),
|
|
3415
|
+
e.description ? (s(), c("p", Ps, h(e.description), 1)) : F("", !0)
|
|
3416
|
+
])) : F("", !0),
|
|
3417
3417
|
d("div", Ts, [
|
|
3418
|
-
(s(!0), c(T, null, I(e.items, (o, a) => (s(), b(
|
|
3418
|
+
(s(!0), c(T, null, I(e.items, (o, a) => (s(), b(we, {
|
|
3419
3419
|
key: a,
|
|
3420
3420
|
node: o
|
|
3421
3421
|
}, null, 8, ["node"]))), 128))
|
|
@@ -3436,7 +3436,7 @@ const J = /* @__PURE__ */ P({
|
|
|
3436
3436
|
function a(u, m) {
|
|
3437
3437
|
return u.key ?? m;
|
|
3438
3438
|
}
|
|
3439
|
-
const l =
|
|
3439
|
+
const l = E(n.active ?? a(n.items[0] ?? {}, 0));
|
|
3440
3440
|
function i(u) {
|
|
3441
3441
|
l.value = u, o("update:active", u);
|
|
3442
3442
|
}
|
|
@@ -3445,12 +3445,12 @@ const J = /* @__PURE__ */ P({
|
|
|
3445
3445
|
"onUpdate:modelValue": i
|
|
3446
3446
|
}, {
|
|
3447
3447
|
list: f(() => [
|
|
3448
|
-
(s(!0), c(T, null, I(e.items, (v, y) => (s(), b(r(
|
|
3448
|
+
(s(!0), c(T, null, I(e.items, (v, y) => (s(), b(r(Ae), {
|
|
3449
3449
|
key: a(v, y),
|
|
3450
3450
|
value: a(v, y)
|
|
3451
3451
|
}, {
|
|
3452
3452
|
default: f(() => [
|
|
3453
|
-
|
|
3453
|
+
C(h(v.label), 1)
|
|
3454
3454
|
]),
|
|
3455
3455
|
_: 2
|
|
3456
3456
|
}, 1032, ["value"]))), 128))
|
|
@@ -3461,9 +3461,9 @@ const J = /* @__PURE__ */ P({
|
|
|
3461
3461
|
value: a(v, y)
|
|
3462
3462
|
}, {
|
|
3463
3463
|
default: f(() => [
|
|
3464
|
-
(s(!0), c(T, null, I(v.items, (
|
|
3464
|
+
(s(!0), c(T, null, I(v.items, (S, R) => (s(), b(we, {
|
|
3465
3465
|
key: R,
|
|
3466
|
-
node:
|
|
3466
|
+
node: S
|
|
3467
3467
|
}, null, 8, ["node"]))), 128))
|
|
3468
3468
|
]),
|
|
3469
3469
|
_: 2
|
|
@@ -3488,14 +3488,14 @@ function Ns() {
|
|
|
3488
3488
|
slug: J,
|
|
3489
3489
|
hidden: J,
|
|
3490
3490
|
label: J,
|
|
3491
|
-
textarea:
|
|
3491
|
+
textarea: Ce,
|
|
3492
3492
|
// Fallback для wysiwyg/markdown/code — обычный TextAreaField.
|
|
3493
3493
|
// Реальный rich-editor host подключает через subpath:
|
|
3494
3494
|
// import { QuillField } from '@dskripchenko/laravel-admin/quill'
|
|
3495
3495
|
// registerField('wysiwyg', QuillField)
|
|
3496
|
-
wysiwyg:
|
|
3497
|
-
markdown:
|
|
3498
|
-
code:
|
|
3496
|
+
wysiwyg: Ce,
|
|
3497
|
+
markdown: Ce,
|
|
3498
|
+
code: Ce,
|
|
3499
3499
|
number: Ve,
|
|
3500
3500
|
slider: Ve,
|
|
3501
3501
|
rating: Ve,
|
|
@@ -3520,7 +3520,7 @@ function Ns() {
|
|
|
3520
3520
|
},
|
|
3521
3521
|
layouts: {
|
|
3522
3522
|
rows: nt,
|
|
3523
|
-
columns:
|
|
3523
|
+
columns: Es,
|
|
3524
3524
|
section: he,
|
|
3525
3525
|
block: he,
|
|
3526
3526
|
tabs: Ms,
|
|
@@ -3541,13 +3541,13 @@ const B = /* @__PURE__ */ P({
|
|
|
3541
3541
|
mono: { type: Boolean, default: !1 }
|
|
3542
3542
|
},
|
|
3543
3543
|
setup(e) {
|
|
3544
|
-
const t = e, n =
|
|
3544
|
+
const t = e, n = Ne(), o = p(() => {
|
|
3545
3545
|
let a = t.value;
|
|
3546
3546
|
return a === void 0 && n && t.name && (a = n[t.name]), a == null || a === "" ? t.placeholder : String(a);
|
|
3547
3547
|
});
|
|
3548
3548
|
return (a, l) => (s(), c("span", {
|
|
3549
3549
|
class: ne(["admin-infolist-text", e.mono ? "admin-infolist-text--mono" : ""])
|
|
3550
|
-
},
|
|
3550
|
+
}, h(o.value), 3));
|
|
3551
3551
|
}
|
|
3552
3552
|
}), Bs = {
|
|
3553
3553
|
key: 1,
|
|
@@ -3562,21 +3562,21 @@ const B = /* @__PURE__ */ P({
|
|
|
3562
3562
|
variant: { default: void 0 }
|
|
3563
3563
|
},
|
|
3564
3564
|
setup(e) {
|
|
3565
|
-
const t = e, n =
|
|
3565
|
+
const t = e, n = Ne(), o = p(() => {
|
|
3566
3566
|
let l = t.value;
|
|
3567
3567
|
return l === void 0 && n && t.name && (l = n[t.name]), l == null ? "" : String(l);
|
|
3568
3568
|
}), a = p(() => t.variant ? t.variant : t.map[o.value] ?? "default");
|
|
3569
|
-
return (l, i) => o.value ? (s(), b(r(
|
|
3569
|
+
return (l, i) => o.value ? (s(), b(r(Ke), {
|
|
3570
3570
|
key: 0,
|
|
3571
3571
|
variant: a.value
|
|
3572
3572
|
}, {
|
|
3573
3573
|
default: f(() => [
|
|
3574
|
-
|
|
3574
|
+
C(h(o.value), 1)
|
|
3575
3575
|
]),
|
|
3576
3576
|
_: 1
|
|
3577
3577
|
}, 8, ["variant"])) : (s(), c("span", Bs, "—"));
|
|
3578
3578
|
}
|
|
3579
|
-
}), Vs = ["data-icon"], zs = { key: 0 },
|
|
3579
|
+
}), Vs = ["data-icon"], zs = { key: 0 }, Ds = /* @__PURE__ */ P({
|
|
3580
3580
|
__name: "IconEntry",
|
|
3581
3581
|
props: {
|
|
3582
3582
|
name: { default: "" },
|
|
@@ -3588,7 +3588,7 @@ const B = /* @__PURE__ */ P({
|
|
|
3588
3588
|
falseLabel: { default: "" }
|
|
3589
3589
|
},
|
|
3590
3590
|
setup(e) {
|
|
3591
|
-
const t = e, n =
|
|
3591
|
+
const t = e, n = Ne(), o = p(() => {
|
|
3592
3592
|
let i = t.value;
|
|
3593
3593
|
return i === void 0 && n && t.name && (i = n[t.name]), !!i;
|
|
3594
3594
|
}), a = p(() => o.value ? t.trueLabel : t.falseLabel), l = p(() => o.value ? t.trueIcon : t.falseIcon);
|
|
@@ -3599,10 +3599,10 @@ const B = /* @__PURE__ */ P({
|
|
|
3599
3599
|
class: "admin-infolist-icon__glyph",
|
|
3600
3600
|
"data-icon": l.value
|
|
3601
3601
|
}, null, 8, Vs),
|
|
3602
|
-
a.value ? (s(), c("span", zs,
|
|
3602
|
+
a.value ? (s(), c("span", zs, h(a.value), 1)) : F("", !0)
|
|
3603
3603
|
], 2));
|
|
3604
3604
|
}
|
|
3605
|
-
}),
|
|
3605
|
+
}), qs = {
|
|
3606
3606
|
key: 1,
|
|
3607
3607
|
class: "admin-infolist-text"
|
|
3608
3608
|
}, at = /* @__PURE__ */ P({
|
|
@@ -3613,7 +3613,7 @@ const B = /* @__PURE__ */ P({
|
|
|
3613
3613
|
value: { default: void 0 }
|
|
3614
3614
|
},
|
|
3615
3615
|
setup(e) {
|
|
3616
|
-
const t = e, n =
|
|
3616
|
+
const t = e, n = Ne(), o = p(() => {
|
|
3617
3617
|
let l = t.value;
|
|
3618
3618
|
return l === void 0 && n && t.name && (l = n[t.name]), l == null ? [] : typeof l != "object" ? [] : Object.entries(l);
|
|
3619
3619
|
});
|
|
@@ -3631,13 +3631,13 @@ const B = /* @__PURE__ */ P({
|
|
|
3631
3631
|
label: u
|
|
3632
3632
|
}, {
|
|
3633
3633
|
default: f(() => [
|
|
3634
|
-
|
|
3634
|
+
C(h(a(m)), 1)
|
|
3635
3635
|
]),
|
|
3636
3636
|
_: 2
|
|
3637
3637
|
}, 1032, ["label"]))), 128))
|
|
3638
3638
|
]),
|
|
3639
3639
|
_: 1
|
|
3640
|
-
})) : (s(), c("span",
|
|
3640
|
+
})) : (s(), c("span", qs, "—"));
|
|
3641
3641
|
}
|
|
3642
3642
|
});
|
|
3643
3643
|
function Os() {
|
|
@@ -3645,7 +3645,7 @@ function Os() {
|
|
|
3645
3645
|
// Дефолтные типы infolist (BadgeEntry::make() и т.п.).
|
|
3646
3646
|
text: B,
|
|
3647
3647
|
badge: Is,
|
|
3648
|
-
icon:
|
|
3648
|
+
icon: Ds,
|
|
3649
3649
|
keyvalue: at,
|
|
3650
3650
|
"key-value": at,
|
|
3651
3651
|
// Маппинг от backend Field::fieldType() → TextEntry для view-режима.
|
|
@@ -3692,9 +3692,9 @@ function eo(e, t = {}) {
|
|
|
3692
3692
|
csrfToken: e.csrf
|
|
3693
3693
|
});
|
|
3694
3694
|
nn(a);
|
|
3695
|
-
const l =
|
|
3696
|
-
l.use(i), Y().hydrate(e), Ge().hydrate(e),
|
|
3697
|
-
const u =
|
|
3695
|
+
const l = Ut(Rn), i = Ft();
|
|
3696
|
+
l.use(i), Y().hydrate(e), Ge().hydrate(e), je().hydrate(e), He().hydrate(e), Ns(), fs(), Os();
|
|
3697
|
+
const u = Us({
|
|
3698
3698
|
base: o,
|
|
3699
3699
|
history: t.router?.history ?? ot(o),
|
|
3700
3700
|
components: {
|
|
@@ -3708,7 +3708,7 @@ function eo(e, t = {}) {
|
|
|
3708
3708
|
resourceEdit: n.resourceEdit ?? et,
|
|
3709
3709
|
resourceView: n.resourceView ?? nl,
|
|
3710
3710
|
dashboard: n.dashboard ?? Nl,
|
|
3711
|
-
settings: n.settings ??
|
|
3711
|
+
settings: n.settings ?? Kn,
|
|
3712
3712
|
screen: n.screen ?? Xn
|
|
3713
3713
|
},
|
|
3714
3714
|
extraRoutes: t.router?.extraRoutes,
|
|
@@ -3716,20 +3716,20 @@ function eo(e, t = {}) {
|
|
|
3716
3716
|
titleGuard: t.router?.titleGuard
|
|
3717
3717
|
});
|
|
3718
3718
|
if (l.use(u), !t.skipManifestLoad) {
|
|
3719
|
-
const m = ie(), v = Y(), y = ht(),
|
|
3719
|
+
const m = ie(), v = Y(), y = ht(), S = () => {
|
|
3720
3720
|
y.load().catch(() => {
|
|
3721
3721
|
}), m.load().then((R) => {
|
|
3722
3722
|
u.replaceManifestRoutes(R);
|
|
3723
|
-
const
|
|
3724
|
-
|
|
3723
|
+
const A = u.currentRoute.value;
|
|
3724
|
+
A.name === "admin.notFound" && A.fullPath !== "/" && u.replace(A.fullPath);
|
|
3725
3725
|
}).catch((R) => {
|
|
3726
3726
|
typeof console < "u" && console.error("[laravel-admin] manifest load failed:", R);
|
|
3727
3727
|
});
|
|
3728
3728
|
};
|
|
3729
|
-
v.isAuthenticated &&
|
|
3729
|
+
v.isAuthenticated && S(), ae(
|
|
3730
3730
|
() => v.user,
|
|
3731
|
-
(R,
|
|
3732
|
-
R && !
|
|
3731
|
+
(R, A) => {
|
|
3732
|
+
R && !A && S();
|
|
3733
3733
|
}
|
|
3734
3734
|
);
|
|
3735
3735
|
}
|
|
@@ -3744,7 +3744,7 @@ function Ws(e) {
|
|
|
3744
3744
|
}
|
|
3745
3745
|
}
|
|
3746
3746
|
async function to(e = {}) {
|
|
3747
|
-
const t =
|
|
3747
|
+
const t = Ks();
|
|
3748
3748
|
if (t)
|
|
3749
3749
|
return t;
|
|
3750
3750
|
if (e.client)
|
|
@@ -3752,19 +3752,19 @@ async function to(e = {}) {
|
|
|
3752
3752
|
const n = e.xhrUrl ?? "/system/bootstrap";
|
|
3753
3753
|
return await e.client.get(n);
|
|
3754
3754
|
} catch (n) {
|
|
3755
|
-
if (n instanceof
|
|
3755
|
+
if (n instanceof Te)
|
|
3756
3756
|
return null;
|
|
3757
3757
|
throw n;
|
|
3758
3758
|
}
|
|
3759
3759
|
return null;
|
|
3760
3760
|
}
|
|
3761
|
-
function
|
|
3761
|
+
function Ks() {
|
|
3762
3762
|
return typeof window > "u" ? null : window.__ADMIN_BOOTSTRAP__ ?? null;
|
|
3763
3763
|
}
|
|
3764
3764
|
function no() {
|
|
3765
3765
|
return typeof document > "u" ? null : document.querySelector('meta[name="csrf-token"]')?.getAttribute("content") ?? null;
|
|
3766
3766
|
}
|
|
3767
|
-
const
|
|
3767
|
+
const js = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" }, Hs = {
|
|
3768
3768
|
key: 0,
|
|
3769
3769
|
class: "admin-notifs__count"
|
|
3770
3770
|
}, Xs = { class: "admin-notifs__list" }, Js = {
|
|
@@ -3790,55 +3790,55 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
3790
3790
|
emits: ["update:open", "select-item"],
|
|
3791
3791
|
setup(e, { emit: t }) {
|
|
3792
3792
|
const n = e, o = t, a = He();
|
|
3793
|
-
function l(
|
|
3794
|
-
o("update:open",
|
|
3793
|
+
function l(g) {
|
|
3794
|
+
o("update:open", g);
|
|
3795
3795
|
}
|
|
3796
3796
|
ae(
|
|
3797
3797
|
() => n.open,
|
|
3798
|
-
async (
|
|
3799
|
-
|
|
3798
|
+
async (g) => {
|
|
3799
|
+
g && await a.load(a.lastFilter ?? "all", 1).catch(() => {
|
|
3800
3800
|
});
|
|
3801
3801
|
},
|
|
3802
3802
|
{ immediate: !0 }
|
|
3803
3803
|
);
|
|
3804
3804
|
const i = p(() => a.lastFilter ?? "all");
|
|
3805
|
-
async function u(
|
|
3806
|
-
await a.load(
|
|
3805
|
+
async function u(g) {
|
|
3806
|
+
await a.load(g, 1).catch(() => {
|
|
3807
3807
|
});
|
|
3808
3808
|
}
|
|
3809
3809
|
async function m() {
|
|
3810
3810
|
await a.markAllAsRead().catch(() => {
|
|
3811
3811
|
});
|
|
3812
3812
|
}
|
|
3813
|
-
async function v(
|
|
3814
|
-
o("select-item",
|
|
3813
|
+
async function v(g) {
|
|
3814
|
+
o("select-item", g), g.read_at || await a.markAsRead(g.id).catch(() => {
|
|
3815
3815
|
});
|
|
3816
3816
|
}
|
|
3817
|
-
async function y(
|
|
3818
|
-
|
|
3817
|
+
async function y(g, U) {
|
|
3818
|
+
U.stopPropagation(), await a.destroy(g.id).catch(() => {
|
|
3819
3819
|
});
|
|
3820
3820
|
}
|
|
3821
|
-
function
|
|
3822
|
-
const
|
|
3823
|
-
return
|
|
3821
|
+
function S(g) {
|
|
3822
|
+
const U = g.data.level;
|
|
3823
|
+
return U === "success" || U === "warning" || U === "danger" ? U : "info";
|
|
3824
3824
|
}
|
|
3825
|
-
function R(
|
|
3826
|
-
return
|
|
3825
|
+
function R(g) {
|
|
3826
|
+
return g.data.title ?? "—";
|
|
3827
3827
|
}
|
|
3828
|
-
function
|
|
3829
|
-
return
|
|
3828
|
+
function A(g) {
|
|
3829
|
+
return g.data.body ?? "";
|
|
3830
3830
|
}
|
|
3831
|
-
function _(
|
|
3832
|
-
if (!
|
|
3833
|
-
const
|
|
3834
|
-
if (
|
|
3835
|
-
if (
|
|
3836
|
-
const
|
|
3837
|
-
if (
|
|
3838
|
-
const
|
|
3839
|
-
return
|
|
3831
|
+
function _(g) {
|
|
3832
|
+
if (!g) return "";
|
|
3833
|
+
const U = new Date(g), L = Math.max(0, Date.now() - U.getTime()), k = Math.floor(L / 6e4);
|
|
3834
|
+
if (k < 1) return "только что";
|
|
3835
|
+
if (k < 60) return `${k} мин назад`;
|
|
3836
|
+
const w = Math.floor(k / 60);
|
|
3837
|
+
if (w < 24) return `${w} ч назад`;
|
|
3838
|
+
const $ = Math.floor(w / 24);
|
|
3839
|
+
return $ < 7 ? `${$} д назад` : U.toLocaleDateString("ru-RU");
|
|
3840
3840
|
}
|
|
3841
|
-
return (
|
|
3841
|
+
return (g, U) => (s(), b(r(Yt), {
|
|
3842
3842
|
"model-value": e.open,
|
|
3843
3843
|
side: "right",
|
|
3844
3844
|
width: "400px",
|
|
@@ -3846,10 +3846,10 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
3846
3846
|
"onUpdate:modelValue": l
|
|
3847
3847
|
}, {
|
|
3848
3848
|
header: f(() => [
|
|
3849
|
-
d("div",
|
|
3849
|
+
d("div", js, [
|
|
3850
3850
|
d("h2", Gs, [
|
|
3851
|
-
|
|
3852
|
-
r(a).unreadCount > 0 ? (s(), c("span", Hs, " (" +
|
|
3851
|
+
U[0] || (U[0] = C(" Уведомления ", -1)),
|
|
3852
|
+
r(a).unreadCount > 0 ? (s(), c("span", Hs, " (" + h(r(a).unreadCount) + ") ", 1)) : F("", !0)
|
|
3853
3853
|
]),
|
|
3854
3854
|
r(a).unreadCount > 0 ? (s(), b(r(V), {
|
|
3855
3855
|
key: 0,
|
|
@@ -3857,74 +3857,74 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
3857
3857
|
size: "sm",
|
|
3858
3858
|
onClick: m
|
|
3859
3859
|
}, {
|
|
3860
|
-
default: f(() => [...
|
|
3861
|
-
|
|
3860
|
+
default: f(() => [...U[1] || (U[1] = [
|
|
3861
|
+
C(" Прочитать все ", -1)
|
|
3862
3862
|
])]),
|
|
3863
3863
|
_: 1
|
|
3864
|
-
})) :
|
|
3864
|
+
})) : F("", !0)
|
|
3865
3865
|
])
|
|
3866
3866
|
]),
|
|
3867
3867
|
default: f(() => [
|
|
3868
|
-
|
|
3868
|
+
x(r(ct), {
|
|
3869
3869
|
"model-value": i.value,
|
|
3870
3870
|
"onUpdate:modelValue": u
|
|
3871
3871
|
}, {
|
|
3872
3872
|
list: f(() => [
|
|
3873
|
-
|
|
3874
|
-
default: f(() => [...
|
|
3875
|
-
|
|
3873
|
+
x(r(Ae), { value: "all" }, {
|
|
3874
|
+
default: f(() => [...U[2] || (U[2] = [
|
|
3875
|
+
C("Все", -1)
|
|
3876
3876
|
])]),
|
|
3877
3877
|
_: 1
|
|
3878
3878
|
}),
|
|
3879
|
-
|
|
3879
|
+
x(r(Ae), { value: "unread" }, {
|
|
3880
3880
|
default: f(() => [
|
|
3881
|
-
|
|
3881
|
+
U[3] || (U[3] = C(" Непрочитанные", -1)),
|
|
3882
3882
|
r(a).unreadCount > 0 ? (s(), c(T, { key: 0 }, [
|
|
3883
|
-
|
|
3884
|
-
], 64)) :
|
|
3883
|
+
C(" (" + h(r(a).unreadCount) + ") ", 1)
|
|
3884
|
+
], 64)) : F("", !0)
|
|
3885
3885
|
]),
|
|
3886
3886
|
_: 1
|
|
3887
3887
|
}),
|
|
3888
|
-
|
|
3889
|
-
default: f(() => [...
|
|
3890
|
-
|
|
3888
|
+
x(r(Ae), { value: "read" }, {
|
|
3889
|
+
default: f(() => [...U[4] || (U[4] = [
|
|
3890
|
+
C("Прочитанные", -1)
|
|
3891
3891
|
])]),
|
|
3892
3892
|
_: 1
|
|
3893
3893
|
})
|
|
3894
3894
|
]),
|
|
3895
3895
|
default: f(() => [
|
|
3896
|
-
(s(), c(T, null, I(["all", "unread", "read"], (
|
|
3897
|
-
key:
|
|
3898
|
-
value:
|
|
3896
|
+
(s(), c(T, null, I(["all", "unread", "read"], (L) => x(r(mt), {
|
|
3897
|
+
key: L,
|
|
3898
|
+
value: L
|
|
3899
3899
|
}, {
|
|
3900
3900
|
default: f(() => [
|
|
3901
3901
|
d("ul", Xs, [
|
|
3902
|
-
r(a).loading ? (s(), c("li", Js, " Загрузка… ")) : r(a).items.length === 0 ? (s(), c("li", Ys, " Нет уведомлений ")) :
|
|
3903
|
-
(s(!0), c(T, null, I(r(a).items, (
|
|
3904
|
-
key:
|
|
3902
|
+
r(a).loading ? (s(), c("li", Js, " Загрузка… ")) : r(a).items.length === 0 ? (s(), c("li", Ys, " Нет уведомлений ")) : F("", !0),
|
|
3903
|
+
(s(!0), c(T, null, I(r(a).items, (k) => (s(), c("li", {
|
|
3904
|
+
key: k.id,
|
|
3905
3905
|
class: ne([
|
|
3906
3906
|
"admin-notifs__item",
|
|
3907
|
-
`admin-notifs__item--${
|
|
3908
|
-
{ "admin-notifs__item--unread": !
|
|
3907
|
+
`admin-notifs__item--${S(k)}`,
|
|
3908
|
+
{ "admin-notifs__item--unread": !k.read_at }
|
|
3909
3909
|
]),
|
|
3910
|
-
onClick: (
|
|
3910
|
+
onClick: (w) => v(k)
|
|
3911
3911
|
}, [
|
|
3912
3912
|
d("span", {
|
|
3913
3913
|
class: "admin-notifs__icon",
|
|
3914
|
-
"data-kind":
|
|
3914
|
+
"data-kind": S(k)
|
|
3915
3915
|
}, null, 8, Zs),
|
|
3916
3916
|
d("div", ei, [
|
|
3917
3917
|
d("div", ti, [
|
|
3918
|
-
|
|
3919
|
-
d("span", li,
|
|
3918
|
+
k.read_at ? (s(), c("span", ai, h(R(k)), 1)) : (s(), c("strong", ni, h(R(k)), 1)),
|
|
3919
|
+
d("span", li, h(_(k.created_at)), 1)
|
|
3920
3920
|
]),
|
|
3921
|
-
|
|
3921
|
+
A(k) ? (s(), c("p", si, h(A(k)), 1)) : F("", !0)
|
|
3922
3922
|
]),
|
|
3923
3923
|
d("button", {
|
|
3924
3924
|
type: "button",
|
|
3925
3925
|
class: "admin-notifs__close",
|
|
3926
3926
|
"aria-label": "Удалить",
|
|
3927
|
-
onClick: (
|
|
3927
|
+
onClick: (w) => y(k, w)
|
|
3928
3928
|
}, " × ", 8, ii)
|
|
3929
3929
|
], 10, Qs))), 128))
|
|
3930
3930
|
])
|
|
@@ -3971,80 +3971,80 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
3971
3971
|
{ label: "Сопоставление", description: "Колонки файла → поля" },
|
|
3972
3972
|
{ label: "Предпросмотр", description: "Проверка первых строк" },
|
|
3973
3973
|
{ label: "Импорт", description: "Запуск + сводка" }
|
|
3974
|
-
], l =
|
|
3975
|
-
function u(
|
|
3976
|
-
n.step === void 0 && (
|
|
3974
|
+
], l = E(0), i = p(() => n.step ?? l.value);
|
|
3975
|
+
function u(w) {
|
|
3976
|
+
n.step === void 0 && (w < 0 || w >= a.length || (l.value = w));
|
|
3977
3977
|
}
|
|
3978
|
-
const m =
|
|
3979
|
-
function v(
|
|
3980
|
-
m.value =
|
|
3978
|
+
const m = E([]);
|
|
3979
|
+
function v(w) {
|
|
3980
|
+
m.value = w, w.length > 0 && o("file-uploaded", w[0].file);
|
|
3981
3981
|
}
|
|
3982
|
-
const y =
|
|
3983
|
-
function
|
|
3984
|
-
y.value[
|
|
3982
|
+
const y = E({});
|
|
3983
|
+
function S(w, $) {
|
|
3984
|
+
y.value[w] = $ === null || $ === "" ? null : String($);
|
|
3985
3985
|
}
|
|
3986
3986
|
function R() {
|
|
3987
|
-
return n.headers.map((
|
|
3988
|
-
source:
|
|
3989
|
-
target: y.value[
|
|
3987
|
+
return n.headers.map((w) => ({
|
|
3988
|
+
source: w.key,
|
|
3989
|
+
target: y.value[w.key] ?? null
|
|
3990
3990
|
}));
|
|
3991
3991
|
}
|
|
3992
|
-
function
|
|
3992
|
+
function A() {
|
|
3993
3993
|
o("mapping-submit", R()), u(2);
|
|
3994
3994
|
}
|
|
3995
3995
|
function _() {
|
|
3996
3996
|
o("run-import"), u(3);
|
|
3997
3997
|
}
|
|
3998
|
-
const
|
|
3998
|
+
const g = p(() => i.value > 0), U = p(() => {
|
|
3999
3999
|
switch (i.value) {
|
|
4000
4000
|
case 0:
|
|
4001
4001
|
return m.value.length > 0;
|
|
4002
4002
|
case 1:
|
|
4003
|
-
return Object.values(y.value).some((
|
|
4003
|
+
return Object.values(y.value).some((w) => w !== null);
|
|
4004
4004
|
case 2:
|
|
4005
4005
|
return !0;
|
|
4006
4006
|
default:
|
|
4007
4007
|
return !1;
|
|
4008
4008
|
}
|
|
4009
|
-
}),
|
|
4009
|
+
}), L = p(() => [
|
|
4010
4010
|
{ value: "", label: "Не импортировать" },
|
|
4011
4011
|
...n.fieldOptions
|
|
4012
4012
|
]);
|
|
4013
|
-
function
|
|
4013
|
+
function k() {
|
|
4014
4014
|
o("cancel");
|
|
4015
4015
|
}
|
|
4016
|
-
return (
|
|
4016
|
+
return (w, $) => (s(), c("section", oi, [
|
|
4017
4017
|
d("header", ri, [
|
|
4018
4018
|
d("div", ui, [
|
|
4019
|
-
d("h1", di,
|
|
4019
|
+
d("h1", di, h(e.title), 1)
|
|
4020
4020
|
]),
|
|
4021
4021
|
d("div", ci, [
|
|
4022
|
-
|
|
4022
|
+
x(r(V), {
|
|
4023
4023
|
variant: "ghost",
|
|
4024
|
-
onClick:
|
|
4024
|
+
onClick: k
|
|
4025
4025
|
}, {
|
|
4026
|
-
default: f(() => [
|
|
4027
|
-
|
|
4026
|
+
default: f(() => [...$[2] || ($[2] = [
|
|
4027
|
+
C("Отмена", -1)
|
|
4028
4028
|
])]),
|
|
4029
4029
|
_: 1
|
|
4030
4030
|
})
|
|
4031
4031
|
])
|
|
4032
4032
|
]),
|
|
4033
|
-
|
|
4033
|
+
x(r(Qt), {
|
|
4034
4034
|
steps: a,
|
|
4035
4035
|
current: i.value
|
|
4036
4036
|
}, null, 8, ["current"]),
|
|
4037
|
-
i.value === 0 ? (s(), b(r(
|
|
4037
|
+
i.value === 0 ? (s(), b(r(q), {
|
|
4038
4038
|
key: 0,
|
|
4039
4039
|
padding: "md",
|
|
4040
4040
|
class: "admin-import-wizard__card"
|
|
4041
4041
|
}, {
|
|
4042
4042
|
default: f(() => [
|
|
4043
|
-
|
|
4043
|
+
$[3] || ($[3] = d("header", { class: "admin-import-wizard__card-hd" }, [
|
|
4044
4044
|
d("h3", null, "1. Загрузите файл"),
|
|
4045
4045
|
d("p", null, "CSV / TSV / XLSX, до 50 MB")
|
|
4046
4046
|
], -1)),
|
|
4047
|
-
|
|
4047
|
+
x(r(Zt), {
|
|
4048
4048
|
"model-value": m.value,
|
|
4049
4049
|
accept: ".csv,.tsv,.xlsx",
|
|
4050
4050
|
"max-size": 50 * 1024 * 1024,
|
|
@@ -4055,13 +4055,13 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
4055
4055
|
}, null, 8, ["model-value"])
|
|
4056
4056
|
]),
|
|
4057
4057
|
_: 1
|
|
4058
|
-
})) : i.value === 1 ? (s(), b(r(
|
|
4058
|
+
})) : i.value === 1 ? (s(), b(r(q), {
|
|
4059
4059
|
key: 1,
|
|
4060
4060
|
padding: "md",
|
|
4061
4061
|
class: "admin-import-wizard__card"
|
|
4062
4062
|
}, {
|
|
4063
4063
|
default: f(() => [
|
|
4064
|
-
|
|
4064
|
+
$[5] || ($[5] = d("header", { class: "admin-import-wizard__card-hd" }, [
|
|
4065
4065
|
d("h3", null, "2. Сопоставьте колонки"),
|
|
4066
4066
|
d("p", null, "Выберите поле ресурса для каждой колонки файла")
|
|
4067
4067
|
], -1)),
|
|
@@ -4071,40 +4071,40 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
4071
4071
|
class: "admin-import-wizard__map-row"
|
|
4072
4072
|
}, [
|
|
4073
4073
|
d("div", vi, [
|
|
4074
|
-
d("strong", null,
|
|
4075
|
-
z.sample ? (s(), c("span", pi, " «" +
|
|
4074
|
+
d("strong", null, h(z.label), 1),
|
|
4075
|
+
z.sample ? (s(), c("span", pi, " «" + h(z.sample) + "» ", 1)) : F("", !0)
|
|
4076
4076
|
]),
|
|
4077
|
-
|
|
4078
|
-
|
|
4077
|
+
$[4] || ($[4] = d("span", { class: "admin-import-wizard__map-arrow" }, "→", -1)),
|
|
4078
|
+
x(r(Re), {
|
|
4079
4079
|
"model-value": y.value[z.key] ?? "",
|
|
4080
|
-
options:
|
|
4080
|
+
options: L.value,
|
|
4081
4081
|
placeholder: "Не импортировать",
|
|
4082
|
-
"onUpdate:modelValue": (G) =>
|
|
4082
|
+
"onUpdate:modelValue": (G) => S(z.key, G)
|
|
4083
4083
|
}, null, 8, ["model-value", "options", "onUpdate:modelValue"])
|
|
4084
4084
|
]))), 128))
|
|
4085
4085
|
]))
|
|
4086
4086
|
]),
|
|
4087
4087
|
_: 1
|
|
4088
|
-
})) : i.value === 2 ? (s(), b(r(
|
|
4088
|
+
})) : i.value === 2 ? (s(), b(r(q), {
|
|
4089
4089
|
key: 2,
|
|
4090
4090
|
padding: "md",
|
|
4091
4091
|
class: "admin-import-wizard__card"
|
|
4092
4092
|
}, {
|
|
4093
4093
|
default: f(() => [
|
|
4094
4094
|
d("header", gi, [
|
|
4095
|
-
|
|
4096
|
-
d("p", null, "Первые " +
|
|
4095
|
+
$[6] || ($[6] = d("h3", null, "3. Предпросмотр", -1)),
|
|
4096
|
+
d("p", null, "Первые " + h(e.preview.length) + " строк перед импортом", 1)
|
|
4097
4097
|
]),
|
|
4098
4098
|
e.preview.some((z) => z.__warning) ? (s(), b(r(Q), {
|
|
4099
4099
|
key: 0,
|
|
4100
4100
|
variant: "warning",
|
|
4101
4101
|
style: { "margin-bottom": "var(--uid-space-md)" }
|
|
4102
4102
|
}, {
|
|
4103
|
-
default: f(() => [
|
|
4104
|
-
|
|
4103
|
+
default: f(() => [...$[7] || ($[7] = [
|
|
4104
|
+
C(" Часть строк имеет предупреждения — проверьте перед импортом. ", -1)
|
|
4105
4105
|
])]),
|
|
4106
4106
|
_: 1
|
|
4107
|
-
})) :
|
|
4107
|
+
})) : F("", !0),
|
|
4108
4108
|
e.previewColumns.length > 0 ? (s(), b(r(We), {
|
|
4109
4109
|
key: 1,
|
|
4110
4110
|
columns: e.previewColumns,
|
|
@@ -4112,13 +4112,13 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
4112
4112
|
}, null, 8, ["columns", "data"])) : (s(), c("div", hi, " Host не передал previewColumns/preview. "))
|
|
4113
4113
|
]),
|
|
4114
4114
|
_: 1
|
|
4115
|
-
})) : (s(), b(r(
|
|
4115
|
+
})) : (s(), b(r(q), {
|
|
4116
4116
|
key: 3,
|
|
4117
4117
|
padding: "md",
|
|
4118
4118
|
class: "admin-import-wizard__card"
|
|
4119
4119
|
}, {
|
|
4120
4120
|
default: f(() => [
|
|
4121
|
-
|
|
4121
|
+
$[8] || ($[8] = d("header", { class: "admin-import-wizard__card-hd" }, [
|
|
4122
4122
|
d("h3", null, "4. Импорт")
|
|
4123
4123
|
], -1)),
|
|
4124
4124
|
e.progress ? (s(), c(T, { key: 1 }, [
|
|
@@ -4126,19 +4126,19 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
4126
4126
|
key: 0,
|
|
4127
4127
|
"model-value": e.progress.created + e.progress.updated + e.progress.errors,
|
|
4128
4128
|
max: e.progress.total
|
|
4129
|
-
}, null, 8, ["model-value", "max"])) :
|
|
4129
|
+
}, null, 8, ["model-value", "max"])) : F("", !0),
|
|
4130
4130
|
d("div", yi, [
|
|
4131
|
-
|
|
4131
|
+
x(r(Se), {
|
|
4132
4132
|
title: "Создано",
|
|
4133
4133
|
value: e.progress.created,
|
|
4134
4134
|
tone: "success"
|
|
4135
4135
|
}, null, 8, ["value"]),
|
|
4136
|
-
|
|
4136
|
+
x(r(Se), {
|
|
4137
4137
|
title: "Обновлено",
|
|
4138
4138
|
value: e.progress.updated,
|
|
4139
4139
|
tone: "info"
|
|
4140
4140
|
}, null, 8, ["value"]),
|
|
4141
|
-
|
|
4141
|
+
x(r(Se), {
|
|
4142
4142
|
title: "Ошибки",
|
|
4143
4143
|
value: e.progress.errors,
|
|
4144
4144
|
tone: "danger"
|
|
@@ -4149,35 +4149,35 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
4149
4149
|
_: 1
|
|
4150
4150
|
})),
|
|
4151
4151
|
d("footer", bi, [
|
|
4152
|
-
|
|
4152
|
+
g.value ? (s(), b(r(V), {
|
|
4153
4153
|
key: 0,
|
|
4154
4154
|
variant: "ghost",
|
|
4155
|
-
onClick:
|
|
4155
|
+
onClick: $[0] || ($[0] = (z) => u(i.value - 1))
|
|
4156
4156
|
}, {
|
|
4157
|
-
default: f(() => [
|
|
4158
|
-
|
|
4157
|
+
default: f(() => [...$[9] || ($[9] = [
|
|
4158
|
+
C(" Назад ", -1)
|
|
4159
4159
|
])]),
|
|
4160
4160
|
_: 1
|
|
4161
|
-
})) :
|
|
4162
|
-
|
|
4161
|
+
})) : F("", !0),
|
|
4162
|
+
$[13] || ($[13] = d("span", { style: { flex: "1" } }, null, -1)),
|
|
4163
4163
|
i.value === 0 ? (s(), b(r(V), {
|
|
4164
4164
|
key: 1,
|
|
4165
4165
|
variant: "primary",
|
|
4166
|
-
disabled: !
|
|
4167
|
-
onClick:
|
|
4166
|
+
disabled: !U.value,
|
|
4167
|
+
onClick: $[1] || ($[1] = (z) => u(1))
|
|
4168
4168
|
}, {
|
|
4169
|
-
default: f(() => [
|
|
4170
|
-
|
|
4169
|
+
default: f(() => [...$[10] || ($[10] = [
|
|
4170
|
+
C(" Далее ", -1)
|
|
4171
4171
|
])]),
|
|
4172
4172
|
_: 1
|
|
4173
4173
|
}, 8, ["disabled"])) : i.value === 1 ? (s(), b(r(V), {
|
|
4174
4174
|
key: 2,
|
|
4175
4175
|
variant: "primary",
|
|
4176
|
-
disabled: !
|
|
4177
|
-
onClick:
|
|
4176
|
+
disabled: !U.value,
|
|
4177
|
+
onClick: A
|
|
4178
4178
|
}, {
|
|
4179
|
-
default: f(() => [
|
|
4180
|
-
|
|
4179
|
+
default: f(() => [...$[11] || ($[11] = [
|
|
4180
|
+
C(" Подтвердить mapping ", -1)
|
|
4181
4181
|
])]),
|
|
4182
4182
|
_: 1
|
|
4183
4183
|
}, 8, ["disabled"])) : i.value === 2 ? (s(), b(r(V), {
|
|
@@ -4185,11 +4185,11 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
4185
4185
|
variant: "primary",
|
|
4186
4186
|
onClick: _
|
|
4187
4187
|
}, {
|
|
4188
|
-
default: f(() => [
|
|
4189
|
-
|
|
4188
|
+
default: f(() => [...$[12] || ($[12] = [
|
|
4189
|
+
C(" Запустить импорт ", -1)
|
|
4190
4190
|
])]),
|
|
4191
4191
|
_: 1
|
|
4192
|
-
})) :
|
|
4192
|
+
})) : F("", !0)
|
|
4193
4193
|
])
|
|
4194
4194
|
]));
|
|
4195
4195
|
}
|
|
@@ -4257,7 +4257,7 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
4257
4257
|
node: { type: "date", name: "demo_date", label: "Дата публикации", inputType: "date" },
|
|
4258
4258
|
initial: { demo_date: "2026-05-01" }
|
|
4259
4259
|
}
|
|
4260
|
-
], n = t.reduce((a, l) => (a[l.group] || (a[l.group] = []), a[l.group].push(l), a), {}), o =
|
|
4260
|
+
], n = t.reduce((a, l) => (a[l.group] || (a[l.group] = []), a[l.group].push(l), a), {}), o = Et(
|
|
4261
4261
|
t.reduce((a, l) => Object.assign(a, l.initial), {})
|
|
4262
4262
|
);
|
|
4263
4263
|
return ft(o), (a, l) => (s(), c("section", ki, [
|
|
@@ -4271,21 +4271,21 @@ const Ks = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" },
|
|
|
4271
4271
|
key: u,
|
|
4272
4272
|
class: "admin-gallery__group"
|
|
4273
4273
|
}, [
|
|
4274
|
-
d("h2", wi,
|
|
4274
|
+
d("h2", wi, h(u), 1),
|
|
4275
4275
|
d("div", $i, [
|
|
4276
|
-
(s(!0), c(T, null, I(i, (m) => (s(), b(r(
|
|
4276
|
+
(s(!0), c(T, null, I(i, (m) => (s(), b(r(q), {
|
|
4277
4277
|
key: m.type + m.title,
|
|
4278
4278
|
padding: "md",
|
|
4279
4279
|
class: "admin-gallery__card"
|
|
4280
4280
|
}, {
|
|
4281
4281
|
default: f(() => [
|
|
4282
4282
|
d("header", xi, [
|
|
4283
|
-
d("h3", Ci,
|
|
4284
|
-
d("code", Si, "type: " +
|
|
4283
|
+
d("h3", Ci, h(m.title), 1),
|
|
4284
|
+
d("code", Si, "type: " + h(m.type), 1)
|
|
4285
4285
|
]),
|
|
4286
|
-
d("p", Ai,
|
|
4286
|
+
d("p", Ai, h(m.description), 1),
|
|
4287
4287
|
d("div", Ri, [
|
|
4288
|
-
|
|
4288
|
+
x(kt, {
|
|
4289
4289
|
node: m.node
|
|
4290
4290
|
}, null, 8, ["node"])
|
|
4291
4291
|
])
|
|
@@ -4306,7 +4306,7 @@ export {
|
|
|
4306
4306
|
Is as BadgeEntry,
|
|
4307
4307
|
Ol as BarChartWidget,
|
|
4308
4308
|
ze as CheckboxField,
|
|
4309
|
-
|
|
4309
|
+
Es as ColumnsLayout,
|
|
4310
4310
|
Nl as DashboardPage,
|
|
4311
4311
|
re as DateField,
|
|
4312
4312
|
Ql as DonutChartWidget,
|
|
@@ -4317,16 +4317,16 @@ export {
|
|
|
4317
4317
|
rs as GaugeWidget,
|
|
4318
4318
|
ls as HeatmapWidget,
|
|
4319
4319
|
Nn as HomePage,
|
|
4320
|
-
|
|
4320
|
+
Ds as IconEntry,
|
|
4321
4321
|
lo as ImportWizardPage,
|
|
4322
4322
|
Ha as InfolistRenderer,
|
|
4323
4323
|
at as KeyValueEntry,
|
|
4324
|
-
|
|
4324
|
+
we as LayoutRenderer,
|
|
4325
4325
|
pt as LocaleSwitcher,
|
|
4326
4326
|
ea as LoginForm,
|
|
4327
4327
|
ma as LoginPage,
|
|
4328
4328
|
ms as MarkdownWidget,
|
|
4329
|
-
|
|
4329
|
+
Te as NetworkError,
|
|
4330
4330
|
dn as NotFoundError,
|
|
4331
4331
|
zn as NotFoundPage,
|
|
4332
4332
|
rn as NotificationBell,
|
|
@@ -4340,10 +4340,10 @@ export {
|
|
|
4340
4340
|
nt as RowsLayout,
|
|
4341
4341
|
he as SectionLayout,
|
|
4342
4342
|
te as SelectField,
|
|
4343
|
-
|
|
4343
|
+
Kn as SettingsPage,
|
|
4344
4344
|
Bl as StatWidget,
|
|
4345
4345
|
Ms as TabsLayout,
|
|
4346
|
-
|
|
4346
|
+
Ce as TextAreaField,
|
|
4347
4347
|
B as TextEntry,
|
|
4348
4348
|
J as TextField,
|
|
4349
4349
|
vt as ThemeToggle,
|
|
@@ -4354,7 +4354,7 @@ export {
|
|
|
4354
4354
|
Xn as UnknownScreenPage,
|
|
4355
4355
|
Al as UnknownWidget,
|
|
4356
4356
|
mn as UserMenu,
|
|
4357
|
-
|
|
4357
|
+
Pe as ValidationError,
|
|
4358
4358
|
Rl as WidgetRenderer,
|
|
4359
4359
|
xs as buildRoutesFromManifest,
|
|
4360
4360
|
Mi as clearAdminClient,
|
|
@@ -4363,30 +4363,30 @@ export {
|
|
|
4363
4363
|
Qi as clearWidgetRegistry,
|
|
4364
4364
|
eo as createAdminApp,
|
|
4365
4365
|
ps as createAdminClient,
|
|
4366
|
-
|
|
4366
|
+
Us as createAdminRouter,
|
|
4367
4367
|
Cs as createAuthGuard,
|
|
4368
4368
|
Ss as createTitleGuard,
|
|
4369
|
-
|
|
4369
|
+
K as getAdminClient,
|
|
4370
4370
|
yt as getField,
|
|
4371
4371
|
tt as getInfolistEntry,
|
|
4372
4372
|
Ze as getLayout,
|
|
4373
4373
|
Cl as getWidget,
|
|
4374
4374
|
Ni as hasAdminClient,
|
|
4375
4375
|
Ii as hasField,
|
|
4376
|
-
|
|
4377
|
-
|
|
4376
|
+
Ki as hasInfolistEntry,
|
|
4377
|
+
Di as hasLayout,
|
|
4378
4378
|
Ji as hasWidget,
|
|
4379
4379
|
Zi as isError,
|
|
4380
4380
|
vs as isSuccess,
|
|
4381
4381
|
Vi as listFields,
|
|
4382
|
-
|
|
4383
|
-
|
|
4382
|
+
ji as listInfolistEntries,
|
|
4383
|
+
qi as listLayouts,
|
|
4384
4384
|
Yi as listWidgets,
|
|
4385
4385
|
to as loadBootstrap,
|
|
4386
4386
|
ft as provideFormState,
|
|
4387
4387
|
Xa as provideRecord,
|
|
4388
4388
|
no as readCsrfFromMeta,
|
|
4389
|
-
|
|
4389
|
+
Ks as readInlineBootstrap,
|
|
4390
4390
|
Ns as registerBuiltinComponents,
|
|
4391
4391
|
Os as registerBuiltinInfolistEntries,
|
|
4392
4392
|
fs as registerBuiltinWidgets,
|
|
@@ -4400,7 +4400,7 @@ export {
|
|
|
4400
4400
|
nn as setAdminClient,
|
|
4401
4401
|
Ye as toApiError,
|
|
4402
4402
|
ro as tryUseFormState,
|
|
4403
|
-
|
|
4403
|
+
Ne as tryUseRecord,
|
|
4404
4404
|
Y as useAuthStore,
|
|
4405
4405
|
ce as useFormState,
|
|
4406
4406
|
Ge as useLocaleStore,
|
|
@@ -4410,6 +4410,6 @@ export {
|
|
|
4410
4410
|
Hi as useRecord,
|
|
4411
4411
|
_t as useResourceFormStore,
|
|
4412
4412
|
fa as useResourceIndexStore,
|
|
4413
|
-
|
|
4413
|
+
je as useThemeStore
|
|
4414
4414
|
};
|
|
4415
4415
|
//# sourceMappingURL=index.mjs.map
|