@dskripchenko/laravel-admin 1.1.11 → 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 +1122 -1142
- package/dist/index.mjs.map +1 -1
- package/dist/stores/resourceIndex.d.ts +8 -7
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { ref as E, computed as p, defineComponent as
|
|
2
|
-
import { defineStore as le, createPinia as
|
|
3
|
-
import { RouterLink as
|
|
4
|
-
import { UidMenu as rt, UidMenuItem as
|
|
5
|
-
import
|
|
6
|
-
import { p as
|
|
7
|
-
import { t as
|
|
8
|
-
let
|
|
9
|
-
function
|
|
10
|
-
|
|
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
|
+
import { defineStore as le, createPinia as Ft } from "pinia";
|
|
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
|
+
import tn from "axios";
|
|
6
|
+
import { p as ft, u as ce } from "./formState-DGNcH1XQ.js";
|
|
7
|
+
import { t as ro } from "./formState-DGNcH1XQ.js";
|
|
8
|
+
let ye = null;
|
|
9
|
+
function nn(e) {
|
|
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
|
-
function
|
|
20
|
-
|
|
19
|
+
function Mi() {
|
|
20
|
+
ye = null;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
22
|
+
function Ni() {
|
|
23
|
+
return ye !== null;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
25
|
+
const je = le("admin-theme", () => {
|
|
26
26
|
const e = E("light"), t = E(["light", "dark"]), n = p(() => e.value === "dark");
|
|
27
27
|
function o(u) {
|
|
28
28
|
e.value = u.theme, t.value = u.availableThemes, i(u.theme);
|
|
@@ -35,12 +35,12 @@ const He = le("admin-theme", () => {
|
|
|
35
35
|
async function l(u) {
|
|
36
36
|
if (!t.value.includes(u))
|
|
37
37
|
throw new Error(`Theme "${u}" is not available`);
|
|
38
|
-
const
|
|
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
|
-
throw a(
|
|
43
|
+
throw a(m), v;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
function i(u) {
|
|
@@ -54,10 +54,10 @@ const He = le("admin-theme", () => {
|
|
|
54
54
|
applyLocal: a,
|
|
55
55
|
setTheme: l
|
|
56
56
|
};
|
|
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() {
|
|
@@ -74,10 +74,10 @@ const He = le("admin-theme", () => {
|
|
|
74
74
|
d("span", {
|
|
75
75
|
class: "admin-topbar__icon",
|
|
76
76
|
"data-icon": o.value
|
|
77
|
-
}, null, 8,
|
|
78
|
-
], 8,
|
|
77
|
+
}, null, 8, ln)
|
|
78
|
+
], 8, an));
|
|
79
79
|
}
|
|
80
|
-
}),
|
|
80
|
+
}), Ge = le("admin-locale", () => {
|
|
81
81
|
const e = E("ru"), t = E(["ru", "en"]);
|
|
82
82
|
function n(i) {
|
|
83
83
|
e.value = i.locale, t.value = i.availableLocales, l(i.locale);
|
|
@@ -93,15 +93,15 @@ const He = le("admin-theme", () => {
|
|
|
93
93
|
const u = e.value;
|
|
94
94
|
o(i);
|
|
95
95
|
try {
|
|
96
|
-
await
|
|
97
|
-
} catch (
|
|
98
|
-
throw o(u),
|
|
96
|
+
await K().post("/system/setLocale", { locale: i });
|
|
97
|
+
} catch (m) {
|
|
98
|
+
throw o(u), m;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
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
|
}
|
|
@@ -112,21 +112,21 @@ const He = le("admin-theme", () => {
|
|
|
112
112
|
applyLocal: o,
|
|
113
113
|
setLocale: a
|
|
114
114
|
};
|
|
115
|
-
}),
|
|
115
|
+
}), sn = {
|
|
116
116
|
type: "button",
|
|
117
117
|
class: "admin-topbar__icon-btn",
|
|
118
118
|
style: { width: "auto", padding: "0 8px", gap: "4px", "font-size": "12px" },
|
|
119
119
|
"aria-label": "Сменить локаль"
|
|
120
|
-
},
|
|
120
|
+
}, pt = /* @__PURE__ */ P({
|
|
121
121
|
__name: "LocaleSwitcher",
|
|
122
122
|
setup(e) {
|
|
123
|
-
const t =
|
|
123
|
+
const t = Ge();
|
|
124
124
|
async function n(o) {
|
|
125
125
|
o !== t.current && await t.setLocale(o);
|
|
126
126
|
}
|
|
127
|
-
return (o, a) => (s(),
|
|
128
|
-
trigger:
|
|
129
|
-
d("button",
|
|
127
|
+
return (o, a) => (s(), b(r(rt), null, {
|
|
128
|
+
trigger: f(() => [
|
|
129
|
+
d("button", sn, [
|
|
130
130
|
a[0] || (a[0] = d("span", {
|
|
131
131
|
class: "admin-topbar__icon",
|
|
132
132
|
"data-icon": "globe"
|
|
@@ -134,12 +134,12 @@ const He = le("admin-theme", () => {
|
|
|
134
134
|
d("span", null, h((r(t).current ?? "").toUpperCase()), 1)
|
|
135
135
|
])
|
|
136
136
|
]),
|
|
137
|
-
default:
|
|
138
|
-
(s(!0), c(T, null,
|
|
137
|
+
default: f(() => [
|
|
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
|
-
default:
|
|
142
|
+
default: f(() => [
|
|
143
143
|
C(h(l.toUpperCase()), 1)
|
|
144
144
|
]),
|
|
145
145
|
_: 2
|
|
@@ -148,7 +148,7 @@ const He = le("admin-theme", () => {
|
|
|
148
148
|
_: 1
|
|
149
149
|
}));
|
|
150
150
|
}
|
|
151
|
-
}),
|
|
151
|
+
}), He = le("admin-notifications", () => {
|
|
152
152
|
const e = E([]), t = E(0), n = E(!1), o = E("all"), a = E(null), l = p(() => t.value > 0);
|
|
153
153
|
function i(R) {
|
|
154
154
|
t.value = R.unread_notifications_count;
|
|
@@ -156,7 +156,7 @@ const He = le("admin-theme", () => {
|
|
|
156
156
|
async function u(R = "all", A = 1) {
|
|
157
157
|
n.value = !0;
|
|
158
158
|
try {
|
|
159
|
-
const g = await
|
|
159
|
+
const g = await K().get(`/notifications/list?type=${R}&page=${A}`);
|
|
160
160
|
e.value = g.data, t.value = g.meta.unread_count, a.value = {
|
|
161
161
|
page: g.meta.page,
|
|
162
162
|
per_page: g.meta.per_page,
|
|
@@ -167,26 +167,26 @@ const He = le("admin-theme", () => {
|
|
|
167
167
|
n.value = !1;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
async function
|
|
171
|
-
const A = await
|
|
170
|
+
async function m() {
|
|
171
|
+
const A = await K().get(
|
|
172
172
|
"/notifications/unread"
|
|
173
173
|
);
|
|
174
174
|
t.value = A.count, o.value === "unread" && (e.value = A.data);
|
|
175
175
|
}
|
|
176
176
|
async function v(R) {
|
|
177
|
-
await
|
|
177
|
+
await K().post("/notifications/markAsRead", { id: R });
|
|
178
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
|
-
async function
|
|
182
|
-
await
|
|
181
|
+
async function y() {
|
|
182
|
+
await K().post("/notifications/markAllAsRead");
|
|
183
183
|
const A = (/* @__PURE__ */ new Date()).toISOString();
|
|
184
184
|
for (const _ of e.value)
|
|
185
185
|
_.read_at === null && (_.read_at = A);
|
|
186
186
|
t.value = 0;
|
|
187
187
|
}
|
|
188
188
|
async function S(R) {
|
|
189
|
-
await
|
|
189
|
+
await K().post("/notifications/destroy", { id: R });
|
|
190
190
|
const _ = e.value.findIndex((g) => g.id === R);
|
|
191
191
|
if (_ !== -1) {
|
|
192
192
|
const g = e.value[_].read_at === null;
|
|
@@ -202,24 +202,24 @@ const He = le("admin-theme", () => {
|
|
|
202
202
|
hasUnread: l,
|
|
203
203
|
hydrate: i,
|
|
204
204
|
load: u,
|
|
205
|
-
loadUnread:
|
|
205
|
+
loadUnread: m,
|
|
206
206
|
markAsRead: v,
|
|
207
|
-
markAllAsRead:
|
|
207
|
+
markAllAsRead: y,
|
|
208
208
|
destroy: S
|
|
209
209
|
};
|
|
210
|
-
}),
|
|
210
|
+
}), on = ["title"], rn = /* @__PURE__ */ P({
|
|
211
211
|
__name: "NotificationBell",
|
|
212
212
|
setup(e) {
|
|
213
|
-
const t =
|
|
213
|
+
const t = He(), n = p(() => {
|
|
214
214
|
const o = t.unreadCount;
|
|
215
215
|
return o <= 0 ? null : o > 99 ? "99+" : String(o);
|
|
216
216
|
});
|
|
217
|
-
return (o, a) => (s(),
|
|
217
|
+
return (o, a) => (s(), b(r(Lt), {
|
|
218
218
|
to: "/notifications",
|
|
219
219
|
class: "admin-topbar__icon-btn",
|
|
220
220
|
"aria-label": "Уведомления"
|
|
221
221
|
}, {
|
|
222
|
-
default:
|
|
222
|
+
default: f(() => [
|
|
223
223
|
a[0] || (a[0] = d("span", {
|
|
224
224
|
class: "admin-topbar__icon",
|
|
225
225
|
"data-icon": "bell"
|
|
@@ -228,13 +228,13 @@ const He = le("admin-theme", () => {
|
|
|
228
228
|
key: 0,
|
|
229
229
|
class: "admin-topbar__bell-badge",
|
|
230
230
|
title: `Непрочитанных: ${r(t).unreadCount}`
|
|
231
|
-
}, h(n.value), 9,
|
|
231
|
+
}, h(n.value), 9, on)) : F("", !0)
|
|
232
232
|
]),
|
|
233
233
|
_: 1
|
|
234
234
|
}));
|
|
235
235
|
}
|
|
236
236
|
});
|
|
237
|
-
class
|
|
237
|
+
class Z extends Error {
|
|
238
238
|
status;
|
|
239
239
|
errorKey;
|
|
240
240
|
payload;
|
|
@@ -242,22 +242,22 @@ class ee extends Error {
|
|
|
242
242
|
super(n.message ?? `API error ${t}`), this.name = "ApiError", this.status = t, this.errorKey = n.errorKey ?? "unknown", this.payload = n;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
class
|
|
245
|
+
class gt extends Z {
|
|
246
246
|
constructor(t) {
|
|
247
247
|
super(401, t), this.name = "UnauthenticatedError";
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
class
|
|
250
|
+
class un extends Z {
|
|
251
251
|
constructor(t) {
|
|
252
252
|
super(403, t), this.name = "ForbiddenError";
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
class
|
|
255
|
+
class dn extends Z {
|
|
256
256
|
constructor(t) {
|
|
257
257
|
super(404, t), this.name = "NotFoundError";
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
class Pe extends
|
|
260
|
+
class Pe extends Z {
|
|
261
261
|
/** Field-keyed map of error messages. */
|
|
262
262
|
fields;
|
|
263
263
|
constructor(t) {
|
|
@@ -276,18 +276,18 @@ class Te extends Error {
|
|
|
276
276
|
super(t), this.name = "NetworkError";
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Ye(e, t) {
|
|
280
280
|
switch (e) {
|
|
281
281
|
case 401:
|
|
282
|
-
return new
|
|
282
|
+
return new gt(t);
|
|
283
283
|
case 403:
|
|
284
|
-
return new rn(t);
|
|
285
|
-
case 404:
|
|
286
284
|
return new un(t);
|
|
285
|
+
case 404:
|
|
286
|
+
return new dn(t);
|
|
287
287
|
case 422:
|
|
288
288
|
return new Pe(t);
|
|
289
289
|
default:
|
|
290
|
-
return new
|
|
290
|
+
return new Z(e, t);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
const Y = le("admin-auth", () => {
|
|
@@ -305,11 +305,11 @@ const Y = le("admin-auth", () => {
|
|
|
305
305
|
function u(_) {
|
|
306
306
|
return _.some(i);
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function m(_) {
|
|
309
309
|
return _.every(i);
|
|
310
310
|
}
|
|
311
311
|
async function v(_) {
|
|
312
|
-
const g =
|
|
312
|
+
const g = K();
|
|
313
313
|
try {
|
|
314
314
|
const U = await g.post(
|
|
315
315
|
"/auth/login",
|
|
@@ -317,20 +317,20 @@ const Y = le("admin-auth", () => {
|
|
|
317
317
|
);
|
|
318
318
|
return U?.user && (e.value = U.user), Array.isArray(U?.permissions) && (t.value = U.permissions), n.value = null, "authenticated";
|
|
319
319
|
} catch (U) {
|
|
320
|
-
if (U instanceof
|
|
321
|
-
const
|
|
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
327
|
throw U;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
async function
|
|
330
|
+
async function y(_) {
|
|
331
331
|
if (n.value === null)
|
|
332
332
|
throw new Error("No pending 2FA challenge");
|
|
333
|
-
const U = await
|
|
333
|
+
const U = await K().post("/auth/twoFactorChallenge", {
|
|
334
334
|
challenge_token: n.value.challengeToken,
|
|
335
335
|
code: _
|
|
336
336
|
});
|
|
@@ -339,7 +339,7 @@ const Y = le("admin-auth", () => {
|
|
|
339
339
|
async function S(_) {
|
|
340
340
|
if (n.value === null)
|
|
341
341
|
throw new Error("No pending 2FA challenge");
|
|
342
|
-
const U = await
|
|
342
|
+
const U = await K().post("/auth/twoFactorRecovery", {
|
|
343
343
|
challenge_token: n.value.challengeToken,
|
|
344
344
|
recovery_code: _
|
|
345
345
|
});
|
|
@@ -349,7 +349,7 @@ const Y = le("admin-auth", () => {
|
|
|
349
349
|
n.value = null;
|
|
350
350
|
}
|
|
351
351
|
async function A() {
|
|
352
|
-
const _ =
|
|
352
|
+
const _ = K();
|
|
353
353
|
try {
|
|
354
354
|
await _.post("/auth/logout");
|
|
355
355
|
} finally {
|
|
@@ -368,20 +368,20 @@ const Y = le("admin-auth", () => {
|
|
|
368
368
|
hydrate: l,
|
|
369
369
|
hasPermission: i,
|
|
370
370
|
hasAnyPermission: u,
|
|
371
|
-
hasAllPermissions:
|
|
371
|
+
hasAllPermissions: m,
|
|
372
372
|
login: v,
|
|
373
|
-
twoFactorChallenge:
|
|
373
|
+
twoFactorChallenge: y,
|
|
374
374
|
twoFactorRecovery: S,
|
|
375
375
|
cancelChallenge: R,
|
|
376
376
|
logout: A
|
|
377
377
|
};
|
|
378
|
-
}),
|
|
378
|
+
}), cn = {
|
|
379
379
|
type: "button",
|
|
380
380
|
class: "admin-topbar__icon-btn admin-user-menu__trigger",
|
|
381
381
|
"aria-label": "Меню пользователя",
|
|
382
382
|
"aria-haspopup": "menu",
|
|
383
383
|
style: { width: "auto", padding: "0 4px", gap: "8px" }
|
|
384
|
-
},
|
|
384
|
+
}, mn = /* @__PURE__ */ P({
|
|
385
385
|
__name: "UserMenu",
|
|
386
386
|
setup(e) {
|
|
387
387
|
const t = Y(), n = se();
|
|
@@ -395,9 +395,9 @@ const Y = le("admin-auth", () => {
|
|
|
395
395
|
function a() {
|
|
396
396
|
n.push({ name: "admin.profile" });
|
|
397
397
|
}
|
|
398
|
-
return (l, i) => (s(),
|
|
399
|
-
trigger:
|
|
400
|
-
d("button",
|
|
398
|
+
return (l, i) => (s(), b(r(rt), null, {
|
|
399
|
+
trigger: f(() => [
|
|
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 ?? "?",
|
|
@@ -406,19 +406,19 @@ const Y = le("admin-auth", () => {
|
|
|
406
406
|
}, null, 8, ["src", "name", "alt"])
|
|
407
407
|
])
|
|
408
408
|
]),
|
|
409
|
-
default:
|
|
410
|
-
x(r(
|
|
411
|
-
default:
|
|
409
|
+
default: f(() => [
|
|
410
|
+
x(r(qe), { onClick: a }, {
|
|
411
|
+
default: f(() => [...i[0] || (i[0] = [
|
|
412
412
|
C("Профиль", -1)
|
|
413
413
|
])]),
|
|
414
414
|
_: 1
|
|
415
415
|
}),
|
|
416
|
-
x(r(
|
|
417
|
-
x(r(
|
|
416
|
+
x(r(Tt)),
|
|
417
|
+
x(r(qe), {
|
|
418
418
|
variant: "danger",
|
|
419
419
|
onClick: o
|
|
420
420
|
}, {
|
|
421
|
-
default:
|
|
421
|
+
default: f(() => [...i[1] || (i[1] = [
|
|
422
422
|
C("Выйти", -1)
|
|
423
423
|
])]),
|
|
424
424
|
_: 1
|
|
@@ -427,10 +427,10 @@ const Y = le("admin-auth", () => {
|
|
|
427
427
|
_: 1
|
|
428
428
|
}));
|
|
429
429
|
}
|
|
430
|
-
}),
|
|
430
|
+
}), fn = { class: "admin-topbar" }, vn = { class: "admin-topbar__breadcrumbs" }, pn = {
|
|
431
431
|
key: 0,
|
|
432
432
|
class: "sep"
|
|
433
|
-
},
|
|
433
|
+
}, gn = /* @__PURE__ */ P({
|
|
434
434
|
__name: "AdminTopBar",
|
|
435
435
|
props: {
|
|
436
436
|
breadcrumbs: { default: () => [] },
|
|
@@ -439,7 +439,7 @@ const Y = le("admin-auth", () => {
|
|
|
439
439
|
emits: ["toggle-sidebar"],
|
|
440
440
|
setup(e, { emit: t }) {
|
|
441
441
|
const n = e, o = t, a = p(() => n.breadcrumbs.length - 1);
|
|
442
|
-
return (l, i) => (s(), c("header",
|
|
442
|
+
return (l, i) => (s(), c("header", fn, [
|
|
443
443
|
e.showCollapseToggle ? (s(), c("button", {
|
|
444
444
|
key: 0,
|
|
445
445
|
type: "button",
|
|
@@ -452,15 +452,15 @@ const Y = le("admin-auth", () => {
|
|
|
452
452
|
"data-icon": "panel-left"
|
|
453
453
|
}, null, -1)
|
|
454
454
|
])])) : F("", !0),
|
|
455
|
-
d("div",
|
|
455
|
+
d("div", vn, [
|
|
456
456
|
X(l.$slots, "breadcrumbs", {}, () => [
|
|
457
|
-
(s(!0), c(T, null,
|
|
458
|
-
|
|
459
|
-
(s(),
|
|
457
|
+
(s(!0), c(T, null, I(e.breadcrumbs, (u, m) => (s(), c(T, { key: m }, [
|
|
458
|
+
m > 0 ? (s(), c("span", pn, "›")) : F("", !0),
|
|
459
|
+
(s(), b(de(u.to ? "a" : "span"), {
|
|
460
460
|
href: typeof u.to == "string" ? u.to : void 0,
|
|
461
|
-
class:
|
|
461
|
+
class: ne(m === a.value ? "cur" : "")
|
|
462
462
|
}, {
|
|
463
|
-
default:
|
|
463
|
+
default: f(() => [
|
|
464
464
|
C(h(u.label), 1)
|
|
465
465
|
]),
|
|
466
466
|
_: 2
|
|
@@ -484,43 +484,43 @@ const Y = le("admin-auth", () => {
|
|
|
484
484
|
], -1))
|
|
485
485
|
]),
|
|
486
486
|
X(l.$slots, "actions"),
|
|
487
|
-
x(
|
|
488
|
-
x(ft),
|
|
487
|
+
x(rn),
|
|
489
488
|
x(vt),
|
|
490
|
-
x(
|
|
489
|
+
x(pt),
|
|
490
|
+
x(mn)
|
|
491
491
|
]));
|
|
492
492
|
}
|
|
493
|
-
}),
|
|
493
|
+
}), ht = le("admin-menu", () => {
|
|
494
494
|
const e = E([]), t = E(!1), n = E(null), o = E(!1), a = p(() => {
|
|
495
|
-
const v = Y(),
|
|
495
|
+
const v = Y(), y = (S) => {
|
|
496
496
|
if (Array.isArray(S.permissions) && S.permissions.length > 0 && !v.hasAnyPermission(S.permissions))
|
|
497
497
|
return null;
|
|
498
|
-
const R = (S.children ?? []).map(
|
|
498
|
+
const R = (S.children ?? []).map(y).filter((A) => A !== null);
|
|
499
499
|
return { ...S, children: R };
|
|
500
500
|
};
|
|
501
|
-
return e.value.map(
|
|
501
|
+
return e.value.map(y).filter((S) => S !== null);
|
|
502
502
|
}), l = p(() => {
|
|
503
503
|
const v = /* @__PURE__ */ new Map();
|
|
504
504
|
for (const S of a.value) {
|
|
505
505
|
const R = S.group ?? null;
|
|
506
506
|
v.has(R) || v.set(R, []), v.get(R).push(S);
|
|
507
507
|
}
|
|
508
|
-
const
|
|
508
|
+
const y = [];
|
|
509
509
|
for (const [S, R] of v)
|
|
510
510
|
R.sort((A, _) => {
|
|
511
511
|
const g = (A.order ?? 0) - (_.order ?? 0);
|
|
512
512
|
return g !== 0 ? g : A.label.localeCompare(_.label);
|
|
513
|
-
}),
|
|
514
|
-
return
|
|
513
|
+
}), y.push({ group: S, items: R });
|
|
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 S = await
|
|
520
|
+
const S = await K().get("/system/menu");
|
|
521
521
|
return e.value = Array.isArray(S.items) ? S.items : [], o.value = !0, e.value;
|
|
522
|
-
} catch (
|
|
523
|
-
throw n.value =
|
|
522
|
+
} catch (y) {
|
|
523
|
+
throw n.value = y instanceof Error ? y : new Error(String(y)), y;
|
|
524
524
|
} finally {
|
|
525
525
|
t.value = !1;
|
|
526
526
|
}
|
|
@@ -528,7 +528,7 @@ const Y = le("admin-auth", () => {
|
|
|
528
528
|
function u(v) {
|
|
529
529
|
e.value = v, o.value = !0, n.value = null;
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function m() {
|
|
532
532
|
e.value = [], o.value = !1, n.value = null, t.value = !1;
|
|
533
533
|
}
|
|
534
534
|
return {
|
|
@@ -540,18 +540,18 @@ const Y = le("admin-auth", () => {
|
|
|
540
540
|
groupedItems: l,
|
|
541
541
|
load: i,
|
|
542
542
|
setItems: u,
|
|
543
|
-
reset:
|
|
543
|
+
reset: m
|
|
544
544
|
};
|
|
545
|
-
}),
|
|
545
|
+
}), hn = { class: "admin-sidebar-brand" }, _n = { class: "admin-sidebar-brand__mark" }, yn = {
|
|
546
546
|
key: 0,
|
|
547
547
|
class: "admin-sidebar-brand__name"
|
|
548
|
-
},
|
|
548
|
+
}, bn = {
|
|
549
549
|
key: 0,
|
|
550
550
|
class: "admin-sidebar-tenant"
|
|
551
|
-
},
|
|
551
|
+
}, kn = { class: "admin-sidebar-foot" }, wn = {
|
|
552
552
|
key: 0,
|
|
553
553
|
class: "admin-sidebar-foot__text"
|
|
554
|
-
},
|
|
554
|
+
}, $n = ["href"], xn = /* @__PURE__ */ P({
|
|
555
555
|
__name: "AdminSidebar",
|
|
556
556
|
props: {
|
|
557
557
|
collapsed: { type: Boolean, default: !1 },
|
|
@@ -562,50 +562,50 @@ const Y = le("admin-auth", () => {
|
|
|
562
562
|
docsUrl: { default: null }
|
|
563
563
|
},
|
|
564
564
|
setup(e) {
|
|
565
|
-
const t =
|
|
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
|
}
|
|
569
569
|
function l(u) {
|
|
570
570
|
if (u)
|
|
571
|
-
return () =>
|
|
571
|
+
return () => Ct("span", { class: "admin-sidebar__icon", "data-icon": u });
|
|
572
572
|
}
|
|
573
573
|
function i(u) {
|
|
574
574
|
if (u.url) return u.url;
|
|
575
575
|
if (u.routeName) return { name: u.routeName };
|
|
576
576
|
}
|
|
577
|
-
return (u,
|
|
578
|
-
header:
|
|
579
|
-
d("div",
|
|
580
|
-
d("div",
|
|
581
|
-
e.collapsed ? F("", !0) : (s(), c("div",
|
|
577
|
+
return (u, m) => (s(), b(r(Mt), { collapsed: e.collapsed }, De({
|
|
578
|
+
header: f(() => [
|
|
579
|
+
d("div", hn, [
|
|
580
|
+
d("div", _n, h(e.brandMark), 1),
|
|
581
|
+
e.collapsed ? F("", !0) : (s(), c("div", yn, h(e.brandName), 1))
|
|
582
582
|
]),
|
|
583
|
-
e.tenant && !e.collapsed ? (s(), c("div",
|
|
583
|
+
e.tenant && !e.collapsed ? (s(), c("div", bn, [
|
|
584
584
|
d("span", null, h(e.tenant.label), 1),
|
|
585
585
|
d("b", null, h(e.tenant.name), 1)
|
|
586
586
|
])) : F("", !0)
|
|
587
587
|
]),
|
|
588
|
-
nav:
|
|
589
|
-
(s(!0), c(T, null,
|
|
590
|
-
key: `grp-${
|
|
588
|
+
nav: f(() => [
|
|
589
|
+
(s(!0), c(T, null, I(o.value, (v, y) => (s(), b(r(Nt), {
|
|
590
|
+
key: `grp-${y}`,
|
|
591
591
|
title: v.group ?? void 0
|
|
592
592
|
}, {
|
|
593
|
-
default:
|
|
594
|
-
(s(!0), c(T, null,
|
|
593
|
+
default: f(() => [
|
|
594
|
+
(s(!0), c(T, null, I(v.items, (S) => (s(), b(r(Bt), {
|
|
595
595
|
key: S.key,
|
|
596
596
|
to: i(S),
|
|
597
597
|
active: a(S),
|
|
598
598
|
badge: S.badge ?? void 0
|
|
599
599
|
}, De({
|
|
600
|
-
default:
|
|
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
|
-
fn:
|
|
608
|
-
(s(),
|
|
607
|
+
fn: f(() => [
|
|
608
|
+
(s(), b(de(l(S.icon))))
|
|
609
609
|
]),
|
|
610
610
|
key: "0"
|
|
611
611
|
} : void 0
|
|
@@ -618,25 +618,25 @@ const Y = le("admin-auth", () => {
|
|
|
618
618
|
}, [
|
|
619
619
|
e.version || e.docsUrl ? {
|
|
620
620
|
name: "footer",
|
|
621
|
-
fn:
|
|
622
|
-
d("div",
|
|
623
|
-
e.version ? (s(), c("span",
|
|
621
|
+
fn: f(() => [
|
|
622
|
+
d("div", kn, [
|
|
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,
|
|
628
|
+
}, " Docs ", 8, $n)) : F("", !0)
|
|
629
629
|
])
|
|
630
630
|
]),
|
|
631
631
|
key: "0"
|
|
632
632
|
} : void 0
|
|
633
633
|
]), 1032, ["collapsed"]));
|
|
634
634
|
}
|
|
635
|
-
}),
|
|
635
|
+
}), Cn = { class: "admin-shell-root" }, Sn = {
|
|
636
636
|
key: 0,
|
|
637
637
|
class: "admin-impersonation-banner",
|
|
638
638
|
role: "status"
|
|
639
|
-
},
|
|
639
|
+
}, Ie = "data-admin-impersonating", An = /* @__PURE__ */ P({
|
|
640
640
|
__name: "AdminShell",
|
|
641
641
|
props: {
|
|
642
642
|
collapsed: { type: Boolean, default: !1 },
|
|
@@ -654,13 +654,13 @@ const Y = le("admin-auth", () => {
|
|
|
654
654
|
return ae(
|
|
655
655
|
() => n.impersonation,
|
|
656
656
|
(i) => {
|
|
657
|
-
typeof document > "u" || (i !== null ? document.documentElement.setAttribute(
|
|
657
|
+
typeof document > "u" || (i !== null ? document.documentElement.setAttribute(Ie, "true") : document.documentElement.removeAttribute(Ie));
|
|
658
658
|
},
|
|
659
659
|
{ immediate: !0 }
|
|
660
|
-
),
|
|
661
|
-
typeof document < "u" && document.documentElement.removeAttribute(
|
|
662
|
-
}), (i, u) => (s(), c("div",
|
|
663
|
-
e.impersonation ? (s(), c("div",
|
|
660
|
+
), St(() => {
|
|
661
|
+
typeof document < "u" && document.documentElement.removeAttribute(Ie);
|
|
662
|
+
}), (i, u) => (s(), c("div", Cn, [
|
|
663
|
+
e.impersonation ? (s(), c("div", Sn, [
|
|
664
664
|
d("span", null, [
|
|
665
665
|
u[1] || (u[1] = C(" Вы вошли как ", -1)),
|
|
666
666
|
d("b", null, h(e.impersonation.asName), 1),
|
|
@@ -676,45 +676,45 @@ const Y = le("admin-auth", () => {
|
|
|
676
676
|
"model-value": e.collapsed,
|
|
677
677
|
"onUpdate:modelValue": a
|
|
678
678
|
}, {
|
|
679
|
-
sidebar:
|
|
679
|
+
sidebar: f(() => [
|
|
680
680
|
X(i.$slots, "sidebar", {}, () => [
|
|
681
|
-
x(
|
|
681
|
+
x(xn, { collapsed: e.collapsed }, null, 8, ["collapsed"])
|
|
682
682
|
])
|
|
683
683
|
]),
|
|
684
|
-
header:
|
|
684
|
+
header: f(() => [
|
|
685
685
|
X(i.$slots, "topbar", {}, () => [
|
|
686
|
-
x(
|
|
687
|
-
onToggleSidebar: u[0] || (u[0] = (
|
|
686
|
+
x(gn, {
|
|
687
|
+
onToggleSidebar: u[0] || (u[0] = (m) => a(!e.collapsed))
|
|
688
688
|
})
|
|
689
689
|
])
|
|
690
690
|
]),
|
|
691
|
-
default:
|
|
691
|
+
default: f(() => [
|
|
692
692
|
X(i.$slots, "default")
|
|
693
693
|
]),
|
|
694
694
|
_: 3
|
|
695
695
|
}, 8, ["model-value"])
|
|
696
696
|
]));
|
|
697
697
|
}
|
|
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
|
-
const l =
|
|
704
|
-
return n.value ? (s(),
|
|
705
|
-
default:
|
|
703
|
+
const l = lt("router-view");
|
|
704
|
+
return n.value ? (s(), b(An, { key: 0 }, {
|
|
705
|
+
default: f(() => [
|
|
706
706
|
x(l)
|
|
707
707
|
]),
|
|
708
708
|
_: 1
|
|
709
|
-
})) : (s(),
|
|
709
|
+
})) : (s(), b(l, { key: 1 }));
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
712
|
}), ie = le("admin-manifest", () => {
|
|
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 ?? []),
|
|
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
715
|
return l.value.find((g) => g.slug === _) ?? null;
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function y(_) {
|
|
718
718
|
return i.value.find((g) => g.slug === _) ?? null;
|
|
719
719
|
}
|
|
720
720
|
function S(_) {
|
|
@@ -725,7 +725,7 @@ const Y = le("admin-auth", () => {
|
|
|
725
725
|
return e.value;
|
|
726
726
|
t.value = !0, n.value = null;
|
|
727
727
|
try {
|
|
728
|
-
const U = await
|
|
728
|
+
const U = await K().get("/system/manifest");
|
|
729
729
|
return e.value = U, U;
|
|
730
730
|
} catch (g) {
|
|
731
731
|
throw n.value = g instanceof Error ? g : new Error(String(g)), g;
|
|
@@ -747,68 +747,68 @@ const Y = le("admin-auth", () => {
|
|
|
747
747
|
resources: l,
|
|
748
748
|
screens: i,
|
|
749
749
|
settings: u,
|
|
750
|
-
plugins:
|
|
750
|
+
plugins: m,
|
|
751
751
|
// actions
|
|
752
752
|
getResource: v,
|
|
753
|
-
getScreen:
|
|
753
|
+
getScreen: y,
|
|
754
754
|
getSettings: S,
|
|
755
755
|
load: R,
|
|
756
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
|
-
x(r(
|
|
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
|
-
default:
|
|
771
|
-
d("h1",
|
|
770
|
+
default: f(() => [
|
|
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
|
|
775
775
|
}),
|
|
776
|
-
l.value.length ? (s(), c("section",
|
|
776
|
+
l.value.length ? (s(), c("section", Fn, [
|
|
777
777
|
u[1] || (u[1] = d("h2", { class: "admin-home__heading" }, "Ресурсы", -1)),
|
|
778
|
-
d("ul",
|
|
779
|
-
(s(!0), c(T, null,
|
|
780
|
-
key:
|
|
778
|
+
d("ul", Ln, [
|
|
779
|
+
(s(!0), c(T, null, I(l.value, (m) => (s(), c("li", {
|
|
780
|
+
key: m.slug
|
|
781
781
|
}, [
|
|
782
782
|
d("button", {
|
|
783
783
|
type: "button",
|
|
784
784
|
class: "admin-home__card",
|
|
785
|
-
onClick: (v) => r(o).push({ name: `admin.resource.${
|
|
785
|
+
onClick: (v) => r(o).push({ name: `admin.resource.${m.slug}.index` })
|
|
786
786
|
}, [
|
|
787
|
-
d("span",
|
|
788
|
-
d("span",
|
|
789
|
-
], 8,
|
|
787
|
+
d("span", Tn, h(m.label), 1),
|
|
788
|
+
d("span", Mn, h(m.slug), 1)
|
|
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({
|
|
796
796
|
__name: "ForbiddenPage",
|
|
797
797
|
setup(e) {
|
|
798
798
|
const t = se();
|
|
799
|
-
return (n, o) => (s(), c("div",
|
|
800
|
-
x(r(
|
|
799
|
+
return (n, o) => (s(), c("div", Bn, [
|
|
800
|
+
x(r(q), {
|
|
801
801
|
padding: "lg",
|
|
802
802
|
class: "admin-status-page__card"
|
|
803
803
|
}, {
|
|
804
|
-
default:
|
|
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
|
-
default:
|
|
811
|
+
default: f(() => [...o[1] || (o[1] = [
|
|
812
812
|
C(" На главную ", -1)
|
|
813
813
|
])]),
|
|
814
814
|
_: 1
|
|
@@ -818,23 +818,23 @@ const Y = le("admin-auth", () => {
|
|
|
818
818
|
})
|
|
819
819
|
]));
|
|
820
820
|
}
|
|
821
|
-
}),
|
|
821
|
+
}), Vn = { class: "admin-status-page" }, zn = /* @__PURE__ */ P({
|
|
822
822
|
__name: "NotFoundPage",
|
|
823
823
|
setup(e) {
|
|
824
824
|
const t = se();
|
|
825
|
-
return (n, o) => (s(), c("div",
|
|
826
|
-
x(r(
|
|
825
|
+
return (n, o) => (s(), c("div", Vn, [
|
|
826
|
+
x(r(q), {
|
|
827
827
|
padding: "lg",
|
|
828
828
|
class: "admin-status-page__card"
|
|
829
829
|
}, {
|
|
830
|
-
default:
|
|
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
|
-
default:
|
|
837
|
+
default: f(() => [...o[1] || (o[1] = [
|
|
838
838
|
C(" На главную ", -1)
|
|
839
839
|
])]),
|
|
840
840
|
_: 1
|
|
@@ -844,38 +844,38 @@ 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
|
-
x(r(
|
|
859
|
-
default:
|
|
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
|
+
default: f(() => [
|
|
860
860
|
d("h1", qn, h(a.value?.label ?? o.value), 1),
|
|
861
|
-
a.value ? (s(), c("pre",
|
|
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
|
-
}), jn = { class: "admin-status-page" },
|
|
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 =
|
|
870
|
+
const t = be(), n = p(() => String(t.params.slug ?? "")), o = p(() => String(t.meta?.title ?? n.value));
|
|
871
871
|
return (a, l) => (s(), c("div", jn, [
|
|
872
|
-
x(r(
|
|
872
|
+
x(r(q), {
|
|
873
873
|
padding: "lg",
|
|
874
874
|
class: "admin-status-page__card"
|
|
875
875
|
}, {
|
|
876
|
-
default:
|
|
877
|
-
d("h1",
|
|
878
|
-
d("p",
|
|
876
|
+
default: f(() => [
|
|
877
|
+
d("h1", Gn, h(o.value), 1),
|
|
878
|
+
d("p", Hn, [
|
|
879
879
|
C(" Это заглушка для screen «" + h(n.value) + "». Передайте свой компонент через ", 1),
|
|
880
880
|
l[0] || (l[0] = d("code", null, "createAdminApp(" + h("{") + " pages: " + h("{") + " screen: MyScreen " + h("}") + " " + h("}") + ")", -1)),
|
|
881
881
|
l[1] || (l[1] = C(". ", -1))
|
|
@@ -885,10 +885,10 @@ const Y = le("admin-auth", () => {
|
|
|
885
885
|
})
|
|
886
886
|
]));
|
|
887
887
|
}
|
|
888
|
-
}),
|
|
888
|
+
}), Jn = { class: "admin-auth-card__row" }, Yn = ["href"], Qn = {
|
|
889
889
|
key: 1,
|
|
890
890
|
style: { "text-align": "center", "font-size": "var(--uid-font-size-xs)", color: "var(--uid-text-secondary)", "padding-top": "4px" }
|
|
891
|
-
},
|
|
891
|
+
}, Zn = ["href"], ea = /* @__PURE__ */ P({
|
|
892
892
|
__name: "LoginForm",
|
|
893
893
|
props: {
|
|
894
894
|
forgotUrl: { default: null },
|
|
@@ -897,10 +897,10 @@ const Y = le("admin-auth", () => {
|
|
|
897
897
|
},
|
|
898
898
|
emits: ["success"],
|
|
899
899
|
setup(e, { emit: t }) {
|
|
900
|
-
const n = t, o = Y(), a = E(""), l = E(""), i = E(!1), u = E(!1),
|
|
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
|
-
u.value = !0,
|
|
903
|
+
u.value = !0, m.value = null, v.value = {};
|
|
904
904
|
try {
|
|
905
905
|
const A = await o.login({
|
|
906
906
|
email: a.value,
|
|
@@ -909,7 +909,7 @@ const Y = le("admin-auth", () => {
|
|
|
909
909
|
});
|
|
910
910
|
n("success", A);
|
|
911
911
|
} catch (A) {
|
|
912
|
-
A instanceof Pe ? (v.value = A.fields,
|
|
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
|
}
|
|
@@ -918,16 +918,16 @@ const Y = le("admin-auth", () => {
|
|
|
918
918
|
return (A, _) => (s(), c("form", {
|
|
919
919
|
class: "admin-auth-card__bd",
|
|
920
920
|
novalidate: "",
|
|
921
|
-
onSubmit:
|
|
921
|
+
onSubmit: st(R, ["prevent"])
|
|
922
922
|
}, [
|
|
923
|
-
|
|
923
|
+
m.value ? (s(), b(r(Q), {
|
|
924
924
|
key: 0,
|
|
925
925
|
variant: "danger",
|
|
926
926
|
class: "admin-auth-card__alert",
|
|
927
927
|
role: "alert"
|
|
928
928
|
}, {
|
|
929
|
-
default:
|
|
930
|
-
C(h(
|
|
929
|
+
default: f(() => [
|
|
930
|
+
C(h(m.value), 1)
|
|
931
931
|
]),
|
|
932
932
|
_: 1
|
|
933
933
|
})) : F("", !0),
|
|
@@ -940,7 +940,7 @@ const Y = le("admin-auth", () => {
|
|
|
940
940
|
autocomplete: "username",
|
|
941
941
|
required: !0,
|
|
942
942
|
disabled: u.value,
|
|
943
|
-
error:
|
|
943
|
+
error: y.value,
|
|
944
944
|
name: "email"
|
|
945
945
|
}, null, 8, ["modelValue", "disabled", "error"]),
|
|
946
946
|
x(r(ue), {
|
|
@@ -954,13 +954,13 @@ const Y = le("admin-auth", () => {
|
|
|
954
954
|
error: S.value,
|
|
955
955
|
name: "password"
|
|
956
956
|
}, null, 8, ["modelValue", "disabled", "error"]),
|
|
957
|
-
d("div",
|
|
958
|
-
x(r(
|
|
957
|
+
d("div", Jn, [
|
|
958
|
+
x(r(dt), {
|
|
959
959
|
modelValue: i.value,
|
|
960
960
|
"onUpdate:modelValue": _[2] || (_[2] = (g) => i.value = g),
|
|
961
961
|
disabled: u.value
|
|
962
962
|
}, {
|
|
963
|
-
default:
|
|
963
|
+
default: f(() => [..._[3] || (_[3] = [
|
|
964
964
|
C(" Запомнить меня ", -1)
|
|
965
965
|
])]),
|
|
966
966
|
_: 1
|
|
@@ -969,7 +969,7 @@ const Y = le("admin-auth", () => {
|
|
|
969
969
|
key: 0,
|
|
970
970
|
href: e.forgotUrl,
|
|
971
971
|
class: "admin-auth-card__link"
|
|
972
|
-
}, " Забыли пароль? ", 8,
|
|
972
|
+
}, " Забыли пароль? ", 8, Yn)) : F("", !0)
|
|
973
973
|
]),
|
|
974
974
|
x(r(V), {
|
|
975
975
|
type: "submit",
|
|
@@ -978,34 +978,34 @@ const Y = le("admin-auth", () => {
|
|
|
978
978
|
loading: u.value,
|
|
979
979
|
disabled: u.value
|
|
980
980
|
}, {
|
|
981
|
-
default:
|
|
981
|
+
default: f(() => [
|
|
982
982
|
C(h(u.value ? "Вход…" : "Войти"), 1)
|
|
983
983
|
]),
|
|
984
984
|
_: 1
|
|
985
985
|
}, 8, ["loading", "disabled"]),
|
|
986
|
-
e.ssoLinkLabel && e.ssoUrl ? (s(), c("div",
|
|
986
|
+
e.ssoLinkLabel && e.ssoUrl ? (s(), c("div", Qn, [
|
|
987
987
|
_[4] || (_[4] = C(" или войдите через ", -1)),
|
|
988
988
|
d("a", {
|
|
989
989
|
href: e.ssoUrl,
|
|
990
990
|
class: "admin-auth-card__link"
|
|
991
|
-
}, h(e.ssoLinkLabel), 9,
|
|
991
|
+
}, h(e.ssoLinkLabel), 9, Zn)
|
|
992
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 = E("totp"), l = E(["", "", "", "", "", ""]), i = E(""), u = E([]),
|
|
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
1000
|
function A($, z) {
|
|
1001
1001
|
z instanceof HTMLInputElement && (u.value[$] = z);
|
|
1002
1002
|
}
|
|
1003
1003
|
function _($, z) {
|
|
1004
1004
|
const G = z.target, O = G.value.replace(/\D/g, "").slice(-1);
|
|
1005
|
-
l.value[$] = O, G.value = O, O && $ < l.value.length - 1 &&
|
|
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
1007
|
function g($, z) {
|
|
1008
|
-
z.key === "Backspace" && !l.value[$] && $ > 0 ?
|
|
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
1010
|
function U($) {
|
|
1011
1011
|
const G = ($.clipboardData?.getData("text") ?? "").replace(/\D/g, "").slice(0, l.value.length);
|
|
@@ -1013,59 +1013,59 @@ const Y = le("admin-auth", () => {
|
|
|
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
|
|
1022
|
-
if (!(
|
|
1023
|
-
|
|
1021
|
+
async function L() {
|
|
1022
|
+
if (!(m.value || !R.value)) {
|
|
1023
|
+
m.value = !0, v.value = null;
|
|
1024
1024
|
try {
|
|
1025
1025
|
if (a.value === "totp")
|
|
1026
1026
|
await o.twoFactorChallenge(S.value);
|
|
1027
1027
|
else {
|
|
1028
1028
|
const $ = await o.twoFactorRecovery(i.value.trim());
|
|
1029
|
-
|
|
1029
|
+
y.value = $.remaining;
|
|
1030
1030
|
}
|
|
1031
1031
|
n("success");
|
|
1032
1032
|
} catch ($) {
|
|
1033
|
-
$ instanceof Pe ? v.value = $.firstFieldMessage() ?? "Неверный код" : $ instanceof Te ? v.value = "Нет соединения с сервером" : $ instanceof
|
|
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
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
1045
|
return ($, z) => (s(), c("form", {
|
|
1046
1046
|
class: "admin-auth-card__bd",
|
|
1047
1047
|
novalidate: "",
|
|
1048
|
-
onSubmit:
|
|
1048
|
+
onSubmit: st(L, ["prevent"])
|
|
1049
1049
|
}, [
|
|
1050
|
-
v.value ? (s(),
|
|
1050
|
+
v.value ? (s(), b(r(Q), {
|
|
1051
1051
|
key: 0,
|
|
1052
1052
|
variant: "danger",
|
|
1053
1053
|
class: "admin-auth-card__alert",
|
|
1054
1054
|
role: "alert"
|
|
1055
1055
|
}, {
|
|
1056
|
-
default:
|
|
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",
|
|
1064
1064
|
class: "admin-auth-card__alert",
|
|
1065
1065
|
role: "status"
|
|
1066
1066
|
}, {
|
|
1067
|
-
default:
|
|
1068
|
-
C(" Использован recovery-код. Осталось: " + h(
|
|
1067
|
+
default: f(() => [
|
|
1068
|
+
C(" Использован recovery-код. Осталось: " + h(y.value), 1)
|
|
1069
1069
|
]),
|
|
1070
1070
|
_: 1
|
|
1071
1071
|
})) : F("", !0),
|
|
@@ -1074,7 +1074,7 @@ const Y = le("admin-auth", () => {
|
|
|
1074
1074
|
class: "admin-code-input",
|
|
1075
1075
|
onPaste: U
|
|
1076
1076
|
}, [
|
|
1077
|
-
(s(!0), c(T, null,
|
|
1077
|
+
(s(!0), c(T, null, I(l.value, (G, O) => (s(), c("input", {
|
|
1078
1078
|
key: O,
|
|
1079
1079
|
ref_for: !0,
|
|
1080
1080
|
ref: (M) => A(O, M),
|
|
@@ -1083,38 +1083,38 @@ const Y = le("admin-auth", () => {
|
|
|
1083
1083
|
inputmode: "numeric",
|
|
1084
1084
|
autocomplete: "one-time-code",
|
|
1085
1085
|
maxlength: "1",
|
|
1086
|
-
disabled:
|
|
1086
|
+
disabled: m.value,
|
|
1087
1087
|
"aria-label": `Цифра ${O + 1}`,
|
|
1088
1088
|
onInput: (M) => _(O, M),
|
|
1089
1089
|
onKeydown: (M) => g(O, M)
|
|
1090
|
-
}, null, 40,
|
|
1091
|
-
], 32)) : (s(),
|
|
1090
|
+
}, null, 40, ta))), 128))
|
|
1091
|
+
], 32)) : (s(), b(r(ue), {
|
|
1092
1092
|
key: 3,
|
|
1093
1093
|
modelValue: i.value,
|
|
1094
1094
|
"onUpdate:modelValue": z[0] || (z[0] = (G) => i.value = G),
|
|
1095
1095
|
type: "text",
|
|
1096
1096
|
label: "Recovery-код",
|
|
1097
1097
|
autocomplete: "one-time-code",
|
|
1098
|
-
disabled:
|
|
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",
|
|
1105
|
-
loading:
|
|
1106
|
-
disabled:
|
|
1105
|
+
loading: m.value,
|
|
1106
|
+
disabled: m.value || !R.value
|
|
1107
1107
|
}, {
|
|
1108
|
-
default:
|
|
1109
|
-
C(h(
|
|
1108
|
+
default: f(() => [
|
|
1109
|
+
C(h(m.value ? "Проверка…" : "Подтвердить"), 1)
|
|
1110
1110
|
]),
|
|
1111
1111
|
_: 1
|
|
1112
1112
|
}, 8, ["loading", "disabled"]),
|
|
1113
|
-
d("div",
|
|
1113
|
+
d("div", na, [
|
|
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-код")
|
|
@@ -1130,13 +1130,13 @@ const Y = le("admin-auth", () => {
|
|
|
1130
1130
|
])
|
|
1131
1131
|
], 32));
|
|
1132
1132
|
}
|
|
1133
|
-
}),
|
|
1133
|
+
}), la = { class: "admin-auth-page" }, sa = {
|
|
1134
1134
|
key: 0,
|
|
1135
1135
|
class: "admin-auth-page__corner"
|
|
1136
|
-
},
|
|
1136
|
+
}, ia = { class: "admin-auth-card__hd" }, oa = ["src", "alt"], ra = {
|
|
1137
1137
|
key: 1,
|
|
1138
1138
|
"aria-hidden": "true"
|
|
1139
|
-
},
|
|
1139
|
+
}, ua = { key: 2 }, da = { class: "admin-auth-card__title" }, ca = { class: "admin-auth-card__sub" }, ma = /* @__PURE__ */ P({
|
|
1140
1140
|
__name: "LoginPage",
|
|
1141
1141
|
props: {
|
|
1142
1142
|
brandName: { default: "Laravel Admin" },
|
|
@@ -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("/")) {
|
|
@@ -1166,34 +1166,34 @@ const Y = le("admin-auth", () => {
|
|
|
1166
1166
|
}
|
|
1167
1167
|
), Ue(() => {
|
|
1168
1168
|
n.isAuthenticated && l();
|
|
1169
|
-
}), (i, u) => (s(), c("div",
|
|
1170
|
-
e.showCornerActions ? (s(), c("div",
|
|
1171
|
-
x(
|
|
1172
|
-
x(
|
|
1169
|
+
}), (i, u) => (s(), c("div", la, [
|
|
1170
|
+
e.showCornerActions ? (s(), c("div", sa, [
|
|
1171
|
+
x(vt),
|
|
1172
|
+
x(pt)
|
|
1173
1173
|
])) : F("", !0),
|
|
1174
|
-
x(r(
|
|
1175
|
-
class:
|
|
1174
|
+
x(r(q), {
|
|
1175
|
+
class: ne(["admin-auth-card", r(n).isChallengePending ? "admin-auth-card--wide" : ""]),
|
|
1176
1176
|
padding: "none"
|
|
1177
1177
|
}, {
|
|
1178
|
-
default:
|
|
1179
|
-
d("div",
|
|
1178
|
+
default: f(() => [
|
|
1179
|
+
d("div", ia, [
|
|
1180
1180
|
d("div", {
|
|
1181
|
-
class:
|
|
1181
|
+
class: ne(["admin-auth-card__logo", r(n).isChallengePending ? "admin-auth-card__logo--accent" : ""])
|
|
1182
1182
|
}, [
|
|
1183
1183
|
e.brandLogo && !r(n).isChallengePending ? (s(), c("img", {
|
|
1184
1184
|
key: 0,
|
|
1185
1185
|
src: e.brandLogo,
|
|
1186
1186
|
alt: e.brandName
|
|
1187
|
-
}, null, 8,
|
|
1187
|
+
}, null, 8, oa)) : r(n).isChallengePending ? (s(), c("span", ra, "🛡")) : (s(), c("span", ua, h(e.brandMark), 1))
|
|
1188
1188
|
], 2),
|
|
1189
|
-
d("div",
|
|
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
|
-
d("div",
|
|
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 }, [
|
|
@@ -1201,13 +1201,13 @@ const Y = le("admin-auth", () => {
|
|
|
1201
1201
|
], 64))
|
|
1202
1202
|
])
|
|
1203
1203
|
]),
|
|
1204
|
-
r(n).isChallengePending ? (s(),
|
|
1204
|
+
r(n).isChallengePending ? (s(), b(aa, {
|
|
1205
1205
|
key: 0,
|
|
1206
1206
|
onSuccess: u[0] || (u[0] = () => {
|
|
1207
1207
|
}),
|
|
1208
1208
|
onCancel: u[1] || (u[1] = () => {
|
|
1209
1209
|
})
|
|
1210
|
-
})) : (s(),
|
|
1210
|
+
})) : (s(), b(ea, {
|
|
1211
1211
|
key: 1,
|
|
1212
1212
|
"forgot-url": e.forgotUrl,
|
|
1213
1213
|
"sso-link-label": e.ssoLinkLabel,
|
|
@@ -1220,78 +1220,78 @@ const Y = le("admin-auth", () => {
|
|
|
1220
1220
|
}, 8, ["class"])
|
|
1221
1221
|
]));
|
|
1222
1222
|
}
|
|
1223
|
-
}),
|
|
1224
|
-
const e = E(null), t = E([]), n = E({ ...
|
|
1223
|
+
}), Qe = { page: 1, per_page: 20, total: 0, last_page: 1 }, fa = le("admin-resource-index", () => {
|
|
1224
|
+
const e = E(null), t = E([]), n = E({ ...Qe }), o = E(!1), a = E(null), l = E(""), i = E({}), u = E(null), 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
1225
|
function g(N) {
|
|
1226
1226
|
return N.id ?? N.key ?? "";
|
|
1227
1227
|
}
|
|
1228
1228
|
function U(N) {
|
|
1229
|
-
e.value !== N && (e.value = N,
|
|
1229
|
+
e.value !== N && (e.value = N, L());
|
|
1230
1230
|
}
|
|
1231
|
-
function
|
|
1232
|
-
t.value = [], n.value = { ...
|
|
1231
|
+
function L() {
|
|
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
1234
|
function k(N = {}) {
|
|
1235
|
-
const
|
|
1235
|
+
const D = {
|
|
1236
1236
|
page: N.page ?? n.value.page,
|
|
1237
1237
|
per_page: N.per_page ?? n.value.per_page
|
|
1238
|
-
},
|
|
1239
|
-
|
|
1240
|
-
const ge = N.sort ?? u.value;
|
|
1241
|
-
ge && (
|
|
1242
|
-
const
|
|
1243
|
-
for (const [
|
|
1244
|
-
oe == null || oe === "" || (
|
|
1245
|
-
return Object.keys(
|
|
1238
|
+
}, $e = N.search ?? l.value;
|
|
1239
|
+
$e && (D.q = $e);
|
|
1240
|
+
const ge = N.sort ?? u.value, Je = N.direction ?? m.value;
|
|
1241
|
+
ge && Je !== null && (D.order = [{ column: ge, direction: Je }]);
|
|
1242
|
+
const $t = N.filters ?? i.value, Be = {};
|
|
1243
|
+
for (const [xt, oe] of Object.entries($t))
|
|
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
1260
|
async function $(N) {
|
|
1261
|
-
l.value = N, n.value.page = 1, await
|
|
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,
|
|
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 ?
|
|
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
|
-
function
|
|
1291
|
+
function ee() {
|
|
1292
1292
|
v.value = /* @__PURE__ */ new Set();
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function wt(N) {
|
|
1295
1295
|
return v.value.has(N);
|
|
1296
1296
|
}
|
|
1297
1297
|
return {
|
|
@@ -1304,18 +1304,18 @@ const Y = le("admin-auth", () => {
|
|
|
1304
1304
|
search: l,
|
|
1305
1305
|
filters: i,
|
|
1306
1306
|
sortKey: u,
|
|
1307
|
-
sortDirection:
|
|
1307
|
+
sortDirection: m,
|
|
1308
1308
|
selection: v,
|
|
1309
1309
|
// getters
|
|
1310
|
-
isEmpty:
|
|
1310
|
+
isEmpty: y,
|
|
1311
1311
|
hasError: A,
|
|
1312
1312
|
hasSelection: R,
|
|
1313
1313
|
selectedCount: S,
|
|
1314
1314
|
selectionState: _,
|
|
1315
1315
|
// actions
|
|
1316
1316
|
setSlug: U,
|
|
1317
|
-
reset:
|
|
1318
|
-
load:
|
|
1317
|
+
reset: L,
|
|
1318
|
+
load: w,
|
|
1319
1319
|
setSearch: $,
|
|
1320
1320
|
setFilter: z,
|
|
1321
1321
|
clearFilters: G,
|
|
@@ -1323,31 +1323,31 @@ const Y = le("admin-auth", () => {
|
|
|
1323
1323
|
toggleSort: M,
|
|
1324
1324
|
setPage: W,
|
|
1325
1325
|
toggleRow: H,
|
|
1326
|
-
toggleAllOnPage:
|
|
1327
|
-
clearSelection:
|
|
1328
|
-
isSelected:
|
|
1326
|
+
toggleAllOnPage: j,
|
|
1327
|
+
clearSelection: ee,
|
|
1328
|
+
isSelected: wt,
|
|
1329
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,
|
|
1333
1333
|
class: "admin-page__count"
|
|
1334
|
-
},
|
|
1334
|
+
}, ya = { class: "admin-page__actions" }, ba = {
|
|
1335
1335
|
key: 0,
|
|
1336
1336
|
class: "admin-bulk-toolbar",
|
|
1337
1337
|
role: "toolbar"
|
|
1338
|
-
},
|
|
1338
|
+
}, ka = { class: "admin-bulk-toolbar__count" }, wa = {
|
|
1339
1339
|
key: 1,
|
|
1340
1340
|
class: "admin-filter-bar"
|
|
1341
|
-
},
|
|
1341
|
+
}, $a = ["value"], xa = {
|
|
1342
1342
|
key: 2,
|
|
1343
1343
|
class: "admin-resource-index__loading"
|
|
1344
|
-
},
|
|
1344
|
+
}, Ca = {
|
|
1345
1345
|
key: 5,
|
|
1346
1346
|
class: "admin-resource-index__table"
|
|
1347
|
-
},
|
|
1347
|
+
}, Sa = {
|
|
1348
1348
|
key: 6,
|
|
1349
1349
|
class: "admin-resource-index__footer"
|
|
1350
|
-
},
|
|
1350
|
+
}, Aa = /* @__PURE__ */ P({
|
|
1351
1351
|
__name: "ResourceIndexPage",
|
|
1352
1352
|
props: {
|
|
1353
1353
|
slug: {},
|
|
@@ -1358,20 +1358,20 @@ const Y = le("admin-auth", () => {
|
|
|
1358
1358
|
},
|
|
1359
1359
|
emits: ["bulk-action", "row-click"],
|
|
1360
1360
|
setup(e, { emit: t }) {
|
|
1361
|
-
const n = e, o = t, a =
|
|
1361
|
+
const n = e, o = t, a = fa(), l = ie(), i = p(() => l.getResource(n.slug)), u = p(
|
|
1362
1362
|
() => n.title ?? i.value?.label ?? n.slug
|
|
1363
|
-
),
|
|
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
1372
|
}).filter((k) => k.key)), v = p(() => {
|
|
1373
|
-
const
|
|
1374
|
-
return
|
|
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(() => {
|
|
@@ -1379,38 +1379,38 @@ const Y = le("admin-auth", () => {
|
|
|
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
|
|
1388
|
-
await a.
|
|
1387
|
+
async function y(L) {
|
|
1388
|
+
await _e(), await a.setSort(L, a.sortDirection);
|
|
1389
1389
|
}
|
|
1390
|
-
async function S(
|
|
1391
|
-
await a.
|
|
1390
|
+
async function S(L) {
|
|
1391
|
+
await _e(), await a.setSort(a.sortKey, L);
|
|
1392
1392
|
}
|
|
1393
|
-
function R() {
|
|
1394
|
-
a.
|
|
1393
|
+
function R(L) {
|
|
1394
|
+
a.selection = L;
|
|
1395
1395
|
}
|
|
1396
|
-
function A(
|
|
1397
|
-
a.
|
|
1396
|
+
async function A(L) {
|
|
1397
|
+
await a.setPage(L);
|
|
1398
1398
|
}
|
|
1399
|
-
function _(
|
|
1400
|
-
o("row-click",
|
|
1399
|
+
function _(L) {
|
|
1400
|
+
o("row-click", L);
|
|
1401
1401
|
}
|
|
1402
|
-
function g(
|
|
1403
|
-
o("bulk-action",
|
|
1402
|
+
function g(L) {
|
|
1403
|
+
o("bulk-action", L, [...a.selection]);
|
|
1404
1404
|
}
|
|
1405
1405
|
async function U() {
|
|
1406
1406
|
await a.load().catch(() => {
|
|
1407
1407
|
});
|
|
1408
1408
|
}
|
|
1409
|
-
return (
|
|
1410
|
-
d("header",
|
|
1411
|
-
d("div",
|
|
1412
|
-
d("h1",
|
|
1413
|
-
e.subtitle || v.value ? (s(), c("div",
|
|
1409
|
+
return (L, k) => (s(), c("section", va, [
|
|
1410
|
+
d("header", pa, [
|
|
1411
|
+
d("div", ga, [
|
|
1412
|
+
d("h1", ha, h(u.value), 1),
|
|
1413
|
+
e.subtitle || v.value ? (s(), c("div", _a, [
|
|
1414
1414
|
e.subtitle ? (s(), c(T, { key: 0 }, [
|
|
1415
1415
|
C(h(e.subtitle), 1)
|
|
1416
1416
|
], 64)) : F("", !0),
|
|
@@ -1422,32 +1422,32 @@ const Y = le("admin-auth", () => {
|
|
|
1422
1422
|
], 64)) : F("", !0)
|
|
1423
1423
|
])) : F("", !0)
|
|
1424
1424
|
]),
|
|
1425
|
-
d("div",
|
|
1426
|
-
X(
|
|
1427
|
-
e.createRouteName ? (s(),
|
|
1425
|
+
d("div", ya, [
|
|
1426
|
+
X(L.$slots, "actions"),
|
|
1427
|
+
e.createRouteName ? (s(), b(r(V), {
|
|
1428
1428
|
key: 0,
|
|
1429
1429
|
variant: "primary",
|
|
1430
|
-
onClick: k[0] || (k[0] = (
|
|
1430
|
+
onClick: k[0] || (k[0] = (w) => L.$router.push({ name: e.createRouteName }))
|
|
1431
1431
|
}, {
|
|
1432
|
-
default:
|
|
1432
|
+
default: f(() => [
|
|
1433
1433
|
C(h(e.createLabel), 1)
|
|
1434
1434
|
]),
|
|
1435
1435
|
_: 1
|
|
1436
1436
|
})) : F("", !0)
|
|
1437
1437
|
])
|
|
1438
1438
|
]),
|
|
1439
|
-
r(a).hasSelection ? (s(), c("div",
|
|
1440
|
-
d("span",
|
|
1441
|
-
k[
|
|
1439
|
+
r(a).hasSelection ? (s(), c("div", ba, [
|
|
1440
|
+
d("span", ka, [
|
|
1441
|
+
k[7] || (k[7] = C(" Выбрано ", -1)),
|
|
1442
1442
|
d("b", null, h(r(a).selectedCount), 1)
|
|
1443
1443
|
]),
|
|
1444
|
-
k[
|
|
1444
|
+
k[13] || (k[13] = d("span", { class: "admin-bulk-toolbar__divider" }, null, -1)),
|
|
1445
1445
|
x(r(V), {
|
|
1446
1446
|
size: "sm",
|
|
1447
1447
|
variant: "ghost",
|
|
1448
|
-
onClick: k[1] || (k[1] = (
|
|
1448
|
+
onClick: k[1] || (k[1] = (w) => g("publish"))
|
|
1449
1449
|
}, {
|
|
1450
|
-
default:
|
|
1450
|
+
default: f(() => [...k[8] || (k[8] = [
|
|
1451
1451
|
C("Опубликовать", -1)
|
|
1452
1452
|
])]),
|
|
1453
1453
|
_: 1
|
|
@@ -1455,9 +1455,9 @@ const Y = le("admin-auth", () => {
|
|
|
1455
1455
|
x(r(V), {
|
|
1456
1456
|
size: "sm",
|
|
1457
1457
|
variant: "ghost",
|
|
1458
|
-
onClick: k[2] || (k[2] = (
|
|
1458
|
+
onClick: k[2] || (k[2] = (w) => g("archive"))
|
|
1459
1459
|
}, {
|
|
1460
|
-
default:
|
|
1460
|
+
default: f(() => [...k[9] || (k[9] = [
|
|
1461
1461
|
C("Архивировать", -1)
|
|
1462
1462
|
])]),
|
|
1463
1463
|
_: 1
|
|
@@ -1465,9 +1465,9 @@ const Y = le("admin-auth", () => {
|
|
|
1465
1465
|
x(r(V), {
|
|
1466
1466
|
size: "sm",
|
|
1467
1467
|
variant: "ghost",
|
|
1468
|
-
onClick: k[3] || (k[3] = (
|
|
1468
|
+
onClick: k[3] || (k[3] = (w) => g("export"))
|
|
1469
1469
|
}, {
|
|
1470
|
-
default:
|
|
1470
|
+
default: f(() => [...k[10] || (k[10] = [
|
|
1471
1471
|
C("Экспорт", -1)
|
|
1472
1472
|
])]),
|
|
1473
1473
|
_: 1
|
|
@@ -1475,152 +1475,132 @@ const Y = le("admin-auth", () => {
|
|
|
1475
1475
|
x(r(V), {
|
|
1476
1476
|
size: "sm",
|
|
1477
1477
|
variant: "danger",
|
|
1478
|
-
onClick: k[4] || (k[4] = (
|
|
1478
|
+
onClick: k[4] || (k[4] = (w) => g("delete"))
|
|
1479
1479
|
}, {
|
|
1480
|
-
default:
|
|
1480
|
+
default: f(() => [...k[11] || (k[11] = [
|
|
1481
1481
|
C("Удалить", -1)
|
|
1482
1482
|
])]),
|
|
1483
1483
|
_: 1
|
|
1484
1484
|
}),
|
|
1485
|
-
k[
|
|
1485
|
+
k[14] || (k[14] = d("span", { class: "admin-bulk-toolbar__spacer" }, null, -1)),
|
|
1486
1486
|
x(r(V), {
|
|
1487
1487
|
size: "sm",
|
|
1488
1488
|
variant: "ghost",
|
|
1489
1489
|
onClick: r(a).clearSelection
|
|
1490
1490
|
}, {
|
|
1491
|
-
default:
|
|
1491
|
+
default: f(() => [...k[12] || (k[12] = [
|
|
1492
1492
|
C(" Снять выделение ", -1)
|
|
1493
1493
|
])]),
|
|
1494
1494
|
_: 1
|
|
1495
1495
|
}, 8, ["onClick"])
|
|
1496
|
-
])) : (s(), c("div",
|
|
1496
|
+
])) : (s(), c("div", wa, [
|
|
1497
1497
|
d("input", {
|
|
1498
1498
|
value: r(a).search,
|
|
1499
1499
|
type: "search",
|
|
1500
1500
|
placeholder: "Поиск…",
|
|
1501
1501
|
class: "admin-filter-bar__search",
|
|
1502
|
-
onKeydown: k[5] || (k[5] =
|
|
1503
|
-
}, null, 40,
|
|
1504
|
-
X(
|
|
1502
|
+
onKeydown: k[5] || (k[5] = At((w) => r(a).setSearch(w.target.value), ["enter"]))
|
|
1503
|
+
}, null, 40, $a),
|
|
1504
|
+
X(L.$slots, "filters", {
|
|
1505
1505
|
filters: r(a).filters,
|
|
1506
1506
|
setFilter: r(a).setFilter
|
|
1507
1507
|
}),
|
|
1508
|
-
k[
|
|
1509
|
-
Object.keys(r(a).filters).length > 0 ? (s(),
|
|
1508
|
+
k[16] || (k[16] = d("span", { class: "admin-filter-bar__spacer" }, null, -1)),
|
|
1509
|
+
Object.keys(r(a).filters).length > 0 ? (s(), b(r(V), {
|
|
1510
1510
|
key: 0,
|
|
1511
1511
|
size: "sm",
|
|
1512
1512
|
variant: "ghost",
|
|
1513
1513
|
onClick: r(a).clearFilters
|
|
1514
1514
|
}, {
|
|
1515
|
-
default:
|
|
1515
|
+
default: f(() => [...k[15] || (k[15] = [
|
|
1516
1516
|
C(" Сброс ", -1)
|
|
1517
1517
|
])]),
|
|
1518
1518
|
_: 1
|
|
1519
1519
|
}, 8, ["onClick"])) : F("", !0)
|
|
1520
1520
|
])),
|
|
1521
|
-
r(a).loading ? (s(), c("div",
|
|
1522
|
-
(s(), c(T, null,
|
|
1523
|
-
key:
|
|
1521
|
+
r(a).loading ? (s(), c("div", xa, [
|
|
1522
|
+
(s(), c(T, null, I(8, (w) => x(r(Oe), {
|
|
1523
|
+
key: w,
|
|
1524
1524
|
height: "40px"
|
|
1525
1525
|
})), 64))
|
|
1526
|
-
])) : r(a).hasError ? (s(),
|
|
1526
|
+
])) : r(a).hasError ? (s(), b(r(Vt), {
|
|
1527
1527
|
key: 3,
|
|
1528
1528
|
title: "Не удалось загрузить данные",
|
|
1529
1529
|
description: r(a).error?.message ?? "Попробуйте обновить страницу.",
|
|
1530
1530
|
class: "admin-resource-index__state"
|
|
1531
1531
|
}, {
|
|
1532
|
-
actions:
|
|
1532
|
+
actions: f(() => [
|
|
1533
1533
|
x(r(V), {
|
|
1534
1534
|
variant: "primary",
|
|
1535
1535
|
onClick: U
|
|
1536
1536
|
}, {
|
|
1537
|
-
default:
|
|
1537
|
+
default: f(() => [...k[17] || (k[17] = [
|
|
1538
1538
|
C("Обновить", -1)
|
|
1539
1539
|
])]),
|
|
1540
1540
|
_: 1
|
|
1541
1541
|
})
|
|
1542
1542
|
]),
|
|
1543
1543
|
_: 1
|
|
1544
|
-
}, 8, ["description"])) : r(a).isEmpty ? (s(),
|
|
1544
|
+
}, 8, ["description"])) : r(a).isEmpty ? (s(), b(r(zt), {
|
|
1545
1545
|
key: 4,
|
|
1546
1546
|
title: "Пока пусто",
|
|
1547
1547
|
description: "Создайте первую запись или измените фильтры.",
|
|
1548
1548
|
class: "admin-resource-index__state"
|
|
1549
1549
|
}, {
|
|
1550
|
-
actions:
|
|
1551
|
-
e.createRouteName ? (s(),
|
|
1550
|
+
actions: f(() => [
|
|
1551
|
+
e.createRouteName ? (s(), b(r(V), {
|
|
1552
1552
|
key: 0,
|
|
1553
1553
|
variant: "primary",
|
|
1554
|
-
onClick: k[6] || (k[6] = (
|
|
1554
|
+
onClick: k[6] || (k[6] = (w) => L.$router.push({ name: e.createRouteName }))
|
|
1555
1555
|
}, {
|
|
1556
|
-
default:
|
|
1556
|
+
default: f(() => [
|
|
1557
1557
|
C(h(e.createLabel), 1)
|
|
1558
1558
|
]),
|
|
1559
1559
|
_: 1
|
|
1560
1560
|
})) : F("", !0)
|
|
1561
1561
|
]),
|
|
1562
1562
|
_: 1
|
|
1563
|
-
})) : (s(), c("div",
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
"model-value": r(a).selectionState === "all",
|
|
1567
|
-
indeterminate: r(a).selectionState === "mixed",
|
|
1568
|
-
"aria-label": "Выделить всё",
|
|
1569
|
-
"onUpdate:modelValue": R
|
|
1570
|
-
}, null, 8, ["model-value", "indeterminate"])
|
|
1571
|
-
]),
|
|
1572
|
-
x(r(Ke), {
|
|
1573
|
-
columns: f.value,
|
|
1563
|
+
})) : (s(), c("div", Ca, [
|
|
1564
|
+
x(r(We), {
|
|
1565
|
+
columns: m.value,
|
|
1574
1566
|
data: r(a).items,
|
|
1575
|
-
"sort-key": r(a).sortKey
|
|
1567
|
+
"sort-key": r(a).sortKey,
|
|
1576
1568
|
"sort-direction": r(a).sortDirection,
|
|
1577
|
-
|
|
1569
|
+
selectable: "",
|
|
1570
|
+
selection: r(a).selection,
|
|
1571
|
+
"row-key": (w) => r(a).rowId(w),
|
|
1572
|
+
"onUpdate:sortKey": y,
|
|
1573
|
+
"onUpdate:sortDirection": S,
|
|
1574
|
+
"onUpdate:selection": R,
|
|
1575
|
+
onRowClick: _
|
|
1578
1576
|
}, De({ _: 2 }, [
|
|
1579
|
-
|
|
1580
|
-
name: `cell-${
|
|
1581
|
-
fn:
|
|
1582
|
-
X(
|
|
1583
|
-
C(h($?.[
|
|
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)
|
|
1584
1582
|
])
|
|
1585
1583
|
])
|
|
1586
1584
|
}))
|
|
1587
|
-
]), 1032, ["columns", "data", "sort-key", "sort-direction"])
|
|
1588
|
-
d("div", Sa, [
|
|
1589
|
-
(s(!0), c(T, null, B(r(a).items, (y) => (s(), c("div", {
|
|
1590
|
-
key: String(r(a).rowId(y)),
|
|
1591
|
-
class: Q([
|
|
1592
|
-
"admin-resource-index__row",
|
|
1593
|
-
{ "admin-resource-index__row--selected": r(a).isSelected(r(a).rowId(y)) }
|
|
1594
|
-
]),
|
|
1595
|
-
onClick: ($) => _(y)
|
|
1596
|
-
}, [
|
|
1597
|
-
x(r(Ae), {
|
|
1598
|
-
"model-value": r(a).isSelected(r(a).rowId(y)),
|
|
1599
|
-
"aria-label": `Строка ${r(a).rowId(y)}`,
|
|
1600
|
-
"onUpdate:modelValue": ($) => A(r(a).rowId(y)),
|
|
1601
|
-
onClick: k[7] || (k[7] = We(() => {
|
|
1602
|
-
}, ["stop"]))
|
|
1603
|
-
}, null, 8, ["model-value", "aria-label", "onUpdate:modelValue"])
|
|
1604
|
-
], 10, Aa))), 128))
|
|
1605
|
-
])
|
|
1585
|
+
]), 1032, ["columns", "data", "sort-key", "sort-direction", "selection", "row-key"])
|
|
1606
1586
|
])),
|
|
1607
|
-
!r(a).loading && !r(a).hasError && !r(a).isEmpty ? (s(), c("footer",
|
|
1608
|
-
x(r(
|
|
1587
|
+
!r(a).loading && !r(a).hasError && !r(a).isEmpty ? (s(), c("footer", Sa, [
|
|
1588
|
+
x(r(Dt), {
|
|
1609
1589
|
"model-value": r(a).meta.page,
|
|
1610
1590
|
total: r(a).meta.total,
|
|
1611
1591
|
"per-page": r(a).meta.per_page,
|
|
1612
|
-
"onUpdate:modelValue":
|
|
1592
|
+
"onUpdate:modelValue": A
|
|
1613
1593
|
}, null, 8, ["model-value", "total", "per-page"])
|
|
1614
1594
|
])) : F("", !0)
|
|
1615
1595
|
]));
|
|
1616
1596
|
}
|
|
1617
|
-
}),
|
|
1618
|
-
const e = E(null), t = E("create"), n = E(null), o = E({}), a = E({}), l = E({}), i = E(!1), u = E(!1),
|
|
1597
|
+
}), _t = le("admin-resource-form", () => {
|
|
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(() => {
|
|
1619
1599
|
const M = o.value, W = a.value, H = /* @__PURE__ */ new Set([...Object.keys(M), ...Object.keys(W)]);
|
|
1620
|
-
for (const
|
|
1621
|
-
if (!Object.is(M[
|
|
1622
|
-
if (typeof M[
|
|
1623
|
-
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;
|
|
1624
1604
|
} else
|
|
1625
1605
|
return !0;
|
|
1626
1606
|
return !1;
|
|
@@ -1630,25 +1610,25 @@ const Y = le("admin-auth", () => {
|
|
|
1630
1610
|
Object.assign(M, W);
|
|
1631
1611
|
}
|
|
1632
1612
|
function U() {
|
|
1633
|
-
g(o.value, {}), g(a.value, {}), l.value = {}, i.value = !1, u.value = !1,
|
|
1613
|
+
g(o.value, {}), g(a.value, {}), l.value = {}, i.value = !1, u.value = !1, m.value = !1, v.value = null, n.value = null;
|
|
1634
1614
|
}
|
|
1635
|
-
function
|
|
1615
|
+
function L(M, W = {}) {
|
|
1636
1616
|
e.value = M, t.value = "create", n.value = null, g(o.value, W), g(a.value, W), l.value = {}, v.value = null;
|
|
1637
1617
|
}
|
|
1638
1618
|
async function k(M, W, H = "edit") {
|
|
1639
1619
|
e.value = M, t.value = H, n.value = W, i.value = !0, v.value = null, l.value = {};
|
|
1640
1620
|
try {
|
|
1641
|
-
const
|
|
1621
|
+
const ee = await K().get(`/${M}/read`, {
|
|
1642
1622
|
params: { id: W }
|
|
1643
1623
|
});
|
|
1644
|
-
g(o.value,
|
|
1645
|
-
} catch (
|
|
1646
|
-
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;
|
|
1647
1627
|
} finally {
|
|
1648
1628
|
i.value = !1;
|
|
1649
1629
|
}
|
|
1650
1630
|
}
|
|
1651
|
-
function
|
|
1631
|
+
function w(M, W) {
|
|
1652
1632
|
if (o.value[M] = W, l.value[M]) {
|
|
1653
1633
|
const H = { ...l.value };
|
|
1654
1634
|
delete H[M], l.value = H;
|
|
@@ -1665,12 +1645,12 @@ const Y = le("admin-auth", () => {
|
|
|
1665
1645
|
if (u.value) throw new Error("Already saving");
|
|
1666
1646
|
u.value = !0, v.value = null, l.value = {};
|
|
1667
1647
|
try {
|
|
1668
|
-
const M =
|
|
1669
|
-
if (
|
|
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
|
+
if (ee === void 0)
|
|
1670
1650
|
throw new Error("save: backend response does not contain record.id");
|
|
1671
|
-
return n.value =
|
|
1651
|
+
return n.value = ee, g(a.value, { ...o.value }), t.value = "edit", ee;
|
|
1672
1652
|
} catch (M) {
|
|
1673
|
-
throw M instanceof Pe ? l.value = { ...M.fields } : (M instanceof
|
|
1653
|
+
throw M instanceof Pe ? l.value = { ...M.fields } : (M instanceof Z || M instanceof Error) && (v.value = M), M;
|
|
1674
1654
|
} finally {
|
|
1675
1655
|
u.value = !1;
|
|
1676
1656
|
}
|
|
@@ -1678,14 +1658,14 @@ const Y = le("admin-auth", () => {
|
|
|
1678
1658
|
async function O() {
|
|
1679
1659
|
if (!e.value || n.value === null)
|
|
1680
1660
|
throw new Error("Nothing to delete");
|
|
1681
|
-
if (
|
|
1682
|
-
|
|
1661
|
+
if (m.value) throw new Error("Already deleting");
|
|
1662
|
+
m.value = !0, v.value = null;
|
|
1683
1663
|
try {
|
|
1684
|
-
await
|
|
1664
|
+
await K().post(`/${e.value}/delete`, { id: n.value });
|
|
1685
1665
|
} catch (M) {
|
|
1686
1666
|
throw M instanceof Error && (v.value = M), M;
|
|
1687
1667
|
} finally {
|
|
1688
|
-
|
|
1668
|
+
m.value = !1;
|
|
1689
1669
|
}
|
|
1690
1670
|
}
|
|
1691
1671
|
return {
|
|
@@ -1698,19 +1678,19 @@ const Y = le("admin-auth", () => {
|
|
|
1698
1678
|
errors: l,
|
|
1699
1679
|
loading: i,
|
|
1700
1680
|
saving: u,
|
|
1701
|
-
deleting:
|
|
1681
|
+
deleting: m,
|
|
1702
1682
|
error: v,
|
|
1703
1683
|
// getters
|
|
1704
|
-
isCreate:
|
|
1684
|
+
isCreate: y,
|
|
1705
1685
|
isEdit: S,
|
|
1706
1686
|
isView: R,
|
|
1707
1687
|
isDirty: _,
|
|
1708
1688
|
hasError: A,
|
|
1709
1689
|
// actions
|
|
1710
1690
|
reset: U,
|
|
1711
|
-
prepareCreate:
|
|
1691
|
+
prepareCreate: L,
|
|
1712
1692
|
load: k,
|
|
1713
|
-
setField:
|
|
1693
|
+
setField: w,
|
|
1714
1694
|
setErrors: $,
|
|
1715
1695
|
clearErrors: z,
|
|
1716
1696
|
save: G,
|
|
@@ -1741,25 +1721,25 @@ function Me() {
|
|
|
1741
1721
|
}
|
|
1742
1722
|
};
|
|
1743
1723
|
}
|
|
1744
|
-
const me = Me(), fe = Me(),
|
|
1745
|
-
function
|
|
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
|
+
function Oi() {
|
|
1746
1726
|
me.clear(), fe.clear();
|
|
1747
1727
|
}
|
|
1748
|
-
function
|
|
1728
|
+
function Ra(e) {
|
|
1749
1729
|
e.fields && me.registerBundle(e.fields), e.layouts && fe.registerBundle(e.layouts);
|
|
1750
1730
|
}
|
|
1751
|
-
const
|
|
1731
|
+
const bt = /* @__PURE__ */ P({
|
|
1752
1732
|
__name: "UnknownField",
|
|
1753
1733
|
props: {
|
|
1754
1734
|
type: {},
|
|
1755
1735
|
name: {}
|
|
1756
1736
|
},
|
|
1757
1737
|
setup(e) {
|
|
1758
|
-
return (t, n) => (s(),
|
|
1759
|
-
title:
|
|
1738
|
+
return (t, n) => (s(), b(r(Q), { variant: "warning" }, {
|
|
1739
|
+
title: f(() => [
|
|
1760
1740
|
C("Неизвестный тип поля: " + h(e.type), 1)
|
|
1761
1741
|
]),
|
|
1762
|
-
default:
|
|
1742
|
+
default: f(() => [
|
|
1763
1743
|
e.name ? (s(), c(T, { key: 0 }, [
|
|
1764
1744
|
d("code", null, h(e.name), 1),
|
|
1765
1745
|
n[0] || (n[0] = C(" — зарегистрируйте field-компонент через ", -1)),
|
|
@@ -1770,23 +1750,23 @@ const yt = /* @__PURE__ */ L({
|
|
|
1770
1750
|
_: 1
|
|
1771
1751
|
}));
|
|
1772
1752
|
}
|
|
1773
|
-
}),
|
|
1753
|
+
}), kt = /* @__PURE__ */ P({
|
|
1774
1754
|
__name: "FieldRenderer",
|
|
1775
1755
|
props: {
|
|
1776
1756
|
node: {}
|
|
1777
1757
|
},
|
|
1778
1758
|
setup(e) {
|
|
1779
|
-
const t = e, n = p(() =>
|
|
1759
|
+
const t = e, n = p(() => yt(t.node.type)), o = p(() => {
|
|
1780
1760
|
const { type: a, ...l } = t.node;
|
|
1781
1761
|
return l;
|
|
1782
1762
|
});
|
|
1783
|
-
return (a, l) => n.value ? (s(),
|
|
1763
|
+
return (a, l) => n.value ? (s(), b(de(n.value), Ee(Fe({ key: 0 }, o.value)), null, 16)) : (s(), b(bt, {
|
|
1784
1764
|
key: 1,
|
|
1785
1765
|
type: e.node.type,
|
|
1786
1766
|
name: e.node.name
|
|
1787
1767
|
}, null, 8, ["type", "name"]));
|
|
1788
1768
|
}
|
|
1789
|
-
}),
|
|
1769
|
+
}), we = /* @__PURE__ */ P({
|
|
1790
1770
|
__name: "LayoutRenderer",
|
|
1791
1771
|
props: {
|
|
1792
1772
|
node: {}
|
|
@@ -1796,31 +1776,31 @@ const yt = /* @__PURE__ */ L({
|
|
|
1796
1776
|
if (t.node.kind === "field")
|
|
1797
1777
|
return { kind: "field" };
|
|
1798
1778
|
if (t.node.kind === "layout") {
|
|
1799
|
-
const i =
|
|
1779
|
+
const i = Ze(t.node.type);
|
|
1800
1780
|
return i ? { kind: "layout", component: i } : { kind: "unknown" };
|
|
1801
1781
|
}
|
|
1802
|
-
const l =
|
|
1803
|
-
return l ? { kind: "layout", component: l } :
|
|
1782
|
+
const l = Ze(t.node.type);
|
|
1783
|
+
return l ? { kind: "layout", component: l } : yt(t.node.type) ? { kind: "field" } : { kind: "unknown" };
|
|
1804
1784
|
}), o = p(() => {
|
|
1805
1785
|
const { type: l, kind: i, ...u } = t.node;
|
|
1806
1786
|
return u;
|
|
1807
1787
|
}), a = p(() => t.node);
|
|
1808
|
-
return (l, i) => n.value.kind === "layout" && n.value.component ? (s(),
|
|
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, {
|
|
1809
1789
|
key: 1,
|
|
1810
1790
|
node: a.value
|
|
1811
|
-
}, null, 8, ["node"])) : (s(),
|
|
1791
|
+
}, null, 8, ["node"])) : (s(), b(bt, {
|
|
1812
1792
|
key: 2,
|
|
1813
1793
|
type: e.node.type,
|
|
1814
1794
|
name: e.node.name
|
|
1815
1795
|
}, null, 8, ["type", "name"]));
|
|
1816
1796
|
}
|
|
1817
|
-
}),
|
|
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 = {
|
|
1818
1798
|
key: 1,
|
|
1819
1799
|
class: "admin-resource-form__loading"
|
|
1820
|
-
},
|
|
1800
|
+
}, Ma = {
|
|
1821
1801
|
key: 3,
|
|
1822
1802
|
class: "admin-resource-form__savebar"
|
|
1823
|
-
},
|
|
1803
|
+
}, et = /* @__PURE__ */ P({
|
|
1824
1804
|
__name: "ResourceFormPage",
|
|
1825
1805
|
props: {
|
|
1826
1806
|
slug: {},
|
|
@@ -1828,7 +1808,7 @@ const yt = /* @__PURE__ */ L({
|
|
|
1828
1808
|
indexRouteName: { default: "admin.home" }
|
|
1829
1809
|
},
|
|
1830
1810
|
setup(e) {
|
|
1831
|
-
const t = e, n =
|
|
1811
|
+
const t = e, n = _t(), o = ie(), a = se(), l = ft(n.state, n.errors);
|
|
1832
1812
|
ae(
|
|
1833
1813
|
() => n.errors,
|
|
1834
1814
|
(_) => {
|
|
@@ -1837,10 +1817,10 @@ const yt = /* @__PURE__ */ L({
|
|
|
1837
1817
|
);
|
|
1838
1818
|
const i = p(() => o.getResource(t.slug)), u = p(
|
|
1839
1819
|
() => i.value?.fields ?? []
|
|
1840
|
-
),
|
|
1820
|
+
), m = p(() => n.isCreate ? `Создать: ${i.value?.label ?? t.slug}` : `${i.value?.label ?? t.slug}: запись #${t.id}`), v = p(() => {
|
|
1841
1821
|
const _ = n.state.status;
|
|
1842
1822
|
return typeof _ == "string" ? _ : null;
|
|
1843
|
-
}),
|
|
1823
|
+
}), y = p(() => {
|
|
1844
1824
|
switch (v.value) {
|
|
1845
1825
|
case "published":
|
|
1846
1826
|
return "success";
|
|
@@ -1884,43 +1864,43 @@ const yt = /* @__PURE__ */ L({
|
|
|
1884
1864
|
n.isDirty && !confirm("Несохранённые изменения будут потеряны. Продолжить?") || a.push({ name: t.indexRouteName }).catch(() => {
|
|
1885
1865
|
});
|
|
1886
1866
|
}
|
|
1887
|
-
return (_, g) => (s(), c("section",
|
|
1888
|
-
d("header",
|
|
1889
|
-
d("div",
|
|
1867
|
+
return (_, g) => (s(), c("section", Ua, [
|
|
1868
|
+
d("header", Ea, [
|
|
1869
|
+
d("div", Fa, [
|
|
1890
1870
|
d("a", {
|
|
1891
1871
|
class: "admin-resource-form__back",
|
|
1892
1872
|
onClick: A
|
|
1893
1873
|
}, "← Назад"),
|
|
1894
|
-
d("h1",
|
|
1895
|
-
v.value ? (s(),
|
|
1874
|
+
d("h1", La, h(m.value), 1),
|
|
1875
|
+
v.value ? (s(), b(r(Ke), {
|
|
1896
1876
|
key: 0,
|
|
1897
|
-
variant:
|
|
1877
|
+
variant: y.value
|
|
1898
1878
|
}, {
|
|
1899
|
-
default:
|
|
1879
|
+
default: f(() => [
|
|
1900
1880
|
C(h(v.value), 1)
|
|
1901
1881
|
]),
|
|
1902
1882
|
_: 1
|
|
1903
1883
|
}, 8, ["variant"])) : F("", !0)
|
|
1904
1884
|
]),
|
|
1905
|
-
d("div",
|
|
1885
|
+
d("div", Pa, [
|
|
1906
1886
|
x(r(V), {
|
|
1907
1887
|
variant: "ghost",
|
|
1908
1888
|
disabled: r(n).saving || r(n).deleting,
|
|
1909
1889
|
onClick: A
|
|
1910
1890
|
}, {
|
|
1911
|
-
default:
|
|
1891
|
+
default: f(() => [...g[0] || (g[0] = [
|
|
1912
1892
|
C(" Отмена ", -1)
|
|
1913
1893
|
])]),
|
|
1914
1894
|
_: 1
|
|
1915
1895
|
}, 8, ["disabled"]),
|
|
1916
|
-
r(n).isEdit ? (s(),
|
|
1896
|
+
r(n).isEdit ? (s(), b(r(V), {
|
|
1917
1897
|
key: 0,
|
|
1918
1898
|
variant: "danger",
|
|
1919
1899
|
disabled: r(n).saving || r(n).deleting,
|
|
1920
1900
|
loading: r(n).deleting,
|
|
1921
1901
|
onClick: R
|
|
1922
1902
|
}, {
|
|
1923
|
-
default:
|
|
1903
|
+
default: f(() => [...g[1] || (g[1] = [
|
|
1924
1904
|
C(" Удалить ", -1)
|
|
1925
1905
|
])]),
|
|
1926
1906
|
_: 1
|
|
@@ -1931,50 +1911,50 @@ const yt = /* @__PURE__ */ L({
|
|
|
1931
1911
|
loading: r(n).saving,
|
|
1932
1912
|
onClick: S
|
|
1933
1913
|
}, {
|
|
1934
|
-
default:
|
|
1914
|
+
default: f(() => [
|
|
1935
1915
|
C(h(r(n).isCreate ? "Создать" : "Сохранить"), 1)
|
|
1936
1916
|
]),
|
|
1937
1917
|
_: 1
|
|
1938
1918
|
}, 8, ["disabled", "loading"])
|
|
1939
1919
|
])
|
|
1940
1920
|
]),
|
|
1941
|
-
r(n).hasError ? (s(),
|
|
1921
|
+
r(n).hasError ? (s(), b(r(Q), {
|
|
1942
1922
|
key: 0,
|
|
1943
1923
|
variant: "danger",
|
|
1944
1924
|
class: "admin-resource-form__alert",
|
|
1945
1925
|
role: "alert"
|
|
1946
1926
|
}, {
|
|
1947
|
-
default:
|
|
1927
|
+
default: f(() => [
|
|
1948
1928
|
C(h(r(n).error?.message ?? "Не удалось сохранить запись"), 1)
|
|
1949
1929
|
]),
|
|
1950
1930
|
_: 1
|
|
1951
1931
|
})) : F("", !0),
|
|
1952
|
-
r(n).loading ? (s(), c("div",
|
|
1953
|
-
(s(), c(T, null,
|
|
1932
|
+
r(n).loading ? (s(), c("div", Ta, [
|
|
1933
|
+
(s(), c(T, null, I(6, (U) => x(r(Oe), {
|
|
1954
1934
|
key: U,
|
|
1955
1935
|
height: "40px"
|
|
1956
1936
|
})), 64))
|
|
1957
|
-
])) : (s(),
|
|
1937
|
+
])) : (s(), b(r(q), {
|
|
1958
1938
|
key: 2,
|
|
1959
1939
|
padding: "md",
|
|
1960
1940
|
class: "admin-resource-form__body"
|
|
1961
1941
|
}, {
|
|
1962
|
-
default:
|
|
1963
|
-
(s(!0), c(T, null,
|
|
1964
|
-
key:
|
|
1942
|
+
default: f(() => [
|
|
1943
|
+
(s(!0), c(T, null, I(u.value, (U, L) => (s(), b(we, {
|
|
1944
|
+
key: L,
|
|
1965
1945
|
node: U
|
|
1966
1946
|
}, null, 8, ["node"]))), 128))
|
|
1967
1947
|
]),
|
|
1968
1948
|
_: 1
|
|
1969
1949
|
})),
|
|
1970
|
-
r(n).isDirty && !r(n).loading ? (s(), c("div",
|
|
1950
|
+
r(n).isDirty && !r(n).loading ? (s(), c("div", Ma, [
|
|
1971
1951
|
g[4] || (g[4] = d("span", { class: "admin-resource-form__savebar-hint" }, " Есть несохранённые изменения ", -1)),
|
|
1972
1952
|
x(r(V), {
|
|
1973
1953
|
variant: "ghost",
|
|
1974
1954
|
size: "sm",
|
|
1975
1955
|
onClick: A
|
|
1976
1956
|
}, {
|
|
1977
|
-
default:
|
|
1957
|
+
default: f(() => [...g[2] || (g[2] = [
|
|
1978
1958
|
C("Отмена", -1)
|
|
1979
1959
|
])]),
|
|
1980
1960
|
_: 1
|
|
@@ -1986,7 +1966,7 @@ const yt = /* @__PURE__ */ L({
|
|
|
1986
1966
|
disabled: r(n).saving,
|
|
1987
1967
|
onClick: S
|
|
1988
1968
|
}, {
|
|
1989
|
-
default:
|
|
1969
|
+
default: f(() => [...g[3] || (g[3] = [
|
|
1990
1970
|
C(" Сохранить ", -1)
|
|
1991
1971
|
])]),
|
|
1992
1972
|
_: 1
|
|
@@ -1994,18 +1974,18 @@ const yt = /* @__PURE__ */ L({
|
|
|
1994
1974
|
])) : F("", !0)
|
|
1995
1975
|
]));
|
|
1996
1976
|
}
|
|
1997
|
-
}), ve = Me(),
|
|
1977
|
+
}), ve = Me(), Wi = ve.register, tt = ve.get, Ki = ve.has, ji = ve.list, Gi = ve.clear, Na = ve.registerBundle, Ba = /* @__PURE__ */ P({
|
|
1998
1978
|
__name: "UnknownEntry",
|
|
1999
1979
|
props: {
|
|
2000
1980
|
type: {},
|
|
2001
1981
|
name: {}
|
|
2002
1982
|
},
|
|
2003
1983
|
setup(e) {
|
|
2004
|
-
return (t, n) => (s(),
|
|
2005
|
-
title:
|
|
1984
|
+
return (t, n) => (s(), b(r(Q), { variant: "warning" }, {
|
|
1985
|
+
title: f(() => [
|
|
2006
1986
|
C("Неизвестный тип infolist-entry: " + h(e.type), 1)
|
|
2007
1987
|
]),
|
|
2008
|
-
default:
|
|
1988
|
+
default: f(() => [
|
|
2009
1989
|
n[0] || (n[0] = C(" Зарегистрируйте через ", -1)),
|
|
2010
1990
|
d("code", null, "registerInfolistEntry('" + h(e.type) + "', YourComponent)", 1),
|
|
2011
1991
|
n[1] || (n[1] = C(". ", -1))
|
|
@@ -2013,31 +1993,31 @@ const yt = /* @__PURE__ */ L({
|
|
|
2013
1993
|
_: 1
|
|
2014
1994
|
}));
|
|
2015
1995
|
}
|
|
2016
|
-
}),
|
|
1996
|
+
}), Ia = {
|
|
2017
1997
|
key: 1,
|
|
2018
1998
|
class: "admin-infolist-rows"
|
|
2019
|
-
},
|
|
1999
|
+
}, Va = {
|
|
2020
2000
|
key: 2,
|
|
2021
2001
|
class: "admin-infolist-cols"
|
|
2022
|
-
},
|
|
2002
|
+
}, za = {
|
|
2023
2003
|
key: 3,
|
|
2024
2004
|
class: "admin-infolist-section"
|
|
2025
|
-
},
|
|
2005
|
+
}, Da = {
|
|
2026
2006
|
key: 0,
|
|
2027
2007
|
class: "admin-infolist-section__hd"
|
|
2028
|
-
},
|
|
2008
|
+
}, qa = {
|
|
2029
2009
|
key: 0,
|
|
2030
2010
|
class: "admin-infolist-section__title"
|
|
2031
|
-
},
|
|
2011
|
+
}, Oa = {
|
|
2032
2012
|
key: 1,
|
|
2033
2013
|
class: "admin-infolist-section__description"
|
|
2034
|
-
},
|
|
2014
|
+
}, Wa = { class: "admin-infolist-section__body" }, Ka = {
|
|
2035
2015
|
key: 4,
|
|
2036
2016
|
class: "admin-infolist-tabs"
|
|
2037
|
-
},
|
|
2017
|
+
}, ja = {
|
|
2038
2018
|
class: "admin-infolist-tabs__list",
|
|
2039
2019
|
role: "tablist"
|
|
2040
|
-
},
|
|
2020
|
+
}, Ga = { class: "admin-infolist-tabs__panel" }, Ha = /* @__PURE__ */ P({
|
|
2041
2021
|
__name: "InfolistRenderer",
|
|
2042
2022
|
props: {
|
|
2043
2023
|
node: {}
|
|
@@ -2045,35 +2025,35 @@ const yt = /* @__PURE__ */ L({
|
|
|
2045
2025
|
setup(e) {
|
|
2046
2026
|
const t = e, n = /* @__PURE__ */ new Set(["rows", "columns", "section", "block", "tabs"]), o = p(() => {
|
|
2047
2027
|
if (t.node.kind === "entry") {
|
|
2048
|
-
const S =
|
|
2028
|
+
const S = tt(t.node.type);
|
|
2049
2029
|
return S ? { kind: "entry", component: S } : { kind: "unknown" };
|
|
2050
2030
|
}
|
|
2051
2031
|
if (t.node.kind === "layout")
|
|
2052
2032
|
return n.has(t.node.type) ? { kind: "layout", layoutType: t.node.type } : { kind: "unknown" };
|
|
2053
2033
|
if (n.has(t.node.type))
|
|
2054
2034
|
return { kind: "layout", layoutType: t.node.type };
|
|
2055
|
-
const
|
|
2056
|
-
return
|
|
2035
|
+
const y = tt(t.node.type);
|
|
2036
|
+
return y ? { kind: "entry", component: y } : { kind: "unknown" };
|
|
2057
2037
|
}), a = p(() => {
|
|
2058
|
-
const { type:
|
|
2038
|
+
const { type: y, kind: S, items: R, ...A } = t.node;
|
|
2059
2039
|
return A;
|
|
2060
2040
|
}), l = p(
|
|
2061
2041
|
() => t.node.items ?? []
|
|
2062
2042
|
), i = p(() => t.node.title ?? null), u = p(
|
|
2063
2043
|
() => t.node.description ?? null
|
|
2064
|
-
),
|
|
2065
|
-
const
|
|
2066
|
-
return typeof
|
|
2044
|
+
), m = p(() => {
|
|
2045
|
+
const y = t.node.active;
|
|
2046
|
+
return typeof y == "number" ? y : 0;
|
|
2067
2047
|
}), v = p(() => t.node.items ?? []);
|
|
2068
|
-
return (
|
|
2069
|
-
const R =
|
|
2070
|
-
return o.value.kind === "entry" ? (s(),
|
|
2071
|
-
(s(!0), c(T, null,
|
|
2048
|
+
return (y, S) => {
|
|
2049
|
+
const R = lt("InfolistRenderer", !0);
|
|
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, {
|
|
2072
2052
|
key: _,
|
|
2073
2053
|
node: A
|
|
2074
2054
|
}, null, 8, ["node"]))), 128))
|
|
2075
|
-
])) : o.value.kind === "layout" && o.value.layoutType === "columns" ? (s(), c("div",
|
|
2076
|
-
(s(!0), c(T, null,
|
|
2055
|
+
])) : o.value.kind === "layout" && o.value.layoutType === "columns" ? (s(), c("div", Va, [
|
|
2056
|
+
(s(!0), c(T, null, I(l.value, (A, _) => (s(), c("div", {
|
|
2077
2057
|
key: _,
|
|
2078
2058
|
class: "admin-infolist-cols__item",
|
|
2079
2059
|
style: Le({
|
|
@@ -2082,57 +2062,57 @@ const yt = /* @__PURE__ */ L({
|
|
|
2082
2062
|
}, [
|
|
2083
2063
|
x(R, { node: A }, null, 8, ["node"])
|
|
2084
2064
|
], 4))), 128))
|
|
2085
|
-
])) : o.value.kind === "layout" && (o.value.layoutType === "section" || o.value.layoutType === "block") ? (s(), c("section",
|
|
2086
|
-
i.value || u.value ? (s(), c("header",
|
|
2087
|
-
i.value ? (s(), c("h3",
|
|
2088
|
-
u.value ? (s(), c("p",
|
|
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", 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)
|
|
2089
2069
|
])) : F("", !0),
|
|
2090
|
-
d("div",
|
|
2091
|
-
(s(!0), c(T, null,
|
|
2070
|
+
d("div", Wa, [
|
|
2071
|
+
(s(!0), c(T, null, I(l.value, (A, _) => (s(), b(R, {
|
|
2092
2072
|
key: _,
|
|
2093
2073
|
node: A
|
|
2094
2074
|
}, null, 8, ["node"]))), 128))
|
|
2095
2075
|
])
|
|
2096
|
-
])) : o.value.kind === "layout" && o.value.layoutType === "tabs" ? (s(), c("div",
|
|
2097
|
-
d("ul",
|
|
2098
|
-
(s(!0), c(T, null,
|
|
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", {
|
|
2099
2079
|
key: A.key ?? _,
|
|
2100
|
-
class:
|
|
2080
|
+
class: ne([
|
|
2101
2081
|
"admin-infolist-tabs__tab",
|
|
2102
|
-
{ "admin-infolist-tabs__tab--active": _ ===
|
|
2082
|
+
{ "admin-infolist-tabs__tab--active": _ === m.value }
|
|
2103
2083
|
])
|
|
2104
2084
|
}, h(A.label), 3))), 128))
|
|
2105
2085
|
]),
|
|
2106
|
-
d("div",
|
|
2107
|
-
(s(!0), c(T, null,
|
|
2086
|
+
d("div", Ga, [
|
|
2087
|
+
(s(!0), c(T, null, I(v.value[m.value]?.items ?? [], (A, _) => (s(), b(R, {
|
|
2108
2088
|
key: _,
|
|
2109
2089
|
node: A
|
|
2110
2090
|
}, null, 8, ["node"]))), 128))
|
|
2111
2091
|
])
|
|
2112
|
-
])) : (s(),
|
|
2092
|
+
])) : (s(), b(Ba, {
|
|
2113
2093
|
key: 5,
|
|
2114
2094
|
type: e.node.type,
|
|
2115
2095
|
name: e.node.name
|
|
2116
2096
|
}, null, 8, ["type", "name"]));
|
|
2117
2097
|
};
|
|
2118
2098
|
}
|
|
2119
|
-
}),
|
|
2120
|
-
function
|
|
2121
|
-
|
|
2099
|
+
}), Xe = /* @__PURE__ */ Symbol("admin.infolist-record");
|
|
2100
|
+
function Xa(e) {
|
|
2101
|
+
Rt(Xe, e);
|
|
2122
2102
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const e = it(
|
|
2103
|
+
function Hi() {
|
|
2104
|
+
const e = it(Xe);
|
|
2125
2105
|
if (!e)
|
|
2126
2106
|
throw new Error("useRecord() called outside of provideRecord() scope");
|
|
2127
2107
|
return e;
|
|
2128
2108
|
}
|
|
2129
2109
|
function Ne() {
|
|
2130
|
-
return it(
|
|
2110
|
+
return it(Xe, null);
|
|
2131
2111
|
}
|
|
2132
|
-
const
|
|
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 = {
|
|
2133
2113
|
key: 1,
|
|
2134
2114
|
class: "admin-resource-view__loading"
|
|
2135
|
-
},
|
|
2115
|
+
}, nl = /* @__PURE__ */ P({
|
|
2136
2116
|
__name: "ResourceViewPage",
|
|
2137
2117
|
props: {
|
|
2138
2118
|
slug: {},
|
|
@@ -2141,8 +2121,8 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2141
2121
|
indexRouteName: { default: "admin.home" }
|
|
2142
2122
|
},
|
|
2143
2123
|
setup(e) {
|
|
2144
|
-
const t = e, n =
|
|
2145
|
-
|
|
2124
|
+
const t = e, n = _t(), o = ie(), a = se();
|
|
2125
|
+
Xa(n.state);
|
|
2146
2126
|
const l = p(() => o.getResource(t.slug)), i = p(
|
|
2147
2127
|
() => l.value?.fields ?? []
|
|
2148
2128
|
), u = p(
|
|
@@ -2154,12 +2134,12 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2154
2134
|
});
|
|
2155
2135
|
}), ae(
|
|
2156
2136
|
() => [t.slug, t.id],
|
|
2157
|
-
async ([
|
|
2158
|
-
await n.load(
|
|
2137
|
+
async ([y, S]) => {
|
|
2138
|
+
await n.load(y, S, "view").catch(() => {
|
|
2159
2139
|
});
|
|
2160
2140
|
}
|
|
2161
2141
|
);
|
|
2162
|
-
function
|
|
2142
|
+
function m() {
|
|
2163
2143
|
if (!t.editRouteName) {
|
|
2164
2144
|
a.push(`/r/${t.slug}/${t.id}/edit`).catch(() => {
|
|
2165
2145
|
});
|
|
@@ -2173,17 +2153,17 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2173
2153
|
}), n.hasError || a.push({ name: t.indexRouteName }).catch(() => {
|
|
2174
2154
|
}));
|
|
2175
2155
|
}
|
|
2176
|
-
return (
|
|
2177
|
-
d("header",
|
|
2178
|
-
d("div",
|
|
2179
|
-
d("h1",
|
|
2156
|
+
return (y, S) => (s(), c("section", Ja, [
|
|
2157
|
+
d("header", Ya, [
|
|
2158
|
+
d("div", Qa, [
|
|
2159
|
+
d("h1", Za, h(u.value), 1)
|
|
2180
2160
|
]),
|
|
2181
|
-
d("div",
|
|
2161
|
+
d("div", el, [
|
|
2182
2162
|
x(r(V), {
|
|
2183
2163
|
variant: "ghost",
|
|
2184
|
-
onClick:
|
|
2164
|
+
onClick: m
|
|
2185
2165
|
}, {
|
|
2186
|
-
default:
|
|
2166
|
+
default: f(() => [...S[0] || (S[0] = [
|
|
2187
2167
|
C("Редактировать", -1)
|
|
2188
2168
|
])]),
|
|
2189
2169
|
_: 1
|
|
@@ -2194,36 +2174,36 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2194
2174
|
disabled: r(n).deleting,
|
|
2195
2175
|
onClick: v
|
|
2196
2176
|
}, {
|
|
2197
|
-
default:
|
|
2177
|
+
default: f(() => [...S[1] || (S[1] = [
|
|
2198
2178
|
C(" Удалить ", -1)
|
|
2199
2179
|
])]),
|
|
2200
2180
|
_: 1
|
|
2201
2181
|
}, 8, ["loading", "disabled"])
|
|
2202
2182
|
])
|
|
2203
2183
|
]),
|
|
2204
|
-
r(n).hasError ? (s(),
|
|
2184
|
+
r(n).hasError ? (s(), b(r(Q), {
|
|
2205
2185
|
key: 0,
|
|
2206
2186
|
variant: "danger",
|
|
2207
2187
|
class: "admin-resource-view__alert",
|
|
2208
2188
|
role: "alert"
|
|
2209
2189
|
}, {
|
|
2210
|
-
default:
|
|
2190
|
+
default: f(() => [
|
|
2211
2191
|
C(h(r(n).error?.message ?? "Не удалось загрузить запись"), 1)
|
|
2212
2192
|
]),
|
|
2213
2193
|
_: 1
|
|
2214
2194
|
})) : F("", !0),
|
|
2215
|
-
r(n).loading ? (s(), c("div",
|
|
2216
|
-
(s(), c(T, null,
|
|
2195
|
+
r(n).loading ? (s(), c("div", tl, [
|
|
2196
|
+
(s(), c(T, null, I(8, (R) => x(r(Oe), {
|
|
2217
2197
|
key: R,
|
|
2218
2198
|
height: "24px"
|
|
2219
2199
|
})), 64))
|
|
2220
|
-
])) : (s(),
|
|
2200
|
+
])) : (s(), b(r(q), {
|
|
2221
2201
|
key: 2,
|
|
2222
2202
|
padding: "md",
|
|
2223
2203
|
class: "admin-resource-view__body"
|
|
2224
2204
|
}, {
|
|
2225
|
-
default:
|
|
2226
|
-
(s(!0), c(T, null,
|
|
2205
|
+
default: f(() => [
|
|
2206
|
+
(s(!0), c(T, null, I(i.value, (R, A) => (s(), b(Ha, {
|
|
2227
2207
|
key: A,
|
|
2228
2208
|
node: R
|
|
2229
2209
|
}, null, 8, ["node"]))), 128))
|
|
@@ -2232,16 +2212,16 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2232
2212
|
}))
|
|
2233
2213
|
]));
|
|
2234
2214
|
}
|
|
2235
|
-
}),
|
|
2215
|
+
}), al = { class: "admin-page admin-profile" }, ll = { class: "admin-page__hd" }, sl = { class: "admin-page__title-wrap" }, il = { class: "admin-page__title" }, ol = { class: "admin-page__count" }, rl = { class: "admin-profile__layout" }, ul = {
|
|
2236
2216
|
class: "admin-profile__nav",
|
|
2237
2217
|
"aria-label": "Profile sections"
|
|
2238
|
-
},
|
|
2218
|
+
}, dl = ["onClick"], cl = ["data-icon"], ml = { class: "admin-profile__content" }, fl = { class: "admin-profile__hero" }, vl = { class: "admin-profile__hero-text" }, pl = { class: "admin-profile__hero-name" }, gl = { class: "admin-profile__hero-meta" }, hl = { class: "admin-profile__form" }, _l = { class: "admin-profile__card-ft" }, yl = { class: "admin-profile__card-hd" }, bl = {
|
|
2239
2219
|
key: 0,
|
|
2240
2220
|
class: "admin-profile__hint"
|
|
2241
|
-
},
|
|
2221
|
+
}, kl = {
|
|
2242
2222
|
key: 1,
|
|
2243
2223
|
class: "admin-profile__hint"
|
|
2244
|
-
},
|
|
2224
|
+
}, wl = { class: "admin-profile__card-ft" }, $l = { class: "admin-profile__hint" }, xl = /* @__PURE__ */ P({
|
|
2245
2225
|
__name: "ProfilePage",
|
|
2246
2226
|
props: {
|
|
2247
2227
|
title: { default: "Profile" },
|
|
@@ -2250,16 +2230,16 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2250
2230
|
},
|
|
2251
2231
|
emits: ["update:section", "avatar-replace", "two-factor-disable", "two-factor-regenerate", "save"],
|
|
2252
2232
|
setup(e, { emit: t }) {
|
|
2253
|
-
const n = e, o = t, a = Y(), l =
|
|
2233
|
+
const n = e, o = t, a = Y(), l = je(), i = Ge(), u = [
|
|
2254
2234
|
{ id: "general", label: "Основное", icon: "user" },
|
|
2255
2235
|
{ id: "security", label: "Безопасность", icon: "shield" },
|
|
2256
2236
|
{ id: "tokens", label: "API токены", icon: "key" },
|
|
2257
2237
|
{ id: "sessions", label: "Сессии", icon: "monitor" }
|
|
2258
|
-
],
|
|
2238
|
+
], m = E(n.section);
|
|
2259
2239
|
function v(k) {
|
|
2260
|
-
|
|
2240
|
+
m.value = k, o("update:section", k);
|
|
2261
2241
|
}
|
|
2262
|
-
const
|
|
2242
|
+
const y = E({
|
|
2263
2243
|
name: a.user?.name ?? "",
|
|
2264
2244
|
email: a.user?.email ?? "",
|
|
2265
2245
|
locale: i.current,
|
|
@@ -2270,7 +2250,7 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2270
2250
|
() => l.available.map((k) => ({ value: k, label: k === "dark" ? "Тёмная" : k === "light" ? "Светлая" : k }))
|
|
2271
2251
|
);
|
|
2272
2252
|
function A() {
|
|
2273
|
-
o("save", { ...
|
|
2253
|
+
o("save", { ...y.value });
|
|
2274
2254
|
}
|
|
2275
2255
|
function _() {
|
|
2276
2256
|
o("avatar-replace");
|
|
@@ -2281,96 +2261,96 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2281
2261
|
function U() {
|
|
2282
2262
|
o("two-factor-regenerate");
|
|
2283
2263
|
}
|
|
2284
|
-
const
|
|
2285
|
-
return (k,
|
|
2286
|
-
d("header",
|
|
2287
|
-
d("div",
|
|
2288
|
-
d("h1",
|
|
2289
|
-
d("div",
|
|
2264
|
+
const L = p(() => !!a.user?.twoFactorEnabled);
|
|
2265
|
+
return (k, w) => (s(), c("section", al, [
|
|
2266
|
+
d("header", ll, [
|
|
2267
|
+
d("div", sl, [
|
|
2268
|
+
d("h1", il, h(e.title), 1),
|
|
2269
|
+
d("div", ol, h(e.subtitle), 1)
|
|
2290
2270
|
])
|
|
2291
2271
|
]),
|
|
2292
|
-
d("div",
|
|
2293
|
-
d("nav",
|
|
2294
|
-
(s(), c(T, null,
|
|
2272
|
+
d("div", rl, [
|
|
2273
|
+
d("nav", ul, [
|
|
2274
|
+
(s(), c(T, null, I(u, ($) => d("button", {
|
|
2295
2275
|
key: $.id,
|
|
2296
2276
|
type: "button",
|
|
2297
|
-
class:
|
|
2277
|
+
class: ne([
|
|
2298
2278
|
"admin-profile__nav-item",
|
|
2299
|
-
{ "admin-profile__nav-item--active":
|
|
2279
|
+
{ "admin-profile__nav-item--active": m.value === $.id }
|
|
2300
2280
|
]),
|
|
2301
2281
|
onClick: (z) => v($.id)
|
|
2302
2282
|
}, [
|
|
2303
2283
|
d("span", {
|
|
2304
2284
|
class: "admin-profile__nav-icon",
|
|
2305
2285
|
"data-icon": $.icon
|
|
2306
|
-
}, null, 8,
|
|
2286
|
+
}, null, 8, cl),
|
|
2307
2287
|
d("span", null, h($.label), 1)
|
|
2308
|
-
], 10,
|
|
2288
|
+
], 10, dl)), 64))
|
|
2309
2289
|
]),
|
|
2310
|
-
d("div",
|
|
2311
|
-
|
|
2290
|
+
d("div", ml, [
|
|
2291
|
+
m.value === "general" ? (s(), b(r(q), {
|
|
2312
2292
|
key: 0,
|
|
2313
2293
|
padding: "md"
|
|
2314
2294
|
}, {
|
|
2315
|
-
default:
|
|
2316
|
-
|
|
2295
|
+
default: f(() => [
|
|
2296
|
+
w[7] || (w[7] = d("header", { class: "admin-profile__card-hd" }, [
|
|
2317
2297
|
d("h3", { class: "admin-profile__card-title" }, "Профиль")
|
|
2318
2298
|
], -1)),
|
|
2319
|
-
d("div",
|
|
2299
|
+
d("div", fl, [
|
|
2320
2300
|
x(r(ut), {
|
|
2321
2301
|
src: r(a).user?.avatar ?? void 0,
|
|
2322
2302
|
name: r(a).user?.name ?? "?",
|
|
2323
2303
|
size: "lg"
|
|
2324
2304
|
}, null, 8, ["src", "name"]),
|
|
2325
|
-
d("div",
|
|
2326
|
-
d("div",
|
|
2327
|
-
d("div",
|
|
2305
|
+
d("div", vl, [
|
|
2306
|
+
d("div", pl, h(r(a).user?.name ?? "—"), 1),
|
|
2307
|
+
d("div", gl, h(r(a).user?.email ?? "—"), 1)
|
|
2328
2308
|
]),
|
|
2329
|
-
|
|
2309
|
+
w[5] || (w[5] = d("div", { style: { flex: "1" } }, null, -1)),
|
|
2330
2310
|
x(r(V), {
|
|
2331
2311
|
variant: "ghost",
|
|
2332
2312
|
size: "sm",
|
|
2333
2313
|
onClick: _
|
|
2334
2314
|
}, {
|
|
2335
|
-
default:
|
|
2315
|
+
default: f(() => [...w[4] || (w[4] = [
|
|
2336
2316
|
C(" Заменить ", -1)
|
|
2337
2317
|
])]),
|
|
2338
2318
|
_: 1
|
|
2339
2319
|
})
|
|
2340
2320
|
]),
|
|
2341
|
-
d("div",
|
|
2321
|
+
d("div", hl, [
|
|
2342
2322
|
x(r(ue), {
|
|
2343
|
-
modelValue:
|
|
2344
|
-
"onUpdate:modelValue":
|
|
2323
|
+
modelValue: y.value.name,
|
|
2324
|
+
"onUpdate:modelValue": w[0] || (w[0] = ($) => y.value.name = $),
|
|
2345
2325
|
label: "Имя",
|
|
2346
2326
|
name: "name"
|
|
2347
2327
|
}, null, 8, ["modelValue"]),
|
|
2348
2328
|
x(r(ue), {
|
|
2349
|
-
modelValue:
|
|
2350
|
-
"onUpdate:modelValue":
|
|
2329
|
+
modelValue: y.value.email,
|
|
2330
|
+
"onUpdate:modelValue": w[1] || (w[1] = ($) => y.value.email = $),
|
|
2351
2331
|
label: "Email",
|
|
2352
2332
|
type: "email",
|
|
2353
2333
|
name: "email"
|
|
2354
2334
|
}, null, 8, ["modelValue"]),
|
|
2355
2335
|
x(r(Re), {
|
|
2356
|
-
modelValue:
|
|
2357
|
-
"onUpdate:modelValue":
|
|
2336
|
+
modelValue: y.value.locale,
|
|
2337
|
+
"onUpdate:modelValue": w[2] || (w[2] = ($) => y.value.locale = $),
|
|
2358
2338
|
options: S.value,
|
|
2359
2339
|
label: "Язык"
|
|
2360
2340
|
}, null, 8, ["modelValue", "options"]),
|
|
2361
2341
|
x(r(Re), {
|
|
2362
|
-
modelValue:
|
|
2363
|
-
"onUpdate:modelValue":
|
|
2342
|
+
modelValue: y.value.theme,
|
|
2343
|
+
"onUpdate:modelValue": w[3] || (w[3] = ($) => y.value.theme = $),
|
|
2364
2344
|
options: R.value,
|
|
2365
2345
|
label: "Тема"
|
|
2366
2346
|
}, null, 8, ["modelValue", "options"])
|
|
2367
2347
|
]),
|
|
2368
|
-
d("footer",
|
|
2348
|
+
d("footer", _l, [
|
|
2369
2349
|
x(r(V), {
|
|
2370
2350
|
variant: "primary",
|
|
2371
2351
|
onClick: A
|
|
2372
2352
|
}, {
|
|
2373
|
-
default:
|
|
2353
|
+
default: f(() => [...w[6] || (w[6] = [
|
|
2374
2354
|
C("Сохранить", -1)
|
|
2375
2355
|
])]),
|
|
2376
2356
|
_: 1
|
|
@@ -2378,31 +2358,31 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2378
2358
|
])
|
|
2379
2359
|
]),
|
|
2380
2360
|
_: 1
|
|
2381
|
-
})) :
|
|
2361
|
+
})) : m.value === "security" ? (s(), b(r(q), {
|
|
2382
2362
|
key: 1,
|
|
2383
2363
|
padding: "md"
|
|
2384
2364
|
}, {
|
|
2385
|
-
default:
|
|
2386
|
-
d("header",
|
|
2387
|
-
|
|
2388
|
-
x(r(
|
|
2389
|
-
variant:
|
|
2365
|
+
default: f(() => [
|
|
2366
|
+
d("header", yl, [
|
|
2367
|
+
w[8] || (w[8] = d("h3", { class: "admin-profile__card-title" }, "Двухфакторная аутентификация", -1)),
|
|
2368
|
+
x(r(Ke), {
|
|
2369
|
+
variant: L.value ? "success" : "default"
|
|
2390
2370
|
}, {
|
|
2391
|
-
default:
|
|
2392
|
-
C(h(
|
|
2371
|
+
default: f(() => [
|
|
2372
|
+
C(h(L.value ? "Включена" : "Отключена"), 1)
|
|
2393
2373
|
]),
|
|
2394
2374
|
_: 1
|
|
2395
2375
|
}, 8, ["variant"])
|
|
2396
2376
|
]),
|
|
2397
|
-
|
|
2398
|
-
d("footer",
|
|
2399
|
-
|
|
2377
|
+
L.value ? (s(), c("p", bl, " 2FA включена. У вас остались recovery-коды на случай потери устройства. ")) : (s(), c("p", kl, " Включите 2FA для дополнительной защиты аккаунта. ")),
|
|
2378
|
+
d("footer", wl, [
|
|
2379
|
+
L.value ? (s(), c(T, { key: 0 }, [
|
|
2400
2380
|
x(r(V), {
|
|
2401
2381
|
variant: "ghost",
|
|
2402
2382
|
size: "sm",
|
|
2403
2383
|
onClick: U
|
|
2404
2384
|
}, {
|
|
2405
|
-
default:
|
|
2385
|
+
default: f(() => [...w[9] || (w[9] = [
|
|
2406
2386
|
C(" Перегенерировать коды ", -1)
|
|
2407
2387
|
])]),
|
|
2408
2388
|
_: 1
|
|
@@ -2412,7 +2392,7 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2412
2392
|
size: "sm",
|
|
2413
2393
|
onClick: g
|
|
2414
2394
|
}, {
|
|
2415
|
-
default:
|
|
2395
|
+
default: f(() => [...w[10] || (w[10] = [
|
|
2416
2396
|
C(" Отключить 2FA ", -1)
|
|
2417
2397
|
])]),
|
|
2418
2398
|
_: 1
|
|
@@ -2422,7 +2402,7 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2422
2402
|
variant: "primary",
|
|
2423
2403
|
disabled: ""
|
|
2424
2404
|
}, {
|
|
2425
|
-
default:
|
|
2405
|
+
default: f(() => [...w[11] || (w[11] = [
|
|
2426
2406
|
C(" Включить 2FA (host customize) ", -1)
|
|
2427
2407
|
])]),
|
|
2428
2408
|
_: 1
|
|
@@ -2431,13 +2411,13 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2431
2411
|
])
|
|
2432
2412
|
]),
|
|
2433
2413
|
_: 3
|
|
2434
|
-
})) : X(k.$slots,
|
|
2414
|
+
})) : X(k.$slots, m.value, {
|
|
2435
2415
|
key: 2,
|
|
2436
|
-
section:
|
|
2416
|
+
section: m.value
|
|
2437
2417
|
}, () => [
|
|
2438
|
-
x(r(
|
|
2439
|
-
default:
|
|
2440
|
-
d("p",
|
|
2418
|
+
x(r(q), { padding: "md" }, {
|
|
2419
|
+
default: f(() => [
|
|
2420
|
+
d("p", $l, " Section «" + h(m.value) + "» не реализована библиотекой — host-проект подключает её через slot " + h(m.value) + ". ", 1)
|
|
2441
2421
|
]),
|
|
2442
2422
|
_: 1
|
|
2443
2423
|
})
|
|
@@ -2446,17 +2426,17 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2446
2426
|
])
|
|
2447
2427
|
]));
|
|
2448
2428
|
}
|
|
2449
|
-
}), pe = Me(),
|
|
2429
|
+
}), pe = Me(), Xi = pe.register, Cl = pe.get, Ji = pe.has, Yi = pe.list, Qi = pe.clear, Sl = pe.registerBundle, Al = /* @__PURE__ */ P({
|
|
2450
2430
|
__name: "UnknownWidget",
|
|
2451
2431
|
props: {
|
|
2452
2432
|
type: {}
|
|
2453
2433
|
},
|
|
2454
2434
|
setup(e) {
|
|
2455
|
-
return (t, n) => (s(),
|
|
2456
|
-
title:
|
|
2435
|
+
return (t, n) => (s(), b(r(Q), { variant: "warning" }, {
|
|
2436
|
+
title: f(() => [
|
|
2457
2437
|
C("Неизвестный widget-тип: " + h(e.type), 1)
|
|
2458
2438
|
]),
|
|
2459
|
-
default:
|
|
2439
|
+
default: f(() => [
|
|
2460
2440
|
n[0] || (n[0] = C(" Зарегистрируйте через ", -1)),
|
|
2461
2441
|
d("code", null, "registerWidget('" + h(e.type) + "', YourComponent)", 1),
|
|
2462
2442
|
n[1] || (n[1] = C(". ", -1))
|
|
@@ -2464,25 +2444,25 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2464
2444
|
_: 1
|
|
2465
2445
|
}));
|
|
2466
2446
|
}
|
|
2467
|
-
}),
|
|
2447
|
+
}), Rl = /* @__PURE__ */ P({
|
|
2468
2448
|
__name: "WidgetRenderer",
|
|
2469
2449
|
props: {
|
|
2470
2450
|
node: {}
|
|
2471
2451
|
},
|
|
2472
2452
|
setup(e) {
|
|
2473
|
-
const t = e, n = p(() =>
|
|
2453
|
+
const t = e, n = p(() => Cl(t.node.type)), o = p(() => {
|
|
2474
2454
|
const { type: a, span: l, ...i } = t.node;
|
|
2475
2455
|
return i;
|
|
2476
2456
|
});
|
|
2477
|
-
return (a, l) => n.value ? (s(),
|
|
2457
|
+
return (a, l) => n.value ? (s(), b(de(n.value), Ee(Fe({ key: 0 }, o.value)), null, 16)) : (s(), b(Al, {
|
|
2478
2458
|
key: 1,
|
|
2479
2459
|
type: e.node.type
|
|
2480
2460
|
}, null, 8, ["type"]));
|
|
2481
2461
|
}
|
|
2482
|
-
}),
|
|
2462
|
+
}), Ul = { class: "admin-page admin-dashboard" }, El = { class: "admin-page__hd" }, Fl = { class: "admin-page__title-wrap" }, Ll = { class: "admin-page__title" }, Pl = {
|
|
2483
2463
|
key: 0,
|
|
2484
2464
|
class: "admin-page__count"
|
|
2485
|
-
},
|
|
2465
|
+
}, Tl = { class: "admin-page__actions" }, Ml = { class: "admin-dashboard__grid" }, Nl = /* @__PURE__ */ P({
|
|
2486
2466
|
__name: "DashboardPage",
|
|
2487
2467
|
props: {
|
|
2488
2468
|
slug: { default: void 0 },
|
|
@@ -2496,32 +2476,32 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2496
2476
|
), i = p(
|
|
2497
2477
|
() => t.subtitle ?? o.value?.description ?? null
|
|
2498
2478
|
);
|
|
2499
|
-
function u(
|
|
2500
|
-
const v = typeof
|
|
2479
|
+
function u(m) {
|
|
2480
|
+
const v = typeof m.span == "number" ? m.span : 12;
|
|
2501
2481
|
return Math.max(1, Math.min(12, v));
|
|
2502
2482
|
}
|
|
2503
|
-
return (
|
|
2504
|
-
d("header",
|
|
2505
|
-
d("div",
|
|
2506
|
-
d("h1",
|
|
2507
|
-
i.value ? (s(), c("div",
|
|
2483
|
+
return (m, v) => (s(), c("section", Ul, [
|
|
2484
|
+
d("header", El, [
|
|
2485
|
+
d("div", Fl, [
|
|
2486
|
+
d("h1", Ll, h(l.value), 1),
|
|
2487
|
+
i.value ? (s(), c("div", Pl, h(i.value), 1)) : F("", !0)
|
|
2508
2488
|
]),
|
|
2509
|
-
d("div",
|
|
2510
|
-
X(
|
|
2489
|
+
d("div", Tl, [
|
|
2490
|
+
X(m.$slots, "actions")
|
|
2511
2491
|
])
|
|
2512
2492
|
]),
|
|
2513
|
-
d("div",
|
|
2514
|
-
(s(!0), c(T, null,
|
|
2493
|
+
d("div", Ml, [
|
|
2494
|
+
(s(!0), c(T, null, I(a.value, (y, S) => (s(), c("div", {
|
|
2515
2495
|
key: S,
|
|
2516
2496
|
class: "admin-dashboard__cell",
|
|
2517
|
-
style: Le({ gridColumn: `span ${u(
|
|
2497
|
+
style: Le({ gridColumn: `span ${u(y)} / span ${u(y)}` })
|
|
2518
2498
|
}, [
|
|
2519
|
-
x(
|
|
2499
|
+
x(Rl, { node: y }, null, 8, ["node"])
|
|
2520
2500
|
], 4))), 128))
|
|
2521
2501
|
])
|
|
2522
2502
|
]));
|
|
2523
2503
|
}
|
|
2524
|
-
}),
|
|
2504
|
+
}), Bl = /* @__PURE__ */ P({
|
|
2525
2505
|
__name: "StatWidget",
|
|
2526
2506
|
props: {
|
|
2527
2507
|
title: { default: "" },
|
|
@@ -2541,7 +2521,7 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2541
2521
|
warning: "warning",
|
|
2542
2522
|
info: "info"
|
|
2543
2523
|
}, o = p(() => n[t.tone]);
|
|
2544
|
-
return (a, l) => (s(),
|
|
2524
|
+
return (a, l) => (s(), b(r(Se), {
|
|
2545
2525
|
title: e.title,
|
|
2546
2526
|
value: e.value,
|
|
2547
2527
|
prefix: e.prefix,
|
|
@@ -2552,16 +2532,16 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2552
2532
|
loading: e.loading
|
|
2553
2533
|
}, null, 8, ["title", "value", "prefix", "suffix", "trend", "precision", "tone", "loading"]));
|
|
2554
2534
|
}
|
|
2555
|
-
}),
|
|
2535
|
+
}), Il = {
|
|
2556
2536
|
key: 0,
|
|
2557
2537
|
class: "admin-widget__hd"
|
|
2558
|
-
},
|
|
2538
|
+
}, Vl = {
|
|
2559
2539
|
key: 0,
|
|
2560
2540
|
class: "admin-widget__title"
|
|
2561
|
-
},
|
|
2541
|
+
}, zl = {
|
|
2562
2542
|
key: 1,
|
|
2563
2543
|
class: "admin-widget__desc"
|
|
2564
|
-
},
|
|
2544
|
+
}, Dl = ["viewBox", "height", "aria-label"], ql = ["x", "y", "width", "height", "fill", "data-label", "data-value"], Ol = /* @__PURE__ */ P({
|
|
2565
2545
|
__name: "BarChartWidget",
|
|
2566
2546
|
props: {
|
|
2567
2547
|
title: { default: "" },
|
|
@@ -2581,14 +2561,14 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2581
2561
|
heightPct: i.value / n.value * 100
|
|
2582
2562
|
}));
|
|
2583
2563
|
});
|
|
2584
|
-
return (a, l) => (s(),
|
|
2564
|
+
return (a, l) => (s(), b(r(q), {
|
|
2585
2565
|
padding: "md",
|
|
2586
2566
|
class: "admin-widget"
|
|
2587
2567
|
}, {
|
|
2588
|
-
default:
|
|
2589
|
-
e.title || e.description ? (s(), c("header",
|
|
2590
|
-
e.title ? (s(), c("h3",
|
|
2591
|
-
e.description ? (s(), c("p",
|
|
2568
|
+
default: f(() => [
|
|
2569
|
+
e.title || e.description ? (s(), c("header", Il, [
|
|
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)
|
|
2592
2572
|
])) : F("", !0),
|
|
2593
2573
|
(s(), c("svg", {
|
|
2594
2574
|
class: "admin-widget-bar-chart",
|
|
@@ -2599,7 +2579,7 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2599
2579
|
role: "img",
|
|
2600
2580
|
"aria-label": e.title || "Bar chart"
|
|
2601
2581
|
}, [
|
|
2602
|
-
(s(!0), c(T, null,
|
|
2582
|
+
(s(!0), c(T, null, I(o.value, (i, u) => (s(), c("rect", {
|
|
2603
2583
|
key: u,
|
|
2604
2584
|
x: i.x,
|
|
2605
2585
|
y: e.height - i.heightPct / 100 * e.height,
|
|
@@ -2611,16 +2591,16 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2611
2591
|
"data-value": i.value
|
|
2612
2592
|
}, [
|
|
2613
2593
|
d("title", null, h(i.label) + ": " + h(i.value), 1)
|
|
2614
|
-
], 8,
|
|
2615
|
-
], 8,
|
|
2594
|
+
], 8, ql))), 128))
|
|
2595
|
+
], 8, Dl))
|
|
2616
2596
|
]),
|
|
2617
2597
|
_: 1
|
|
2618
2598
|
}));
|
|
2619
2599
|
}
|
|
2620
|
-
}),
|
|
2600
|
+
}), Wl = {
|
|
2621
2601
|
key: 0,
|
|
2622
2602
|
class: "admin-widget__hd"
|
|
2623
|
-
},
|
|
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({
|
|
2624
2604
|
__name: "DonutChartWidget",
|
|
2625
2605
|
props: {
|
|
2626
2606
|
title: { default: "" },
|
|
@@ -2636,9 +2616,9 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2636
2616
|
], o = p(() => t.data.reduce((l, i) => l + i.value, 0) || 1), a = p(() => {
|
|
2637
2617
|
let l = 0;
|
|
2638
2618
|
return t.data.map((i, u) => {
|
|
2639
|
-
const
|
|
2619
|
+
const m = l / o.value * 2 * Math.PI;
|
|
2640
2620
|
l += i.value;
|
|
2641
|
-
const v = l / o.value * 2 * Math.PI,
|
|
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`;
|
|
2642
2622
|
return {
|
|
2643
2623
|
...i,
|
|
2644
2624
|
path: k,
|
|
@@ -2647,43 +2627,43 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2647
2627
|
};
|
|
2648
2628
|
});
|
|
2649
2629
|
});
|
|
2650
|
-
return (l, i) => (s(),
|
|
2630
|
+
return (l, i) => (s(), b(r(q), {
|
|
2651
2631
|
padding: "md",
|
|
2652
2632
|
class: "admin-widget admin-donut-widget"
|
|
2653
2633
|
}, {
|
|
2654
|
-
default:
|
|
2655
|
-
e.title ? (s(), c("header",
|
|
2656
|
-
d("h3",
|
|
2634
|
+
default: f(() => [
|
|
2635
|
+
e.title ? (s(), c("header", Wl, [
|
|
2636
|
+
d("h3", Kl, h(e.title), 1)
|
|
2657
2637
|
])) : F("", !0),
|
|
2658
|
-
d("div",
|
|
2638
|
+
d("div", jl, [
|
|
2659
2639
|
(s(), c("svg", {
|
|
2660
2640
|
viewBox: "0 0 120 120",
|
|
2661
2641
|
class: "admin-donut-widget__svg",
|
|
2662
2642
|
role: "img",
|
|
2663
2643
|
"aria-label": e.title
|
|
2664
2644
|
}, [
|
|
2665
|
-
(s(!0), c(T, null,
|
|
2666
|
-
key:
|
|
2645
|
+
(s(!0), c(T, null, I(a.value, (u, m) => (s(), c("path", {
|
|
2646
|
+
key: m,
|
|
2667
2647
|
d: u.path,
|
|
2668
2648
|
fill: u.color
|
|
2669
2649
|
}, [
|
|
2670
2650
|
d("title", null, h(u.label) + ": " + h(u.value) + " (" + h(u.pct) + "%)", 1)
|
|
2671
|
-
], 8,
|
|
2651
|
+
], 8, Hl))), 128)),
|
|
2672
2652
|
i[0] || (i[0] = d("circle", {
|
|
2673
2653
|
cx: "60",
|
|
2674
2654
|
cy: "60",
|
|
2675
2655
|
r: "30",
|
|
2676
2656
|
fill: "var(--uid-surface-raised)"
|
|
2677
2657
|
}, null, -1))
|
|
2678
|
-
], 8,
|
|
2679
|
-
d("ul",
|
|
2680
|
-
(s(!0), c(T, null,
|
|
2658
|
+
], 8, Gl)),
|
|
2659
|
+
d("ul", Xl, [
|
|
2660
|
+
(s(!0), c(T, null, I(a.value, (u, m) => (s(), c("li", { key: m }, [
|
|
2681
2661
|
d("span", {
|
|
2682
2662
|
class: "admin-donut-widget__dot",
|
|
2683
2663
|
style: Le({ background: u.color })
|
|
2684
2664
|
}, null, 4),
|
|
2685
|
-
d("span",
|
|
2686
|
-
d("span",
|
|
2665
|
+
d("span", Jl, h(u.label), 1),
|
|
2666
|
+
d("span", Yl, h(u.pct) + "%", 1)
|
|
2687
2667
|
]))), 128))
|
|
2688
2668
|
])
|
|
2689
2669
|
])
|
|
@@ -2691,10 +2671,10 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2691
2671
|
_: 1
|
|
2692
2672
|
}));
|
|
2693
2673
|
}
|
|
2694
|
-
}),
|
|
2674
|
+
}), Zl = {
|
|
2695
2675
|
key: 0,
|
|
2696
2676
|
class: "admin-widget__hd"
|
|
2697
|
-
},
|
|
2677
|
+
}, es = { class: "admin-widget__title" }, ts = /* @__PURE__ */ P({
|
|
2698
2678
|
__name: "RecentTableWidget",
|
|
2699
2679
|
props: {
|
|
2700
2680
|
title: { default: "" },
|
|
@@ -2703,15 +2683,15 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2703
2683
|
emptyText: { default: "Нет данных" }
|
|
2704
2684
|
},
|
|
2705
2685
|
setup(e) {
|
|
2706
|
-
return (t, n) => (s(),
|
|
2686
|
+
return (t, n) => (s(), b(r(q), {
|
|
2707
2687
|
padding: "md",
|
|
2708
2688
|
class: "admin-widget"
|
|
2709
2689
|
}, {
|
|
2710
|
-
default:
|
|
2711
|
-
e.title ? (s(), c("header",
|
|
2712
|
-
d("h3",
|
|
2690
|
+
default: f(() => [
|
|
2691
|
+
e.title ? (s(), c("header", Zl, [
|
|
2692
|
+
d("h3", es, h(e.title), 1)
|
|
2713
2693
|
])) : F("", !0),
|
|
2714
|
-
x(r(
|
|
2694
|
+
x(r(We), {
|
|
2715
2695
|
columns: e.columns,
|
|
2716
2696
|
data: e.rows,
|
|
2717
2697
|
"empty-text": e.emptyText
|
|
@@ -2720,10 +2700,10 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2720
2700
|
_: 1
|
|
2721
2701
|
}));
|
|
2722
2702
|
}
|
|
2723
|
-
}),
|
|
2703
|
+
}), ns = {
|
|
2724
2704
|
key: 0,
|
|
2725
2705
|
class: "admin-widget__hd"
|
|
2726
|
-
},
|
|
2706
|
+
}, as = { class: "admin-widget__title" }, ls = /* @__PURE__ */ P({
|
|
2727
2707
|
__name: "HeatmapWidget",
|
|
2728
2708
|
props: {
|
|
2729
2709
|
title: { default: "" },
|
|
@@ -2733,13 +2713,13 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2733
2713
|
gap: { default: 2 }
|
|
2734
2714
|
},
|
|
2735
2715
|
setup(e) {
|
|
2736
|
-
return (t, n) => (s(),
|
|
2716
|
+
return (t, n) => (s(), b(r(q), {
|
|
2737
2717
|
padding: "md",
|
|
2738
2718
|
class: "admin-widget"
|
|
2739
2719
|
}, {
|
|
2740
|
-
default:
|
|
2741
|
-
e.title ? (s(), c("header",
|
|
2742
|
-
d("h3",
|
|
2720
|
+
default: f(() => [
|
|
2721
|
+
e.title ? (s(), c("header", ns, [
|
|
2722
|
+
d("h3", as, h(e.title), 1)
|
|
2743
2723
|
])) : F("", !0),
|
|
2744
2724
|
x(r(qt), {
|
|
2745
2725
|
data: e.data,
|
|
@@ -2751,10 +2731,10 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2751
2731
|
_: 1
|
|
2752
2732
|
}));
|
|
2753
2733
|
}
|
|
2754
|
-
}),
|
|
2734
|
+
}), ss = {
|
|
2755
2735
|
key: 0,
|
|
2756
2736
|
class: "admin-widget__hd"
|
|
2757
|
-
},
|
|
2737
|
+
}, is = { class: "admin-widget__title" }, os = { style: { display: "flex", "justify-content": "center" } }, rs = /* @__PURE__ */ P({
|
|
2758
2738
|
__name: "GaugeWidget",
|
|
2759
2739
|
props: {
|
|
2760
2740
|
title: { default: "" },
|
|
@@ -2776,16 +2756,16 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2776
2756
|
warning: "warning",
|
|
2777
2757
|
negative: "danger"
|
|
2778
2758
|
}, o = p(() => n[t.tone]);
|
|
2779
|
-
return (a, l) => (s(),
|
|
2759
|
+
return (a, l) => (s(), b(r(q), {
|
|
2780
2760
|
padding: "md",
|
|
2781
2761
|
class: "admin-widget"
|
|
2782
2762
|
}, {
|
|
2783
|
-
default:
|
|
2784
|
-
e.title ? (s(), c("header",
|
|
2785
|
-
d("h3",
|
|
2763
|
+
default: f(() => [
|
|
2764
|
+
e.title ? (s(), c("header", ss, [
|
|
2765
|
+
d("h3", is, h(e.title), 1)
|
|
2786
2766
|
])) : F("", !0),
|
|
2787
|
-
d("div",
|
|
2788
|
-
x(r(
|
|
2767
|
+
d("div", os, [
|
|
2768
|
+
x(r(Ot), {
|
|
2789
2769
|
value: e.value,
|
|
2790
2770
|
min: e.min,
|
|
2791
2771
|
max: e.max,
|
|
@@ -2802,49 +2782,49 @@ const Qa = { class: "admin-page admin-resource-view" }, Za = { class: "admin-pag
|
|
|
2802
2782
|
_: 1
|
|
2803
2783
|
}));
|
|
2804
2784
|
}
|
|
2805
|
-
}),
|
|
2785
|
+
}), us = {
|
|
2806
2786
|
key: 0,
|
|
2807
2787
|
class: "admin-widget__hd"
|
|
2808
|
-
},
|
|
2788
|
+
}, ds = { class: "admin-widget__title" }, cs = { class: "admin-markdown-widget" }, ms = /* @__PURE__ */ P({
|
|
2809
2789
|
__name: "MarkdownWidget",
|
|
2810
2790
|
props: {
|
|
2811
2791
|
title: { default: "" },
|
|
2812
2792
|
content: {}
|
|
2813
2793
|
},
|
|
2814
2794
|
setup(e) {
|
|
2815
|
-
return (t, n) => (s(),
|
|
2795
|
+
return (t, n) => (s(), b(r(q), {
|
|
2816
2796
|
padding: "md",
|
|
2817
2797
|
class: "admin-widget"
|
|
2818
2798
|
}, {
|
|
2819
|
-
default:
|
|
2820
|
-
e.title ? (s(), c("header",
|
|
2821
|
-
d("h3",
|
|
2799
|
+
default: f(() => [
|
|
2800
|
+
e.title ? (s(), c("header", us, [
|
|
2801
|
+
d("h3", ds, h(e.title), 1)
|
|
2822
2802
|
])) : F("", !0),
|
|
2823
|
-
d("div",
|
|
2803
|
+
d("div", cs, h(e.content), 1)
|
|
2824
2804
|
]),
|
|
2825
2805
|
_: 1
|
|
2826
2806
|
}));
|
|
2827
2807
|
}
|
|
2828
2808
|
});
|
|
2829
|
-
function
|
|
2830
|
-
|
|
2831
|
-
stat:
|
|
2832
|
-
"bar-chart":
|
|
2833
|
-
"donut-chart":
|
|
2834
|
-
"recent-table":
|
|
2835
|
-
heatmap:
|
|
2836
|
-
gauge:
|
|
2837
|
-
markdown:
|
|
2809
|
+
function fs() {
|
|
2810
|
+
Sl({
|
|
2811
|
+
stat: Bl,
|
|
2812
|
+
"bar-chart": Ol,
|
|
2813
|
+
"donut-chart": Ql,
|
|
2814
|
+
"recent-table": ts,
|
|
2815
|
+
heatmap: ls,
|
|
2816
|
+
gauge: rs,
|
|
2817
|
+
markdown: ms
|
|
2838
2818
|
});
|
|
2839
2819
|
}
|
|
2840
|
-
function
|
|
2820
|
+
function vs(e) {
|
|
2841
2821
|
return e.success === !0;
|
|
2842
2822
|
}
|
|
2843
|
-
function
|
|
2823
|
+
function Zi(e) {
|
|
2844
2824
|
return e.success === !1;
|
|
2845
2825
|
}
|
|
2846
|
-
function
|
|
2847
|
-
const t =
|
|
2826
|
+
function ps(e) {
|
|
2827
|
+
const t = tn.create({
|
|
2848
2828
|
baseURL: e.baseURL,
|
|
2849
2829
|
withCredentials: !0,
|
|
2850
2830
|
headers: {
|
|
@@ -2853,15 +2833,15 @@ function hs(e) {
|
|
|
2853
2833
|
}
|
|
2854
2834
|
});
|
|
2855
2835
|
e.csrfToken && (t.defaults.headers.common["X-CSRF-TOKEN"] = e.csrfToken), e.locale && (t.defaults.headers.common["X-Admin-Locale"] = e.locale), t.interceptors.request.use((a) => {
|
|
2856
|
-
const l =
|
|
2836
|
+
const l = gs("XSRF-TOKEN");
|
|
2857
2837
|
return l && a.headers.set("X-XSRF-TOKEN", decodeURIComponent(l)), a;
|
|
2858
2838
|
}), t.interceptors.response.use(
|
|
2859
2839
|
(a) => {
|
|
2860
2840
|
const l = a.data;
|
|
2861
2841
|
if (l && typeof l == "object" && "success" in l) {
|
|
2862
|
-
if (
|
|
2842
|
+
if (vs(l))
|
|
2863
2843
|
return a.data = l.payload, a;
|
|
2864
|
-
throw
|
|
2844
|
+
throw Ye(a.status, l.payload);
|
|
2865
2845
|
}
|
|
2866
2846
|
return a;
|
|
2867
2847
|
},
|
|
@@ -2870,13 +2850,13 @@ function hs(e) {
|
|
|
2870
2850
|
const l = a.response.status, i = a.response.data?.payload ?? {
|
|
2871
2851
|
errorKey: "unknown",
|
|
2872
2852
|
message: a.message
|
|
2873
|
-
}, u =
|
|
2874
|
-
return u instanceof
|
|
2853
|
+
}, u = Ye(l, i);
|
|
2854
|
+
return u instanceof gt && e.onUnauthenticated?.(), Promise.reject(u);
|
|
2875
2855
|
}
|
|
2876
2856
|
return Promise.reject(new Te(a.message));
|
|
2877
2857
|
}
|
|
2878
2858
|
);
|
|
2879
|
-
const n = (a, l, i) => t[a](l, i).then((u) => u.data), o = (a, l, i, u) => t[a](l, i, u).then((
|
|
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);
|
|
2880
2860
|
return {
|
|
2881
2861
|
raw: t,
|
|
2882
2862
|
get: (a, l) => n("get", a, l),
|
|
@@ -2889,26 +2869,26 @@ function hs(e) {
|
|
|
2889
2869
|
}
|
|
2890
2870
|
};
|
|
2891
2871
|
}
|
|
2892
|
-
function
|
|
2872
|
+
function gs(e) {
|
|
2893
2873
|
if (typeof document > "u") return null;
|
|
2894
|
-
const t = document.cookie.match(new RegExp("(^|; )" +
|
|
2874
|
+
const t = document.cookie.match(new RegExp("(^|; )" + hs(e) + "=([^;]*)"));
|
|
2895
2875
|
return t ? t[2] : null;
|
|
2896
2876
|
}
|
|
2897
|
-
function
|
|
2877
|
+
function hs(e) {
|
|
2898
2878
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2899
2879
|
}
|
|
2900
|
-
function
|
|
2880
|
+
function xe(e, t) {
|
|
2901
2881
|
const n = e.permissions?.[t];
|
|
2902
2882
|
return typeof n == "string" && n.length > 0 ? [n] : [];
|
|
2903
2883
|
}
|
|
2904
|
-
function
|
|
2884
|
+
function _s(e, t) {
|
|
2905
2885
|
const n = e.permissions?.[t];
|
|
2906
2886
|
return typeof n == "string" && n.length > 0 ? [n] : [];
|
|
2907
2887
|
}
|
|
2908
|
-
function
|
|
2888
|
+
function ys(e) {
|
|
2909
2889
|
return Array.isArray(e.permission) ? e.permission : typeof e.permission == "string" && e.permission.length > 0 ? [e.permission] : [];
|
|
2910
2890
|
}
|
|
2911
|
-
function
|
|
2891
|
+
function bs(e, t) {
|
|
2912
2892
|
const n = e.slug, o = `/r/${n}`;
|
|
2913
2893
|
return [
|
|
2914
2894
|
{
|
|
@@ -2920,7 +2900,7 @@ function ws(e, t) {
|
|
|
2920
2900
|
kind: "resource",
|
|
2921
2901
|
slug: n,
|
|
2922
2902
|
title: e.label,
|
|
2923
|
-
permissions:
|
|
2903
|
+
permissions: xe(e, "view")
|
|
2924
2904
|
},
|
|
2925
2905
|
// slug передаётся в page-component'ы как prop. Конкретный slug запекаем в
|
|
2926
2906
|
// function-mode, чтобы page видел его одинаково и через named-route, и через
|
|
@@ -2936,7 +2916,7 @@ function ws(e, t) {
|
|
|
2936
2916
|
kind: "resource",
|
|
2937
2917
|
slug: n,
|
|
2938
2918
|
title: `${e.label}: создать`,
|
|
2939
|
-
permissions:
|
|
2919
|
+
permissions: xe(e, "create")
|
|
2940
2920
|
},
|
|
2941
2921
|
props: { slug: n }
|
|
2942
2922
|
},
|
|
@@ -2949,7 +2929,7 @@ function ws(e, t) {
|
|
|
2949
2929
|
kind: "resource",
|
|
2950
2930
|
slug: n,
|
|
2951
2931
|
title: `${e.label}: редактирование`,
|
|
2952
|
-
permissions:
|
|
2932
|
+
permissions: xe(e, "update")
|
|
2953
2933
|
},
|
|
2954
2934
|
// slug запекаем, id из route-params.
|
|
2955
2935
|
props: (a) => ({ slug: n, id: a.params.id })
|
|
@@ -2963,13 +2943,13 @@ function ws(e, t) {
|
|
|
2963
2943
|
kind: "resource",
|
|
2964
2944
|
slug: n,
|
|
2965
2945
|
title: e.label,
|
|
2966
|
-
permissions:
|
|
2946
|
+
permissions: xe(e, "view")
|
|
2967
2947
|
},
|
|
2968
2948
|
props: (a) => ({ slug: n, id: a.params.id })
|
|
2969
2949
|
}
|
|
2970
2950
|
];
|
|
2971
2951
|
}
|
|
2972
|
-
function
|
|
2952
|
+
function ks(e, t) {
|
|
2973
2953
|
return {
|
|
2974
2954
|
path: `/screens/${e.slug}`,
|
|
2975
2955
|
name: `admin.screen.${e.slug}`,
|
|
@@ -2979,11 +2959,11 @@ function $s(e, t) {
|
|
|
2979
2959
|
kind: "screen",
|
|
2980
2960
|
slug: e.slug,
|
|
2981
2961
|
title: e.name,
|
|
2982
|
-
permissions:
|
|
2962
|
+
permissions: ys(e)
|
|
2983
2963
|
}
|
|
2984
2964
|
};
|
|
2985
2965
|
}
|
|
2986
|
-
function
|
|
2966
|
+
function ws(e, t) {
|
|
2987
2967
|
return {
|
|
2988
2968
|
path: `/settings/${e.slug}`,
|
|
2989
2969
|
name: `admin.settings.${e.slug}`,
|
|
@@ -2993,11 +2973,11 @@ function xs(e, t) {
|
|
|
2993
2973
|
kind: "settings",
|
|
2994
2974
|
slug: e.slug,
|
|
2995
2975
|
title: e.label,
|
|
2996
|
-
permissions:
|
|
2976
|
+
permissions: _s(e, "view")
|
|
2997
2977
|
}
|
|
2998
2978
|
};
|
|
2999
2979
|
}
|
|
3000
|
-
function
|
|
2980
|
+
function $s(e, t) {
|
|
3001
2981
|
if (typeof e.slug != "string" || e.slug.length === 0) return null;
|
|
3002
2982
|
const n = e.permission, o = Array.isArray(n) ? n : typeof n == "string" && n.length > 0 ? [n] : [];
|
|
3003
2983
|
return {
|
|
@@ -3013,22 +2993,22 @@ function Cs(e, t) {
|
|
|
3013
2993
|
}
|
|
3014
2994
|
};
|
|
3015
2995
|
}
|
|
3016
|
-
function
|
|
2996
|
+
function xs(e, t) {
|
|
3017
2997
|
if (e === null) return [];
|
|
3018
2998
|
const n = [];
|
|
3019
2999
|
for (const o of e.resources)
|
|
3020
|
-
n.push(...
|
|
3000
|
+
n.push(...bs(o, t));
|
|
3021
3001
|
for (const o of e.screens)
|
|
3022
|
-
n.push(
|
|
3002
|
+
n.push(ks(o, t));
|
|
3023
3003
|
for (const o of e.settings)
|
|
3024
|
-
n.push(
|
|
3004
|
+
n.push(ws(o, t));
|
|
3025
3005
|
for (const o of e.dashboards) {
|
|
3026
|
-
const a =
|
|
3006
|
+
const a = $s(o, t);
|
|
3027
3007
|
a && n.push(a);
|
|
3028
3008
|
}
|
|
3029
3009
|
return n;
|
|
3030
3010
|
}
|
|
3031
|
-
function
|
|
3011
|
+
function Cs(e = {}) {
|
|
3032
3012
|
const t = e.loginRouteName ?? "admin.login", n = e.forbiddenRouteName ?? "admin.forbidden", o = e.redirectQueryKey ?? "redirect";
|
|
3033
3013
|
return (a) => {
|
|
3034
3014
|
if (a.name === t)
|
|
@@ -3048,7 +3028,7 @@ function As(e = {}) {
|
|
|
3048
3028
|
return Array.isArray(u) && u.length > 0 && !l.hasAnyPermission(u) ? { name: n } : !0;
|
|
3049
3029
|
};
|
|
3050
3030
|
}
|
|
3051
|
-
function
|
|
3031
|
+
function Ss(e = {}) {
|
|
3052
3032
|
const t = e.template, n = e.brand ?? "", o = e.fallback ?? "";
|
|
3053
3033
|
return (a) => {
|
|
3054
3034
|
if (typeof document > "u") return;
|
|
@@ -3057,16 +3037,16 @@ function Rs(e = {}) {
|
|
|
3057
3037
|
t ? i = t.replace("{title}", l).replace("{brand}", n) : l && n ? i = `${l} · ${n}` : i = l || n, document.title = i;
|
|
3058
3038
|
};
|
|
3059
3039
|
}
|
|
3060
|
-
const
|
|
3040
|
+
const As = [
|
|
3061
3041
|
"admin.resource.",
|
|
3062
3042
|
"admin.screen.",
|
|
3063
3043
|
"admin.settings.",
|
|
3064
3044
|
"admin.dashboard."
|
|
3065
3045
|
];
|
|
3066
|
-
function
|
|
3067
|
-
return typeof e != "string" ? !1 :
|
|
3046
|
+
function Rs(e) {
|
|
3047
|
+
return typeof e != "string" ? !1 : As.some((t) => e.startsWith(t));
|
|
3068
3048
|
}
|
|
3069
|
-
function
|
|
3049
|
+
function Us(e) {
|
|
3070
3050
|
const t = e.base ?? "/admin", n = e.history ?? ot(t), o = [
|
|
3071
3051
|
{
|
|
3072
3052
|
path: "/login",
|
|
@@ -3103,22 +3083,22 @@ function Fs(e) {
|
|
|
3103
3083
|
name: "admin.notFound",
|
|
3104
3084
|
component: e.components.notFound,
|
|
3105
3085
|
meta: { kind: "system", title: "404" }
|
|
3106
|
-
}, l =
|
|
3086
|
+
}, l = Pt({
|
|
3107
3087
|
history: n,
|
|
3108
3088
|
routes: [...o, ...e.extraRoutes ?? [], a]
|
|
3109
3089
|
});
|
|
3110
|
-
return l.beforeEach(
|
|
3090
|
+
return l.beforeEach(Cs(e.authGuard)), l.afterEach(Ss(e.titleGuard)), l.replaceManifestRoutes = (i) => {
|
|
3111
3091
|
const u = l.getRoutes();
|
|
3112
3092
|
for (const v of u)
|
|
3113
|
-
|
|
3093
|
+
Rs(v.name) && l.removeRoute(v.name);
|
|
3114
3094
|
l.hasRoute("admin.notFound") && l.removeRoute("admin.notFound");
|
|
3115
|
-
const
|
|
3116
|
-
for (const v of
|
|
3095
|
+
const m = xs(i, e.components);
|
|
3096
|
+
for (const v of m)
|
|
3117
3097
|
l.addRoute(v);
|
|
3118
3098
|
l.addRoute(a);
|
|
3119
3099
|
}, l;
|
|
3120
3100
|
}
|
|
3121
|
-
const J = /* @__PURE__ */
|
|
3101
|
+
const J = /* @__PURE__ */ P({
|
|
3122
3102
|
__name: "TextField",
|
|
3123
3103
|
props: {
|
|
3124
3104
|
name: {},
|
|
@@ -3136,7 +3116,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3136
3116
|
function l(i) {
|
|
3137
3117
|
n.setField(t.name, i);
|
|
3138
3118
|
}
|
|
3139
|
-
return (i, u) => (s(),
|
|
3119
|
+
return (i, u) => (s(), b(r(ue), {
|
|
3140
3120
|
"model-value": o.value,
|
|
3141
3121
|
type: e.inputType,
|
|
3142
3122
|
label: e.label ?? void 0,
|
|
@@ -3151,7 +3131,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3151
3131
|
"onUpdate:modelValue": l
|
|
3152
3132
|
}, null, 8, ["model-value", "type", "label", "hint", "error", "placeholder", "required", "disabled", "readonly", "name", "autocomplete"]));
|
|
3153
3133
|
}
|
|
3154
|
-
}),
|
|
3134
|
+
}), Ce = /* @__PURE__ */ P({
|
|
3155
3135
|
__name: "TextAreaField",
|
|
3156
3136
|
props: {
|
|
3157
3137
|
name: {},
|
|
@@ -3168,15 +3148,15 @@ const J = /* @__PURE__ */ L({
|
|
|
3168
3148
|
function l(i) {
|
|
3169
3149
|
n.setField(t.name, i);
|
|
3170
3150
|
}
|
|
3171
|
-
return (i, u) => (s(),
|
|
3151
|
+
return (i, u) => (s(), b(r(ke), {
|
|
3172
3152
|
label: e.label ?? void 0,
|
|
3173
3153
|
hint: e.help ?? void 0,
|
|
3174
3154
|
error: a.value,
|
|
3175
3155
|
required: e.required,
|
|
3176
3156
|
disabled: e.disabled
|
|
3177
3157
|
}, {
|
|
3178
|
-
default:
|
|
3179
|
-
x(r(
|
|
3158
|
+
default: f(() => [
|
|
3159
|
+
x(r(Wt), {
|
|
3180
3160
|
"model-value": o.value,
|
|
3181
3161
|
rows: e.rows,
|
|
3182
3162
|
placeholder: e.placeholder ?? void 0,
|
|
@@ -3189,7 +3169,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3189
3169
|
_: 1
|
|
3190
3170
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3191
3171
|
}
|
|
3192
|
-
}),
|
|
3172
|
+
}), Ve = /* @__PURE__ */ P({
|
|
3193
3173
|
__name: "NumberField",
|
|
3194
3174
|
props: {
|
|
3195
3175
|
name: {},
|
|
@@ -3211,15 +3191,15 @@ const J = /* @__PURE__ */ L({
|
|
|
3211
3191
|
function l(i) {
|
|
3212
3192
|
n.setField(t.name, i);
|
|
3213
3193
|
}
|
|
3214
|
-
return (i, u) => (s(),
|
|
3194
|
+
return (i, u) => (s(), b(r(ke), {
|
|
3215
3195
|
label: e.label ?? void 0,
|
|
3216
3196
|
hint: e.help ?? void 0,
|
|
3217
3197
|
error: a.value,
|
|
3218
3198
|
required: e.required,
|
|
3219
3199
|
disabled: e.disabled
|
|
3220
3200
|
}, {
|
|
3221
|
-
default:
|
|
3222
|
-
x(r(
|
|
3201
|
+
default: f(() => [
|
|
3202
|
+
x(r(Kt), {
|
|
3223
3203
|
"model-value": o.value,
|
|
3224
3204
|
min: e.min ?? void 0,
|
|
3225
3205
|
max: e.max ?? void 0,
|
|
@@ -3234,7 +3214,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3234
3214
|
_: 1
|
|
3235
3215
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3236
3216
|
}
|
|
3237
|
-
}),
|
|
3217
|
+
}), te = /* @__PURE__ */ P({
|
|
3238
3218
|
__name: "SelectField",
|
|
3239
3219
|
props: {
|
|
3240
3220
|
name: {},
|
|
@@ -3256,14 +3236,14 @@ const J = /* @__PURE__ */ L({
|
|
|
3256
3236
|
function l(i) {
|
|
3257
3237
|
n.setField(t.name, i);
|
|
3258
3238
|
}
|
|
3259
|
-
return (i, u) => (s(),
|
|
3239
|
+
return (i, u) => (s(), b(r(ke), {
|
|
3260
3240
|
label: e.label ?? void 0,
|
|
3261
3241
|
hint: e.help ?? void 0,
|
|
3262
3242
|
error: a.value,
|
|
3263
3243
|
required: e.required,
|
|
3264
3244
|
disabled: e.disabled
|
|
3265
3245
|
}, {
|
|
3266
|
-
default:
|
|
3246
|
+
default: f(() => [
|
|
3267
3247
|
x(r(Re), {
|
|
3268
3248
|
"model-value": o.value,
|
|
3269
3249
|
options: e.options,
|
|
@@ -3278,7 +3258,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3278
3258
|
_: 1
|
|
3279
3259
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3280
3260
|
}
|
|
3281
|
-
}),
|
|
3261
|
+
}), ze = /* @__PURE__ */ P({
|
|
3282
3262
|
__name: "CheckboxField",
|
|
3283
3263
|
props: {
|
|
3284
3264
|
name: {},
|
|
@@ -3293,21 +3273,21 @@ const J = /* @__PURE__ */ L({
|
|
|
3293
3273
|
function l(i) {
|
|
3294
3274
|
n.setField(t.name, i);
|
|
3295
3275
|
}
|
|
3296
|
-
return (i, u) => (s(),
|
|
3276
|
+
return (i, u) => (s(), b(r(ke), {
|
|
3297
3277
|
label: e.label ?? void 0,
|
|
3298
3278
|
hint: e.help ?? void 0,
|
|
3299
3279
|
error: a.value,
|
|
3300
3280
|
required: e.required,
|
|
3301
3281
|
disabled: e.disabled
|
|
3302
3282
|
}, {
|
|
3303
|
-
default:
|
|
3304
|
-
x(r(
|
|
3283
|
+
default: f(() => [
|
|
3284
|
+
x(r(dt), {
|
|
3305
3285
|
"model-value": o.value,
|
|
3306
3286
|
disabled: e.disabled,
|
|
3307
3287
|
name: e.name,
|
|
3308
3288
|
"onUpdate:modelValue": l
|
|
3309
3289
|
}, {
|
|
3310
|
-
default:
|
|
3290
|
+
default: f(() => [
|
|
3311
3291
|
e.inlineLabel ? (s(), c(T, { key: 0 }, [
|
|
3312
3292
|
C(h(e.inlineLabel), 1)
|
|
3313
3293
|
], 64)) : F("", !0)
|
|
@@ -3318,7 +3298,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3318
3298
|
_: 1
|
|
3319
3299
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3320
3300
|
}
|
|
3321
|
-
}), re = /* @__PURE__ */
|
|
3301
|
+
}), re = /* @__PURE__ */ P({
|
|
3322
3302
|
__name: "DateField",
|
|
3323
3303
|
props: {
|
|
3324
3304
|
name: {},
|
|
@@ -3338,14 +3318,14 @@ const J = /* @__PURE__ */ L({
|
|
|
3338
3318
|
function l(i) {
|
|
3339
3319
|
n.setField(t.name, i);
|
|
3340
3320
|
}
|
|
3341
|
-
return (i, u) => (s(),
|
|
3321
|
+
return (i, u) => (s(), b(r(ke), {
|
|
3342
3322
|
label: e.label ?? void 0,
|
|
3343
3323
|
hint: e.help ?? void 0,
|
|
3344
3324
|
error: a.value,
|
|
3345
3325
|
required: e.required,
|
|
3346
3326
|
disabled: e.disabled
|
|
3347
3327
|
}, {
|
|
3348
|
-
default:
|
|
3328
|
+
default: f(() => [
|
|
3349
3329
|
x(r(jt), {
|
|
3350
3330
|
"model-value": o.value,
|
|
3351
3331
|
min: e.min ?? void 0,
|
|
@@ -3358,20 +3338,20 @@ const J = /* @__PURE__ */ L({
|
|
|
3358
3338
|
_: 1
|
|
3359
3339
|
}, 8, ["label", "hint", "error", "required", "disabled"]));
|
|
3360
3340
|
}
|
|
3361
|
-
}),
|
|
3341
|
+
}), nt = /* @__PURE__ */ P({
|
|
3362
3342
|
__name: "RowsLayout",
|
|
3363
3343
|
props: {
|
|
3364
3344
|
items: {},
|
|
3365
3345
|
gap: { default: "var(--uid-space-md)" }
|
|
3366
3346
|
},
|
|
3367
3347
|
setup(e) {
|
|
3368
|
-
return (t, n) => (s(),
|
|
3348
|
+
return (t, n) => (s(), b(r(Gt), {
|
|
3369
3349
|
direction: "column",
|
|
3370
3350
|
gap: e.gap,
|
|
3371
3351
|
align: "stretch"
|
|
3372
3352
|
}, {
|
|
3373
|
-
default:
|
|
3374
|
-
(s(!0), c(T, null,
|
|
3353
|
+
default: f(() => [
|
|
3354
|
+
(s(!0), c(T, null, I(e.items, (o, a) => (s(), b(we, {
|
|
3375
3355
|
key: a,
|
|
3376
3356
|
node: o
|
|
3377
3357
|
}, null, 8, ["node"]))), 128))
|
|
@@ -3379,7 +3359,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3379
3359
|
_: 1
|
|
3380
3360
|
}, 8, ["gap"]));
|
|
3381
3361
|
}
|
|
3382
|
-
}),
|
|
3362
|
+
}), Es = /* @__PURE__ */ P({
|
|
3383
3363
|
__name: "ColumnsLayout",
|
|
3384
3364
|
props: {
|
|
3385
3365
|
items: {},
|
|
@@ -3392,32 +3372,32 @@ const J = /* @__PURE__ */ L({
|
|
|
3392
3372
|
const l = a.span;
|
|
3393
3373
|
return typeof l == "number" && l > 0 ? Math.min(l, t.cols) : n.value;
|
|
3394
3374
|
}
|
|
3395
|
-
return (a, l) => (s(),
|
|
3375
|
+
return (a, l) => (s(), b(r(Ht), {
|
|
3396
3376
|
cols: e.cols,
|
|
3397
3377
|
gap: e.gap
|
|
3398
3378
|
}, {
|
|
3399
|
-
default:
|
|
3400
|
-
(s(!0), c(T, null,
|
|
3379
|
+
default: f(() => [
|
|
3380
|
+
(s(!0), c(T, null, I(e.items, (i, u) => (s(), c("div", {
|
|
3401
3381
|
key: u,
|
|
3402
3382
|
class: "admin-columns__item",
|
|
3403
3383
|
style: Le({ gridColumn: `span ${o(i)} / span ${o(i)}` })
|
|
3404
3384
|
}, [
|
|
3405
|
-
x(
|
|
3385
|
+
x(we, { node: i }, null, 8, ["node"])
|
|
3406
3386
|
], 4))), 128))
|
|
3407
3387
|
]),
|
|
3408
3388
|
_: 1
|
|
3409
3389
|
}, 8, ["cols", "gap"]));
|
|
3410
3390
|
}
|
|
3411
|
-
}),
|
|
3391
|
+
}), Fs = {
|
|
3412
3392
|
key: 0,
|
|
3413
3393
|
class: "admin-section__header"
|
|
3414
|
-
},
|
|
3394
|
+
}, Ls = {
|
|
3415
3395
|
key: 0,
|
|
3416
3396
|
class: "admin-section__title"
|
|
3417
|
-
},
|
|
3397
|
+
}, Ps = {
|
|
3418
3398
|
key: 1,
|
|
3419
3399
|
class: "admin-section__description"
|
|
3420
|
-
},
|
|
3400
|
+
}, Ts = { class: "admin-section__body" }, he = /* @__PURE__ */ P({
|
|
3421
3401
|
__name: "SectionLayout",
|
|
3422
3402
|
props: {
|
|
3423
3403
|
items: {},
|
|
@@ -3425,17 +3405,17 @@ const J = /* @__PURE__ */ L({
|
|
|
3425
3405
|
description: { default: null }
|
|
3426
3406
|
},
|
|
3427
3407
|
setup(e) {
|
|
3428
|
-
return (t, n) => (s(),
|
|
3408
|
+
return (t, n) => (s(), b(r(q), {
|
|
3429
3409
|
padding: "md",
|
|
3430
3410
|
class: "admin-section"
|
|
3431
3411
|
}, {
|
|
3432
|
-
default:
|
|
3433
|
-
e.title || e.description ? (s(), c("header",
|
|
3434
|
-
e.title ? (s(), c("h3",
|
|
3435
|
-
e.description ? (s(), c("p",
|
|
3412
|
+
default: f(() => [
|
|
3413
|
+
e.title || e.description ? (s(), c("header", Fs, [
|
|
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)
|
|
3436
3416
|
])) : F("", !0),
|
|
3437
|
-
d("div",
|
|
3438
|
-
(s(!0), c(T, null,
|
|
3417
|
+
d("div", Ts, [
|
|
3418
|
+
(s(!0), c(T, null, I(e.items, (o, a) => (s(), b(we, {
|
|
3439
3419
|
key: a,
|
|
3440
3420
|
node: o
|
|
3441
3421
|
}, null, 8, ["node"]))), 128))
|
|
@@ -3444,7 +3424,7 @@ const J = /* @__PURE__ */ L({
|
|
|
3444
3424
|
_: 1
|
|
3445
3425
|
}));
|
|
3446
3426
|
}
|
|
3447
|
-
}),
|
|
3427
|
+
}), Ms = /* @__PURE__ */ P({
|
|
3448
3428
|
__name: "TabsLayout",
|
|
3449
3429
|
props: {
|
|
3450
3430
|
items: {},
|
|
@@ -3453,35 +3433,35 @@ const J = /* @__PURE__ */ L({
|
|
|
3453
3433
|
emits: ["update:active"],
|
|
3454
3434
|
setup(e, { emit: t }) {
|
|
3455
3435
|
const n = e, o = t;
|
|
3456
|
-
function a(u,
|
|
3457
|
-
return u.key ??
|
|
3436
|
+
function a(u, m) {
|
|
3437
|
+
return u.key ?? m;
|
|
3458
3438
|
}
|
|
3459
3439
|
const l = E(n.active ?? a(n.items[0] ?? {}, 0));
|
|
3460
3440
|
function i(u) {
|
|
3461
3441
|
l.value = u, o("update:active", u);
|
|
3462
3442
|
}
|
|
3463
|
-
return (u,
|
|
3443
|
+
return (u, m) => (s(), b(r(ct), {
|
|
3464
3444
|
"model-value": l.value,
|
|
3465
3445
|
"onUpdate:modelValue": i
|
|
3466
3446
|
}, {
|
|
3467
|
-
list:
|
|
3468
|
-
(s(!0), c(T, null,
|
|
3469
|
-
key: a(v,
|
|
3470
|
-
value: a(v,
|
|
3447
|
+
list: f(() => [
|
|
3448
|
+
(s(!0), c(T, null, I(e.items, (v, y) => (s(), b(r(Ae), {
|
|
3449
|
+
key: a(v, y),
|
|
3450
|
+
value: a(v, y)
|
|
3471
3451
|
}, {
|
|
3472
|
-
default:
|
|
3452
|
+
default: f(() => [
|
|
3473
3453
|
C(h(v.label), 1)
|
|
3474
3454
|
]),
|
|
3475
3455
|
_: 2
|
|
3476
3456
|
}, 1032, ["value"]))), 128))
|
|
3477
3457
|
]),
|
|
3478
|
-
default:
|
|
3479
|
-
(s(!0), c(T, null,
|
|
3480
|
-
key: `panel-${a(v,
|
|
3481
|
-
value: a(v,
|
|
3458
|
+
default: f(() => [
|
|
3459
|
+
(s(!0), c(T, null, I(e.items, (v, y) => (s(), b(r(mt), {
|
|
3460
|
+
key: `panel-${a(v, y)}`,
|
|
3461
|
+
value: a(v, y)
|
|
3482
3462
|
}, {
|
|
3483
|
-
default:
|
|
3484
|
-
(s(!0), c(T, null,
|
|
3463
|
+
default: f(() => [
|
|
3464
|
+
(s(!0), c(T, null, I(v.items, (S, R) => (s(), b(we, {
|
|
3485
3465
|
key: R,
|
|
3486
3466
|
node: S
|
|
3487
3467
|
}, null, 8, ["node"]))), 128))
|
|
@@ -3493,8 +3473,8 @@ const J = /* @__PURE__ */ L({
|
|
|
3493
3473
|
}, 8, ["model-value"]));
|
|
3494
3474
|
}
|
|
3495
3475
|
});
|
|
3496
|
-
function
|
|
3497
|
-
|
|
3476
|
+
function Ns() {
|
|
3477
|
+
Ra({
|
|
3498
3478
|
fields: {
|
|
3499
3479
|
// Backend Field-классы из dskripchenko/laravel-admin отдают эти fieldType()
|
|
3500
3480
|
// строки. Соответствие см. core/src/Field/{Input,TextArea,Select,...}.php.
|
|
@@ -3508,28 +3488,28 @@ function Bs() {
|
|
|
3508
3488
|
slug: J,
|
|
3509
3489
|
hidden: J,
|
|
3510
3490
|
label: J,
|
|
3511
|
-
textarea:
|
|
3491
|
+
textarea: Ce,
|
|
3512
3492
|
// Fallback для wysiwyg/markdown/code — обычный TextAreaField.
|
|
3513
3493
|
// Реальный rich-editor host подключает через subpath:
|
|
3514
3494
|
// import { QuillField } from '@dskripchenko/laravel-admin/quill'
|
|
3515
3495
|
// registerField('wysiwyg', QuillField)
|
|
3516
|
-
wysiwyg:
|
|
3517
|
-
markdown:
|
|
3518
|
-
code:
|
|
3519
|
-
number:
|
|
3520
|
-
slider:
|
|
3521
|
-
rating:
|
|
3522
|
-
select:
|
|
3523
|
-
combobox:
|
|
3524
|
-
radio:
|
|
3525
|
-
tags:
|
|
3526
|
-
"morph-switcher":
|
|
3527
|
-
relation:
|
|
3528
|
-
cascader:
|
|
3529
|
-
"tree-select":
|
|
3530
|
-
checkbox:
|
|
3531
|
-
switcher:
|
|
3532
|
-
boolean:
|
|
3496
|
+
wysiwyg: Ce,
|
|
3497
|
+
markdown: Ce,
|
|
3498
|
+
code: Ce,
|
|
3499
|
+
number: Ve,
|
|
3500
|
+
slider: Ve,
|
|
3501
|
+
rating: Ve,
|
|
3502
|
+
select: te,
|
|
3503
|
+
combobox: te,
|
|
3504
|
+
radio: te,
|
|
3505
|
+
tags: te,
|
|
3506
|
+
"morph-switcher": te,
|
|
3507
|
+
relation: te,
|
|
3508
|
+
cascader: te,
|
|
3509
|
+
"tree-select": te,
|
|
3510
|
+
checkbox: ze,
|
|
3511
|
+
switcher: ze,
|
|
3512
|
+
boolean: ze,
|
|
3533
3513
|
date: re,
|
|
3534
3514
|
datetime: re,
|
|
3535
3515
|
datepicker: re,
|
|
@@ -3539,19 +3519,19 @@ function Bs() {
|
|
|
3539
3519
|
"color-picker": J
|
|
3540
3520
|
},
|
|
3541
3521
|
layouts: {
|
|
3542
|
-
rows:
|
|
3543
|
-
columns:
|
|
3522
|
+
rows: nt,
|
|
3523
|
+
columns: Es,
|
|
3544
3524
|
section: he,
|
|
3545
3525
|
block: he,
|
|
3546
|
-
tabs:
|
|
3526
|
+
tabs: Ms,
|
|
3547
3527
|
accordion: he,
|
|
3548
|
-
group:
|
|
3528
|
+
group: nt,
|
|
3549
3529
|
step: he,
|
|
3550
3530
|
wizard: he
|
|
3551
3531
|
}
|
|
3552
3532
|
});
|
|
3553
3533
|
}
|
|
3554
|
-
const
|
|
3534
|
+
const B = /* @__PURE__ */ P({
|
|
3555
3535
|
__name: "TextEntry",
|
|
3556
3536
|
props: {
|
|
3557
3537
|
name: { default: "" },
|
|
@@ -3566,13 +3546,13 @@ const I = /* @__PURE__ */ L({
|
|
|
3566
3546
|
return a === void 0 && n && t.name && (a = n[t.name]), a == null || a === "" ? t.placeholder : String(a);
|
|
3567
3547
|
});
|
|
3568
3548
|
return (a, l) => (s(), c("span", {
|
|
3569
|
-
class:
|
|
3549
|
+
class: ne(["admin-infolist-text", e.mono ? "admin-infolist-text--mono" : ""])
|
|
3570
3550
|
}, h(o.value), 3));
|
|
3571
3551
|
}
|
|
3572
|
-
}),
|
|
3552
|
+
}), Bs = {
|
|
3573
3553
|
key: 1,
|
|
3574
3554
|
class: "admin-infolist-text"
|
|
3575
|
-
},
|
|
3555
|
+
}, Is = /* @__PURE__ */ P({
|
|
3576
3556
|
__name: "BadgeEntry",
|
|
3577
3557
|
props: {
|
|
3578
3558
|
name: { default: "" },
|
|
@@ -3586,17 +3566,17 @@ const I = /* @__PURE__ */ L({
|
|
|
3586
3566
|
let l = t.value;
|
|
3587
3567
|
return l === void 0 && n && t.name && (l = n[t.name]), l == null ? "" : String(l);
|
|
3588
3568
|
}), a = p(() => t.variant ? t.variant : t.map[o.value] ?? "default");
|
|
3589
|
-
return (l, i) => o.value ? (s(),
|
|
3569
|
+
return (l, i) => o.value ? (s(), b(r(Ke), {
|
|
3590
3570
|
key: 0,
|
|
3591
3571
|
variant: a.value
|
|
3592
3572
|
}, {
|
|
3593
|
-
default:
|
|
3573
|
+
default: f(() => [
|
|
3594
3574
|
C(h(o.value), 1)
|
|
3595
3575
|
]),
|
|
3596
3576
|
_: 1
|
|
3597
|
-
}, 8, ["variant"])) : (s(), c("span",
|
|
3577
|
+
}, 8, ["variant"])) : (s(), c("span", Bs, "—"));
|
|
3598
3578
|
}
|
|
3599
|
-
}),
|
|
3579
|
+
}), Vs = ["data-icon"], zs = { key: 0 }, Ds = /* @__PURE__ */ P({
|
|
3600
3580
|
__name: "IconEntry",
|
|
3601
3581
|
props: {
|
|
3602
3582
|
name: { default: "" },
|
|
@@ -3613,19 +3593,19 @@ const I = /* @__PURE__ */ L({
|
|
|
3613
3593
|
return i === void 0 && n && t.name && (i = n[t.name]), !!i;
|
|
3614
3594
|
}), a = p(() => o.value ? t.trueLabel : t.falseLabel), l = p(() => o.value ? t.trueIcon : t.falseIcon);
|
|
3615
3595
|
return (i, u) => (s(), c("span", {
|
|
3616
|
-
class:
|
|
3596
|
+
class: ne(["admin-infolist-icon", o.value ? "admin-infolist-icon--on" : "admin-infolist-icon--off"])
|
|
3617
3597
|
}, [
|
|
3618
3598
|
d("span", {
|
|
3619
3599
|
class: "admin-infolist-icon__glyph",
|
|
3620
3600
|
"data-icon": l.value
|
|
3621
|
-
}, null, 8,
|
|
3622
|
-
a.value ? (s(), c("span",
|
|
3601
|
+
}, null, 8, Vs),
|
|
3602
|
+
a.value ? (s(), c("span", zs, h(a.value), 1)) : F("", !0)
|
|
3623
3603
|
], 2));
|
|
3624
3604
|
}
|
|
3625
|
-
}),
|
|
3605
|
+
}), qs = {
|
|
3626
3606
|
key: 1,
|
|
3627
3607
|
class: "admin-infolist-text"
|
|
3628
|
-
},
|
|
3608
|
+
}, at = /* @__PURE__ */ P({
|
|
3629
3609
|
__name: "KeyValueEntry",
|
|
3630
3610
|
props: {
|
|
3631
3611
|
name: { default: "" },
|
|
@@ -3640,105 +3620,105 @@ const I = /* @__PURE__ */ L({
|
|
|
3640
3620
|
function a(l) {
|
|
3641
3621
|
return l == null ? "—" : typeof l == "object" ? JSON.stringify(l) : String(l);
|
|
3642
3622
|
}
|
|
3643
|
-
return (l, i) => o.value.length > 0 ? (s(),
|
|
3623
|
+
return (l, i) => o.value.length > 0 ? (s(), b(r(Xt), {
|
|
3644
3624
|
key: 0,
|
|
3645
3625
|
direction: "vertical",
|
|
3646
3626
|
columns: 1
|
|
3647
3627
|
}, {
|
|
3648
|
-
default:
|
|
3649
|
-
(s(!0), c(T, null,
|
|
3628
|
+
default: f(() => [
|
|
3629
|
+
(s(!0), c(T, null, I(o.value, ([u, m]) => (s(), b(r(Jt), {
|
|
3650
3630
|
key: u,
|
|
3651
3631
|
label: u
|
|
3652
3632
|
}, {
|
|
3653
|
-
default:
|
|
3654
|
-
C(h(a(
|
|
3633
|
+
default: f(() => [
|
|
3634
|
+
C(h(a(m)), 1)
|
|
3655
3635
|
]),
|
|
3656
3636
|
_: 2
|
|
3657
3637
|
}, 1032, ["label"]))), 128))
|
|
3658
3638
|
]),
|
|
3659
3639
|
_: 1
|
|
3660
|
-
})) : (s(), c("span",
|
|
3640
|
+
})) : (s(), c("span", qs, "—"));
|
|
3661
3641
|
}
|
|
3662
3642
|
});
|
|
3663
|
-
function
|
|
3664
|
-
|
|
3643
|
+
function Os() {
|
|
3644
|
+
Na({
|
|
3665
3645
|
// Дефолтные типы infolist (BadgeEntry::make() и т.п.).
|
|
3666
|
-
text:
|
|
3667
|
-
badge:
|
|
3668
|
-
icon:
|
|
3669
|
-
keyvalue:
|
|
3670
|
-
"key-value":
|
|
3646
|
+
text: B,
|
|
3647
|
+
badge: Is,
|
|
3648
|
+
icon: Ds,
|
|
3649
|
+
keyvalue: at,
|
|
3650
|
+
"key-value": at,
|
|
3671
3651
|
// Маппинг от backend Field::fieldType() → TextEntry для view-режима.
|
|
3672
3652
|
// Host'ы могут перебить registerInfolistEntry('wysiwyg', WysiwygEntry).
|
|
3673
|
-
input:
|
|
3674
|
-
email:
|
|
3675
|
-
url:
|
|
3676
|
-
password:
|
|
3677
|
-
tel:
|
|
3678
|
-
search:
|
|
3679
|
-
slug:
|
|
3680
|
-
hidden:
|
|
3681
|
-
label:
|
|
3682
|
-
textarea:
|
|
3683
|
-
wysiwyg:
|
|
3684
|
-
markdown:
|
|
3685
|
-
code:
|
|
3686
|
-
number:
|
|
3687
|
-
slider:
|
|
3688
|
-
rating:
|
|
3689
|
-
select:
|
|
3690
|
-
combobox:
|
|
3691
|
-
radio:
|
|
3692
|
-
tags:
|
|
3693
|
-
"morph-switcher":
|
|
3694
|
-
relation:
|
|
3695
|
-
cascader:
|
|
3696
|
-
"tree-select":
|
|
3697
|
-
checkbox:
|
|
3698
|
-
switcher:
|
|
3699
|
-
boolean:
|
|
3700
|
-
date:
|
|
3701
|
-
datetime:
|
|
3702
|
-
datepicker:
|
|
3703
|
-
"date-range":
|
|
3704
|
-
time:
|
|
3705
|
-
"time-picker":
|
|
3706
|
-
"color-picker":
|
|
3653
|
+
input: B,
|
|
3654
|
+
email: B,
|
|
3655
|
+
url: B,
|
|
3656
|
+
password: B,
|
|
3657
|
+
tel: B,
|
|
3658
|
+
search: B,
|
|
3659
|
+
slug: B,
|
|
3660
|
+
hidden: B,
|
|
3661
|
+
label: B,
|
|
3662
|
+
textarea: B,
|
|
3663
|
+
wysiwyg: B,
|
|
3664
|
+
markdown: B,
|
|
3665
|
+
code: B,
|
|
3666
|
+
number: B,
|
|
3667
|
+
slider: B,
|
|
3668
|
+
rating: B,
|
|
3669
|
+
select: B,
|
|
3670
|
+
combobox: B,
|
|
3671
|
+
radio: B,
|
|
3672
|
+
tags: B,
|
|
3673
|
+
"morph-switcher": B,
|
|
3674
|
+
relation: B,
|
|
3675
|
+
cascader: B,
|
|
3676
|
+
"tree-select": B,
|
|
3677
|
+
checkbox: B,
|
|
3678
|
+
switcher: B,
|
|
3679
|
+
boolean: B,
|
|
3680
|
+
date: B,
|
|
3681
|
+
datetime: B,
|
|
3682
|
+
datepicker: B,
|
|
3683
|
+
"date-range": B,
|
|
3684
|
+
time: B,
|
|
3685
|
+
"time-picker": B,
|
|
3686
|
+
"color-picker": B
|
|
3707
3687
|
});
|
|
3708
3688
|
}
|
|
3709
|
-
function
|
|
3710
|
-
const n = t.pages ?? {}, o = t.base ??
|
|
3689
|
+
function eo(e, t = {}) {
|
|
3690
|
+
const n = t.pages ?? {}, o = t.base ?? Ws(e.baseUrl) ?? "/admin", a = ps({
|
|
3711
3691
|
baseURL: e.apiUrl,
|
|
3712
3692
|
csrfToken: e.csrf
|
|
3713
3693
|
});
|
|
3714
|
-
|
|
3715
|
-
const l =
|
|
3716
|
-
l.use(i), Y().hydrate(e),
|
|
3717
|
-
const u =
|
|
3694
|
+
nn(a);
|
|
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({
|
|
3718
3698
|
base: o,
|
|
3719
3699
|
history: t.router?.history ?? ot(o),
|
|
3720
3700
|
components: {
|
|
3721
|
-
login: n.login ??
|
|
3722
|
-
home: n.home ??
|
|
3701
|
+
login: n.login ?? ma,
|
|
3702
|
+
home: n.home ?? Nn,
|
|
3723
3703
|
forbidden: n.forbidden ?? In,
|
|
3724
|
-
notFound: n.notFound ??
|
|
3725
|
-
profile: n.profile ??
|
|
3726
|
-
resourceIndex: n.resourceIndex ??
|
|
3727
|
-
resourceCreate: n.resourceCreate ??
|
|
3728
|
-
resourceEdit: n.resourceEdit ??
|
|
3729
|
-
resourceView: n.resourceView ??
|
|
3730
|
-
dashboard: n.dashboard ??
|
|
3731
|
-
settings: n.settings ??
|
|
3732
|
-
screen: n.screen ??
|
|
3704
|
+
notFound: n.notFound ?? zn,
|
|
3705
|
+
profile: n.profile ?? xl,
|
|
3706
|
+
resourceIndex: n.resourceIndex ?? Aa,
|
|
3707
|
+
resourceCreate: n.resourceCreate ?? et,
|
|
3708
|
+
resourceEdit: n.resourceEdit ?? et,
|
|
3709
|
+
resourceView: n.resourceView ?? nl,
|
|
3710
|
+
dashboard: n.dashboard ?? Nl,
|
|
3711
|
+
settings: n.settings ?? Kn,
|
|
3712
|
+
screen: n.screen ?? Xn
|
|
3733
3713
|
},
|
|
3734
3714
|
extraRoutes: t.router?.extraRoutes,
|
|
3735
3715
|
authGuard: t.router?.authGuard,
|
|
3736
3716
|
titleGuard: t.router?.titleGuard
|
|
3737
3717
|
});
|
|
3738
3718
|
if (l.use(u), !t.skipManifestLoad) {
|
|
3739
|
-
const
|
|
3740
|
-
|
|
3741
|
-
}),
|
|
3719
|
+
const m = ie(), v = Y(), y = ht(), S = () => {
|
|
3720
|
+
y.load().catch(() => {
|
|
3721
|
+
}), m.load().then((R) => {
|
|
3742
3722
|
u.replaceManifestRoutes(R);
|
|
3743
3723
|
const A = u.currentRoute.value;
|
|
3744
3724
|
A.name === "admin.notFound" && A.fullPath !== "/" && u.replace(A.fullPath);
|
|
@@ -3755,7 +3735,7 @@ function no(e, t = {}) {
|
|
|
3755
3735
|
}
|
|
3756
3736
|
return t.onAppCreated?.(l), { app: l, router: u, client: a };
|
|
3757
3737
|
}
|
|
3758
|
-
function
|
|
3738
|
+
function Ws(e) {
|
|
3759
3739
|
if (!e) return null;
|
|
3760
3740
|
try {
|
|
3761
3741
|
return new URL(e).pathname || "/admin";
|
|
@@ -3763,8 +3743,8 @@ function Ks(e) {
|
|
|
3763
3743
|
return e.startsWith("/") ? e : null;
|
|
3764
3744
|
}
|
|
3765
3745
|
}
|
|
3766
|
-
async function
|
|
3767
|
-
const t =
|
|
3746
|
+
async function to(e = {}) {
|
|
3747
|
+
const t = Ks();
|
|
3768
3748
|
if (t)
|
|
3769
3749
|
return t;
|
|
3770
3750
|
if (e.client)
|
|
@@ -3778,38 +3758,38 @@ async function ao(e = {}) {
|
|
|
3778
3758
|
}
|
|
3779
3759
|
return null;
|
|
3780
3760
|
}
|
|
3781
|
-
function
|
|
3761
|
+
function Ks() {
|
|
3782
3762
|
return typeof window > "u" ? null : window.__ADMIN_BOOTSTRAP__ ?? null;
|
|
3783
3763
|
}
|
|
3784
|
-
function
|
|
3764
|
+
function no() {
|
|
3785
3765
|
return typeof document > "u" ? null : document.querySelector('meta[name="csrf-token"]')?.getAttribute("content") ?? null;
|
|
3786
3766
|
}
|
|
3787
|
-
const
|
|
3767
|
+
const js = { class: "admin-notifs__hd" }, Gs = { class: "admin-notifs__title" }, Hs = {
|
|
3788
3768
|
key: 0,
|
|
3789
3769
|
class: "admin-notifs__count"
|
|
3790
|
-
},
|
|
3770
|
+
}, Xs = { class: "admin-notifs__list" }, Js = {
|
|
3791
3771
|
key: 0,
|
|
3792
3772
|
class: "admin-notifs__empty"
|
|
3793
|
-
},
|
|
3773
|
+
}, Ys = {
|
|
3794
3774
|
key: 1,
|
|
3795
3775
|
class: "admin-notifs__empty"
|
|
3796
|
-
},
|
|
3776
|
+
}, Qs = ["onClick"], Zs = ["data-kind"], ei = { class: "admin-notifs__body" }, ti = { class: "admin-notifs__row1" }, ni = {
|
|
3797
3777
|
key: 0,
|
|
3798
3778
|
class: "admin-notifs__title-strong"
|
|
3799
|
-
},
|
|
3779
|
+
}, ai = {
|
|
3800
3780
|
key: 1,
|
|
3801
3781
|
class: "admin-notifs__title-soft"
|
|
3802
|
-
},
|
|
3782
|
+
}, li = { class: "admin-notifs__time" }, si = {
|
|
3803
3783
|
key: 0,
|
|
3804
3784
|
class: "admin-notifs__text"
|
|
3805
|
-
},
|
|
3785
|
+
}, ii = ["onClick"], ao = /* @__PURE__ */ P({
|
|
3806
3786
|
__name: "NotificationsDrawer",
|
|
3807
3787
|
props: {
|
|
3808
3788
|
open: { type: Boolean }
|
|
3809
3789
|
},
|
|
3810
3790
|
emits: ["update:open", "select-item"],
|
|
3811
3791
|
setup(e, { emit: t }) {
|
|
3812
|
-
const n = e, o = t, a =
|
|
3792
|
+
const n = e, o = t, a = He();
|
|
3813
3793
|
function l(g) {
|
|
3814
3794
|
o("update:open", g);
|
|
3815
3795
|
}
|
|
@@ -3826,7 +3806,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3826
3806
|
await a.load(g, 1).catch(() => {
|
|
3827
3807
|
});
|
|
3828
3808
|
}
|
|
3829
|
-
async function
|
|
3809
|
+
async function m() {
|
|
3830
3810
|
await a.markAllAsRead().catch(() => {
|
|
3831
3811
|
});
|
|
3832
3812
|
}
|
|
@@ -3834,7 +3814,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3834
3814
|
o("select-item", g), g.read_at || await a.markAsRead(g.id).catch(() => {
|
|
3835
3815
|
});
|
|
3836
3816
|
}
|
|
3837
|
-
async function
|
|
3817
|
+
async function y(g, U) {
|
|
3838
3818
|
U.stopPropagation(), await a.destroy(g.id).catch(() => {
|
|
3839
3819
|
});
|
|
3840
3820
|
}
|
|
@@ -3850,54 +3830,54 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3850
3830
|
}
|
|
3851
3831
|
function _(g) {
|
|
3852
3832
|
if (!g) return "";
|
|
3853
|
-
const U = new Date(g),
|
|
3833
|
+
const U = new Date(g), L = Math.max(0, Date.now() - U.getTime()), k = Math.floor(L / 6e4);
|
|
3854
3834
|
if (k < 1) return "только что";
|
|
3855
3835
|
if (k < 60) return `${k} мин назад`;
|
|
3856
|
-
const
|
|
3857
|
-
if (
|
|
3858
|
-
const $ = Math.floor(
|
|
3836
|
+
const w = Math.floor(k / 60);
|
|
3837
|
+
if (w < 24) return `${w} ч назад`;
|
|
3838
|
+
const $ = Math.floor(w / 24);
|
|
3859
3839
|
return $ < 7 ? `${$} д назад` : U.toLocaleDateString("ru-RU");
|
|
3860
3840
|
}
|
|
3861
|
-
return (g, U) => (s(),
|
|
3841
|
+
return (g, U) => (s(), b(r(Yt), {
|
|
3862
3842
|
"model-value": e.open,
|
|
3863
3843
|
side: "right",
|
|
3864
3844
|
width: "400px",
|
|
3865
3845
|
title: "Уведомления",
|
|
3866
3846
|
"onUpdate:modelValue": l
|
|
3867
3847
|
}, {
|
|
3868
|
-
header:
|
|
3869
|
-
d("div",
|
|
3870
|
-
d("h2",
|
|
3848
|
+
header: f(() => [
|
|
3849
|
+
d("div", js, [
|
|
3850
|
+
d("h2", Gs, [
|
|
3871
3851
|
U[0] || (U[0] = C(" Уведомления ", -1)),
|
|
3872
|
-
r(a).unreadCount > 0 ? (s(), c("span",
|
|
3852
|
+
r(a).unreadCount > 0 ? (s(), c("span", Hs, " (" + h(r(a).unreadCount) + ") ", 1)) : F("", !0)
|
|
3873
3853
|
]),
|
|
3874
|
-
r(a).unreadCount > 0 ? (s(),
|
|
3854
|
+
r(a).unreadCount > 0 ? (s(), b(r(V), {
|
|
3875
3855
|
key: 0,
|
|
3876
3856
|
variant: "ghost",
|
|
3877
3857
|
size: "sm",
|
|
3878
|
-
onClick:
|
|
3858
|
+
onClick: m
|
|
3879
3859
|
}, {
|
|
3880
|
-
default:
|
|
3860
|
+
default: f(() => [...U[1] || (U[1] = [
|
|
3881
3861
|
C(" Прочитать все ", -1)
|
|
3882
3862
|
])]),
|
|
3883
3863
|
_: 1
|
|
3884
3864
|
})) : F("", !0)
|
|
3885
3865
|
])
|
|
3886
3866
|
]),
|
|
3887
|
-
default:
|
|
3888
|
-
x(r(
|
|
3867
|
+
default: f(() => [
|
|
3868
|
+
x(r(ct), {
|
|
3889
3869
|
"model-value": i.value,
|
|
3890
3870
|
"onUpdate:modelValue": u
|
|
3891
3871
|
}, {
|
|
3892
|
-
list:
|
|
3893
|
-
x(r(
|
|
3894
|
-
default:
|
|
3872
|
+
list: f(() => [
|
|
3873
|
+
x(r(Ae), { value: "all" }, {
|
|
3874
|
+
default: f(() => [...U[2] || (U[2] = [
|
|
3895
3875
|
C("Все", -1)
|
|
3896
3876
|
])]),
|
|
3897
3877
|
_: 1
|
|
3898
3878
|
}),
|
|
3899
|
-
x(r(
|
|
3900
|
-
default:
|
|
3879
|
+
x(r(Ae), { value: "unread" }, {
|
|
3880
|
+
default: f(() => [
|
|
3901
3881
|
U[3] || (U[3] = C(" Непрочитанные", -1)),
|
|
3902
3882
|
r(a).unreadCount > 0 ? (s(), c(T, { key: 0 }, [
|
|
3903
3883
|
C(" (" + h(r(a).unreadCount) + ") ", 1)
|
|
@@ -3905,48 +3885,48 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3905
3885
|
]),
|
|
3906
3886
|
_: 1
|
|
3907
3887
|
}),
|
|
3908
|
-
x(r(
|
|
3909
|
-
default:
|
|
3888
|
+
x(r(Ae), { value: "read" }, {
|
|
3889
|
+
default: f(() => [...U[4] || (U[4] = [
|
|
3910
3890
|
C("Прочитанные", -1)
|
|
3911
3891
|
])]),
|
|
3912
3892
|
_: 1
|
|
3913
3893
|
})
|
|
3914
3894
|
]),
|
|
3915
|
-
default:
|
|
3916
|
-
(s(), c(T, null,
|
|
3917
|
-
key:
|
|
3918
|
-
value:
|
|
3895
|
+
default: f(() => [
|
|
3896
|
+
(s(), c(T, null, I(["all", "unread", "read"], (L) => x(r(mt), {
|
|
3897
|
+
key: L,
|
|
3898
|
+
value: L
|
|
3919
3899
|
}, {
|
|
3920
|
-
default:
|
|
3921
|
-
d("ul",
|
|
3922
|
-
r(a).loading ? (s(), c("li",
|
|
3923
|
-
(s(!0), c(T, null,
|
|
3900
|
+
default: f(() => [
|
|
3901
|
+
d("ul", Xs, [
|
|
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", {
|
|
3924
3904
|
key: k.id,
|
|
3925
|
-
class:
|
|
3905
|
+
class: ne([
|
|
3926
3906
|
"admin-notifs__item",
|
|
3927
3907
|
`admin-notifs__item--${S(k)}`,
|
|
3928
3908
|
{ "admin-notifs__item--unread": !k.read_at }
|
|
3929
3909
|
]),
|
|
3930
|
-
onClick: (
|
|
3910
|
+
onClick: (w) => v(k)
|
|
3931
3911
|
}, [
|
|
3932
3912
|
d("span", {
|
|
3933
3913
|
class: "admin-notifs__icon",
|
|
3934
3914
|
"data-kind": S(k)
|
|
3935
|
-
}, null, 8,
|
|
3936
|
-
d("div",
|
|
3937
|
-
d("div",
|
|
3938
|
-
k.read_at ? (s(), c("span",
|
|
3939
|
-
d("span",
|
|
3915
|
+
}, null, 8, Zs),
|
|
3916
|
+
d("div", ei, [
|
|
3917
|
+
d("div", ti, [
|
|
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)
|
|
3940
3920
|
]),
|
|
3941
|
-
A(k) ? (s(), c("p",
|
|
3921
|
+
A(k) ? (s(), c("p", si, h(A(k)), 1)) : F("", !0)
|
|
3942
3922
|
]),
|
|
3943
3923
|
d("button", {
|
|
3944
3924
|
type: "button",
|
|
3945
3925
|
class: "admin-notifs__close",
|
|
3946
3926
|
"aria-label": "Удалить",
|
|
3947
|
-
onClick: (
|
|
3948
|
-
}, " × ", 8,
|
|
3949
|
-
], 10,
|
|
3927
|
+
onClick: (w) => y(k, w)
|
|
3928
|
+
}, " × ", 8, ii)
|
|
3929
|
+
], 10, Qs))), 128))
|
|
3950
3930
|
])
|
|
3951
3931
|
]),
|
|
3952
3932
|
_: 1
|
|
@@ -3958,22 +3938,22 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3958
3938
|
_: 1
|
|
3959
3939
|
}, 8, ["model-value"]));
|
|
3960
3940
|
}
|
|
3961
|
-
}),
|
|
3941
|
+
}), oi = { class: "admin-page admin-import-wizard" }, ri = { class: "admin-page__hd" }, ui = { class: "admin-page__title-wrap" }, di = { class: "admin-page__title" }, ci = { class: "admin-page__actions" }, mi = {
|
|
3962
3942
|
key: 0,
|
|
3963
3943
|
class: "admin-import-wizard__empty"
|
|
3964
|
-
},
|
|
3944
|
+
}, fi = {
|
|
3965
3945
|
key: 1,
|
|
3966
3946
|
class: "admin-import-wizard__mapping"
|
|
3967
|
-
},
|
|
3947
|
+
}, vi = { class: "admin-import-wizard__map-source" }, pi = {
|
|
3968
3948
|
key: 0,
|
|
3969
3949
|
class: "admin-import-wizard__map-sample"
|
|
3970
|
-
},
|
|
3950
|
+
}, gi = { class: "admin-import-wizard__card-hd" }, hi = {
|
|
3971
3951
|
key: 2,
|
|
3972
3952
|
class: "admin-import-wizard__empty"
|
|
3973
|
-
},
|
|
3953
|
+
}, _i = {
|
|
3974
3954
|
key: 0,
|
|
3975
3955
|
class: "admin-import-wizard__empty"
|
|
3976
|
-
},
|
|
3956
|
+
}, yi = { class: "admin-import-wizard__kpi" }, bi = { class: "admin-import-wizard__nav" }, lo = /* @__PURE__ */ P({
|
|
3977
3957
|
__name: "ImportWizardPage",
|
|
3978
3958
|
props: {
|
|
3979
3959
|
title: { default: "Импорт" },
|
|
@@ -3992,21 +3972,21 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
3992
3972
|
{ label: "Предпросмотр", description: "Проверка первых строк" },
|
|
3993
3973
|
{ label: "Импорт", description: "Запуск + сводка" }
|
|
3994
3974
|
], l = E(0), i = p(() => n.step ?? l.value);
|
|
3995
|
-
function u(
|
|
3996
|
-
n.step === void 0 && (
|
|
3975
|
+
function u(w) {
|
|
3976
|
+
n.step === void 0 && (w < 0 || w >= a.length || (l.value = w));
|
|
3997
3977
|
}
|
|
3998
|
-
const
|
|
3999
|
-
function v(
|
|
4000
|
-
|
|
3978
|
+
const m = E([]);
|
|
3979
|
+
function v(w) {
|
|
3980
|
+
m.value = w, w.length > 0 && o("file-uploaded", w[0].file);
|
|
4001
3981
|
}
|
|
4002
|
-
const
|
|
4003
|
-
function S(
|
|
4004
|
-
|
|
3982
|
+
const y = E({});
|
|
3983
|
+
function S(w, $) {
|
|
3984
|
+
y.value[w] = $ === null || $ === "" ? null : String($);
|
|
4005
3985
|
}
|
|
4006
3986
|
function R() {
|
|
4007
|
-
return n.headers.map((
|
|
4008
|
-
source:
|
|
4009
|
-
target:
|
|
3987
|
+
return n.headers.map((w) => ({
|
|
3988
|
+
source: w.key,
|
|
3989
|
+
target: y.value[w.key] ?? null
|
|
4010
3990
|
}));
|
|
4011
3991
|
}
|
|
4012
3992
|
function A() {
|
|
@@ -4018,54 +3998,54 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4018
3998
|
const g = p(() => i.value > 0), U = p(() => {
|
|
4019
3999
|
switch (i.value) {
|
|
4020
4000
|
case 0:
|
|
4021
|
-
return
|
|
4001
|
+
return m.value.length > 0;
|
|
4022
4002
|
case 1:
|
|
4023
|
-
return Object.values(
|
|
4003
|
+
return Object.values(y.value).some((w) => w !== null);
|
|
4024
4004
|
case 2:
|
|
4025
4005
|
return !0;
|
|
4026
4006
|
default:
|
|
4027
4007
|
return !1;
|
|
4028
4008
|
}
|
|
4029
|
-
}),
|
|
4009
|
+
}), L = p(() => [
|
|
4030
4010
|
{ value: "", label: "Не импортировать" },
|
|
4031
4011
|
...n.fieldOptions
|
|
4032
4012
|
]);
|
|
4033
4013
|
function k() {
|
|
4034
4014
|
o("cancel");
|
|
4035
4015
|
}
|
|
4036
|
-
return (
|
|
4037
|
-
d("header",
|
|
4038
|
-
d("div",
|
|
4039
|
-
d("h1",
|
|
4016
|
+
return (w, $) => (s(), c("section", oi, [
|
|
4017
|
+
d("header", ri, [
|
|
4018
|
+
d("div", ui, [
|
|
4019
|
+
d("h1", di, h(e.title), 1)
|
|
4040
4020
|
]),
|
|
4041
|
-
d("div",
|
|
4021
|
+
d("div", ci, [
|
|
4042
4022
|
x(r(V), {
|
|
4043
4023
|
variant: "ghost",
|
|
4044
4024
|
onClick: k
|
|
4045
4025
|
}, {
|
|
4046
|
-
default:
|
|
4026
|
+
default: f(() => [...$[2] || ($[2] = [
|
|
4047
4027
|
C("Отмена", -1)
|
|
4048
4028
|
])]),
|
|
4049
4029
|
_: 1
|
|
4050
4030
|
})
|
|
4051
4031
|
])
|
|
4052
4032
|
]),
|
|
4053
|
-
x(r(
|
|
4033
|
+
x(r(Qt), {
|
|
4054
4034
|
steps: a,
|
|
4055
4035
|
current: i.value
|
|
4056
4036
|
}, null, 8, ["current"]),
|
|
4057
|
-
i.value === 0 ? (s(),
|
|
4037
|
+
i.value === 0 ? (s(), b(r(q), {
|
|
4058
4038
|
key: 0,
|
|
4059
4039
|
padding: "md",
|
|
4060
4040
|
class: "admin-import-wizard__card"
|
|
4061
4041
|
}, {
|
|
4062
|
-
default:
|
|
4042
|
+
default: f(() => [
|
|
4063
4043
|
$[3] || ($[3] = d("header", { class: "admin-import-wizard__card-hd" }, [
|
|
4064
4044
|
d("h3", null, "1. Загрузите файл"),
|
|
4065
4045
|
d("p", null, "CSV / TSV / XLSX, до 50 MB")
|
|
4066
4046
|
], -1)),
|
|
4067
|
-
x(r(
|
|
4068
|
-
"model-value":
|
|
4047
|
+
x(r(Zt), {
|
|
4048
|
+
"model-value": m.value,
|
|
4069
4049
|
accept: ".csv,.tsv,.xlsx",
|
|
4070
4050
|
"max-size": 50 * 1024 * 1024,
|
|
4071
4051
|
"max-files": 1,
|
|
@@ -4075,29 +4055,29 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4075
4055
|
}, null, 8, ["model-value"])
|
|
4076
4056
|
]),
|
|
4077
4057
|
_: 1
|
|
4078
|
-
})) : i.value === 1 ? (s(),
|
|
4058
|
+
})) : i.value === 1 ? (s(), b(r(q), {
|
|
4079
4059
|
key: 1,
|
|
4080
4060
|
padding: "md",
|
|
4081
4061
|
class: "admin-import-wizard__card"
|
|
4082
4062
|
}, {
|
|
4083
|
-
default:
|
|
4063
|
+
default: f(() => [
|
|
4084
4064
|
$[5] || ($[5] = d("header", { class: "admin-import-wizard__card-hd" }, [
|
|
4085
4065
|
d("h3", null, "2. Сопоставьте колонки"),
|
|
4086
4066
|
d("p", null, "Выберите поле ресурса для каждой колонки файла")
|
|
4087
4067
|
], -1)),
|
|
4088
|
-
e.headers.length === 0 ? (s(), c("div",
|
|
4089
|
-
(s(!0), c(T, null,
|
|
4068
|
+
e.headers.length === 0 ? (s(), c("div", mi, " Нет данных — host ещё не отдал headers. Загрузите файл сначала. ")) : (s(), c("div", fi, [
|
|
4069
|
+
(s(!0), c(T, null, I(e.headers, (z) => (s(), c("div", {
|
|
4090
4070
|
key: z.key,
|
|
4091
4071
|
class: "admin-import-wizard__map-row"
|
|
4092
4072
|
}, [
|
|
4093
|
-
d("div",
|
|
4073
|
+
d("div", vi, [
|
|
4094
4074
|
d("strong", null, h(z.label), 1),
|
|
4095
|
-
z.sample ? (s(), c("span",
|
|
4075
|
+
z.sample ? (s(), c("span", pi, " «" + h(z.sample) + "» ", 1)) : F("", !0)
|
|
4096
4076
|
]),
|
|
4097
4077
|
$[4] || ($[4] = d("span", { class: "admin-import-wizard__map-arrow" }, "→", -1)),
|
|
4098
4078
|
x(r(Re), {
|
|
4099
|
-
"model-value":
|
|
4100
|
-
options:
|
|
4079
|
+
"model-value": y.value[z.key] ?? "",
|
|
4080
|
+
options: L.value,
|
|
4101
4081
|
placeholder: "Не импортировать",
|
|
4102
4082
|
"onUpdate:modelValue": (G) => S(z.key, G)
|
|
4103
4083
|
}, null, 8, ["model-value", "options", "onUpdate:modelValue"])
|
|
@@ -4105,107 +4085,107 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4105
4085
|
]))
|
|
4106
4086
|
]),
|
|
4107
4087
|
_: 1
|
|
4108
|
-
})) : i.value === 2 ? (s(),
|
|
4088
|
+
})) : i.value === 2 ? (s(), b(r(q), {
|
|
4109
4089
|
key: 2,
|
|
4110
4090
|
padding: "md",
|
|
4111
4091
|
class: "admin-import-wizard__card"
|
|
4112
4092
|
}, {
|
|
4113
|
-
default:
|
|
4114
|
-
d("header",
|
|
4093
|
+
default: f(() => [
|
|
4094
|
+
d("header", gi, [
|
|
4115
4095
|
$[6] || ($[6] = d("h3", null, "3. Предпросмотр", -1)),
|
|
4116
4096
|
d("p", null, "Первые " + h(e.preview.length) + " строк перед импортом", 1)
|
|
4117
4097
|
]),
|
|
4118
|
-
e.preview.some((z) => z.__warning) ? (s(),
|
|
4098
|
+
e.preview.some((z) => z.__warning) ? (s(), b(r(Q), {
|
|
4119
4099
|
key: 0,
|
|
4120
4100
|
variant: "warning",
|
|
4121
4101
|
style: { "margin-bottom": "var(--uid-space-md)" }
|
|
4122
4102
|
}, {
|
|
4123
|
-
default:
|
|
4103
|
+
default: f(() => [...$[7] || ($[7] = [
|
|
4124
4104
|
C(" Часть строк имеет предупреждения — проверьте перед импортом. ", -1)
|
|
4125
4105
|
])]),
|
|
4126
4106
|
_: 1
|
|
4127
4107
|
})) : F("", !0),
|
|
4128
|
-
e.previewColumns.length > 0 ? (s(),
|
|
4108
|
+
e.previewColumns.length > 0 ? (s(), b(r(We), {
|
|
4129
4109
|
key: 1,
|
|
4130
4110
|
columns: e.previewColumns,
|
|
4131
4111
|
data: e.preview
|
|
4132
|
-
}, null, 8, ["columns", "data"])) : (s(), c("div",
|
|
4112
|
+
}, null, 8, ["columns", "data"])) : (s(), c("div", hi, " Host не передал previewColumns/preview. "))
|
|
4133
4113
|
]),
|
|
4134
4114
|
_: 1
|
|
4135
|
-
})) : (s(),
|
|
4115
|
+
})) : (s(), b(r(q), {
|
|
4136
4116
|
key: 3,
|
|
4137
4117
|
padding: "md",
|
|
4138
4118
|
class: "admin-import-wizard__card"
|
|
4139
4119
|
}, {
|
|
4140
|
-
default:
|
|
4120
|
+
default: f(() => [
|
|
4141
4121
|
$[8] || ($[8] = d("header", { class: "admin-import-wizard__card-hd" }, [
|
|
4142
4122
|
d("h3", null, "4. Импорт")
|
|
4143
4123
|
], -1)),
|
|
4144
4124
|
e.progress ? (s(), c(T, { key: 1 }, [
|
|
4145
|
-
e.progress.total > 0 ? (s(),
|
|
4125
|
+
e.progress.total > 0 ? (s(), b(r(en), {
|
|
4146
4126
|
key: 0,
|
|
4147
4127
|
"model-value": e.progress.created + e.progress.updated + e.progress.errors,
|
|
4148
4128
|
max: e.progress.total
|
|
4149
4129
|
}, null, 8, ["model-value", "max"])) : F("", !0),
|
|
4150
|
-
d("div",
|
|
4151
|
-
x(r(
|
|
4130
|
+
d("div", yi, [
|
|
4131
|
+
x(r(Se), {
|
|
4152
4132
|
title: "Создано",
|
|
4153
4133
|
value: e.progress.created,
|
|
4154
4134
|
tone: "success"
|
|
4155
4135
|
}, null, 8, ["value"]),
|
|
4156
|
-
x(r(
|
|
4136
|
+
x(r(Se), {
|
|
4157
4137
|
title: "Обновлено",
|
|
4158
4138
|
value: e.progress.updated,
|
|
4159
4139
|
tone: "info"
|
|
4160
4140
|
}, null, 8, ["value"]),
|
|
4161
|
-
x(r(
|
|
4141
|
+
x(r(Se), {
|
|
4162
4142
|
title: "Ошибки",
|
|
4163
4143
|
value: e.progress.errors,
|
|
4164
4144
|
tone: "danger"
|
|
4165
4145
|
}, null, 8, ["value"])
|
|
4166
4146
|
])
|
|
4167
|
-
], 64)) : (s(), c("div",
|
|
4147
|
+
], 64)) : (s(), c("div", _i, " Запускается импорт… "))
|
|
4168
4148
|
]),
|
|
4169
4149
|
_: 1
|
|
4170
4150
|
})),
|
|
4171
|
-
d("footer",
|
|
4172
|
-
g.value ? (s(),
|
|
4151
|
+
d("footer", bi, [
|
|
4152
|
+
g.value ? (s(), b(r(V), {
|
|
4173
4153
|
key: 0,
|
|
4174
4154
|
variant: "ghost",
|
|
4175
4155
|
onClick: $[0] || ($[0] = (z) => u(i.value - 1))
|
|
4176
4156
|
}, {
|
|
4177
|
-
default:
|
|
4157
|
+
default: f(() => [...$[9] || ($[9] = [
|
|
4178
4158
|
C(" Назад ", -1)
|
|
4179
4159
|
])]),
|
|
4180
4160
|
_: 1
|
|
4181
4161
|
})) : F("", !0),
|
|
4182
4162
|
$[13] || ($[13] = d("span", { style: { flex: "1" } }, null, -1)),
|
|
4183
|
-
i.value === 0 ? (s(),
|
|
4163
|
+
i.value === 0 ? (s(), b(r(V), {
|
|
4184
4164
|
key: 1,
|
|
4185
4165
|
variant: "primary",
|
|
4186
4166
|
disabled: !U.value,
|
|
4187
4167
|
onClick: $[1] || ($[1] = (z) => u(1))
|
|
4188
4168
|
}, {
|
|
4189
|
-
default:
|
|
4169
|
+
default: f(() => [...$[10] || ($[10] = [
|
|
4190
4170
|
C(" Далее ", -1)
|
|
4191
4171
|
])]),
|
|
4192
4172
|
_: 1
|
|
4193
|
-
}, 8, ["disabled"])) : i.value === 1 ? (s(),
|
|
4173
|
+
}, 8, ["disabled"])) : i.value === 1 ? (s(), b(r(V), {
|
|
4194
4174
|
key: 2,
|
|
4195
4175
|
variant: "primary",
|
|
4196
4176
|
disabled: !U.value,
|
|
4197
4177
|
onClick: A
|
|
4198
4178
|
}, {
|
|
4199
|
-
default:
|
|
4179
|
+
default: f(() => [...$[11] || ($[11] = [
|
|
4200
4180
|
C(" Подтвердить mapping ", -1)
|
|
4201
4181
|
])]),
|
|
4202
4182
|
_: 1
|
|
4203
|
-
}, 8, ["disabled"])) : i.value === 2 ? (s(),
|
|
4183
|
+
}, 8, ["disabled"])) : i.value === 2 ? (s(), b(r(V), {
|
|
4204
4184
|
key: 3,
|
|
4205
4185
|
variant: "primary",
|
|
4206
4186
|
onClick: _
|
|
4207
4187
|
}, {
|
|
4208
|
-
default:
|
|
4188
|
+
default: f(() => [...$[12] || ($[12] = [
|
|
4209
4189
|
C(" Запустить импорт ", -1)
|
|
4210
4190
|
])]),
|
|
4211
4191
|
_: 1
|
|
@@ -4213,7 +4193,7 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4213
4193
|
])
|
|
4214
4194
|
]));
|
|
4215
4195
|
}
|
|
4216
|
-
}),
|
|
4196
|
+
}), ki = { class: "admin-page admin-field-gallery" }, wi = { class: "admin-gallery__group-title" }, $i = { class: "admin-gallery__grid" }, xi = { class: "admin-gallery__card-hd" }, Ci = { class: "admin-gallery__card-title" }, Si = { class: "admin-gallery__card-type" }, Ai = { class: "admin-gallery__card-desc" }, Ri = { class: "admin-gallery__card-demo" }, so = /* @__PURE__ */ P({
|
|
4217
4197
|
__name: "FieldGalleryPage",
|
|
4218
4198
|
setup(e) {
|
|
4219
4199
|
const t = [
|
|
@@ -4277,36 +4257,36 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4277
4257
|
node: { type: "date", name: "demo_date", label: "Дата публикации", inputType: "date" },
|
|
4278
4258
|
initial: { demo_date: "2026-05-01" }
|
|
4279
4259
|
}
|
|
4280
|
-
], 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(
|
|
4281
4261
|
t.reduce((a, l) => Object.assign(a, l.initial), {})
|
|
4282
4262
|
);
|
|
4283
|
-
return
|
|
4263
|
+
return ft(o), (a, l) => (s(), c("section", ki, [
|
|
4284
4264
|
l[0] || (l[0] = d("header", { class: "admin-page__hd" }, [
|
|
4285
4265
|
d("div", { class: "admin-page__title-wrap" }, [
|
|
4286
4266
|
d("h1", { class: "admin-page__title" }, "Field Gallery"),
|
|
4287
4267
|
d("div", { class: "admin-page__count" }, " Каталог встроенных field-компонентов library + примеры использования ")
|
|
4288
4268
|
])
|
|
4289
4269
|
], -1)),
|
|
4290
|
-
(s(!0), c(T, null,
|
|
4270
|
+
(s(!0), c(T, null, I(r(n), (i, u) => (s(), c("section", {
|
|
4291
4271
|
key: u,
|
|
4292
4272
|
class: "admin-gallery__group"
|
|
4293
4273
|
}, [
|
|
4294
|
-
d("h2",
|
|
4295
|
-
d("div",
|
|
4296
|
-
(s(!0), c(T, null,
|
|
4297
|
-
key:
|
|
4274
|
+
d("h2", wi, h(u), 1),
|
|
4275
|
+
d("div", $i, [
|
|
4276
|
+
(s(!0), c(T, null, I(i, (m) => (s(), b(r(q), {
|
|
4277
|
+
key: m.type + m.title,
|
|
4298
4278
|
padding: "md",
|
|
4299
4279
|
class: "admin-gallery__card"
|
|
4300
4280
|
}, {
|
|
4301
|
-
default:
|
|
4302
|
-
d("header",
|
|
4303
|
-
d("h3",
|
|
4304
|
-
d("code",
|
|
4281
|
+
default: f(() => [
|
|
4282
|
+
d("header", xi, [
|
|
4283
|
+
d("h3", Ci, h(m.title), 1),
|
|
4284
|
+
d("code", Si, "type: " + h(m.type), 1)
|
|
4305
4285
|
]),
|
|
4306
|
-
d("p",
|
|
4307
|
-
d("div",
|
|
4308
|
-
x(
|
|
4309
|
-
node:
|
|
4286
|
+
d("p", Ai, h(m.description), 1),
|
|
4287
|
+
d("div", Ri, [
|
|
4288
|
+
x(kt, {
|
|
4289
|
+
node: m.node
|
|
4310
4290
|
}, null, 8, ["node"])
|
|
4311
4291
|
])
|
|
4312
4292
|
]),
|
|
@@ -4318,118 +4298,118 @@ const Hs = { class: "admin-notifs__hd" }, Xs = { class: "admin-notifs__title" },
|
|
|
4318
4298
|
}
|
|
4319
4299
|
});
|
|
4320
4300
|
export {
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4301
|
+
Rn as AdminApp,
|
|
4302
|
+
An as AdminShell,
|
|
4303
|
+
xn as AdminSidebar,
|
|
4304
|
+
gn as AdminTopBar,
|
|
4305
|
+
Z as ApiError,
|
|
4306
|
+
Is as BadgeEntry,
|
|
4307
|
+
Ol as BarChartWidget,
|
|
4308
|
+
ze as CheckboxField,
|
|
4309
|
+
Es as ColumnsLayout,
|
|
4310
|
+
Nl as DashboardPage,
|
|
4331
4311
|
re as DateField,
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4312
|
+
Ql as DonutChartWidget,
|
|
4313
|
+
so as FieldGalleryPage,
|
|
4314
|
+
kt as FieldRenderer,
|
|
4315
|
+
un as ForbiddenError,
|
|
4336
4316
|
In as ForbiddenPage,
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4317
|
+
rs as GaugeWidget,
|
|
4318
|
+
ls as HeatmapWidget,
|
|
4319
|
+
Nn as HomePage,
|
|
4320
|
+
Ds as IconEntry,
|
|
4321
|
+
lo as ImportWizardPage,
|
|
4322
|
+
Ha as InfolistRenderer,
|
|
4323
|
+
at as KeyValueEntry,
|
|
4324
|
+
we as LayoutRenderer,
|
|
4325
|
+
pt as LocaleSwitcher,
|
|
4326
|
+
ea as LoginForm,
|
|
4327
|
+
ma as LoginPage,
|
|
4328
|
+
ms as MarkdownWidget,
|
|
4349
4329
|
Te as NetworkError,
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4330
|
+
dn as NotFoundError,
|
|
4331
|
+
zn as NotFoundPage,
|
|
4332
|
+
rn as NotificationBell,
|
|
4333
|
+
ao as NotificationsDrawer,
|
|
4334
|
+
Ve as NumberField,
|
|
4335
|
+
xl as ProfilePage,
|
|
4336
|
+
ts as RecentTableWidget,
|
|
4337
|
+
et as ResourceFormPage,
|
|
4338
|
+
Aa as ResourceIndexPage,
|
|
4339
|
+
nl as ResourceViewPage,
|
|
4340
|
+
nt as RowsLayout,
|
|
4361
4341
|
he as SectionLayout,
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4342
|
+
te as SelectField,
|
|
4343
|
+
Kn as SettingsPage,
|
|
4344
|
+
Bl as StatWidget,
|
|
4345
|
+
Ms as TabsLayout,
|
|
4346
|
+
Ce as TextAreaField,
|
|
4347
|
+
B as TextEntry,
|
|
4368
4348
|
J as TextField,
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4349
|
+
vt as ThemeToggle,
|
|
4350
|
+
aa as TwoFactorForm,
|
|
4351
|
+
gt as UnauthenticatedError,
|
|
4352
|
+
Ba as UnknownEntry,
|
|
4353
|
+
bt as UnknownField,
|
|
4354
|
+
Xn as UnknownScreenPage,
|
|
4355
|
+
Al as UnknownWidget,
|
|
4356
|
+
mn as UserMenu,
|
|
4377
4357
|
Pe as ValidationError,
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4358
|
+
Rl as WidgetRenderer,
|
|
4359
|
+
xs as buildRoutesFromManifest,
|
|
4360
|
+
Mi as clearAdminClient,
|
|
4361
|
+
Gi as clearInfolistRegistry,
|
|
4362
|
+
Oi as clearRegistry,
|
|
4363
|
+
Qi as clearWidgetRegistry,
|
|
4364
|
+
eo as createAdminApp,
|
|
4365
|
+
ps as createAdminClient,
|
|
4366
|
+
Us as createAdminRouter,
|
|
4367
|
+
Cs as createAuthGuard,
|
|
4368
|
+
Ss as createTitleGuard,
|
|
4369
|
+
K as getAdminClient,
|
|
4370
|
+
yt as getField,
|
|
4371
|
+
tt as getInfolistEntry,
|
|
4372
|
+
Ze as getLayout,
|
|
4373
|
+
Cl as getWidget,
|
|
4374
|
+
Ni as hasAdminClient,
|
|
4375
|
+
Ii as hasField,
|
|
4376
|
+
Ki as hasInfolistEntry,
|
|
4377
|
+
Di as hasLayout,
|
|
4378
|
+
Ji as hasWidget,
|
|
4379
|
+
Zi as isError,
|
|
4380
|
+
vs as isSuccess,
|
|
4381
|
+
Vi as listFields,
|
|
4382
|
+
ji as listInfolistEntries,
|
|
4383
|
+
qi as listLayouts,
|
|
4384
|
+
Yi as listWidgets,
|
|
4385
|
+
to as loadBootstrap,
|
|
4386
|
+
ft as provideFormState,
|
|
4387
|
+
Xa as provideRecord,
|
|
4388
|
+
no as readCsrfFromMeta,
|
|
4389
|
+
Ks as readInlineBootstrap,
|
|
4390
|
+
Ns as registerBuiltinComponents,
|
|
4391
|
+
Os as registerBuiltinInfolistEntries,
|
|
4392
|
+
fs as registerBuiltinWidgets,
|
|
4393
|
+
Ra as registerComponents,
|
|
4394
|
+
Bi as registerField,
|
|
4395
|
+
Na as registerInfolistEntries,
|
|
4396
|
+
Wi as registerInfolistEntry,
|
|
4397
|
+
zi as registerLayout,
|
|
4398
|
+
Xi as registerWidget,
|
|
4399
|
+
Sl as registerWidgets,
|
|
4400
|
+
nn as setAdminClient,
|
|
4401
|
+
Ye as toApiError,
|
|
4402
|
+
ro as tryUseFormState,
|
|
4423
4403
|
Ne as tryUseRecord,
|
|
4424
4404
|
Y as useAuthStore,
|
|
4425
4405
|
ce as useFormState,
|
|
4426
|
-
|
|
4406
|
+
Ge as useLocaleStore,
|
|
4427
4407
|
ie as useManifestStore,
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4408
|
+
ht as useMenuStore,
|
|
4409
|
+
He as useNotificationsStore,
|
|
4410
|
+
Hi as useRecord,
|
|
4411
|
+
_t as useResourceFormStore,
|
|
4412
|
+
fa as useResourceIndexStore,
|
|
4413
|
+
je as useThemeStore
|
|
4434
4414
|
};
|
|
4435
4415
|
//# sourceMappingURL=index.mjs.map
|