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