@webx-ui/module-auth 0.8.12 → 0.8.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +84 -82
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -86,25 +86,25 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
86
86
|
capsLock: o.capsLockWarning ?? _("card.caps-lock"),
|
|
87
87
|
reveal: o.revealLabel ?? _("card.reveal"),
|
|
88
88
|
hide: o.hideLabel ?? _("card.hide")
|
|
89
|
-
})),
|
|
89
|
+
})), g = T(""), O = T(""), v = T(!1), b = T(!1), w = T(!1), m = T(!1), k = T(""), f = T({}), h = T(0), z = re("emailField");
|
|
90
90
|
let A = null;
|
|
91
91
|
qe(D);
|
|
92
92
|
const S = P(() => h.value > 0), s = P(
|
|
93
93
|
() => o.throttleMessage === void 0 ? _("card.throttled", { seconds: h.value }) : o.throttleMessage.replace(":seconds", String(h.value))
|
|
94
94
|
);
|
|
95
95
|
async function x() {
|
|
96
|
-
if (!(
|
|
97
|
-
|
|
96
|
+
if (!(b.value || S.value)) {
|
|
97
|
+
b.value = !0, k.value = "", f.value = {};
|
|
98
98
|
try {
|
|
99
99
|
await c.login({
|
|
100
|
-
email:
|
|
100
|
+
email: g.value,
|
|
101
101
|
password: O.value,
|
|
102
102
|
remember: v.value
|
|
103
103
|
}), O.value = "", y("success");
|
|
104
104
|
} catch (C) {
|
|
105
105
|
U(C);
|
|
106
106
|
} finally {
|
|
107
|
-
|
|
107
|
+
b.value = !1;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -143,7 +143,7 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
143
143
|
default: t(() => [
|
|
144
144
|
a(ae, {
|
|
145
145
|
errors: f.value,
|
|
146
|
-
disabled:
|
|
146
|
+
disabled: b.value,
|
|
147
147
|
gap: "md",
|
|
148
148
|
onSubmit: Pe(x, ["prevent"])
|
|
149
149
|
}, {
|
|
@@ -168,8 +168,8 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
168
168
|
a(ce, {
|
|
169
169
|
ref_key: "emailField",
|
|
170
170
|
ref: z,
|
|
171
|
-
modelValue:
|
|
172
|
-
"onUpdate:modelValue": R[0] || (R[0] = (se) =>
|
|
171
|
+
modelValue: g.value,
|
|
172
|
+
"onUpdate:modelValue": R[0] || (R[0] = (se) => g.value = se),
|
|
173
173
|
type: "email",
|
|
174
174
|
placeholder: r.value.email,
|
|
175
175
|
"aria-label": r.value.email,
|
|
@@ -237,7 +237,7 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
237
237
|
"native-type": "submit",
|
|
238
238
|
size: "lg",
|
|
239
239
|
block: "",
|
|
240
|
-
loading:
|
|
240
|
+
loading: b.value,
|
|
241
241
|
disabled: S.value
|
|
242
242
|
}, {
|
|
243
243
|
default: t(() => [
|
|
@@ -472,7 +472,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
472
472
|
setup(n) {
|
|
473
473
|
const u = n, { resolve: l, dismiss: o, open: y } = ge(), c = ee(), _ = fe(c), r = Be();
|
|
474
474
|
te();
|
|
475
|
-
const
|
|
475
|
+
const g = j("webx-auth"), O = ve(), v = T([]), b = T(!1), w = T({}), m = T({
|
|
476
476
|
name: "",
|
|
477
477
|
email: "",
|
|
478
478
|
password: "",
|
|
@@ -487,7 +487,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
487
487
|
m.value.avatar = s?.path ?? null;
|
|
488
488
|
}
|
|
489
489
|
}), f = P(() => u.admin !== null), h = P(() => v.value.map((s) => ({ value: s.id, label: s.name }))), z = P(() => [
|
|
490
|
-
{ value: "auto", label:
|
|
490
|
+
{ value: "auto", label: g("admins.locale-auto") },
|
|
491
491
|
...r.state.panelLocales.map((s) => ({ value: s.code, label: s.nativeName }))
|
|
492
492
|
]);
|
|
493
493
|
_.roles().then((s) => v.value = s), ue(
|
|
@@ -510,7 +510,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
510
510
|
return w.value[s]?.[0];
|
|
511
511
|
}
|
|
512
512
|
async function S() {
|
|
513
|
-
|
|
513
|
+
b.value = !0, w.value = {};
|
|
514
514
|
const s = {
|
|
515
515
|
name: m.value.name,
|
|
516
516
|
email: m.value.email,
|
|
@@ -523,18 +523,18 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
523
523
|
m.value.password && (s.password = m.value.password);
|
|
524
524
|
try {
|
|
525
525
|
const x = u.admin ? await _.update(u.admin.id, s) : await _.create(s);
|
|
526
|
-
q.success(
|
|
526
|
+
q.success(g(f.value ? "admins.updated" : "admins.created")), l(x);
|
|
527
527
|
} catch (x) {
|
|
528
528
|
const U = x.body;
|
|
529
529
|
U?.errors ? w.value = U.errors : q.danger(O(x));
|
|
530
530
|
} finally {
|
|
531
|
-
|
|
531
|
+
b.value = !1;
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
return (s, x) => (p(), V(e(we), {
|
|
535
535
|
open: e(y),
|
|
536
536
|
"onUpdate:open": x[9] || (x[9] = (U) => be(y) ? y.value = U : null),
|
|
537
|
-
title: f.value ? e(
|
|
537
|
+
title: f.value ? e(g)("admins.edit-short") : e(g)("admins.new-short"),
|
|
538
538
|
width: 720
|
|
539
539
|
}, {
|
|
540
540
|
footer: t(() => [
|
|
@@ -545,17 +545,17 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
545
545
|
onClick: x[8] || (x[8] = (U) => e(o)())
|
|
546
546
|
}, {
|
|
547
547
|
default: t(() => [
|
|
548
|
-
d(i(e(
|
|
548
|
+
d(i(e(g)("admins.cancel")), 1)
|
|
549
549
|
]),
|
|
550
550
|
_: 1
|
|
551
551
|
}),
|
|
552
552
|
a(e(I), {
|
|
553
553
|
type: "primary",
|
|
554
|
-
loading:
|
|
554
|
+
loading: b.value,
|
|
555
555
|
onClick: S
|
|
556
556
|
}, {
|
|
557
557
|
default: t(() => [
|
|
558
|
-
d(i(e(
|
|
558
|
+
d(i(e(g)("admins.save")), 1)
|
|
559
559
|
]),
|
|
560
560
|
_: 1
|
|
561
561
|
}, 8, ["loading"])
|
|
@@ -570,14 +570,14 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
570
570
|
(p(), V(Fe(n.avatarField), {
|
|
571
571
|
modelValue: k.value,
|
|
572
572
|
"onUpdate:modelValue": x[0] || (x[0] = (U) => k.value = U),
|
|
573
|
-
label: e(
|
|
573
|
+
label: e(g)("admins.avatar"),
|
|
574
574
|
aspect: "1/1",
|
|
575
575
|
captions: !1
|
|
576
576
|
}, null, 8, ["modelValue", "label"]))
|
|
577
577
|
])) : E("", !0),
|
|
578
578
|
W("div", ht, [
|
|
579
579
|
a(e(M), {
|
|
580
|
-
label: e(
|
|
580
|
+
label: e(g)("admins.name"),
|
|
581
581
|
error: A("name")
|
|
582
582
|
}, {
|
|
583
583
|
default: t(() => [
|
|
@@ -590,7 +590,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
590
590
|
_: 1
|
|
591
591
|
}, 8, ["label", "error"]),
|
|
592
592
|
a(e(M), {
|
|
593
|
-
label: e(
|
|
593
|
+
label: e(g)("admins.email"),
|
|
594
594
|
error: A("email")
|
|
595
595
|
}, {
|
|
596
596
|
default: t(() => [
|
|
@@ -605,9 +605,9 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
605
605
|
_: 1
|
|
606
606
|
}, 8, ["label", "error"]),
|
|
607
607
|
a(e(M), {
|
|
608
|
-
label: e(
|
|
608
|
+
label: e(g)("admins.password"),
|
|
609
609
|
error: A("password"),
|
|
610
|
-
help: f.value ? e(
|
|
610
|
+
help: f.value ? e(g)("admins.password-keep") : e(g)("admins.password-hint")
|
|
611
611
|
}, {
|
|
612
612
|
default: t(() => [
|
|
613
613
|
a(e(le), {
|
|
@@ -621,7 +621,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
621
621
|
_: 1
|
|
622
622
|
}, 8, ["label", "error", "help"]),
|
|
623
623
|
a(e(M), {
|
|
624
|
-
label: e(
|
|
624
|
+
label: e(g)("admins.roles"),
|
|
625
625
|
error: A("roles")
|
|
626
626
|
}, {
|
|
627
627
|
default: t(() => [
|
|
@@ -635,7 +635,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
635
635
|
_: 1
|
|
636
636
|
}, 8, ["label", "error"]),
|
|
637
637
|
a(e(M), {
|
|
638
|
-
label: e(
|
|
638
|
+
label: e(g)("admins.locale")
|
|
639
639
|
}, {
|
|
640
640
|
default: t(() => [
|
|
641
641
|
a(e(ne), {
|
|
@@ -651,12 +651,12 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
651
651
|
a(e(ze), {
|
|
652
652
|
modelValue: m.value.is_active,
|
|
653
653
|
"onUpdate:modelValue": x[6] || (x[6] = (U) => m.value.is_active = U),
|
|
654
|
-
label: e(
|
|
654
|
+
label: e(g)("admins.active")
|
|
655
655
|
}, null, 8, ["modelValue", "label"]),
|
|
656
656
|
a(e(ze), {
|
|
657
657
|
modelValue: m.value.is_super,
|
|
658
658
|
"onUpdate:modelValue": x[7] || (x[7] = (U) => m.value.is_super = U),
|
|
659
|
-
label: e(
|
|
659
|
+
label: e(g)("admins.super")
|
|
660
660
|
}, null, 8, ["modelValue", "label"])
|
|
661
661
|
]),
|
|
662
662
|
_: 1
|
|
@@ -666,7 +666,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
666
666
|
tone: "muted"
|
|
667
667
|
}, {
|
|
668
668
|
default: t(() => [
|
|
669
|
-
d(i(e(
|
|
669
|
+
d(i(e(g)("admins.super-hint")), 1)
|
|
670
670
|
]),
|
|
671
671
|
_: 1
|
|
672
672
|
})
|
|
@@ -690,7 +690,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
690
690
|
setup(n, { expose: u, emit: l }) {
|
|
691
691
|
const o = n, y = l, c = ee(), _ = fe(c);
|
|
692
692
|
te();
|
|
693
|
-
const r = re("root"),
|
|
693
|
+
const r = re("root"), g = xe(r), O = P(() => g.value > 0 && g.value < We), v = j("webx-auth"), b = j("webx-admin"), w = T(null), m = T([]), k = T(!1), f = T("all"), h = T("any"), z = T([]), A = T({});
|
|
694
694
|
let S = { page: 1, perPage: 20, sort: null, search: "" };
|
|
695
695
|
const s = P(() => [
|
|
696
696
|
{ value: "all", label: v("admins.all-roles") },
|
|
@@ -802,9 +802,11 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
802
802
|
"search-placeholder": e(v)("admins.search"),
|
|
803
803
|
"empty-text": e(v)("admins.empty"),
|
|
804
804
|
selectable: n.picking && n.multiple,
|
|
805
|
+
"select-row-label": e(b)("filters.select-row"),
|
|
806
|
+
"select-all-label": e(b)("filters.select-all"),
|
|
805
807
|
"cards-below": We,
|
|
806
808
|
"filters-count": U.value.length,
|
|
807
|
-
"filters-label": e(
|
|
809
|
+
"filters-label": e(b)("filters.title"),
|
|
808
810
|
onRowClick: $,
|
|
809
811
|
onStateChange: G,
|
|
810
812
|
onSelectionChange: ce
|
|
@@ -977,7 +979,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
977
979
|
a(e(Z), { name: "close" })
|
|
978
980
|
]),
|
|
979
981
|
default: t(() => [
|
|
980
|
-
d(" " + i(e(
|
|
982
|
+
d(" " + i(e(b)("filters.reset")), 1)
|
|
981
983
|
]),
|
|
982
984
|
_: 1
|
|
983
985
|
})) : E("", !0)
|
|
@@ -991,7 +993,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
991
993
|
]),
|
|
992
994
|
key: "1"
|
|
993
995
|
} : void 0
|
|
994
|
-
]), 1032, ["data", "columns", "clickable", "hover", "loading", "search-placeholder", "empty-text", "selectable", "filters-count", "filters-label"])
|
|
996
|
+
]), 1032, ["data", "columns", "clickable", "hover", "loading", "search-placeholder", "empty-text", "selectable", "select-row-label", "select-all-label", "filters-count", "filters-label"])
|
|
995
997
|
], 512));
|
|
996
998
|
}
|
|
997
999
|
}), _t = { class: "wx-call-list__details" }, bt = {
|
|
@@ -1008,7 +1010,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1008
1010
|
setup(n, { expose: u }) {
|
|
1009
1011
|
const l = ee(), o = fe(l);
|
|
1010
1012
|
te();
|
|
1011
|
-
const y = re("root"), c = xe(y), _ = P(() => c.value > 0 && c.value < Te), r = j("webx-auth"),
|
|
1013
|
+
const y = re("root"), c = xe(y), _ = P(() => c.value > 0 && c.value < Te), r = j("webx-auth"), g = j("webx-admin"), O = T(null), v = T({ users: [], tools: [] }), b = T(!1), w = T("all"), m = T("all"), k = T("any");
|
|
1012
1014
|
let f = { page: 1, perPage: 30, sort: null, search: "" };
|
|
1013
1015
|
function h(C) {
|
|
1014
1016
|
return C === null ? r("calls.local") : C.name ?? r("calls.deleted", { id: C.id });
|
|
@@ -1058,7 +1060,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1058
1060
|
]);
|
|
1059
1061
|
ue([w, m, k], () => X({ ...f, page: 1 }));
|
|
1060
1062
|
async function X(C) {
|
|
1061
|
-
f = C,
|
|
1063
|
+
f = C, b.value = !0;
|
|
1062
1064
|
try {
|
|
1063
1065
|
O.value = await o.calls({
|
|
1064
1066
|
user: w.value === "all" ? null : w.value,
|
|
@@ -1068,7 +1070,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1068
1070
|
per_page: C.perPage
|
|
1069
1071
|
}), v.value = O.value.filters;
|
|
1070
1072
|
} finally {
|
|
1071
|
-
|
|
1073
|
+
b.value = !1;
|
|
1072
1074
|
}
|
|
1073
1075
|
}
|
|
1074
1076
|
function D(C) {
|
|
@@ -1087,14 +1089,14 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1087
1089
|
columns: U.value,
|
|
1088
1090
|
"row-key": "id",
|
|
1089
1091
|
flush: "",
|
|
1090
|
-
loading:
|
|
1092
|
+
loading: b.value,
|
|
1091
1093
|
clickable: !1,
|
|
1092
1094
|
expandable: !_.value,
|
|
1093
1095
|
"expandable-if": G,
|
|
1094
1096
|
"empty-text": e(r)("calls.empty"),
|
|
1095
1097
|
"cards-below": Te,
|
|
1096
1098
|
"filters-count": s.value.length,
|
|
1097
|
-
"filters-label": e(
|
|
1099
|
+
"filters-label": e(g)("filters.title"),
|
|
1098
1100
|
onStateChange: X
|
|
1099
1101
|
}, {
|
|
1100
1102
|
filters: t(() => [
|
|
@@ -1148,7 +1150,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1148
1150
|
a(e(Z), { name: "close" })
|
|
1149
1151
|
]),
|
|
1150
1152
|
default: t(() => [
|
|
1151
|
-
d(" " + i(e(
|
|
1153
|
+
d(" " + i(e(g)("filters.reset")), 1)
|
|
1152
1154
|
]),
|
|
1153
1155
|
_: 1
|
|
1154
1156
|
})) : E("", !0)
|
|
@@ -1342,7 +1344,7 @@ const Ct = {
|
|
|
1342
1344
|
setup(n, { expose: u }) {
|
|
1343
1345
|
const l = n, o = ee(), y = kt(o);
|
|
1344
1346
|
te();
|
|
1345
|
-
const c = j("webx-auth"), _ = ve(), r = re("root"),
|
|
1347
|
+
const c = j("webx-auth"), _ = ve(), r = re("root"), g = xe(r), O = P(() => g.value > 0 && g.value < Ue), v = T([]), b = T(!1), w = T(null), m = P(() => O.value ? [{ key: "card", label: "" }] : [
|
|
1346
1348
|
{ key: "client", label: c("connections.client"), minWidth: 210 },
|
|
1347
1349
|
...l.scope === "all" ? [{ key: "user", label: c("connections.who"), minWidth: 140 }] : [],
|
|
1348
1350
|
{ key: "read_only", label: c("connections.allowed"), minWidth: 160 },
|
|
@@ -1360,13 +1362,13 @@ const Ct = {
|
|
|
1360
1362
|
return c("connections.full", { name: S || k(A) });
|
|
1361
1363
|
}
|
|
1362
1364
|
async function h() {
|
|
1363
|
-
|
|
1365
|
+
b.value = !0;
|
|
1364
1366
|
try {
|
|
1365
1367
|
v.value = (await y.list(l.scope)).data;
|
|
1366
1368
|
} catch (A) {
|
|
1367
1369
|
q.danger(_(A));
|
|
1368
1370
|
} finally {
|
|
1369
|
-
|
|
1371
|
+
b.value = !1;
|
|
1370
1372
|
}
|
|
1371
1373
|
}
|
|
1372
1374
|
async function z(A) {
|
|
@@ -1398,7 +1400,7 @@ const Ct = {
|
|
|
1398
1400
|
columns: m.value,
|
|
1399
1401
|
"row-key": "id",
|
|
1400
1402
|
flush: "",
|
|
1401
|
-
loading:
|
|
1403
|
+
loading: b.value,
|
|
1402
1404
|
clickable: !1,
|
|
1403
1405
|
"empty-text": n.scope === "all" ? e(c)("connections.empty-all") : e(c)("connections.empty"),
|
|
1404
1406
|
"cards-below": Ue,
|
|
@@ -1593,11 +1595,11 @@ const Ct = {
|
|
|
1593
1595
|
setup(n) {
|
|
1594
1596
|
const u = n, l = ee(), o = fe(l), y = tt(), c = at();
|
|
1595
1597
|
te();
|
|
1596
|
-
const _ = j("webx-auth"), r = ve(),
|
|
1598
|
+
const _ = j("webx-auth"), r = ve(), g = re("list"), O = T(null), v = $e(yt), b = l.can("admins.manage"), w = l.can("admins.audit"), m = P(
|
|
1597
1599
|
() => l.state.manifest?.modules.find((S) => S.id === "admins")?.title ?? _("admins.title")
|
|
1598
1600
|
), k = P(() => {
|
|
1599
1601
|
const S = [{ value: "admins", label: m.value }];
|
|
1600
|
-
return w && S.push({ value: "calls", label: _("calls.title") }),
|
|
1602
|
+
return w && S.push({ value: "calls", label: _("calls.title") }), b && S.push({ value: "connections", label: _("connections.title") }), S.length > 1 ? S : void 0;
|
|
1601
1603
|
}), f = P({
|
|
1602
1604
|
get: () => u.current,
|
|
1603
1605
|
set: (S) => {
|
|
@@ -1605,7 +1607,7 @@ const Ct = {
|
|
|
1605
1607
|
s !== c.path && y.push(s);
|
|
1606
1608
|
}
|
|
1607
1609
|
}), h = P(
|
|
1608
|
-
() =>
|
|
1610
|
+
() => b && u.current === "admins" ? [
|
|
1609
1611
|
{
|
|
1610
1612
|
key: "new",
|
|
1611
1613
|
label: _("admins.new-short"),
|
|
@@ -1618,7 +1620,7 @@ const Ct = {
|
|
|
1618
1620
|
] : []
|
|
1619
1621
|
);
|
|
1620
1622
|
async function z(S) {
|
|
1621
|
-
O.value = S, await v({ admin: S, avatarField: u.avatarField }) &&
|
|
1623
|
+
O.value = S, await v({ admin: S, avatarField: u.avatarField }) && g.value?.reload();
|
|
1622
1624
|
}
|
|
1623
1625
|
async function A(S) {
|
|
1624
1626
|
if (await Ne({
|
|
@@ -1629,7 +1631,7 @@ const Ct = {
|
|
|
1629
1631
|
tone: "danger"
|
|
1630
1632
|
}))
|
|
1631
1633
|
try {
|
|
1632
|
-
await o.remove(S.id), q.success(_("admins.deleted")),
|
|
1634
|
+
await o.remove(S.id), q.success(_("admins.deleted")), g.value?.reload();
|
|
1633
1635
|
} catch (x) {
|
|
1634
1636
|
q.danger(r(x));
|
|
1635
1637
|
}
|
|
@@ -1648,8 +1650,8 @@ const Ct = {
|
|
|
1648
1650
|
})) : (p(), V(Ye, {
|
|
1649
1651
|
key: 2,
|
|
1650
1652
|
ref_key: "list",
|
|
1651
|
-
ref:
|
|
1652
|
-
removable: e(
|
|
1653
|
+
ref: g,
|
|
1654
|
+
removable: e(b),
|
|
1653
1655
|
"resolve-avatar": u.resolveAvatar,
|
|
1654
1656
|
onOpen: z,
|
|
1655
1657
|
onRemove: A
|
|
@@ -1674,15 +1676,15 @@ const Ct = {
|
|
|
1674
1676
|
} catch {
|
|
1675
1677
|
return "webx";
|
|
1676
1678
|
}
|
|
1677
|
-
}), r = P(() => `claude mcp add --transport http ${_.value} ${c.value}`),
|
|
1679
|
+
}), r = P(() => `claude mcp add --transport http ${_.value} ${c.value}`), g = P(() => `[mcp_servers.${_.value}]
|
|
1678
1680
|
url = "${c.value}"`), O = P(() => {
|
|
1679
|
-
const k =
|
|
1681
|
+
const k = b(JSON.stringify({ url: c.value }));
|
|
1680
1682
|
return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(_.value)}&config=${k}`;
|
|
1681
1683
|
}), v = P(() => {
|
|
1682
1684
|
const k = JSON.stringify({ name: _.value, type: "http", url: c.value });
|
|
1683
1685
|
return `vscode:mcp/install?${encodeURIComponent(k)}`;
|
|
1684
1686
|
});
|
|
1685
|
-
function
|
|
1687
|
+
function b(k) {
|
|
1686
1688
|
const f = new TextEncoder().encode(k);
|
|
1687
1689
|
let h = "";
|
|
1688
1690
|
for (const z of f) h += String.fromCharCode(z);
|
|
@@ -1839,11 +1841,11 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1839
1841
|
_: 1
|
|
1840
1842
|
}),
|
|
1841
1843
|
W("div", Ut, [
|
|
1842
|
-
W("pre", null, i(
|
|
1844
|
+
W("pre", null, i(g.value), 1),
|
|
1843
1845
|
a(e(I), {
|
|
1844
1846
|
variant: "text",
|
|
1845
1847
|
size: "sm",
|
|
1846
|
-
onClick: f[2] || (f[2] = (h) => w(
|
|
1848
|
+
onClick: f[2] || (f[2] = (h) => w(g.value))
|
|
1847
1849
|
}, {
|
|
1848
1850
|
icon: t(() => [
|
|
1849
1851
|
a(e(Z), { name: "copy" })
|
|
@@ -1992,15 +1994,15 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
1992
1994
|
const u = n, { open: l, resolve: o, dismiss: y } = ge();
|
|
1993
1995
|
te();
|
|
1994
1996
|
const c = j("webx-auth"), _ = re("list"), r = T(0);
|
|
1995
|
-
function
|
|
1997
|
+
function g(v) {
|
|
1996
1998
|
o(v);
|
|
1997
1999
|
}
|
|
1998
2000
|
function O(v) {
|
|
1999
2001
|
r.value = v.length;
|
|
2000
2002
|
}
|
|
2001
|
-
return (v,
|
|
2003
|
+
return (v, b) => (p(), V(e(we), {
|
|
2002
2004
|
open: e(l),
|
|
2003
|
-
"onUpdate:open":
|
|
2005
|
+
"onUpdate:open": b[2] || (b[2] = (w) => be(l) ? l.value = w : null),
|
|
2004
2006
|
title: n.title ?? e(c)(n.multiple ? "admins.select-many" : "admins.select-one"),
|
|
2005
2007
|
width: 880
|
|
2006
2008
|
}, Oe({
|
|
@@ -2011,7 +2013,7 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
2011
2013
|
picking: "",
|
|
2012
2014
|
multiple: n.multiple,
|
|
2013
2015
|
"resolve-avatar": u.resolveAvatar,
|
|
2014
|
-
onChosen:
|
|
2016
|
+
onChosen: g,
|
|
2015
2017
|
onSelection: O
|
|
2016
2018
|
}, null, 8, ["multiple", "resolve-avatar"])
|
|
2017
2019
|
]),
|
|
@@ -2036,7 +2038,7 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
2036
2038
|
}),
|
|
2037
2039
|
a(e(I), {
|
|
2038
2040
|
variant: "outline",
|
|
2039
|
-
onClick:
|
|
2041
|
+
onClick: b[0] || (b[0] = (w) => e(y)())
|
|
2040
2042
|
}, {
|
|
2041
2043
|
default: t(() => [
|
|
2042
2044
|
d(i(e(c)("admins.cancel")), 1)
|
|
@@ -2046,7 +2048,7 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
2046
2048
|
a(e(I), {
|
|
2047
2049
|
type: "primary",
|
|
2048
2050
|
disabled: r.value === 0,
|
|
2049
|
-
onClick:
|
|
2051
|
+
onClick: b[1] || (b[1] = (w) => e(o)(_.value?.chosen() ?? []))
|
|
2050
2052
|
}, {
|
|
2051
2053
|
default: t(() => [
|
|
2052
2054
|
d(i(e(c)("admins.save")), 1)
|
|
@@ -2079,12 +2081,12 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2079
2081
|
setup(n) {
|
|
2080
2082
|
const u = n, { resolve: l, dismiss: o, open: y } = ge(), c = ee(), _ = Ae();
|
|
2081
2083
|
te();
|
|
2082
|
-
const r = j("webx-auth"),
|
|
2084
|
+
const r = j("webx-auth"), g = ve(), O = T(!1), v = T({}), b = T({
|
|
2083
2085
|
name: c.state.user?.name ?? "",
|
|
2084
2086
|
avatar: c.state.user?.avatar ?? null,
|
|
2085
2087
|
password: "",
|
|
2086
2088
|
current_password: ""
|
|
2087
|
-
}), w = T(
|
|
2089
|
+
}), w = T(b.value.avatar ? { path: b.value.avatar } : null);
|
|
2088
2090
|
function m(f) {
|
|
2089
2091
|
return v.value[f]?.[0];
|
|
2090
2092
|
}
|
|
@@ -2092,15 +2094,15 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2092
2094
|
O.value = !0, v.value = {};
|
|
2093
2095
|
try {
|
|
2094
2096
|
await _.updateProfile({
|
|
2095
|
-
name:
|
|
2097
|
+
name: b.value.name,
|
|
2096
2098
|
avatar: w.value?.path ?? null,
|
|
2097
2099
|
// Blank is left out entirely rather than sent as an empty string: the server reads a
|
|
2098
2100
|
// filled password as "change it", and an empty one would be a change to nothing.
|
|
2099
|
-
...
|
|
2101
|
+
...b.value.password ? { password: b.value.password, current_password: b.value.current_password } : {}
|
|
2100
2102
|
}), q.success(r("profile.saved")), l(!0);
|
|
2101
2103
|
} catch (f) {
|
|
2102
2104
|
const h = f.body;
|
|
2103
|
-
h?.errors ? v.value = h.errors : q.danger(
|
|
2105
|
+
h?.errors ? v.value = h.errors : q.danger(g(f));
|
|
2104
2106
|
} finally {
|
|
2105
2107
|
O.value = !1;
|
|
2106
2108
|
}
|
|
@@ -2150,8 +2152,8 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2150
2152
|
}, {
|
|
2151
2153
|
default: t(() => [
|
|
2152
2154
|
a(e(le), {
|
|
2153
|
-
modelValue:
|
|
2154
|
-
"onUpdate:modelValue": h[1] || (h[1] = (z) =>
|
|
2155
|
+
modelValue: b.value.name,
|
|
2156
|
+
"onUpdate:modelValue": h[1] || (h[1] = (z) => b.value.name = z),
|
|
2155
2157
|
name: "name"
|
|
2156
2158
|
}, null, 8, ["modelValue"])
|
|
2157
2159
|
]),
|
|
@@ -2175,15 +2177,15 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2175
2177
|
}, {
|
|
2176
2178
|
default: t(() => [
|
|
2177
2179
|
a(e(le), {
|
|
2178
|
-
modelValue:
|
|
2179
|
-
"onUpdate:modelValue": h[2] || (h[2] = (z) =>
|
|
2180
|
+
modelValue: b.value.password,
|
|
2181
|
+
"onUpdate:modelValue": h[2] || (h[2] = (z) => b.value.password = z),
|
|
2180
2182
|
type: "password",
|
|
2181
2183
|
autocomplete: "new-password"
|
|
2182
2184
|
}, null, 8, ["modelValue"])
|
|
2183
2185
|
]),
|
|
2184
2186
|
_: 1
|
|
2185
2187
|
}, 8, ["label", "help", "error"]),
|
|
2186
|
-
|
|
2188
|
+
b.value.password ? (p(), V(e(M), {
|
|
2187
2189
|
key: 0,
|
|
2188
2190
|
label: e(r)("profile.current-password"),
|
|
2189
2191
|
help: e(r)("profile.current-password-hint"),
|
|
@@ -2191,8 +2193,8 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2191
2193
|
}, {
|
|
2192
2194
|
default: t(() => [
|
|
2193
2195
|
a(e(le), {
|
|
2194
|
-
modelValue:
|
|
2195
|
-
"onUpdate:modelValue": h[3] || (h[3] = (z) =>
|
|
2196
|
+
modelValue: b.value.current_password,
|
|
2197
|
+
"onUpdate:modelValue": h[3] || (h[3] = (z) => b.value.current_password = z),
|
|
2196
2198
|
type: "password",
|
|
2197
2199
|
autocomplete: "current-password"
|
|
2198
2200
|
}, null, 8, ["modelValue"])
|
|
@@ -2218,11 +2220,11 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2218
2220
|
expanded: { type: Boolean, default: !1 }
|
|
2219
2221
|
},
|
|
2220
2222
|
setup(n) {
|
|
2221
|
-
const u = n, l = ee(), o = Ae(), y = Be(), c = et(), _ = j("webx-auth"), r = y.scope("webx-admin"),
|
|
2223
|
+
const u = n, l = ee(), o = Ae(), y = Be(), c = et(), _ = j("webx-auth"), r = y.scope("webx-admin"), g = P(() => l.state.user), O = P(
|
|
2222
2224
|
() => y.state.panelLocales.length > 1 ? y.state.panelLocales : []
|
|
2223
|
-
), v = ye(Me, null),
|
|
2225
|
+
), v = ye(Me, null), b = ye(He, null), w = T(void 0);
|
|
2224
2226
|
ue(
|
|
2225
|
-
() => typeof
|
|
2227
|
+
() => typeof g.value?.avatar == "string" ? g.value.avatar : null,
|
|
2226
2228
|
async (z) => {
|
|
2227
2229
|
const A = u.resolveAvatar ?? v;
|
|
2228
2230
|
if (z === null || z === "" || A === null) {
|
|
@@ -2230,7 +2232,7 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2230
2232
|
return;
|
|
2231
2233
|
}
|
|
2232
2234
|
const S = await A(z);
|
|
2233
|
-
|
|
2235
|
+
g.value?.avatar === z && (w.value = S ?? void 0);
|
|
2234
2236
|
},
|
|
2235
2237
|
{ immediate: !0 }
|
|
2236
2238
|
);
|
|
@@ -2238,7 +2240,7 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2238
2240
|
function k() {
|
|
2239
2241
|
setTimeout(
|
|
2240
2242
|
() => {
|
|
2241
|
-
m({ avatarField: u.avatarField ??
|
|
2243
|
+
m({ avatarField: u.avatarField ?? b ?? void 0 });
|
|
2242
2244
|
},
|
|
2243
2245
|
0
|
|
2244
2246
|
);
|
|
@@ -2254,19 +2256,19 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2254
2256
|
}
|
|
2255
2257
|
return (z, A) => {
|
|
2256
2258
|
const S = H("wx-avatar"), s = H("wx-text"), x = H("wx-dropdown-item"), U = H("wx-divider"), X = H("wx-dropdown");
|
|
2257
|
-
return
|
|
2259
|
+
return g.value !== null ? (p(), V(X, { key: 0 }, {
|
|
2258
2260
|
trigger: t(() => [
|
|
2259
2261
|
W("button", {
|
|
2260
2262
|
type: "button",
|
|
2261
2263
|
class: Qe(["wx-user-menu__trigger", { "wx-user-menu__trigger--named": n.expanded }]),
|
|
2262
|
-
title:
|
|
2264
|
+
title: g.value.name
|
|
2263
2265
|
}, [
|
|
2264
2266
|
a(S, {
|
|
2265
|
-
name:
|
|
2267
|
+
name: g.value.name,
|
|
2266
2268
|
src: w.value,
|
|
2267
2269
|
size: "lg"
|
|
2268
2270
|
}, null, 8, ["name", "src"]),
|
|
2269
|
-
n.expanded ? (p(), Y("span", Gt, i(
|
|
2271
|
+
n.expanded ? (p(), Y("span", Gt, i(g.value.name), 1)) : E("", !0)
|
|
2270
2272
|
], 10, jt)
|
|
2271
2273
|
]),
|
|
2272
2274
|
default: t(() => [
|
|
@@ -2274,7 +2276,7 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2274
2276
|
default: t(() => [
|
|
2275
2277
|
a(s, { size: "sm" }, {
|
|
2276
2278
|
default: t(() => [
|
|
2277
|
-
d(i(
|
|
2279
|
+
d(i(g.value.email), 1)
|
|
2278
2280
|
]),
|
|
2279
2281
|
_: 1
|
|
2280
2282
|
})
|