@webx-ui/module-auth 0.8.14 → 0.9.0
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/avatars.d.ts +14 -0
- package/dist/index.js +802 -780
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { inject as ye, defineComponent as
|
|
2
|
-
import { useTranslate as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { useModal as ge, WxDialog as we, WxFormItem as
|
|
5
|
-
const
|
|
1
|
+
import { inject as ye, defineComponent as X, computed as U, ref as T, useTemplateRef as re, onBeforeUnmount as Ze, resolveComponent as H, openBlock as h, createBlock as V, withCtx as t, createVNode as a, withModifiers as Pe, createCommentVNode as E, createElementVNode as W, createTextVNode as m, toDisplayString as s, watch as ue, unref as e, isRef as be, normalizeClass as Fe, createElementBlock as G, resolveDynamicComponent as Oe, createSlots as Re, Fragment as ce, renderList as _e, h as Be } from "vue";
|
|
2
|
+
import { useTranslate as J, HttpError as et, useAdmin as ee, useI18n as Ee, useErrorText as ve, rowMenuWidth as tt, WxDate as ie, WxRowMenu as Ve, WxFilterChips as De, WxListScreen as Ne, useTheme as at } from "@webx-ui/module-admin";
|
|
3
|
+
import { useRouter as lt, useRoute as nt } from "vue-router";
|
|
4
|
+
import { useModal as ge, WxDialog as we, WxFormItem as K, WxInput as le, WxSelect as ne, WxSpace as oe, WxCheckbox as ze, WxText as B, WxButton as M, toast as Q, useElementWidth as xe, WxTable as ke, WxEntityCard as Ce, WxBadge as j, WxAvatar as ot, WxIcon as Z, confirm as Ie, createModal as $e, WxCard as Le, WxHeading as he, WxTabs as st, WxTab as me, WxAlert as it, WxThemeSwitch as rt } from "@webx-ui/core";
|
|
5
|
+
const Me = /* @__PURE__ */ Symbol("webx-auth");
|
|
6
6
|
function Ae() {
|
|
7
|
-
const n = ye(
|
|
7
|
+
const n = ye(Me, null);
|
|
8
8
|
if (n === null)
|
|
9
9
|
throw new Error("useAuth() was called outside a panel that installed the auth plugin.");
|
|
10
10
|
return n;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function ut(n) {
|
|
13
13
|
const u = `${n.apiPath}/auth`;
|
|
14
14
|
return {
|
|
15
15
|
async me() {
|
|
16
16
|
try {
|
|
17
17
|
return (await n.http.get(`${u}/me`)).data;
|
|
18
18
|
} catch (l) {
|
|
19
|
-
if (
|
|
19
|
+
if (dt(l))
|
|
20
20
|
return null;
|
|
21
21
|
throw l;
|
|
22
22
|
}
|
|
@@ -55,14 +55,14 @@ function it(n) {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
const
|
|
59
|
-
function
|
|
60
|
-
n.provide(
|
|
58
|
+
const He = /* @__PURE__ */ Symbol("webx-auth-avatar"), Ke = /* @__PURE__ */ Symbol("webx-auth-avatar-field");
|
|
59
|
+
function ct(n, u, l = null, o = null) {
|
|
60
|
+
n.provide(Me, u), n.provide(He, l), n.provide(Ke, o);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function dt(n) {
|
|
63
63
|
return typeof n == "object" && n !== null && "status" in n && n.status === 401;
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const mt = ["title", "aria-label", "aria-pressed"], vt = /* @__PURE__ */ X({
|
|
66
66
|
__name: "LoginCard",
|
|
67
67
|
props: {
|
|
68
68
|
emailLabel: { default: void 0 },
|
|
@@ -78,98 +78,98 @@ 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,
|
|
82
|
-
email: o.emailLabel ??
|
|
83
|
-
password: o.passwordLabel ??
|
|
84
|
-
remember: o.rememberLabel ??
|
|
85
|
-
submit: o.submitLabel ??
|
|
86
|
-
capsLock: o.capsLockWarning ??
|
|
87
|
-
reveal: o.revealLabel ??
|
|
88
|
-
hide: o.hideLabel ??
|
|
89
|
-
})),
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
() => o.throttleMessage === void 0 ?
|
|
81
|
+
const o = n, b = l, c = Ae(), z = J("webx-auth"), r = U(() => ({
|
|
82
|
+
email: o.emailLabel ?? z("card.email"),
|
|
83
|
+
password: o.passwordLabel ?? z("card.password"),
|
|
84
|
+
remember: o.rememberLabel ?? z("card.remember"),
|
|
85
|
+
submit: o.submitLabel ?? z("card.submit"),
|
|
86
|
+
capsLock: o.capsLockWarning ?? z("card.caps-lock"),
|
|
87
|
+
reveal: o.revealLabel ?? z("card.reveal"),
|
|
88
|
+
hide: o.hideLabel ?? z("card.hide")
|
|
89
|
+
})), f = T(""), F = T(""), p = T(!1), g = T(!1), w = T(!1), d = T(!1), x = T(""), y = T({}), _ = T(0), L = re("emailField");
|
|
90
|
+
let $ = null;
|
|
91
|
+
Ze(Y);
|
|
92
|
+
const O = U(() => _.value > 0), i = U(
|
|
93
|
+
() => o.throttleMessage === void 0 ? z("card.throttled", { seconds: _.value }) : o.throttleMessage.replace(":seconds", String(_.value))
|
|
94
94
|
);
|
|
95
|
-
async function
|
|
96
|
-
if (!(
|
|
97
|
-
|
|
95
|
+
async function v() {
|
|
96
|
+
if (!(g.value || O.value)) {
|
|
97
|
+
g.value = !0, x.value = "", y.value = {};
|
|
98
98
|
try {
|
|
99
99
|
await c.login({
|
|
100
|
-
email:
|
|
101
|
-
password:
|
|
102
|
-
remember:
|
|
103
|
-
}),
|
|
104
|
-
} catch (
|
|
105
|
-
|
|
100
|
+
email: f.value,
|
|
101
|
+
password: F.value,
|
|
102
|
+
remember: p.value
|
|
103
|
+
}), F.value = "", b("success");
|
|
104
|
+
} catch (k) {
|
|
105
|
+
A(k);
|
|
106
106
|
} finally {
|
|
107
|
-
|
|
107
|
+
g.value = !1;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
if (!(
|
|
113
|
-
|
|
111
|
+
function A(k) {
|
|
112
|
+
if (!(k instanceof et)) {
|
|
113
|
+
x.value = k instanceof Error ? k.message : String(k);
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
if (
|
|
117
|
-
|
|
116
|
+
if (k.isValidation) {
|
|
117
|
+
y.value = k.errors;
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
if (
|
|
121
|
-
|
|
120
|
+
if (k.isThrottled) {
|
|
121
|
+
I(k.retryAfter ?? 60);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
x.value = k.message;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
function I(k) {
|
|
127
|
+
Y(), _.value = k, $ = setInterval(() => {
|
|
128
|
+
_.value -= 1, _.value <= 0 && Y();
|
|
129
129
|
}, 1e3);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
|
|
131
|
+
function Y() {
|
|
132
|
+
$ !== null && (clearInterval($), $ = null), _.value = 0;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
|
|
134
|
+
function D(k) {
|
|
135
|
+
d.value = k.getModifierState("CapsLock");
|
|
136
136
|
}
|
|
137
|
-
return u({ focus: () =>
|
|
138
|
-
const
|
|
139
|
-
return
|
|
137
|
+
return u({ focus: () => L.value?.focus() }), (k, R) => {
|
|
138
|
+
const C = H("wx-alert"), q = H("wx-icon"), de = H("wx-input"), P = H("wx-form-item"), N = H("wx-checkbox"), S = H("wx-button"), ae = H("wx-form"), Xe = H("wx-card");
|
|
139
|
+
return h(), V(Xe, {
|
|
140
140
|
class: "wx-login",
|
|
141
141
|
padding: 24
|
|
142
142
|
}, {
|
|
143
143
|
default: t(() => [
|
|
144
144
|
a(ae, {
|
|
145
|
-
errors:
|
|
146
|
-
disabled:
|
|
145
|
+
errors: y.value,
|
|
146
|
+
disabled: g.value,
|
|
147
147
|
gap: "md",
|
|
148
|
-
onSubmit: Pe(
|
|
148
|
+
onSubmit: Pe(v, ["prevent"])
|
|
149
149
|
}, {
|
|
150
150
|
default: t(() => [
|
|
151
|
-
|
|
151
|
+
x.value !== "" ? (h(), 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"])) : O.value ? (h(), V(C, {
|
|
159
159
|
key: 1,
|
|
160
160
|
type: "warning",
|
|
161
161
|
variant: "soft",
|
|
162
162
|
live: "",
|
|
163
|
-
description:
|
|
163
|
+
description: i.value,
|
|
164
164
|
class: "wx-login__message"
|
|
165
165
|
}, null, 8, ["description"])) : E("", !0),
|
|
166
|
-
a(
|
|
166
|
+
a(P, { name: "email" }, {
|
|
167
167
|
default: t(() => [
|
|
168
|
-
a(
|
|
168
|
+
a(de, {
|
|
169
169
|
ref_key: "emailField",
|
|
170
|
-
ref:
|
|
171
|
-
modelValue:
|
|
172
|
-
"onUpdate:modelValue": R[0] || (R[0] = (se) =>
|
|
170
|
+
ref: L,
|
|
171
|
+
modelValue: f.value,
|
|
172
|
+
"onUpdate:modelValue": R[0] || (R[0] = (se) => f.value = se),
|
|
173
173
|
type: "email",
|
|
174
174
|
placeholder: r.value.email,
|
|
175
175
|
"aria-label": r.value.email,
|
|
@@ -179,31 +179,31 @@ 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"])
|
|
186
186
|
]),
|
|
187
187
|
_: 1
|
|
188
188
|
}),
|
|
189
|
-
a(
|
|
189
|
+
a(P, {
|
|
190
190
|
name: "password",
|
|
191
|
-
help:
|
|
191
|
+
help: d.value ? r.value.capsLock : void 0
|
|
192
192
|
}, {
|
|
193
193
|
default: t(() => [
|
|
194
|
-
a(
|
|
195
|
-
modelValue:
|
|
196
|
-
"onUpdate:modelValue": R[2] || (R[2] = (se) =>
|
|
194
|
+
a(de, {
|
|
195
|
+
modelValue: F.value,
|
|
196
|
+
"onUpdate:modelValue": R[2] || (R[2] = (se) => F.value = se),
|
|
197
197
|
type: w.value ? "text" : "password",
|
|
198
198
|
placeholder: r.value.password,
|
|
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
|
W("button", {
|
|
@@ -215,33 +215,33 @@ 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
|
-
], 8,
|
|
221
|
+
], 8, mt)
|
|
222
222
|
]),
|
|
223
223
|
_: 1
|
|
224
224
|
}, 8, ["modelValue", "type", "placeholder", "aria-label"])
|
|
225
225
|
]),
|
|
226
226
|
_: 1
|
|
227
227
|
}, 8, ["help"]),
|
|
228
|
-
n.remember ? (
|
|
228
|
+
n.remember ? (h(), V(N, {
|
|
229
229
|
key: 2,
|
|
230
|
-
modelValue:
|
|
231
|
-
"onUpdate:modelValue": R[3] || (R[3] = (se) =>
|
|
230
|
+
modelValue: p.value,
|
|
231
|
+
"onUpdate:modelValue": R[3] || (R[3] = (se) => p.value = se),
|
|
232
232
|
label: r.value.remember,
|
|
233
233
|
class: "wx-login__remember"
|
|
234
234
|
}, null, 8, ["modelValue", "label"])) : E("", !0),
|
|
235
|
-
a(
|
|
235
|
+
a(S, {
|
|
236
236
|
type: "primary",
|
|
237
237
|
"native-type": "submit",
|
|
238
238
|
size: "lg",
|
|
239
239
|
block: "",
|
|
240
|
-
loading:
|
|
241
|
-
disabled:
|
|
240
|
+
loading: g.value,
|
|
241
|
+
disabled: O.value
|
|
242
242
|
}, {
|
|
243
243
|
default: t(() => [
|
|
244
|
-
|
|
244
|
+
m(s(r.value.submit), 1)
|
|
245
245
|
]),
|
|
246
246
|
_: 1
|
|
247
247
|
}, 8, ["loading", "disabled"])
|
|
@@ -255,10 +255,18 @@ const ct = ["title", "aria-label", "aria-pressed"], dt = /* @__PURE__ */ Q({
|
|
|
255
255
|
}
|
|
256
256
|
}), pe = (n, u) => {
|
|
257
257
|
const l = n.__vccOpts || n;
|
|
258
|
-
for (const [o,
|
|
259
|
-
l[o] =
|
|
258
|
+
for (const [o, b] of u)
|
|
259
|
+
l[o] = b;
|
|
260
260
|
return l;
|
|
261
|
-
},
|
|
261
|
+
}, pt = /* @__PURE__ */ pe(vt, [["__scopeId", "data-v-3c206e31"]]);
|
|
262
|
+
function Ye(n) {
|
|
263
|
+
return n.types["wx-media"]?.component ?? null;
|
|
264
|
+
}
|
|
265
|
+
function je(n) {
|
|
266
|
+
const u = n.assetUrls;
|
|
267
|
+
return u ? async (l) => (await u([l]))[l] ?? null : null;
|
|
268
|
+
}
|
|
269
|
+
const Ge = {
|
|
262
270
|
card: {
|
|
263
271
|
email: "Email",
|
|
264
272
|
password: "Password",
|
|
@@ -435,10 +443,10 @@ function fe(n) {
|
|
|
435
443
|
page: o.page,
|
|
436
444
|
per_page: o.per_page
|
|
437
445
|
}
|
|
438
|
-
}).then((
|
|
446
|
+
}).then((b) => ({ ...b.meta, data: b.data })),
|
|
439
447
|
get: (o) => n.http.get(`${u}/admins/${o}`).then(l),
|
|
440
448
|
create: (o) => n.http.post(`${u}/admins`, o).then(l),
|
|
441
|
-
update: (o,
|
|
449
|
+
update: (o, b) => n.http.patch(`${u}/admins/${o}`, b).then(l),
|
|
442
450
|
remove: (o) => n.http.delete(`${u}/admins/${o}`),
|
|
443
451
|
roles: () => n.http.get(`${u}/roles`).then(l),
|
|
444
452
|
calls: (o = {}) => n.http.get(`${u}/mcp-calls`, {
|
|
@@ -449,30 +457,30 @@ function fe(n) {
|
|
|
449
457
|
page: o.page,
|
|
450
458
|
per_page: o.per_page
|
|
451
459
|
}
|
|
452
|
-
}).then((
|
|
460
|
+
}).then((b) => ({ ...b.meta, data: b.data, filters: b.filters }))
|
|
453
461
|
};
|
|
454
462
|
}
|
|
455
463
|
const Se = /* @__PURE__ */ new WeakSet();
|
|
456
464
|
function te() {
|
|
457
465
|
try {
|
|
458
466
|
const { i18n: n } = ee();
|
|
459
|
-
Se.has(n) || (n.defaults("webx-auth",
|
|
467
|
+
Se.has(n) || (n.defaults("webx-auth", Ge), Se.add(n));
|
|
460
468
|
} catch {
|
|
461
469
|
}
|
|
462
470
|
}
|
|
463
|
-
const
|
|
471
|
+
const ft = { class: "wx-admin-form" }, ht = {
|
|
464
472
|
key: 0,
|
|
465
473
|
class: "wx-admin-form__aside"
|
|
466
|
-
},
|
|
474
|
+
}, yt = { class: "wx-admin-form__fields" }, _t = /* @__PURE__ */ X({
|
|
467
475
|
__name: "AdminDialog",
|
|
468
476
|
props: {
|
|
469
477
|
admin: { default: null },
|
|
470
478
|
avatarField: { default: void 0 }
|
|
471
479
|
},
|
|
472
480
|
setup(n) {
|
|
473
|
-
const u = n, { resolve: l, dismiss: o, open:
|
|
481
|
+
const u = n, { resolve: l, dismiss: o, open: b } = ge(), c = ee(), z = fe(c), r = Ee();
|
|
474
482
|
te();
|
|
475
|
-
const
|
|
483
|
+
const f = J("webx-auth"), F = ve(), p = T([]), g = T(!1), w = T({}), d = T({
|
|
476
484
|
name: "",
|
|
477
485
|
email: "",
|
|
478
486
|
password: "",
|
|
@@ -481,81 +489,81 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
481
489
|
is_super: !1,
|
|
482
490
|
locale: null,
|
|
483
491
|
roles: []
|
|
484
|
-
}),
|
|
485
|
-
get: () =>
|
|
486
|
-
set: (
|
|
487
|
-
|
|
492
|
+
}), x = U({
|
|
493
|
+
get: () => d.value.avatar ? { path: d.value.avatar } : null,
|
|
494
|
+
set: (i) => {
|
|
495
|
+
d.value.avatar = i?.path ?? null;
|
|
488
496
|
}
|
|
489
|
-
}),
|
|
490
|
-
{ value: "auto", label:
|
|
491
|
-
...r.state.panelLocales.map((
|
|
497
|
+
}), y = U(() => u.admin !== null), _ = U(() => p.value.map((i) => ({ value: i.id, label: i.name }))), L = U(() => [
|
|
498
|
+
{ value: "auto", label: f("admins.locale-auto") },
|
|
499
|
+
...r.state.panelLocales.map((i) => ({ value: i.code, label: i.nativeName }))
|
|
492
500
|
]);
|
|
493
|
-
|
|
501
|
+
z.roles().then((i) => p.value = i), ue(
|
|
494
502
|
() => u.admin,
|
|
495
|
-
(
|
|
496
|
-
|
|
497
|
-
name:
|
|
498
|
-
email:
|
|
503
|
+
(i) => {
|
|
504
|
+
d.value = {
|
|
505
|
+
name: i?.name ?? "",
|
|
506
|
+
email: i?.email ?? "",
|
|
499
507
|
password: "",
|
|
500
|
-
avatar:
|
|
501
|
-
is_active:
|
|
502
|
-
is_super:
|
|
503
|
-
locale:
|
|
504
|
-
roles:
|
|
508
|
+
avatar: i?.avatar ?? null,
|
|
509
|
+
is_active: i?.is_active ?? !0,
|
|
510
|
+
is_super: i?.is_super ?? !1,
|
|
511
|
+
locale: i?.locale ?? "auto",
|
|
512
|
+
roles: i?.roles.map((v) => v.id) ?? []
|
|
505
513
|
}, w.value = {};
|
|
506
514
|
},
|
|
507
515
|
{ immediate: !0 }
|
|
508
516
|
);
|
|
509
|
-
function
|
|
510
|
-
return w.value[
|
|
517
|
+
function $(i) {
|
|
518
|
+
return w.value[i]?.[0];
|
|
511
519
|
}
|
|
512
|
-
async function
|
|
513
|
-
|
|
514
|
-
const
|
|
515
|
-
name:
|
|
516
|
-
email:
|
|
517
|
-
avatar:
|
|
518
|
-
is_active:
|
|
519
|
-
is_super:
|
|
520
|
-
locale:
|
|
521
|
-
roles:
|
|
520
|
+
async function O() {
|
|
521
|
+
g.value = !0, w.value = {};
|
|
522
|
+
const i = {
|
|
523
|
+
name: d.value.name,
|
|
524
|
+
email: d.value.email,
|
|
525
|
+
avatar: d.value.avatar,
|
|
526
|
+
is_active: d.value.is_active,
|
|
527
|
+
is_super: d.value.is_super,
|
|
528
|
+
locale: d.value.locale === "auto" ? null : d.value.locale,
|
|
529
|
+
roles: d.value.roles ?? []
|
|
522
530
|
};
|
|
523
|
-
|
|
531
|
+
d.value.password && (i.password = d.value.password);
|
|
524
532
|
try {
|
|
525
|
-
const
|
|
526
|
-
|
|
527
|
-
} catch (
|
|
528
|
-
const
|
|
529
|
-
|
|
533
|
+
const v = u.admin ? await z.update(u.admin.id, i) : await z.create(i);
|
|
534
|
+
Q.success(f(y.value ? "admins.updated" : "admins.created")), l(v);
|
|
535
|
+
} catch (v) {
|
|
536
|
+
const A = v.body;
|
|
537
|
+
A?.errors ? w.value = A.errors : Q.danger(F(v));
|
|
530
538
|
} finally {
|
|
531
|
-
|
|
539
|
+
g.value = !1;
|
|
532
540
|
}
|
|
533
541
|
}
|
|
534
|
-
return (
|
|
535
|
-
open: e(
|
|
536
|
-
"onUpdate:open":
|
|
537
|
-
title:
|
|
542
|
+
return (i, v) => (h(), V(e(we), {
|
|
543
|
+
open: e(b),
|
|
544
|
+
"onUpdate:open": v[9] || (v[9] = (A) => be(b) ? b.value = A : null),
|
|
545
|
+
title: y.value ? e(f)("admins.edit-short") : e(f)("admins.new-short"),
|
|
538
546
|
width: 720
|
|
539
547
|
}, {
|
|
540
548
|
footer: t(() => [
|
|
541
549
|
a(e(oe), { size: "sm" }, {
|
|
542
550
|
default: t(() => [
|
|
543
|
-
a(e(
|
|
551
|
+
a(e(M), {
|
|
544
552
|
variant: "outline",
|
|
545
|
-
onClick:
|
|
553
|
+
onClick: v[8] || (v[8] = (A) => e(o)())
|
|
546
554
|
}, {
|
|
547
555
|
default: t(() => [
|
|
548
|
-
|
|
556
|
+
m(s(e(f)("admins.cancel")), 1)
|
|
549
557
|
]),
|
|
550
558
|
_: 1
|
|
551
559
|
}),
|
|
552
|
-
a(e(
|
|
560
|
+
a(e(M), {
|
|
553
561
|
type: "primary",
|
|
554
|
-
loading:
|
|
555
|
-
onClick:
|
|
562
|
+
loading: g.value,
|
|
563
|
+
onClick: O
|
|
556
564
|
}, {
|
|
557
565
|
default: t(() => [
|
|
558
|
-
|
|
566
|
+
m(s(e(f)("admins.save")), 1)
|
|
559
567
|
]),
|
|
560
568
|
_: 1
|
|
561
569
|
}, 8, ["loading"])
|
|
@@ -564,39 +572,41 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
564
572
|
})
|
|
565
573
|
]),
|
|
566
574
|
default: t(() => [
|
|
567
|
-
W("div",
|
|
568
|
-
W("div",
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
575
|
+
W("div", ft, [
|
|
576
|
+
W("div", {
|
|
577
|
+
class: Fe(["wx-admin-form__grid", { "has-aside": n.avatarField }])
|
|
578
|
+
}, [
|
|
579
|
+
n.avatarField ? (h(), G("div", ht, [
|
|
580
|
+
(h(), V(Oe(n.avatarField), {
|
|
581
|
+
modelValue: x.value,
|
|
582
|
+
"onUpdate:modelValue": v[0] || (v[0] = (A) => x.value = A),
|
|
583
|
+
label: e(f)("admins.avatar"),
|
|
574
584
|
aspect: "1/1",
|
|
575
585
|
captions: !1
|
|
576
586
|
}, null, 8, ["modelValue", "label"]))
|
|
577
587
|
])) : E("", !0),
|
|
578
|
-
W("div",
|
|
579
|
-
a(e(
|
|
580
|
-
label: e(
|
|
581
|
-
error:
|
|
588
|
+
W("div", yt, [
|
|
589
|
+
a(e(K), {
|
|
590
|
+
label: e(f)("admins.name"),
|
|
591
|
+
error: $("name")
|
|
582
592
|
}, {
|
|
583
593
|
default: t(() => [
|
|
584
594
|
a(e(le), {
|
|
585
|
-
modelValue:
|
|
586
|
-
"onUpdate:modelValue":
|
|
595
|
+
modelValue: d.value.name,
|
|
596
|
+
"onUpdate:modelValue": v[1] || (v[1] = (A) => d.value.name = A),
|
|
587
597
|
name: "name"
|
|
588
598
|
}, null, 8, ["modelValue"])
|
|
589
599
|
]),
|
|
590
600
|
_: 1
|
|
591
601
|
}, 8, ["label", "error"]),
|
|
592
|
-
a(e(
|
|
593
|
-
label: e(
|
|
594
|
-
error:
|
|
602
|
+
a(e(K), {
|
|
603
|
+
label: e(f)("admins.email"),
|
|
604
|
+
error: $("email")
|
|
595
605
|
}, {
|
|
596
606
|
default: t(() => [
|
|
597
607
|
a(e(le), {
|
|
598
|
-
modelValue:
|
|
599
|
-
"onUpdate:modelValue":
|
|
608
|
+
modelValue: d.value.email,
|
|
609
|
+
"onUpdate:modelValue": v[2] || (v[2] = (A) => d.value.email = A),
|
|
600
610
|
type: "email",
|
|
601
611
|
name: "email",
|
|
602
612
|
autocomplete: "off"
|
|
@@ -604,15 +614,15 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
604
614
|
]),
|
|
605
615
|
_: 1
|
|
606
616
|
}, 8, ["label", "error"]),
|
|
607
|
-
a(e(
|
|
608
|
-
label: e(
|
|
609
|
-
error:
|
|
610
|
-
help:
|
|
617
|
+
a(e(K), {
|
|
618
|
+
label: e(f)("admins.password"),
|
|
619
|
+
error: $("password"),
|
|
620
|
+
help: y.value ? e(f)("admins.password-keep") : e(f)("admins.password-hint")
|
|
611
621
|
}, {
|
|
612
622
|
default: t(() => [
|
|
613
623
|
a(e(le), {
|
|
614
|
-
modelValue:
|
|
615
|
-
"onUpdate:modelValue":
|
|
624
|
+
modelValue: d.value.password,
|
|
625
|
+
"onUpdate:modelValue": v[3] || (v[3] = (A) => d.value.password = A),
|
|
616
626
|
type: "password",
|
|
617
627
|
name: "password",
|
|
618
628
|
autocomplete: "new-password"
|
|
@@ -620,28 +630,28 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
620
630
|
]),
|
|
621
631
|
_: 1
|
|
622
632
|
}, 8, ["label", "error", "help"]),
|
|
623
|
-
a(e(
|
|
624
|
-
label: e(
|
|
625
|
-
error:
|
|
633
|
+
a(e(K), {
|
|
634
|
+
label: e(f)("admins.roles"),
|
|
635
|
+
error: $("roles")
|
|
626
636
|
}, {
|
|
627
637
|
default: t(() => [
|
|
628
638
|
a(e(ne), {
|
|
629
|
-
modelValue:
|
|
630
|
-
"onUpdate:modelValue":
|
|
631
|
-
options:
|
|
639
|
+
modelValue: d.value.roles,
|
|
640
|
+
"onUpdate:modelValue": v[4] || (v[4] = (A) => d.value.roles = A),
|
|
641
|
+
options: _.value,
|
|
632
642
|
multiple: ""
|
|
633
643
|
}, null, 8, ["modelValue", "options"])
|
|
634
644
|
]),
|
|
635
645
|
_: 1
|
|
636
646
|
}, 8, ["label", "error"]),
|
|
637
|
-
a(e(
|
|
638
|
-
label: e(
|
|
647
|
+
a(e(K), {
|
|
648
|
+
label: e(f)("admins.locale")
|
|
639
649
|
}, {
|
|
640
650
|
default: t(() => [
|
|
641
651
|
a(e(ne), {
|
|
642
|
-
modelValue:
|
|
643
|
-
"onUpdate:modelValue":
|
|
644
|
-
options:
|
|
652
|
+
modelValue: d.value.locale,
|
|
653
|
+
"onUpdate:modelValue": v[5] || (v[5] = (A) => d.value.locale = A),
|
|
654
|
+
options: L.value
|
|
645
655
|
}, null, 8, ["modelValue", "options"])
|
|
646
656
|
]),
|
|
647
657
|
_: 1
|
|
@@ -649,14 +659,14 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
649
659
|
a(e(oe), { size: "md" }, {
|
|
650
660
|
default: t(() => [
|
|
651
661
|
a(e(ze), {
|
|
652
|
-
modelValue:
|
|
653
|
-
"onUpdate:modelValue":
|
|
654
|
-
label: e(
|
|
662
|
+
modelValue: d.value.is_active,
|
|
663
|
+
"onUpdate:modelValue": v[6] || (v[6] = (A) => d.value.is_active = A),
|
|
664
|
+
label: e(f)("admins.active")
|
|
655
665
|
}, null, 8, ["modelValue", "label"]),
|
|
656
666
|
a(e(ze), {
|
|
657
|
-
modelValue:
|
|
658
|
-
"onUpdate:modelValue":
|
|
659
|
-
label: e(
|
|
667
|
+
modelValue: d.value.is_super,
|
|
668
|
+
"onUpdate:modelValue": v[7] || (v[7] = (A) => d.value.is_super = A),
|
|
669
|
+
label: e(f)("admins.super")
|
|
660
670
|
}, null, 8, ["modelValue", "label"])
|
|
661
671
|
]),
|
|
662
672
|
_: 1
|
|
@@ -666,18 +676,18 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
666
676
|
tone: "muted"
|
|
667
677
|
}, {
|
|
668
678
|
default: t(() => [
|
|
669
|
-
|
|
679
|
+
m(s(e(f)("admins.super-hint")), 1)
|
|
670
680
|
]),
|
|
671
681
|
_: 1
|
|
672
682
|
})
|
|
673
683
|
])
|
|
674
|
-
])
|
|
684
|
+
], 2)
|
|
675
685
|
])
|
|
676
686
|
]),
|
|
677
687
|
_: 1
|
|
678
688
|
}, 8, ["open", "title"]));
|
|
679
689
|
}
|
|
680
|
-
}), We = 480,
|
|
690
|
+
}), We = 480, Je = /* @__PURE__ */ X({
|
|
681
691
|
__name: "AdminList",
|
|
682
692
|
props: {
|
|
683
693
|
picking: { type: Boolean, default: !1 },
|
|
@@ -688,40 +698,40 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
688
698
|
},
|
|
689
699
|
emits: ["open", "chosen", "selection", "remove"],
|
|
690
700
|
setup(n, { expose: u, emit: l }) {
|
|
691
|
-
const o = n,
|
|
701
|
+
const o = n, b = l, c = ee(), z = fe(c);
|
|
692
702
|
te();
|
|
693
|
-
const r = re("root"),
|
|
694
|
-
let
|
|
695
|
-
const
|
|
696
|
-
{ value: "all", label:
|
|
697
|
-
...
|
|
698
|
-
]),
|
|
699
|
-
{ value: "any", label:
|
|
700
|
-
{ value: "yes", label:
|
|
701
|
-
{ value: "no", label:
|
|
702
|
-
]),
|
|
703
|
-
const
|
|
704
|
-
return N &&
|
|
703
|
+
const r = re("root"), f = xe(r), F = U(() => f.value > 0 && f.value < We), p = J("webx-auth"), g = J("webx-admin"), w = T(null), d = T([]), x = T(!1), y = T("all"), _ = T("any"), L = T([]), $ = T({});
|
|
704
|
+
let O = { page: 1, perPage: 20, sort: null, search: "" };
|
|
705
|
+
const i = U(() => [
|
|
706
|
+
{ value: "all", label: p("admins.all-roles") },
|
|
707
|
+
...d.value.map((P) => ({ value: P.slug, label: P.name }))
|
|
708
|
+
]), v = U(() => [
|
|
709
|
+
{ value: "any", label: p("admins.any-state") },
|
|
710
|
+
{ value: "yes", label: p("admins.only-active") },
|
|
711
|
+
{ value: "no", label: p("admins.only-inactive") }
|
|
712
|
+
]), A = U(() => {
|
|
713
|
+
const P = [], N = d.value.find((S) => S.slug === y.value);
|
|
714
|
+
return N && P.push({
|
|
705
715
|
key: "role",
|
|
706
|
-
label: `${
|
|
707
|
-
clear: () =>
|
|
708
|
-
}),
|
|
716
|
+
label: `${p("admins.filter-role")}: ${N.name}`,
|
|
717
|
+
clear: () => y.value = "all"
|
|
718
|
+
}), _.value !== "any" && P.push({
|
|
709
719
|
key: "state",
|
|
710
|
-
label: `${
|
|
711
|
-
clear: () =>
|
|
712
|
-
}),
|
|
720
|
+
label: `${p("admins.filter-state")}: ${_.value === "yes" ? p("admins.only-active") : p("admins.only-inactive")}`,
|
|
721
|
+
clear: () => _.value = "any"
|
|
722
|
+
}), P;
|
|
713
723
|
});
|
|
714
|
-
function
|
|
715
|
-
|
|
724
|
+
function I() {
|
|
725
|
+
y.value = "all", _.value = "any";
|
|
716
726
|
}
|
|
717
|
-
const
|
|
718
|
-
{ key: "name", label:
|
|
719
|
-
{ key: "email", label:
|
|
720
|
-
{ key: "roles", label:
|
|
721
|
-
{ key: "is_active", label:
|
|
727
|
+
const Y = U(() => F.value ? [{ key: "card", label: "" }] : [
|
|
728
|
+
{ key: "name", label: p("admins.name"), sortable: !0 },
|
|
729
|
+
{ key: "email", label: p("admins.email"), sortable: !0, hideBelow: 560 },
|
|
730
|
+
{ key: "roles", label: p("admins.roles"), hideBelow: 760 },
|
|
731
|
+
{ key: "is_active", label: p("admins.active"), align: "center", hideBelow: 660 },
|
|
722
732
|
{
|
|
723
733
|
key: "last_login_at",
|
|
724
|
-
label:
|
|
734
|
+
label: p("admins.last-login"),
|
|
725
735
|
sortable: !0,
|
|
726
736
|
hideBelow: 900,
|
|
727
737
|
// The first thing to go when a row becomes a card: it is a date somebody scans down a
|
|
@@ -731,104 +741,104 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
731
741
|
{
|
|
732
742
|
key: "actions",
|
|
733
743
|
label: "",
|
|
734
|
-
width:
|
|
744
|
+
width: tt,
|
|
735
745
|
align: "right",
|
|
736
746
|
hidden: !o.removable,
|
|
737
747
|
// A card puts them along its top instead, through the `card-actions` slot.
|
|
738
748
|
hideOnCards: !0
|
|
739
749
|
}
|
|
740
750
|
]);
|
|
741
|
-
|
|
742
|
-
async function
|
|
743
|
-
|
|
751
|
+
z.roles().then((P) => d.value = P), ue([y, _], () => D(O));
|
|
752
|
+
async function D(P) {
|
|
753
|
+
O = P, x.value = !0;
|
|
744
754
|
try {
|
|
745
|
-
w.value = await
|
|
746
|
-
q:
|
|
747
|
-
role:
|
|
748
|
-
active:
|
|
749
|
-
sort:
|
|
750
|
-
page:
|
|
751
|
-
per_page:
|
|
752
|
-
}),
|
|
755
|
+
w.value = await z.list({
|
|
756
|
+
q: P.search,
|
|
757
|
+
role: y.value === "all" ? null : y.value,
|
|
758
|
+
active: _.value === "any" ? null : _.value,
|
|
759
|
+
sort: P.sort ? `${P.sort.order === "desc" ? "-" : ""}${P.sort.key}` : "name",
|
|
760
|
+
page: P.page,
|
|
761
|
+
per_page: P.perPage
|
|
762
|
+
}), k();
|
|
753
763
|
} finally {
|
|
754
|
-
|
|
764
|
+
x.value = !1;
|
|
755
765
|
}
|
|
756
766
|
}
|
|
757
|
-
async function
|
|
758
|
-
const
|
|
759
|
-
if (
|
|
767
|
+
async function k() {
|
|
768
|
+
const P = o.resolveAvatar;
|
|
769
|
+
if (P)
|
|
760
770
|
for (const N of w.value?.data ?? []) {
|
|
761
|
-
if (!N.avatar ||
|
|
762
|
-
const
|
|
763
|
-
|
|
771
|
+
if (!N.avatar || $.value[N.avatar]) continue;
|
|
772
|
+
const S = await P(N.avatar);
|
|
773
|
+
S && ($.value = { ...$.value, [N.avatar]: S });
|
|
764
774
|
}
|
|
765
775
|
}
|
|
766
|
-
function R(
|
|
776
|
+
function R(P) {
|
|
767
777
|
return [
|
|
768
778
|
{
|
|
769
779
|
key: "delete",
|
|
770
780
|
icon: "trash",
|
|
771
|
-
label:
|
|
781
|
+
label: p("admins.delete"),
|
|
772
782
|
danger: !0,
|
|
773
|
-
run: () =>
|
|
783
|
+
run: () => b("remove", P)
|
|
774
784
|
}
|
|
775
785
|
];
|
|
776
786
|
}
|
|
777
|
-
function
|
|
787
|
+
function C(P) {
|
|
778
788
|
if (o.picking) {
|
|
779
|
-
|
|
789
|
+
b("chosen", [P]);
|
|
780
790
|
return;
|
|
781
791
|
}
|
|
782
|
-
|
|
792
|
+
b("open", P);
|
|
783
793
|
}
|
|
784
|
-
const
|
|
785
|
-
function
|
|
786
|
-
|
|
794
|
+
const q = U(() => !(o.picking && o.multiple));
|
|
795
|
+
function de(P, N) {
|
|
796
|
+
L.value = N, b("selection", N);
|
|
787
797
|
}
|
|
788
|
-
return u({ reload: () =>
|
|
798
|
+
return u({ reload: () => D(O), chosen: () => L.value }), (P, N) => (h(), G("div", {
|
|
789
799
|
ref_key: "root",
|
|
790
800
|
ref: r,
|
|
791
801
|
class: "wx-admin-list"
|
|
792
802
|
}, [
|
|
793
803
|
a(e(ke), {
|
|
794
804
|
data: w.value,
|
|
795
|
-
columns:
|
|
805
|
+
columns: Y.value,
|
|
796
806
|
"row-key": "id",
|
|
797
807
|
searchable: "",
|
|
798
|
-
clickable:
|
|
799
|
-
hover:
|
|
808
|
+
clickable: q.value,
|
|
809
|
+
hover: q.value,
|
|
800
810
|
flush: "",
|
|
801
|
-
loading:
|
|
802
|
-
"search-placeholder": e(
|
|
803
|
-
"empty-text": e(
|
|
811
|
+
loading: x.value,
|
|
812
|
+
"search-placeholder": e(p)("admins.search"),
|
|
813
|
+
"empty-text": e(p)("admins.empty"),
|
|
804
814
|
selectable: n.picking && n.multiple,
|
|
805
|
-
"select-row-label": e(
|
|
806
|
-
"select-all-label": e(
|
|
815
|
+
"select-row-label": e(g)("filters.select-row"),
|
|
816
|
+
"select-all-label": e(g)("filters.select-all"),
|
|
807
817
|
"cards-below": We,
|
|
808
|
-
"filters-count":
|
|
809
|
-
"filters-label": e(
|
|
810
|
-
onRowClick:
|
|
811
|
-
onStateChange:
|
|
812
|
-
onSelectionChange:
|
|
813
|
-
},
|
|
814
|
-
"cell-name": t(({ row:
|
|
818
|
+
"filters-count": A.value.length,
|
|
819
|
+
"filters-label": e(g)("filters.title"),
|
|
820
|
+
onRowClick: C,
|
|
821
|
+
onStateChange: D,
|
|
822
|
+
onSelectionChange: de
|
|
823
|
+
}, Re({
|
|
824
|
+
"cell-name": t(({ row: S }) => [
|
|
815
825
|
a(e(oe), {
|
|
816
826
|
size: "sm",
|
|
817
827
|
align: "center"
|
|
818
828
|
}, {
|
|
819
829
|
default: t(() => [
|
|
820
|
-
a(e(
|
|
821
|
-
name:
|
|
822
|
-
src:
|
|
830
|
+
a(e(ot), {
|
|
831
|
+
name: S.name,
|
|
832
|
+
src: S.avatar ? $.value[S.avatar] : void 0,
|
|
823
833
|
size: "sm"
|
|
824
834
|
}, null, 8, ["name", "src"]),
|
|
825
|
-
W("span", null,
|
|
826
|
-
|
|
835
|
+
W("span", null, s(S.name), 1),
|
|
836
|
+
S.is_super ? (h(), V(e(j), {
|
|
827
837
|
key: 0,
|
|
828
838
|
type: "warning"
|
|
829
839
|
}, {
|
|
830
840
|
default: t(() => [
|
|
831
|
-
|
|
841
|
+
m(s(e(p)("admins.super")), 1)
|
|
832
842
|
]),
|
|
833
843
|
_: 1
|
|
834
844
|
})) : E("", !0)
|
|
@@ -836,100 +846,100 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
836
846
|
_: 2
|
|
837
847
|
}, 1024)
|
|
838
848
|
]),
|
|
839
|
-
"cell-roles": t(({ row:
|
|
840
|
-
|
|
849
|
+
"cell-roles": t(({ row: S }) => [
|
|
850
|
+
S.roles.length > 0 ? (h(), V(e(oe), {
|
|
841
851
|
key: 0,
|
|
842
852
|
size: "xs",
|
|
843
853
|
wrap: ""
|
|
844
854
|
}, {
|
|
845
855
|
default: t(() => [
|
|
846
|
-
(
|
|
856
|
+
(h(!0), G(ce, null, _e(S.roles, (ae) => (h(), V(e(j), {
|
|
847
857
|
key: ae.id
|
|
848
858
|
}, {
|
|
849
859
|
default: t(() => [
|
|
850
|
-
|
|
860
|
+
m(s(ae.name), 1)
|
|
851
861
|
]),
|
|
852
862
|
_: 2
|
|
853
863
|
}, 1024))), 128))
|
|
854
864
|
]),
|
|
855
865
|
_: 2
|
|
856
|
-
}, 1024)) : (
|
|
866
|
+
}, 1024)) : (h(), V(e(B), {
|
|
857
867
|
key: 1,
|
|
858
868
|
size: "sm",
|
|
859
869
|
tone: "muted"
|
|
860
870
|
}, {
|
|
861
871
|
default: t(() => [
|
|
862
|
-
|
|
872
|
+
m(s(e(p)("admins.no-roles")), 1)
|
|
863
873
|
]),
|
|
864
874
|
_: 1
|
|
865
875
|
}))
|
|
866
876
|
]),
|
|
867
|
-
"cell-is_active": t(({ row:
|
|
868
|
-
a(e(
|
|
869
|
-
type:
|
|
877
|
+
"cell-is_active": t(({ row: S }) => [
|
|
878
|
+
a(e(j), {
|
|
879
|
+
type: S.is_active ? "success" : "default",
|
|
870
880
|
dot: ""
|
|
871
881
|
}, {
|
|
872
882
|
default: t(() => [
|
|
873
|
-
|
|
883
|
+
m(s(S.is_active ? e(p)("admins.active") : e(p)("admins.only-inactive")), 1)
|
|
874
884
|
]),
|
|
875
885
|
_: 2
|
|
876
886
|
}, 1032, ["type"])
|
|
877
887
|
]),
|
|
878
|
-
"card-actions": t(({ row:
|
|
879
|
-
n.removable ? (
|
|
888
|
+
"card-actions": t(({ row: S }) => [
|
|
889
|
+
n.removable ? (h(), V(e(Ve), {
|
|
880
890
|
key: 0,
|
|
881
|
-
actions: R(
|
|
882
|
-
label:
|
|
891
|
+
actions: R(S),
|
|
892
|
+
label: S.name
|
|
883
893
|
}, null, 8, ["actions", "label"])) : E("", !0)
|
|
884
894
|
]),
|
|
885
|
-
"cell-actions": t(({ row:
|
|
895
|
+
"cell-actions": t(({ row: S }) => [
|
|
886
896
|
a(e(Ve), {
|
|
887
|
-
actions: R(
|
|
888
|
-
label:
|
|
897
|
+
actions: R(S),
|
|
898
|
+
label: S.name
|
|
889
899
|
}, null, 8, ["actions", "label"])
|
|
890
900
|
]),
|
|
891
|
-
"cell-last_login_at": t(({ row:
|
|
901
|
+
"cell-last_login_at": t(({ row: S }) => [
|
|
892
902
|
a(e(ie), {
|
|
893
|
-
value:
|
|
894
|
-
tone:
|
|
903
|
+
value: S.last_login_at,
|
|
904
|
+
tone: S.last_login_at ? "default" : "muted",
|
|
895
905
|
compact: ""
|
|
896
906
|
}, null, 8, ["value", "tone"])
|
|
897
907
|
]),
|
|
898
|
-
"cell-card": t(({ row:
|
|
908
|
+
"cell-card": t(({ row: S }) => [
|
|
899
909
|
a(e(Ce), {
|
|
900
910
|
variant: "plain",
|
|
901
911
|
shape: "circle",
|
|
902
|
-
title:
|
|
903
|
-
image:
|
|
904
|
-
subtitle:
|
|
912
|
+
title: S.name,
|
|
913
|
+
image: S.avatar ? $.value[S.avatar] : void 0,
|
|
914
|
+
subtitle: S.email
|
|
905
915
|
}, {
|
|
906
916
|
meta: t(() => [
|
|
907
|
-
|
|
917
|
+
S.is_super ? (h(), V(e(j), {
|
|
908
918
|
key: 0,
|
|
909
919
|
type: "warning",
|
|
910
920
|
size: "sm"
|
|
911
921
|
}, {
|
|
912
922
|
default: t(() => [
|
|
913
|
-
|
|
923
|
+
m(s(e(p)("admins.super")), 1)
|
|
914
924
|
]),
|
|
915
925
|
_: 1
|
|
916
926
|
})) : E("", !0),
|
|
917
|
-
(
|
|
927
|
+
(h(!0), G(ce, null, _e(S.roles, (ae) => (h(), V(e(j), {
|
|
918
928
|
key: ae.id,
|
|
919
929
|
size: "sm"
|
|
920
930
|
}, {
|
|
921
931
|
default: t(() => [
|
|
922
|
-
|
|
932
|
+
m(s(ae.name), 1)
|
|
923
933
|
]),
|
|
924
934
|
_: 2
|
|
925
935
|
}, 1024))), 128)),
|
|
926
|
-
a(e(
|
|
927
|
-
type:
|
|
936
|
+
a(e(j), {
|
|
937
|
+
type: S.is_active ? "success" : "default",
|
|
928
938
|
dot: "",
|
|
929
939
|
size: "sm"
|
|
930
940
|
}, {
|
|
931
941
|
default: t(() => [
|
|
932
|
-
|
|
942
|
+
m(s(S.is_active ? e(p)("admins.active") : e(p)("admins.only-inactive")), 1)
|
|
933
943
|
]),
|
|
934
944
|
_: 2
|
|
935
945
|
}, 1032, ["type"])
|
|
@@ -942,44 +952,44 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
942
952
|
n.filters ? {
|
|
943
953
|
name: "filters",
|
|
944
954
|
fn: t(() => [
|
|
945
|
-
a(e(
|
|
946
|
-
label: e(
|
|
955
|
+
a(e(K), {
|
|
956
|
+
label: e(p)("admins.filter-role")
|
|
947
957
|
}, {
|
|
948
958
|
default: t(() => [
|
|
949
959
|
a(e(ne), {
|
|
950
|
-
modelValue:
|
|
951
|
-
"onUpdate:modelValue": N[0] || (N[0] = (
|
|
952
|
-
options:
|
|
960
|
+
modelValue: y.value,
|
|
961
|
+
"onUpdate:modelValue": N[0] || (N[0] = (S) => y.value = S),
|
|
962
|
+
options: i.value,
|
|
953
963
|
size: "sm"
|
|
954
964
|
}, null, 8, ["modelValue", "options"])
|
|
955
965
|
]),
|
|
956
966
|
_: 1
|
|
957
967
|
}, 8, ["label"]),
|
|
958
|
-
a(e(
|
|
959
|
-
label: e(
|
|
968
|
+
a(e(K), {
|
|
969
|
+
label: e(p)("admins.filter-state")
|
|
960
970
|
}, {
|
|
961
971
|
default: t(() => [
|
|
962
972
|
a(e(ne), {
|
|
963
|
-
modelValue:
|
|
964
|
-
"onUpdate:modelValue": N[1] || (N[1] = (
|
|
965
|
-
options:
|
|
973
|
+
modelValue: _.value,
|
|
974
|
+
"onUpdate:modelValue": N[1] || (N[1] = (S) => _.value = S),
|
|
975
|
+
options: v.value,
|
|
966
976
|
size: "sm"
|
|
967
977
|
}, null, 8, ["modelValue", "options"])
|
|
968
978
|
]),
|
|
969
979
|
_: 1
|
|
970
980
|
}, 8, ["label"]),
|
|
971
|
-
|
|
981
|
+
A.value.length > 0 ? (h(), V(e(M), {
|
|
972
982
|
key: 0,
|
|
973
983
|
variant: "text",
|
|
974
984
|
size: "sm",
|
|
975
985
|
block: "",
|
|
976
|
-
onClick:
|
|
986
|
+
onClick: I
|
|
977
987
|
}, {
|
|
978
988
|
icon: t(() => [
|
|
979
989
|
a(e(Z), { name: "close" })
|
|
980
990
|
]),
|
|
981
991
|
default: t(() => [
|
|
982
|
-
|
|
992
|
+
m(" " + s(e(g)("filters.reset")), 1)
|
|
983
993
|
]),
|
|
984
994
|
_: 1
|
|
985
995
|
})) : E("", !0)
|
|
@@ -989,68 +999,68 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
989
999
|
n.filters ? {
|
|
990
1000
|
name: "applied",
|
|
991
1001
|
fn: t(() => [
|
|
992
|
-
a(e(
|
|
1002
|
+
a(e(De), { filters: A.value }, null, 8, ["filters"])
|
|
993
1003
|
]),
|
|
994
1004
|
key: "1"
|
|
995
1005
|
} : void 0
|
|
996
1006
|
]), 1032, ["data", "columns", "clickable", "hover", "loading", "search-placeholder", "empty-text", "selectable", "select-row-label", "select-all-label", "filters-count", "filters-label"])
|
|
997
1007
|
], 512));
|
|
998
1008
|
}
|
|
999
|
-
}),
|
|
1009
|
+
}), bt = { class: "wx-call-list__details" }, gt = {
|
|
1000
1010
|
key: 1,
|
|
1001
1011
|
class: "wx-call-list__arguments"
|
|
1002
|
-
},
|
|
1012
|
+
}, wt = {
|
|
1003
1013
|
class: "wx-call-list__glyph",
|
|
1004
1014
|
"aria-hidden": "true"
|
|
1005
|
-
},
|
|
1015
|
+
}, xt = {
|
|
1006
1016
|
key: 1,
|
|
1007
1017
|
class: "wx-call-list__arguments"
|
|
1008
|
-
}, Te = 480,
|
|
1018
|
+
}, Te = 480, kt = /* @__PURE__ */ X({
|
|
1009
1019
|
__name: "CallList",
|
|
1010
1020
|
setup(n, { expose: u }) {
|
|
1011
1021
|
const l = ee(), o = fe(l);
|
|
1012
1022
|
te();
|
|
1013
|
-
const
|
|
1014
|
-
let
|
|
1015
|
-
function
|
|
1016
|
-
return
|
|
1023
|
+
const b = re("root"), c = xe(b), z = U(() => c.value > 0 && c.value < Te), r = J("webx-auth"), f = J("webx-admin"), F = T(null), p = T({ users: [], tools: [] }), g = T(!1), w = T("all"), d = T("all"), x = T("any");
|
|
1024
|
+
let y = { page: 1, perPage: 30, sort: null, search: "" };
|
|
1025
|
+
function _(k) {
|
|
1026
|
+
return k === null ? r("calls.local") : k.name ?? r("calls.deleted", { id: k.id });
|
|
1017
1027
|
}
|
|
1018
|
-
const
|
|
1028
|
+
const L = U(() => [
|
|
1019
1029
|
{ value: "all", label: r("calls.everybody") },
|
|
1020
|
-
...
|
|
1021
|
-
value:
|
|
1022
|
-
label:
|
|
1030
|
+
...p.value.users.map((k) => ({
|
|
1031
|
+
value: k.id === null ? "none" : String(k.id),
|
|
1032
|
+
label: _(k.id === null ? null : { id: k.id, name: k.name })
|
|
1023
1033
|
}))
|
|
1024
|
-
]),
|
|
1034
|
+
]), $ = U(() => [
|
|
1025
1035
|
{ value: "all", label: r("calls.all-tools") },
|
|
1026
|
-
...
|
|
1027
|
-
]),
|
|
1036
|
+
...p.value.tools.map((k) => ({ value: k, label: k }))
|
|
1037
|
+
]), O = U(() => [
|
|
1028
1038
|
{ value: "any", label: r("calls.any-outcome") },
|
|
1029
1039
|
{ value: "ok", label: r("calls.only-answered") },
|
|
1030
1040
|
{ value: "failed", label: r("calls.only-refused") },
|
|
1031
1041
|
{ value: "dry", label: r("calls.only-dry") }
|
|
1032
|
-
]),
|
|
1033
|
-
const
|
|
1034
|
-
w.value !== "all" && R &&
|
|
1042
|
+
]), i = U(() => {
|
|
1043
|
+
const k = [], R = L.value.find((q) => q.value === w.value);
|
|
1044
|
+
w.value !== "all" && R && k.push({
|
|
1035
1045
|
key: "user",
|
|
1036
1046
|
label: `${r("calls.filter-user")}: ${R.label}`,
|
|
1037
1047
|
clear: () => w.value = "all"
|
|
1038
|
-
}),
|
|
1048
|
+
}), d.value !== "all" && k.push({
|
|
1039
1049
|
key: "tool",
|
|
1040
|
-
label: `${r("calls.filter-tool")}: ${
|
|
1041
|
-
clear: () =>
|
|
1050
|
+
label: `${r("calls.filter-tool")}: ${d.value}`,
|
|
1051
|
+
clear: () => d.value = "all"
|
|
1042
1052
|
});
|
|
1043
|
-
const
|
|
1044
|
-
return
|
|
1053
|
+
const C = O.value.find((q) => q.value === x.value);
|
|
1054
|
+
return x.value !== "any" && C && k.push({
|
|
1045
1055
|
key: "outcome",
|
|
1046
|
-
label: `${r("calls.filter-outcome")}: ${
|
|
1047
|
-
clear: () =>
|
|
1048
|
-
}),
|
|
1056
|
+
label: `${r("calls.filter-outcome")}: ${C.label}`,
|
|
1057
|
+
clear: () => x.value = "any"
|
|
1058
|
+
}), k;
|
|
1049
1059
|
});
|
|
1050
|
-
function
|
|
1051
|
-
w.value = "all",
|
|
1060
|
+
function v() {
|
|
1061
|
+
w.value = "all", d.value = "all", x.value = "any";
|
|
1052
1062
|
}
|
|
1053
|
-
const
|
|
1063
|
+
const A = U(() => z.value ? [{ key: "card", label: "" }] : [
|
|
1054
1064
|
{ key: "at", label: r("calls.when") },
|
|
1055
1065
|
{ key: "user", label: r("calls.who"), hideBelow: 640 },
|
|
1056
1066
|
{ key: "tool", label: r("calls.tool") },
|
|
@@ -1058,258 +1068,258 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1058
1068
|
{ key: "duration_ms", label: r("calls.took"), align: "right", hideBelow: 820 },
|
|
1059
1069
|
{ key: "client", label: r("calls.client"), hideBelow: 960 }
|
|
1060
1070
|
]);
|
|
1061
|
-
ue([w,
|
|
1062
|
-
async function
|
|
1063
|
-
|
|
1071
|
+
ue([w, d, x], () => I({ ...y, page: 1 }));
|
|
1072
|
+
async function I(k) {
|
|
1073
|
+
y = k, g.value = !0;
|
|
1064
1074
|
try {
|
|
1065
|
-
|
|
1075
|
+
F.value = await o.calls({
|
|
1066
1076
|
user: w.value === "all" ? null : w.value,
|
|
1067
|
-
tool:
|
|
1068
|
-
outcome:
|
|
1069
|
-
page:
|
|
1070
|
-
per_page:
|
|
1071
|
-
}),
|
|
1077
|
+
tool: d.value === "all" ? null : d.value,
|
|
1078
|
+
outcome: x.value === "any" ? null : x.value,
|
|
1079
|
+
page: k.page,
|
|
1080
|
+
per_page: k.perPage
|
|
1081
|
+
}), p.value = F.value.filters;
|
|
1072
1082
|
} finally {
|
|
1073
|
-
|
|
1083
|
+
g.value = !1;
|
|
1074
1084
|
}
|
|
1075
1085
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return
|
|
1086
|
+
function Y(k) {
|
|
1087
|
+
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
1088
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return
|
|
1089
|
+
function D(k) {
|
|
1090
|
+
return k.arguments !== null || k.error !== null;
|
|
1081
1091
|
}
|
|
1082
|
-
return u({ reload: () =>
|
|
1092
|
+
return u({ reload: () => I(y) }), (k, R) => (h(), G("div", {
|
|
1083
1093
|
ref_key: "root",
|
|
1084
|
-
ref:
|
|
1094
|
+
ref: b,
|
|
1085
1095
|
class: "wx-call-list"
|
|
1086
1096
|
}, [
|
|
1087
1097
|
a(e(ke), {
|
|
1088
|
-
data:
|
|
1089
|
-
columns:
|
|
1098
|
+
data: F.value,
|
|
1099
|
+
columns: A.value,
|
|
1090
1100
|
"row-key": "id",
|
|
1091
1101
|
flush: "",
|
|
1092
|
-
loading:
|
|
1102
|
+
loading: g.value,
|
|
1093
1103
|
clickable: !1,
|
|
1094
|
-
expandable: !
|
|
1095
|
-
"expandable-if":
|
|
1104
|
+
expandable: !z.value,
|
|
1105
|
+
"expandable-if": D,
|
|
1096
1106
|
"empty-text": e(r)("calls.empty"),
|
|
1097
1107
|
"cards-below": Te,
|
|
1098
|
-
"filters-count":
|
|
1099
|
-
"filters-label": e(
|
|
1100
|
-
onStateChange:
|
|
1108
|
+
"filters-count": i.value.length,
|
|
1109
|
+
"filters-label": e(f)("filters.title"),
|
|
1110
|
+
onStateChange: I
|
|
1101
1111
|
}, {
|
|
1102
1112
|
filters: t(() => [
|
|
1103
|
-
a(e(
|
|
1113
|
+
a(e(K), {
|
|
1104
1114
|
label: e(r)("calls.filter-user")
|
|
1105
1115
|
}, {
|
|
1106
1116
|
default: t(() => [
|
|
1107
1117
|
a(e(ne), {
|
|
1108
1118
|
modelValue: w.value,
|
|
1109
|
-
"onUpdate:modelValue": R[0] || (R[0] = (
|
|
1110
|
-
options:
|
|
1119
|
+
"onUpdate:modelValue": R[0] || (R[0] = (C) => w.value = C),
|
|
1120
|
+
options: L.value,
|
|
1111
1121
|
size: "sm"
|
|
1112
1122
|
}, null, 8, ["modelValue", "options"])
|
|
1113
1123
|
]),
|
|
1114
1124
|
_: 1
|
|
1115
1125
|
}, 8, ["label"]),
|
|
1116
|
-
a(e(
|
|
1126
|
+
a(e(K), {
|
|
1117
1127
|
label: e(r)("calls.filter-tool")
|
|
1118
1128
|
}, {
|
|
1119
1129
|
default: t(() => [
|
|
1120
1130
|
a(e(ne), {
|
|
1121
|
-
modelValue:
|
|
1122
|
-
"onUpdate:modelValue": R[1] || (R[1] = (
|
|
1123
|
-
options:
|
|
1131
|
+
modelValue: d.value,
|
|
1132
|
+
"onUpdate:modelValue": R[1] || (R[1] = (C) => d.value = C),
|
|
1133
|
+
options: $.value,
|
|
1124
1134
|
size: "sm"
|
|
1125
1135
|
}, null, 8, ["modelValue", "options"])
|
|
1126
1136
|
]),
|
|
1127
1137
|
_: 1
|
|
1128
1138
|
}, 8, ["label"]),
|
|
1129
|
-
a(e(
|
|
1139
|
+
a(e(K), {
|
|
1130
1140
|
label: e(r)("calls.filter-outcome")
|
|
1131
1141
|
}, {
|
|
1132
1142
|
default: t(() => [
|
|
1133
1143
|
a(e(ne), {
|
|
1134
|
-
modelValue:
|
|
1135
|
-
"onUpdate:modelValue": R[2] || (R[2] = (
|
|
1136
|
-
options:
|
|
1144
|
+
modelValue: x.value,
|
|
1145
|
+
"onUpdate:modelValue": R[2] || (R[2] = (C) => x.value = C),
|
|
1146
|
+
options: O.value,
|
|
1137
1147
|
size: "sm"
|
|
1138
1148
|
}, null, 8, ["modelValue", "options"])
|
|
1139
1149
|
]),
|
|
1140
1150
|
_: 1
|
|
1141
1151
|
}, 8, ["label"]),
|
|
1142
|
-
|
|
1152
|
+
i.value.length > 0 ? (h(), V(e(M), {
|
|
1143
1153
|
key: 0,
|
|
1144
1154
|
variant: "text",
|
|
1145
1155
|
size: "sm",
|
|
1146
1156
|
block: "",
|
|
1147
|
-
onClick:
|
|
1157
|
+
onClick: v
|
|
1148
1158
|
}, {
|
|
1149
1159
|
icon: t(() => [
|
|
1150
1160
|
a(e(Z), { name: "close" })
|
|
1151
1161
|
]),
|
|
1152
1162
|
default: t(() => [
|
|
1153
|
-
|
|
1163
|
+
m(" " + s(e(f)("filters.reset")), 1)
|
|
1154
1164
|
]),
|
|
1155
1165
|
_: 1
|
|
1156
1166
|
})) : E("", !0)
|
|
1157
1167
|
]),
|
|
1158
1168
|
applied: t(() => [
|
|
1159
|
-
a(e(
|
|
1169
|
+
a(e(De), { filters: i.value }, null, 8, ["filters"])
|
|
1160
1170
|
]),
|
|
1161
|
-
"cell-at": t(({ row:
|
|
1171
|
+
"cell-at": t(({ row: C }) => [
|
|
1162
1172
|
a(e(ie), {
|
|
1163
|
-
value:
|
|
1173
|
+
value: C.at,
|
|
1164
1174
|
tone: "default",
|
|
1165
1175
|
compact: ""
|
|
1166
1176
|
}, null, 8, ["value"])
|
|
1167
1177
|
]),
|
|
1168
|
-
"cell-user": t(({ row:
|
|
1178
|
+
"cell-user": t(({ row: C }) => [
|
|
1169
1179
|
a(e(B), {
|
|
1170
|
-
tone:
|
|
1180
|
+
tone: C.user === null || C.user.name === null ? "muted" : "default"
|
|
1171
1181
|
}, {
|
|
1172
1182
|
default: t(() => [
|
|
1173
|
-
|
|
1183
|
+
m(s(_(C.user)), 1)
|
|
1174
1184
|
]),
|
|
1175
1185
|
_: 2
|
|
1176
1186
|
}, 1032, ["tone"])
|
|
1177
1187
|
]),
|
|
1178
|
-
"cell-tool": t(({ row:
|
|
1188
|
+
"cell-tool": t(({ row: C }) => [
|
|
1179
1189
|
a(e(B), {
|
|
1180
1190
|
mono: "",
|
|
1181
1191
|
size: "sm"
|
|
1182
1192
|
}, {
|
|
1183
1193
|
default: t(() => [
|
|
1184
|
-
|
|
1194
|
+
m(s(C.tool), 1)
|
|
1185
1195
|
]),
|
|
1186
1196
|
_: 2
|
|
1187
1197
|
}, 1024)
|
|
1188
1198
|
]),
|
|
1189
|
-
"cell-outcome": t(({ row:
|
|
1190
|
-
a(e(
|
|
1191
|
-
type:
|
|
1199
|
+
"cell-outcome": t(({ row: C }) => [
|
|
1200
|
+
a(e(j), {
|
|
1201
|
+
type: Y(C).type,
|
|
1192
1202
|
dot: ""
|
|
1193
1203
|
}, {
|
|
1194
1204
|
default: t(() => [
|
|
1195
|
-
|
|
1205
|
+
m(s(Y(C).label), 1)
|
|
1196
1206
|
]),
|
|
1197
1207
|
_: 2
|
|
1198
1208
|
}, 1032, ["type"])
|
|
1199
1209
|
]),
|
|
1200
|
-
"cell-duration_ms": t(({ row:
|
|
1210
|
+
"cell-duration_ms": t(({ row: C }) => [
|
|
1201
1211
|
a(e(B), {
|
|
1202
1212
|
size: "sm",
|
|
1203
1213
|
tone: "muted"
|
|
1204
1214
|
}, {
|
|
1205
1215
|
default: t(() => [
|
|
1206
|
-
|
|
1216
|
+
m(s(e(r)("calls.ms", { count: C.duration_ms })), 1)
|
|
1207
1217
|
]),
|
|
1208
1218
|
_: 2
|
|
1209
1219
|
}, 1024)
|
|
1210
1220
|
]),
|
|
1211
|
-
"cell-client": t(({ row:
|
|
1212
|
-
|
|
1221
|
+
"cell-client": t(({ row: C }) => [
|
|
1222
|
+
C.client ? (h(), V(e(B), {
|
|
1213
1223
|
key: 0,
|
|
1214
1224
|
size: "sm"
|
|
1215
1225
|
}, {
|
|
1216
1226
|
default: t(() => [
|
|
1217
|
-
|
|
1227
|
+
m(s(C.client), 1)
|
|
1218
1228
|
]),
|
|
1219
1229
|
_: 2
|
|
1220
|
-
}, 1024)) : (
|
|
1230
|
+
}, 1024)) : (h(), V(e(B), {
|
|
1221
1231
|
key: 1,
|
|
1222
1232
|
size: "sm",
|
|
1223
1233
|
tone: "muted"
|
|
1224
1234
|
}, {
|
|
1225
1235
|
default: t(() => [...R[3] || (R[3] = [
|
|
1226
|
-
|
|
1236
|
+
m("—", -1)
|
|
1227
1237
|
])]),
|
|
1228
1238
|
_: 1
|
|
1229
1239
|
}))
|
|
1230
1240
|
]),
|
|
1231
|
-
expanded: t(({ row:
|
|
1232
|
-
W("div",
|
|
1233
|
-
|
|
1241
|
+
expanded: t(({ row: C }) => [
|
|
1242
|
+
W("div", bt, [
|
|
1243
|
+
C.error ? (h(), V(e(B), {
|
|
1234
1244
|
key: 0,
|
|
1235
1245
|
tone: "danger",
|
|
1236
1246
|
size: "sm",
|
|
1237
1247
|
class: "wx-call-list__error"
|
|
1238
1248
|
}, {
|
|
1239
1249
|
default: t(() => [
|
|
1240
|
-
W("strong", null,
|
|
1241
|
-
|
|
1250
|
+
W("strong", null, s(e(r)("calls.error")) + ":", 1),
|
|
1251
|
+
m(" " + s(C.error), 1)
|
|
1242
1252
|
]),
|
|
1243
1253
|
_: 2
|
|
1244
1254
|
}, 1024)) : E("", !0),
|
|
1245
|
-
|
|
1255
|
+
C.arguments ? (h(), G("pre", gt, s(C.arguments), 1)) : (h(), V(e(B), {
|
|
1246
1256
|
key: 2,
|
|
1247
1257
|
size: "sm",
|
|
1248
1258
|
tone: "muted"
|
|
1249
1259
|
}, {
|
|
1250
1260
|
default: t(() => [
|
|
1251
|
-
|
|
1261
|
+
m(s(e(r)("calls.no-arguments")), 1)
|
|
1252
1262
|
]),
|
|
1253
1263
|
_: 1
|
|
1254
1264
|
}))
|
|
1255
1265
|
])
|
|
1256
1266
|
]),
|
|
1257
|
-
"cell-card": t(({ row:
|
|
1267
|
+
"cell-card": t(({ row: C }) => [
|
|
1258
1268
|
a(e(Ce), {
|
|
1259
1269
|
variant: "plain",
|
|
1260
|
-
title:
|
|
1261
|
-
subtitle:
|
|
1270
|
+
title: C.tool,
|
|
1271
|
+
subtitle: _(C.user)
|
|
1262
1272
|
}, {
|
|
1263
1273
|
media: t(() => [
|
|
1264
|
-
W("span",
|
|
1274
|
+
W("span", wt, [
|
|
1265
1275
|
a(e(Z), { name: "sliders" })
|
|
1266
1276
|
])
|
|
1267
1277
|
]),
|
|
1268
1278
|
meta: t(() => [
|
|
1269
|
-
a(e(
|
|
1270
|
-
type:
|
|
1279
|
+
a(e(j), {
|
|
1280
|
+
type: Y(C).type,
|
|
1271
1281
|
dot: "",
|
|
1272
1282
|
size: "sm"
|
|
1273
1283
|
}, {
|
|
1274
1284
|
default: t(() => [
|
|
1275
|
-
|
|
1285
|
+
m(s(Y(C).label), 1)
|
|
1276
1286
|
]),
|
|
1277
1287
|
_: 2
|
|
1278
1288
|
}, 1032, ["type"]),
|
|
1279
1289
|
a(e(ie), {
|
|
1280
|
-
value:
|
|
1290
|
+
value: C.at,
|
|
1281
1291
|
compact: ""
|
|
1282
1292
|
}, null, 8, ["value"]),
|
|
1283
|
-
|
|
1293
|
+
C.client ? (h(), V(e(B), {
|
|
1284
1294
|
key: 0,
|
|
1285
1295
|
size: "xs",
|
|
1286
1296
|
tone: "muted"
|
|
1287
1297
|
}, {
|
|
1288
1298
|
default: t(() => [
|
|
1289
|
-
|
|
1299
|
+
m(s(C.client), 1)
|
|
1290
1300
|
]),
|
|
1291
1301
|
_: 2
|
|
1292
1302
|
}, 1024)) : E("", !0)
|
|
1293
1303
|
]),
|
|
1294
1304
|
default: t(() => [
|
|
1295
|
-
|
|
1305
|
+
D(C) ? (h(), V(e(oe), {
|
|
1296
1306
|
key: 0,
|
|
1297
1307
|
direction: "vertical",
|
|
1298
1308
|
size: "xs",
|
|
1299
1309
|
class: "wx-call-list__card-details"
|
|
1300
1310
|
}, {
|
|
1301
1311
|
default: t(() => [
|
|
1302
|
-
|
|
1312
|
+
C.error ? (h(), V(e(B), {
|
|
1303
1313
|
key: 0,
|
|
1304
1314
|
tone: "danger",
|
|
1305
1315
|
size: "sm"
|
|
1306
1316
|
}, {
|
|
1307
1317
|
default: t(() => [
|
|
1308
|
-
|
|
1318
|
+
m(s(C.error), 1)
|
|
1309
1319
|
]),
|
|
1310
1320
|
_: 2
|
|
1311
1321
|
}, 1024)) : E("", !0),
|
|
1312
|
-
|
|
1322
|
+
C.arguments ? (h(), G("pre", xt, s(C.arguments), 1)) : E("", !0)
|
|
1313
1323
|
]),
|
|
1314
1324
|
_: 2
|
|
1315
1325
|
}, 1024)) : E("", !0)
|
|
@@ -1322,7 +1332,7 @@ const vt = { class: "wx-admin-form" }, pt = { class: "wx-admin-form__grid" }, ft
|
|
|
1322
1332
|
], 512));
|
|
1323
1333
|
}
|
|
1324
1334
|
});
|
|
1325
|
-
function
|
|
1335
|
+
function Ct(n) {
|
|
1326
1336
|
const u = `${n.apiPath}/auth/connections`;
|
|
1327
1337
|
return {
|
|
1328
1338
|
list: (l = "mine") => n.http.get(u, { query: { all: l === "all" ? 1 : void 0 } }).then((o) => ({
|
|
@@ -1333,18 +1343,18 @@ function kt(n) {
|
|
|
1333
1343
|
disconnect: (l) => n.http.delete(`${u}/${l}`).then((o) => o.data)
|
|
1334
1344
|
};
|
|
1335
1345
|
}
|
|
1336
|
-
const
|
|
1346
|
+
const $t = {
|
|
1337
1347
|
class: "wx-connection-list__glyph",
|
|
1338
1348
|
"aria-hidden": "true"
|
|
1339
|
-
}, Ue = 560,
|
|
1349
|
+
}, Ue = 560, qe = /* @__PURE__ */ X({
|
|
1340
1350
|
__name: "ConnectionList",
|
|
1341
1351
|
props: {
|
|
1342
1352
|
scope: { default: "mine" }
|
|
1343
1353
|
},
|
|
1344
1354
|
setup(n, { expose: u }) {
|
|
1345
|
-
const l = n, o = ee(),
|
|
1355
|
+
const l = n, o = ee(), b = Ct(o);
|
|
1346
1356
|
te();
|
|
1347
|
-
const c =
|
|
1357
|
+
const c = J("webx-auth"), z = ve(), r = re("root"), f = xe(r), F = U(() => f.value > 0 && f.value < Ue), p = T([]), g = T(!1), w = T(null), d = U(() => F.value ? [{ key: "card", label: "" }] : [
|
|
1348
1358
|
{ key: "client", label: c("connections.client"), minWidth: 210 },
|
|
1349
1359
|
...l.scope === "all" ? [{ key: "user", label: c("connections.who"), minWidth: 140 }] : [],
|
|
1350
1360
|
{ key: "read_only", label: c("connections.allowed"), minWidth: 160 },
|
|
@@ -1352,72 +1362,72 @@ const Ct = {
|
|
|
1352
1362
|
{ key: "last_used_at", label: c("connections.last-used"), minWidth: 130 },
|
|
1353
1363
|
{ key: "end", label: "", align: "right", width: 140 }
|
|
1354
1364
|
]);
|
|
1355
|
-
function
|
|
1356
|
-
return
|
|
1365
|
+
function x($) {
|
|
1366
|
+
return $.user.name ?? c("calls.deleted", { id: $.user.id });
|
|
1357
1367
|
}
|
|
1358
|
-
function
|
|
1359
|
-
if (
|
|
1368
|
+
function y($) {
|
|
1369
|
+
if ($.read_only) return c("connections.read-only");
|
|
1360
1370
|
if (l.scope !== "all") return c("connections.full-you");
|
|
1361
|
-
const
|
|
1362
|
-
return c("connections.full", { name:
|
|
1371
|
+
const O = $.user.name?.split(" ")[0];
|
|
1372
|
+
return c("connections.full", { name: O || x($) });
|
|
1363
1373
|
}
|
|
1364
|
-
async function
|
|
1365
|
-
|
|
1374
|
+
async function _() {
|
|
1375
|
+
g.value = !0;
|
|
1366
1376
|
try {
|
|
1367
|
-
|
|
1368
|
-
} catch (
|
|
1369
|
-
|
|
1377
|
+
p.value = (await b.list(l.scope)).data;
|
|
1378
|
+
} catch ($) {
|
|
1379
|
+
Q.danger(z($));
|
|
1370
1380
|
} finally {
|
|
1371
|
-
|
|
1381
|
+
g.value = !1;
|
|
1372
1382
|
}
|
|
1373
1383
|
}
|
|
1374
|
-
async function
|
|
1375
|
-
if (await
|
|
1376
|
-
title: c("connections.confirm-title", { client:
|
|
1384
|
+
async function L($) {
|
|
1385
|
+
if (await Ie({
|
|
1386
|
+
title: c("connections.confirm-title", { client: $.client }),
|
|
1377
1387
|
message: c("connections.confirm-text"),
|
|
1378
1388
|
confirmText: c("connections.confirm"),
|
|
1379
1389
|
cancelText: c("connections.cancel"),
|
|
1380
1390
|
tone: "danger"
|
|
1381
1391
|
})) {
|
|
1382
|
-
w.value =
|
|
1392
|
+
w.value = $.id;
|
|
1383
1393
|
try {
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1386
|
-
} catch (
|
|
1387
|
-
|
|
1394
|
+
const i = await b.disconnect($.id);
|
|
1395
|
+
p.value = p.value.map((v) => v.id === i.id ? i : v), Q.success(c("connections.done", { client: $.client }));
|
|
1396
|
+
} catch (i) {
|
|
1397
|
+
Q.danger(z(i));
|
|
1388
1398
|
} finally {
|
|
1389
1399
|
w.value = null;
|
|
1390
1400
|
}
|
|
1391
1401
|
}
|
|
1392
1402
|
}
|
|
1393
|
-
return ue(() => l.scope,
|
|
1403
|
+
return ue(() => l.scope, _, { immediate: !0 }), u({ reload: _ }), ($, O) => (h(), G("div", {
|
|
1394
1404
|
ref_key: "root",
|
|
1395
1405
|
ref: r,
|
|
1396
1406
|
class: "wx-connection-list"
|
|
1397
1407
|
}, [
|
|
1398
1408
|
a(e(ke), {
|
|
1399
|
-
data:
|
|
1400
|
-
columns:
|
|
1409
|
+
data: p.value,
|
|
1410
|
+
columns: d.value,
|
|
1401
1411
|
"row-key": "id",
|
|
1402
1412
|
flush: "",
|
|
1403
|
-
loading:
|
|
1413
|
+
loading: g.value,
|
|
1404
1414
|
clickable: !1,
|
|
1405
1415
|
"empty-text": n.scope === "all" ? e(c)("connections.empty-all") : e(c)("connections.empty"),
|
|
1406
1416
|
"cards-below": Ue,
|
|
1407
|
-
"row-class": (
|
|
1417
|
+
"row-class": (i) => i.revoked_at ? "is-ended" : ""
|
|
1408
1418
|
}, {
|
|
1409
|
-
"cell-client": t(({ row:
|
|
1419
|
+
"cell-client": t(({ row: i }) => [
|
|
1410
1420
|
a(e(oe), {
|
|
1411
1421
|
direction: "vertical",
|
|
1412
1422
|
size: "none"
|
|
1413
1423
|
}, {
|
|
1414
1424
|
default: t(() => [
|
|
1415
1425
|
a(e(B), {
|
|
1416
|
-
tone:
|
|
1426
|
+
tone: i.revoked_at ? "muted" : "default",
|
|
1417
1427
|
weight: "medium"
|
|
1418
1428
|
}, {
|
|
1419
1429
|
default: t(() => [
|
|
1420
|
-
|
|
1430
|
+
m(s(i.client), 1)
|
|
1421
1431
|
]),
|
|
1422
1432
|
_: 2
|
|
1423
1433
|
}, 1032, ["tone"]),
|
|
@@ -1426,7 +1436,7 @@ const Ct = {
|
|
|
1426
1436
|
tone: "muted"
|
|
1427
1437
|
}, {
|
|
1428
1438
|
default: t(() => [
|
|
1429
|
-
|
|
1439
|
+
m(s(e(c)("connections.returns-to", { host: i.host })), 1)
|
|
1430
1440
|
]),
|
|
1431
1441
|
_: 2
|
|
1432
1442
|
}, 1024)
|
|
@@ -1434,145 +1444,145 @@ const Ct = {
|
|
|
1434
1444
|
_: 2
|
|
1435
1445
|
}, 1024)
|
|
1436
1446
|
]),
|
|
1437
|
-
"cell-user": t(({ row:
|
|
1447
|
+
"cell-user": t(({ row: i }) => [
|
|
1438
1448
|
a(e(B), {
|
|
1439
|
-
tone:
|
|
1449
|
+
tone: i.user.name === null ? "muted" : "default"
|
|
1440
1450
|
}, {
|
|
1441
1451
|
default: t(() => [
|
|
1442
|
-
|
|
1452
|
+
m(s(x(i)), 1)
|
|
1443
1453
|
]),
|
|
1444
1454
|
_: 2
|
|
1445
1455
|
}, 1032, ["tone"])
|
|
1446
1456
|
]),
|
|
1447
|
-
"cell-read_only": t(({ row:
|
|
1448
|
-
|
|
1457
|
+
"cell-read_only": t(({ row: i }) => [
|
|
1458
|
+
i.revoked_at ? (h(), V(e(j), {
|
|
1449
1459
|
key: 0,
|
|
1450
1460
|
type: "default",
|
|
1451
1461
|
dot: ""
|
|
1452
1462
|
}, {
|
|
1453
1463
|
default: t(() => [
|
|
1454
|
-
|
|
1464
|
+
m(s(e(c)("connections.disconnected")), 1)
|
|
1455
1465
|
]),
|
|
1456
1466
|
_: 1
|
|
1457
|
-
})) : (
|
|
1467
|
+
})) : (h(), V(e(j), {
|
|
1458
1468
|
key: 1,
|
|
1459
|
-
type:
|
|
1469
|
+
type: i.read_only ? "info" : "success",
|
|
1460
1470
|
dot: ""
|
|
1461
1471
|
}, {
|
|
1462
1472
|
default: t(() => [
|
|
1463
|
-
|
|
1473
|
+
m(s(y(i)), 1)
|
|
1464
1474
|
]),
|
|
1465
1475
|
_: 2
|
|
1466
1476
|
}, 1032, ["type"]))
|
|
1467
1477
|
]),
|
|
1468
|
-
"cell-connected_at": t(({ row:
|
|
1478
|
+
"cell-connected_at": t(({ row: i }) => [
|
|
1469
1479
|
a(e(ie), {
|
|
1470
|
-
value:
|
|
1480
|
+
value: i.connected_at,
|
|
1471
1481
|
tone: "muted",
|
|
1472
1482
|
compact: ""
|
|
1473
1483
|
}, null, 8, ["value"])
|
|
1474
1484
|
]),
|
|
1475
|
-
"cell-last_used_at": t(({ row:
|
|
1476
|
-
|
|
1485
|
+
"cell-last_used_at": t(({ row: i }) => [
|
|
1486
|
+
i.last_used_at ? (h(), V(e(ie), {
|
|
1477
1487
|
key: 0,
|
|
1478
|
-
value:
|
|
1488
|
+
value: i.last_used_at,
|
|
1479
1489
|
tone: "default",
|
|
1480
1490
|
compact: ""
|
|
1481
|
-
}, null, 8, ["value"])) : (
|
|
1491
|
+
}, null, 8, ["value"])) : (h(), V(e(B), {
|
|
1482
1492
|
key: 1,
|
|
1483
1493
|
size: "sm",
|
|
1484
1494
|
tone: "muted"
|
|
1485
1495
|
}, {
|
|
1486
1496
|
default: t(() => [
|
|
1487
|
-
|
|
1497
|
+
m(s(e(c)("connections.never-used")), 1)
|
|
1488
1498
|
]),
|
|
1489
1499
|
_: 1
|
|
1490
1500
|
}))
|
|
1491
1501
|
]),
|
|
1492
|
-
"cell-end": t(({ row:
|
|
1493
|
-
|
|
1502
|
+
"cell-end": t(({ row: i }) => [
|
|
1503
|
+
i.revoked_at ? E("", !0) : (h(), V(e(M), {
|
|
1494
1504
|
key: 0,
|
|
1495
1505
|
type: "danger",
|
|
1496
1506
|
variant: "text",
|
|
1497
1507
|
size: "sm",
|
|
1498
|
-
loading: w.value ===
|
|
1499
|
-
onClick: (
|
|
1508
|
+
loading: w.value === i.id,
|
|
1509
|
+
onClick: (v) => L(i)
|
|
1500
1510
|
}, {
|
|
1501
1511
|
default: t(() => [
|
|
1502
|
-
|
|
1512
|
+
m(s(e(c)("connections.disconnect")), 1)
|
|
1503
1513
|
]),
|
|
1504
1514
|
_: 1
|
|
1505
1515
|
}, 8, ["loading", "onClick"]))
|
|
1506
1516
|
]),
|
|
1507
|
-
"cell-card": t(({ row:
|
|
1517
|
+
"cell-card": t(({ row: i }) => [
|
|
1508
1518
|
a(e(Ce), {
|
|
1509
1519
|
variant: "plain",
|
|
1510
|
-
title:
|
|
1511
|
-
subtitle: e(c)("connections.returns-to", { host:
|
|
1520
|
+
title: i.client,
|
|
1521
|
+
subtitle: e(c)("connections.returns-to", { host: i.host })
|
|
1512
1522
|
}, {
|
|
1513
1523
|
media: t(() => [
|
|
1514
|
-
W("span",
|
|
1524
|
+
W("span", $t, [
|
|
1515
1525
|
a(e(Z), { name: "link" })
|
|
1516
1526
|
])
|
|
1517
1527
|
]),
|
|
1518
1528
|
meta: t(() => [
|
|
1519
|
-
|
|
1529
|
+
i.revoked_at ? (h(), V(e(j), {
|
|
1520
1530
|
key: 0,
|
|
1521
1531
|
type: "default",
|
|
1522
1532
|
dot: "",
|
|
1523
1533
|
size: "sm"
|
|
1524
1534
|
}, {
|
|
1525
1535
|
default: t(() => [
|
|
1526
|
-
|
|
1536
|
+
m(s(e(c)("connections.disconnected")), 1)
|
|
1527
1537
|
]),
|
|
1528
1538
|
_: 1
|
|
1529
|
-
})) : (
|
|
1539
|
+
})) : (h(), V(e(j), {
|
|
1530
1540
|
key: 1,
|
|
1531
|
-
type:
|
|
1541
|
+
type: i.read_only ? "info" : "success",
|
|
1532
1542
|
dot: "",
|
|
1533
1543
|
size: "sm"
|
|
1534
1544
|
}, {
|
|
1535
1545
|
default: t(() => [
|
|
1536
|
-
|
|
1546
|
+
m(s(y(i)), 1)
|
|
1537
1547
|
]),
|
|
1538
1548
|
_: 2
|
|
1539
1549
|
}, 1032, ["type"])),
|
|
1540
|
-
n.scope === "all" ? (
|
|
1550
|
+
n.scope === "all" ? (h(), V(e(B), {
|
|
1541
1551
|
key: 2,
|
|
1542
1552
|
size: "xs",
|
|
1543
1553
|
tone: "muted"
|
|
1544
1554
|
}, {
|
|
1545
1555
|
default: t(() => [
|
|
1546
|
-
|
|
1556
|
+
m(s(x(i)), 1)
|
|
1547
1557
|
]),
|
|
1548
1558
|
_: 2
|
|
1549
1559
|
}, 1024)) : E("", !0),
|
|
1550
|
-
|
|
1560
|
+
i.last_used_at ? (h(), V(e(ie), {
|
|
1551
1561
|
key: 3,
|
|
1552
|
-
value:
|
|
1562
|
+
value: i.last_used_at,
|
|
1553
1563
|
compact: ""
|
|
1554
|
-
}, null, 8, ["value"])) : (
|
|
1564
|
+
}, null, 8, ["value"])) : (h(), V(e(B), {
|
|
1555
1565
|
key: 4,
|
|
1556
1566
|
size: "xs",
|
|
1557
1567
|
tone: "muted"
|
|
1558
1568
|
}, {
|
|
1559
1569
|
default: t(() => [
|
|
1560
|
-
|
|
1570
|
+
m(s(e(c)("connections.never-used")), 1)
|
|
1561
1571
|
]),
|
|
1562
1572
|
_: 1
|
|
1563
1573
|
}))
|
|
1564
1574
|
]),
|
|
1565
1575
|
actions: t(() => [
|
|
1566
|
-
|
|
1576
|
+
i.revoked_at ? E("", !0) : (h(), V(e(M), {
|
|
1567
1577
|
key: 0,
|
|
1568
1578
|
type: "danger",
|
|
1569
1579
|
variant: "text",
|
|
1570
1580
|
size: "sm",
|
|
1571
|
-
loading: w.value ===
|
|
1572
|
-
onClick: (
|
|
1581
|
+
loading: w.value === i.id,
|
|
1582
|
+
onClick: (v) => L(i)
|
|
1573
1583
|
}, {
|
|
1574
1584
|
default: t(() => [
|
|
1575
|
-
|
|
1585
|
+
m(s(e(c)("connections.disconnect")), 1)
|
|
1576
1586
|
]),
|
|
1577
1587
|
_: 1
|
|
1578
1588
|
}, 8, ["loading", "onClick"]))
|
|
@@ -1584,7 +1594,7 @@ const Ct = {
|
|
|
1584
1594
|
}, 8, ["data", "columns", "loading", "empty-text", "row-class"])
|
|
1585
1595
|
], 512));
|
|
1586
1596
|
}
|
|
1587
|
-
}),
|
|
1597
|
+
}), At = /* @__PURE__ */ X({
|
|
1588
1598
|
__name: "AdminsPage",
|
|
1589
1599
|
props: {
|
|
1590
1600
|
base: { default: "/admins" },
|
|
@@ -1593,135 +1603,135 @@ const Ct = {
|
|
|
1593
1603
|
resolveAvatar: { type: Function, default: void 0 }
|
|
1594
1604
|
},
|
|
1595
1605
|
setup(n) {
|
|
1596
|
-
const u = n, l = ee(), o = fe(l),
|
|
1606
|
+
const u = n, l = ee(), o = fe(l), b = u.avatarField ?? Ye(l) ?? void 0, c = u.resolveAvatar ?? je(l) ?? void 0, z = lt(), r = nt();
|
|
1597
1607
|
te();
|
|
1598
|
-
const
|
|
1599
|
-
() => l.state.manifest?.modules.find((
|
|
1600
|
-
),
|
|
1601
|
-
const
|
|
1602
|
-
return
|
|
1603
|
-
}),
|
|
1608
|
+
const f = J("webx-auth"), F = ve(), p = re("list"), g = T(null), w = $e(_t), d = l.can("admins.manage"), x = l.can("admins.audit"), y = U(
|
|
1609
|
+
() => l.state.manifest?.modules.find((v) => v.id === "admins")?.title ?? f("admins.title")
|
|
1610
|
+
), _ = U(() => {
|
|
1611
|
+
const v = [{ value: "admins", label: y.value }];
|
|
1612
|
+
return x && v.push({ value: "calls", label: f("calls.title") }), d && v.push({ value: "connections", label: f("connections.title") }), v.length > 1 ? v : void 0;
|
|
1613
|
+
}), L = U({
|
|
1604
1614
|
get: () => u.current,
|
|
1605
|
-
set: (
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1615
|
+
set: (v) => {
|
|
1616
|
+
const A = v === "admins" ? u.base : `${u.base}/${String(v)}`;
|
|
1617
|
+
A !== r.path && z.push(A);
|
|
1608
1618
|
}
|
|
1609
|
-
}),
|
|
1610
|
-
() =>
|
|
1619
|
+
}), $ = U(
|
|
1620
|
+
() => d && u.current === "admins" ? [
|
|
1611
1621
|
{
|
|
1612
1622
|
key: "new",
|
|
1613
|
-
label:
|
|
1623
|
+
label: f("admins.new-short"),
|
|
1614
1624
|
icon: "plus",
|
|
1615
1625
|
primary: !0,
|
|
1616
1626
|
run: () => {
|
|
1617
|
-
|
|
1627
|
+
O(null);
|
|
1618
1628
|
}
|
|
1619
1629
|
}
|
|
1620
1630
|
] : []
|
|
1621
1631
|
);
|
|
1622
|
-
async function
|
|
1623
|
-
|
|
1632
|
+
async function O(v) {
|
|
1633
|
+
g.value = v, await w({ admin: v, avatarField: b }) && p.value?.reload();
|
|
1624
1634
|
}
|
|
1625
|
-
async function
|
|
1626
|
-
if (await
|
|
1627
|
-
title:
|
|
1628
|
-
message:
|
|
1629
|
-
confirmText:
|
|
1630
|
-
cancelText:
|
|
1635
|
+
async function i(v) {
|
|
1636
|
+
if (await Ie({
|
|
1637
|
+
title: f("admins.delete-title", { name: v.name }),
|
|
1638
|
+
message: f("admins.delete-text"),
|
|
1639
|
+
confirmText: f("admins.delete"),
|
|
1640
|
+
cancelText: f("admins.cancel"),
|
|
1631
1641
|
tone: "danger"
|
|
1632
1642
|
}))
|
|
1633
1643
|
try {
|
|
1634
|
-
await o.remove(
|
|
1635
|
-
} catch (
|
|
1636
|
-
|
|
1644
|
+
await o.remove(v.id), Q.success(f("admins.deleted")), p.value?.reload();
|
|
1645
|
+
} catch (I) {
|
|
1646
|
+
Q.danger(F(I));
|
|
1637
1647
|
}
|
|
1638
1648
|
}
|
|
1639
|
-
return (
|
|
1640
|
-
view:
|
|
1641
|
-
"onUpdate:view":
|
|
1642
|
-
title:
|
|
1643
|
-
views:
|
|
1644
|
-
actions:
|
|
1649
|
+
return (v, A) => (h(), V(e(Ne), {
|
|
1650
|
+
view: L.value,
|
|
1651
|
+
"onUpdate:view": A[0] || (A[0] = (I) => L.value = I),
|
|
1652
|
+
title: y.value,
|
|
1653
|
+
views: _.value,
|
|
1654
|
+
actions: $.value
|
|
1645
1655
|
}, {
|
|
1646
1656
|
default: t(() => [
|
|
1647
|
-
n.current === "calls" ? (
|
|
1657
|
+
n.current === "calls" ? (h(), V(kt, { key: 0 })) : n.current === "connections" ? (h(), V(qe, {
|
|
1648
1658
|
key: 1,
|
|
1649
1659
|
scope: "all"
|
|
1650
|
-
})) : (
|
|
1660
|
+
})) : (h(), V(Je, {
|
|
1651
1661
|
key: 2,
|
|
1652
1662
|
ref_key: "list",
|
|
1653
|
-
ref:
|
|
1654
|
-
removable: e(
|
|
1655
|
-
"resolve-avatar":
|
|
1656
|
-
onOpen:
|
|
1657
|
-
onRemove:
|
|
1663
|
+
ref: p,
|
|
1664
|
+
removable: e(d),
|
|
1665
|
+
"resolve-avatar": e(c),
|
|
1666
|
+
onOpen: O,
|
|
1667
|
+
onRemove: i
|
|
1658
1668
|
}, null, 8, ["removable", "resolve-avatar"]))
|
|
1659
1669
|
]),
|
|
1660
1670
|
_: 1
|
|
1661
1671
|
}, 8, ["view", "title", "views", "actions"]));
|
|
1662
1672
|
}
|
|
1663
|
-
}),
|
|
1673
|
+
}), Vt = { class: "wx-connect" }, zt = { class: "wx-connect__row" }, Lt = { class: "wx-connect__url" }, St = { class: "wx-connect__section" }, Wt = { class: "wx-connect__steps" }, Tt = { class: "wx-connect__steps" }, Ut = { class: "wx-connect__snippet" }, Pt = { class: "wx-connect__snippet" }, Ft = { class: "wx-connect__section" }, Ot = { class: "wx-connect__links" }, Rt = { class: "wx-connect__steps" }, Bt = { class: "wx-connect__section" }, Et = /* @__PURE__ */ X({
|
|
1664
1674
|
__name: "ConnectPage",
|
|
1665
1675
|
setup(n) {
|
|
1666
1676
|
const u = ee();
|
|
1667
1677
|
te();
|
|
1668
|
-
const l =
|
|
1669
|
-
let
|
|
1670
|
-
const c =
|
|
1671
|
-
const
|
|
1672
|
-
return typeof
|
|
1673
|
-
}),
|
|
1678
|
+
const l = J("webx-auth"), o = T(!1);
|
|
1679
|
+
let b;
|
|
1680
|
+
const c = U(() => {
|
|
1681
|
+
const x = u.state.manifest?.modules.find((y) => y.id === "connect")?.meta;
|
|
1682
|
+
return typeof x?.url == "string" ? x.url : "";
|
|
1683
|
+
}), z = U(() => {
|
|
1674
1684
|
try {
|
|
1675
1685
|
return new URL(c.value).hostname.split(".")[0] || "webx";
|
|
1676
1686
|
} catch {
|
|
1677
1687
|
return "webx";
|
|
1678
1688
|
}
|
|
1679
|
-
}), r =
|
|
1680
|
-
url = "${c.value}"`),
|
|
1681
|
-
const
|
|
1682
|
-
return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(
|
|
1683
|
-
}),
|
|
1684
|
-
const
|
|
1685
|
-
return `vscode:mcp/install?${encodeURIComponent(
|
|
1689
|
+
}), r = U(() => `claude mcp add --transport http ${z.value} ${c.value}`), f = U(() => `[mcp_servers.${z.value}]
|
|
1690
|
+
url = "${c.value}"`), F = U(() => {
|
|
1691
|
+
const x = g(JSON.stringify({ url: c.value }));
|
|
1692
|
+
return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(z.value)}&config=${x}`;
|
|
1693
|
+
}), p = U(() => {
|
|
1694
|
+
const x = JSON.stringify({ name: z.value, type: "http", url: c.value });
|
|
1695
|
+
return `vscode:mcp/install?${encodeURIComponent(x)}`;
|
|
1686
1696
|
});
|
|
1687
|
-
function
|
|
1688
|
-
const
|
|
1689
|
-
let
|
|
1690
|
-
for (const
|
|
1691
|
-
return encodeURIComponent(btoa(
|
|
1697
|
+
function g(x) {
|
|
1698
|
+
const y = new TextEncoder().encode(x);
|
|
1699
|
+
let _ = "";
|
|
1700
|
+
for (const L of y) _ += String.fromCharCode(L);
|
|
1701
|
+
return encodeURIComponent(btoa(_));
|
|
1692
1702
|
}
|
|
1693
|
-
async function w(
|
|
1703
|
+
async function w(x) {
|
|
1694
1704
|
try {
|
|
1695
1705
|
if (navigator.clipboard?.writeText)
|
|
1696
|
-
await navigator.clipboard.writeText(
|
|
1697
|
-
else if (!
|
|
1706
|
+
await navigator.clipboard.writeText(x);
|
|
1707
|
+
else if (!d(x))
|
|
1698
1708
|
throw new Error("no clipboard");
|
|
1699
|
-
o.value = !0, clearTimeout(
|
|
1709
|
+
o.value = !0, clearTimeout(b), b = setTimeout(() => o.value = !1, 2e3);
|
|
1700
1710
|
} catch {
|
|
1701
|
-
if (
|
|
1702
|
-
|
|
1711
|
+
if (d(x)) return;
|
|
1712
|
+
Q.danger(l("connect.copy-failed"));
|
|
1703
1713
|
}
|
|
1704
1714
|
}
|
|
1705
|
-
function
|
|
1706
|
-
const
|
|
1707
|
-
|
|
1715
|
+
function d(x) {
|
|
1716
|
+
const y = document.createElement("textarea");
|
|
1717
|
+
y.value = x, y.setAttribute("readonly", ""), y.style.position = "fixed", y.style.opacity = "0", document.body.append(y), y.select();
|
|
1708
1718
|
try {
|
|
1709
1719
|
return document.execCommand("copy");
|
|
1710
1720
|
} catch {
|
|
1711
1721
|
return !1;
|
|
1712
1722
|
} finally {
|
|
1713
|
-
|
|
1723
|
+
y.remove();
|
|
1714
1724
|
}
|
|
1715
1725
|
}
|
|
1716
|
-
return (
|
|
1726
|
+
return (x, y) => (h(), V(e(Ne), {
|
|
1717
1727
|
title: e(l)("connect.title"),
|
|
1718
1728
|
card: !1
|
|
1719
1729
|
}, {
|
|
1720
1730
|
default: t(() => [
|
|
1721
|
-
W("div",
|
|
1731
|
+
W("div", Vt, [
|
|
1722
1732
|
a(e(B), { class: "wx-connect__lead" }, {
|
|
1723
1733
|
default: t(() => [
|
|
1724
|
-
|
|
1734
|
+
m(s(e(l)("connect.lead")), 1)
|
|
1725
1735
|
]),
|
|
1726
1736
|
_: 1
|
|
1727
1737
|
}),
|
|
@@ -1733,16 +1743,16 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1733
1743
|
class: "wx-connect__label"
|
|
1734
1744
|
}, {
|
|
1735
1745
|
default: t(() => [
|
|
1736
|
-
|
|
1746
|
+
m(s(e(l)("connect.address")), 1)
|
|
1737
1747
|
]),
|
|
1738
1748
|
_: 1
|
|
1739
1749
|
}),
|
|
1740
|
-
W("div",
|
|
1741
|
-
W("code",
|
|
1742
|
-
a(e(
|
|
1750
|
+
W("div", zt, [
|
|
1751
|
+
W("code", Lt, s(c.value), 1),
|
|
1752
|
+
a(e(M), {
|
|
1743
1753
|
type: "primary",
|
|
1744
1754
|
disabled: c.value === "",
|
|
1745
|
-
onClick:
|
|
1755
|
+
onClick: y[0] || (y[0] = (_) => w(c.value))
|
|
1746
1756
|
}, {
|
|
1747
1757
|
icon: t(() => [
|
|
1748
1758
|
a(e(Z), {
|
|
@@ -1750,7 +1760,7 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1750
1760
|
}, null, 8, ["name"])
|
|
1751
1761
|
]),
|
|
1752
1762
|
default: t(() => [
|
|
1753
|
-
|
|
1763
|
+
m(" " + s(o.value ? e(l)("connect.copied") : e(l)("connect.copy")), 1)
|
|
1754
1764
|
]),
|
|
1755
1765
|
_: 1
|
|
1756
1766
|
}, 8, ["disabled"])
|
|
@@ -1758,70 +1768,70 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1758
1768
|
]),
|
|
1759
1769
|
_: 1
|
|
1760
1770
|
}),
|
|
1761
|
-
W("section",
|
|
1771
|
+
W("section", St, [
|
|
1762
1772
|
a(e(he), {
|
|
1763
1773
|
level: 2,
|
|
1764
1774
|
size: "sm"
|
|
1765
1775
|
}, {
|
|
1766
1776
|
default: t(() => [
|
|
1767
|
-
|
|
1777
|
+
m(s(e(l)("connect.how")), 1)
|
|
1768
1778
|
]),
|
|
1769
1779
|
_: 1
|
|
1770
1780
|
}),
|
|
1771
|
-
a(e(
|
|
1781
|
+
a(e(st), {
|
|
1772
1782
|
variant: "line",
|
|
1773
1783
|
"aria-label": e(l)("connect.how")
|
|
1774
1784
|
}, {
|
|
1775
1785
|
default: t(() => [
|
|
1776
|
-
a(e(
|
|
1786
|
+
a(e(me), {
|
|
1777
1787
|
value: "claude",
|
|
1778
1788
|
label: e(l)("connect.claude-title")
|
|
1779
1789
|
}, {
|
|
1780
1790
|
default: t(() => [
|
|
1781
|
-
W("ol",
|
|
1782
|
-
W("li", null,
|
|
1783
|
-
W("li", null,
|
|
1784
|
-
W("li", null,
|
|
1791
|
+
W("ol", Wt, [
|
|
1792
|
+
W("li", null, s(e(l)("connect.claude-1")), 1),
|
|
1793
|
+
W("li", null, s(e(l)("connect.claude-2")), 1),
|
|
1794
|
+
W("li", null, s(e(l)("connect.claude-3")), 1)
|
|
1785
1795
|
])
|
|
1786
1796
|
]),
|
|
1787
1797
|
_: 1
|
|
1788
1798
|
}, 8, ["label"]),
|
|
1789
|
-
a(e(
|
|
1799
|
+
a(e(me), {
|
|
1790
1800
|
value: "chatgpt",
|
|
1791
1801
|
label: e(l)("connect.chatgpt-title")
|
|
1792
1802
|
}, {
|
|
1793
1803
|
default: t(() => [
|
|
1794
|
-
W("ol",
|
|
1795
|
-
W("li", null,
|
|
1796
|
-
W("li", null,
|
|
1797
|
-
W("li", null,
|
|
1804
|
+
W("ol", Tt, [
|
|
1805
|
+
W("li", null, s(e(l)("connect.chatgpt-1")), 1),
|
|
1806
|
+
W("li", null, s(e(l)("connect.chatgpt-2")), 1),
|
|
1807
|
+
W("li", null, s(e(l)("connect.chatgpt-3")), 1)
|
|
1798
1808
|
])
|
|
1799
1809
|
]),
|
|
1800
1810
|
_: 1
|
|
1801
1811
|
}, 8, ["label"]),
|
|
1802
|
-
a(e(
|
|
1812
|
+
a(e(me), {
|
|
1803
1813
|
value: "claude-code",
|
|
1804
1814
|
label: e(l)("connect.claude-code-title")
|
|
1805
1815
|
}, {
|
|
1806
1816
|
default: t(() => [
|
|
1807
1817
|
a(e(B), { size: "sm" }, {
|
|
1808
1818
|
default: t(() => [
|
|
1809
|
-
|
|
1819
|
+
m(s(e(l)("connect.claude-code-hint")), 1)
|
|
1810
1820
|
]),
|
|
1811
1821
|
_: 1
|
|
1812
1822
|
}),
|
|
1813
|
-
W("div",
|
|
1814
|
-
W("pre", null,
|
|
1815
|
-
a(e(
|
|
1823
|
+
W("div", Ut, [
|
|
1824
|
+
W("pre", null, s(r.value), 1),
|
|
1825
|
+
a(e(M), {
|
|
1816
1826
|
variant: "text",
|
|
1817
1827
|
size: "sm",
|
|
1818
|
-
onClick:
|
|
1828
|
+
onClick: y[1] || (y[1] = (_) => w(r.value))
|
|
1819
1829
|
}, {
|
|
1820
1830
|
icon: t(() => [
|
|
1821
1831
|
a(e(Z), { name: "copy" })
|
|
1822
1832
|
]),
|
|
1823
1833
|
default: t(() => [
|
|
1824
|
-
|
|
1834
|
+
m(" " + s(e(l)("connect.copy-line")), 1)
|
|
1825
1835
|
]),
|
|
1826
1836
|
_: 1
|
|
1827
1837
|
})
|
|
@@ -1829,29 +1839,29 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1829
1839
|
]),
|
|
1830
1840
|
_: 1
|
|
1831
1841
|
}, 8, ["label"]),
|
|
1832
|
-
a(e(
|
|
1842
|
+
a(e(me), {
|
|
1833
1843
|
value: "codex",
|
|
1834
1844
|
label: e(l)("connect.codex-title")
|
|
1835
1845
|
}, {
|
|
1836
1846
|
default: t(() => [
|
|
1837
1847
|
a(e(B), { size: "sm" }, {
|
|
1838
1848
|
default: t(() => [
|
|
1839
|
-
|
|
1849
|
+
m(s(e(l)("connect.codex-hint")), 1)
|
|
1840
1850
|
]),
|
|
1841
1851
|
_: 1
|
|
1842
1852
|
}),
|
|
1843
|
-
W("div",
|
|
1844
|
-
W("pre", null,
|
|
1845
|
-
a(e(
|
|
1853
|
+
W("div", Pt, [
|
|
1854
|
+
W("pre", null, s(f.value), 1),
|
|
1855
|
+
a(e(M), {
|
|
1846
1856
|
variant: "text",
|
|
1847
1857
|
size: "sm",
|
|
1848
|
-
onClick:
|
|
1858
|
+
onClick: y[2] || (y[2] = (_) => w(f.value))
|
|
1849
1859
|
}, {
|
|
1850
1860
|
icon: t(() => [
|
|
1851
1861
|
a(e(Z), { name: "copy" })
|
|
1852
1862
|
]),
|
|
1853
1863
|
default: t(() => [
|
|
1854
|
-
|
|
1864
|
+
m(" " + s(e(l)("connect.copy-line")), 1)
|
|
1855
1865
|
]),
|
|
1856
1866
|
_: 1
|
|
1857
1867
|
})
|
|
@@ -1863,13 +1873,13 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1863
1873
|
_: 1
|
|
1864
1874
|
}, 8, ["aria-label"])
|
|
1865
1875
|
]),
|
|
1866
|
-
W("section",
|
|
1876
|
+
W("section", Ft, [
|
|
1867
1877
|
a(e(he), {
|
|
1868
1878
|
level: 2,
|
|
1869
1879
|
size: "sm"
|
|
1870
1880
|
}, {
|
|
1871
1881
|
default: t(() => [
|
|
1872
|
-
|
|
1882
|
+
m(s(e(l)("connect.one-click")), 1)
|
|
1873
1883
|
]),
|
|
1874
1884
|
_: 1
|
|
1875
1885
|
}),
|
|
@@ -1878,13 +1888,13 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1878
1888
|
tone: "muted"
|
|
1879
1889
|
}, {
|
|
1880
1890
|
default: t(() => [
|
|
1881
|
-
|
|
1891
|
+
m(s(e(l)("connect.one-click-hint")), 1)
|
|
1882
1892
|
]),
|
|
1883
1893
|
_: 1
|
|
1884
1894
|
}),
|
|
1885
|
-
W("div",
|
|
1886
|
-
a(e(
|
|
1887
|
-
href:
|
|
1895
|
+
W("div", Ot, [
|
|
1896
|
+
a(e(M), {
|
|
1897
|
+
href: F.value,
|
|
1888
1898
|
variant: "outline",
|
|
1889
1899
|
disabled: c.value === "",
|
|
1890
1900
|
class: "wx-connect__link"
|
|
@@ -1893,12 +1903,12 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1893
1903
|
a(e(Z), { name: "external-link" })
|
|
1894
1904
|
]),
|
|
1895
1905
|
default: t(() => [
|
|
1896
|
-
|
|
1906
|
+
m(" " + s(e(l)("connect.install-in", { client: e(l)("connect.cursor-title") })), 1)
|
|
1897
1907
|
]),
|
|
1898
1908
|
_: 1
|
|
1899
1909
|
}, 8, ["href", "disabled"]),
|
|
1900
|
-
a(e(
|
|
1901
|
-
href:
|
|
1910
|
+
a(e(M), {
|
|
1911
|
+
href: p.value,
|
|
1902
1912
|
variant: "outline",
|
|
1903
1913
|
disabled: c.value === "",
|
|
1904
1914
|
class: "wx-connect__link"
|
|
@@ -1907,38 +1917,38 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1907
1917
|
a(e(Z), { name: "external-link" })
|
|
1908
1918
|
]),
|
|
1909
1919
|
default: t(() => [
|
|
1910
|
-
|
|
1920
|
+
m(" " + s(e(l)("connect.install-in", { client: e(l)("connect.vscode-title") })), 1)
|
|
1911
1921
|
]),
|
|
1912
1922
|
_: 1
|
|
1913
1923
|
}, 8, ["href", "disabled"])
|
|
1914
1924
|
])
|
|
1915
1925
|
]),
|
|
1916
|
-
a(e(
|
|
1926
|
+
a(e(it), {
|
|
1917
1927
|
type: "info",
|
|
1918
1928
|
title: e(l)("connect.next")
|
|
1919
1929
|
}, {
|
|
1920
1930
|
default: t(() => [
|
|
1921
|
-
W("ol",
|
|
1922
|
-
W("li", null,
|
|
1923
|
-
W("li", null,
|
|
1924
|
-
W("li", null,
|
|
1931
|
+
W("ol", Rt, [
|
|
1932
|
+
W("li", null, s(e(l)("connect.next-1")), 1),
|
|
1933
|
+
W("li", null, s(e(l)("connect.next-2")), 1),
|
|
1934
|
+
W("li", null, s(e(l)("connect.next-3")), 1)
|
|
1925
1935
|
])
|
|
1926
1936
|
]),
|
|
1927
1937
|
_: 1
|
|
1928
1938
|
}, 8, ["title"]),
|
|
1929
|
-
W("section",
|
|
1939
|
+
W("section", Bt, [
|
|
1930
1940
|
a(e(he), {
|
|
1931
1941
|
level: 2,
|
|
1932
1942
|
size: "sm"
|
|
1933
1943
|
}, {
|
|
1934
1944
|
default: t(() => [
|
|
1935
|
-
|
|
1945
|
+
m(s(e(l)("connect.mine")), 1)
|
|
1936
1946
|
]),
|
|
1937
1947
|
_: 1
|
|
1938
1948
|
}),
|
|
1939
1949
|
a(e(Le), { padding: "none" }, {
|
|
1940
1950
|
default: t(() => [
|
|
1941
|
-
a(
|
|
1951
|
+
a(qe, { scope: "mine" })
|
|
1942
1952
|
]),
|
|
1943
1953
|
_: 1
|
|
1944
1954
|
})
|
|
@@ -1948,10 +1958,10 @@ url = "${c.value}"`), O = P(() => {
|
|
|
1948
1958
|
_: 1
|
|
1949
1959
|
}, 8, ["title"]));
|
|
1950
1960
|
}
|
|
1951
|
-
}),
|
|
1952
|
-
function
|
|
1961
|
+
}), Dt = /* @__PURE__ */ pe(Et, [["__scopeId", "data-v-92d62c98"]]);
|
|
1962
|
+
function na(n = {}) {
|
|
1953
1963
|
const u = n.path ?? "/admins", l = (o) => ({
|
|
1954
|
-
render: () =>
|
|
1964
|
+
render: () => Be(At, {
|
|
1955
1965
|
base: u,
|
|
1956
1966
|
current: o,
|
|
1957
1967
|
avatarField: n.avatarField,
|
|
@@ -1975,15 +1985,15 @@ function ta(n = {}) {
|
|
|
1975
1985
|
]
|
|
1976
1986
|
};
|
|
1977
1987
|
}
|
|
1978
|
-
function
|
|
1988
|
+
function oa(n = {}) {
|
|
1979
1989
|
const u = n.path ?? "/connect";
|
|
1980
1990
|
return {
|
|
1981
1991
|
id: "connect",
|
|
1982
1992
|
path: u,
|
|
1983
|
-
routes: [{ path: u, name: "webx.connect", component:
|
|
1993
|
+
routes: [{ path: u, name: "webx.connect", component: Dt }]
|
|
1984
1994
|
};
|
|
1985
1995
|
}
|
|
1986
|
-
const
|
|
1996
|
+
const Nt = /* @__PURE__ */ X({
|
|
1987
1997
|
__name: "AdminPicker",
|
|
1988
1998
|
props: {
|
|
1989
1999
|
multiple: { type: Boolean, default: !1 },
|
|
@@ -1991,30 +2001,30 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
1991
2001
|
resolveAvatar: { type: Function, default: void 0 }
|
|
1992
2002
|
},
|
|
1993
2003
|
setup(n) {
|
|
1994
|
-
const u = n, { open: l, resolve: o, dismiss:
|
|
2004
|
+
const u = n, { open: l, resolve: o, dismiss: b } = ge();
|
|
1995
2005
|
te();
|
|
1996
|
-
const c =
|
|
1997
|
-
function
|
|
1998
|
-
o(
|
|
2006
|
+
const c = J("webx-auth"), z = re("list"), r = T(0);
|
|
2007
|
+
function f(p) {
|
|
2008
|
+
o(p);
|
|
1999
2009
|
}
|
|
2000
|
-
function
|
|
2001
|
-
r.value =
|
|
2010
|
+
function F(p) {
|
|
2011
|
+
r.value = p.length;
|
|
2002
2012
|
}
|
|
2003
|
-
return (
|
|
2013
|
+
return (p, g) => (h(), V(e(we), {
|
|
2004
2014
|
open: e(l),
|
|
2005
|
-
"onUpdate:open":
|
|
2015
|
+
"onUpdate:open": g[2] || (g[2] = (w) => be(l) ? l.value = w : null),
|
|
2006
2016
|
title: n.title ?? e(c)(n.multiple ? "admins.select-many" : "admins.select-one"),
|
|
2007
2017
|
width: 880
|
|
2008
|
-
},
|
|
2018
|
+
}, Re({
|
|
2009
2019
|
default: t(() => [
|
|
2010
|
-
a(
|
|
2020
|
+
a(Je, {
|
|
2011
2021
|
ref_key: "list",
|
|
2012
|
-
ref:
|
|
2022
|
+
ref: z,
|
|
2013
2023
|
picking: "",
|
|
2014
2024
|
multiple: n.multiple,
|
|
2015
2025
|
"resolve-avatar": u.resolveAvatar,
|
|
2016
|
-
onChosen:
|
|
2017
|
-
onSelection:
|
|
2026
|
+
onChosen: f,
|
|
2027
|
+
onSelection: F
|
|
2018
2028
|
}, null, 8, ["multiple", "resolve-avatar"])
|
|
2019
2029
|
]),
|
|
2020
2030
|
_: 2
|
|
@@ -2032,26 +2042,26 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
2032
2042
|
tone: "muted"
|
|
2033
2043
|
}, {
|
|
2034
2044
|
default: t(() => [
|
|
2035
|
-
|
|
2045
|
+
m(s(e(c)("admins.chosen", { count: r.value })), 1)
|
|
2036
2046
|
]),
|
|
2037
2047
|
_: 1
|
|
2038
2048
|
}),
|
|
2039
|
-
a(e(
|
|
2049
|
+
a(e(M), {
|
|
2040
2050
|
variant: "outline",
|
|
2041
|
-
onClick:
|
|
2051
|
+
onClick: g[0] || (g[0] = (w) => e(b)())
|
|
2042
2052
|
}, {
|
|
2043
2053
|
default: t(() => [
|
|
2044
|
-
|
|
2054
|
+
m(s(e(c)("admins.cancel")), 1)
|
|
2045
2055
|
]),
|
|
2046
2056
|
_: 1
|
|
2047
2057
|
}),
|
|
2048
|
-
a(e(
|
|
2058
|
+
a(e(M), {
|
|
2049
2059
|
type: "primary",
|
|
2050
2060
|
disabled: r.value === 0,
|
|
2051
|
-
onClick:
|
|
2061
|
+
onClick: g[1] || (g[1] = (w) => e(o)(z.value?.chosen() ?? []))
|
|
2052
2062
|
}, {
|
|
2053
2063
|
default: t(() => [
|
|
2054
|
-
|
|
2064
|
+
m(s(e(c)("admins.save")), 1)
|
|
2055
2065
|
]),
|
|
2056
2066
|
_: 1
|
|
2057
2067
|
}, 8, ["disabled"])
|
|
@@ -2063,103 +2073,103 @@ const Dt = /* @__PURE__ */ Q({
|
|
|
2063
2073
|
} : void 0
|
|
2064
2074
|
]), 1032, ["open", "title"]));
|
|
2065
2075
|
}
|
|
2066
|
-
}),
|
|
2067
|
-
async function
|
|
2068
|
-
return (await
|
|
2076
|
+
}), Qe = $e(Nt);
|
|
2077
|
+
async function sa(n = {}) {
|
|
2078
|
+
return (await Qe({ ...n, multiple: !1 }))?.[0];
|
|
2069
2079
|
}
|
|
2070
|
-
function
|
|
2071
|
-
return
|
|
2080
|
+
function ia(n = {}) {
|
|
2081
|
+
return Qe({ ...n, multiple: !0 });
|
|
2072
2082
|
}
|
|
2073
|
-
const
|
|
2083
|
+
const It = { class: "wx-profile-host" }, Mt = { class: "wx-profile" }, Ht = {
|
|
2074
2084
|
key: 0,
|
|
2075
2085
|
class: "wx-profile__aside"
|
|
2076
|
-
},
|
|
2086
|
+
}, Kt = { class: "wx-profile__fields" }, Yt = /* @__PURE__ */ X({
|
|
2077
2087
|
__name: "ProfileDialog",
|
|
2078
2088
|
props: {
|
|
2079
2089
|
avatarField: { default: void 0 }
|
|
2080
2090
|
},
|
|
2081
2091
|
setup(n) {
|
|
2082
|
-
const u = n, { resolve: l, dismiss: o, open:
|
|
2092
|
+
const u = n, { resolve: l, dismiss: o, open: b } = ge(), c = ee(), z = Ae();
|
|
2083
2093
|
te();
|
|
2084
|
-
const r =
|
|
2094
|
+
const r = J("webx-auth"), f = ve(), F = T(!1), p = T({}), g = T({
|
|
2085
2095
|
name: c.state.user?.name ?? "",
|
|
2086
2096
|
avatar: c.state.user?.avatar ?? null,
|
|
2087
2097
|
password: "",
|
|
2088
2098
|
current_password: ""
|
|
2089
|
-
}), w = T(
|
|
2090
|
-
function
|
|
2091
|
-
return
|
|
2099
|
+
}), w = T(g.value.avatar ? { path: g.value.avatar } : null);
|
|
2100
|
+
function d(y) {
|
|
2101
|
+
return p.value[y]?.[0];
|
|
2092
2102
|
}
|
|
2093
|
-
async function
|
|
2094
|
-
|
|
2103
|
+
async function x() {
|
|
2104
|
+
F.value = !0, p.value = {};
|
|
2095
2105
|
try {
|
|
2096
|
-
await
|
|
2097
|
-
name:
|
|
2106
|
+
await z.updateProfile({
|
|
2107
|
+
name: g.value.name,
|
|
2098
2108
|
avatar: w.value?.path ?? null,
|
|
2099
2109
|
// Blank is left out entirely rather than sent as an empty string: the server reads a
|
|
2100
2110
|
// filled password as "change it", and an empty one would be a change to nothing.
|
|
2101
|
-
...
|
|
2102
|
-
}),
|
|
2103
|
-
} catch (
|
|
2104
|
-
const
|
|
2105
|
-
|
|
2111
|
+
...g.value.password ? { password: g.value.password, current_password: g.value.current_password } : {}
|
|
2112
|
+
}), Q.success(r("profile.saved")), l(!0);
|
|
2113
|
+
} catch (y) {
|
|
2114
|
+
const _ = y.body;
|
|
2115
|
+
_?.errors ? p.value = _.errors : Q.danger(f(y));
|
|
2106
2116
|
} finally {
|
|
2107
|
-
|
|
2117
|
+
F.value = !1;
|
|
2108
2118
|
}
|
|
2109
2119
|
}
|
|
2110
|
-
return (
|
|
2111
|
-
open: e(
|
|
2112
|
-
"onUpdate:open":
|
|
2120
|
+
return (y, _) => (h(), V(e(we), {
|
|
2121
|
+
open: e(b),
|
|
2122
|
+
"onUpdate:open": _[5] || (_[5] = (L) => be(b) ? b.value = L : null),
|
|
2113
2123
|
title: e(r)("profile.title"),
|
|
2114
2124
|
width: 560
|
|
2115
2125
|
}, {
|
|
2116
2126
|
footer: t(() => [
|
|
2117
|
-
a(e(
|
|
2118
|
-
onClick:
|
|
2127
|
+
a(e(M), {
|
|
2128
|
+
onClick: _[4] || (_[4] = (L) => e(o)())
|
|
2119
2129
|
}, {
|
|
2120
2130
|
default: t(() => [
|
|
2121
|
-
|
|
2131
|
+
m(s(e(r)("profile.cancel")), 1)
|
|
2122
2132
|
]),
|
|
2123
2133
|
_: 1
|
|
2124
2134
|
}),
|
|
2125
|
-
a(e(
|
|
2135
|
+
a(e(M), {
|
|
2126
2136
|
type: "primary",
|
|
2127
|
-
loading:
|
|
2128
|
-
onClick:
|
|
2137
|
+
loading: F.value,
|
|
2138
|
+
onClick: x
|
|
2129
2139
|
}, {
|
|
2130
2140
|
default: t(() => [
|
|
2131
|
-
|
|
2141
|
+
m(s(e(r)("profile.save")), 1)
|
|
2132
2142
|
]),
|
|
2133
2143
|
_: 1
|
|
2134
2144
|
}, 8, ["loading"])
|
|
2135
2145
|
]),
|
|
2136
2146
|
default: t(() => [
|
|
2137
|
-
W("div",
|
|
2138
|
-
W("div",
|
|
2139
|
-
u.avatarField ? (
|
|
2140
|
-
(
|
|
2147
|
+
W("div", It, [
|
|
2148
|
+
W("div", Mt, [
|
|
2149
|
+
u.avatarField ? (h(), G("div", Ht, [
|
|
2150
|
+
(h(), V(Oe(u.avatarField), {
|
|
2141
2151
|
modelValue: w.value,
|
|
2142
|
-
"onUpdate:modelValue":
|
|
2152
|
+
"onUpdate:modelValue": _[0] || (_[0] = (L) => w.value = L),
|
|
2143
2153
|
label: e(r)("profile.avatar"),
|
|
2144
2154
|
aspect: "1/1",
|
|
2145
2155
|
captions: !1
|
|
2146
2156
|
}, null, 8, ["modelValue", "label"]))
|
|
2147
2157
|
])) : E("", !0),
|
|
2148
|
-
W("div",
|
|
2149
|
-
a(e(
|
|
2158
|
+
W("div", Kt, [
|
|
2159
|
+
a(e(K), {
|
|
2150
2160
|
label: e(r)("profile.name"),
|
|
2151
|
-
error:
|
|
2161
|
+
error: d("name")
|
|
2152
2162
|
}, {
|
|
2153
2163
|
default: t(() => [
|
|
2154
2164
|
a(e(le), {
|
|
2155
|
-
modelValue:
|
|
2156
|
-
"onUpdate:modelValue":
|
|
2165
|
+
modelValue: g.value.name,
|
|
2166
|
+
"onUpdate:modelValue": _[1] || (_[1] = (L) => g.value.name = L),
|
|
2157
2167
|
name: "name"
|
|
2158
2168
|
}, null, 8, ["modelValue"])
|
|
2159
2169
|
]),
|
|
2160
2170
|
_: 1
|
|
2161
2171
|
}, 8, ["label", "error"]),
|
|
2162
|
-
a(e(
|
|
2172
|
+
a(e(K), {
|
|
2163
2173
|
label: e(r)("admins.email")
|
|
2164
2174
|
}, {
|
|
2165
2175
|
default: t(() => [
|
|
@@ -2170,31 +2180,31 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2170
2180
|
]),
|
|
2171
2181
|
_: 1
|
|
2172
2182
|
}, 8, ["label"]),
|
|
2173
|
-
a(e(
|
|
2183
|
+
a(e(K), {
|
|
2174
2184
|
label: e(r)("profile.password"),
|
|
2175
2185
|
help: e(r)("profile.password-hint"),
|
|
2176
|
-
error:
|
|
2186
|
+
error: d("password")
|
|
2177
2187
|
}, {
|
|
2178
2188
|
default: t(() => [
|
|
2179
2189
|
a(e(le), {
|
|
2180
|
-
modelValue:
|
|
2181
|
-
"onUpdate:modelValue":
|
|
2190
|
+
modelValue: g.value.password,
|
|
2191
|
+
"onUpdate:modelValue": _[2] || (_[2] = (L) => g.value.password = L),
|
|
2182
2192
|
type: "password",
|
|
2183
2193
|
autocomplete: "new-password"
|
|
2184
2194
|
}, null, 8, ["modelValue"])
|
|
2185
2195
|
]),
|
|
2186
2196
|
_: 1
|
|
2187
2197
|
}, 8, ["label", "help", "error"]),
|
|
2188
|
-
|
|
2198
|
+
g.value.password ? (h(), V(e(K), {
|
|
2189
2199
|
key: 0,
|
|
2190
2200
|
label: e(r)("profile.current-password"),
|
|
2191
2201
|
help: e(r)("profile.current-password-hint"),
|
|
2192
|
-
error:
|
|
2202
|
+
error: d("current_password")
|
|
2193
2203
|
}, {
|
|
2194
2204
|
default: t(() => [
|
|
2195
2205
|
a(e(le), {
|
|
2196
|
-
modelValue:
|
|
2197
|
-
"onUpdate:modelValue":
|
|
2206
|
+
modelValue: g.value.current_password,
|
|
2207
|
+
"onUpdate:modelValue": _[3] || (_[3] = (L) => g.value.current_password = L),
|
|
2198
2208
|
type: "password",
|
|
2199
2209
|
autocomplete: "current-password"
|
|
2200
2210
|
}, null, 8, ["modelValue"])
|
|
@@ -2208,10 +2218,7 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2208
2218
|
_: 1
|
|
2209
2219
|
}, 8, ["open", "title"]));
|
|
2210
2220
|
}
|
|
2211
|
-
}),
|
|
2212
|
-
key: 0,
|
|
2213
|
-
class: "wx-user-menu__name"
|
|
2214
|
-
}, Jt = /* @__PURE__ */ Q({
|
|
2221
|
+
}), jt = /* @__PURE__ */ pe(Yt, [["__scopeId", "data-v-9583a67a"]]), Gt = ["title"], Jt = { class: "wx-user-menu__who" }, qt = { class: "wx-user-menu__name" }, Qt = { class: "wx-user-menu__email" }, Xt = /* @__PURE__ */ X({
|
|
2215
2222
|
__name: "UserMenu",
|
|
2216
2223
|
props: {
|
|
2217
2224
|
signOutLabel: { default: void 0 },
|
|
@@ -2220,88 +2227,98 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2220
2227
|
expanded: { type: Boolean, default: !1 }
|
|
2221
2228
|
},
|
|
2222
2229
|
setup(n) {
|
|
2223
|
-
const u = n, l = ee(), o = Ae(),
|
|
2224
|
-
() =>
|
|
2225
|
-
),
|
|
2230
|
+
const u = n, l = ee(), o = Ae(), b = Ee(), c = at(), z = J("webx-auth"), r = b.scope("webx-admin"), f = U(() => l.state.user), F = U(
|
|
2231
|
+
() => b.state.panelLocales.length > 1 ? b.state.panelLocales : []
|
|
2232
|
+
), p = ye(He, null), g = ye(Ke, null), w = T(void 0);
|
|
2226
2233
|
ue(
|
|
2227
|
-
() => typeof
|
|
2228
|
-
async (
|
|
2229
|
-
const
|
|
2230
|
-
if (
|
|
2234
|
+
() => typeof f.value?.avatar == "string" ? f.value.avatar : null,
|
|
2235
|
+
async (L) => {
|
|
2236
|
+
const $ = u.resolveAvatar ?? p;
|
|
2237
|
+
if (L === null || L === "" || $ === null) {
|
|
2231
2238
|
w.value = void 0;
|
|
2232
2239
|
return;
|
|
2233
2240
|
}
|
|
2234
|
-
const
|
|
2235
|
-
|
|
2241
|
+
const O = await $(L);
|
|
2242
|
+
f.value?.avatar === L && (w.value = O ?? void 0);
|
|
2236
2243
|
},
|
|
2237
2244
|
{ immediate: !0 }
|
|
2238
2245
|
);
|
|
2239
|
-
const
|
|
2240
|
-
function
|
|
2246
|
+
const d = $e(jt);
|
|
2247
|
+
function x() {
|
|
2241
2248
|
setTimeout(
|
|
2242
2249
|
() => {
|
|
2243
|
-
|
|
2250
|
+
d({ avatarField: u.avatarField ?? g ?? void 0 });
|
|
2244
2251
|
},
|
|
2245
2252
|
0
|
|
2246
2253
|
);
|
|
2247
2254
|
}
|
|
2248
|
-
const
|
|
2255
|
+
const y = U({
|
|
2249
2256
|
get: () => c.state.preference,
|
|
2250
|
-
set: (
|
|
2251
|
-
c.set(
|
|
2257
|
+
set: (L) => {
|
|
2258
|
+
c.set(L), o.setTheme(L);
|
|
2252
2259
|
}
|
|
2253
2260
|
});
|
|
2254
|
-
async function
|
|
2255
|
-
|
|
2261
|
+
async function _(L) {
|
|
2262
|
+
L !== b.state.locale && await o.setLocale(L);
|
|
2256
2263
|
}
|
|
2257
|
-
return (
|
|
2258
|
-
const
|
|
2259
|
-
return
|
|
2264
|
+
return (L, $) => {
|
|
2265
|
+
const O = H("wx-avatar"), i = H("wx-icon"), v = H("wx-text"), A = H("wx-dropdown-item"), I = H("wx-divider"), Y = H("wx-dropdown");
|
|
2266
|
+
return f.value !== null ? (h(), V(Y, { key: 0 }, {
|
|
2260
2267
|
trigger: t(() => [
|
|
2261
2268
|
W("button", {
|
|
2262
2269
|
type: "button",
|
|
2263
|
-
class:
|
|
2264
|
-
title:
|
|
2270
|
+
class: Fe(["wx-user-menu__trigger", { "wx-user-menu__trigger--named": n.expanded }]),
|
|
2271
|
+
title: f.value.name
|
|
2265
2272
|
}, [
|
|
2266
|
-
a(
|
|
2267
|
-
name:
|
|
2273
|
+
a(O, {
|
|
2274
|
+
name: f.value.name,
|
|
2268
2275
|
src: w.value,
|
|
2269
2276
|
size: "lg"
|
|
2270
2277
|
}, null, 8, ["name", "src"]),
|
|
2271
|
-
n.expanded ? (
|
|
2272
|
-
|
|
2278
|
+
n.expanded ? (h(), G(ce, { key: 0 }, [
|
|
2279
|
+
W("span", Jt, [
|
|
2280
|
+
W("span", qt, s(f.value.name), 1),
|
|
2281
|
+
W("span", Qt, s(f.value.email), 1)
|
|
2282
|
+
]),
|
|
2283
|
+
a(i, {
|
|
2284
|
+
name: "chevron-up",
|
|
2285
|
+
size: "sm",
|
|
2286
|
+
class: "wx-user-menu__chevron"
|
|
2287
|
+
})
|
|
2288
|
+
], 64)) : E("", !0)
|
|
2289
|
+
], 10, Gt)
|
|
2273
2290
|
]),
|
|
2274
2291
|
default: t(() => [
|
|
2275
|
-
a(
|
|
2292
|
+
a(A, { disabled: "" }, {
|
|
2276
2293
|
default: t(() => [
|
|
2277
|
-
a(
|
|
2294
|
+
a(v, { size: "sm" }, {
|
|
2278
2295
|
default: t(() => [
|
|
2279
|
-
|
|
2296
|
+
m(s(f.value.email), 1)
|
|
2280
2297
|
]),
|
|
2281
2298
|
_: 1
|
|
2282
2299
|
})
|
|
2283
2300
|
]),
|
|
2284
2301
|
_: 1
|
|
2285
2302
|
}),
|
|
2286
|
-
a(
|
|
2287
|
-
a(
|
|
2303
|
+
a(I, { spacing: "sm" }),
|
|
2304
|
+
a(A, {
|
|
2288
2305
|
icon: "user",
|
|
2289
|
-
onClick:
|
|
2306
|
+
onClick: x
|
|
2290
2307
|
}, {
|
|
2291
2308
|
default: t(() => [
|
|
2292
|
-
|
|
2309
|
+
m(s(e(z)("profile.menu")), 1)
|
|
2293
2310
|
]),
|
|
2294
2311
|
_: 1
|
|
2295
2312
|
}),
|
|
2296
|
-
a(
|
|
2297
|
-
a(
|
|
2313
|
+
a(I, { spacing: "sm" }),
|
|
2314
|
+
a(A, { disabled: "" }, {
|
|
2298
2315
|
default: t(() => [
|
|
2299
|
-
a(
|
|
2316
|
+
a(v, {
|
|
2300
2317
|
size: "sm",
|
|
2301
2318
|
tone: "muted"
|
|
2302
2319
|
}, {
|
|
2303
2320
|
default: t(() => [
|
|
2304
|
-
|
|
2321
|
+
m(s(e(r)("theme.label")), 1)
|
|
2305
2322
|
]),
|
|
2306
2323
|
_: 1
|
|
2307
2324
|
})
|
|
@@ -2310,12 +2327,12 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2310
2327
|
}),
|
|
2311
2328
|
W("div", {
|
|
2312
2329
|
class: "wx-user-menu__theme",
|
|
2313
|
-
onClick:
|
|
2330
|
+
onClick: $[1] || ($[1] = Pe(() => {
|
|
2314
2331
|
}, ["stop"]))
|
|
2315
2332
|
}, [
|
|
2316
|
-
a(e(
|
|
2317
|
-
modelValue:
|
|
2318
|
-
"onUpdate:modelValue":
|
|
2333
|
+
a(e(rt), {
|
|
2334
|
+
modelValue: y.value,
|
|
2335
|
+
"onUpdate:modelValue": $[0] || ($[0] = (D) => y.value = D),
|
|
2319
2336
|
size: "sm",
|
|
2320
2337
|
block: "",
|
|
2321
2338
|
"aria-label": e(r)("theme.label"),
|
|
@@ -2324,40 +2341,40 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2324
2341
|
"system-label": e(r)("theme.system")
|
|
2325
2342
|
}, null, 8, ["modelValue", "aria-label", "light-label", "dark-label", "system-label"])
|
|
2326
2343
|
]),
|
|
2327
|
-
|
|
2328
|
-
a(
|
|
2329
|
-
a(
|
|
2344
|
+
F.value.length > 0 ? (h(), G(ce, { key: 0 }, [
|
|
2345
|
+
a(I, { spacing: "sm" }),
|
|
2346
|
+
a(A, { disabled: "" }, {
|
|
2330
2347
|
default: t(() => [
|
|
2331
|
-
a(
|
|
2348
|
+
a(v, {
|
|
2332
2349
|
size: "sm",
|
|
2333
2350
|
tone: "muted"
|
|
2334
2351
|
}, {
|
|
2335
2352
|
default: t(() => [
|
|
2336
|
-
|
|
2353
|
+
m(s(e(z)("menu.language")), 1)
|
|
2337
2354
|
]),
|
|
2338
2355
|
_: 1
|
|
2339
2356
|
})
|
|
2340
2357
|
]),
|
|
2341
2358
|
_: 1
|
|
2342
2359
|
}),
|
|
2343
|
-
(
|
|
2360
|
+
(h(!0), G(ce, null, _e(F.value, (D) => (h(), V(A, {
|
|
2344
2361
|
key: D.code,
|
|
2345
|
-
icon: D.code === e(
|
|
2346
|
-
onClick: (
|
|
2362
|
+
icon: D.code === e(b).state.locale ? "check" : void 0,
|
|
2363
|
+
onClick: (k) => _(D.code)
|
|
2347
2364
|
}, {
|
|
2348
2365
|
default: t(() => [
|
|
2349
|
-
|
|
2366
|
+
m(s(D.nativeName), 1)
|
|
2350
2367
|
]),
|
|
2351
2368
|
_: 2
|
|
2352
2369
|
}, 1032, ["icon", "onClick"]))), 128)),
|
|
2353
|
-
a(
|
|
2370
|
+
a(I, { spacing: "sm" })
|
|
2354
2371
|
], 64)) : E("", !0),
|
|
2355
|
-
a(
|
|
2372
|
+
a(A, {
|
|
2356
2373
|
icon: "logout",
|
|
2357
|
-
onClick:
|
|
2374
|
+
onClick: $[2] || ($[2] = (D) => e(o).logout())
|
|
2358
2375
|
}, {
|
|
2359
2376
|
default: t(() => [
|
|
2360
|
-
|
|
2377
|
+
m(s(n.signOutLabel ?? e(z)("menu.sign-out")), 1)
|
|
2361
2378
|
]),
|
|
2362
2379
|
_: 1
|
|
2363
2380
|
})
|
|
@@ -2366,39 +2383,44 @@ const Nt = { class: "wx-profile-host" }, It = { class: "wx-profile" }, Mt = {
|
|
|
2366
2383
|
})) : E("", !0);
|
|
2367
2384
|
};
|
|
2368
2385
|
}
|
|
2369
|
-
}),
|
|
2370
|
-
function
|
|
2386
|
+
}), ra = /* @__PURE__ */ pe(Xt, [["__scopeId", "data-v-09f012fd"]]);
|
|
2387
|
+
function ua(n = {}) {
|
|
2371
2388
|
const u = n.path ?? "/login";
|
|
2372
2389
|
return {
|
|
2373
2390
|
install(l) {
|
|
2374
|
-
const o =
|
|
2375
|
-
l.i18n.defaults("webx-auth",
|
|
2391
|
+
const o = ut(l.context);
|
|
2392
|
+
l.i18n.defaults("webx-auth", Ge), ct(
|
|
2393
|
+
l.app,
|
|
2394
|
+
o,
|
|
2395
|
+
n.resolveAvatar ?? je(l.context),
|
|
2396
|
+
n.avatarField ?? Ye(l.context)
|
|
2397
|
+
), l.context.useSessionLoader(() => o.me()), l.router.addRoute({
|
|
2376
2398
|
path: u,
|
|
2377
2399
|
name: "webx.login",
|
|
2378
2400
|
meta: { public: !0 },
|
|
2379
|
-
component: { render: () =>
|
|
2380
|
-
}), l.router.beforeEach((
|
|
2401
|
+
component: { render: () => Be(pt, { ...n.card }) }
|
|
2402
|
+
}), l.router.beforeEach((b) => b.meta.public === !0 || l.context.state.status !== "unauthenticated" ? !0 : { path: u, query: b.fullPath === "/" ? {} : { next: b.fullPath } }), ue(
|
|
2381
2403
|
() => l.context.state.status,
|
|
2382
|
-
(
|
|
2404
|
+
(b) => {
|
|
2383
2405
|
const c = l.router.currentRoute.value;
|
|
2384
|
-
if (
|
|
2406
|
+
if (b === "unauthenticated" && c.path !== u) {
|
|
2385
2407
|
l.router.replace({ path: u, query: { next: c.fullPath } });
|
|
2386
2408
|
return;
|
|
2387
2409
|
}
|
|
2388
|
-
if (
|
|
2389
|
-
const
|
|
2390
|
-
if (typeof
|
|
2391
|
-
location.assign(
|
|
2410
|
+
if (b === "ready" && c.path === u) {
|
|
2411
|
+
const z = c.query.next;
|
|
2412
|
+
if (typeof z == "string" && Zt(z)) {
|
|
2413
|
+
location.assign(z);
|
|
2392
2414
|
return;
|
|
2393
2415
|
}
|
|
2394
|
-
l.router.replace(typeof
|
|
2416
|
+
l.router.replace(typeof z == "string" ? z : "/");
|
|
2395
2417
|
}
|
|
2396
2418
|
}
|
|
2397
2419
|
);
|
|
2398
2420
|
}
|
|
2399
2421
|
};
|
|
2400
2422
|
}
|
|
2401
|
-
function
|
|
2423
|
+
function Zt(n) {
|
|
2402
2424
|
if (!/^https?:\/\//i.test(n))
|
|
2403
2425
|
return !1;
|
|
2404
2426
|
try {
|
|
@@ -2408,27 +2430,27 @@ function qt(n) {
|
|
|
2408
2430
|
}
|
|
2409
2431
|
}
|
|
2410
2432
|
export {
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2433
|
+
Je as WxAdminList,
|
|
2434
|
+
At as WxAdminsPage,
|
|
2435
|
+
kt as WxAgentCallList,
|
|
2436
|
+
Dt as WxConnectPage,
|
|
2437
|
+
qe as WxConnectionList,
|
|
2438
|
+
pt as WxLoginCard,
|
|
2439
|
+
jt as WxProfileDialog,
|
|
2440
|
+
ra as WxUserMenu,
|
|
2441
|
+
na as admins,
|
|
2442
|
+
ua as auth,
|
|
2443
|
+
Me as authKey,
|
|
2444
|
+
Ge as authMessages,
|
|
2445
|
+
Ke as avatarFieldKey,
|
|
2446
|
+
He as avatarResolverKey,
|
|
2447
|
+
oa as connect,
|
|
2426
2448
|
fe as createAdminsApi,
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2449
|
+
ut as createAuthSession,
|
|
2450
|
+
Ct as createConnectionsApi,
|
|
2451
|
+
ct as provideAuth,
|
|
2452
|
+
sa as selectAdmin,
|
|
2453
|
+
ia as selectAdmins,
|
|
2432
2454
|
Ae as useAuth
|
|
2433
2455
|
};
|
|
2434
2456
|
//# sourceMappingURL=index.js.map
|