@webx-ui/module-auth 0.8.14 → 0.8.15
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 +393 -386
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { inject as ye, defineComponent as
|
|
2
|
-
import { useTranslate as
|
|
1
|
+
import { inject as ye, defineComponent as X, computed as P, ref as T, useTemplateRef as re, onBeforeUnmount as qe, resolveComponent as M, openBlock as p, createBlock as V, withCtx as t, createVNode as a, withModifiers as Pe, createCommentVNode as E, createElementVNode as S, createTextVNode as d, toDisplayString as i, watch as ue, unref as e, isRef as be, createElementBlock as G, resolveDynamicComponent as Fe, createSlots as Oe, Fragment as ce, renderList as _e, h as Re, normalizeClass as Qe } from "vue";
|
|
2
|
+
import { useTranslate as J, HttpError as Xe, useAdmin as ee, useI18n as Be, useErrorText as ve, rowMenuWidth as Ze, WxDate as ie, WxRowMenu as Ve, WxFilterChips as Ee, WxListScreen as De, useTheme as et } from "@webx-ui/module-admin";
|
|
3
3
|
import { useRouter as tt, useRoute as at } from "vue-router";
|
|
4
|
-
import { useModal as ge, WxDialog as we, WxFormItem as
|
|
4
|
+
import { useModal as ge, WxDialog as we, WxFormItem as H, WxInput as le, WxSelect as ne, WxSpace as oe, WxCheckbox as ze, WxText as B, WxButton as I, toast as Q, useElementWidth as xe, WxTable as ke, WxEntityCard as Ce, WxBadge as j, WxAvatar as lt, WxIcon as Z, confirm as Ne, createModal as $e, WxCard as Le, WxHeading as he, WxTabs as nt, WxTab as me, WxAlert as ot, WxThemeSwitch as st } from "@webx-ui/core";
|
|
5
5
|
const Ie = /* @__PURE__ */ Symbol("webx-auth");
|
|
6
6
|
function Ae() {
|
|
7
7
|
const n = ye(Ie, null);
|
|
@@ -62,7 +62,7 @@ function rt(n, u, l = null, o = null) {
|
|
|
62
62
|
function ut(n) {
|
|
63
63
|
return typeof n == "object" && n !== null && "status" in n && n.status === 401;
|
|
64
64
|
}
|
|
65
|
-
const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */
|
|
65
|
+
const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ X({
|
|
66
66
|
__name: "LoginCard",
|
|
67
67
|
props: {
|
|
68
68
|
emailLabel: { default: void 0 },
|
|
@@ -78,7 +78,7 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
78
78
|
},
|
|
79
79
|
emits: ["success"],
|
|
80
80
|
setup(n, { expose: u, emit: l }) {
|
|
81
|
-
const o = n, y = l, c = Ae(), _ =
|
|
81
|
+
const o = n, y = l, c = Ae(), _ = J("webx-auth"), r = P(() => ({
|
|
82
82
|
email: o.emailLabel ?? _("card.email"),
|
|
83
83
|
password: o.passwordLabel ?? _("card.password"),
|
|
84
84
|
remember: o.rememberLabel ?? _("card.remember"),
|
|
@@ -86,56 +86,56 @@ 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
|
+
})), b = T(""), O = T(""), v = T(!1), g = T(!1), w = T(!1), m = T(!1), x = T(""), f = T({}), h = T(0), z = re("emailField");
|
|
90
90
|
let A = null;
|
|
91
|
-
qe(
|
|
92
|
-
const
|
|
91
|
+
qe(Y);
|
|
92
|
+
const W = 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
|
-
async function
|
|
96
|
-
if (!(
|
|
97
|
-
|
|
95
|
+
async function $() {
|
|
96
|
+
if (!(g.value || W.value)) {
|
|
97
|
+
g.value = !0, x.value = "", f.value = {};
|
|
98
98
|
try {
|
|
99
99
|
await c.login({
|
|
100
|
-
email:
|
|
100
|
+
email: b.value,
|
|
101
101
|
password: O.value,
|
|
102
102
|
remember: v.value
|
|
103
103
|
}), O.value = "", y("success");
|
|
104
|
-
} catch (
|
|
105
|
-
U(
|
|
104
|
+
} catch (k) {
|
|
105
|
+
U(k);
|
|
106
106
|
} finally {
|
|
107
|
-
|
|
107
|
+
g.value = !1;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
function U(
|
|
112
|
-
if (!(
|
|
113
|
-
|
|
111
|
+
function U(k) {
|
|
112
|
+
if (!(k instanceof Xe)) {
|
|
113
|
+
x.value = k instanceof Error ? k.message : String(k);
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
if (
|
|
117
|
-
f.value =
|
|
116
|
+
if (k.isValidation) {
|
|
117
|
+
f.value = k.errors;
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
if (
|
|
121
|
-
|
|
120
|
+
if (k.isThrottled) {
|
|
121
|
+
K(k.retryAfter ?? 60);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
x.value = k.message;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
|
|
128
|
-
h.value -= 1, h.value <= 0 &&
|
|
126
|
+
function K(k) {
|
|
127
|
+
Y(), h.value = k, A = setInterval(() => {
|
|
128
|
+
h.value -= 1, h.value <= 0 && Y();
|
|
129
129
|
}, 1e3);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function Y() {
|
|
132
132
|
A !== null && (clearInterval(A), A = null), h.value = 0;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
m.value =
|
|
134
|
+
function D(k) {
|
|
135
|
+
m.value = k.getModifierState("CapsLock");
|
|
136
136
|
}
|
|
137
|
-
return u({ focus: () => z.value?.focus() }), (
|
|
138
|
-
const
|
|
137
|
+
return u({ focus: () => z.value?.focus() }), (k, R) => {
|
|
138
|
+
const C = M("wx-alert"), q = M("wx-icon"), de = M("wx-input"), F = M("wx-form-item"), N = M("wx-checkbox"), L = M("wx-button"), ae = M("wx-form"), Je = M("wx-card");
|
|
139
139
|
return p(), V(Je, {
|
|
140
140
|
class: "wx-login",
|
|
141
141
|
padding: 24
|
|
@@ -143,19 +143,19 @@ 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: g.value,
|
|
147
147
|
gap: "md",
|
|
148
|
-
onSubmit: Pe(
|
|
148
|
+
onSubmit: Pe($, ["prevent"])
|
|
149
149
|
}, {
|
|
150
150
|
default: t(() => [
|
|
151
|
-
|
|
151
|
+
x.value !== "" ? (p(), V(C, {
|
|
152
152
|
key: 0,
|
|
153
153
|
type: "danger",
|
|
154
154
|
variant: "soft",
|
|
155
155
|
live: "",
|
|
156
|
-
description:
|
|
156
|
+
description: x.value,
|
|
157
157
|
class: "wx-login__message"
|
|
158
|
-
}, null, 8, ["description"])) :
|
|
158
|
+
}, null, 8, ["description"])) : W.value ? (p(), V(C, {
|
|
159
159
|
key: 1,
|
|
160
160
|
type: "warning",
|
|
161
161
|
variant: "soft",
|
|
@@ -165,11 +165,11 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
165
165
|
}, null, 8, ["description"])) : E("", !0),
|
|
166
166
|
a(F, { name: "email" }, {
|
|
167
167
|
default: t(() => [
|
|
168
|
-
a(
|
|
168
|
+
a(de, {
|
|
169
169
|
ref_key: "emailField",
|
|
170
170
|
ref: z,
|
|
171
|
-
modelValue:
|
|
172
|
-
"onUpdate:modelValue": R[0] || (R[0] = (se) =>
|
|
171
|
+
modelValue: b.value,
|
|
172
|
+
"onUpdate:modelValue": R[0] || (R[0] = (se) => b.value = se),
|
|
173
173
|
type: "email",
|
|
174
174
|
placeholder: r.value.email,
|
|
175
175
|
"aria-label": r.value.email,
|
|
@@ -179,7 +179,7 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
179
179
|
size: "lg"
|
|
180
180
|
}, {
|
|
181
181
|
prefix: t(() => [
|
|
182
|
-
a(
|
|
182
|
+
a(q, { name: "mail" })
|
|
183
183
|
]),
|
|
184
184
|
_: 1
|
|
185
185
|
}, 8, ["modelValue", "placeholder", "aria-label", "autofocus"])
|
|
@@ -191,7 +191,7 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
191
191
|
help: m.value ? r.value.capsLock : void 0
|
|
192
192
|
}, {
|
|
193
193
|
default: t(() => [
|
|
194
|
-
a(
|
|
194
|
+
a(de, {
|
|
195
195
|
modelValue: O.value,
|
|
196
196
|
"onUpdate:modelValue": R[2] || (R[2] = (se) => O.value = se),
|
|
197
197
|
type: w.value ? "text" : "password",
|
|
@@ -199,14 +199,14 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
199
199
|
"aria-label": r.value.password,
|
|
200
200
|
autocomplete: "current-password",
|
|
201
201
|
size: "lg",
|
|
202
|
-
onKeydown:
|
|
203
|
-
onKeyup:
|
|
202
|
+
onKeydown: D,
|
|
203
|
+
onKeyup: D
|
|
204
204
|
}, {
|
|
205
205
|
prefix: t(() => [
|
|
206
|
-
a(
|
|
206
|
+
a(q, { name: "lock" })
|
|
207
207
|
]),
|
|
208
208
|
suffix: t(() => [
|
|
209
|
-
|
|
209
|
+
S("button", {
|
|
210
210
|
type: "button",
|
|
211
211
|
class: "wx-login__reveal",
|
|
212
212
|
title: w.value ? r.value.hide : r.value.reveal,
|
|
@@ -215,7 +215,7 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
215
215
|
tabindex: "-1",
|
|
216
216
|
onClick: R[1] || (R[1] = (se) => w.value = !w.value)
|
|
217
217
|
}, [
|
|
218
|
-
a(
|
|
218
|
+
a(q, {
|
|
219
219
|
name: w.value ? "eye-off" : "eye"
|
|
220
220
|
}, null, 8, ["name"])
|
|
221
221
|
], 8, ct)
|
|
@@ -237,8 +237,8 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
237
237
|
"native-type": "submit",
|
|
238
238
|
size: "lg",
|
|
239
239
|
block: "",
|
|
240
|
-
loading:
|
|
241
|
-
disabled:
|
|
240
|
+
loading: g.value,
|
|
241
|
+
disabled: W.value
|
|
242
242
|
}, {
|
|
243
243
|
default: t(() => [
|
|
244
244
|
d(i(r.value.submit), 1)
|
|
@@ -463,7 +463,7 @@ function te() {
|
|
|
463
463
|
const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft = {
|
|
464
464
|
key: 0,
|
|
465
465
|
class: "wx-admin-form__aside"
|
|
466
|
-
}, ht = { class: "wx-admin-form__fields" }, yt = /* @__PURE__ */
|
|
466
|
+
}, ht = { class: "wx-admin-form__fields" }, yt = /* @__PURE__ */ X({
|
|
467
467
|
__name: "AdminDialog",
|
|
468
468
|
props: {
|
|
469
469
|
admin: { default: null },
|
|
@@ -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 b = J("webx-auth"), O = ve(), v = T([]), g = T(!1), w = T({}), m = T({
|
|
476
476
|
name: "",
|
|
477
477
|
email: "",
|
|
478
478
|
password: "",
|
|
@@ -481,13 +481,13 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
481
481
|
is_super: !1,
|
|
482
482
|
locale: null,
|
|
483
483
|
roles: []
|
|
484
|
-
}),
|
|
484
|
+
}), x = P({
|
|
485
485
|
get: () => m.value.avatar ? { path: m.value.avatar } : null,
|
|
486
486
|
set: (s) => {
|
|
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: b("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(
|
|
@@ -501,7 +501,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
501
501
|
is_active: s?.is_active ?? !0,
|
|
502
502
|
is_super: s?.is_super ?? !1,
|
|
503
503
|
locale: s?.locale ?? "auto",
|
|
504
|
-
roles: s?.roles.map((
|
|
504
|
+
roles: s?.roles.map(($) => $.id) ?? []
|
|
505
505
|
}, w.value = {};
|
|
506
506
|
},
|
|
507
507
|
{ immediate: !0 }
|
|
@@ -509,8 +509,8 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
509
509
|
function A(s) {
|
|
510
510
|
return w.value[s]?.[0];
|
|
511
511
|
}
|
|
512
|
-
async function
|
|
513
|
-
|
|
512
|
+
async function W() {
|
|
513
|
+
g.value = !0, w.value = {};
|
|
514
514
|
const s = {
|
|
515
515
|
name: m.value.name,
|
|
516
516
|
email: m.value.email,
|
|
@@ -522,19 +522,19 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
522
522
|
};
|
|
523
523
|
m.value.password && (s.password = m.value.password);
|
|
524
524
|
try {
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
} catch (
|
|
528
|
-
const U =
|
|
529
|
-
U?.errors ? w.value = U.errors :
|
|
525
|
+
const $ = u.admin ? await _.update(u.admin.id, s) : await _.create(s);
|
|
526
|
+
Q.success(b(f.value ? "admins.updated" : "admins.created")), l($);
|
|
527
|
+
} catch ($) {
|
|
528
|
+
const U = $.body;
|
|
529
|
+
U?.errors ? w.value = U.errors : Q.danger(O($));
|
|
530
530
|
} finally {
|
|
531
|
-
|
|
531
|
+
g.value = !1;
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
return (s,
|
|
534
|
+
return (s, $) => (p(), V(e(we), {
|
|
535
535
|
open: e(y),
|
|
536
|
-
"onUpdate:open":
|
|
537
|
-
title: f.value ? e(
|
|
536
|
+
"onUpdate:open": $[9] || ($[9] = (U) => be(y) ? y.value = U : null),
|
|
537
|
+
title: f.value ? e(b)("admins.edit-short") : e(b)("admins.new-short"),
|
|
538
538
|
width: 720
|
|
539
539
|
}, {
|
|
540
540
|
footer: t(() => [
|
|
@@ -542,20 +542,20 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
542
542
|
default: t(() => [
|
|
543
543
|
a(e(I), {
|
|
544
544
|
variant: "outline",
|
|
545
|
-
onClick:
|
|
545
|
+
onClick: $[8] || ($[8] = (U) => e(o)())
|
|
546
546
|
}, {
|
|
547
547
|
default: t(() => [
|
|
548
|
-
d(i(e(
|
|
548
|
+
d(i(e(b)("admins.cancel")), 1)
|
|
549
549
|
]),
|
|
550
550
|
_: 1
|
|
551
551
|
}),
|
|
552
552
|
a(e(I), {
|
|
553
553
|
type: "primary",
|
|
554
|
-
loading:
|
|
555
|
-
onClick:
|
|
554
|
+
loading: g.value,
|
|
555
|
+
onClick: W
|
|
556
556
|
}, {
|
|
557
557
|
default: t(() => [
|
|
558
|
-
d(i(e(
|
|
558
|
+
d(i(e(b)("admins.save")), 1)
|
|
559
559
|
]),
|
|
560
560
|
_: 1
|
|
561
561
|
}, 8, ["loading"])
|
|
@@ -564,39 +564,39 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
564
564
|
})
|
|
565
565
|
]),
|
|
566
566
|
default: t(() => [
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
n.avatarField ? (p(),
|
|
567
|
+
S("div", vt, [
|
|
568
|
+
S("div", pt, [
|
|
569
|
+
n.avatarField ? (p(), G("div", ft, [
|
|
570
570
|
(p(), V(Fe(n.avatarField), {
|
|
571
|
-
modelValue:
|
|
572
|
-
"onUpdate:modelValue":
|
|
573
|
-
label: e(
|
|
571
|
+
modelValue: x.value,
|
|
572
|
+
"onUpdate:modelValue": $[0] || ($[0] = (U) => x.value = U),
|
|
573
|
+
label: e(b)("admins.avatar"),
|
|
574
574
|
aspect: "1/1",
|
|
575
575
|
captions: !1
|
|
576
576
|
}, null, 8, ["modelValue", "label"]))
|
|
577
577
|
])) : E("", !0),
|
|
578
|
-
|
|
579
|
-
a(e(
|
|
580
|
-
label: e(
|
|
578
|
+
S("div", ht, [
|
|
579
|
+
a(e(H), {
|
|
580
|
+
label: e(b)("admins.name"),
|
|
581
581
|
error: A("name")
|
|
582
582
|
}, {
|
|
583
583
|
default: t(() => [
|
|
584
584
|
a(e(le), {
|
|
585
585
|
modelValue: m.value.name,
|
|
586
|
-
"onUpdate:modelValue":
|
|
586
|
+
"onUpdate:modelValue": $[1] || ($[1] = (U) => m.value.name = U),
|
|
587
587
|
name: "name"
|
|
588
588
|
}, null, 8, ["modelValue"])
|
|
589
589
|
]),
|
|
590
590
|
_: 1
|
|
591
591
|
}, 8, ["label", "error"]),
|
|
592
|
-
a(e(
|
|
593
|
-
label: e(
|
|
592
|
+
a(e(H), {
|
|
593
|
+
label: e(b)("admins.email"),
|
|
594
594
|
error: A("email")
|
|
595
595
|
}, {
|
|
596
596
|
default: t(() => [
|
|
597
597
|
a(e(le), {
|
|
598
598
|
modelValue: m.value.email,
|
|
599
|
-
"onUpdate:modelValue":
|
|
599
|
+
"onUpdate:modelValue": $[2] || ($[2] = (U) => m.value.email = U),
|
|
600
600
|
type: "email",
|
|
601
601
|
name: "email",
|
|
602
602
|
autocomplete: "off"
|
|
@@ -604,15 +604,15 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
604
604
|
]),
|
|
605
605
|
_: 1
|
|
606
606
|
}, 8, ["label", "error"]),
|
|
607
|
-
a(e(
|
|
608
|
-
label: e(
|
|
607
|
+
a(e(H), {
|
|
608
|
+
label: e(b)("admins.password"),
|
|
609
609
|
error: A("password"),
|
|
610
|
-
help: f.value ? e(
|
|
610
|
+
help: f.value ? e(b)("admins.password-keep") : e(b)("admins.password-hint")
|
|
611
611
|
}, {
|
|
612
612
|
default: t(() => [
|
|
613
613
|
a(e(le), {
|
|
614
614
|
modelValue: m.value.password,
|
|
615
|
-
"onUpdate:modelValue":
|
|
615
|
+
"onUpdate:modelValue": $[3] || ($[3] = (U) => m.value.password = U),
|
|
616
616
|
type: "password",
|
|
617
617
|
name: "password",
|
|
618
618
|
autocomplete: "new-password"
|
|
@@ -620,27 +620,27 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
620
620
|
]),
|
|
621
621
|
_: 1
|
|
622
622
|
}, 8, ["label", "error", "help"]),
|
|
623
|
-
a(e(
|
|
624
|
-
label: e(
|
|
623
|
+
a(e(H), {
|
|
624
|
+
label: e(b)("admins.roles"),
|
|
625
625
|
error: A("roles")
|
|
626
626
|
}, {
|
|
627
627
|
default: t(() => [
|
|
628
628
|
a(e(ne), {
|
|
629
629
|
modelValue: m.value.roles,
|
|
630
|
-
"onUpdate:modelValue":
|
|
630
|
+
"onUpdate:modelValue": $[4] || ($[4] = (U) => m.value.roles = U),
|
|
631
631
|
options: h.value,
|
|
632
632
|
multiple: ""
|
|
633
633
|
}, null, 8, ["modelValue", "options"])
|
|
634
634
|
]),
|
|
635
635
|
_: 1
|
|
636
636
|
}, 8, ["label", "error"]),
|
|
637
|
-
a(e(
|
|
638
|
-
label: e(
|
|
637
|
+
a(e(H), {
|
|
638
|
+
label: e(b)("admins.locale")
|
|
639
639
|
}, {
|
|
640
640
|
default: t(() => [
|
|
641
641
|
a(e(ne), {
|
|
642
642
|
modelValue: m.value.locale,
|
|
643
|
-
"onUpdate:modelValue":
|
|
643
|
+
"onUpdate:modelValue": $[5] || ($[5] = (U) => m.value.locale = U),
|
|
644
644
|
options: z.value
|
|
645
645
|
}, null, 8, ["modelValue", "options"])
|
|
646
646
|
]),
|
|
@@ -650,13 +650,13 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
650
650
|
default: t(() => [
|
|
651
651
|
a(e(ze), {
|
|
652
652
|
modelValue: m.value.is_active,
|
|
653
|
-
"onUpdate:modelValue":
|
|
654
|
-
label: e(
|
|
653
|
+
"onUpdate:modelValue": $[6] || ($[6] = (U) => m.value.is_active = U),
|
|
654
|
+
label: e(b)("admins.active")
|
|
655
655
|
}, null, 8, ["modelValue", "label"]),
|
|
656
656
|
a(e(ze), {
|
|
657
657
|
modelValue: m.value.is_super,
|
|
658
|
-
"onUpdate:modelValue":
|
|
659
|
-
label: e(
|
|
658
|
+
"onUpdate:modelValue": $[7] || ($[7] = (U) => m.value.is_super = U),
|
|
659
|
+
label: e(b)("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(b)("admins.super-hint")), 1)
|
|
670
670
|
]),
|
|
671
671
|
_: 1
|
|
672
672
|
})
|
|
@@ -677,7 +677,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
677
677
|
_: 1
|
|
678
678
|
}, 8, ["open", "title"]));
|
|
679
679
|
}
|
|
680
|
-
}), We = 480, Ye = /* @__PURE__ */
|
|
680
|
+
}), We = 480, Ye = /* @__PURE__ */ X({
|
|
681
681
|
__name: "AdminList",
|
|
682
682
|
props: {
|
|
683
683
|
picking: { type: Boolean, default: !1 },
|
|
@@ -690,12 +690,12 @@ 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"),
|
|
694
|
-
let
|
|
693
|
+
const r = re("root"), b = xe(r), O = P(() => b.value > 0 && b.value < We), v = J("webx-auth"), g = J("webx-admin"), w = T(null), m = T([]), x = T(!1), f = T("all"), h = T("any"), z = T([]), A = T({});
|
|
694
|
+
let W = { page: 1, perPage: 20, sort: null, search: "" };
|
|
695
695
|
const s = P(() => [
|
|
696
696
|
{ value: "all", label: v("admins.all-roles") },
|
|
697
697
|
...m.value.map((F) => ({ value: F.slug, label: F.name }))
|
|
698
|
-
]),
|
|
698
|
+
]), $ = P(() => [
|
|
699
699
|
{ value: "any", label: v("admins.any-state") },
|
|
700
700
|
{ value: "yes", label: v("admins.only-active") },
|
|
701
701
|
{ value: "no", label: v("admins.only-inactive") }
|
|
@@ -711,10 +711,10 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
711
711
|
clear: () => h.value = "any"
|
|
712
712
|
}), F;
|
|
713
713
|
});
|
|
714
|
-
function
|
|
714
|
+
function K() {
|
|
715
715
|
f.value = "all", h.value = "any";
|
|
716
716
|
}
|
|
717
|
-
const
|
|
717
|
+
const Y = P(() => O.value ? [{ key: "card", label: "" }] : [
|
|
718
718
|
{ key: "name", label: v("admins.name"), sortable: !0 },
|
|
719
719
|
{ key: "email", label: v("admins.email"), sortable: !0, hideBelow: 560 },
|
|
720
720
|
{ key: "roles", label: v("admins.roles"), hideBelow: 760 },
|
|
@@ -738,9 +738,9 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
738
738
|
hideOnCards: !0
|
|
739
739
|
}
|
|
740
740
|
]);
|
|
741
|
-
_.roles().then((F) => m.value = F), ue([f, h], () =>
|
|
742
|
-
async function
|
|
743
|
-
|
|
741
|
+
_.roles().then((F) => m.value = F), ue([f, h], () => D(W));
|
|
742
|
+
async function D(F) {
|
|
743
|
+
W = F, x.value = !0;
|
|
744
744
|
try {
|
|
745
745
|
w.value = await _.list({
|
|
746
746
|
q: F.search,
|
|
@@ -749,12 +749,12 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
749
749
|
sort: F.sort ? `${F.sort.order === "desc" ? "-" : ""}${F.sort.key}` : "name",
|
|
750
750
|
page: F.page,
|
|
751
751
|
per_page: F.perPage
|
|
752
|
-
}),
|
|
752
|
+
}), k();
|
|
753
753
|
} finally {
|
|
754
|
-
|
|
754
|
+
x.value = !1;
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
|
-
async function
|
|
757
|
+
async function k() {
|
|
758
758
|
const F = o.resolveAvatar;
|
|
759
759
|
if (F)
|
|
760
760
|
for (const N of w.value?.data ?? []) {
|
|
@@ -774,42 +774,42 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
774
774
|
}
|
|
775
775
|
];
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function C(F) {
|
|
778
778
|
if (o.picking) {
|
|
779
779
|
y("chosen", [F]);
|
|
780
780
|
return;
|
|
781
781
|
}
|
|
782
782
|
y("open", F);
|
|
783
783
|
}
|
|
784
|
-
const
|
|
785
|
-
function
|
|
784
|
+
const q = P(() => !(o.picking && o.multiple));
|
|
785
|
+
function de(F, N) {
|
|
786
786
|
z.value = N, y("selection", N);
|
|
787
787
|
}
|
|
788
|
-
return u({ reload: () =>
|
|
788
|
+
return u({ reload: () => D(W), chosen: () => z.value }), (F, N) => (p(), G("div", {
|
|
789
789
|
ref_key: "root",
|
|
790
790
|
ref: r,
|
|
791
791
|
class: "wx-admin-list"
|
|
792
792
|
}, [
|
|
793
793
|
a(e(ke), {
|
|
794
794
|
data: w.value,
|
|
795
|
-
columns:
|
|
795
|
+
columns: Y.value,
|
|
796
796
|
"row-key": "id",
|
|
797
797
|
searchable: "",
|
|
798
|
-
clickable:
|
|
799
|
-
hover:
|
|
798
|
+
clickable: q.value,
|
|
799
|
+
hover: q.value,
|
|
800
800
|
flush: "",
|
|
801
|
-
loading:
|
|
801
|
+
loading: x.value,
|
|
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(
|
|
806
|
-
"select-all-label": e(
|
|
805
|
+
"select-row-label": e(g)("filters.select-row"),
|
|
806
|
+
"select-all-label": e(g)("filters.select-all"),
|
|
807
807
|
"cards-below": We,
|
|
808
808
|
"filters-count": U.value.length,
|
|
809
|
-
"filters-label": e(
|
|
810
|
-
onRowClick:
|
|
811
|
-
onStateChange:
|
|
812
|
-
onSelectionChange:
|
|
809
|
+
"filters-label": e(g)("filters.title"),
|
|
810
|
+
onRowClick: C,
|
|
811
|
+
onStateChange: D,
|
|
812
|
+
onSelectionChange: de
|
|
813
813
|
}, Oe({
|
|
814
814
|
"cell-name": t(({ row: L }) => [
|
|
815
815
|
a(e(oe), {
|
|
@@ -822,8 +822,8 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
822
822
|
src: L.avatar ? A.value[L.avatar] : void 0,
|
|
823
823
|
size: "sm"
|
|
824
824
|
}, null, 8, ["name", "src"]),
|
|
825
|
-
|
|
826
|
-
L.is_super ? (p(), V(e(
|
|
825
|
+
S("span", null, i(L.name), 1),
|
|
826
|
+
L.is_super ? (p(), V(e(j), {
|
|
827
827
|
key: 0,
|
|
828
828
|
type: "warning"
|
|
829
829
|
}, {
|
|
@@ -843,7 +843,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
843
843
|
wrap: ""
|
|
844
844
|
}, {
|
|
845
845
|
default: t(() => [
|
|
846
|
-
(p(!0),
|
|
846
|
+
(p(!0), G(ce, null, _e(L.roles, (ae) => (p(), V(e(j), {
|
|
847
847
|
key: ae.id
|
|
848
848
|
}, {
|
|
849
849
|
default: t(() => [
|
|
@@ -865,7 +865,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
865
865
|
}))
|
|
866
866
|
]),
|
|
867
867
|
"cell-is_active": t(({ row: L }) => [
|
|
868
|
-
a(e(
|
|
868
|
+
a(e(j), {
|
|
869
869
|
type: L.is_active ? "success" : "default",
|
|
870
870
|
dot: ""
|
|
871
871
|
}, {
|
|
@@ -904,7 +904,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
904
904
|
subtitle: L.email
|
|
905
905
|
}, {
|
|
906
906
|
meta: t(() => [
|
|
907
|
-
L.is_super ? (p(), V(e(
|
|
907
|
+
L.is_super ? (p(), V(e(j), {
|
|
908
908
|
key: 0,
|
|
909
909
|
type: "warning",
|
|
910
910
|
size: "sm"
|
|
@@ -914,7 +914,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
914
914
|
]),
|
|
915
915
|
_: 1
|
|
916
916
|
})) : E("", !0),
|
|
917
|
-
(p(!0),
|
|
917
|
+
(p(!0), G(ce, null, _e(L.roles, (ae) => (p(), V(e(j), {
|
|
918
918
|
key: ae.id,
|
|
919
919
|
size: "sm"
|
|
920
920
|
}, {
|
|
@@ -923,7 +923,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
923
923
|
]),
|
|
924
924
|
_: 2
|
|
925
925
|
}, 1024))), 128)),
|
|
926
|
-
a(e(
|
|
926
|
+
a(e(j), {
|
|
927
927
|
type: L.is_active ? "success" : "default",
|
|
928
928
|
dot: "",
|
|
929
929
|
size: "sm"
|
|
@@ -942,7 +942,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
942
942
|
n.filters ? {
|
|
943
943
|
name: "filters",
|
|
944
944
|
fn: t(() => [
|
|
945
|
-
a(e(
|
|
945
|
+
a(e(H), {
|
|
946
946
|
label: e(v)("admins.filter-role")
|
|
947
947
|
}, {
|
|
948
948
|
default: t(() => [
|
|
@@ -955,14 +955,14 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
955
955
|
]),
|
|
956
956
|
_: 1
|
|
957
957
|
}, 8, ["label"]),
|
|
958
|
-
a(e(
|
|
958
|
+
a(e(H), {
|
|
959
959
|
label: e(v)("admins.filter-state")
|
|
960
960
|
}, {
|
|
961
961
|
default: t(() => [
|
|
962
962
|
a(e(ne), {
|
|
963
963
|
modelValue: h.value,
|
|
964
964
|
"onUpdate:modelValue": N[1] || (N[1] = (L) => h.value = L),
|
|
965
|
-
options:
|
|
965
|
+
options: $.value,
|
|
966
966
|
size: "sm"
|
|
967
967
|
}, null, 8, ["modelValue", "options"])
|
|
968
968
|
]),
|
|
@@ -973,13 +973,13 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
973
973
|
variant: "text",
|
|
974
974
|
size: "sm",
|
|
975
975
|
block: "",
|
|
976
|
-
onClick:
|
|
976
|
+
onClick: K
|
|
977
977
|
}, {
|
|
978
978
|
icon: t(() => [
|
|
979
979
|
a(e(Z), { name: "close" })
|
|
980
980
|
]),
|
|
981
981
|
default: t(() => [
|
|
982
|
-
d(" " + i(e(
|
|
982
|
+
d(" " + i(e(g)("filters.reset")), 1)
|
|
983
983
|
]),
|
|
984
984
|
_: 1
|
|
985
985
|
})) : E("", !0)
|
|
@@ -1005,50 +1005,50 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1005
1005
|
}, wt = {
|
|
1006
1006
|
key: 1,
|
|
1007
1007
|
class: "wx-call-list__arguments"
|
|
1008
|
-
}, Te = 480, xt = /* @__PURE__ */
|
|
1008
|
+
}, Te = 480, xt = /* @__PURE__ */ X({
|
|
1009
1009
|
__name: "CallList",
|
|
1010
1010
|
setup(n, { expose: u }) {
|
|
1011
1011
|
const l = ee(), o = fe(l);
|
|
1012
1012
|
te();
|
|
1013
|
-
const y = re("root"), c = xe(y), _ = P(() => c.value > 0 && c.value < Te), r =
|
|
1013
|
+
const y = re("root"), c = xe(y), _ = P(() => c.value > 0 && c.value < Te), r = J("webx-auth"), b = J("webx-admin"), O = T(null), v = T({ users: [], tools: [] }), g = T(!1), w = T("all"), m = T("all"), x = T("any");
|
|
1014
1014
|
let f = { page: 1, perPage: 30, sort: null, search: "" };
|
|
1015
|
-
function h(
|
|
1016
|
-
return
|
|
1015
|
+
function h(k) {
|
|
1016
|
+
return k === null ? r("calls.local") : k.name ?? r("calls.deleted", { id: k.id });
|
|
1017
1017
|
}
|
|
1018
1018
|
const z = P(() => [
|
|
1019
1019
|
{ value: "all", label: r("calls.everybody") },
|
|
1020
|
-
...v.value.users.map((
|
|
1021
|
-
value:
|
|
1022
|
-
label: h(
|
|
1020
|
+
...v.value.users.map((k) => ({
|
|
1021
|
+
value: k.id === null ? "none" : String(k.id),
|
|
1022
|
+
label: h(k.id === null ? null : { id: k.id, name: k.name })
|
|
1023
1023
|
}))
|
|
1024
1024
|
]), A = P(() => [
|
|
1025
1025
|
{ value: "all", label: r("calls.all-tools") },
|
|
1026
|
-
...v.value.tools.map((
|
|
1027
|
-
]),
|
|
1026
|
+
...v.value.tools.map((k) => ({ value: k, label: k }))
|
|
1027
|
+
]), W = P(() => [
|
|
1028
1028
|
{ value: "any", label: r("calls.any-outcome") },
|
|
1029
1029
|
{ value: "ok", label: r("calls.only-answered") },
|
|
1030
1030
|
{ value: "failed", label: r("calls.only-refused") },
|
|
1031
1031
|
{ value: "dry", label: r("calls.only-dry") }
|
|
1032
1032
|
]), s = P(() => {
|
|
1033
|
-
const
|
|
1034
|
-
w.value !== "all" && R &&
|
|
1033
|
+
const k = [], R = z.value.find((q) => q.value === w.value);
|
|
1034
|
+
w.value !== "all" && R && k.push({
|
|
1035
1035
|
key: "user",
|
|
1036
1036
|
label: `${r("calls.filter-user")}: ${R.label}`,
|
|
1037
1037
|
clear: () => w.value = "all"
|
|
1038
|
-
}), m.value !== "all" &&
|
|
1038
|
+
}), m.value !== "all" && k.push({
|
|
1039
1039
|
key: "tool",
|
|
1040
1040
|
label: `${r("calls.filter-tool")}: ${m.value}`,
|
|
1041
1041
|
clear: () => m.value = "all"
|
|
1042
1042
|
});
|
|
1043
|
-
const
|
|
1044
|
-
return
|
|
1043
|
+
const C = W.value.find((q) => q.value === x.value);
|
|
1044
|
+
return x.value !== "any" && C && k.push({
|
|
1045
1045
|
key: "outcome",
|
|
1046
|
-
label: `${r("calls.filter-outcome")}: ${
|
|
1047
|
-
clear: () =>
|
|
1048
|
-
}),
|
|
1046
|
+
label: `${r("calls.filter-outcome")}: ${C.label}`,
|
|
1047
|
+
clear: () => x.value = "any"
|
|
1048
|
+
}), k;
|
|
1049
1049
|
});
|
|
1050
|
-
function
|
|
1051
|
-
w.value = "all", m.value = "all",
|
|
1050
|
+
function $() {
|
|
1051
|
+
w.value = "all", m.value = "all", x.value = "any";
|
|
1052
1052
|
}
|
|
1053
1053
|
const U = P(() => _.value ? [{ key: "card", label: "" }] : [
|
|
1054
1054
|
{ key: "at", label: r("calls.when") },
|
|
@@ -1058,28 +1058,28 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1058
1058
|
{ key: "duration_ms", label: r("calls.took"), align: "right", hideBelow: 820 },
|
|
1059
1059
|
{ key: "client", label: r("calls.client"), hideBelow: 960 }
|
|
1060
1060
|
]);
|
|
1061
|
-
ue([w, m,
|
|
1062
|
-
async function
|
|
1063
|
-
f =
|
|
1061
|
+
ue([w, m, x], () => K({ ...f, page: 1 }));
|
|
1062
|
+
async function K(k) {
|
|
1063
|
+
f = k, g.value = !0;
|
|
1064
1064
|
try {
|
|
1065
1065
|
O.value = await o.calls({
|
|
1066
1066
|
user: w.value === "all" ? null : w.value,
|
|
1067
1067
|
tool: m.value === "all" ? null : m.value,
|
|
1068
|
-
outcome:
|
|
1069
|
-
page:
|
|
1070
|
-
per_page:
|
|
1068
|
+
outcome: x.value === "any" ? null : x.value,
|
|
1069
|
+
page: k.page,
|
|
1070
|
+
per_page: k.perPage
|
|
1071
1071
|
}), v.value = O.value.filters;
|
|
1072
1072
|
} finally {
|
|
1073
|
-
|
|
1073
|
+
g.value = !1;
|
|
1074
1074
|
}
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return
|
|
1076
|
+
function Y(k) {
|
|
1077
|
+
return k.ok ? k.dry_run ? { type: "info", label: r("calls.dry-run") } : { type: "success", label: r("calls.answered") } : { type: "danger", label: r("calls.refused") };
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return
|
|
1079
|
+
function D(k) {
|
|
1080
|
+
return k.arguments !== null || k.error !== null;
|
|
1081
1081
|
}
|
|
1082
|
-
return u({ reload: () =>
|
|
1082
|
+
return u({ reload: () => K(f) }), (k, R) => (p(), G("div", {
|
|
1083
1083
|
ref_key: "root",
|
|
1084
1084
|
ref: y,
|
|
1085
1085
|
class: "wx-call-list"
|
|
@@ -1089,51 +1089,51 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1089
1089
|
columns: U.value,
|
|
1090
1090
|
"row-key": "id",
|
|
1091
1091
|
flush: "",
|
|
1092
|
-
loading:
|
|
1092
|
+
loading: g.value,
|
|
1093
1093
|
clickable: !1,
|
|
1094
1094
|
expandable: !_.value,
|
|
1095
|
-
"expandable-if":
|
|
1095
|
+
"expandable-if": D,
|
|
1096
1096
|
"empty-text": e(r)("calls.empty"),
|
|
1097
1097
|
"cards-below": Te,
|
|
1098
1098
|
"filters-count": s.value.length,
|
|
1099
|
-
"filters-label": e(
|
|
1100
|
-
onStateChange:
|
|
1099
|
+
"filters-label": e(b)("filters.title"),
|
|
1100
|
+
onStateChange: K
|
|
1101
1101
|
}, {
|
|
1102
1102
|
filters: t(() => [
|
|
1103
|
-
a(e(
|
|
1103
|
+
a(e(H), {
|
|
1104
1104
|
label: e(r)("calls.filter-user")
|
|
1105
1105
|
}, {
|
|
1106
1106
|
default: t(() => [
|
|
1107
1107
|
a(e(ne), {
|
|
1108
1108
|
modelValue: w.value,
|
|
1109
|
-
"onUpdate:modelValue": R[0] || (R[0] = (
|
|
1109
|
+
"onUpdate:modelValue": R[0] || (R[0] = (C) => w.value = C),
|
|
1110
1110
|
options: z.value,
|
|
1111
1111
|
size: "sm"
|
|
1112
1112
|
}, null, 8, ["modelValue", "options"])
|
|
1113
1113
|
]),
|
|
1114
1114
|
_: 1
|
|
1115
1115
|
}, 8, ["label"]),
|
|
1116
|
-
a(e(
|
|
1116
|
+
a(e(H), {
|
|
1117
1117
|
label: e(r)("calls.filter-tool")
|
|
1118
1118
|
}, {
|
|
1119
1119
|
default: t(() => [
|
|
1120
1120
|
a(e(ne), {
|
|
1121
1121
|
modelValue: m.value,
|
|
1122
|
-
"onUpdate:modelValue": R[1] || (R[1] = (
|
|
1122
|
+
"onUpdate:modelValue": R[1] || (R[1] = (C) => m.value = C),
|
|
1123
1123
|
options: A.value,
|
|
1124
1124
|
size: "sm"
|
|
1125
1125
|
}, null, 8, ["modelValue", "options"])
|
|
1126
1126
|
]),
|
|
1127
1127
|
_: 1
|
|
1128
1128
|
}, 8, ["label"]),
|
|
1129
|
-
a(e(
|
|
1129
|
+
a(e(H), {
|
|
1130
1130
|
label: e(r)("calls.filter-outcome")
|
|
1131
1131
|
}, {
|
|
1132
1132
|
default: t(() => [
|
|
1133
1133
|
a(e(ne), {
|
|
1134
|
-
modelValue:
|
|
1135
|
-
"onUpdate:modelValue": R[2] || (R[2] = (
|
|
1136
|
-
options:
|
|
1134
|
+
modelValue: x.value,
|
|
1135
|
+
"onUpdate:modelValue": R[2] || (R[2] = (C) => x.value = C),
|
|
1136
|
+
options: W.value,
|
|
1137
1137
|
size: "sm"
|
|
1138
1138
|
}, null, 8, ["modelValue", "options"])
|
|
1139
1139
|
]),
|
|
@@ -1144,13 +1144,13 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1144
1144
|
variant: "text",
|
|
1145
1145
|
size: "sm",
|
|
1146
1146
|
block: "",
|
|
1147
|
-
onClick:
|
|
1147
|
+
onClick: $
|
|
1148
1148
|
}, {
|
|
1149
1149
|
icon: t(() => [
|
|
1150
1150
|
a(e(Z), { name: "close" })
|
|
1151
1151
|
]),
|
|
1152
1152
|
default: t(() => [
|
|
1153
|
-
d(" " + i(e(
|
|
1153
|
+
d(" " + i(e(b)("filters.reset")), 1)
|
|
1154
1154
|
]),
|
|
1155
1155
|
_: 1
|
|
1156
1156
|
})) : E("", !0)
|
|
@@ -1158,63 +1158,63 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1158
1158
|
applied: t(() => [
|
|
1159
1159
|
a(e(Ee), { filters: s.value }, null, 8, ["filters"])
|
|
1160
1160
|
]),
|
|
1161
|
-
"cell-at": t(({ row:
|
|
1161
|
+
"cell-at": t(({ row: C }) => [
|
|
1162
1162
|
a(e(ie), {
|
|
1163
|
-
value:
|
|
1163
|
+
value: C.at,
|
|
1164
1164
|
tone: "default",
|
|
1165
1165
|
compact: ""
|
|
1166
1166
|
}, null, 8, ["value"])
|
|
1167
1167
|
]),
|
|
1168
|
-
"cell-user": t(({ row:
|
|
1168
|
+
"cell-user": t(({ row: C }) => [
|
|
1169
1169
|
a(e(B), {
|
|
1170
|
-
tone:
|
|
1170
|
+
tone: C.user === null || C.user.name === null ? "muted" : "default"
|
|
1171
1171
|
}, {
|
|
1172
1172
|
default: t(() => [
|
|
1173
|
-
d(i(h(
|
|
1173
|
+
d(i(h(C.user)), 1)
|
|
1174
1174
|
]),
|
|
1175
1175
|
_: 2
|
|
1176
1176
|
}, 1032, ["tone"])
|
|
1177
1177
|
]),
|
|
1178
|
-
"cell-tool": t(({ row:
|
|
1178
|
+
"cell-tool": t(({ row: C }) => [
|
|
1179
1179
|
a(e(B), {
|
|
1180
1180
|
mono: "",
|
|
1181
1181
|
size: "sm"
|
|
1182
1182
|
}, {
|
|
1183
1183
|
default: t(() => [
|
|
1184
|
-
d(i(
|
|
1184
|
+
d(i(C.tool), 1)
|
|
1185
1185
|
]),
|
|
1186
1186
|
_: 2
|
|
1187
1187
|
}, 1024)
|
|
1188
1188
|
]),
|
|
1189
|
-
"cell-outcome": t(({ row:
|
|
1190
|
-
a(e(
|
|
1191
|
-
type:
|
|
1189
|
+
"cell-outcome": t(({ row: C }) => [
|
|
1190
|
+
a(e(j), {
|
|
1191
|
+
type: Y(C).type,
|
|
1192
1192
|
dot: ""
|
|
1193
1193
|
}, {
|
|
1194
1194
|
default: t(() => [
|
|
1195
|
-
d(i(
|
|
1195
|
+
d(i(Y(C).label), 1)
|
|
1196
1196
|
]),
|
|
1197
1197
|
_: 2
|
|
1198
1198
|
}, 1032, ["type"])
|
|
1199
1199
|
]),
|
|
1200
|
-
"cell-duration_ms": t(({ row:
|
|
1200
|
+
"cell-duration_ms": t(({ row: C }) => [
|
|
1201
1201
|
a(e(B), {
|
|
1202
1202
|
size: "sm",
|
|
1203
1203
|
tone: "muted"
|
|
1204
1204
|
}, {
|
|
1205
1205
|
default: t(() => [
|
|
1206
|
-
d(i(e(r)("calls.ms", { count:
|
|
1206
|
+
d(i(e(r)("calls.ms", { count: C.duration_ms })), 1)
|
|
1207
1207
|
]),
|
|
1208
1208
|
_: 2
|
|
1209
1209
|
}, 1024)
|
|
1210
1210
|
]),
|
|
1211
|
-
"cell-client": t(({ row:
|
|
1212
|
-
|
|
1211
|
+
"cell-client": t(({ row: C }) => [
|
|
1212
|
+
C.client ? (p(), V(e(B), {
|
|
1213
1213
|
key: 0,
|
|
1214
1214
|
size: "sm"
|
|
1215
1215
|
}, {
|
|
1216
1216
|
default: t(() => [
|
|
1217
|
-
d(i(
|
|
1217
|
+
d(i(C.client), 1)
|
|
1218
1218
|
]),
|
|
1219
1219
|
_: 2
|
|
1220
1220
|
}, 1024)) : (p(), V(e(B), {
|
|
@@ -1228,21 +1228,21 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1228
1228
|
_: 1
|
|
1229
1229
|
}))
|
|
1230
1230
|
]),
|
|
1231
|
-
expanded: t(({ row:
|
|
1232
|
-
|
|
1233
|
-
|
|
1231
|
+
expanded: t(({ row: C }) => [
|
|
1232
|
+
S("div", _t, [
|
|
1233
|
+
C.error ? (p(), V(e(B), {
|
|
1234
1234
|
key: 0,
|
|
1235
1235
|
tone: "danger",
|
|
1236
1236
|
size: "sm",
|
|
1237
1237
|
class: "wx-call-list__error"
|
|
1238
1238
|
}, {
|
|
1239
1239
|
default: t(() => [
|
|
1240
|
-
|
|
1241
|
-
d(" " + i(
|
|
1240
|
+
S("strong", null, i(e(r)("calls.error")) + ":", 1),
|
|
1241
|
+
d(" " + i(C.error), 1)
|
|
1242
1242
|
]),
|
|
1243
1243
|
_: 2
|
|
1244
1244
|
}, 1024)) : E("", !0),
|
|
1245
|
-
|
|
1245
|
+
C.arguments ? (p(), G("pre", bt, i(C.arguments), 1)) : (p(), V(e(B), {
|
|
1246
1246
|
key: 2,
|
|
1247
1247
|
size: "sm",
|
|
1248
1248
|
tone: "muted"
|
|
@@ -1254,62 +1254,62 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1254
1254
|
}))
|
|
1255
1255
|
])
|
|
1256
1256
|
]),
|
|
1257
|
-
"cell-card": t(({ row:
|
|
1257
|
+
"cell-card": t(({ row: C }) => [
|
|
1258
1258
|
a(e(Ce), {
|
|
1259
1259
|
variant: "plain",
|
|
1260
|
-
title:
|
|
1261
|
-
subtitle: h(
|
|
1260
|
+
title: C.tool,
|
|
1261
|
+
subtitle: h(C.user)
|
|
1262
1262
|
}, {
|
|
1263
1263
|
media: t(() => [
|
|
1264
|
-
|
|
1264
|
+
S("span", gt, [
|
|
1265
1265
|
a(e(Z), { name: "sliders" })
|
|
1266
1266
|
])
|
|
1267
1267
|
]),
|
|
1268
1268
|
meta: t(() => [
|
|
1269
|
-
a(e(
|
|
1270
|
-
type:
|
|
1269
|
+
a(e(j), {
|
|
1270
|
+
type: Y(C).type,
|
|
1271
1271
|
dot: "",
|
|
1272
1272
|
size: "sm"
|
|
1273
1273
|
}, {
|
|
1274
1274
|
default: t(() => [
|
|
1275
|
-
d(i(
|
|
1275
|
+
d(i(Y(C).label), 1)
|
|
1276
1276
|
]),
|
|
1277
1277
|
_: 2
|
|
1278
1278
|
}, 1032, ["type"]),
|
|
1279
1279
|
a(e(ie), {
|
|
1280
|
-
value:
|
|
1280
|
+
value: C.at,
|
|
1281
1281
|
compact: ""
|
|
1282
1282
|
}, null, 8, ["value"]),
|
|
1283
|
-
|
|
1283
|
+
C.client ? (p(), V(e(B), {
|
|
1284
1284
|
key: 0,
|
|
1285
1285
|
size: "xs",
|
|
1286
1286
|
tone: "muted"
|
|
1287
1287
|
}, {
|
|
1288
1288
|
default: t(() => [
|
|
1289
|
-
d(i(
|
|
1289
|
+
d(i(C.client), 1)
|
|
1290
1290
|
]),
|
|
1291
1291
|
_: 2
|
|
1292
1292
|
}, 1024)) : E("", !0)
|
|
1293
1293
|
]),
|
|
1294
1294
|
default: t(() => [
|
|
1295
|
-
|
|
1295
|
+
D(C) ? (p(), V(e(oe), {
|
|
1296
1296
|
key: 0,
|
|
1297
1297
|
direction: "vertical",
|
|
1298
1298
|
size: "xs",
|
|
1299
1299
|
class: "wx-call-list__card-details"
|
|
1300
1300
|
}, {
|
|
1301
1301
|
default: t(() => [
|
|
1302
|
-
|
|
1302
|
+
C.error ? (p(), V(e(B), {
|
|
1303
1303
|
key: 0,
|
|
1304
1304
|
tone: "danger",
|
|
1305
1305
|
size: "sm"
|
|
1306
1306
|
}, {
|
|
1307
1307
|
default: t(() => [
|
|
1308
|
-
d(i(
|
|
1308
|
+
d(i(C.error), 1)
|
|
1309
1309
|
]),
|
|
1310
1310
|
_: 2
|
|
1311
1311
|
}, 1024)) : E("", !0),
|
|
1312
|
-
|
|
1312
|
+
C.arguments ? (p(), G("pre", wt, i(C.arguments), 1)) : E("", !0)
|
|
1313
1313
|
]),
|
|
1314
1314
|
_: 2
|
|
1315
1315
|
}, 1024)) : E("", !0)
|
|
@@ -1336,7 +1336,7 @@ function kt(n) {
|
|
|
1336
1336
|
const Ct = {
|
|
1337
1337
|
class: "wx-connection-list__glyph",
|
|
1338
1338
|
"aria-hidden": "true"
|
|
1339
|
-
}, Ue = 560, je = /* @__PURE__ */
|
|
1339
|
+
}, Ue = 560, je = /* @__PURE__ */ X({
|
|
1340
1340
|
__name: "ConnectionList",
|
|
1341
1341
|
props: {
|
|
1342
1342
|
scope: { default: "mine" }
|
|
@@ -1344,7 +1344,7 @@ const Ct = {
|
|
|
1344
1344
|
setup(n, { expose: u }) {
|
|
1345
1345
|
const l = n, o = ee(), y = kt(o);
|
|
1346
1346
|
te();
|
|
1347
|
-
const c =
|
|
1347
|
+
const c = J("webx-auth"), _ = ve(), r = re("root"), b = xe(r), O = P(() => b.value > 0 && b.value < Ue), v = T([]), g = T(!1), w = T(null), m = P(() => O.value ? [{ key: "card", label: "" }] : [
|
|
1348
1348
|
{ key: "client", label: c("connections.client"), minWidth: 210 },
|
|
1349
1349
|
...l.scope === "all" ? [{ key: "user", label: c("connections.who"), minWidth: 140 }] : [],
|
|
1350
1350
|
{ key: "read_only", label: c("connections.allowed"), minWidth: 160 },
|
|
@@ -1352,23 +1352,23 @@ const Ct = {
|
|
|
1352
1352
|
{ key: "last_used_at", label: c("connections.last-used"), minWidth: 130 },
|
|
1353
1353
|
{ key: "end", label: "", align: "right", width: 140 }
|
|
1354
1354
|
]);
|
|
1355
|
-
function
|
|
1355
|
+
function x(A) {
|
|
1356
1356
|
return A.user.name ?? c("calls.deleted", { id: A.user.id });
|
|
1357
1357
|
}
|
|
1358
1358
|
function f(A) {
|
|
1359
1359
|
if (A.read_only) return c("connections.read-only");
|
|
1360
1360
|
if (l.scope !== "all") return c("connections.full-you");
|
|
1361
|
-
const
|
|
1362
|
-
return c("connections.full", { name:
|
|
1361
|
+
const W = A.user.name?.split(" ")[0];
|
|
1362
|
+
return c("connections.full", { name: W || x(A) });
|
|
1363
1363
|
}
|
|
1364
1364
|
async function h() {
|
|
1365
|
-
|
|
1365
|
+
g.value = !0;
|
|
1366
1366
|
try {
|
|
1367
1367
|
v.value = (await y.list(l.scope)).data;
|
|
1368
1368
|
} catch (A) {
|
|
1369
|
-
|
|
1369
|
+
Q.danger(_(A));
|
|
1370
1370
|
} finally {
|
|
1371
|
-
|
|
1371
|
+
g.value = !1;
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
1374
|
async function z(A) {
|
|
@@ -1382,15 +1382,15 @@ const Ct = {
|
|
|
1382
1382
|
w.value = A.id;
|
|
1383
1383
|
try {
|
|
1384
1384
|
const s = await y.disconnect(A.id);
|
|
1385
|
-
v.value = v.value.map((
|
|
1385
|
+
v.value = v.value.map(($) => $.id === s.id ? s : $), Q.success(c("connections.done", { client: A.client }));
|
|
1386
1386
|
} catch (s) {
|
|
1387
|
-
|
|
1387
|
+
Q.danger(_(s));
|
|
1388
1388
|
} finally {
|
|
1389
1389
|
w.value = null;
|
|
1390
1390
|
}
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
|
-
return ue(() => l.scope, h, { immediate: !0 }), u({ reload: h }), (A,
|
|
1393
|
+
return ue(() => l.scope, h, { immediate: !0 }), u({ reload: h }), (A, W) => (p(), G("div", {
|
|
1394
1394
|
ref_key: "root",
|
|
1395
1395
|
ref: r,
|
|
1396
1396
|
class: "wx-connection-list"
|
|
@@ -1400,7 +1400,7 @@ const Ct = {
|
|
|
1400
1400
|
columns: m.value,
|
|
1401
1401
|
"row-key": "id",
|
|
1402
1402
|
flush: "",
|
|
1403
|
-
loading:
|
|
1403
|
+
loading: g.value,
|
|
1404
1404
|
clickable: !1,
|
|
1405
1405
|
"empty-text": n.scope === "all" ? e(c)("connections.empty-all") : e(c)("connections.empty"),
|
|
1406
1406
|
"cards-below": Ue,
|
|
@@ -1439,13 +1439,13 @@ const Ct = {
|
|
|
1439
1439
|
tone: s.user.name === null ? "muted" : "default"
|
|
1440
1440
|
}, {
|
|
1441
1441
|
default: t(() => [
|
|
1442
|
-
d(i(
|
|
1442
|
+
d(i(x(s)), 1)
|
|
1443
1443
|
]),
|
|
1444
1444
|
_: 2
|
|
1445
1445
|
}, 1032, ["tone"])
|
|
1446
1446
|
]),
|
|
1447
1447
|
"cell-read_only": t(({ row: s }) => [
|
|
1448
|
-
s.revoked_at ? (p(), V(e(
|
|
1448
|
+
s.revoked_at ? (p(), V(e(j), {
|
|
1449
1449
|
key: 0,
|
|
1450
1450
|
type: "default",
|
|
1451
1451
|
dot: ""
|
|
@@ -1454,7 +1454,7 @@ const Ct = {
|
|
|
1454
1454
|
d(i(e(c)("connections.disconnected")), 1)
|
|
1455
1455
|
]),
|
|
1456
1456
|
_: 1
|
|
1457
|
-
})) : (p(), V(e(
|
|
1457
|
+
})) : (p(), V(e(j), {
|
|
1458
1458
|
key: 1,
|
|
1459
1459
|
type: s.read_only ? "info" : "success",
|
|
1460
1460
|
dot: ""
|
|
@@ -1496,7 +1496,7 @@ const Ct = {
|
|
|
1496
1496
|
variant: "text",
|
|
1497
1497
|
size: "sm",
|
|
1498
1498
|
loading: w.value === s.id,
|
|
1499
|
-
onClick: (
|
|
1499
|
+
onClick: ($) => z(s)
|
|
1500
1500
|
}, {
|
|
1501
1501
|
default: t(() => [
|
|
1502
1502
|
d(i(e(c)("connections.disconnect")), 1)
|
|
@@ -1511,12 +1511,12 @@ const Ct = {
|
|
|
1511
1511
|
subtitle: e(c)("connections.returns-to", { host: s.host })
|
|
1512
1512
|
}, {
|
|
1513
1513
|
media: t(() => [
|
|
1514
|
-
|
|
1514
|
+
S("span", Ct, [
|
|
1515
1515
|
a(e(Z), { name: "link" })
|
|
1516
1516
|
])
|
|
1517
1517
|
]),
|
|
1518
1518
|
meta: t(() => [
|
|
1519
|
-
s.revoked_at ? (p(), V(e(
|
|
1519
|
+
s.revoked_at ? (p(), V(e(j), {
|
|
1520
1520
|
key: 0,
|
|
1521
1521
|
type: "default",
|
|
1522
1522
|
dot: "",
|
|
@@ -1526,7 +1526,7 @@ const Ct = {
|
|
|
1526
1526
|
d(i(e(c)("connections.disconnected")), 1)
|
|
1527
1527
|
]),
|
|
1528
1528
|
_: 1
|
|
1529
|
-
})) : (p(), V(e(
|
|
1529
|
+
})) : (p(), V(e(j), {
|
|
1530
1530
|
key: 1,
|
|
1531
1531
|
type: s.read_only ? "info" : "success",
|
|
1532
1532
|
dot: "",
|
|
@@ -1543,7 +1543,7 @@ const Ct = {
|
|
|
1543
1543
|
tone: "muted"
|
|
1544
1544
|
}, {
|
|
1545
1545
|
default: t(() => [
|
|
1546
|
-
d(i(
|
|
1546
|
+
d(i(x(s)), 1)
|
|
1547
1547
|
]),
|
|
1548
1548
|
_: 2
|
|
1549
1549
|
}, 1024)) : E("", !0),
|
|
@@ -1569,7 +1569,7 @@ const Ct = {
|
|
|
1569
1569
|
variant: "text",
|
|
1570
1570
|
size: "sm",
|
|
1571
1571
|
loading: w.value === s.id,
|
|
1572
|
-
onClick: (
|
|
1572
|
+
onClick: ($) => z(s)
|
|
1573
1573
|
}, {
|
|
1574
1574
|
default: t(() => [
|
|
1575
1575
|
d(i(e(c)("connections.disconnect")), 1)
|
|
@@ -1584,7 +1584,7 @@ const Ct = {
|
|
|
1584
1584
|
}, 8, ["data", "columns", "loading", "empty-text", "row-class"])
|
|
1585
1585
|
], 512));
|
|
1586
1586
|
}
|
|
1587
|
-
}), $t = /* @__PURE__ */
|
|
1587
|
+
}), $t = /* @__PURE__ */ X({
|
|
1588
1588
|
__name: "AdminsPage",
|
|
1589
1589
|
props: {
|
|
1590
1590
|
base: { default: "/admins" },
|
|
@@ -1595,19 +1595,19 @@ const Ct = {
|
|
|
1595
1595
|
setup(n) {
|
|
1596
1596
|
const u = n, l = ee(), o = fe(l), y = tt(), c = at();
|
|
1597
1597
|
te();
|
|
1598
|
-
const _ =
|
|
1599
|
-
() => l.state.manifest?.modules.find((
|
|
1600
|
-
),
|
|
1601
|
-
const
|
|
1602
|
-
return w &&
|
|
1598
|
+
const _ = J("webx-auth"), r = ve(), b = re("list"), O = T(null), v = $e(yt), g = l.can("admins.manage"), w = l.can("admins.audit"), m = P(
|
|
1599
|
+
() => l.state.manifest?.modules.find((W) => W.id === "admins")?.title ?? _("admins.title")
|
|
1600
|
+
), x = P(() => {
|
|
1601
|
+
const W = [{ value: "admins", label: m.value }];
|
|
1602
|
+
return w && W.push({ value: "calls", label: _("calls.title") }), g && W.push({ value: "connections", label: _("connections.title") }), W.length > 1 ? W : void 0;
|
|
1603
1603
|
}), f = P({
|
|
1604
1604
|
get: () => u.current,
|
|
1605
|
-
set: (
|
|
1606
|
-
const s =
|
|
1605
|
+
set: (W) => {
|
|
1606
|
+
const s = W === "admins" ? u.base : `${u.base}/${String(W)}`;
|
|
1607
1607
|
s !== c.path && y.push(s);
|
|
1608
1608
|
}
|
|
1609
1609
|
}), h = P(
|
|
1610
|
-
() =>
|
|
1610
|
+
() => g && u.current === "admins" ? [
|
|
1611
1611
|
{
|
|
1612
1612
|
key: "new",
|
|
1613
1613
|
label: _("admins.new-short"),
|
|
@@ -1619,28 +1619,28 @@ const Ct = {
|
|
|
1619
1619
|
}
|
|
1620
1620
|
] : []
|
|
1621
1621
|
);
|
|
1622
|
-
async function z(
|
|
1623
|
-
O.value =
|
|
1622
|
+
async function z(W) {
|
|
1623
|
+
O.value = W, await v({ admin: W, avatarField: u.avatarField }) && b.value?.reload();
|
|
1624
1624
|
}
|
|
1625
|
-
async function A(
|
|
1625
|
+
async function A(W) {
|
|
1626
1626
|
if (await Ne({
|
|
1627
|
-
title: _("admins.delete-title", { name:
|
|
1627
|
+
title: _("admins.delete-title", { name: W.name }),
|
|
1628
1628
|
message: _("admins.delete-text"),
|
|
1629
1629
|
confirmText: _("admins.delete"),
|
|
1630
1630
|
cancelText: _("admins.cancel"),
|
|
1631
1631
|
tone: "danger"
|
|
1632
1632
|
}))
|
|
1633
1633
|
try {
|
|
1634
|
-
await o.remove(
|
|
1635
|
-
} catch (
|
|
1636
|
-
|
|
1634
|
+
await o.remove(W.id), Q.success(_("admins.deleted")), b.value?.reload();
|
|
1635
|
+
} catch ($) {
|
|
1636
|
+
Q.danger(r($));
|
|
1637
1637
|
}
|
|
1638
1638
|
}
|
|
1639
|
-
return (
|
|
1639
|
+
return (W, s) => (p(), V(e(De), {
|
|
1640
1640
|
view: f.value,
|
|
1641
|
-
"onUpdate:view": s[0] || (s[0] = (
|
|
1641
|
+
"onUpdate:view": s[0] || (s[0] = ($) => f.value = $),
|
|
1642
1642
|
title: m.value,
|
|
1643
|
-
views:
|
|
1643
|
+
views: x.value,
|
|
1644
1644
|
actions: h.value
|
|
1645
1645
|
}, {
|
|
1646
1646
|
default: t(() => [
|
|
@@ -1650,8 +1650,8 @@ const Ct = {
|
|
|
1650
1650
|
})) : (p(), V(Ye, {
|
|
1651
1651
|
key: 2,
|
|
1652
1652
|
ref_key: "list",
|
|
1653
|
-
ref:
|
|
1654
|
-
removable: e(
|
|
1653
|
+
ref: b,
|
|
1654
|
+
removable: e(g),
|
|
1655
1655
|
"resolve-avatar": u.resolveAvatar,
|
|
1656
1656
|
onOpen: z,
|
|
1657
1657
|
onRemove: A
|
|
@@ -1660,51 +1660,51 @@ const Ct = {
|
|
|
1660
1660
|
_: 1
|
|
1661
1661
|
}, 8, ["view", "title", "views", "actions"]));
|
|
1662
1662
|
}
|
|
1663
|
-
}), At = { class: "wx-connect" }, Vt = { class: "wx-connect__row" }, zt = { class: "wx-connect__url" }, Lt = { class: "wx-connect__section" }, St = { class: "wx-connect__steps" }, Wt = { class: "wx-connect__steps" }, Tt = { class: "wx-connect__snippet" }, Ut = { class: "wx-connect__snippet" }, Pt = { class: "wx-connect__section" }, Ft = { class: "wx-connect__links" }, Ot = { class: "wx-connect__steps" }, Rt = { class: "wx-connect__section" }, Bt = /* @__PURE__ */
|
|
1663
|
+
}), At = { class: "wx-connect" }, Vt = { class: "wx-connect__row" }, zt = { class: "wx-connect__url" }, Lt = { class: "wx-connect__section" }, St = { class: "wx-connect__steps" }, Wt = { class: "wx-connect__steps" }, Tt = { class: "wx-connect__snippet" }, Ut = { class: "wx-connect__snippet" }, Pt = { class: "wx-connect__section" }, Ft = { class: "wx-connect__links" }, Ot = { class: "wx-connect__steps" }, Rt = { class: "wx-connect__section" }, Bt = /* @__PURE__ */ X({
|
|
1664
1664
|
__name: "ConnectPage",
|
|
1665
1665
|
setup(n) {
|
|
1666
1666
|
const u = ee();
|
|
1667
1667
|
te();
|
|
1668
|
-
const l =
|
|
1668
|
+
const l = J("webx-auth"), o = T(!1);
|
|
1669
1669
|
let y;
|
|
1670
1670
|
const c = P(() => {
|
|
1671
|
-
const
|
|
1672
|
-
return typeof
|
|
1671
|
+
const x = u.state.manifest?.modules.find((f) => f.id === "connect")?.meta;
|
|
1672
|
+
return typeof x?.url == "string" ? x.url : "";
|
|
1673
1673
|
}), _ = P(() => {
|
|
1674
1674
|
try {
|
|
1675
1675
|
return new URL(c.value).hostname.split(".")[0] || "webx";
|
|
1676
1676
|
} catch {
|
|
1677
1677
|
return "webx";
|
|
1678
1678
|
}
|
|
1679
|
-
}), r = P(() => `claude mcp add --transport http ${_.value} ${c.value}`),
|
|
1679
|
+
}), r = P(() => `claude mcp add --transport http ${_.value} ${c.value}`), b = P(() => `[mcp_servers.${_.value}]
|
|
1680
1680
|
url = "${c.value}"`), O = P(() => {
|
|
1681
|
-
const
|
|
1682
|
-
return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(_.value)}&config=${
|
|
1681
|
+
const x = g(JSON.stringify({ url: c.value }));
|
|
1682
|
+
return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(_.value)}&config=${x}`;
|
|
1683
1683
|
}), v = P(() => {
|
|
1684
|
-
const
|
|
1685
|
-
return `vscode:mcp/install?${encodeURIComponent(
|
|
1684
|
+
const x = JSON.stringify({ name: _.value, type: "http", url: c.value });
|
|
1685
|
+
return `vscode:mcp/install?${encodeURIComponent(x)}`;
|
|
1686
1686
|
});
|
|
1687
|
-
function
|
|
1688
|
-
const f = new TextEncoder().encode(
|
|
1687
|
+
function g(x) {
|
|
1688
|
+
const f = new TextEncoder().encode(x);
|
|
1689
1689
|
let h = "";
|
|
1690
1690
|
for (const z of f) h += String.fromCharCode(z);
|
|
1691
1691
|
return encodeURIComponent(btoa(h));
|
|
1692
1692
|
}
|
|
1693
|
-
async function w(
|
|
1693
|
+
async function w(x) {
|
|
1694
1694
|
try {
|
|
1695
1695
|
if (navigator.clipboard?.writeText)
|
|
1696
|
-
await navigator.clipboard.writeText(
|
|
1697
|
-
else if (!m(
|
|
1696
|
+
await navigator.clipboard.writeText(x);
|
|
1697
|
+
else if (!m(x))
|
|
1698
1698
|
throw new Error("no clipboard");
|
|
1699
1699
|
o.value = !0, clearTimeout(y), y = setTimeout(() => o.value = !1, 2e3);
|
|
1700
1700
|
} catch {
|
|
1701
|
-
if (m(
|
|
1702
|
-
|
|
1701
|
+
if (m(x)) return;
|
|
1702
|
+
Q.danger(l("connect.copy-failed"));
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
1705
|
-
function m(
|
|
1705
|
+
function m(x) {
|
|
1706
1706
|
const f = document.createElement("textarea");
|
|
1707
|
-
f.value =
|
|
1707
|
+
f.value = x, f.setAttribute("readonly", ""), f.style.position = "fixed", f.style.opacity = "0", document.body.append(f), f.select();
|
|
1708
1708
|
try {
|
|
1709
1709
|
return document.execCommand("copy");
|
|
1710
1710
|
} catch {
|
|
@@ -1713,12 +1713,12 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1713
1713
|
f.remove();
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
|
-
return (
|
|
1716
|
+
return (x, f) => (p(), V(e(De), {
|
|
1717
1717
|
title: e(l)("connect.title"),
|
|
1718
1718
|
card: !1
|
|
1719
1719
|
}, {
|
|
1720
1720
|
default: t(() => [
|
|
1721
|
-
|
|
1721
|
+
S("div", At, [
|
|
1722
1722
|
a(e(B), { class: "wx-connect__lead" }, {
|
|
1723
1723
|
default: t(() => [
|
|
1724
1724
|
d(i(e(l)("connect.lead")), 1)
|
|
@@ -1737,8 +1737,8 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1737
1737
|
]),
|
|
1738
1738
|
_: 1
|
|
1739
1739
|
}),
|
|
1740
|
-
|
|
1741
|
-
|
|
1740
|
+
S("div", Vt, [
|
|
1741
|
+
S("code", zt, i(c.value), 1),
|
|
1742
1742
|
a(e(I), {
|
|
1743
1743
|
type: "primary",
|
|
1744
1744
|
disabled: c.value === "",
|
|
@@ -1758,7 +1758,7 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1758
1758
|
]),
|
|
1759
1759
|
_: 1
|
|
1760
1760
|
}),
|
|
1761
|
-
|
|
1761
|
+
S("section", Lt, [
|
|
1762
1762
|
a(e(he), {
|
|
1763
1763
|
level: 2,
|
|
1764
1764
|
size: "sm"
|
|
@@ -1773,33 +1773,33 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1773
1773
|
"aria-label": e(l)("connect.how")
|
|
1774
1774
|
}, {
|
|
1775
1775
|
default: t(() => [
|
|
1776
|
-
a(e(
|
|
1776
|
+
a(e(me), {
|
|
1777
1777
|
value: "claude",
|
|
1778
1778
|
label: e(l)("connect.claude-title")
|
|
1779
1779
|
}, {
|
|
1780
1780
|
default: t(() => [
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1781
|
+
S("ol", St, [
|
|
1782
|
+
S("li", null, i(e(l)("connect.claude-1")), 1),
|
|
1783
|
+
S("li", null, i(e(l)("connect.claude-2")), 1),
|
|
1784
|
+
S("li", null, i(e(l)("connect.claude-3")), 1)
|
|
1785
1785
|
])
|
|
1786
1786
|
]),
|
|
1787
1787
|
_: 1
|
|
1788
1788
|
}, 8, ["label"]),
|
|
1789
|
-
a(e(
|
|
1789
|
+
a(e(me), {
|
|
1790
1790
|
value: "chatgpt",
|
|
1791
1791
|
label: e(l)("connect.chatgpt-title")
|
|
1792
1792
|
}, {
|
|
1793
1793
|
default: t(() => [
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1794
|
+
S("ol", Wt, [
|
|
1795
|
+
S("li", null, i(e(l)("connect.chatgpt-1")), 1),
|
|
1796
|
+
S("li", null, i(e(l)("connect.chatgpt-2")), 1),
|
|
1797
|
+
S("li", null, i(e(l)("connect.chatgpt-3")), 1)
|
|
1798
1798
|
])
|
|
1799
1799
|
]),
|
|
1800
1800
|
_: 1
|
|
1801
1801
|
}, 8, ["label"]),
|
|
1802
|
-
a(e(
|
|
1802
|
+
a(e(me), {
|
|
1803
1803
|
value: "claude-code",
|
|
1804
1804
|
label: e(l)("connect.claude-code-title")
|
|
1805
1805
|
}, {
|
|
@@ -1810,8 +1810,8 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1810
1810
|
]),
|
|
1811
1811
|
_: 1
|
|
1812
1812
|
}),
|
|
1813
|
-
|
|
1814
|
-
|
|
1813
|
+
S("div", Tt, [
|
|
1814
|
+
S("pre", null, i(r.value), 1),
|
|
1815
1815
|
a(e(I), {
|
|
1816
1816
|
variant: "text",
|
|
1817
1817
|
size: "sm",
|
|
@@ -1829,7 +1829,7 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1829
1829
|
]),
|
|
1830
1830
|
_: 1
|
|
1831
1831
|
}, 8, ["label"]),
|
|
1832
|
-
a(e(
|
|
1832
|
+
a(e(me), {
|
|
1833
1833
|
value: "codex",
|
|
1834
1834
|
label: e(l)("connect.codex-title")
|
|
1835
1835
|
}, {
|
|
@@ -1840,12 +1840,12 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1840
1840
|
]),
|
|
1841
1841
|
_: 1
|
|
1842
1842
|
}),
|
|
1843
|
-
|
|
1844
|
-
|
|
1843
|
+
S("div", Ut, [
|
|
1844
|
+
S("pre", null, i(b.value), 1),
|
|
1845
1845
|
a(e(I), {
|
|
1846
1846
|
variant: "text",
|
|
1847
1847
|
size: "sm",
|
|
1848
|
-
onClick: f[2] || (f[2] = (h) => w(
|
|
1848
|
+
onClick: f[2] || (f[2] = (h) => w(b.value))
|
|
1849
1849
|
}, {
|
|
1850
1850
|
icon: t(() => [
|
|
1851
1851
|
a(e(Z), { name: "copy" })
|
|
@@ -1863,7 +1863,7 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1863
1863
|
_: 1
|
|
1864
1864
|
}, 8, ["aria-label"])
|
|
1865
1865
|
]),
|
|
1866
|
-
|
|
1866
|
+
S("section", Pt, [
|
|
1867
1867
|
a(e(he), {
|
|
1868
1868
|
level: 2,
|
|
1869
1869
|
size: "sm"
|
|
@@ -1882,7 +1882,7 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1882
1882
|
]),
|
|
1883
1883
|
_: 1
|
|
1884
1884
|
}),
|
|
1885
|
-
|
|
1885
|
+
S("div", Ft, [
|
|
1886
1886
|
a(e(I), {
|
|
1887
1887
|
href: O.value,
|
|
1888
1888
|
variant: "outline",
|
|
@@ -1918,15 +1918,15 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1918
1918
|
title: e(l)("connect.next")
|
|
1919
1919
|
}, {
|
|
1920
1920
|
default: t(() => [
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1921
|
+
S("ol", Ot, [
|
|
1922
|
+
S("li", null, i(e(l)("connect.next-1")), 1),
|
|
1923
|
+
S("li", null, i(e(l)("connect.next-2")), 1),
|
|
1924
|
+
S("li", null, i(e(l)("connect.next-3")), 1)
|
|
1925
1925
|
])
|
|
1926
1926
|
]),
|
|
1927
1927
|
_: 1
|
|
1928
1928
|
}, 8, ["title"]),
|
|
1929
|
-
|
|
1929
|
+
S("section", Rt, [
|
|
1930
1930
|
a(e(he), {
|
|
1931
1931
|
level: 2,
|
|
1932
1932
|
size: "sm"
|
|
@@ -1949,7 +1949,7 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1949
1949
|
}, 8, ["title"]));
|
|
1950
1950
|
}
|
|
1951
1951
|
}), Et = /* @__PURE__ */ pe(Bt, [["__scopeId", "data-v-92d62c98"]]);
|
|
1952
|
-
function
|
|
1952
|
+
function la(n = {}) {
|
|
1953
1953
|
const u = n.path ?? "/admins", l = (o) => ({
|
|
1954
1954
|
render: () => Re($t, {
|
|
1955
1955
|
base: u,
|
|
@@ -1975,7 +1975,7 @@ function ta(n = {}) {
|
|
|
1975
1975
|
]
|
|
1976
1976
|
};
|
|
1977
1977
|
}
|
|
1978
|
-
function
|
|
1978
|
+
function na(n = {}) {
|
|
1979
1979
|
const u = n.path ?? "/connect";
|
|
1980
1980
|
return {
|
|
1981
1981
|
id: "connect",
|
|
@@ -1983,7 +1983,7 @@ function aa(n = {}) {
|
|
|
1983
1983
|
routes: [{ path: u, name: "webx.connect", component: Et }]
|
|
1984
1984
|
};
|
|
1985
1985
|
}
|
|
1986
|
-
const Dt = /* @__PURE__ */
|
|
1986
|
+
const Dt = /* @__PURE__ */ X({
|
|
1987
1987
|
__name: "AdminPicker",
|
|
1988
1988
|
props: {
|
|
1989
1989
|
multiple: { type: Boolean, default: !1 },
|
|
@@ -1993,16 +1993,16 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
1993
1993
|
setup(n) {
|
|
1994
1994
|
const u = n, { open: l, resolve: o, dismiss: y } = ge();
|
|
1995
1995
|
te();
|
|
1996
|
-
const c =
|
|
1997
|
-
function
|
|
1996
|
+
const c = J("webx-auth"), _ = re("list"), r = T(0);
|
|
1997
|
+
function b(v) {
|
|
1998
1998
|
o(v);
|
|
1999
1999
|
}
|
|
2000
2000
|
function O(v) {
|
|
2001
2001
|
r.value = v.length;
|
|
2002
2002
|
}
|
|
2003
|
-
return (v,
|
|
2003
|
+
return (v, g) => (p(), V(e(we), {
|
|
2004
2004
|
open: e(l),
|
|
2005
|
-
"onUpdate:open":
|
|
2005
|
+
"onUpdate:open": g[2] || (g[2] = (w) => be(l) ? l.value = w : null),
|
|
2006
2006
|
title: n.title ?? e(c)(n.multiple ? "admins.select-many" : "admins.select-one"),
|
|
2007
2007
|
width: 880
|
|
2008
2008
|
}, Oe({
|
|
@@ -2013,7 +2013,7 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
2013
2013
|
picking: "",
|
|
2014
2014
|
multiple: n.multiple,
|
|
2015
2015
|
"resolve-avatar": u.resolveAvatar,
|
|
2016
|
-
onChosen:
|
|
2016
|
+
onChosen: b,
|
|
2017
2017
|
onSelection: O
|
|
2018
2018
|
}, null, 8, ["multiple", "resolve-avatar"])
|
|
2019
2019
|
]),
|
|
@@ -2038,7 +2038,7 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
2038
2038
|
}),
|
|
2039
2039
|
a(e(I), {
|
|
2040
2040
|
variant: "outline",
|
|
2041
|
-
onClick:
|
|
2041
|
+
onClick: g[0] || (g[0] = (w) => e(y)())
|
|
2042
2042
|
}, {
|
|
2043
2043
|
default: t(() => [
|
|
2044
2044
|
d(i(e(c)("admins.cancel")), 1)
|
|
@@ -2048,7 +2048,7 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
2048
2048
|
a(e(I), {
|
|
2049
2049
|
type: "primary",
|
|
2050
2050
|
disabled: r.value === 0,
|
|
2051
|
-
onClick:
|
|
2051
|
+
onClick: g[1] || (g[1] = (w) => e(o)(_.value?.chosen() ?? []))
|
|
2052
2052
|
}, {
|
|
2053
2053
|
default: t(() => [
|
|
2054
2054
|
d(i(e(c)("admins.save")), 1)
|
|
@@ -2064,16 +2064,16 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
2064
2064
|
]), 1032, ["open", "title"]));
|
|
2065
2065
|
}
|
|
2066
2066
|
}), Ge = $e(Dt);
|
|
2067
|
-
async function
|
|
2067
|
+
async function oa(n = {}) {
|
|
2068
2068
|
return (await Ge({ ...n, multiple: !1 }))?.[0];
|
|
2069
2069
|
}
|
|
2070
|
-
function
|
|
2070
|
+
function sa(n = {}) {
|
|
2071
2071
|
return Ge({ ...n, multiple: !0 });
|
|
2072
2072
|
}
|
|
2073
2073
|
const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
2074
2074
|
key: 0,
|
|
2075
2075
|
class: "wx-profile__aside"
|
|
2076
|
-
}, Ht = { class: "wx-profile__fields" }, Kt = /* @__PURE__ */
|
|
2076
|
+
}, Ht = { class: "wx-profile__fields" }, Kt = /* @__PURE__ */ X({
|
|
2077
2077
|
__name: "ProfileDialog",
|
|
2078
2078
|
props: {
|
|
2079
2079
|
avatarField: { default: void 0 }
|
|
@@ -2081,28 +2081,28 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2081
2081
|
setup(n) {
|
|
2082
2082
|
const u = n, { resolve: l, dismiss: o, open: y } = ge(), c = ee(), _ = Ae();
|
|
2083
2083
|
te();
|
|
2084
|
-
const r =
|
|
2084
|
+
const r = J("webx-auth"), b = ve(), O = T(!1), v = T({}), g = T({
|
|
2085
2085
|
name: c.state.user?.name ?? "",
|
|
2086
2086
|
avatar: c.state.user?.avatar ?? null,
|
|
2087
2087
|
password: "",
|
|
2088
2088
|
current_password: ""
|
|
2089
|
-
}), w = T(
|
|
2089
|
+
}), w = T(g.value.avatar ? { path: g.value.avatar } : null);
|
|
2090
2090
|
function m(f) {
|
|
2091
2091
|
return v.value[f]?.[0];
|
|
2092
2092
|
}
|
|
2093
|
-
async function
|
|
2093
|
+
async function x() {
|
|
2094
2094
|
O.value = !0, v.value = {};
|
|
2095
2095
|
try {
|
|
2096
2096
|
await _.updateProfile({
|
|
2097
|
-
name:
|
|
2097
|
+
name: g.value.name,
|
|
2098
2098
|
avatar: w.value?.path ?? null,
|
|
2099
2099
|
// Blank is left out entirely rather than sent as an empty string: the server reads a
|
|
2100
2100
|
// filled password as "change it", and an empty one would be a change to nothing.
|
|
2101
|
-
...
|
|
2102
|
-
}),
|
|
2101
|
+
...g.value.password ? { password: g.value.password, current_password: g.value.current_password } : {}
|
|
2102
|
+
}), Q.success(r("profile.saved")), l(!0);
|
|
2103
2103
|
} catch (f) {
|
|
2104
2104
|
const h = f.body;
|
|
2105
|
-
h?.errors ? v.value = h.errors :
|
|
2105
|
+
h?.errors ? v.value = h.errors : Q.danger(b(f));
|
|
2106
2106
|
} finally {
|
|
2107
2107
|
O.value = !1;
|
|
2108
2108
|
}
|
|
@@ -2125,7 +2125,7 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2125
2125
|
a(e(I), {
|
|
2126
2126
|
type: "primary",
|
|
2127
2127
|
loading: O.value,
|
|
2128
|
-
onClick:
|
|
2128
|
+
onClick: x
|
|
2129
2129
|
}, {
|
|
2130
2130
|
default: t(() => [
|
|
2131
2131
|
d(i(e(r)("profile.save")), 1)
|
|
@@ -2134,9 +2134,9 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2134
2134
|
}, 8, ["loading"])
|
|
2135
2135
|
]),
|
|
2136
2136
|
default: t(() => [
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
u.avatarField ? (p(),
|
|
2137
|
+
S("div", Nt, [
|
|
2138
|
+
S("div", It, [
|
|
2139
|
+
u.avatarField ? (p(), G("div", Mt, [
|
|
2140
2140
|
(p(), V(Fe(u.avatarField), {
|
|
2141
2141
|
modelValue: w.value,
|
|
2142
2142
|
"onUpdate:modelValue": h[0] || (h[0] = (z) => w.value = z),
|
|
@@ -2145,21 +2145,21 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2145
2145
|
captions: !1
|
|
2146
2146
|
}, null, 8, ["modelValue", "label"]))
|
|
2147
2147
|
])) : E("", !0),
|
|
2148
|
-
|
|
2149
|
-
a(e(
|
|
2148
|
+
S("div", Ht, [
|
|
2149
|
+
a(e(H), {
|
|
2150
2150
|
label: e(r)("profile.name"),
|
|
2151
2151
|
error: m("name")
|
|
2152
2152
|
}, {
|
|
2153
2153
|
default: t(() => [
|
|
2154
2154
|
a(e(le), {
|
|
2155
|
-
modelValue:
|
|
2156
|
-
"onUpdate:modelValue": h[1] || (h[1] = (z) =>
|
|
2155
|
+
modelValue: g.value.name,
|
|
2156
|
+
"onUpdate:modelValue": h[1] || (h[1] = (z) => g.value.name = z),
|
|
2157
2157
|
name: "name"
|
|
2158
2158
|
}, null, 8, ["modelValue"])
|
|
2159
2159
|
]),
|
|
2160
2160
|
_: 1
|
|
2161
2161
|
}, 8, ["label", "error"]),
|
|
2162
|
-
a(e(
|
|
2162
|
+
a(e(H), {
|
|
2163
2163
|
label: e(r)("admins.email")
|
|
2164
2164
|
}, {
|
|
2165
2165
|
default: t(() => [
|
|
@@ -2170,22 +2170,22 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2170
2170
|
]),
|
|
2171
2171
|
_: 1
|
|
2172
2172
|
}, 8, ["label"]),
|
|
2173
|
-
a(e(
|
|
2173
|
+
a(e(H), {
|
|
2174
2174
|
label: e(r)("profile.password"),
|
|
2175
2175
|
help: e(r)("profile.password-hint"),
|
|
2176
2176
|
error: m("password")
|
|
2177
2177
|
}, {
|
|
2178
2178
|
default: t(() => [
|
|
2179
2179
|
a(e(le), {
|
|
2180
|
-
modelValue:
|
|
2181
|
-
"onUpdate:modelValue": h[2] || (h[2] = (z) =>
|
|
2180
|
+
modelValue: g.value.password,
|
|
2181
|
+
"onUpdate:modelValue": h[2] || (h[2] = (z) => g.value.password = z),
|
|
2182
2182
|
type: "password",
|
|
2183
2183
|
autocomplete: "new-password"
|
|
2184
2184
|
}, null, 8, ["modelValue"])
|
|
2185
2185
|
]),
|
|
2186
2186
|
_: 1
|
|
2187
2187
|
}, 8, ["label", "help", "error"]),
|
|
2188
|
-
|
|
2188
|
+
g.value.password ? (p(), V(e(H), {
|
|
2189
2189
|
key: 0,
|
|
2190
2190
|
label: e(r)("profile.current-password"),
|
|
2191
2191
|
help: e(r)("profile.current-password-hint"),
|
|
@@ -2193,8 +2193,8 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2193
2193
|
}, {
|
|
2194
2194
|
default: t(() => [
|
|
2195
2195
|
a(e(le), {
|
|
2196
|
-
modelValue:
|
|
2197
|
-
"onUpdate:modelValue": h[3] || (h[3] = (z) =>
|
|
2196
|
+
modelValue: g.value.current_password,
|
|
2197
|
+
"onUpdate:modelValue": h[3] || (h[3] = (z) => g.value.current_password = z),
|
|
2198
2198
|
type: "password",
|
|
2199
2199
|
autocomplete: "current-password"
|
|
2200
2200
|
}, null, 8, ["modelValue"])
|
|
@@ -2208,10 +2208,7 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2208
2208
|
_: 1
|
|
2209
2209
|
}, 8, ["open", "title"]));
|
|
2210
2210
|
}
|
|
2211
|
-
}), Yt = /* @__PURE__ */ pe(Kt, [["__scopeId", "data-v-9583a67a"]]), jt = ["title"], Gt = {
|
|
2212
|
-
key: 0,
|
|
2213
|
-
class: "wx-user-menu__name"
|
|
2214
|
-
}, Jt = /* @__PURE__ */ Q({
|
|
2211
|
+
}), Yt = /* @__PURE__ */ pe(Kt, [["__scopeId", "data-v-9583a67a"]]), jt = ["title"], Gt = { class: "wx-user-menu__who" }, Jt = { class: "wx-user-menu__name" }, qt = { class: "wx-user-menu__email" }, Qt = /* @__PURE__ */ X({
|
|
2215
2212
|
__name: "UserMenu",
|
|
2216
2213
|
props: {
|
|
2217
2214
|
signOutLabel: { default: void 0 },
|
|
@@ -2220,27 +2217,27 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2220
2217
|
expanded: { type: Boolean, default: !1 }
|
|
2221
2218
|
},
|
|
2222
2219
|
setup(n) {
|
|
2223
|
-
const u = n, l = ee(), o = Ae(), y = Be(), c = et(), _ =
|
|
2220
|
+
const u = n, l = ee(), o = Ae(), y = Be(), c = et(), _ = J("webx-auth"), r = y.scope("webx-admin"), b = P(() => l.state.user), O = P(
|
|
2224
2221
|
() => y.state.panelLocales.length > 1 ? y.state.panelLocales : []
|
|
2225
|
-
), v = ye(Me, null),
|
|
2222
|
+
), v = ye(Me, null), g = ye(He, null), w = T(void 0);
|
|
2226
2223
|
ue(
|
|
2227
|
-
() => typeof
|
|
2224
|
+
() => typeof b.value?.avatar == "string" ? b.value.avatar : null,
|
|
2228
2225
|
async (z) => {
|
|
2229
2226
|
const A = u.resolveAvatar ?? v;
|
|
2230
2227
|
if (z === null || z === "" || A === null) {
|
|
2231
2228
|
w.value = void 0;
|
|
2232
2229
|
return;
|
|
2233
2230
|
}
|
|
2234
|
-
const
|
|
2235
|
-
|
|
2231
|
+
const W = await A(z);
|
|
2232
|
+
b.value?.avatar === z && (w.value = W ?? void 0);
|
|
2236
2233
|
},
|
|
2237
2234
|
{ immediate: !0 }
|
|
2238
2235
|
);
|
|
2239
2236
|
const m = $e(Yt);
|
|
2240
|
-
function
|
|
2237
|
+
function x() {
|
|
2241
2238
|
setTimeout(
|
|
2242
2239
|
() => {
|
|
2243
|
-
m({ avatarField: u.avatarField ??
|
|
2240
|
+
m({ avatarField: u.avatarField ?? g ?? void 0 });
|
|
2244
2241
|
},
|
|
2245
2242
|
0
|
|
2246
2243
|
);
|
|
@@ -2255,48 +2252,58 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2255
2252
|
z !== y.state.locale && await o.setLocale(z);
|
|
2256
2253
|
}
|
|
2257
2254
|
return (z, A) => {
|
|
2258
|
-
const
|
|
2259
|
-
return
|
|
2255
|
+
const W = M("wx-avatar"), s = M("wx-icon"), $ = M("wx-text"), U = M("wx-dropdown-item"), K = M("wx-divider"), Y = M("wx-dropdown");
|
|
2256
|
+
return b.value !== null ? (p(), V(Y, { key: 0 }, {
|
|
2260
2257
|
trigger: t(() => [
|
|
2261
|
-
|
|
2258
|
+
S("button", {
|
|
2262
2259
|
type: "button",
|
|
2263
2260
|
class: Qe(["wx-user-menu__trigger", { "wx-user-menu__trigger--named": n.expanded }]),
|
|
2264
|
-
title:
|
|
2261
|
+
title: b.value.name
|
|
2265
2262
|
}, [
|
|
2266
|
-
a(
|
|
2267
|
-
name:
|
|
2263
|
+
a(W, {
|
|
2264
|
+
name: b.value.name,
|
|
2268
2265
|
src: w.value,
|
|
2269
2266
|
size: "lg"
|
|
2270
2267
|
}, null, 8, ["name", "src"]),
|
|
2271
|
-
n.expanded ? (p(),
|
|
2268
|
+
n.expanded ? (p(), G(ce, { key: 0 }, [
|
|
2269
|
+
S("span", Gt, [
|
|
2270
|
+
S("span", Jt, i(b.value.name), 1),
|
|
2271
|
+
S("span", qt, i(b.value.email), 1)
|
|
2272
|
+
]),
|
|
2273
|
+
a(s, {
|
|
2274
|
+
name: "chevron-up",
|
|
2275
|
+
size: "sm",
|
|
2276
|
+
class: "wx-user-menu__chevron"
|
|
2277
|
+
})
|
|
2278
|
+
], 64)) : E("", !0)
|
|
2272
2279
|
], 10, jt)
|
|
2273
2280
|
]),
|
|
2274
2281
|
default: t(() => [
|
|
2275
|
-
a(
|
|
2282
|
+
a(U, { disabled: "" }, {
|
|
2276
2283
|
default: t(() => [
|
|
2277
|
-
a(
|
|
2284
|
+
a($, { size: "sm" }, {
|
|
2278
2285
|
default: t(() => [
|
|
2279
|
-
d(i(
|
|
2286
|
+
d(i(b.value.email), 1)
|
|
2280
2287
|
]),
|
|
2281
2288
|
_: 1
|
|
2282
2289
|
})
|
|
2283
2290
|
]),
|
|
2284
2291
|
_: 1
|
|
2285
2292
|
}),
|
|
2286
|
-
a(
|
|
2287
|
-
a(
|
|
2293
|
+
a(K, { spacing: "sm" }),
|
|
2294
|
+
a(U, {
|
|
2288
2295
|
icon: "user",
|
|
2289
|
-
onClick:
|
|
2296
|
+
onClick: x
|
|
2290
2297
|
}, {
|
|
2291
2298
|
default: t(() => [
|
|
2292
2299
|
d(i(e(_)("profile.menu")), 1)
|
|
2293
2300
|
]),
|
|
2294
2301
|
_: 1
|
|
2295
2302
|
}),
|
|
2296
|
-
a(
|
|
2297
|
-
a(
|
|
2303
|
+
a(K, { spacing: "sm" }),
|
|
2304
|
+
a(U, { disabled: "" }, {
|
|
2298
2305
|
default: t(() => [
|
|
2299
|
-
a(
|
|
2306
|
+
a($, {
|
|
2300
2307
|
size: "sm",
|
|
2301
2308
|
tone: "muted"
|
|
2302
2309
|
}, {
|
|
@@ -2308,7 +2315,7 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2308
2315
|
]),
|
|
2309
2316
|
_: 1
|
|
2310
2317
|
}),
|
|
2311
|
-
|
|
2318
|
+
S("div", {
|
|
2312
2319
|
class: "wx-user-menu__theme",
|
|
2313
2320
|
onClick: A[1] || (A[1] = Pe(() => {
|
|
2314
2321
|
}, ["stop"]))
|
|
@@ -2324,11 +2331,11 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2324
2331
|
"system-label": e(r)("theme.system")
|
|
2325
2332
|
}, null, 8, ["modelValue", "aria-label", "light-label", "dark-label", "system-label"])
|
|
2326
2333
|
]),
|
|
2327
|
-
O.value.length > 0 ? (p(),
|
|
2328
|
-
a(
|
|
2329
|
-
a(
|
|
2334
|
+
O.value.length > 0 ? (p(), G(ce, { key: 0 }, [
|
|
2335
|
+
a(K, { spacing: "sm" }),
|
|
2336
|
+
a(U, { disabled: "" }, {
|
|
2330
2337
|
default: t(() => [
|
|
2331
|
-
a(
|
|
2338
|
+
a($, {
|
|
2332
2339
|
size: "sm",
|
|
2333
2340
|
tone: "muted"
|
|
2334
2341
|
}, {
|
|
@@ -2340,19 +2347,19 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2340
2347
|
]),
|
|
2341
2348
|
_: 1
|
|
2342
2349
|
}),
|
|
2343
|
-
(p(!0),
|
|
2350
|
+
(p(!0), G(ce, null, _e(O.value, (D) => (p(), V(U, {
|
|
2344
2351
|
key: D.code,
|
|
2345
2352
|
icon: D.code === e(y).state.locale ? "check" : void 0,
|
|
2346
|
-
onClick: (
|
|
2353
|
+
onClick: (k) => h(D.code)
|
|
2347
2354
|
}, {
|
|
2348
2355
|
default: t(() => [
|
|
2349
2356
|
d(i(D.nativeName), 1)
|
|
2350
2357
|
]),
|
|
2351
2358
|
_: 2
|
|
2352
2359
|
}, 1032, ["icon", "onClick"]))), 128)),
|
|
2353
|
-
a(
|
|
2360
|
+
a(K, { spacing: "sm" })
|
|
2354
2361
|
], 64)) : E("", !0),
|
|
2355
|
-
a(
|
|
2362
|
+
a(U, {
|
|
2356
2363
|
icon: "logout",
|
|
2357
2364
|
onClick: A[2] || (A[2] = (D) => e(o).logout())
|
|
2358
2365
|
}, {
|
|
@@ -2366,8 +2373,8 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2366
2373
|
})) : E("", !0);
|
|
2367
2374
|
};
|
|
2368
2375
|
}
|
|
2369
|
-
}),
|
|
2370
|
-
function
|
|
2376
|
+
}), ia = /* @__PURE__ */ pe(Qt, [["__scopeId", "data-v-09f012fd"]]);
|
|
2377
|
+
function ra(n = {}) {
|
|
2371
2378
|
const u = n.path ?? "/login";
|
|
2372
2379
|
return {
|
|
2373
2380
|
install(l) {
|
|
@@ -2387,7 +2394,7 @@ function sa(n = {}) {
|
|
|
2387
2394
|
}
|
|
2388
2395
|
if (y === "ready" && c.path === u) {
|
|
2389
2396
|
const _ = c.query.next;
|
|
2390
|
-
if (typeof _ == "string" &&
|
|
2397
|
+
if (typeof _ == "string" && Xt(_)) {
|
|
2391
2398
|
location.assign(_);
|
|
2392
2399
|
return;
|
|
2393
2400
|
}
|
|
@@ -2398,7 +2405,7 @@ function sa(n = {}) {
|
|
|
2398
2405
|
}
|
|
2399
2406
|
};
|
|
2400
2407
|
}
|
|
2401
|
-
function
|
|
2408
|
+
function Xt(n) {
|
|
2402
2409
|
if (!/^https?:\/\//i.test(n))
|
|
2403
2410
|
return !1;
|
|
2404
2411
|
try {
|
|
@@ -2415,20 +2422,20 @@ export {
|
|
|
2415
2422
|
je as WxConnectionList,
|
|
2416
2423
|
mt as WxLoginCard,
|
|
2417
2424
|
Yt as WxProfileDialog,
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2425
|
+
ia as WxUserMenu,
|
|
2426
|
+
la as admins,
|
|
2427
|
+
ra as auth,
|
|
2421
2428
|
Ie as authKey,
|
|
2422
2429
|
Ke as authMessages,
|
|
2423
2430
|
He as avatarFieldKey,
|
|
2424
2431
|
Me as avatarResolverKey,
|
|
2425
|
-
|
|
2432
|
+
na as connect,
|
|
2426
2433
|
fe as createAdminsApi,
|
|
2427
2434
|
it as createAuthSession,
|
|
2428
2435
|
kt as createConnectionsApi,
|
|
2429
2436
|
rt as provideAuth,
|
|
2430
|
-
|
|
2431
|
-
|
|
2437
|
+
oa as selectAdmin,
|
|
2438
|
+
sa as selectAdmins,
|
|
2432
2439
|
Ae as useAuth
|
|
2433
2440
|
};
|
|
2434
2441
|
//# sourceMappingURL=index.js.map
|