@webx-ui/module-admin 0.24.0 → 0.25.1
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/Screen.d.ts +23 -2
- package/dist/index.js +588 -586
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject as be, reactive as ot, defineComponent as X, useModel as ze, ref as E, watch as ue, computed as
|
|
1
|
+
import { inject as be, reactive as ot, defineComponent as X, useModel as ze, ref as E, watch as ue, computed as _, openBlock as c, createElementBlock as C, createVNode as x, unref as a, withCtx as b, createElementVNode as D, toDisplayString as T, createBlock as N, createTextVNode as M, createCommentVNode as B, mergeModels as Ae, mergeProps as Nt, provide as ut, normalizeClass as ke, createSlots as Ue, nextTick as dt, useId as In, Fragment as G, onMounted as Ee, renderList as ce, withModifiers as Rt, useSlots as Mn, useTemplateRef as Vt, renderSlot as fe, useAttrs as On, normalizeProps as Pn, guardReactiveProps as Bn, resolveComponent as me, watchEffect as jn, onUnmounted as Dn, isRef as mn, createApp as Fn, h as Oe, onBeforeUnmount as ct, shallowRef as st, getCurrentScope as Hn, onScopeDispose as Kn, readonly as Ve, withKeys as hn } from "vue";
|
|
2
2
|
import { RouterLink as qn, useRouter as He, useRoute as pn, createRouter as Yn, createWebHistory as Jn, onBeforeRouteLeave as Xn } from "vue-router";
|
|
3
3
|
import { WxSortableList as Ut, WxAction as Ne, WxBadge as Ke, WxSelect as je, WxAutocomplete as xt, WxSwitch as pt, WxInputNumber as Gn, WxButton as re, WxSegmented as Qn, WxText as ne, WxInput as qe, WxCheckbox as Gt, WxTooltip as It, WxEmpty as it, WxSkeleton as Ce, WxAvatar as gn, WxDialog as Mt, toast as Z, WxActions as Zn, WxDropdownItem as el, useElementWidth as tl, WxHeading as yn, WxIcon as ft, WxTabs as nl, WxCard as $t, WxRichText as ll, useLocales as Ot, WxAlert as ye, WxResult as bn, useResponsiveShell as al, shellLayoutFor as ol, WxToaster as sl, WebxUI as il, dateLocaleKey as rl, dateTimezoneKey as ul, localesKey as dl, confirm as We, useModal as cl, WxFormItem as fl, WxSpace as vl, createModal as ml, localizedValue as hl, WxBreadcrumb as pl, WxBreadcrumbItem as Qt, WxActionBar as gl, WxPopover as yl, WxTextarea as Zt } from "@webx-ui/core";
|
|
4
4
|
import { watchSystemTheme as bl, applyTheme as wl, systemTheme as _l } from "@webx-ui/tokens";
|
|
@@ -34,7 +34,7 @@ function Pt(e = {}) {
|
|
|
34
34
|
return typeof m == "string" ? m : null;
|
|
35
35
|
}
|
|
36
36
|
function i(r, u, v) {
|
|
37
|
-
const [m, f] = u.includes("::") ? u.split("::", 2) : [r, u],
|
|
37
|
+
const [m, f] = u.includes("::") ? u.split("::", 2) : [r, u], d = f.split("."), y = s(l.value, m, d) ?? s(o, m, d) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
|
|
38
38
|
// label says nothing to anybody trying to fix it.
|
|
39
39
|
u;
|
|
40
40
|
return v === void 0 ? y : Sl(y, v);
|
|
@@ -102,34 +102,34 @@ const Al = { class: "wx-categories-field" }, Cl = { class: "wx-categories-field_
|
|
|
102
102
|
const t = e, n = ze(e, "modelValue"), o = oe(), l = ee("webx-admin"), s = E([]);
|
|
103
103
|
ue(
|
|
104
104
|
() => t.source,
|
|
105
|
-
async (
|
|
105
|
+
async (d) => {
|
|
106
106
|
try {
|
|
107
|
-
const y = await Ie(o,
|
|
108
|
-
s.value = y.data.map((
|
|
107
|
+
const y = await Ie(o, d).list();
|
|
108
|
+
s.value = y.data.map((w) => ({ id: w.id, name: w.name }));
|
|
109
109
|
} catch {
|
|
110
110
|
s.value = [];
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
{ immediate: !0 }
|
|
114
114
|
);
|
|
115
|
-
const i =
|
|
116
|
-
get: () => i.value.map((
|
|
117
|
-
set: (
|
|
118
|
-
n.value =
|
|
115
|
+
const i = _(() => Array.isArray(n.value) ? n.value : []), r = _(() => new Map(s.value.map((d) => [d.id, d.name]))), u = _({
|
|
116
|
+
get: () => i.value.map((d) => ({ id: d, name: r.value.get(d) ?? `#${d}` })),
|
|
117
|
+
set: (d) => {
|
|
118
|
+
n.value = d.map((y) => y.id);
|
|
119
119
|
}
|
|
120
|
-
}), v =
|
|
121
|
-
() => s.value.filter((
|
|
120
|
+
}), v = _(
|
|
121
|
+
() => s.value.filter((d) => !i.value.includes(d.id)).map((d) => ({ label: d.name, value: d.id }))
|
|
122
122
|
);
|
|
123
|
-
function m(
|
|
124
|
-
typeof
|
|
123
|
+
function m(d) {
|
|
124
|
+
typeof d != "number" || i.value.includes(d) || (n.value = [...i.value, d]);
|
|
125
125
|
}
|
|
126
|
-
function f(
|
|
127
|
-
n.value = i.value.filter((y) => y !==
|
|
126
|
+
function f(d) {
|
|
127
|
+
n.value = i.value.filter((y) => y !== d);
|
|
128
128
|
}
|
|
129
|
-
return (
|
|
130
|
-
|
|
129
|
+
return (d, y) => (c(), C("div", Al, [
|
|
130
|
+
x(a(Ut), {
|
|
131
131
|
modelValue: u.value,
|
|
132
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
132
|
+
"onUpdate:modelValue": y[0] || (y[0] = (w) => u.value = w),
|
|
133
133
|
plain: "",
|
|
134
134
|
size: "sm",
|
|
135
135
|
"item-key": "id",
|
|
@@ -137,9 +137,9 @@ const Al = { class: "wx-categories-field" }, Cl = { class: "wx-categories-field_
|
|
|
137
137
|
disabled: t.disabled,
|
|
138
138
|
"empty-text": t.emptyText ?? a(l)("categories.field-empty")
|
|
139
139
|
}, {
|
|
140
|
-
default: b(({ item:
|
|
141
|
-
D("span", Cl, T(
|
|
142
|
-
t.main && h === 0 ? (
|
|
140
|
+
default: b(({ item: w, index: h }) => [
|
|
141
|
+
D("span", Cl, T(w.name), 1),
|
|
142
|
+
t.main && h === 0 ? (c(), N(a(Ke), {
|
|
143
143
|
key: 0,
|
|
144
144
|
type: "primary"
|
|
145
145
|
}, {
|
|
@@ -149,18 +149,18 @@ const Al = { class: "wx-categories-field" }, Cl = { class: "wx-categories-field_
|
|
|
149
149
|
_: 1
|
|
150
150
|
})) : B("", !0)
|
|
151
151
|
]),
|
|
152
|
-
actions: b(({ item:
|
|
153
|
-
|
|
152
|
+
actions: b(({ item: w }) => [
|
|
153
|
+
x(a(Ne), {
|
|
154
154
|
type: "remove",
|
|
155
155
|
size: "sm",
|
|
156
156
|
disabled: t.disabled,
|
|
157
157
|
title: t.removeText ?? a(l)("categories.field-remove"),
|
|
158
|
-
onClick: (h) => f(
|
|
158
|
+
onClick: (h) => f(w.id)
|
|
159
159
|
}, null, 8, ["disabled", "title", "onClick"])
|
|
160
160
|
]),
|
|
161
161
|
_: 1
|
|
162
162
|
}, 8, ["modelValue", "disabled", "empty-text"]),
|
|
163
|
-
|
|
163
|
+
x(a(je), {
|
|
164
164
|
"model-value": null,
|
|
165
165
|
options: v.value,
|
|
166
166
|
placeholder: t.addText ?? a(l)("categories.field-add"),
|
|
@@ -204,8 +204,8 @@ const Al = { class: "wx-categories-field" }, Cl = { class: "wx-categories-field_
|
|
|
204
204
|
},
|
|
205
205
|
{ immediate: !0 }
|
|
206
206
|
);
|
|
207
|
-
const l =
|
|
208
|
-
return (s, i) => (
|
|
207
|
+
const l = _(() => t.source ? o.value : t.options);
|
|
208
|
+
return (s, i) => (c(), N(a(je), Nt(s.$attrs, { options: l.value }), null, 16, ["options"]));
|
|
209
209
|
}
|
|
210
210
|
});
|
|
211
211
|
class De extends Error {
|
|
@@ -234,48 +234,48 @@ function Nl(e = {}) {
|
|
|
234
234
|
async function r(m = !1) {
|
|
235
235
|
i && !m && en("XSRF-TOKEN") !== null || (await o(n, { credentials: "same-origin" }), i = !0);
|
|
236
236
|
}
|
|
237
|
-
async function u(m, f,
|
|
238
|
-
const
|
|
239
|
-
|
|
237
|
+
async function u(m, f, d = {}, y = !1) {
|
|
238
|
+
const w = El.has(m);
|
|
239
|
+
w && await r();
|
|
240
240
|
const h = {
|
|
241
241
|
Accept: "application/json",
|
|
242
242
|
"X-Requested-With": "XMLHttpRequest",
|
|
243
243
|
// Standing headers first, so a caller can still override one for a single request.
|
|
244
244
|
...s?.(),
|
|
245
|
-
...
|
|
245
|
+
...d.headers
|
|
246
246
|
};
|
|
247
|
-
if (
|
|
247
|
+
if (w) {
|
|
248
248
|
const p = en("XSRF-TOKEN");
|
|
249
249
|
p !== null && (h["X-XSRF-TOKEN"] = p);
|
|
250
250
|
}
|
|
251
|
-
|
|
252
|
-
const W = await o(Rl(t, f,
|
|
251
|
+
d.json === !0 && (h["Content-Type"] = "application/json");
|
|
252
|
+
const W = await o(Rl(t, f, d.query), {
|
|
253
253
|
method: m,
|
|
254
254
|
credentials: "same-origin",
|
|
255
255
|
headers: h,
|
|
256
|
-
signal:
|
|
257
|
-
body:
|
|
256
|
+
signal: d.signal,
|
|
257
|
+
body: d.body ?? void 0
|
|
258
258
|
});
|
|
259
|
-
return W.status === 419 &&
|
|
259
|
+
return W.status === 419 && w && !y ? (await r(!0), u(m, f, d, !0)) : (W.status === 401 && l?.(), W);
|
|
260
260
|
}
|
|
261
|
-
async function v(m, f,
|
|
262
|
-
const
|
|
261
|
+
async function v(m, f, d, y = {}) {
|
|
262
|
+
const w = await u(m, f, {
|
|
263
263
|
...y,
|
|
264
|
-
json:
|
|
265
|
-
body:
|
|
264
|
+
json: d !== void 0,
|
|
265
|
+
body: d === void 0 ? void 0 : JSON.stringify(d)
|
|
266
266
|
});
|
|
267
|
-
if (!
|
|
268
|
-
throw await St(
|
|
269
|
-
if (
|
|
270
|
-
return await
|
|
267
|
+
if (!w.ok)
|
|
268
|
+
throw await St(w);
|
|
269
|
+
if (w.status !== 204)
|
|
270
|
+
return await w.json();
|
|
271
271
|
}
|
|
272
272
|
return {
|
|
273
273
|
get: (m, f) => v("GET", m, void 0, f),
|
|
274
|
-
post: (m, f,
|
|
275
|
-
put: (m, f,
|
|
276
|
-
patch: (m, f,
|
|
274
|
+
post: (m, f, d) => v("POST", m, f, d),
|
|
275
|
+
put: (m, f, d) => v("PUT", m, f, d),
|
|
276
|
+
patch: (m, f, d) => v("PATCH", m, f, d),
|
|
277
277
|
delete: (m, f) => v("DELETE", m, void 0, f),
|
|
278
|
-
send: (m, f,
|
|
278
|
+
send: (m, f, d) => u(m.toUpperCase(), f, d)
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
async function St(e) {
|
|
@@ -355,8 +355,8 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
355
355
|
}),
|
|
356
356
|
emits: ["update:modelValue"],
|
|
357
357
|
setup(e) {
|
|
358
|
-
const t = e, n = ze(e, "modelValue"), o = oe(), l = Il(), s = ee("webx-admin"), i =
|
|
359
|
-
function
|
|
358
|
+
const t = e, n = ze(e, "modelValue"), o = oe(), l = Il(), s = ee("webx-admin"), i = _(() => Vl(o, t.target)), r = E(/* @__PURE__ */ new Map()), u = E(/* @__PURE__ */ new Set()), v = E(!1), m = E([]), f = E(!1), d = E(""), y = _(() => Ul(n.value));
|
|
359
|
+
function w(U) {
|
|
360
360
|
const L = new Map(r.value);
|
|
361
361
|
for (const j of U) L.set(j.id, j);
|
|
362
362
|
r.value = L;
|
|
@@ -366,7 +366,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
366
366
|
if (!(L.length === 0 || v.value))
|
|
367
367
|
try {
|
|
368
368
|
const j = await i.value.named(L);
|
|
369
|
-
|
|
369
|
+
w(j);
|
|
370
370
|
const J = new Set(j.map((le) => le.id));
|
|
371
371
|
u.value = /* @__PURE__ */ new Set([...u.value, ...L.filter((le) => !J.has(le))]);
|
|
372
372
|
} catch (j) {
|
|
@@ -381,7 +381,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
381
381
|
), ue(y, (U) => {
|
|
382
382
|
h(U);
|
|
383
383
|
}, { immediate: !0 });
|
|
384
|
-
const W =
|
|
384
|
+
const W = _({
|
|
385
385
|
get: () => y.value.map((U) => {
|
|
386
386
|
const L = r.value.get(U) ?? null;
|
|
387
387
|
return { id: U, title: L?.title || `#${U}`, candidate: L };
|
|
@@ -389,7 +389,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
389
389
|
set: (U) => {
|
|
390
390
|
n.value = U.map((L) => L.id);
|
|
391
391
|
}
|
|
392
|
-
}), p =
|
|
392
|
+
}), p = _(() => t.max !== null && y.value.length >= t.max), V = _(() => l !== null && l.type === t.target ? l.id.value : null), H = _(
|
|
393
393
|
() => m.value.filter((U) => U.id !== V.value && !y.value.includes(U.id)).map((U) => ({
|
|
394
394
|
value: U.title,
|
|
395
395
|
description: [U.subtitle, U.visible ? null : s("relations.field-hidden")].filter((L) => typeof L == "string" && L !== "").join(" · "),
|
|
@@ -400,7 +400,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
400
400
|
f.value = !0;
|
|
401
401
|
try {
|
|
402
402
|
const L = await i.value.search(U);
|
|
403
|
-
m.value = L,
|
|
403
|
+
m.value = L, w(L);
|
|
404
404
|
} catch (L) {
|
|
405
405
|
m.value = [], L instanceof De && L.status === 403 && (v.value = !0);
|
|
406
406
|
} finally {
|
|
@@ -410,22 +410,22 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
410
410
|
function O(U) {
|
|
411
411
|
const L = Number(U.id);
|
|
412
412
|
!Number.isInteger(L) || y.value.includes(L) || p.value || (n.value = [...y.value, L], dt(() => {
|
|
413
|
-
|
|
413
|
+
d.value = "";
|
|
414
414
|
}));
|
|
415
415
|
}
|
|
416
416
|
function g(U) {
|
|
417
417
|
n.value = y.value.filter((L) => L !== U);
|
|
418
418
|
}
|
|
419
|
-
const S =
|
|
419
|
+
const S = _(() => t.disabled || v.value), k = _(
|
|
420
420
|
() => p.value ? s("relations.field-full", { max: String(t.max) }) : t.addText ?? s("relations.field-add")
|
|
421
421
|
);
|
|
422
422
|
function I(U) {
|
|
423
423
|
return U.candidate === null ? u.value.has(U.id) ? s("relations.field-missing") : null : U.candidate.trashed === !0 ? s("relations.field-trashed") : U.candidate.visible ? null : s("relations.field-hidden");
|
|
424
424
|
}
|
|
425
|
-
return (U, L) => (
|
|
425
|
+
return (U, L) => (c(), C("div", {
|
|
426
426
|
class: ke(["wx-relations-field", { "is-unordered": !t.sortable }])
|
|
427
427
|
}, [
|
|
428
|
-
|
|
428
|
+
x(a(Ut), {
|
|
429
429
|
modelValue: W.value,
|
|
430
430
|
"onUpdate:modelValue": L[0] || (L[0] = (j) => W.value = j),
|
|
431
431
|
plain: "",
|
|
@@ -437,7 +437,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
437
437
|
"drag-label": a(s)("relations.field-drag")
|
|
438
438
|
}, Ue({
|
|
439
439
|
default: b(({ item: j }) => [
|
|
440
|
-
j.candidate?.thumb ? (
|
|
440
|
+
j.candidate?.thumb ? (c(), C("img", {
|
|
441
441
|
key: 0,
|
|
442
442
|
class: "wx-relations-field__thumb",
|
|
443
443
|
src: j.candidate.thumb,
|
|
@@ -445,9 +445,9 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
445
445
|
}, null, 8, Ml)) : B("", !0),
|
|
446
446
|
D("span", Ol, [
|
|
447
447
|
D("span", Pl, T(j.title), 1),
|
|
448
|
-
j.candidate?.subtitle ? (
|
|
448
|
+
j.candidate?.subtitle ? (c(), C("span", Bl, T(j.candidate.subtitle), 1)) : B("", !0)
|
|
449
449
|
]),
|
|
450
|
-
I(j) ? (
|
|
450
|
+
I(j) ? (c(), N(a(Ke), {
|
|
451
451
|
key: 1,
|
|
452
452
|
type: "warning"
|
|
453
453
|
}, {
|
|
@@ -462,7 +462,7 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
462
462
|
S.value ? void 0 : {
|
|
463
463
|
name: "actions",
|
|
464
464
|
fn: b(({ item: j }) => [
|
|
465
|
-
|
|
465
|
+
x(a(Ne), {
|
|
466
466
|
type: "remove",
|
|
467
467
|
size: "sm",
|
|
468
468
|
title: a(s)("relations.field-remove"),
|
|
@@ -472,10 +472,10 @@ const Ml = ["src"], Ol = { class: "wx-relations-field__text" }, Pl = { class: "w
|
|
|
472
472
|
key: "0"
|
|
473
473
|
}
|
|
474
474
|
]), 1032, ["modelValue", "disabled", "empty-text", "drag-label"]),
|
|
475
|
-
v.value ? (
|
|
476
|
-
|
|
477
|
-
modelValue:
|
|
478
|
-
"onUpdate:modelValue": L[1] || (L[1] = (j) =>
|
|
475
|
+
v.value ? (c(), C("p", jl, T(a(s)("relations.field-forbidden")), 1)) : (c(), C("div", Dl, [
|
|
476
|
+
x(a(xt), {
|
|
477
|
+
modelValue: d.value,
|
|
478
|
+
"onUpdate:modelValue": L[1] || (L[1] = (j) => d.value = j),
|
|
479
479
|
options: H.value,
|
|
480
480
|
remote: "",
|
|
481
481
|
teleport: "",
|
|
@@ -580,23 +580,23 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
580
580
|
},
|
|
581
581
|
{ immediate: !0 }
|
|
582
582
|
);
|
|
583
|
-
const u =
|
|
583
|
+
const u = _(() => tn(n.value));
|
|
584
584
|
function v(g) {
|
|
585
585
|
n.value = tn({ ...u.value, ...g });
|
|
586
586
|
}
|
|
587
|
-
const m =
|
|
587
|
+
const m = _(() => {
|
|
588
588
|
const g = new Set(r.value.map((k) => k.value)), S = u.value.categories.filter((k) => !g.has(k)).map((k) => ({ label: `#${k}`, value: k }));
|
|
589
589
|
return [...r.value, ...S];
|
|
590
590
|
});
|
|
591
591
|
function f(g) {
|
|
592
592
|
v({ categories: Array.isArray(g) ? g.map(Number) : [] });
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function d(g) {
|
|
595
595
|
v({ limit: g ?? null });
|
|
596
596
|
}
|
|
597
|
-
const y = E(null),
|
|
597
|
+
const y = E(null), w = _(
|
|
598
598
|
() => (i.value?.relations ?? []).map((g) => ({ label: g.title, value: g.key }))
|
|
599
|
-
), h =
|
|
599
|
+
), h = _(() => {
|
|
600
600
|
const g = i.value?.relations ?? [];
|
|
601
601
|
if (g.length === 1) return g[0];
|
|
602
602
|
const S = u.value.related?.type ?? y.value;
|
|
@@ -613,27 +613,27 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
613
613
|
const S = h.value?.key;
|
|
614
614
|
v({ related: g && S ? { type: S, ids: [], current: !0 } : null });
|
|
615
615
|
}
|
|
616
|
-
const H =
|
|
616
|
+
const H = _(() => u.value.markup ?? nn(u.value));
|
|
617
617
|
function z(g) {
|
|
618
618
|
v({ markup: g === !0 });
|
|
619
619
|
}
|
|
620
|
-
const O =
|
|
620
|
+
const O = _(
|
|
621
621
|
() => l(
|
|
622
622
|
nn(u.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
|
|
623
623
|
)
|
|
624
624
|
);
|
|
625
|
-
return (g, S) => (
|
|
625
|
+
return (g, S) => (c(), C("div", {
|
|
626
626
|
class: "wx-collection-field",
|
|
627
627
|
"aria-busy": i.value === void 0
|
|
628
628
|
}, [
|
|
629
|
-
i.value === null ? (
|
|
629
|
+
i.value === null ? (c(), C("p", Jl, T(a(l)("collections.field-unavailable", { source: t.source })), 1)) : i.value ? (c(), C(G, { key: 1 }, [
|
|
630
630
|
D("p", Xl, T(a(l)("collections.field-source", { source: i.value.title })), 1),
|
|
631
|
-
i.value.categories ? (
|
|
631
|
+
i.value.categories ? (c(), C("div", Gl, [
|
|
632
632
|
D("label", {
|
|
633
633
|
class: "wx-collection-field__label",
|
|
634
634
|
for: `${a(s)}-categories`
|
|
635
635
|
}, T(a(l)("collections.field-categories")), 9, Ql),
|
|
636
|
-
|
|
636
|
+
x(a(je), {
|
|
637
637
|
id: `${a(s)}-categories`,
|
|
638
638
|
"model-value": u.value.categories,
|
|
639
639
|
options: m.value,
|
|
@@ -647,12 +647,12 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
647
647
|
"onUpdate:modelValue": f
|
|
648
648
|
}, null, 8, ["id", "model-value", "options", "placeholder", "empty-text", "disabled"])
|
|
649
649
|
])) : B("", !0),
|
|
650
|
-
i.value.relations.length > 0 ? (
|
|
650
|
+
i.value.relations.length > 0 ? (c(), C("div", Zl, [
|
|
651
651
|
D("span", ea, T(i.value.relations.length === 1 ? a(l)("relations.collection-related-to", { target: i.value.relations[0].title }) : a(l)("relations.collection-related")), 1),
|
|
652
|
-
i.value.relations.length > 1 ? (
|
|
652
|
+
i.value.relations.length > 1 ? (c(), N(a(je), {
|
|
653
653
|
key: 0,
|
|
654
654
|
"model-value": h.value?.key ?? null,
|
|
655
|
-
options:
|
|
655
|
+
options: w.value,
|
|
656
656
|
placeholder: a(l)("relations.collection-related-type"),
|
|
657
657
|
"aria-label": a(l)("relations.collection-related-type"),
|
|
658
658
|
disabled: t.disabled,
|
|
@@ -660,8 +660,8 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
660
660
|
teleport: "",
|
|
661
661
|
"onUpdate:modelValue": W
|
|
662
662
|
}, null, 8, ["model-value", "options", "placeholder", "aria-label", "disabled"])) : B("", !0),
|
|
663
|
-
h.value ? (
|
|
664
|
-
|
|
663
|
+
h.value ? (c(), C(G, { key: 1 }, [
|
|
664
|
+
x(a(pt), {
|
|
665
665
|
"model-value": u.value.related?.current === !0,
|
|
666
666
|
label: a(l)("relations.collection-related-current"),
|
|
667
667
|
disabled: t.disabled,
|
|
@@ -669,7 +669,7 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
669
669
|
}, null, 8, ["model-value", "label", "disabled"]),
|
|
670
670
|
D("p", ta, T(a(l)("relations.collection-related-current-hint", { target: h.value.title })), 1)
|
|
671
671
|
], 64)) : B("", !0),
|
|
672
|
-
h.value && u.value.related?.current !== !0 ? (
|
|
672
|
+
h.value && u.value.related?.current !== !0 ? (c(), N(_n, {
|
|
673
673
|
key: 2,
|
|
674
674
|
"model-value": u.value.related?.ids ?? [],
|
|
675
675
|
target: h.value.key,
|
|
@@ -685,7 +685,7 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
685
685
|
for: `${a(s)}-limit`
|
|
686
686
|
}, T(a(l)("collections.field-limit")), 9, la),
|
|
687
687
|
D("div", aa, [
|
|
688
|
-
|
|
688
|
+
x(a(Gn), {
|
|
689
689
|
id: `${a(s)}-limit`,
|
|
690
690
|
"model-value": u.value.limit,
|
|
691
691
|
min: 1,
|
|
@@ -694,26 +694,26 @@ const Yl = ["aria-busy"], Jl = {
|
|
|
694
694
|
precision: 0,
|
|
695
695
|
placeholder: a(l)("collections.field-limit-all"),
|
|
696
696
|
disabled: t.disabled,
|
|
697
|
-
"onUpdate:modelValue":
|
|
697
|
+
"onUpdate:modelValue": d
|
|
698
698
|
}, null, 8, ["id", "model-value", "max", "placeholder", "disabled"])
|
|
699
699
|
])
|
|
700
700
|
]),
|
|
701
|
-
i.value.categories ? (
|
|
701
|
+
i.value.categories ? (c(), N(a(pt), {
|
|
702
702
|
key: 2,
|
|
703
703
|
"model-value": u.value.filter,
|
|
704
704
|
label: a(l)("collections.field-filter"),
|
|
705
705
|
disabled: t.disabled,
|
|
706
706
|
"onUpdate:modelValue": S[1] || (S[1] = (k) => v({ filter: k === !0 }))
|
|
707
707
|
}, null, 8, ["model-value", "label", "disabled"])) : B("", !0),
|
|
708
|
-
i.value.markup ? (
|
|
709
|
-
|
|
708
|
+
i.value.markup ? (c(), C("div", oa, [
|
|
709
|
+
x(a(pt), {
|
|
710
710
|
"model-value": H.value,
|
|
711
711
|
label: a(l)("collections.field-markup"),
|
|
712
712
|
disabled: t.disabled,
|
|
713
713
|
"onUpdate:modelValue": z
|
|
714
714
|
}, null, 8, ["model-value", "label", "disabled"]),
|
|
715
715
|
D("p", sa, T(O.value), 1),
|
|
716
|
-
u.value.markup !== null ? (
|
|
716
|
+
u.value.markup !== null ? (c(), N(a(re), {
|
|
717
717
|
key: 0,
|
|
718
718
|
class: "wx-collection-field__reset",
|
|
719
719
|
variant: "text",
|
|
@@ -776,24 +776,24 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
776
776
|
}),
|
|
777
777
|
emits: ["update:modelValue"],
|
|
778
778
|
setup(e) {
|
|
779
|
-
const t = e, n = ze(e, "modelValue"), o = oe(), l = xl(), s = da(o), i = ee("webx-admin"), r = E([]), u = E([]), v = E([]), m = E(!1), f = E(null),
|
|
780
|
-
let
|
|
781
|
-
const h =
|
|
782
|
-
const
|
|
779
|
+
const t = e, n = ze(e, "modelValue"), o = oe(), l = xl(), s = da(o), i = ee("webx-admin"), r = E([]), u = E([]), v = E([]), m = E(!1), f = E(null), d = E(""), y = E(null);
|
|
780
|
+
let w = null;
|
|
781
|
+
const h = _(() => n.value ?? ua()), W = _(() => {
|
|
782
|
+
const $ = [
|
|
783
783
|
{ value: "entity", label: i("links.target-entity") },
|
|
784
784
|
{ value: "url", label: i("links.target-url") }
|
|
785
785
|
];
|
|
786
|
-
return t.allowNone ? [
|
|
787
|
-
}), p =
|
|
788
|
-
() => r.value.map((
|
|
789
|
-
), V =
|
|
790
|
-
() => u.value.map((
|
|
791
|
-
value:
|
|
792
|
-
description:
|
|
793
|
-
id:
|
|
786
|
+
return t.allowNone ? [...$, { value: "none", label: i("links.target-none") }] : $;
|
|
787
|
+
}), p = _(
|
|
788
|
+
() => r.value.map(($) => ({ value: $.type, label: $.title }))
|
|
789
|
+
), V = _(
|
|
790
|
+
() => u.value.map(($) => ({
|
|
791
|
+
value: $.title,
|
|
792
|
+
description: ve($),
|
|
793
|
+
id: $.id
|
|
794
794
|
}))
|
|
795
|
-
), H =
|
|
796
|
-
() => v.value.map((
|
|
795
|
+
), H = _(
|
|
796
|
+
() => v.value.map(($) => ({ value: $.path, description: $.name }))
|
|
797
797
|
);
|
|
798
798
|
Ee(async () => {
|
|
799
799
|
r.value = await s.sources(), f.value = h.value.entity_type ?? r.value[0]?.type ?? null, await Promise.all([z(), O()]);
|
|
@@ -804,77 +804,77 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
804
804
|
}
|
|
805
805
|
);
|
|
806
806
|
async function z() {
|
|
807
|
-
const { entity_type:
|
|
808
|
-
if (
|
|
809
|
-
y.value = null,
|
|
807
|
+
const { entity_type: $, entity_id: P } = h.value;
|
|
808
|
+
if ($ === null || P === null) {
|
|
809
|
+
y.value = null, d.value = "";
|
|
810
810
|
return;
|
|
811
811
|
}
|
|
812
812
|
if (y.value?.id === P)
|
|
813
813
|
return;
|
|
814
|
-
const [F] = await s.resolve([{ type:
|
|
815
|
-
y.value = F ?? null,
|
|
814
|
+
const [F] = await s.resolve([{ type: $, id: P }], l.state.locale);
|
|
815
|
+
y.value = F ?? null, d.value = F?.title ?? i("links.missing"), w = d.value;
|
|
816
816
|
}
|
|
817
817
|
async function O() {
|
|
818
818
|
v.value = await s.routes();
|
|
819
819
|
}
|
|
820
|
-
async function g(
|
|
821
|
-
if (
|
|
822
|
-
|
|
820
|
+
async function g($) {
|
|
821
|
+
if ($ === w) {
|
|
822
|
+
w = null;
|
|
823
823
|
return;
|
|
824
824
|
}
|
|
825
|
-
if (
|
|
825
|
+
if (w = null, f.value !== null) {
|
|
826
826
|
m.value = !0;
|
|
827
827
|
try {
|
|
828
|
-
u.value = await s.search(f.value,
|
|
828
|
+
u.value = await s.search(f.value, $, l.state.locale);
|
|
829
829
|
} finally {
|
|
830
830
|
m.value = !1;
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
|
-
function S(
|
|
835
|
-
|
|
834
|
+
function S($) {
|
|
835
|
+
$ !== void 0 && (n.value = { ...h.value, target: $ });
|
|
836
836
|
}
|
|
837
|
-
function k(
|
|
838
|
-
f.value =
|
|
837
|
+
function k($) {
|
|
838
|
+
f.value = $ == null ? null : String($), u.value = [], g("");
|
|
839
839
|
}
|
|
840
|
-
function I(
|
|
841
|
-
const P = u.value.find((F) => F.id ===
|
|
842
|
-
P === void 0 || f.value === null || (y.value = P,
|
|
840
|
+
function I($) {
|
|
841
|
+
const P = u.value.find((F) => F.id === $.id);
|
|
842
|
+
P === void 0 || f.value === null || (y.value = P, d.value = P.title, n.value = { ...h.value, entity_type: f.value, entity_id: P.id });
|
|
843
843
|
}
|
|
844
844
|
function U() {
|
|
845
|
-
y.value = null,
|
|
845
|
+
y.value = null, d.value = "", u.value = [], n.value = { ...h.value, entity_type: null, entity_id: null };
|
|
846
846
|
}
|
|
847
|
-
function L(
|
|
848
|
-
n.value = { ...h.value, url:
|
|
847
|
+
function L($) {
|
|
848
|
+
n.value = { ...h.value, url: $ === "" ? null : $ };
|
|
849
849
|
}
|
|
850
|
-
function j(
|
|
851
|
-
const P = (typeof
|
|
850
|
+
function j($) {
|
|
851
|
+
const P = (typeof $ == "string" || typeof $ == "number" ? String($) : "").replace(/^#+/, "").trim();
|
|
852
852
|
n.value = { ...h.value, hash: P === "" ? null : P };
|
|
853
853
|
}
|
|
854
|
-
function J(
|
|
855
|
-
n.value = { ...h.value, new_tab:
|
|
854
|
+
function J($) {
|
|
855
|
+
n.value = { ...h.value, new_tab: $ };
|
|
856
856
|
}
|
|
857
|
-
function le(
|
|
858
|
-
const F = h.value.rel.filter((te) => te !==
|
|
859
|
-
n.value = { ...h.value, rel: P ? [...F,
|
|
857
|
+
function le($, P) {
|
|
858
|
+
const F = h.value.rel.filter((te) => te !== $);
|
|
859
|
+
n.value = { ...h.value, rel: P ? [...F, $] : F };
|
|
860
860
|
}
|
|
861
|
-
function
|
|
862
|
-
const P = [
|
|
861
|
+
function ve($) {
|
|
862
|
+
const P = [$.hint, $.url ?? void 0].filter(
|
|
863
863
|
(F) => typeof F == "string" && F !== ""
|
|
864
864
|
);
|
|
865
|
-
return
|
|
865
|
+
return $.available || P.push(i("links.unavailable")), P.join(" · ");
|
|
866
866
|
}
|
|
867
867
|
const K = ["nofollow", "sponsored", "ugc"];
|
|
868
|
-
return (
|
|
869
|
-
|
|
868
|
+
return ($, P) => (c(), C("div", ca, [
|
|
869
|
+
x(a(Qn), {
|
|
870
870
|
options: W.value,
|
|
871
871
|
"model-value": h.value.target,
|
|
872
872
|
disabled: t.disabled,
|
|
873
873
|
"aria-label": a(i)("links.target-entity"),
|
|
874
874
|
"onUpdate:modelValue": S
|
|
875
875
|
}, null, 8, ["options", "model-value", "disabled", "aria-label"]),
|
|
876
|
-
h.value.target === "entity" ? (
|
|
877
|
-
p.value.length > 1 ? (
|
|
876
|
+
h.value.target === "entity" ? (c(), C("div", fa, [
|
|
877
|
+
p.value.length > 1 ? (c(), N(a(je), {
|
|
878
878
|
key: 0,
|
|
879
879
|
class: "wx-link-picker__section",
|
|
880
880
|
options: p.value,
|
|
@@ -883,9 +883,9 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
883
883
|
"aria-label": a(i)("links.section"),
|
|
884
884
|
"onUpdate:modelValue": k
|
|
885
885
|
}, null, 8, ["options", "model-value", "disabled", "aria-label"])) : B("", !0),
|
|
886
|
-
|
|
886
|
+
x(a(xt), {
|
|
887
887
|
class: "wx-link-picker__search",
|
|
888
|
-
"model-value":
|
|
888
|
+
"model-value": d.value,
|
|
889
889
|
options: V.value,
|
|
890
890
|
remote: "",
|
|
891
891
|
clearable: "",
|
|
@@ -895,13 +895,13 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
895
895
|
placeholder: a(i)("links.search"),
|
|
896
896
|
"aria-label": a(i)("links.search"),
|
|
897
897
|
disabled: t.disabled,
|
|
898
|
-
"onUpdate:modelValue": P[0] || (P[0] = (F) =>
|
|
898
|
+
"onUpdate:modelValue": P[0] || (P[0] = (F) => d.value = F),
|
|
899
899
|
onSearch: g,
|
|
900
900
|
onSelect: I,
|
|
901
901
|
onClear: U
|
|
902
902
|
}, null, 8, ["model-value", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
903
|
-
])) : h.value.target === "url" ? (
|
|
904
|
-
|
|
903
|
+
])) : h.value.target === "url" ? (c(), C("div", va, [
|
|
904
|
+
x(a(xt), {
|
|
905
905
|
"model-value": h.value.url ?? "",
|
|
906
906
|
options: H.value,
|
|
907
907
|
clearable: "",
|
|
@@ -913,8 +913,8 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
913
913
|
"onUpdate:modelValue": L
|
|
914
914
|
}, null, 8, ["model-value", "options", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
915
915
|
])) : B("", !0),
|
|
916
|
-
h.value.target !== "none" ? (
|
|
917
|
-
|
|
916
|
+
h.value.target !== "none" ? (c(), C("label", ma, [
|
|
917
|
+
x(a(ne), {
|
|
918
918
|
size: "sm",
|
|
919
919
|
tone: "muted"
|
|
920
920
|
}, {
|
|
@@ -927,7 +927,7 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
927
927
|
class: "wx-link-picker__sign",
|
|
928
928
|
"aria-hidden": "true"
|
|
929
929
|
}, "#", -1)),
|
|
930
|
-
|
|
930
|
+
x(a(qe), {
|
|
931
931
|
"model-value": h.value.hash ?? "",
|
|
932
932
|
placeholder: a(i)("links.hash-placeholder"),
|
|
933
933
|
"aria-label": a(i)("links.hash"),
|
|
@@ -936,8 +936,8 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
936
936
|
"onUpdate:modelValue": j
|
|
937
937
|
}, null, 8, ["model-value", "placeholder", "aria-label", "disabled"])
|
|
938
938
|
])) : B("", !0),
|
|
939
|
-
t.attributes && h.value.target !== "none" ? (
|
|
940
|
-
|
|
939
|
+
t.attributes && h.value.target !== "none" ? (c(), C("div", ha, [
|
|
940
|
+
x(a(Gt), {
|
|
941
941
|
"model-value": h.value.new_tab,
|
|
942
942
|
disabled: t.disabled,
|
|
943
943
|
"onUpdate:modelValue": P[1] || (P[1] = (F) => J(F))
|
|
@@ -948,7 +948,7 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
948
948
|
_: 1
|
|
949
949
|
}, 8, ["model-value", "disabled"]),
|
|
950
950
|
D("div", pa, [
|
|
951
|
-
|
|
951
|
+
x(a(ne), {
|
|
952
952
|
size: "sm",
|
|
953
953
|
tone: "muted"
|
|
954
954
|
}, {
|
|
@@ -957,7 +957,7 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
957
957
|
]),
|
|
958
958
|
_: 1
|
|
959
959
|
}),
|
|
960
|
-
(
|
|
960
|
+
(c(), C(G, null, ce(K, (F) => x(a(Gt), {
|
|
961
961
|
key: F,
|
|
962
962
|
"model-value": h.value.rel.includes(F),
|
|
963
963
|
disabled: t.disabled,
|
|
@@ -987,7 +987,7 @@ const ca = { class: "wx-link-picker" }, fa = {
|
|
|
987
987
|
emits: ["update:modelValue"],
|
|
988
988
|
setup(e) {
|
|
989
989
|
const t = e, n = ze(e, "modelValue");
|
|
990
|
-
return (o, l) => (
|
|
990
|
+
return (o, l) => (c(), N(ya, Nt({
|
|
991
991
|
modelValue: n.value,
|
|
992
992
|
"onUpdate:modelValue": l[0] || (l[0] = (s) => n.value = s)
|
|
993
993
|
}, o.$attrs, {
|
|
@@ -1460,13 +1460,13 @@ const Fe = /* @__PURE__ */ X({
|
|
|
1460
1460
|
tone: { default: "muted" }
|
|
1461
1461
|
},
|
|
1462
1462
|
setup(e) {
|
|
1463
|
-
const t = e, n = mt(), o =
|
|
1464
|
-
return (i, r) => l.value ? (
|
|
1463
|
+
const t = e, n = mt(), o = _(() => t.compact ? n.compact(t.value) : n.short(t.value)), l = _(() => n.exact(t.value)), s = _(() => n.iso(t.value));
|
|
1464
|
+
return (i, r) => l.value ? (c(), N(a(It), {
|
|
1465
1465
|
key: 0,
|
|
1466
1466
|
content: l.value
|
|
1467
1467
|
}, {
|
|
1468
1468
|
default: b(() => [
|
|
1469
|
-
|
|
1469
|
+
x(a(ne), {
|
|
1470
1470
|
as: "time",
|
|
1471
1471
|
datetime: s.value,
|
|
1472
1472
|
size: e.size,
|
|
@@ -1479,7 +1479,7 @@ const Fe = /* @__PURE__ */ X({
|
|
|
1479
1479
|
}, 8, ["datetime", "size", "tone"])
|
|
1480
1480
|
]),
|
|
1481
1481
|
_: 1
|
|
1482
|
-
}, 8, ["content"])) : (
|
|
1482
|
+
}, 8, ["content"])) : (c(), N(a(ne), {
|
|
1483
1483
|
key: 1,
|
|
1484
1484
|
size: e.size,
|
|
1485
1485
|
tone: e.tone
|
|
@@ -1571,17 +1571,17 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1571
1571
|
title: { default: void 0 }
|
|
1572
1572
|
},
|
|
1573
1573
|
setup(e, { expose: t }) {
|
|
1574
|
-
const n = e, o = oe(), l = ee("webx-admin"), s = Ye(), i = Aa(), r = E([]), u = E(1), v = E(1), m = E(!1), f = E(!1),
|
|
1575
|
-
() =>
|
|
1576
|
-
),
|
|
1574
|
+
const n = e, o = oe(), l = ee("webx-admin"), s = Ye(), i = Aa(), r = E([]), u = E(1), v = E(1), m = E(!1), f = E(!1), d = _(() => n.id ?? i?.id.value ?? null), y = _(
|
|
1575
|
+
() => d.value === null ? null : Sa(o, n.type, d.value)
|
|
1576
|
+
), w = _(() => n.title ?? l("history.title"));
|
|
1577
1577
|
async function h() {
|
|
1578
1578
|
if (r.value = [], u.value = 1, v.value = 1, y.value !== null) {
|
|
1579
1579
|
m.value = !0;
|
|
1580
1580
|
try {
|
|
1581
|
-
const
|
|
1582
|
-
r.value =
|
|
1583
|
-
} catch (
|
|
1584
|
-
Z.danger(s(
|
|
1581
|
+
const $ = await y.value.list(1);
|
|
1582
|
+
r.value = $.data, v.value = $.last_page;
|
|
1583
|
+
} catch ($) {
|
|
1584
|
+
Z.danger(s($));
|
|
1585
1585
|
} finally {
|
|
1586
1586
|
m.value = !1;
|
|
1587
1587
|
}
|
|
@@ -1591,48 +1591,48 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1591
1591
|
if (!(y.value === null || f.value)) {
|
|
1592
1592
|
f.value = !0;
|
|
1593
1593
|
try {
|
|
1594
|
-
const
|
|
1595
|
-
r.value = [...r.value,
|
|
1596
|
-
} catch (
|
|
1597
|
-
Z.danger(s(
|
|
1594
|
+
const $ = await y.value.list(u.value + 1);
|
|
1595
|
+
r.value = [...r.value, ...$.data], u.value = $.current_page, v.value = $.last_page;
|
|
1596
|
+
} catch ($) {
|
|
1597
|
+
Z.danger(s($));
|
|
1598
1598
|
} finally {
|
|
1599
1599
|
f.value = !1;
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
1602
|
}
|
|
1603
|
-
ue([() => n.type,
|
|
1603
|
+
ue([() => n.type, d], () => {
|
|
1604
1604
|
h();
|
|
1605
1605
|
}, { immediate: !0 }), t({ reload: h });
|
|
1606
|
-
function p(
|
|
1607
|
-
return
|
|
1606
|
+
function p($) {
|
|
1607
|
+
return $.admin?.name ?? l("history.unknown-author");
|
|
1608
1608
|
}
|
|
1609
|
-
function V(
|
|
1610
|
-
return `${l(`history.event-${
|
|
1609
|
+
function V($) {
|
|
1610
|
+
return `${l(`history.event-${$.event}`)} · ${l(`history.source-${$.source}`)}`;
|
|
1611
1611
|
}
|
|
1612
|
-
function H(
|
|
1613
|
-
return yt(
|
|
1612
|
+
function H($) {
|
|
1613
|
+
return yt($.from, l("history.empty-value"));
|
|
1614
1614
|
}
|
|
1615
|
-
function z(
|
|
1616
|
-
return yt(
|
|
1615
|
+
function z($) {
|
|
1616
|
+
return yt($.to, l("history.empty-value"));
|
|
1617
1617
|
}
|
|
1618
|
-
function O(
|
|
1618
|
+
function O($) {
|
|
1619
1619
|
return l("history.long", {
|
|
1620
|
-
from: String(
|
|
1621
|
-
to: String(
|
|
1620
|
+
from: String($.from_length ?? 0),
|
|
1621
|
+
to: String($.to_length ?? 0)
|
|
1622
1622
|
});
|
|
1623
1623
|
}
|
|
1624
|
-
function g(
|
|
1625
|
-
const P =
|
|
1624
|
+
function g($) {
|
|
1625
|
+
const P = $.run?.summary?.what;
|
|
1626
1626
|
return typeof P == "string" && P !== "" ? `${l("history.run")} · ${P}` : l("history.run");
|
|
1627
1627
|
}
|
|
1628
1628
|
const S = E(!1), k = E(null), I = E(null), U = E(""), L = E(!1);
|
|
1629
1629
|
let j = 0;
|
|
1630
|
-
async function J(
|
|
1630
|
+
async function J($, P = 1) {
|
|
1631
1631
|
if (y.value === null) return;
|
|
1632
1632
|
L.value = !0;
|
|
1633
1633
|
const F = ++j;
|
|
1634
1634
|
try {
|
|
1635
|
-
const te = /^\d+$/.test(U.value.trim()) ? Number(U.value.trim()) : null, we = await y.value.run(
|
|
1635
|
+
const te = /^\d+$/.test(U.value.trim()) ? Number(U.value.trim()) : null, we = await y.value.run($, P, te);
|
|
1636
1636
|
if (F !== j) return;
|
|
1637
1637
|
k.value = P === 1 || k.value === null ? we : {
|
|
1638
1638
|
run: we.run,
|
|
@@ -1644,54 +1644,54 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1644
1644
|
L.value = !1;
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
|
-
function le(
|
|
1648
|
-
I.value =
|
|
1647
|
+
function le($) {
|
|
1648
|
+
I.value = $, k.value = null, U.value = "", S.value = !0, J($);
|
|
1649
1649
|
}
|
|
1650
1650
|
ue(U, () => {
|
|
1651
1651
|
I.value !== null && S.value && J(I.value);
|
|
1652
1652
|
});
|
|
1653
|
-
const
|
|
1654
|
-
const
|
|
1655
|
-
return Object.entries(
|
|
1656
|
-
}), K =
|
|
1657
|
-
const
|
|
1658
|
-
return typeof
|
|
1653
|
+
const ve = _(() => {
|
|
1654
|
+
const $ = k.value?.run.summary ?? {};
|
|
1655
|
+
return Object.entries($).filter(([P]) => P !== "rows" && P !== "failed").map(([P, F]) => ({ key: P, value: yt(F, l("history.empty-value")) }));
|
|
1656
|
+
}), K = _(() => {
|
|
1657
|
+
const $ = k.value?.run.summary?.failed;
|
|
1658
|
+
return typeof $ == "string" ? $ : null;
|
|
1659
1659
|
});
|
|
1660
|
-
return (
|
|
1661
|
-
|
|
1660
|
+
return ($, P) => (c(), C("section", Ca, [
|
|
1661
|
+
w.value ? (c(), N(a(ne), {
|
|
1662
1662
|
key: 0,
|
|
1663
1663
|
weight: "medium",
|
|
1664
1664
|
class: "wx-history__title"
|
|
1665
1665
|
}, {
|
|
1666
1666
|
default: b(() => [
|
|
1667
|
-
M(T(
|
|
1667
|
+
M(T(w.value), 1)
|
|
1668
1668
|
]),
|
|
1669
1669
|
_: 1
|
|
1670
1670
|
})) : B("", !0),
|
|
1671
|
-
|
|
1671
|
+
d.value === null ? (c(), N(a(it), {
|
|
1672
1672
|
key: 1,
|
|
1673
1673
|
size: "sm",
|
|
1674
1674
|
description: a(l)("history.unsaved")
|
|
1675
|
-
}, null, 8, ["description"])) : m.value ? (
|
|
1675
|
+
}, null, 8, ["description"])) : m.value ? (c(), N(a(Ce), {
|
|
1676
1676
|
key: 2,
|
|
1677
1677
|
rows: 3
|
|
1678
|
-
})) : r.value.length === 0 ? (
|
|
1678
|
+
})) : r.value.length === 0 ? (c(), N(a(it), {
|
|
1679
1679
|
key: 3,
|
|
1680
1680
|
size: "sm",
|
|
1681
1681
|
description: a(l)("history.empty")
|
|
1682
|
-
}, null, 8, ["description"])) : (
|
|
1683
|
-
(
|
|
1682
|
+
}, null, 8, ["description"])) : (c(), C("ul", La, [
|
|
1683
|
+
(c(!0), C(G, null, ce(r.value, (F) => (c(), C("li", {
|
|
1684
1684
|
key: F.id,
|
|
1685
1685
|
class: "wx-history-entry"
|
|
1686
1686
|
}, [
|
|
1687
|
-
|
|
1687
|
+
x(a(gn), {
|
|
1688
1688
|
name: p(F),
|
|
1689
1689
|
size: "sm",
|
|
1690
1690
|
tone: "auto"
|
|
1691
1691
|
}, null, 8, ["name"]),
|
|
1692
1692
|
D("div", Wa, [
|
|
1693
1693
|
D("div", za, [
|
|
1694
|
-
|
|
1694
|
+
x(a(ne), {
|
|
1695
1695
|
size: "sm",
|
|
1696
1696
|
weight: "medium",
|
|
1697
1697
|
truncate: ""
|
|
@@ -1701,11 +1701,11 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1701
1701
|
]),
|
|
1702
1702
|
_: 2
|
|
1703
1703
|
}, 1024),
|
|
1704
|
-
|
|
1704
|
+
x(Fe, {
|
|
1705
1705
|
value: F.created_at
|
|
1706
1706
|
}, null, 8, ["value"])
|
|
1707
1707
|
]),
|
|
1708
|
-
|
|
1708
|
+
x(a(ne), {
|
|
1709
1709
|
size: "sm",
|
|
1710
1710
|
tone: "muted"
|
|
1711
1711
|
}, {
|
|
@@ -1714,13 +1714,13 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1714
1714
|
]),
|
|
1715
1715
|
_: 2
|
|
1716
1716
|
}, 1024),
|
|
1717
|
-
F.changes.length > 0 ? (
|
|
1718
|
-
(
|
|
1717
|
+
F.changes.length > 0 ? (c(), C("ul", Ea, [
|
|
1718
|
+
(c(!0), C(G, null, ce(F.changes, (te) => (c(), C("li", {
|
|
1719
1719
|
key: te.field,
|
|
1720
1720
|
class: "wx-history-change"
|
|
1721
1721
|
}, [
|
|
1722
1722
|
D("span", Na, T(te.label) + ":", 1),
|
|
1723
|
-
te.long ? (
|
|
1723
|
+
te.long ? (c(), C("span", Ra, T(O(te)), 1)) : (c(), C(G, { key: 1 }, [
|
|
1724
1724
|
D("span", Va, T(H(te)), 1),
|
|
1725
1725
|
P[3] || (P[3] = D("span", {
|
|
1726
1726
|
class: "wx-history-change__arrow",
|
|
@@ -1730,7 +1730,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1730
1730
|
], 64))
|
|
1731
1731
|
]))), 128))
|
|
1732
1732
|
])) : B("", !0),
|
|
1733
|
-
F.run ? (
|
|
1733
|
+
F.run ? (c(), C("button", {
|
|
1734
1734
|
key: 1,
|
|
1735
1735
|
type: "button",
|
|
1736
1736
|
class: "wx-history-entry__run",
|
|
@@ -1739,8 +1739,8 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1739
1739
|
])
|
|
1740
1740
|
]))), 128))
|
|
1741
1741
|
])),
|
|
1742
|
-
u.value < v.value ? (
|
|
1743
|
-
|
|
1742
|
+
u.value < v.value ? (c(), C("div", Ma, [
|
|
1743
|
+
x(a(re), {
|
|
1744
1744
|
size: "sm",
|
|
1745
1745
|
loading: f.value,
|
|
1746
1746
|
onClick: W
|
|
@@ -1751,19 +1751,19 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1751
1751
|
_: 1
|
|
1752
1752
|
}, 8, ["loading"])
|
|
1753
1753
|
])) : B("", !0),
|
|
1754
|
-
|
|
1754
|
+
x(a(Mt), {
|
|
1755
1755
|
open: S.value,
|
|
1756
1756
|
"onUpdate:open": P[2] || (P[2] = (F) => S.value = F),
|
|
1757
1757
|
title: a(l)("history.run-title"),
|
|
1758
1758
|
width: 640
|
|
1759
1759
|
}, {
|
|
1760
1760
|
default: b(() => [
|
|
1761
|
-
k.value === null ? (
|
|
1761
|
+
k.value === null ? (c(), N(a(Ce), {
|
|
1762
1762
|
key: 0,
|
|
1763
1763
|
rows: 4
|
|
1764
|
-
})) : (
|
|
1764
|
+
})) : (c(), C("div", Oa, [
|
|
1765
1765
|
D("div", Pa, [
|
|
1766
|
-
|
|
1766
|
+
x(a(ne), {
|
|
1767
1767
|
size: "sm",
|
|
1768
1768
|
weight: "medium"
|
|
1769
1769
|
}, {
|
|
@@ -1772,11 +1772,11 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1772
1772
|
]),
|
|
1773
1773
|
_: 1
|
|
1774
1774
|
}),
|
|
1775
|
-
|
|
1775
|
+
x(Fe, {
|
|
1776
1776
|
value: k.value.run.created_at
|
|
1777
1777
|
}, null, 8, ["value"])
|
|
1778
1778
|
]),
|
|
1779
|
-
|
|
1779
|
+
x(a(ne), {
|
|
1780
1780
|
size: "sm",
|
|
1781
1781
|
tone: "muted"
|
|
1782
1782
|
}, {
|
|
@@ -1785,21 +1785,21 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1785
1785
|
]),
|
|
1786
1786
|
_: 1
|
|
1787
1787
|
}),
|
|
1788
|
-
|
|
1789
|
-
(
|
|
1788
|
+
ve.value.length > 0 ? (c(), C("dl", Ba, [
|
|
1789
|
+
(c(!0), C(G, null, ce(ve.value, (F) => (c(), C(G, {
|
|
1790
1790
|
key: F.key
|
|
1791
1791
|
}, [
|
|
1792
1792
|
D("dt", null, T(F.key), 1),
|
|
1793
1793
|
D("dd", null, T(F.value), 1)
|
|
1794
1794
|
], 64))), 128))
|
|
1795
1795
|
])) : B("", !0),
|
|
1796
|
-
|
|
1796
|
+
x(a(ne), { size: "sm" }, {
|
|
1797
1797
|
default: b(() => [
|
|
1798
1798
|
M(T(a(l)("history.run-rows", { count: String(k.value.run.rows ?? 0) })), 1)
|
|
1799
1799
|
]),
|
|
1800
1800
|
_: 1
|
|
1801
1801
|
}),
|
|
1802
|
-
K.value ? (
|
|
1802
|
+
K.value ? (c(), N(a(ne), {
|
|
1803
1803
|
key: 1,
|
|
1804
1804
|
size: "sm",
|
|
1805
1805
|
tone: "danger"
|
|
@@ -1809,7 +1809,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1809
1809
|
]),
|
|
1810
1810
|
_: 1
|
|
1811
1811
|
})) : B("", !0),
|
|
1812
|
-
|
|
1812
|
+
x(a(qe), {
|
|
1813
1813
|
modelValue: U.value,
|
|
1814
1814
|
"onUpdate:modelValue": P[0] || (P[0] = (F) => U.value = F),
|
|
1815
1815
|
size: "sm",
|
|
@@ -1818,11 +1818,11 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1818
1818
|
clearable: ""
|
|
1819
1819
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
1820
1820
|
D("ul", ja, [
|
|
1821
|
-
(
|
|
1821
|
+
(c(!0), C(G, null, ce(k.value.rows.data, (F) => (c(), C("li", {
|
|
1822
1822
|
key: F.id,
|
|
1823
1823
|
class: "wx-history-run__row"
|
|
1824
1824
|
}, [
|
|
1825
|
-
|
|
1825
|
+
x(a(ne), {
|
|
1826
1826
|
size: "sm",
|
|
1827
1827
|
weight: "medium"
|
|
1828
1828
|
}, {
|
|
@@ -1832,12 +1832,12 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1832
1832
|
_: 2
|
|
1833
1833
|
}, 1024),
|
|
1834
1834
|
D("ul", Da, [
|
|
1835
|
-
(
|
|
1835
|
+
(c(!0), C(G, null, ce(F.changes, (te) => (c(), C("li", {
|
|
1836
1836
|
key: te.field,
|
|
1837
1837
|
class: "wx-history-change"
|
|
1838
1838
|
}, [
|
|
1839
1839
|
D("span", Fa, T(te.label) + ":", 1),
|
|
1840
|
-
te.long ? (
|
|
1840
|
+
te.long ? (c(), C("span", Ha, T(O(te)), 1)) : (c(), C(G, { key: 1 }, [
|
|
1841
1841
|
D("span", Ka, T(H(te)), 1),
|
|
1842
1842
|
P[4] || (P[4] = D("span", {
|
|
1843
1843
|
class: "wx-history-change__arrow",
|
|
@@ -1849,8 +1849,8 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1849
1849
|
])
|
|
1850
1850
|
]))), 128))
|
|
1851
1851
|
]),
|
|
1852
|
-
k.value.rows.current_page < k.value.rows.last_page ? (
|
|
1853
|
-
|
|
1852
|
+
k.value.rows.current_page < k.value.rows.last_page ? (c(), C("div", Ya, [
|
|
1853
|
+
x(a(re), {
|
|
1854
1854
|
size: "sm",
|
|
1855
1855
|
loading: L.value,
|
|
1856
1856
|
onClick: P[1] || (P[1] = (F) => I.value !== null && J(I.value, k.value.rows.current_page + 1))
|
|
@@ -1875,8 +1875,8 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1875
1875
|
size: { default: "sm" }
|
|
1876
1876
|
},
|
|
1877
1877
|
setup(e) {
|
|
1878
|
-
const t = e, n = ee("webx-admin"), o =
|
|
1879
|
-
return (l, s) => (
|
|
1878
|
+
const t = e, n = ee("webx-admin"), o = _(() => t.label ?? n("editor.back"));
|
|
1879
|
+
return (l, s) => (c(), N(a(Ne), {
|
|
1880
1880
|
icon: "arrow-left",
|
|
1881
1881
|
class: "wx-back-button",
|
|
1882
1882
|
as: a(qn),
|
|
@@ -1897,14 +1897,14 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1897
1897
|
size: { default: "sm" }
|
|
1898
1898
|
},
|
|
1899
1899
|
setup(e) {
|
|
1900
|
-
const t = ee("webx-admin"), n = e, o =
|
|
1900
|
+
const t = ee("webx-admin"), n = e, o = _(() => [
|
|
1901
1901
|
...n.actions.filter((s) => !s.danger),
|
|
1902
1902
|
...n.actions.filter((s) => s.danger)
|
|
1903
|
-
]), l =
|
|
1903
|
+
]), l = _(() => {
|
|
1904
1904
|
const s = o.value.find((i) => i.danger);
|
|
1905
1905
|
return s && o.value[0] !== s ? s.key : null;
|
|
1906
1906
|
});
|
|
1907
|
-
return (s, i) => o.value.length > 0 ? (
|
|
1907
|
+
return (s, i) => o.value.length > 0 ? (c(), N(a(Zn), {
|
|
1908
1908
|
key: 0,
|
|
1909
1909
|
class: "wx-row-menu",
|
|
1910
1910
|
collapse: "always",
|
|
@@ -1915,18 +1915,18 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1915
1915
|
}, ["stop"]))
|
|
1916
1916
|
}, {
|
|
1917
1917
|
trigger: b(() => [
|
|
1918
|
-
|
|
1918
|
+
x(a(Ne), {
|
|
1919
1919
|
type: "more",
|
|
1920
1920
|
size: e.size,
|
|
1921
1921
|
title: a(t)("editor.more")
|
|
1922
1922
|
}, null, 8, ["size", "title"])
|
|
1923
1923
|
]),
|
|
1924
1924
|
collapsed: b(() => [
|
|
1925
|
-
(
|
|
1925
|
+
(c(!0), C(G, null, ce(o.value, (r) => (c(), C(G, {
|
|
1926
1926
|
key: r.key
|
|
1927
1927
|
}, [
|
|
1928
|
-
r.key === l.value ? (
|
|
1929
|
-
|
|
1928
|
+
r.key === l.value ? (c(), C("hr", Qa)) : B("", !0),
|
|
1929
|
+
x(a(el), {
|
|
1930
1930
|
icon: r.icon,
|
|
1931
1931
|
tone: r.danger ? "danger" : "default",
|
|
1932
1932
|
href: r.href,
|
|
@@ -1964,14 +1964,14 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1964
1964
|
},
|
|
1965
1965
|
emits: ["back"],
|
|
1966
1966
|
setup(e, { emit: t }) {
|
|
1967
|
-
const n = e, o = t, l = ee("webx-admin"), s = Mn(), i = Vt("root"), r = tl(i), u =
|
|
1967
|
+
const n = e, o = t, l = ee("webx-admin"), s = Mn(), i = Vt("root"), r = tl(i), u = _(() => r.value > 0 && r.value < n.collapseBelow), v = _(() => n.actions ?? []), m = _(
|
|
1968
1968
|
() => v.value.find((h) => h.primary) ?? null
|
|
1969
|
-
), f =
|
|
1969
|
+
), f = _(() => u.value ? m.value ? [m.value] : [] : v.value.filter((h) => !h.menu && !h.danger)), d = _(() => u.value ? v.value.filter((h) => h !== m.value) : v.value.filter((h) => h.menu || h.danger)), y = _(
|
|
1970
1970
|
() => n.back && n.back !== !0 ? n.back : null
|
|
1971
|
-
),
|
|
1972
|
-
() => f.value.length > 0 ||
|
|
1971
|
+
), w = _(
|
|
1972
|
+
() => f.value.length > 0 || d.value.length > 0 || !!s.extra
|
|
1973
1973
|
);
|
|
1974
|
-
return (h, W) => (
|
|
1974
|
+
return (h, W) => (c(), C("div", {
|
|
1975
1975
|
ref_key: "root",
|
|
1976
1976
|
ref: i,
|
|
1977
1977
|
class: ke(["wx-screen-head", {
|
|
@@ -1982,16 +1982,16 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
1982
1982
|
}]),
|
|
1983
1983
|
"data-level": e.level
|
|
1984
1984
|
}, [
|
|
1985
|
-
h.$slots.trail ? (
|
|
1986
|
-
|
|
1985
|
+
h.$slots.trail ? (c(), C("div", to, [
|
|
1986
|
+
fe(h.$slots, "trail", {}, void 0, !0)
|
|
1987
1987
|
])) : B("", !0),
|
|
1988
|
-
y.value ? (
|
|
1988
|
+
y.value ? (c(), N(Ga, {
|
|
1989
1989
|
key: 1,
|
|
1990
1990
|
class: "wx-screen-head__back",
|
|
1991
1991
|
to: y.value,
|
|
1992
1992
|
label: e.backLabel,
|
|
1993
1993
|
"tooltip-side": "bottom"
|
|
1994
|
-
}, null, 8, ["to", "label"])) : e.back ? (
|
|
1994
|
+
}, null, 8, ["to", "label"])) : e.back ? (c(), N(a(Ne), {
|
|
1995
1995
|
key: 2,
|
|
1996
1996
|
class: "wx-screen-head__back",
|
|
1997
1997
|
icon: "arrow-left",
|
|
@@ -2001,7 +2001,7 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2001
2001
|
onClick: W[0] || (W[0] = (p) => o("back"))
|
|
2002
2002
|
}, null, 8, ["title"])) : B("", !0),
|
|
2003
2003
|
D("div", no, [
|
|
2004
|
-
e.title ? (
|
|
2004
|
+
e.title ? (c(), N(a(yn), {
|
|
2005
2005
|
key: 0,
|
|
2006
2006
|
level: e.level,
|
|
2007
2007
|
truncate: "",
|
|
@@ -2012,9 +2012,9 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2012
2012
|
]),
|
|
2013
2013
|
_: 1
|
|
2014
2014
|
}, 8, ["level"])) : B("", !0),
|
|
2015
|
-
|
|
2015
|
+
fe(h.$slots, "title-after", {}, void 0, !0)
|
|
2016
2016
|
]),
|
|
2017
|
-
e.subtitle || h.$slots.subtitle ? (
|
|
2017
|
+
e.subtitle || h.$slots.subtitle ? (c(), N(a(ne), {
|
|
2018
2018
|
key: 3,
|
|
2019
2019
|
class: "wx-screen-head__subtitle",
|
|
2020
2020
|
size: "sm",
|
|
@@ -2022,15 +2022,15 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2022
2022
|
truncate: ""
|
|
2023
2023
|
}, {
|
|
2024
2024
|
default: b(() => [
|
|
2025
|
-
|
|
2025
|
+
fe(h.$slots, "subtitle", {}, () => [
|
|
2026
2026
|
M(T(e.subtitle), 1)
|
|
2027
2027
|
], !0)
|
|
2028
2028
|
]),
|
|
2029
2029
|
_: 3
|
|
2030
2030
|
})) : B("", !0),
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
(
|
|
2031
|
+
w.value ? (c(), C("div", lo, [
|
|
2032
|
+
fe(h.$slots, "extra", {}, void 0, !0),
|
|
2033
|
+
(c(!0), C(G, null, ce(f.value, (p) => (c(), N(a(re), {
|
|
2034
2034
|
key: p.key,
|
|
2035
2035
|
class: ke(["wx-screen-head__button", { "is-primary": p.primary }]),
|
|
2036
2036
|
type: p.primary ? "primary" : "default",
|
|
@@ -2050,16 +2050,16 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2050
2050
|
p.icon ? {
|
|
2051
2051
|
name: "icon",
|
|
2052
2052
|
fn: b(() => [
|
|
2053
|
-
|
|
2053
|
+
x(a(ft), {
|
|
2054
2054
|
name: p.icon
|
|
2055
2055
|
}, null, 8, ["name"])
|
|
2056
2056
|
]),
|
|
2057
2057
|
key: "0"
|
|
2058
2058
|
} : void 0
|
|
2059
2059
|
]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
|
|
2060
|
-
|
|
2060
|
+
d.value.length > 0 ? (c(), N(Bt, {
|
|
2061
2061
|
key: 0,
|
|
2062
|
-
actions:
|
|
2062
|
+
actions: d.value,
|
|
2063
2063
|
size: "lg",
|
|
2064
2064
|
label: e.title ?? a(l)("editor.more")
|
|
2065
2065
|
}, null, 8, ["actions", "label"])) : B("", !0)
|
|
@@ -2086,11 +2086,11 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2086
2086
|
emits: ["update:view"],
|
|
2087
2087
|
setup(e) {
|
|
2088
2088
|
const t = ze(e, "view");
|
|
2089
|
-
return (n, o) => (
|
|
2089
|
+
return (n, o) => (c(), C("div", {
|
|
2090
2090
|
class: ke(["wx-list-screen", { "is-fill": e.fill }]),
|
|
2091
2091
|
"data-wx-fill": e.fill ? "" : void 0
|
|
2092
2092
|
}, [
|
|
2093
|
-
e.title || e.actions || n.$slots.actions ? (
|
|
2093
|
+
e.title || e.actions || n.$slots.actions ? (c(), N(Tn, {
|
|
2094
2094
|
key: 0,
|
|
2095
2095
|
class: "wx-list-screen__head",
|
|
2096
2096
|
title: e.title,
|
|
@@ -2103,12 +2103,12 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2103
2103
|
n.$slots.actions ? {
|
|
2104
2104
|
name: "extra",
|
|
2105
2105
|
fn: b(() => [
|
|
2106
|
-
|
|
2106
|
+
fe(n.$slots, "actions", {}, void 0, !0)
|
|
2107
2107
|
]),
|
|
2108
2108
|
key: "0"
|
|
2109
2109
|
} : void 0
|
|
2110
2110
|
]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : B("", !0),
|
|
2111
|
-
e.views && e.views.length > 0 ? (
|
|
2111
|
+
e.views && e.views.length > 0 ? (c(), N(a(nl), {
|
|
2112
2112
|
key: 1,
|
|
2113
2113
|
modelValue: t.value,
|
|
2114
2114
|
"onUpdate:modelValue": o[0] || (o[0] = (l) => t.value = l),
|
|
@@ -2118,29 +2118,29 @@ const Ca = { class: "wx-history" }, La = {
|
|
|
2118
2118
|
"aria-label": e.title
|
|
2119
2119
|
}, {
|
|
2120
2120
|
default: b(() => [
|
|
2121
|
-
e.card ? (
|
|
2121
|
+
e.card ? (c(), N(a($t), {
|
|
2122
2122
|
key: 0,
|
|
2123
2123
|
class: "wx-list-screen__card",
|
|
2124
2124
|
padding: e.padding
|
|
2125
2125
|
}, {
|
|
2126
2126
|
default: b(() => [
|
|
2127
|
-
|
|
2127
|
+
fe(n.$slots, "default", {}, void 0, !0)
|
|
2128
2128
|
]),
|
|
2129
2129
|
_: 3
|
|
2130
|
-
}, 8, ["padding"])) :
|
|
2130
|
+
}, 8, ["padding"])) : fe(n.$slots, "default", {}, void 0, !0, 1)
|
|
2131
2131
|
]),
|
|
2132
2132
|
_: 3
|
|
2133
|
-
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (
|
|
2134
|
-
e.card ? (
|
|
2133
|
+
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (c(), C(G, { key: 2 }, [
|
|
2134
|
+
e.card ? (c(), N(a($t), {
|
|
2135
2135
|
key: 0,
|
|
2136
2136
|
class: "wx-list-screen__card",
|
|
2137
2137
|
padding: e.padding
|
|
2138
2138
|
}, {
|
|
2139
2139
|
default: b(() => [
|
|
2140
|
-
|
|
2140
|
+
fe(n.$slots, "default", {}, void 0, !0)
|
|
2141
2141
|
]),
|
|
2142
2142
|
_: 3
|
|
2143
|
-
}, 8, ["padding"])) :
|
|
2143
|
+
}, 8, ["padding"])) : fe(n.$slots, "default", {}, void 0, !0, 1)
|
|
2144
2144
|
], 64))
|
|
2145
2145
|
], 10, oo));
|
|
2146
2146
|
}
|
|
@@ -2186,7 +2186,7 @@ const fo = /* @__PURE__ */ X({
|
|
|
2186
2186
|
inheritAttrs: !1,
|
|
2187
2187
|
__name: "RichTextField",
|
|
2188
2188
|
setup(e) {
|
|
2189
|
-
const t = oe(), n = ee("webx-admin"), o =
|
|
2189
|
+
const t = oe(), n = ee("webx-admin"), o = _(() => t.pickImage ?? void 0), l = On(), s = E(l.modelValue);
|
|
2190
2190
|
let i;
|
|
2191
2191
|
ue(
|
|
2192
2192
|
() => l.modelValue,
|
|
@@ -2194,15 +2194,15 @@ const fo = /* @__PURE__ */ X({
|
|
|
2194
2194
|
s.value = v;
|
|
2195
2195
|
const m = t.assetUrls, f = v === i || !m ? [] : ro(v);
|
|
2196
2196
|
if (!m || f.length === 0) return;
|
|
2197
|
-
const
|
|
2198
|
-
|
|
2197
|
+
const d = await m(f).catch(() => null);
|
|
2198
|
+
d && l.modelValue === v && (s.value = co(v, d));
|
|
2199
2199
|
},
|
|
2200
2200
|
{ immediate: !0 }
|
|
2201
2201
|
);
|
|
2202
2202
|
function r(v) {
|
|
2203
2203
|
i = v;
|
|
2204
2204
|
}
|
|
2205
|
-
const u =
|
|
2205
|
+
const u = _(() => ({
|
|
2206
2206
|
bold: n("rich-text.bold"),
|
|
2207
2207
|
italic: n("rich-text.italic"),
|
|
2208
2208
|
accent: n("rich-text.accent"),
|
|
@@ -2240,7 +2240,7 @@ const fo = /* @__PURE__ */ X({
|
|
|
2240
2240
|
sourceDrop: n("rich-text.source-drop"),
|
|
2241
2241
|
sourceKeep: n("rich-text.source-keep")
|
|
2242
2242
|
}));
|
|
2243
|
-
return (v, m) => (
|
|
2243
|
+
return (v, m) => (c(), N(a(ll), Nt(v.$attrs, {
|
|
2244
2244
|
"model-value": s.value,
|
|
2245
2245
|
labels: u.value,
|
|
2246
2246
|
"pick-image": o.value,
|
|
@@ -2259,18 +2259,18 @@ const ho = { class: "wx-slug" }, po = { class: "wx-slug__prefix" }, go = /* @__P
|
|
|
2259
2259
|
inheritAttrs: !1,
|
|
2260
2260
|
__name: "SlugField",
|
|
2261
2261
|
setup(e) {
|
|
2262
|
-
const t = mo(), n = Ot(), o =
|
|
2262
|
+
const t = mo(), n = Ot(), o = _(() => t?.prefix.value === null && t.missing !== void 0), l = _(() => {
|
|
2263
2263
|
const r = t?.prefix.value ?? "";
|
|
2264
2264
|
return r === "" ? "/" : `/${r}/`;
|
|
2265
|
-
}), s =
|
|
2265
|
+
}), s = _(() => {
|
|
2266
2266
|
const r = t?.values.value.slug;
|
|
2267
2267
|
return typeof r == "string" ? r : r?.[n.active.value] ?? "";
|
|
2268
|
-
}), i =
|
|
2268
|
+
}), i = _(() => {
|
|
2269
2269
|
const r = t?.path.value;
|
|
2270
2270
|
return !o.value && typeof r == "string" && s.value !== "" && `${l.value}${s.value}` != `/${r}`;
|
|
2271
2271
|
});
|
|
2272
|
-
return (r, u) => (
|
|
2273
|
-
|
|
2272
|
+
return (r, u) => (c(), C("div", ho, [
|
|
2273
|
+
x(a(qe), Pn(Bn(r.$attrs)), Ue({ _: 2 }, [
|
|
2274
2274
|
o.value ? void 0 : {
|
|
2275
2275
|
name: "prefix",
|
|
2276
2276
|
fn: b(() => [
|
|
@@ -2279,12 +2279,12 @@ const ho = { class: "wx-slug" }, po = { class: "wx-slug__prefix" }, go = /* @__P
|
|
|
2279
2279
|
key: "0"
|
|
2280
2280
|
}
|
|
2281
2281
|
]), 1040),
|
|
2282
|
-
o.value && a(t)?.missing ? (
|
|
2282
|
+
o.value && a(t)?.missing ? (c(), N(a(ye), {
|
|
2283
2283
|
key: 0,
|
|
2284
2284
|
type: "info",
|
|
2285
2285
|
variant: "soft",
|
|
2286
2286
|
description: a(t).missing()
|
|
2287
|
-
}, null, 8, ["description"])) : i.value && a(t) ? (
|
|
2287
|
+
}, null, 8, ["description"])) : i.value && a(t) ? (c(), N(a(ye), {
|
|
2288
2288
|
key: 1,
|
|
2289
2289
|
type: "info",
|
|
2290
2290
|
variant: "soft",
|
|
@@ -2324,7 +2324,7 @@ function bo(e) {
|
|
|
2324
2324
|
manifest: null,
|
|
2325
2325
|
user: null,
|
|
2326
2326
|
error: null
|
|
2327
|
-
}), n =
|
|
2327
|
+
}), n = _(() => {
|
|
2328
2328
|
const z = t.manifest;
|
|
2329
2329
|
if (z === null)
|
|
2330
2330
|
return [];
|
|
@@ -2344,7 +2344,7 @@ function bo(e) {
|
|
|
2344
2344
|
});
|
|
2345
2345
|
}
|
|
2346
2346
|
return O;
|
|
2347
|
-
}), o =
|
|
2347
|
+
}), o = _(() => {
|
|
2348
2348
|
const z = t.manifest?.groups ?? [], O = [], g = /* @__PURE__ */ new Map();
|
|
2349
2349
|
for (const S of n.value)
|
|
2350
2350
|
if (S.group !== null && z.some((k) => k.id === S.group)) {
|
|
@@ -2386,10 +2386,10 @@ function bo(e) {
|
|
|
2386
2386
|
}), v.set(O, g)), g;
|
|
2387
2387
|
}
|
|
2388
2388
|
let f = null;
|
|
2389
|
-
async function
|
|
2389
|
+
async function d() {
|
|
2390
2390
|
t.status = "loading", t.error = null;
|
|
2391
2391
|
try {
|
|
2392
|
-
if (f !== null && (t.user = await f(),
|
|
2392
|
+
if (f !== null && (t.user = await f(), w(t.user), t.user === null)) {
|
|
2393
2393
|
t.manifest = null, t.status = "unauthenticated";
|
|
2394
2394
|
return;
|
|
2395
2395
|
}
|
|
@@ -2410,7 +2410,7 @@ function bo(e) {
|
|
|
2410
2410
|
} catch {
|
|
2411
2411
|
}
|
|
2412
2412
|
}
|
|
2413
|
-
function
|
|
2413
|
+
function w(z) {
|
|
2414
2414
|
z !== null && e.theme?.adopt(z.theme);
|
|
2415
2415
|
}
|
|
2416
2416
|
function h(z) {
|
|
@@ -2456,11 +2456,11 @@ function bo(e) {
|
|
|
2456
2456
|
blockLabels() {
|
|
2457
2457
|
return u ??= r ? r(H).catch(() => (u = null, null)) : Promise.resolve(null), u;
|
|
2458
2458
|
},
|
|
2459
|
-
reload:
|
|
2459
|
+
reload: d,
|
|
2460
2460
|
refreshManifest: y,
|
|
2461
2461
|
setLocale: h,
|
|
2462
2462
|
setUser(z) {
|
|
2463
|
-
t.user = z,
|
|
2463
|
+
t.user = z, w(z);
|
|
2464
2464
|
},
|
|
2465
2465
|
useSessionLoader(z) {
|
|
2466
2466
|
f = z;
|
|
@@ -2488,7 +2488,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2488
2488
|
landing: { default: null }
|
|
2489
2489
|
},
|
|
2490
2490
|
setup(e) {
|
|
2491
|
-
const t = e, n = oe(), o = He(), l = ee("webx-admin"), s =
|
|
2491
|
+
const t = e, n = oe(), o = He(), l = ee("webx-admin"), s = _(() => {
|
|
2492
2492
|
const i = n.nav.value;
|
|
2493
2493
|
return i.length === 0 ? null : ((t.landing === null ? void 0 : i.find((u) => u.path === t.landing)) ?? i[0])?.path ?? null;
|
|
2494
2494
|
});
|
|
@@ -2498,7 +2498,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2498
2498
|
i !== null && o.replace(i);
|
|
2499
2499
|
},
|
|
2500
2500
|
{ immediate: !0 }
|
|
2501
|
-
), (i, r) => s.value === null && a(n).state.status === "ready" ? (
|
|
2501
|
+
), (i, r) => s.value === null && a(n).state.status === "ready" ? (c(), N(a(bn), {
|
|
2502
2502
|
key: 0,
|
|
2503
2503
|
status: "info",
|
|
2504
2504
|
title: a(l)("shell.empty-title"),
|
|
@@ -2512,60 +2512,60 @@ const ko = /* @__PURE__ */ X({
|
|
|
2512
2512
|
},
|
|
2513
2513
|
emits: ["select"],
|
|
2514
2514
|
setup(e, { emit: t }) {
|
|
2515
|
-
const n = t, o = oe(), l = ee("webx-admin"), s = He(), i = pn(), r =
|
|
2515
|
+
const n = t, o = oe(), l = ee("webx-admin"), s = He(), i = pn(), r = _({
|
|
2516
2516
|
/*
|
|
2517
2517
|
* The longest path that contains this one, on a segment boundary: a section may live inside
|
|
2518
2518
|
* another's path (`/services/categories` under `/services`), and the first match in the order
|
|
2519
2519
|
* of the menu would light up the outer one.
|
|
2520
2520
|
*/
|
|
2521
|
-
get: () => o.nav.value.filter((
|
|
2521
|
+
get: () => o.nav.value.filter((d) => i.path === d.path || i.path.startsWith(`${d.path}/`)).sort((d, y) => y.path.length - d.path.length)[0]?.id ?? "",
|
|
2522
2522
|
set: (f) => {
|
|
2523
|
-
const
|
|
2524
|
-
|
|
2523
|
+
const d = o.nav.value.find((y) => y.id === f);
|
|
2524
|
+
d !== void 0 && s.push(d.path);
|
|
2525
2525
|
}
|
|
2526
2526
|
}), u = Vt("root");
|
|
2527
2527
|
let v = !1;
|
|
2528
2528
|
async function m() {
|
|
2529
2529
|
const f = u.value?.$el;
|
|
2530
|
-
v || r.value === "" || !(f instanceof HTMLElement) || (v = !0, await Promise.allSettled((f.getAnimations?.({ subtree: !0 }) ?? []).map((
|
|
2530
|
+
v || r.value === "" || !(f instanceof HTMLElement) || (v = !0, await Promise.allSettled((f.getAnimations?.({ subtree: !0 }) ?? []).map((d) => d.finished)), f.querySelector(".wx-menu-row.is-active")?.scrollIntoView?.({ block: "center" }));
|
|
2531
2531
|
}
|
|
2532
|
-
return Ee(m), ue(r, m, { flush: "post" }), (f,
|
|
2533
|
-
const y =
|
|
2534
|
-
return
|
|
2532
|
+
return Ee(m), ue(r, m, { flush: "post" }), (f, d) => {
|
|
2533
|
+
const y = me("wx-menu-item"), w = me("wx-menu-group"), h = me("wx-submenu"), W = me("wx-menu");
|
|
2534
|
+
return c(), N(W, {
|
|
2535
2535
|
ref_key: "root",
|
|
2536
2536
|
ref: u,
|
|
2537
2537
|
modelValue: r.value,
|
|
2538
|
-
"onUpdate:modelValue":
|
|
2538
|
+
"onUpdate:modelValue": d[0] || (d[0] = (p) => r.value = p),
|
|
2539
2539
|
collapsed: e.collapsed,
|
|
2540
2540
|
label: a(l)("nav.sections"),
|
|
2541
|
-
onSelect:
|
|
2541
|
+
onSelect: d[1] || (d[1] = (p) => n("select"))
|
|
2542
2542
|
}, {
|
|
2543
2543
|
default: b(() => [
|
|
2544
|
-
(
|
|
2544
|
+
(c(!0), C(G, null, ce(a(o).groups.value.top, (p) => (c(), N(y, {
|
|
2545
2545
|
key: p.id,
|
|
2546
2546
|
value: p.id,
|
|
2547
2547
|
icon: p.icon ?? void 0,
|
|
2548
2548
|
label: p.title
|
|
2549
2549
|
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
2550
|
-
(
|
|
2550
|
+
(c(!0), C(G, null, ce(a(o).groups.value.groups, (p) => (c(), N(h, {
|
|
2551
2551
|
key: p.id,
|
|
2552
2552
|
value: `group:${p.id}`,
|
|
2553
2553
|
title: p.title,
|
|
2554
2554
|
icon: p.icon ?? "gear"
|
|
2555
2555
|
}, {
|
|
2556
2556
|
default: b(() => [
|
|
2557
|
-
(
|
|
2557
|
+
(c(!0), C(G, null, ce(p.entries, (V) => (c(), N(y, {
|
|
2558
2558
|
key: V.id,
|
|
2559
2559
|
value: V.id,
|
|
2560
2560
|
icon: V.icon ?? void 0,
|
|
2561
2561
|
label: V.title
|
|
2562
2562
|
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
2563
|
-
(
|
|
2563
|
+
(c(!0), C(G, null, ce(p.sections, (V) => (c(), N(w, {
|
|
2564
2564
|
key: V.id,
|
|
2565
2565
|
title: V.title
|
|
2566
2566
|
}, {
|
|
2567
2567
|
default: b(() => [
|
|
2568
|
-
(
|
|
2568
|
+
(c(!0), C(G, null, ce(V.entries, (H) => (c(), N(y, {
|
|
2569
2569
|
key: H.id,
|
|
2570
2570
|
value: H.id,
|
|
2571
2571
|
icon: H.icon ?? void 0,
|
|
@@ -2586,7 +2586,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2586
2586
|
__name: "AdminNotFound",
|
|
2587
2587
|
setup(e) {
|
|
2588
2588
|
const t = oe(), n = He(), o = ee("webx-admin");
|
|
2589
|
-
return (l, s) => a(t).state.status === "ready" ? (
|
|
2589
|
+
return (l, s) => a(t).state.status === "ready" ? (c(), N(a(bn), {
|
|
2590
2590
|
key: 0,
|
|
2591
2591
|
class: "wx-admin-not-found",
|
|
2592
2592
|
status: "404",
|
|
@@ -2594,7 +2594,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2594
2594
|
subtitle: a(o)("shell.not-found-description")
|
|
2595
2595
|
}, {
|
|
2596
2596
|
actions: b(() => [
|
|
2597
|
-
|
|
2597
|
+
x(a(re), {
|
|
2598
2598
|
type: "primary",
|
|
2599
2599
|
onClick: s[0] || (s[0] = (i) => a(n).push("/"))
|
|
2600
2600
|
}, {
|
|
@@ -2622,29 +2622,29 @@ const ko = /* @__PURE__ */ X({
|
|
|
2622
2622
|
const t = oe(), n = ee("webx-admin"), o = E(null), { width: l, layout: s, collapsed: i, showAside: r, drawerOpen: u, toggle: v, close: m } = al(
|
|
2623
2623
|
o,
|
|
2624
2624
|
{ persist: "webx-admin-shell" }
|
|
2625
|
-
), f =
|
|
2625
|
+
), f = _(() => t.state.manifest?.title ?? ""), d = _(() => t.state.manifest?.branding?.logo ?? null), y = _(() => t.state.manifest?.branding?.mark ?? null), w = _(() => ol(l.value, null));
|
|
2626
2626
|
return jn(() => {
|
|
2627
|
-
typeof document > "u" || (document.documentElement.dataset.wxShell =
|
|
2627
|
+
typeof document > "u" || (document.documentElement.dataset.wxShell = w.value);
|
|
2628
2628
|
}), Dn(() => {
|
|
2629
2629
|
typeof document < "u" && delete document.documentElement.dataset.wxShell;
|
|
2630
2630
|
}), (h, W) => {
|
|
2631
|
-
const p =
|
|
2632
|
-
return
|
|
2633
|
-
|
|
2634
|
-
a(t).state.status === "unauthenticated" ? (
|
|
2635
|
-
|
|
2636
|
-
])) : a(t).state.status === "loading" ? (
|
|
2637
|
-
|
|
2631
|
+
const p = me("router-view"), V = me("wx-loading"), H = me("wx-button"), z = me("wx-result"), O = me("wx-action"), g = me("wx-text"), S = me("wx-header"), k = me("wx-aside"), I = me("wx-main"), U = me("wx-container"), L = me("wx-drawer");
|
|
2632
|
+
return c(), C(G, null, [
|
|
2633
|
+
x(a(sl), { placement: "bottom-center" }),
|
|
2634
|
+
a(t).state.status === "unauthenticated" ? (c(), C("div", So, [
|
|
2635
|
+
x(p)
|
|
2636
|
+
])) : a(t).state.status === "loading" ? (c(), C("div", To, [
|
|
2637
|
+
x(V, {
|
|
2638
2638
|
label: a(n)("shell.loading")
|
|
2639
2639
|
}, null, 8, ["label"])
|
|
2640
|
-
])) : a(t).state.status === "error" ? (
|
|
2641
|
-
|
|
2640
|
+
])) : a(t).state.status === "error" ? (c(), C("div", Ao, [
|
|
2641
|
+
x(z, {
|
|
2642
2642
|
status: "error",
|
|
2643
2643
|
title: a(n)("shell.error-title"),
|
|
2644
2644
|
description: a(t).state.error
|
|
2645
2645
|
}, {
|
|
2646
2646
|
default: b(() => [
|
|
2647
|
-
|
|
2647
|
+
x(H, {
|
|
2648
2648
|
type: "primary",
|
|
2649
2649
|
onClick: W[0] || (W[0] = (j) => a(t).reload())
|
|
2650
2650
|
}, {
|
|
@@ -2656,19 +2656,19 @@ const ko = /* @__PURE__ */ X({
|
|
|
2656
2656
|
]),
|
|
2657
2657
|
_: 1
|
|
2658
2658
|
}, 8, ["title", "description"])
|
|
2659
|
-
])) : (
|
|
2659
|
+
])) : (c(), C("div", {
|
|
2660
2660
|
key: 3,
|
|
2661
2661
|
ref_key: "shellEl",
|
|
2662
2662
|
ref: o,
|
|
2663
|
-
class: ke(["wx-root wx-admin", `wx-admin--${
|
|
2663
|
+
class: ke(["wx-root wx-admin", `wx-admin--${w.value}`])
|
|
2664
2664
|
}, [
|
|
2665
|
-
|
|
2665
|
+
x(U, {
|
|
2666
2666
|
direction: a(s) === "drawer" ? "vertical" : "horizontal",
|
|
2667
2667
|
"full-height": "",
|
|
2668
2668
|
class: "wx-admin__frame"
|
|
2669
2669
|
}, {
|
|
2670
2670
|
default: b(() => [
|
|
2671
|
-
a(s) === "drawer" ? (
|
|
2671
|
+
a(s) === "drawer" ? (c(), N(S, {
|
|
2672
2672
|
key: 0,
|
|
2673
2673
|
class: "wx-admin__header",
|
|
2674
2674
|
floating: "",
|
|
@@ -2678,23 +2678,23 @@ const ko = /* @__PURE__ */ X({
|
|
|
2678
2678
|
height: "var(--wx-admin-header-height)"
|
|
2679
2679
|
}, {
|
|
2680
2680
|
end: b(() => [
|
|
2681
|
-
|
|
2681
|
+
fe(h.$slots, "user", { expanded: !1 }, void 0, !0)
|
|
2682
2682
|
]),
|
|
2683
2683
|
default: b(() => [
|
|
2684
|
-
|
|
2684
|
+
x(O, {
|
|
2685
2685
|
icon: "menu",
|
|
2686
2686
|
title: a(n)("nav.menu"),
|
|
2687
2687
|
onClick: a(v)
|
|
2688
2688
|
}, null, 8, ["title", "onClick"]),
|
|
2689
|
-
|
|
2690
|
-
|
|
2689
|
+
fe(h.$slots, "brand", {}, () => [
|
|
2690
|
+
d.value ? (c(), C("img", {
|
|
2691
2691
|
key: 0,
|
|
2692
2692
|
class: "wx-admin__logo",
|
|
2693
|
-
src:
|
|
2693
|
+
src: d.value.url,
|
|
2694
2694
|
alt: f.value,
|
|
2695
|
-
width:
|
|
2696
|
-
height:
|
|
2697
|
-
}, null, 8, Co)) : (
|
|
2695
|
+
width: d.value.width ?? void 0,
|
|
2696
|
+
height: d.value.height ?? void 0
|
|
2697
|
+
}, null, 8, Co)) : (c(), N(g, {
|
|
2698
2698
|
key: 1,
|
|
2699
2699
|
weight: "semibold",
|
|
2700
2700
|
truncate: ""
|
|
@@ -2708,7 +2708,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2708
2708
|
]),
|
|
2709
2709
|
_: 3
|
|
2710
2710
|
})) : B("", !0),
|
|
2711
|
-
a(r) ? (
|
|
2711
|
+
a(r) ? (c(), N(k, {
|
|
2712
2712
|
key: 1,
|
|
2713
2713
|
class: "wx-admin__aside",
|
|
2714
2714
|
sticky: "",
|
|
@@ -2723,20 +2723,20 @@ const ko = /* @__PURE__ */ X({
|
|
|
2723
2723
|
D("div", {
|
|
2724
2724
|
class: ke(["wx-admin__brand", { "wx-admin__brand--stacked": a(i) && y.value }])
|
|
2725
2725
|
}, [
|
|
2726
|
-
a(i) ? y.value ? (
|
|
2726
|
+
a(i) ? y.value ? (c(), C("img", {
|
|
2727
2727
|
key: 1,
|
|
2728
2728
|
class: "wx-admin__mark",
|
|
2729
2729
|
src: y.value.url,
|
|
2730
2730
|
alt: f.value
|
|
2731
|
-
}, null, 8, Wo)) : B("", !0) :
|
|
2732
|
-
|
|
2731
|
+
}, null, 8, Wo)) : B("", !0) : fe(h.$slots, "brand", {}, () => [
|
|
2732
|
+
d.value ? (c(), C("img", {
|
|
2733
2733
|
key: 0,
|
|
2734
2734
|
class: "wx-admin__logo",
|
|
2735
|
-
src:
|
|
2735
|
+
src: d.value.url,
|
|
2736
2736
|
alt: f.value,
|
|
2737
|
-
width:
|
|
2738
|
-
height:
|
|
2739
|
-
}, null, 8, Lo)) : (
|
|
2737
|
+
width: d.value.width ?? void 0,
|
|
2738
|
+
height: d.value.height ?? void 0
|
|
2739
|
+
}, null, 8, Lo)) : (c(), N(g, {
|
|
2740
2740
|
key: 1,
|
|
2741
2741
|
weight: "semibold",
|
|
2742
2742
|
truncate: "",
|
|
@@ -2748,7 +2748,7 @@ const ko = /* @__PURE__ */ X({
|
|
|
2748
2748
|
_: 1
|
|
2749
2749
|
}))
|
|
2750
2750
|
], !0, 0),
|
|
2751
|
-
|
|
2751
|
+
x(O, {
|
|
2752
2752
|
icon: "sidebar",
|
|
2753
2753
|
title: a(i) ? a(n)("nav.expand") : a(n)("nav.collapse"),
|
|
2754
2754
|
onClick: a(v)
|
|
@@ -2757,29 +2757,29 @@ const ko = /* @__PURE__ */ X({
|
|
|
2757
2757
|
]),
|
|
2758
2758
|
bottom: b(() => [
|
|
2759
2759
|
D("div", zo, [
|
|
2760
|
-
|
|
2760
|
+
fe(h.$slots, "user", {
|
|
2761
2761
|
expanded: !a(i)
|
|
2762
2762
|
}, void 0, !0)
|
|
2763
2763
|
])
|
|
2764
2764
|
]),
|
|
2765
2765
|
default: b(() => [
|
|
2766
|
-
|
|
2766
|
+
fe(h.$slots, "nav", { collapsed: a(i) }, void 0, !0)
|
|
2767
2767
|
]),
|
|
2768
2768
|
_: 3
|
|
2769
2769
|
}, 8, ["collapsed"])) : B("", !0),
|
|
2770
|
-
|
|
2770
|
+
x(I, {
|
|
2771
2771
|
padding: "none",
|
|
2772
2772
|
class: "wx-admin__screen"
|
|
2773
2773
|
}, {
|
|
2774
2774
|
default: b(() => [
|
|
2775
|
-
|
|
2775
|
+
x(p)
|
|
2776
2776
|
]),
|
|
2777
2777
|
_: 1
|
|
2778
2778
|
})
|
|
2779
2779
|
]),
|
|
2780
2780
|
_: 3
|
|
2781
2781
|
}, 8, ["direction"]),
|
|
2782
|
-
|
|
2782
|
+
x(L, {
|
|
2783
2783
|
open: a(u),
|
|
2784
2784
|
"onUpdate:open": W[1] || (W[1] = (j) => mn(u) ? u.value = j : null),
|
|
2785
2785
|
class: "wx-admin__drawer",
|
|
@@ -2791,11 +2791,11 @@ const ko = /* @__PURE__ */ X({
|
|
|
2791
2791
|
}, {
|
|
2792
2792
|
footer: b(() => [
|
|
2793
2793
|
D("div", Eo, [
|
|
2794
|
-
|
|
2794
|
+
fe(h.$slots, "user", { expanded: !0 }, void 0, !0)
|
|
2795
2795
|
])
|
|
2796
2796
|
]),
|
|
2797
2797
|
default: b(() => [
|
|
2798
|
-
|
|
2798
|
+
fe(h.$slots, "nav", {
|
|
2799
2799
|
collapsed: !1,
|
|
2800
2800
|
select: a(m)
|
|
2801
2801
|
}, void 0, !0)
|
|
@@ -2878,7 +2878,7 @@ function si(e = {}) {
|
|
|
2878
2878
|
baseUrl: "",
|
|
2879
2879
|
csrfUrl: `${n}/auth/csrf-cookie`,
|
|
2880
2880
|
onUnauthenticated: () => {
|
|
2881
|
-
|
|
2881
|
+
d.setUser(null), d.state.status = "unauthenticated";
|
|
2882
2882
|
},
|
|
2883
2883
|
// Every request says which language the panel is currently showing. It decides what
|
|
2884
2884
|
// the server writes its own messages in — a 422 under a field — for anybody who has
|
|
@@ -2894,7 +2894,7 @@ function si(e = {}) {
|
|
|
2894
2894
|
const H = await V;
|
|
2895
2895
|
r.load(H.data.namespaces, H.data.locale, H.data.fallback), Bo(H.data.locale), Do(H.data.locale, r.state.panelLocales);
|
|
2896
2896
|
}
|
|
2897
|
-
const
|
|
2897
|
+
const d = bo({
|
|
2898
2898
|
http: v,
|
|
2899
2899
|
theme: u,
|
|
2900
2900
|
basePath: o,
|
|
@@ -2906,37 +2906,37 @@ function si(e = {}) {
|
|
|
2906
2906
|
screens: e.screens,
|
|
2907
2907
|
loadManifest: async () => (await v.get(t)).data
|
|
2908
2908
|
}), y = Fn(Oo(e));
|
|
2909
|
-
y.use(il), wo(y,
|
|
2910
|
-
const
|
|
2909
|
+
y.use(il), wo(y, d), $l(y, r), Uo(y, u);
|
|
2910
|
+
const w = E("");
|
|
2911
2911
|
y.provide(
|
|
2912
2912
|
rl,
|
|
2913
|
-
|
|
2913
|
+
_(() => r.state.locale)
|
|
2914
2914
|
), y.provide(
|
|
2915
2915
|
ul,
|
|
2916
|
-
|
|
2916
|
+
_(() => d.state.manifest?.timezone)
|
|
2917
2917
|
), y.provide(dl, {
|
|
2918
|
-
list:
|
|
2918
|
+
list: _(
|
|
2919
2919
|
() => r.state.contentLocales.map((p) => ({
|
|
2920
2920
|
code: p.code,
|
|
2921
2921
|
label: p.code.toUpperCase()
|
|
2922
2922
|
}))
|
|
2923
2923
|
),
|
|
2924
|
-
active:
|
|
2925
|
-
get: () =>
|
|
2924
|
+
active: _({
|
|
2925
|
+
get: () => w.value || (r.state.contentLocales[0]?.code ?? ""),
|
|
2926
2926
|
set: (p) => {
|
|
2927
|
-
|
|
2927
|
+
w.value = p;
|
|
2928
2928
|
}
|
|
2929
2929
|
})
|
|
2930
2930
|
});
|
|
2931
2931
|
const h = {
|
|
2932
2932
|
app: y,
|
|
2933
2933
|
router: i,
|
|
2934
|
-
context:
|
|
2934
|
+
context: d,
|
|
2935
2935
|
i18n: r,
|
|
2936
2936
|
theme: u,
|
|
2937
2937
|
async mount() {
|
|
2938
2938
|
await Promise.all([W(), f(r.state.locale)]).catch(() => {
|
|
2939
|
-
}), y.mount(e.el ?? "#webx-app"), await
|
|
2939
|
+
}), y.mount(e.el ?? "#webx-app"), await d.reload();
|
|
2940
2940
|
}
|
|
2941
2941
|
};
|
|
2942
2942
|
async function W() {
|
|
@@ -3099,12 +3099,12 @@ function Yo(e, t, n, o, l) {
|
|
|
3099
3099
|
function Jo(e, t, n, o, l) {
|
|
3100
3100
|
const s = Pe(e), i = Pe(t), r = Pe(n), u = /* @__PURE__ */ new Map();
|
|
3101
3101
|
for (const y of /* @__PURE__ */ new Set([...i.keys(), ...r.keys()])) {
|
|
3102
|
-
const
|
|
3102
|
+
const w = s.get(y), h = i.get(y), W = r.get(y), p = [...o, { block: y, type: zn(h ?? W) }];
|
|
3103
3103
|
let V;
|
|
3104
|
-
h && W ? V = Dt(
|
|
3104
|
+
h && W ? V = Dt(w, h, W, p, l) : h ? w === void 0 ? V = h : ge(w, h) ? V = Se : V = Ct(l, p, "removed-theirs", w, h, Se, h, Se) : W && (w === void 0 ? V = W : ge(w, W) ? V = Se : V = Ct(l, p, "removed-mine", w, Se, W, Se, W)), V !== Se && u.set(y, V);
|
|
3105
3105
|
}
|
|
3106
|
-
const v = !Wt(e, n), m = !Wt(e, t), [f,
|
|
3107
|
-
return Xo(f,
|
|
3106
|
+
const v = !Wt(e, n), m = !Wt(e, t), [f, d] = v && !m ? [n, t] : [t, n];
|
|
3107
|
+
return Xo(f, d, u);
|
|
3108
3108
|
}
|
|
3109
3109
|
function Xo(e, t, n) {
|
|
3110
3110
|
const o = e.map((s) => s.key).filter((s) => n.has(s)), l = new Set(o);
|
|
@@ -3174,24 +3174,24 @@ function En(e = {}) {
|
|
|
3174
3174
|
return e.block?.(u) ?? s.value?.type(u) ?? zt(u || n("editing.block"));
|
|
3175
3175
|
}
|
|
3176
3176
|
function r(u) {
|
|
3177
|
-
const v = new Set(o.list.value.map((
|
|
3178
|
-
let f = "",
|
|
3179
|
-
u.forEach((
|
|
3180
|
-
if ("block" in
|
|
3181
|
-
m.push(i(
|
|
3177
|
+
const v = new Set(o.list.value.map((w) => w.code)), m = [];
|
|
3178
|
+
let f = "", d = null;
|
|
3179
|
+
u.forEach((w, h) => {
|
|
3180
|
+
if ("block" in w) {
|
|
3181
|
+
m.push(i(w.type)), d = w.type;
|
|
3182
3182
|
return;
|
|
3183
3183
|
}
|
|
3184
|
-
if (
|
|
3184
|
+
if (w.field === "values" && h > 0 && "block" in u[h - 1]) return;
|
|
3185
3185
|
const W = u[h + 1];
|
|
3186
3186
|
if (W !== void 0 && "block" in W) return;
|
|
3187
|
-
if (h === u.length - 1 && h > 0 && v.has(
|
|
3188
|
-
f =
|
|
3187
|
+
if (h === u.length - 1 && h > 0 && v.has(w.field)) {
|
|
3188
|
+
f = w.field.toUpperCase();
|
|
3189
3189
|
return;
|
|
3190
3190
|
}
|
|
3191
|
-
const p =
|
|
3192
|
-
|
|
3193
|
-
const V = p !== null ? s.value?.field(p,
|
|
3194
|
-
m.push(V ?? zt(
|
|
3191
|
+
const p = d;
|
|
3192
|
+
d = null;
|
|
3193
|
+
const V = p !== null ? s.value?.field(p, w.field) : h === 0 ? e.field?.(w.field) ?? l.value.get(w.field) : void 0;
|
|
3194
|
+
m.push(V ?? zt(w.field));
|
|
3195
3195
|
});
|
|
3196
3196
|
const y = m.length === 0 ? n("editing.order") : m.join(" › ");
|
|
3197
3197
|
return f === "" ? y : `${y} · ${f}`;
|
|
@@ -3217,13 +3217,13 @@ function ri(e) {
|
|
|
3217
3217
|
screen: e.screen,
|
|
3218
3218
|
field: e.field,
|
|
3219
3219
|
block: e.block
|
|
3220
|
-
}), s = st(tt(e.values.value)), i = E(null), r = E(null), u = E([]), v = E(null), m = E(null), f = E([]),
|
|
3220
|
+
}), s = st(tt(e.values.value)), i = E(null), r = E(null), u = E([]), v = E(null), m = E(null), f = E([]), d = E([]);
|
|
3221
3221
|
let y = null;
|
|
3222
|
-
const
|
|
3222
|
+
const w = () => e.canWrite?.() ?? !0, h = _(() => v.value?.trashed === !0), W = E(null), p = _(() => h.value || W.value !== null), V = _(
|
|
3223
3223
|
() => W.value !== null ? n("editing.blocked-purged") : h.value ? n("editing.blocked-trashed") : void 0
|
|
3224
|
-
), H =
|
|
3225
|
-
() => [...
|
|
3226
|
-
), z =
|
|
3224
|
+
), H = _(
|
|
3225
|
+
() => [...d.value].reverse().find((A) => A.kind === "trashed") ?? null
|
|
3226
|
+
), z = _(() => !ge(e.values.value, s.value));
|
|
3227
3227
|
let O = !1, g = !1;
|
|
3228
3228
|
function S(A) {
|
|
3229
3229
|
s.value = tt(A), r.value = null, O || (O = !0, g && e.heartbeat !== !1 && Le());
|
|
@@ -3237,7 +3237,7 @@ function ri(e) {
|
|
|
3237
3237
|
}
|
|
3238
3238
|
function U(A) {
|
|
3239
3239
|
const R = I(A);
|
|
3240
|
-
return R && Z.info(n("editing.merged", { who:
|
|
3240
|
+
return R && Z.info(n("editing.merged", { who: ve(A.changed) })), R;
|
|
3241
3241
|
}
|
|
3242
3242
|
async function L() {
|
|
3243
3243
|
const A = r.value?.theirs ?? await e.read();
|
|
@@ -3261,14 +3261,14 @@ function ri(e) {
|
|
|
3261
3261
|
const A = i.value;
|
|
3262
3262
|
A && (A.conflicts.forEach((R) => j(R.id, "theirs")), J());
|
|
3263
3263
|
}
|
|
3264
|
-
function
|
|
3264
|
+
function ve(A) {
|
|
3265
3265
|
const R = A?.author ?? n("editing.somebody");
|
|
3266
3266
|
return A?.source === "mcp" ? n("editing.via-agent", { name: R }) : A?.source === "import" ? n("editing.via-import", { name: R }) : R;
|
|
3267
3267
|
}
|
|
3268
3268
|
function K(A) {
|
|
3269
3269
|
return A ? o.short(A) : "";
|
|
3270
3270
|
}
|
|
3271
|
-
function
|
|
3271
|
+
function $(A) {
|
|
3272
3272
|
const R = [...new Set(A.map((ie) => l.label(ie)))], Y = R.slice(0, 3).join(", ") || n("editing.order");
|
|
3273
3273
|
return R.length > 3 ? n("editing.and-more", { what: Y }) : Y;
|
|
3274
3274
|
}
|
|
@@ -3297,7 +3297,7 @@ function ri(e) {
|
|
|
3297
3297
|
pe.at(-1) !== $e && pe.push($e), Y++;
|
|
3298
3298
|
}
|
|
3299
3299
|
const Me = pe.length === 1 ? pe[0] : `${pe.slice(0, -1).join(", ")} ${n("editing.and")} ${pe.at(-1)}`;
|
|
3300
|
-
R.push(rt(n("editing.event", { who:
|
|
3300
|
+
R.push(rt(n("editing.event", { who: ve(xe), what: Me, when: K(xe.at) })));
|
|
3301
3301
|
}
|
|
3302
3302
|
return R.join(" · ");
|
|
3303
3303
|
}
|
|
@@ -3321,8 +3321,8 @@ function ri(e) {
|
|
|
3321
3321
|
R.changed ??= y;
|
|
3322
3322
|
const Y = f.value.filter((xe) => dn.has(xe.kind)), ie = Y.length > 0 ? F(Y) : rt(
|
|
3323
3323
|
n("editing.incoming", {
|
|
3324
|
-
who:
|
|
3325
|
-
what:
|
|
3324
|
+
who: ve(R.changed),
|
|
3325
|
+
what: $(un(s.value, R.values)),
|
|
3326
3326
|
when: K(R.changed?.at)
|
|
3327
3327
|
})
|
|
3328
3328
|
);
|
|
@@ -3331,13 +3331,13 @@ function ri(e) {
|
|
|
3331
3331
|
message: `${ie}. ${n("editing.publish-unseen-text")}`,
|
|
3332
3332
|
confirmText: n("editing.publish-with"),
|
|
3333
3333
|
cancelText: n("editing.review-first")
|
|
3334
|
-
}) ? { revision: R.revision, asked: !0 } : (I(R) && Z.info(n("editing.merged", { who:
|
|
3334
|
+
}) ? { revision: R.revision, asked: !0 } : (I(R) && Z.info(n("editing.merged", { who: ve(R.changed) })), null);
|
|
3335
3335
|
}
|
|
3336
3336
|
async function Je(A) {
|
|
3337
3337
|
const R = A;
|
|
3338
3338
|
return R?.status === 410 && he(R.body?.gone) ? !0 : R?.status === 404 || R?.status === 410 ? (await Le(), p.value) : R?.status === 409 && typeof R.body?.revision == "string" ? (Z.warning(R.body.message || n("editing.publish-moved")), await Le(), !0) : !1;
|
|
3339
3339
|
}
|
|
3340
|
-
const q = () => e.restore !== void 0 &&
|
|
3340
|
+
const q = () => e.restore !== void 0 && w();
|
|
3341
3341
|
async function Q() {
|
|
3342
3342
|
if (!e.restore) return !1;
|
|
3343
3343
|
try {
|
|
@@ -3391,7 +3391,7 @@ ${R}`).join(`
|
|
|
3391
3391
|
function Vn(A) {
|
|
3392
3392
|
const R = Array.isArray(A.events) ? A.events : [], Y = R.reduce((Me, $e) => Math.max(Me, $e.id), Re ?? 0);
|
|
3393
3393
|
let ie = [];
|
|
3394
|
-
if (
|
|
3394
|
+
if (d.value = R, Re === null)
|
|
3395
3395
|
Re = Y;
|
|
3396
3396
|
else {
|
|
3397
3397
|
const Me = Re;
|
|
@@ -3419,7 +3419,7 @@ ${R}`).join(`
|
|
|
3419
3419
|
}
|
|
3420
3420
|
return;
|
|
3421
3421
|
}
|
|
3422
|
-
if (typeof Y?.revision == "string" && (u.value = Array.isArray(Y.editors) ? Y.editors : [], y = Y.changed ?? null, Vn(Y), !!O && !(R !== e.revision.value || e.busy?.()) && !(Y.revision === R || !
|
|
3422
|
+
if (typeof Y?.revision == "string" && (u.value = Array.isArray(Y.editors) ? Y.editors : [], y = Y.changed ?? null, Vn(Y), !!O && !(R !== e.revision.value || e.busy?.()) && !(Y.revision === R || !w() || i.value || ht) && r.value?.theirs.revision !== Y.revision)) {
|
|
3423
3423
|
ht = !0;
|
|
3424
3424
|
try {
|
|
3425
3425
|
const ie = await e.read();
|
|
@@ -3487,10 +3487,10 @@ ${R}`).join(`
|
|
|
3487
3487
|
dismissEvents: ae,
|
|
3488
3488
|
check: Le,
|
|
3489
3489
|
label: l.label,
|
|
3490
|
-
places:
|
|
3490
|
+
places: $,
|
|
3491
3491
|
describe: F,
|
|
3492
3492
|
preview: Qo,
|
|
3493
|
-
who:
|
|
3493
|
+
who: ve
|
|
3494
3494
|
};
|
|
3495
3495
|
}
|
|
3496
3496
|
function Qo(e) {
|
|
@@ -3579,10 +3579,10 @@ function as(e, t, n = Ft()) {
|
|
|
3579
3579
|
);
|
|
3580
3580
|
}
|
|
3581
3581
|
function fi(e = {}) {
|
|
3582
|
-
const t = e.admin ?? oe(), n = e.storage === void 0 ? Ft() : e.storage, o = e.retries ?? 3, l = e.retryDelay ?? 1e3, s = `${t.apiPath}/uploads`, i = E("idle"), r = E(0), u = E(0), v = E(0), m = E(null), f = E(null),
|
|
3582
|
+
const t = e.admin ?? oe(), n = e.storage === void 0 ? Ft() : e.storage, o = e.retries ?? 3, l = e.retryDelay ?? 1e3, s = `${t.apiPath}/uploads`, i = E("idle"), r = E(0), u = E(0), v = E(0), m = E(null), f = E(null), d = _(() => u.value > 0 ? Math.min(1, r.value / u.value) : 0), y = _(
|
|
3583
3583
|
() => v.value > 0 ? Math.ceil((u.value - r.value) / v.value) : null
|
|
3584
3584
|
);
|
|
3585
|
-
let
|
|
3585
|
+
let w = null, h = "", W = nt, p = 0, V = null, H = [], z = null, O = null;
|
|
3586
3586
|
function g(q, Q, ae = {}) {
|
|
3587
3587
|
return os(t.http, q, Q, ae);
|
|
3588
3588
|
}
|
|
@@ -3604,7 +3604,7 @@ function fi(e = {}) {
|
|
|
3604
3604
|
const Q = Date.now();
|
|
3605
3605
|
H.push({ at: Q, bytes: r.value }), H = H.filter((se) => Q - se.at <= ls);
|
|
3606
3606
|
const ae = H[0], he = ae === void 0 ? 0 : (Q - ae.at) / 1e3;
|
|
3607
|
-
v.value = ae !== void 0 && he > 0 ? (r.value - ae.bytes) / he : 0,
|
|
3607
|
+
v.value = ae !== void 0 && he > 0 ? (r.value - ae.bytes) / he : 0, w !== null && L(w, h, r.value);
|
|
3608
3608
|
}
|
|
3609
3609
|
function L(q, Q, ae) {
|
|
3610
3610
|
const he = _t(q), se = Ht(n).filter(
|
|
@@ -3623,7 +3623,7 @@ function fi(e = {}) {
|
|
|
3623
3623
|
]);
|
|
3624
3624
|
}
|
|
3625
3625
|
function j() {
|
|
3626
|
-
|
|
3626
|
+
w !== null && as(_t(w), h, n);
|
|
3627
3627
|
}
|
|
3628
3628
|
function J() {
|
|
3629
3629
|
p += 1, V?.abort(), V = null, v.value = 0, H = [];
|
|
@@ -3631,7 +3631,7 @@ function fi(e = {}) {
|
|
|
3631
3631
|
async function le(q, Q) {
|
|
3632
3632
|
if (i.value === "uploading" || i.value === "paused" || i.value === "offline")
|
|
3633
3633
|
throw new Error("This upload is still going; cancel it before starting another.");
|
|
3634
|
-
J(),
|
|
3634
|
+
J(), w = q, h = Q, m.value = null, f.value = null, r.value = 0, u.value = q.size, i.value = "uploading";
|
|
3635
3635
|
const ae = S(), he = p;
|
|
3636
3636
|
try {
|
|
3637
3637
|
const se = await t.http.post(s, {
|
|
@@ -3649,7 +3649,7 @@ function fi(e = {}) {
|
|
|
3649
3649
|
}
|
|
3650
3650
|
return ae;
|
|
3651
3651
|
}
|
|
3652
|
-
async function
|
|
3652
|
+
async function ve() {
|
|
3653
3653
|
const q = await g("HEAD", `${s}/${m.value}`);
|
|
3654
3654
|
if (!q.ok)
|
|
3655
3655
|
return I(await St(q)), !1;
|
|
@@ -3659,7 +3659,7 @@ function fi(e = {}) {
|
|
|
3659
3659
|
async function K() {
|
|
3660
3660
|
const q = p;
|
|
3661
3661
|
let Q = 0;
|
|
3662
|
-
for (i.value = "uploading"; q === p &&
|
|
3662
|
+
for (i.value = "uploading"; q === p && w !== null && m.value !== null; ) {
|
|
3663
3663
|
if (r.value >= u.value) {
|
|
3664
3664
|
i.value = "done", v.value = 0, j(), k(m.value);
|
|
3665
3665
|
return;
|
|
@@ -3669,7 +3669,7 @@ function fi(e = {}) {
|
|
|
3669
3669
|
let se;
|
|
3670
3670
|
try {
|
|
3671
3671
|
se = await g("PATCH", `${s}/${m.value}`, {
|
|
3672
|
-
body:
|
|
3672
|
+
body: w.slice(ae, he),
|
|
3673
3673
|
headers: {
|
|
3674
3674
|
"Upload-Offset": String(ae),
|
|
3675
3675
|
"Content-Type": "application/offset+octet-stream"
|
|
@@ -3690,7 +3690,7 @@ function fi(e = {}) {
|
|
|
3690
3690
|
if (await ss(l * 2 ** (Q - 1)), q !== p)
|
|
3691
3691
|
return;
|
|
3692
3692
|
try {
|
|
3693
|
-
if (!await
|
|
3693
|
+
if (!await ve())
|
|
3694
3694
|
return;
|
|
3695
3695
|
} catch {
|
|
3696
3696
|
}
|
|
@@ -3717,7 +3717,7 @@ function fi(e = {}) {
|
|
|
3717
3717
|
return;
|
|
3718
3718
|
}
|
|
3719
3719
|
}
|
|
3720
|
-
function
|
|
3720
|
+
function $() {
|
|
3721
3721
|
i.value === "uploading" && (J(), i.value = "paused");
|
|
3722
3722
|
}
|
|
3723
3723
|
function P() {
|
|
@@ -3726,14 +3726,14 @@ function fi(e = {}) {
|
|
|
3726
3726
|
async function F() {
|
|
3727
3727
|
if (i.value === "uploading" || i.value === "done" || i.value === "idle")
|
|
3728
3728
|
return O ?? Promise.resolve(i.value === "done" ? m.value : null);
|
|
3729
|
-
if (
|
|
3729
|
+
if (w === null)
|
|
3730
3730
|
return Promise.resolve(null);
|
|
3731
3731
|
if (m.value === null)
|
|
3732
|
-
return i.value = "idle", le(
|
|
3732
|
+
return i.value = "idle", le(w, h);
|
|
3733
3733
|
J(), f.value = null, i.value = "uploading";
|
|
3734
3734
|
const q = S(), Q = p;
|
|
3735
3735
|
try {
|
|
3736
|
-
await
|
|
3736
|
+
await ve() && Q === p && K();
|
|
3737
3737
|
} catch (ae) {
|
|
3738
3738
|
Q === p && (fn() ? P() : I(ae));
|
|
3739
3739
|
}
|
|
@@ -3754,10 +3754,10 @@ function fi(e = {}) {
|
|
|
3754
3754
|
i.value === "offline" && F();
|
|
3755
3755
|
}
|
|
3756
3756
|
return typeof window < "u" && (window.addEventListener("offline", we), window.addEventListener("online", Je)), Hn() !== void 0 && Kn(() => {
|
|
3757
|
-
typeof window < "u" && (window.removeEventListener("offline", we), window.removeEventListener("online", Je)),
|
|
3757
|
+
typeof window < "u" && (window.removeEventListener("offline", we), window.removeEventListener("online", Je)), $();
|
|
3758
3758
|
}), {
|
|
3759
3759
|
state: Ve(i),
|
|
3760
|
-
progress:
|
|
3760
|
+
progress: d,
|
|
3761
3761
|
uploaded: Ve(r),
|
|
3762
3762
|
total: Ve(u),
|
|
3763
3763
|
speed: Ve(v),
|
|
@@ -3765,7 +3765,7 @@ function fi(e = {}) {
|
|
|
3765
3765
|
id: Ve(m),
|
|
3766
3766
|
error: Ve(f),
|
|
3767
3767
|
start: le,
|
|
3768
|
-
pause:
|
|
3768
|
+
pause: $,
|
|
3769
3769
|
resume: F,
|
|
3770
3770
|
cancel: te
|
|
3771
3771
|
};
|
|
@@ -3824,11 +3824,11 @@ function rs(e) {
|
|
|
3824
3824
|
return (e.q ?? "").trim() !== "" || e.filtered ? "locked" : e.category == null ? "all" : "category";
|
|
3825
3825
|
}
|
|
3826
3826
|
function mi(e, t) {
|
|
3827
|
-
const n = oe(), o = ee("webx-admin"), l =
|
|
3827
|
+
const n = oe(), o = ee("webx-admin"), l = _(() => rs(t()));
|
|
3828
3828
|
return {
|
|
3829
3829
|
mode: l,
|
|
3830
|
-
sortable:
|
|
3831
|
-
hint:
|
|
3830
|
+
sortable: _(() => l.value !== "locked"),
|
|
3831
|
+
hint: _(() => o(`categories.order-${l.value}`)),
|
|
3832
3832
|
move: (s) => Tl(n, e, s, l.value === "category" ? t().category ?? null : null)
|
|
3833
3833
|
};
|
|
3834
3834
|
}
|
|
@@ -3839,7 +3839,7 @@ const us = /* @__PURE__ */ X({
|
|
|
3839
3839
|
},
|
|
3840
3840
|
setup(e) {
|
|
3841
3841
|
const t = e, n = ee("webx-admin");
|
|
3842
|
-
return (o, l) => t.locale ? (
|
|
3842
|
+
return (o, l) => t.locale ? (c(), N(a(It), {
|
|
3843
3843
|
key: 0,
|
|
3844
3844
|
content: a(n)("links.address-fallback", { locale: t.locale.toUpperCase() }),
|
|
3845
3845
|
"max-width": 280
|
|
@@ -3851,7 +3851,7 @@ const us = /* @__PURE__ */ X({
|
|
|
3851
3851
|
onClick: l[0] || (l[0] = Rt(() => {
|
|
3852
3852
|
}, ["stop"]))
|
|
3853
3853
|
}, [
|
|
3854
|
-
|
|
3854
|
+
x(a(ft), {
|
|
3855
3855
|
name: "info",
|
|
3856
3856
|
size: "14px",
|
|
3857
3857
|
label: a(n)("links.address-fallback-label")
|
|
@@ -3878,10 +3878,10 @@ const cs = /* @__PURE__ */ X({
|
|
|
3878
3878
|
await dt(), m.value?.querySelector("input")?.focus();
|
|
3879
3879
|
});
|
|
3880
3880
|
function f(y) {
|
|
3881
|
-
const
|
|
3882
|
-
return
|
|
3881
|
+
const w = Object.keys(v.value).find((h) => h === y || h.startsWith(`${y}.`));
|
|
3882
|
+
return w === void 0 ? void 0 : v.value[w]?.[0];
|
|
3883
3883
|
}
|
|
3884
|
-
async function
|
|
3884
|
+
async function d() {
|
|
3885
3885
|
if (!(r.value.trim() === "" || u.value)) {
|
|
3886
3886
|
u.value = !0, v.value = {};
|
|
3887
3887
|
try {
|
|
@@ -3893,29 +3893,29 @@ const cs = /* @__PURE__ */ X({
|
|
|
3893
3893
|
}
|
|
3894
3894
|
}
|
|
3895
3895
|
}
|
|
3896
|
-
return (y,
|
|
3896
|
+
return (y, w) => (c(), N(a(Mt), {
|
|
3897
3897
|
open: a(n),
|
|
3898
|
-
"onUpdate:open":
|
|
3898
|
+
"onUpdate:open": w[2] || (w[2] = (h) => mn(n) ? n.value = h : null),
|
|
3899
3899
|
title: a(i)("new"),
|
|
3900
3900
|
width: 440
|
|
3901
3901
|
}, {
|
|
3902
3902
|
footer: b(() => [
|
|
3903
|
-
|
|
3903
|
+
x(a(vl), { size: "sm" }, {
|
|
3904
3904
|
default: b(() => [
|
|
3905
|
-
|
|
3905
|
+
x(a(re), {
|
|
3906
3906
|
variant: "outline",
|
|
3907
|
-
onClick:
|
|
3907
|
+
onClick: w[1] || (w[1] = (h) => a(l)())
|
|
3908
3908
|
}, {
|
|
3909
3909
|
default: b(() => [
|
|
3910
3910
|
M(T(a(i)("cancel")), 1)
|
|
3911
3911
|
]),
|
|
3912
3912
|
_: 1
|
|
3913
3913
|
}),
|
|
3914
|
-
|
|
3914
|
+
x(a(re), {
|
|
3915
3915
|
type: "primary",
|
|
3916
3916
|
loading: u.value,
|
|
3917
3917
|
disabled: r.value.trim() === "",
|
|
3918
|
-
onClick:
|
|
3918
|
+
onClick: d
|
|
3919
3919
|
}, {
|
|
3920
3920
|
default: b(() => [
|
|
3921
3921
|
M(T(a(i)("create")), 1)
|
|
@@ -3927,7 +3927,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
3927
3927
|
})
|
|
3928
3928
|
]),
|
|
3929
3929
|
default: b(() => [
|
|
3930
|
-
|
|
3930
|
+
x(a(fl), {
|
|
3931
3931
|
label: a(i)("field-title"),
|
|
3932
3932
|
error: f("title") ?? f("slug"),
|
|
3933
3933
|
required: ""
|
|
@@ -3937,11 +3937,11 @@ const cs = /* @__PURE__ */ X({
|
|
|
3937
3937
|
ref_key: "field",
|
|
3938
3938
|
ref: m
|
|
3939
3939
|
}, [
|
|
3940
|
-
|
|
3940
|
+
x(a(qe), {
|
|
3941
3941
|
modelValue: r.value,
|
|
3942
|
-
"onUpdate:modelValue":
|
|
3942
|
+
"onUpdate:modelValue": w[0] || (w[0] = (h) => r.value = h),
|
|
3943
3943
|
"aria-label": a(i)("field-title"),
|
|
3944
|
-
onKeyup: hn(
|
|
3944
|
+
onKeyup: hn(d, ["enter"])
|
|
3945
3945
|
}, null, 8, ["modelValue", "aria-label"])
|
|
3946
3946
|
], 512)
|
|
3947
3947
|
]),
|
|
@@ -3958,9 +3958,9 @@ const cs = /* @__PURE__ */ X({
|
|
|
3958
3958
|
options: {}
|
|
3959
3959
|
},
|
|
3960
3960
|
setup(e) {
|
|
3961
|
-
const t = e, n = oe(), o = Ie(n, t.options.api), l = He(), s = Kt(t.options.words), i = ee("webx-admin"), r = Ye(), u = E([]), v = E(!0), m = E(!0), f =
|
|
3961
|
+
const t = e, n = oe(), o = Ie(n, t.options.api), l = He(), s = Kt(t.options.words), i = ee("webx-admin"), r = Ye(), u = E([]), v = E(!0), m = E(!0), f = _(() => n.can(t.options.manage)), d = _(
|
|
3962
3962
|
() => t.options.title ? i(t.options.title) : n.state.manifest?.modules.find((g) => g.id === t.options.module)?.title ?? ""
|
|
3963
|
-
), y = ml(cs),
|
|
3963
|
+
), y = ml(cs), w = _(
|
|
3964
3964
|
() => f.value ? [{ key: "new", label: s("new"), icon: "plus", primary: !0, run: () => {
|
|
3965
3965
|
V();
|
|
3966
3966
|
} }] : []
|
|
@@ -4032,26 +4032,26 @@ const cs = /* @__PURE__ */ X({
|
|
|
4032
4032
|
}
|
|
4033
4033
|
}
|
|
4034
4034
|
return (g, S) => {
|
|
4035
|
-
const k =
|
|
4036
|
-
return
|
|
4035
|
+
const k = me("router-link");
|
|
4036
|
+
return c(), N(An, {
|
|
4037
4037
|
class: "wx-categories",
|
|
4038
|
-
title:
|
|
4038
|
+
title: d.value,
|
|
4039
4039
|
back: t.options.back?.path,
|
|
4040
4040
|
"back-label": t.options.back ? a(i)(t.options.back.label) : void 0,
|
|
4041
|
-
actions:
|
|
4041
|
+
actions: w.value,
|
|
4042
4042
|
padding: "sm"
|
|
4043
4043
|
}, {
|
|
4044
4044
|
default: b(() => [
|
|
4045
|
-
v.value ? (
|
|
4045
|
+
v.value ? (c(), N(a(Ce), {
|
|
4046
4046
|
key: 0,
|
|
4047
4047
|
class: "wx-categories__loading",
|
|
4048
4048
|
rows: 5
|
|
4049
|
-
})) : u.value.length === 0 ? (
|
|
4049
|
+
})) : u.value.length === 0 ? (c(), N(a(it), {
|
|
4050
4050
|
key: 1,
|
|
4051
4051
|
title: a(s)("empty"),
|
|
4052
4052
|
description: a(s)("empty-help")
|
|
4053
|
-
}, null, 8, ["title", "description"])) : (
|
|
4054
|
-
|
|
4053
|
+
}, null, 8, ["title", "description"])) : (c(), C(G, { key: 2 }, [
|
|
4054
|
+
x(a(Ut), {
|
|
4055
4055
|
modelValue: u.value,
|
|
4056
4056
|
"onUpdate:modelValue": S[0] || (S[0] = (I) => u.value = I),
|
|
4057
4057
|
class: "wx-categories__list",
|
|
@@ -4062,13 +4062,13 @@ const cs = /* @__PURE__ */ X({
|
|
|
4062
4062
|
onMove: O
|
|
4063
4063
|
}, {
|
|
4064
4064
|
default: b(({ item: I }) => [
|
|
4065
|
-
|
|
4065
|
+
x(k, {
|
|
4066
4066
|
class: ke(["wx-category-row", { "is-hidden": !I.is_visible }]),
|
|
4067
4067
|
to: `${t.options.path}/${I.id}`
|
|
4068
4068
|
}, {
|
|
4069
4069
|
default: b(() => [
|
|
4070
4070
|
D("span", fs, [
|
|
4071
|
-
|
|
4071
|
+
x(a(ne), {
|
|
4072
4072
|
truncate: "",
|
|
4073
4073
|
weight: "medium"
|
|
4074
4074
|
}, {
|
|
@@ -4077,12 +4077,12 @@ const cs = /* @__PURE__ */ X({
|
|
|
4077
4077
|
]),
|
|
4078
4078
|
_: 2
|
|
4079
4079
|
}, 1024),
|
|
4080
|
-
I.is_visible ? B("", !0) : (
|
|
4080
|
+
I.is_visible ? B("", !0) : (c(), N(a(It), {
|
|
4081
4081
|
key: 0,
|
|
4082
4082
|
content: a(s)("hidden")
|
|
4083
4083
|
}, {
|
|
4084
4084
|
default: b(() => [
|
|
4085
|
-
|
|
4085
|
+
x(a(ft), {
|
|
4086
4086
|
name: "eye-off",
|
|
4087
4087
|
size: "sm"
|
|
4088
4088
|
})
|
|
@@ -4090,7 +4090,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
4090
4090
|
_: 1
|
|
4091
4091
|
}, 8, ["content"]))
|
|
4092
4092
|
]),
|
|
4093
|
-
m.value ? (
|
|
4093
|
+
m.value ? (c(), N(a(ne), {
|
|
4094
4094
|
key: 0,
|
|
4095
4095
|
size: "sm",
|
|
4096
4096
|
tone: "muted",
|
|
@@ -4098,7 +4098,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
4098
4098
|
}, {
|
|
4099
4099
|
default: b(() => [
|
|
4100
4100
|
M(T(I.path === null ? a(s)("no-address") : `/${I.path}`) + " ", 1),
|
|
4101
|
-
I.path !== null ? (
|
|
4101
|
+
I.path !== null ? (c(), N(ds, {
|
|
4102
4102
|
key: 0,
|
|
4103
4103
|
locale: I.address_locale
|
|
4104
4104
|
}, null, 8, ["locale"])) : B("", !0)
|
|
@@ -4110,7 +4110,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
4110
4110
|
}, 1032, ["class", "to"])
|
|
4111
4111
|
]),
|
|
4112
4112
|
actions: b(({ item: I }) => [
|
|
4113
|
-
|
|
4113
|
+
x(a(ne), {
|
|
4114
4114
|
class: "wx-category-row__count",
|
|
4115
4115
|
size: "sm",
|
|
4116
4116
|
tone: "muted"
|
|
@@ -4120,14 +4120,14 @@ const cs = /* @__PURE__ */ X({
|
|
|
4120
4120
|
]),
|
|
4121
4121
|
_: 2
|
|
4122
4122
|
}, 1024),
|
|
4123
|
-
|
|
4123
|
+
x(Bt, {
|
|
4124
4124
|
actions: z(I),
|
|
4125
4125
|
label: I.name
|
|
4126
4126
|
}, null, 8, ["actions", "label"])
|
|
4127
4127
|
]),
|
|
4128
4128
|
_: 1
|
|
4129
4129
|
}, 8, ["modelValue", "item-label", "disabled"]),
|
|
4130
|
-
|
|
4130
|
+
x(a(ye), {
|
|
4131
4131
|
class: "wx-categories__note",
|
|
4132
4132
|
type: "info",
|
|
4133
4133
|
description: a(s)("order")
|
|
@@ -4159,13 +4159,13 @@ const cs = /* @__PURE__ */ X({
|
|
|
4159
4159
|
}, t.linger));
|
|
4160
4160
|
}
|
|
4161
4161
|
);
|
|
4162
|
-
const s =
|
|
4162
|
+
const s = _(
|
|
4163
4163
|
() => t.state === "saving" ? "saving" : o.value ? "saved" : null
|
|
4164
4164
|
);
|
|
4165
4165
|
return ct(() => {
|
|
4166
4166
|
l !== null && clearTimeout(l);
|
|
4167
|
-
}), (i, r) => (
|
|
4168
|
-
s.value ? (
|
|
4167
|
+
}), (i, r) => (c(), C("span", ms, [
|
|
4168
|
+
s.value ? (c(), N(a(ft), {
|
|
4169
4169
|
key: 0,
|
|
4170
4170
|
class: ke(["wx-save-state__mark", { "is-saved": s.value === "saved" }]),
|
|
4171
4171
|
name: s.value === "saving" ? "loader" : "check",
|
|
@@ -4182,7 +4182,8 @@ const cs = /* @__PURE__ */ X({
|
|
|
4182
4182
|
disabled: { type: Boolean, default: !1 },
|
|
4183
4183
|
labelPosition: { default: void 0 },
|
|
4184
4184
|
labelWidth: { default: void 0 },
|
|
4185
|
-
size: { default: void 0 }
|
|
4185
|
+
size: { default: void 0 },
|
|
4186
|
+
patch: { default: () => [] }
|
|
4186
4187
|
}, {
|
|
4187
4188
|
modelValue: { default: () => ({}) },
|
|
4188
4189
|
modelModifiers: {}
|
|
@@ -4193,29 +4194,30 @@ const cs = /* @__PURE__ */ X({
|
|
|
4193
4194
|
async function m() {
|
|
4194
4195
|
u.value = null, v.value = null;
|
|
4195
4196
|
try {
|
|
4196
|
-
const
|
|
4197
|
-
u.value =
|
|
4198
|
-
} catch (
|
|
4199
|
-
v.value =
|
|
4197
|
+
const d = await i.loadScreen(o.name);
|
|
4198
|
+
u.value = d, l("loaded", d);
|
|
4199
|
+
} catch (d) {
|
|
4200
|
+
v.value = d instanceof Error ? d.message : String(d);
|
|
4200
4201
|
}
|
|
4201
4202
|
}
|
|
4202
|
-
|
|
4203
|
+
ue([() => o.name, () => i.i18n.state.locale], () => {
|
|
4203
4204
|
m();
|
|
4204
|
-
}, { immediate: !0 })
|
|
4205
|
-
|
|
4205
|
+
}, { immediate: !0 });
|
|
4206
|
+
const f = _(() => [...o.patch, ...i.screenPatch(o.name)]);
|
|
4207
|
+
return t({ reload: m }), (d, y) => (c(), C("div", gs, [
|
|
4208
|
+
v.value ? (c(), N(a(ye), {
|
|
4206
4209
|
key: 0,
|
|
4207
4210
|
type: "danger",
|
|
4208
4211
|
title: a(r)("shell.error-title"),
|
|
4209
4212
|
description: v.value
|
|
4210
|
-
}, null, 8, ["title", "description"])) : u.value === null ? (d
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
})) : (d(), N(a(kl), {
|
|
4213
|
+
}, null, 8, ["title", "description"])) : u.value === null ? fe(d.$slots, "loading", {}, () => [
|
|
4214
|
+
x(a(Ce), { rows: 4 })
|
|
4215
|
+
], void 0, 1) : (c(), N(a(kl), {
|
|
4214
4216
|
key: 2,
|
|
4215
4217
|
modelValue: s.value,
|
|
4216
|
-
"onUpdate:modelValue":
|
|
4218
|
+
"onUpdate:modelValue": y[0] || (y[0] = (w) => s.value = w),
|
|
4217
4219
|
root: u.value,
|
|
4218
|
-
patch:
|
|
4220
|
+
patch: f.value,
|
|
4219
4221
|
types: a(i).types,
|
|
4220
4222
|
errors: e.errors,
|
|
4221
4223
|
translate: a(i).i18n.t,
|
|
@@ -4234,20 +4236,20 @@ const cs = /* @__PURE__ */ X({
|
|
|
4234
4236
|
options: {}
|
|
4235
4237
|
},
|
|
4236
4238
|
setup(e) {
|
|
4237
|
-
const t = e, n = oe(), o = Ie(n, t.options.api), l = pn(), s = He(), i = Ot(), r = Kt(t.options.words), u = ee("webx-admin"), v = Ye(), m =
|
|
4239
|
+
const t = e, n = oe(), o = Ie(n, t.options.api), l = pn(), s = He(), i = Ot(), r = Kt(t.options.words), u = ee("webx-admin"), v = Ye(), m = _(() => Number(l.params.id)), f = _(() => t.options.path), d = E(null), y = E({}), w = E(null), h = E(""), W = E(!0), p = E(!1), V = E({}), H = _(() => n.can(t.options.manage)), z = _(() => JSON.stringify(y.value)), O = _(() => h.value !== "" && z.value !== h.value), g = _(() => p.value ? "saving" : O.value ? "unsaved" : "saved"), S = _(
|
|
4238
4240
|
() => t.options.title ? u(t.options.title) : n.state.manifest?.modules.find((K) => K.id === t.options.module)?.title ?? ""
|
|
4239
|
-
), k =
|
|
4241
|
+
), k = _(() => {
|
|
4240
4242
|
const K = y.value.title;
|
|
4241
|
-
return hl(K, i.active.value,
|
|
4243
|
+
return hl(K, i.active.value, d.value?.name ?? "") || r("untitled");
|
|
4242
4244
|
});
|
|
4243
|
-
is({ category:
|
|
4245
|
+
is({ category: d, values: y, prefix: w, moving: () => r("address-moving") }), Ta({ id: _(() => d.value?.id ?? null) }), vo({
|
|
4244
4246
|
values: y,
|
|
4245
|
-
prefix:
|
|
4246
|
-
path:
|
|
4247
|
+
prefix: w,
|
|
4248
|
+
path: _(() => d.value?.path),
|
|
4247
4249
|
moving: () => r("address-moving")
|
|
4248
4250
|
});
|
|
4249
4251
|
function I(K) {
|
|
4250
|
-
|
|
4252
|
+
d.value = K.category, y.value = K.values, w.value = K.prefix, h.value = JSON.stringify(K.values);
|
|
4251
4253
|
}
|
|
4252
4254
|
async function U() {
|
|
4253
4255
|
W.value = !0;
|
|
@@ -4260,20 +4262,20 @@ const cs = /* @__PURE__ */ X({
|
|
|
4260
4262
|
}
|
|
4261
4263
|
}
|
|
4262
4264
|
async function L() {
|
|
4263
|
-
if (!(!
|
|
4265
|
+
if (!(!d.value || p.value || !H.value)) {
|
|
4264
4266
|
p.value = !0, V.value = {};
|
|
4265
4267
|
try {
|
|
4266
|
-
I(await o.save(
|
|
4268
|
+
I(await o.save(d.value.id, y.value)), Z.success(r("saved"));
|
|
4267
4269
|
} catch (K) {
|
|
4268
|
-
const
|
|
4269
|
-
|
|
4270
|
+
const $ = K.body;
|
|
4271
|
+
$?.errors ? (V.value = $.errors, Z.danger(r("save-failed"))) : Z.danger(v(K));
|
|
4270
4272
|
} finally {
|
|
4271
4273
|
p.value = !1;
|
|
4272
4274
|
}
|
|
4273
4275
|
}
|
|
4274
4276
|
}
|
|
4275
4277
|
async function j() {
|
|
4276
|
-
const K =
|
|
4278
|
+
const K = d.value;
|
|
4277
4279
|
if (!(!K || !await We({
|
|
4278
4280
|
title: r("delete-title", { name: K.name }),
|
|
4279
4281
|
message: r("delete-text"),
|
|
@@ -4306,9 +4308,9 @@ const cs = /* @__PURE__ */ X({
|
|
|
4306
4308
|
cancelText: r("cancel"),
|
|
4307
4309
|
tone: "danger"
|
|
4308
4310
|
}));
|
|
4309
|
-
const
|
|
4310
|
-
const K =
|
|
4311
|
-
return K && (K.url && K.is_visible &&
|
|
4311
|
+
const ve = _(() => {
|
|
4312
|
+
const K = d.value, $ = [];
|
|
4313
|
+
return K && (K.url && K.is_visible && $.push({ key: "site", label: r("open-on-site"), icon: "link", href: K.url }), H.value && $.push({
|
|
4312
4314
|
key: "delete",
|
|
4313
4315
|
label: r("delete"),
|
|
4314
4316
|
icon: "trash",
|
|
@@ -4317,40 +4319,40 @@ const cs = /* @__PURE__ */ X({
|
|
|
4317
4319
|
run: () => {
|
|
4318
4320
|
j();
|
|
4319
4321
|
}
|
|
4320
|
-
})),
|
|
4322
|
+
})), $;
|
|
4321
4323
|
});
|
|
4322
|
-
return (K,
|
|
4324
|
+
return (K, $) => (c(), C("div", {
|
|
4323
4325
|
class: "wx-category-editor",
|
|
4324
4326
|
onKeydown: le
|
|
4325
4327
|
}, [
|
|
4326
|
-
W.value || !
|
|
4327
|
-
|
|
4328
|
+
W.value || !d.value ? (c(), C(G, { key: 0 }, [
|
|
4329
|
+
x(a(Ce), {
|
|
4328
4330
|
class: "wx-category-editor__ghost",
|
|
4329
4331
|
title: "",
|
|
4330
4332
|
rows: 1
|
|
4331
4333
|
}),
|
|
4332
|
-
|
|
4334
|
+
x(a($t), null, {
|
|
4333
4335
|
default: b(() => [
|
|
4334
|
-
|
|
4336
|
+
x(a(Ce), { rows: 6 })
|
|
4335
4337
|
]),
|
|
4336
4338
|
_: 1
|
|
4337
4339
|
})
|
|
4338
|
-
], 64)) : (
|
|
4339
|
-
|
|
4340
|
+
], 64)) : (c(), C(G, { key: 1 }, [
|
|
4341
|
+
x(Tn, {
|
|
4340
4342
|
divider: "",
|
|
4341
4343
|
back: f.value,
|
|
4342
4344
|
"back-label": S.value,
|
|
4343
4345
|
title: k.value,
|
|
4344
|
-
subtitle:
|
|
4345
|
-
actions:
|
|
4346
|
+
subtitle: d.value.path === null ? void 0 : `/${d.value.path}`,
|
|
4347
|
+
actions: ve.value
|
|
4346
4348
|
}, Ue({
|
|
4347
4349
|
trail: b(() => [
|
|
4348
|
-
|
|
4350
|
+
x(a(pl), {
|
|
4349
4351
|
size: "sm",
|
|
4350
4352
|
label: a(r)("trail")
|
|
4351
4353
|
}, {
|
|
4352
4354
|
default: b(() => [
|
|
4353
|
-
|
|
4355
|
+
x(a(Qt), {
|
|
4354
4356
|
as: "router-link",
|
|
4355
4357
|
to: f.value
|
|
4356
4358
|
}, {
|
|
@@ -4359,7 +4361,7 @@ const cs = /* @__PURE__ */ X({
|
|
|
4359
4361
|
]),
|
|
4360
4362
|
_: 1
|
|
4361
4363
|
}, 8, ["to"]),
|
|
4362
|
-
|
|
4364
|
+
x(a(Qt), { current: "" }, {
|
|
4363
4365
|
default: b(() => [
|
|
4364
4366
|
M(T(k.value), 1)
|
|
4365
4367
|
]),
|
|
@@ -4371,10 +4373,10 @@ const cs = /* @__PURE__ */ X({
|
|
|
4371
4373
|
]),
|
|
4372
4374
|
_: 2
|
|
4373
4375
|
}, [
|
|
4374
|
-
|
|
4376
|
+
d.value.is_visible ? void 0 : {
|
|
4375
4377
|
name: "title-after",
|
|
4376
4378
|
fn: b(() => [
|
|
4377
|
-
|
|
4379
|
+
x(a(Ke), { dot: "" }, {
|
|
4378
4380
|
default: b(() => [
|
|
4379
4381
|
M(T(a(r)("hidden")), 1)
|
|
4380
4382
|
]),
|
|
@@ -4384,19 +4386,19 @@ const cs = /* @__PURE__ */ X({
|
|
|
4384
4386
|
key: "0"
|
|
4385
4387
|
}
|
|
4386
4388
|
]), 1032, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
4387
|
-
|
|
4389
|
+
x(ys, {
|
|
4388
4390
|
modelValue: y.value,
|
|
4389
|
-
"onUpdate:modelValue":
|
|
4391
|
+
"onUpdate:modelValue": $[0] || ($[0] = (P) => y.value = P),
|
|
4390
4392
|
name: t.options.screen,
|
|
4391
4393
|
errors: V.value,
|
|
4392
4394
|
disabled: !H.value || p.value
|
|
4393
4395
|
}, null, 8, ["modelValue", "name", "errors", "disabled"]),
|
|
4394
|
-
H.value ? (
|
|
4396
|
+
H.value ? (c(), N(a(gl), { key: 0 }, {
|
|
4395
4397
|
state: b(() => [
|
|
4396
|
-
|
|
4398
|
+
x(ps, { state: g.value }, null, 8, ["state"])
|
|
4397
4399
|
]),
|
|
4398
4400
|
default: b(() => [
|
|
4399
|
-
|
|
4401
|
+
x(a(re), {
|
|
4400
4402
|
type: "primary",
|
|
4401
4403
|
loading: p.value,
|
|
4402
4404
|
disabled: !O.value,
|
|
@@ -4436,7 +4438,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4436
4438
|
filters: {}
|
|
4437
4439
|
},
|
|
4438
4440
|
setup(e) {
|
|
4439
|
-
return (t, n) => (
|
|
4441
|
+
return (t, n) => (c(!0), C(G, null, ce(e.filters, (o) => (c(), N(a(Ke), {
|
|
4440
4442
|
key: o.key,
|
|
4441
4443
|
class: "wx-filter-chip",
|
|
4442
4444
|
size: "sm",
|
|
@@ -4461,7 +4463,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4461
4463
|
},
|
|
4462
4464
|
emits: ["rename"],
|
|
4463
4465
|
setup(e, { emit: t }) {
|
|
4464
|
-
const n = e, o = t, l = ee("webx-admin"), s = E(!1), i = E(n.name), r = E(null), u =
|
|
4466
|
+
const n = e, o = t, l = ee("webx-admin"), s = E(!1), i = E(n.name), r = E(null), u = _(() => n.label ?? l("editor.rename"));
|
|
4465
4467
|
ue(s, async (m) => {
|
|
4466
4468
|
m && (i.value = n.name, await dt(), r.value?.focus(), r.value?.select());
|
|
4467
4469
|
});
|
|
@@ -4473,9 +4475,9 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4473
4475
|
}
|
|
4474
4476
|
o("rename", m), s.value = !1;
|
|
4475
4477
|
}
|
|
4476
|
-
return (m, f) => (
|
|
4478
|
+
return (m, f) => (c(), N(a(yl), {
|
|
4477
4479
|
open: s.value,
|
|
4478
|
-
"onUpdate:open": f[2] || (f[2] = (
|
|
4480
|
+
"onUpdate:open": f[2] || (f[2] = (d) => s.value = d),
|
|
4479
4481
|
title: u.value,
|
|
4480
4482
|
width: 320,
|
|
4481
4483
|
side: "bottom",
|
|
@@ -4483,7 +4485,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4483
4485
|
teleport: ""
|
|
4484
4486
|
}, {
|
|
4485
4487
|
trigger: b(() => [
|
|
4486
|
-
|
|
4488
|
+
x(a(Ne), {
|
|
4487
4489
|
type: "edit",
|
|
4488
4490
|
title: u.value,
|
|
4489
4491
|
size: e.size,
|
|
@@ -4495,17 +4497,17 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4495
4497
|
class: "wx-rename",
|
|
4496
4498
|
onSubmit: Rt(v, ["prevent"])
|
|
4497
4499
|
}, [
|
|
4498
|
-
|
|
4500
|
+
x(a(qe), {
|
|
4499
4501
|
ref_key: "field",
|
|
4500
4502
|
ref: r,
|
|
4501
4503
|
modelValue: i.value,
|
|
4502
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
4504
|
+
"onUpdate:modelValue": f[0] || (f[0] = (d) => i.value = d),
|
|
4503
4505
|
"aria-label": u.value,
|
|
4504
4506
|
placeholder: e.placeholder,
|
|
4505
|
-
onKeydown: f[1] || (f[1] = hn((
|
|
4507
|
+
onKeydown: f[1] || (f[1] = hn((d) => s.value = !1, ["esc"]))
|
|
4506
4508
|
}, null, 8, ["modelValue", "aria-label", "placeholder"]),
|
|
4507
4509
|
D("div", _s, [
|
|
4508
|
-
|
|
4510
|
+
x(a(re), {
|
|
4509
4511
|
type: "primary",
|
|
4510
4512
|
size: "sm",
|
|
4511
4513
|
"native-type": "submit"
|
|
@@ -4531,9 +4533,9 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4531
4533
|
width: { default: 720 }
|
|
4532
4534
|
},
|
|
4533
4535
|
setup(e) {
|
|
4534
|
-
const t = e, n = ee("webx-admin"), o = E(!1), l =
|
|
4535
|
-
return (i, r) => (
|
|
4536
|
-
|
|
4536
|
+
const t = e, n = ee("webx-admin"), o = E(!1), l = _(() => t.title ?? n("help.title")), s = _(() => Ho(t.body));
|
|
4537
|
+
return (i, r) => (c(), C(G, null, [
|
|
4538
|
+
x(a(Ne), {
|
|
4537
4539
|
type: "details",
|
|
4538
4540
|
icon: "question",
|
|
4539
4541
|
tone: "neutral",
|
|
@@ -4541,7 +4543,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4541
4543
|
title: e.label ?? l.value,
|
|
4542
4544
|
onClick: r[0] || (r[0] = (u) => o.value = !0)
|
|
4543
4545
|
}, null, 8, ["size", "title"]),
|
|
4544
|
-
|
|
4546
|
+
x(a(Mt), {
|
|
4545
4547
|
open: o.value,
|
|
4546
4548
|
"onUpdate:open": r[1] || (r[1] = (u) => o.value = u),
|
|
4547
4549
|
title: l.value,
|
|
@@ -4577,7 +4579,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4577
4579
|
},
|
|
4578
4580
|
emits: ["change"],
|
|
4579
4581
|
setup(e, { emit: t }) {
|
|
4580
|
-
const n = e, o = t, l = oe(), s = ee("webx-admin"), i = Ye(), r = E([]), u = E(!0), v = E(""), m = E(!1), f = E(null),
|
|
4582
|
+
const n = e, o = t, l = oe(), s = ee("webx-admin"), i = Ye(), r = E([]), u = E(!0), v = E(""), m = E(!1), f = E(null), d = E(""), y = _(() => es(l, n.type, n.id)), w = _(() => n.title ?? s("notes.title"));
|
|
4581
4583
|
async function h() {
|
|
4582
4584
|
u.value = !0;
|
|
4583
4585
|
try {
|
|
@@ -4609,10 +4611,10 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4609
4611
|
}
|
|
4610
4612
|
}
|
|
4611
4613
|
function p(g) {
|
|
4612
|
-
f.value = g.id,
|
|
4614
|
+
f.value = g.id, d.value = g.body;
|
|
4613
4615
|
}
|
|
4614
4616
|
async function V(g) {
|
|
4615
|
-
const S =
|
|
4617
|
+
const S = d.value.trim();
|
|
4616
4618
|
if (S !== "")
|
|
4617
4619
|
try {
|
|
4618
4620
|
const k = await y.value.save(g.id, S);
|
|
@@ -4652,37 +4654,37 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4652
4654
|
function O(g) {
|
|
4653
4655
|
return g.author?.name ?? s("notes.unknown-author");
|
|
4654
4656
|
}
|
|
4655
|
-
return (g, S) => (
|
|
4656
|
-
|
|
4657
|
+
return (g, S) => (c(), C("section", Ss, [
|
|
4658
|
+
w.value ? (c(), N(a(ne), {
|
|
4657
4659
|
key: 0,
|
|
4658
4660
|
weight: "medium",
|
|
4659
4661
|
class: "wx-notes__title"
|
|
4660
4662
|
}, {
|
|
4661
4663
|
default: b(() => [
|
|
4662
|
-
M(T(
|
|
4664
|
+
M(T(w.value), 1)
|
|
4663
4665
|
]),
|
|
4664
4666
|
_: 1
|
|
4665
4667
|
})) : B("", !0),
|
|
4666
|
-
u.value ? (
|
|
4668
|
+
u.value ? (c(), N(a(Ce), {
|
|
4667
4669
|
key: 1,
|
|
4668
4670
|
rows: 2
|
|
4669
|
-
})) : r.value.length === 0 ? (
|
|
4671
|
+
})) : r.value.length === 0 ? (c(), N(a(it), {
|
|
4670
4672
|
key: 2,
|
|
4671
4673
|
size: "sm",
|
|
4672
4674
|
description: a(s)("notes.empty")
|
|
4673
|
-
}, null, 8, ["description"])) : (
|
|
4674
|
-
(
|
|
4675
|
+
}, null, 8, ["description"])) : (c(), C("ul", Ts, [
|
|
4676
|
+
(c(!0), C(G, null, ce(r.value, (k) => (c(), C("li", {
|
|
4675
4677
|
key: k.id,
|
|
4676
4678
|
class: "wx-note"
|
|
4677
4679
|
}, [
|
|
4678
|
-
|
|
4680
|
+
x(a(gn), {
|
|
4679
4681
|
name: O(k),
|
|
4680
4682
|
size: "sm",
|
|
4681
4683
|
tone: "auto"
|
|
4682
4684
|
}, null, 8, ["name"]),
|
|
4683
4685
|
D("div", As, [
|
|
4684
4686
|
D("div", Cs, [
|
|
4685
|
-
|
|
4687
|
+
x(a(ne), {
|
|
4686
4688
|
size: "sm",
|
|
4687
4689
|
weight: "medium",
|
|
4688
4690
|
truncate: ""
|
|
@@ -4692,22 +4694,22 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4692
4694
|
]),
|
|
4693
4695
|
_: 2
|
|
4694
4696
|
}, 1024),
|
|
4695
|
-
|
|
4697
|
+
x(Fe, {
|
|
4696
4698
|
value: k.created_at
|
|
4697
4699
|
}, null, 8, ["value"]),
|
|
4698
|
-
|
|
4700
|
+
x(Bt, {
|
|
4699
4701
|
actions: z(k),
|
|
4700
4702
|
label: O(k)
|
|
4701
4703
|
}, null, 8, ["actions", "label"])
|
|
4702
4704
|
]),
|
|
4703
|
-
f.value === k.id ? (
|
|
4704
|
-
|
|
4705
|
-
modelValue:
|
|
4706
|
-
"onUpdate:modelValue": S[0] || (S[0] = (I) =>
|
|
4705
|
+
f.value === k.id ? (c(), C(G, { key: 0 }, [
|
|
4706
|
+
x(a(Zt), {
|
|
4707
|
+
modelValue: d.value,
|
|
4708
|
+
"onUpdate:modelValue": S[0] || (S[0] = (I) => d.value = I),
|
|
4707
4709
|
autosize: { minRows: 2, maxRows: 10 }
|
|
4708
4710
|
}, null, 8, ["modelValue"]),
|
|
4709
4711
|
D("div", Ls, [
|
|
4710
|
-
|
|
4712
|
+
x(a(re), {
|
|
4711
4713
|
size: "sm",
|
|
4712
4714
|
type: "primary",
|
|
4713
4715
|
onClick: (I) => V(k)
|
|
@@ -4717,7 +4719,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4717
4719
|
]),
|
|
4718
4720
|
_: 1
|
|
4719
4721
|
}, 8, ["onClick"]),
|
|
4720
|
-
|
|
4722
|
+
x(a(re), {
|
|
4721
4723
|
size: "sm",
|
|
4722
4724
|
variant: "text",
|
|
4723
4725
|
onClick: S[1] || (S[1] = (I) => f.value = null)
|
|
@@ -4728,18 +4730,18 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4728
4730
|
_: 1
|
|
4729
4731
|
})
|
|
4730
4732
|
])
|
|
4731
|
-
], 64)) : (
|
|
4733
|
+
], 64)) : (c(), C("p", Ws, T(k.body), 1))
|
|
4732
4734
|
])
|
|
4733
4735
|
]))), 128))
|
|
4734
4736
|
])),
|
|
4735
|
-
e.can ? (
|
|
4736
|
-
|
|
4737
|
+
e.can ? (c(), C("div", zs, [
|
|
4738
|
+
x(a(Zt), {
|
|
4737
4739
|
modelValue: v.value,
|
|
4738
4740
|
"onUpdate:modelValue": S[2] || (S[2] = (k) => v.value = k),
|
|
4739
4741
|
placeholder: a(s)("notes.placeholder"),
|
|
4740
4742
|
autosize: { minRows: 2, maxRows: 8 }
|
|
4741
4743
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
4742
|
-
|
|
4744
|
+
x(a(re), {
|
|
4743
4745
|
size: "sm",
|
|
4744
4746
|
type: "primary",
|
|
4745
4747
|
disabled: v.value.trim() === "",
|
|
@@ -4767,7 +4769,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4767
4769
|
},
|
|
4768
4770
|
emits: ["save", "theirs", "pulled"],
|
|
4769
4771
|
setup(e, { emit: t }) {
|
|
4770
|
-
const n = e, o = t, l = ee("webx-admin"), s = mt(), i =
|
|
4772
|
+
const n = e, o = t, l = ee("webx-admin"), s = mt(), i = _(() => n.editing.conflict.value), r = _(() => n.editing.incoming.value), u = _(() => n.editing.editors.value), v = _(
|
|
4771
4773
|
() => l("editing.conflict-title", { who: n.editing.who(i.value?.theirs.changed) })
|
|
4772
4774
|
), m = E(null);
|
|
4773
4775
|
ue(
|
|
@@ -4779,23 +4781,23 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4779
4781
|
function f(L) {
|
|
4780
4782
|
return L ? s.short(L) : "";
|
|
4781
4783
|
}
|
|
4782
|
-
const
|
|
4783
|
-
() =>
|
|
4784
|
-
),
|
|
4784
|
+
const d = _(() => n.editing.events.value), y = _(
|
|
4785
|
+
() => d.value.some((L) => L.kind === "restored_version" || L.kind === "discarded")
|
|
4786
|
+
), w = _(() => {
|
|
4785
4787
|
const L = r.value;
|
|
4786
|
-
return L ? y.value ? n.editing.describe(
|
|
4788
|
+
return L ? y.value ? n.editing.describe(d.value) : rt(
|
|
4787
4789
|
l("editing.incoming", {
|
|
4788
4790
|
who: n.editing.who(L.theirs.changed),
|
|
4789
4791
|
what: n.editing.places(L.paths),
|
|
4790
4792
|
when: f(L.theirs.changed?.at)
|
|
4791
4793
|
})
|
|
4792
4794
|
) : "";
|
|
4793
|
-
}), h =
|
|
4795
|
+
}), h = _(() => n.editing.describe(d.value)), W = _(() => n.editing.trashed.value), p = _(() => {
|
|
4794
4796
|
const L = n.editing.trashedBy.value;
|
|
4795
4797
|
return L ? l("editing.trashed-title", { who: n.editing.who(L), when: f(L.at) }) : l("editing.trashed-anonymous", {
|
|
4796
4798
|
when: f(n.editing.state.value?.deleted_at)
|
|
4797
4799
|
});
|
|
4798
|
-
}), V =
|
|
4800
|
+
}), V = _(() => n.editing.gone.value), H = _(() => {
|
|
4799
4801
|
const L = V.value;
|
|
4800
4802
|
return L?.at ? rt(l("editing.purged-title", { who: n.editing.who(L), when: f(L.at) })) : l("editing.purged-anonymous");
|
|
4801
4803
|
}), z = E(!1);
|
|
@@ -4829,7 +4831,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4829
4831
|
async function U() {
|
|
4830
4832
|
await n.editing.pull() && o("pulled");
|
|
4831
4833
|
}
|
|
4832
|
-
return (L, j) => V.value ? (
|
|
4834
|
+
return (L, j) => V.value ? (c(), N(a(ye), {
|
|
4833
4835
|
key: 0,
|
|
4834
4836
|
class: "wx-editing-alerts",
|
|
4835
4837
|
type: "danger",
|
|
@@ -4838,7 +4840,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4838
4840
|
live: ""
|
|
4839
4841
|
}, {
|
|
4840
4842
|
actions: b(() => [
|
|
4841
|
-
|
|
4843
|
+
x(a(re), {
|
|
4842
4844
|
size: "sm",
|
|
4843
4845
|
type: "primary",
|
|
4844
4846
|
onClick: j[0] || (j[0] = (J) => e.editing.copyText())
|
|
@@ -4850,7 +4852,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4850
4852
|
})
|
|
4851
4853
|
]),
|
|
4852
4854
|
_: 1
|
|
4853
|
-
}, 8, ["title", "description"])) : W.value ? (
|
|
4855
|
+
}, 8, ["title", "description"])) : W.value ? (c(), N(a(ye), {
|
|
4854
4856
|
key: 1,
|
|
4855
4857
|
class: "wx-editing-alerts",
|
|
4856
4858
|
type: "danger",
|
|
@@ -4861,7 +4863,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4861
4863
|
e.editing.canRestore() ? {
|
|
4862
4864
|
name: "actions",
|
|
4863
4865
|
fn: b(() => [
|
|
4864
|
-
|
|
4866
|
+
x(a(re), {
|
|
4865
4867
|
size: "sm",
|
|
4866
4868
|
type: "primary",
|
|
4867
4869
|
loading: z.value,
|
|
@@ -4875,7 +4877,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4875
4877
|
]),
|
|
4876
4878
|
key: "0"
|
|
4877
4879
|
} : void 0
|
|
4878
|
-
]), 1032, ["title", "description"])) : i.value ? (
|
|
4880
|
+
]), 1032, ["title", "description"])) : i.value ? (c(), N(a(ye), {
|
|
4879
4881
|
key: 2,
|
|
4880
4882
|
ref_key: "conflictAlert",
|
|
4881
4883
|
ref: m,
|
|
@@ -4885,7 +4887,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4885
4887
|
live: ""
|
|
4886
4888
|
}, {
|
|
4887
4889
|
actions: b(() => [
|
|
4888
|
-
|
|
4890
|
+
x(a(re), {
|
|
4889
4891
|
size: "sm",
|
|
4890
4892
|
variant: "outline",
|
|
4891
4893
|
onClick: I
|
|
@@ -4895,7 +4897,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4895
4897
|
]),
|
|
4896
4898
|
_: 1
|
|
4897
4899
|
}),
|
|
4898
|
-
|
|
4900
|
+
x(a(re), {
|
|
4899
4901
|
size: "sm",
|
|
4900
4902
|
type: "primary",
|
|
4901
4903
|
onClick: k
|
|
@@ -4909,13 +4911,13 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4909
4911
|
default: b(() => [
|
|
4910
4912
|
D("p", Ns, T(a(l)("editing.conflict-text")), 1),
|
|
4911
4913
|
D("ul", Rs, [
|
|
4912
|
-
(
|
|
4914
|
+
(c(!0), C(G, null, ce(i.value.conflicts, (J) => (c(), C("li", {
|
|
4913
4915
|
key: J.id,
|
|
4914
4916
|
class: "wx-editing-alerts__item"
|
|
4915
4917
|
}, [
|
|
4916
4918
|
D("div", Vs, [
|
|
4917
4919
|
M(T(e.editing.label(J.path)) + " ", 1),
|
|
4918
|
-
J.kind !== "changed" ? (
|
|
4920
|
+
J.kind !== "changed" ? (c(), C("span", Us, T(a(l)(`editing.${J.kind}`)), 1)) : B("", !0)
|
|
4919
4921
|
]),
|
|
4920
4922
|
D("div", Is, [
|
|
4921
4923
|
D("span", Ms, T(a(l)("editing.base")), 1),
|
|
@@ -4926,13 +4928,13 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4926
4928
|
role: "radiogroup",
|
|
4927
4929
|
"aria-label": e.editing.label(J.path)
|
|
4928
4930
|
}, [
|
|
4929
|
-
(
|
|
4931
|
+
(c(), C(G, null, ce(["mine", "theirs"], (le) => D("button", {
|
|
4930
4932
|
key: le,
|
|
4931
4933
|
type: "button",
|
|
4932
4934
|
role: "radio",
|
|
4933
4935
|
class: ke(["wx-editing-alerts__choice", { "is-chosen": g(J) === le }]),
|
|
4934
4936
|
"aria-checked": g(J) === le,
|
|
4935
|
-
onClick: (
|
|
4937
|
+
onClick: (ve) => e.editing.choose(J.id, le)
|
|
4936
4938
|
}, [
|
|
4937
4939
|
D("span", Bs, T(a(l)(`editing.${le}`)), 1),
|
|
4938
4940
|
D("span", js, T(S(J, le)), 1)
|
|
@@ -4942,15 +4944,15 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4942
4944
|
])
|
|
4943
4945
|
]),
|
|
4944
4946
|
_: 1
|
|
4945
|
-
}, 8, ["title"])) : r.value ? (
|
|
4947
|
+
}, 8, ["title"])) : r.value ? (c(), N(a(ye), {
|
|
4946
4948
|
key: 3,
|
|
4947
4949
|
class: "wx-editing-alerts",
|
|
4948
4950
|
type: "info",
|
|
4949
|
-
title:
|
|
4951
|
+
title: w.value,
|
|
4950
4952
|
live: ""
|
|
4951
4953
|
}, {
|
|
4952
4954
|
actions: b(() => [
|
|
4953
|
-
|
|
4955
|
+
x(a(re), {
|
|
4954
4956
|
size: "sm",
|
|
4955
4957
|
type: "primary",
|
|
4956
4958
|
onClick: U
|
|
@@ -4962,7 +4964,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4962
4964
|
})
|
|
4963
4965
|
]),
|
|
4964
4966
|
_: 1
|
|
4965
|
-
}, 8, ["title"])) :
|
|
4967
|
+
}, 8, ["title"])) : d.value.length > 0 ? (c(), N(a(ye), {
|
|
4966
4968
|
key: 4,
|
|
4967
4969
|
class: "wx-editing-alerts",
|
|
4968
4970
|
type: "info",
|
|
@@ -4970,7 +4972,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4970
4972
|
live: ""
|
|
4971
4973
|
}, {
|
|
4972
4974
|
actions: b(() => [
|
|
4973
|
-
|
|
4975
|
+
x(a(re), {
|
|
4974
4976
|
size: "sm",
|
|
4975
4977
|
variant: "outline",
|
|
4976
4978
|
onClick: j[1] || (j[1] = (J) => e.editing.dismissEvents())
|
|
@@ -4982,7 +4984,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
4982
4984
|
})
|
|
4983
4985
|
]),
|
|
4984
4986
|
_: 1
|
|
4985
|
-
}, 8, ["title"])) : u.value.length > 0 ? (
|
|
4987
|
+
}, 8, ["title"])) : u.value.length > 0 ? (c(), C("p", Ds, T(a(l)("editing.others", { names: u.value.map((J) => J.name).join(", ") })), 1)) : B("", !0);
|
|
4986
4988
|
}
|
|
4987
4989
|
}), _i = /* @__PURE__ */ de(Fs, [["__scopeId", "data-v-4d019f39"]]), Hs = {
|
|
4988
4990
|
key: 0,
|
|
@@ -5000,23 +5002,23 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5000
5002
|
emits: ["restored"],
|
|
5001
5003
|
setup(e, { emit: t }) {
|
|
5002
5004
|
const n = e, o = t, l = oe(), s = ee("webx-admin"), i = Ye(), r = E(null), u = En({ screen: n.screen });
|
|
5003
|
-
function v(
|
|
5004
|
-
const h = [...new Set((
|
|
5005
|
+
function v(w) {
|
|
5006
|
+
const h = [...new Set((w.paths ?? []).map((p) => u.label(p)))];
|
|
5005
5007
|
if (h.length === 0) return "";
|
|
5006
5008
|
const W = h.slice(0, 3).join(", ");
|
|
5007
5009
|
return h.length > 3 ? s("editing.and-more", { what: W }) : W;
|
|
5008
5010
|
}
|
|
5009
5011
|
const m = E(!1), f = () => n.id === null || n.id === void 0 || n.id === "" ? null : `${l.apiPath}/editing/${n.entity}/${encodeURIComponent(String(n.id))}/drafts`;
|
|
5010
|
-
async function
|
|
5011
|
-
const
|
|
5012
|
-
if (
|
|
5012
|
+
async function d() {
|
|
5013
|
+
const w = f();
|
|
5014
|
+
if (w !== null)
|
|
5013
5015
|
try {
|
|
5014
|
-
r.value = (await l.http.get(
|
|
5016
|
+
r.value = (await l.http.get(w)).data;
|
|
5015
5017
|
} catch {
|
|
5016
5018
|
r.value = [];
|
|
5017
5019
|
}
|
|
5018
5020
|
}
|
|
5019
|
-
async function y(
|
|
5021
|
+
async function y(w) {
|
|
5020
5022
|
const h = f();
|
|
5021
5023
|
if (!(h === null || !await We({
|
|
5022
5024
|
title: s("editing.restore-title"),
|
|
@@ -5026,7 +5028,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5026
5028
|
}))) {
|
|
5027
5029
|
m.value = !0;
|
|
5028
5030
|
try {
|
|
5029
|
-
await l.http.post(`${h}/${
|
|
5031
|
+
await l.http.post(`${h}/${w.id}/restore`), o("restored"), Z.success(s("editing.restored")), await d();
|
|
5030
5032
|
} catch (p) {
|
|
5031
5033
|
Z.danger(i(p));
|
|
5032
5034
|
} finally {
|
|
@@ -5037,12 +5039,12 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5037
5039
|
return ue(
|
|
5038
5040
|
() => [n.entity, n.id, n.stamp],
|
|
5039
5041
|
() => {
|
|
5040
|
-
|
|
5042
|
+
d();
|
|
5041
5043
|
},
|
|
5042
5044
|
{ immediate: !0 }
|
|
5043
|
-
), (
|
|
5045
|
+
), (w, h) => r.value === null || r.value.length > 0 ? (c(), C("section", Hs, [
|
|
5044
5046
|
D("header", Ks, [
|
|
5045
|
-
|
|
5047
|
+
x(a(yn), {
|
|
5046
5048
|
level: 3,
|
|
5047
5049
|
size: "sm"
|
|
5048
5050
|
}, {
|
|
@@ -5051,7 +5053,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5051
5053
|
]),
|
|
5052
5054
|
_: 1
|
|
5053
5055
|
}),
|
|
5054
|
-
|
|
5056
|
+
x(a(ne), {
|
|
5055
5057
|
size: "sm",
|
|
5056
5058
|
tone: "muted"
|
|
5057
5059
|
}, {
|
|
@@ -5062,23 +5064,23 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5062
5064
|
})
|
|
5063
5065
|
]),
|
|
5064
5066
|
D("div", qs, [
|
|
5065
|
-
r.value === null ? (
|
|
5067
|
+
r.value === null ? (c(), N(a(Ce), {
|
|
5066
5068
|
key: 0,
|
|
5067
5069
|
class: "wx-drafts__ghost",
|
|
5068
5070
|
rows: 2
|
|
5069
5071
|
})) : B("", !0),
|
|
5070
|
-
(
|
|
5072
|
+
(c(!0), C(G, null, ce(r.value ?? [], (W) => (c(), C("div", {
|
|
5071
5073
|
key: W.id,
|
|
5072
5074
|
class: "wx-drafts__row"
|
|
5073
5075
|
}, [
|
|
5074
5076
|
D("div", Ys, [
|
|
5075
|
-
W.created_at ? (
|
|
5077
|
+
W.created_at ? (c(), N(Fe, {
|
|
5076
5078
|
key: 0,
|
|
5077
5079
|
value: W.created_at,
|
|
5078
5080
|
size: "md",
|
|
5079
5081
|
tone: "default"
|
|
5080
5082
|
}, null, 8, ["value"])) : B("", !0),
|
|
5081
|
-
|
|
5083
|
+
x(a(ne), {
|
|
5082
5084
|
size: "sm",
|
|
5083
5085
|
tone: "muted"
|
|
5084
5086
|
}, {
|
|
@@ -5087,7 +5089,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5087
5089
|
]),
|
|
5088
5090
|
_: 2
|
|
5089
5091
|
}, 1024),
|
|
5090
|
-
v(W) ? (
|
|
5092
|
+
v(W) ? (c(), N(a(ne), {
|
|
5091
5093
|
key: 1,
|
|
5092
5094
|
size: "sm",
|
|
5093
5095
|
class: "wx-drafts__changed"
|
|
@@ -5098,7 +5100,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5098
5100
|
_: 2
|
|
5099
5101
|
}, 1024)) : B("", !0)
|
|
5100
5102
|
]),
|
|
5101
|
-
|
|
5103
|
+
x(a(Ke), {
|
|
5102
5104
|
type: W.kind === "overwritten" ? "warning" : "default",
|
|
5103
5105
|
dot: ""
|
|
5104
5106
|
}, {
|
|
@@ -5107,7 +5109,7 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5107
5109
|
]),
|
|
5108
5110
|
_: 2
|
|
5109
5111
|
}, 1032, ["type"]),
|
|
5110
|
-
e.canRestore ? (
|
|
5112
|
+
e.canRestore ? (c(), N(a(re), {
|
|
5111
5113
|
key: 0,
|
|
5112
5114
|
size: "sm",
|
|
5113
5115
|
variant: "outline",
|
|
@@ -5130,34 +5132,34 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5130
5132
|
name: "WxBackupNote",
|
|
5131
5133
|
__name: "BackupNote",
|
|
5132
5134
|
setup(e) {
|
|
5133
|
-
const t = oe(), n = mt(), o = ee("webx-admin"), l =
|
|
5135
|
+
const t = oe(), n = mt(), o = ee("webx-admin"), l = _(() => t.state.manifest?.backup ?? null), s = _(() => l.value !== null && t.can("settings.view")), i = _(() => {
|
|
5134
5136
|
const v = l.value?.at;
|
|
5135
5137
|
if (v == null) return !0;
|
|
5136
5138
|
const m = new Date(v).getTime();
|
|
5137
5139
|
return Number.isNaN(m) || Date.now() - m > Gs * 36e5;
|
|
5138
|
-
}), r =
|
|
5140
|
+
}), r = _(() => {
|
|
5139
5141
|
const v = l.value?.bytes;
|
|
5140
5142
|
if (v == null) return "";
|
|
5141
5143
|
const m = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte"];
|
|
5142
|
-
let f = v,
|
|
5143
|
-
for (; f >= 1024 &&
|
|
5144
|
-
f /= 1024,
|
|
5144
|
+
let f = v, d = 0;
|
|
5145
|
+
for (; f >= 1024 && d < m.length - 1; )
|
|
5146
|
+
f /= 1024, d++;
|
|
5145
5147
|
return new Intl.NumberFormat(t.i18n.state.locale, {
|
|
5146
5148
|
style: "unit",
|
|
5147
|
-
unit: m[
|
|
5149
|
+
unit: m[d],
|
|
5148
5150
|
unitDisplay: "short",
|
|
5149
|
-
maximumFractionDigits: f >= 10 ||
|
|
5151
|
+
maximumFractionDigits: f >= 10 || d === 0 ? 0 : 1
|
|
5150
5152
|
}).format(f);
|
|
5151
|
-
}), u =
|
|
5153
|
+
}), u = _(
|
|
5152
5154
|
() => l.value?.at == null ? o("backup.never") : o("backup.stale", { date: n.short(l.value.at) })
|
|
5153
5155
|
);
|
|
5154
|
-
return (v, m) => s.value && i.value ? (
|
|
5156
|
+
return (v, m) => s.value && i.value ? (c(), N(a(ye), {
|
|
5155
5157
|
key: 0,
|
|
5156
5158
|
type: "warning",
|
|
5157
5159
|
variant: "soft",
|
|
5158
5160
|
description: u.value
|
|
5159
|
-
}, null, 8, ["description"])) : s.value ? (
|
|
5160
|
-
|
|
5161
|
+
}, null, 8, ["description"])) : s.value ? (c(), C("p", Xs, [
|
|
5162
|
+
x(a(ne), {
|
|
5161
5163
|
size: "sm",
|
|
5162
5164
|
tone: "muted"
|
|
5163
5165
|
}, {
|
|
@@ -5166,10 +5168,10 @@ const pi = 76, gi = /* @__PURE__ */ X({
|
|
|
5166
5168
|
]),
|
|
5167
5169
|
_: 1
|
|
5168
5170
|
}),
|
|
5169
|
-
|
|
5171
|
+
x(Fe, {
|
|
5170
5172
|
value: l.value?.at
|
|
5171
5173
|
}, null, 8, ["value"]),
|
|
5172
|
-
r.value ? (
|
|
5174
|
+
r.value ? (c(), N(a(ne), {
|
|
5173
5175
|
key: 0,
|
|
5174
5176
|
size: "sm",
|
|
5175
5177
|
tone: "muted"
|