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