@webx-ui/module-auth 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdminsPage.d.ts +16 -2
- package/dist/KeyDialog.d.ts +2 -0
- package/dist/KeyList.d.ts +7 -0
- package/dist/clipboard.d.ts +8 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1682 -1073
- package/dist/index.js.map +1 -1
- package/dist/keys.d.ts +12 -0
- package/dist/module.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/types.d.ts +47 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { useTranslate as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { useModal as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
1
|
+
import { inject as xe, defineComponent as Q, computed as T, ref as A, useTemplateRef as oe, onBeforeUnmount as nt, resolveComponent as J, openBlock as m, createBlock as b, withCtx as t, createVNode as a, withModifiers as Oe, createCommentVNode as I, createElementVNode as S, createTextVNode as c, toDisplayString as i, watch as de, unref as e, isRef as Ve, normalizeClass as Be, createElementBlock as H, resolveDynamicComponent as Ee, createSlots as Ae, Fragment as ue, renderList as Ce, onMounted as Ie, h as De } from "vue";
|
|
2
|
+
import { useTranslate as G, HttpError as st, useAdmin as X, useI18n as Ne, useErrorText as re, rowMenuWidth as ot, WxDate as ae, WxRowMenu as Se, WxFilterChips as Me, WxListScreen as Ke, WxScreen as it, useTheme as ut } from "@webx-ui/module-admin";
|
|
3
|
+
import { useRouter as rt, useRoute as ct } from "vue-router";
|
|
4
|
+
import { useModal as _e, WxDialog as be, WxFormItem as M, WxInput as le, WxSelect as ne, WxSpace as se, WxCheckbox as Le, WxText as E, WxButton as N, toast as K, useElementWidth as ge, WxTable as ke, WxEntityCard as we, WxBadge as q, WxAvatar as dt, WxIcon as Z, confirm as ze, WxAlert as qe, WxRadioGroup as mt, createModal as he, WxHeading as me, WxCard as $e, WxSkeleton as vt, WxTabs as pt, WxTab as ye, WxThemeSwitch as ft } from "@webx-ui/core";
|
|
5
|
+
const He = /* @__PURE__ */ Symbol("webx-auth");
|
|
6
|
+
function We() {
|
|
7
|
+
const s = xe(He, null);
|
|
8
|
+
if (s === null)
|
|
9
9
|
throw new Error("useAuth() was called outside a panel that installed the auth plugin.");
|
|
10
|
-
return
|
|
10
|
+
return s;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
12
|
+
function yt(s) {
|
|
13
|
+
const r = `${s.apiPath}/auth`;
|
|
14
14
|
return {
|
|
15
15
|
async me() {
|
|
16
16
|
try {
|
|
17
|
-
return (await
|
|
17
|
+
return (await s.http.get(`${r}/me`)).data;
|
|
18
18
|
} catch (l) {
|
|
19
|
-
if (
|
|
19
|
+
if (_t(l))
|
|
20
20
|
return null;
|
|
21
21
|
throw l;
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
async login(l) {
|
|
25
|
-
const
|
|
25
|
+
const u = await s.http.post(`${r}/login`, {
|
|
26
26
|
email: l.email,
|
|
27
27
|
password: l.password,
|
|
28
28
|
remember: l.remember ?? !1
|
|
29
29
|
});
|
|
30
|
-
return
|
|
30
|
+
return s.setUser(u.data), await s.reload(), u.data;
|
|
31
31
|
},
|
|
32
32
|
async setLocale(l) {
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const u = await s.http.put(`${r}/locale`, { locale: l });
|
|
34
|
+
s.setUser(u.data), await s.setLocale(l);
|
|
35
35
|
},
|
|
36
36
|
async setTheme(l) {
|
|
37
|
-
const
|
|
37
|
+
const u = await s.http.put(`${r}/theme`, {
|
|
38
38
|
theme: l === "system" ? null : l
|
|
39
39
|
});
|
|
40
|
-
|
|
40
|
+
s.setUser(u.data);
|
|
41
41
|
},
|
|
42
42
|
async setSiteBar(l) {
|
|
43
|
-
const
|
|
44
|
-
|
|
43
|
+
const u = await s.http.put(`${r}/site-bar`, { enabled: l });
|
|
44
|
+
s.setUser(u.data);
|
|
45
45
|
},
|
|
46
46
|
async updateProfile(l) {
|
|
47
|
-
const
|
|
48
|
-
`${
|
|
47
|
+
const u = await s.http.put(
|
|
48
|
+
`${r}/me`,
|
|
49
49
|
l
|
|
50
50
|
);
|
|
51
|
-
return
|
|
51
|
+
return s.setUser(u.data), u.data;
|
|
52
52
|
},
|
|
53
53
|
async logout() {
|
|
54
54
|
try {
|
|
55
|
-
await
|
|
55
|
+
await s.http.post(`${r}/logout`);
|
|
56
56
|
} finally {
|
|
57
|
-
|
|
57
|
+
s.setUser(null), s.state.status = "unauthenticated", s.state.manifest = null;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
function
|
|
64
|
-
|
|
62
|
+
const je = /* @__PURE__ */ Symbol("webx-auth-avatar"), Ge = /* @__PURE__ */ Symbol("webx-auth-avatar-field");
|
|
63
|
+
function ht(s, r, l = null, u = null) {
|
|
64
|
+
s.provide(He, r), s.provide(je, l), s.provide(Ge, u);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return typeof
|
|
66
|
+
function _t(s) {
|
|
67
|
+
return typeof s == "object" && s !== null && "status" in s && s.status === 401;
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const bt = ["title", "aria-label", "aria-pressed"], gt = /* @__PURE__ */ Q({
|
|
70
70
|
__name: "LoginCard",
|
|
71
71
|
props: {
|
|
72
72
|
emailLabel: { default: void 0 },
|
|
@@ -81,171 +81,171 @@ const ft = ["title", "aria-label", "aria-pressed"], ht = /* @__PURE__ */ Q({
|
|
|
81
81
|
autofocus: { type: Boolean, default: !0 }
|
|
82
82
|
},
|
|
83
83
|
emits: ["success"],
|
|
84
|
-
setup(
|
|
85
|
-
const
|
|
86
|
-
email:
|
|
87
|
-
password:
|
|
88
|
-
remember:
|
|
89
|
-
submit:
|
|
90
|
-
capsLock:
|
|
91
|
-
reveal:
|
|
92
|
-
hide:
|
|
93
|
-
})),
|
|
94
|
-
let
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
() =>
|
|
84
|
+
setup(s, { expose: r, emit: l }) {
|
|
85
|
+
const u = s, v = l, y = We(), V = G("webx-auth"), o = T(() => ({
|
|
86
|
+
email: u.emailLabel ?? V("card.email"),
|
|
87
|
+
password: u.passwordLabel ?? V("card.password"),
|
|
88
|
+
remember: u.rememberLabel ?? V("card.remember"),
|
|
89
|
+
submit: u.submitLabel ?? V("card.submit"),
|
|
90
|
+
capsLock: u.capsLockWarning ?? V("card.caps-lock"),
|
|
91
|
+
reveal: u.revealLabel ?? V("card.reveal"),
|
|
92
|
+
hide: u.hideLabel ?? V("card.hide")
|
|
93
|
+
})), h = A(""), F = A(""), d = A(!1), w = A(!1), x = A(!1), p = A(!1), g = A(""), _ = A({}), k = A(0), B = oe("emailField");
|
|
94
|
+
let C = null;
|
|
95
|
+
nt(U);
|
|
96
|
+
const O = T(() => k.value > 0), n = T(
|
|
97
|
+
() => u.throttleMessage === void 0 ? V("card.throttled", { seconds: k.value }) : u.throttleMessage.replace(":seconds", String(k.value))
|
|
98
98
|
);
|
|
99
|
-
async function
|
|
100
|
-
if (!(w.value ||
|
|
101
|
-
w.value = !0,
|
|
99
|
+
async function $() {
|
|
100
|
+
if (!(w.value || O.value)) {
|
|
101
|
+
w.value = !0, g.value = "", _.value = {};
|
|
102
102
|
try {
|
|
103
|
-
await
|
|
104
|
-
email:
|
|
105
|
-
password:
|
|
106
|
-
remember:
|
|
107
|
-
}),
|
|
108
|
-
} catch (
|
|
109
|
-
|
|
103
|
+
await y.login({
|
|
104
|
+
email: h.value,
|
|
105
|
+
password: F.value,
|
|
106
|
+
remember: d.value
|
|
107
|
+
}), F.value = "", v("success");
|
|
108
|
+
} catch (f) {
|
|
109
|
+
R(f);
|
|
110
110
|
} finally {
|
|
111
111
|
w.value = !1;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
if (!(
|
|
117
|
-
|
|
115
|
+
function R(f) {
|
|
116
|
+
if (!(f instanceof st)) {
|
|
117
|
+
g.value = f instanceof Error ? f.message : String(f);
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
if (
|
|
121
|
-
|
|
120
|
+
if (f.isValidation) {
|
|
121
|
+
_.value = f.errors;
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
|
|
124
|
+
if (f.isThrottled) {
|
|
125
|
+
Y(f.retryAfter ?? 60);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
|
|
128
|
+
g.value = f.message;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
function Y(f) {
|
|
131
|
+
U(), k.value = f, C = setInterval(() => {
|
|
132
|
+
k.value -= 1, k.value <= 0 && U();
|
|
133
133
|
}, 1e3);
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
135
|
+
function U() {
|
|
136
|
+
C !== null && (clearInterval(C), C = null), k.value = 0;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
138
|
+
function z(f) {
|
|
139
|
+
p.value = f.getModifierState("CapsLock");
|
|
140
140
|
}
|
|
141
|
-
return
|
|
142
|
-
const
|
|
143
|
-
return
|
|
141
|
+
return r({ focus: () => B.value?.focus() }), (f, L) => {
|
|
142
|
+
const W = J("wx-alert"), te = J("wx-icon"), fe = J("wx-input"), D = J("wx-form-item"), j = J("wx-checkbox"), P = J("wx-button"), ie = J("wx-form"), lt = J("wx-card");
|
|
143
|
+
return m(), b(lt, {
|
|
144
144
|
class: "wx-login",
|
|
145
145
|
padding: 24
|
|
146
146
|
}, {
|
|
147
147
|
default: t(() => [
|
|
148
|
-
a(
|
|
149
|
-
errors:
|
|
148
|
+
a(ie, {
|
|
149
|
+
errors: _.value,
|
|
150
150
|
disabled: w.value,
|
|
151
151
|
gap: "md",
|
|
152
|
-
onSubmit:
|
|
152
|
+
onSubmit: Oe($, ["prevent"])
|
|
153
153
|
}, {
|
|
154
154
|
default: t(() => [
|
|
155
|
-
|
|
155
|
+
g.value !== "" ? (m(), b(W, {
|
|
156
156
|
key: 0,
|
|
157
157
|
type: "danger",
|
|
158
158
|
variant: "soft",
|
|
159
159
|
live: "",
|
|
160
|
-
description:
|
|
160
|
+
description: g.value,
|
|
161
161
|
class: "wx-login__message"
|
|
162
|
-
}, null, 8, ["description"])) :
|
|
162
|
+
}, null, 8, ["description"])) : O.value ? (m(), b(W, {
|
|
163
163
|
key: 1,
|
|
164
164
|
type: "warning",
|
|
165
165
|
variant: "soft",
|
|
166
166
|
live: "",
|
|
167
|
-
description:
|
|
167
|
+
description: n.value,
|
|
168
168
|
class: "wx-login__message"
|
|
169
|
-
}, null, 8, ["description"])) :
|
|
170
|
-
a(
|
|
169
|
+
}, null, 8, ["description"])) : I("", !0),
|
|
170
|
+
a(D, { name: "email" }, {
|
|
171
171
|
default: t(() => [
|
|
172
|
-
a(
|
|
172
|
+
a(fe, {
|
|
173
173
|
ref_key: "emailField",
|
|
174
|
-
ref:
|
|
175
|
-
modelValue:
|
|
176
|
-
"onUpdate:modelValue":
|
|
174
|
+
ref: B,
|
|
175
|
+
modelValue: h.value,
|
|
176
|
+
"onUpdate:modelValue": L[0] || (L[0] = (ce) => h.value = ce),
|
|
177
177
|
type: "email",
|
|
178
|
-
placeholder:
|
|
179
|
-
"aria-label":
|
|
178
|
+
placeholder: o.value.email,
|
|
179
|
+
"aria-label": o.value.email,
|
|
180
180
|
autocomplete: "username",
|
|
181
|
-
autofocus:
|
|
181
|
+
autofocus: s.autofocus,
|
|
182
182
|
inputmode: "email",
|
|
183
183
|
size: "lg"
|
|
184
184
|
}, {
|
|
185
185
|
prefix: t(() => [
|
|
186
|
-
a(
|
|
186
|
+
a(te, { name: "mail" })
|
|
187
187
|
]),
|
|
188
188
|
_: 1
|
|
189
189
|
}, 8, ["modelValue", "placeholder", "aria-label", "autofocus"])
|
|
190
190
|
]),
|
|
191
191
|
_: 1
|
|
192
192
|
}),
|
|
193
|
-
a(
|
|
193
|
+
a(D, {
|
|
194
194
|
name: "password",
|
|
195
|
-
help:
|
|
195
|
+
help: p.value ? o.value.capsLock : void 0
|
|
196
196
|
}, {
|
|
197
197
|
default: t(() => [
|
|
198
|
-
a(
|
|
199
|
-
modelValue:
|
|
200
|
-
"onUpdate:modelValue":
|
|
198
|
+
a(fe, {
|
|
199
|
+
modelValue: F.value,
|
|
200
|
+
"onUpdate:modelValue": L[2] || (L[2] = (ce) => F.value = ce),
|
|
201
201
|
type: x.value ? "text" : "password",
|
|
202
|
-
placeholder:
|
|
203
|
-
"aria-label":
|
|
202
|
+
placeholder: o.value.password,
|
|
203
|
+
"aria-label": o.value.password,
|
|
204
204
|
autocomplete: "current-password",
|
|
205
205
|
size: "lg",
|
|
206
|
-
onKeydown:
|
|
207
|
-
onKeyup:
|
|
206
|
+
onKeydown: z,
|
|
207
|
+
onKeyup: z
|
|
208
208
|
}, {
|
|
209
209
|
prefix: t(() => [
|
|
210
|
-
a(
|
|
210
|
+
a(te, { name: "lock" })
|
|
211
211
|
]),
|
|
212
212
|
suffix: t(() => [
|
|
213
|
-
|
|
213
|
+
S("button", {
|
|
214
214
|
type: "button",
|
|
215
215
|
class: "wx-login__reveal",
|
|
216
|
-
title: x.value ?
|
|
217
|
-
"aria-label": x.value ?
|
|
216
|
+
title: x.value ? o.value.hide : o.value.reveal,
|
|
217
|
+
"aria-label": x.value ? o.value.hide : o.value.reveal,
|
|
218
218
|
"aria-pressed": x.value,
|
|
219
219
|
tabindex: "-1",
|
|
220
|
-
onClick:
|
|
220
|
+
onClick: L[1] || (L[1] = (ce) => x.value = !x.value)
|
|
221
221
|
}, [
|
|
222
|
-
a(
|
|
222
|
+
a(te, {
|
|
223
223
|
name: x.value ? "eye-off" : "eye"
|
|
224
224
|
}, null, 8, ["name"])
|
|
225
|
-
], 8,
|
|
225
|
+
], 8, bt)
|
|
226
226
|
]),
|
|
227
227
|
_: 1
|
|
228
228
|
}, 8, ["modelValue", "type", "placeholder", "aria-label"])
|
|
229
229
|
]),
|
|
230
230
|
_: 1
|
|
231
231
|
}, 8, ["help"]),
|
|
232
|
-
|
|
232
|
+
s.remember ? (m(), b(j, {
|
|
233
233
|
key: 2,
|
|
234
|
-
modelValue:
|
|
235
|
-
"onUpdate:modelValue":
|
|
236
|
-
label:
|
|
234
|
+
modelValue: d.value,
|
|
235
|
+
"onUpdate:modelValue": L[3] || (L[3] = (ce) => d.value = ce),
|
|
236
|
+
label: o.value.remember,
|
|
237
237
|
class: "wx-login__remember"
|
|
238
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
239
|
-
a(
|
|
238
|
+
}, null, 8, ["modelValue", "label"])) : I("", !0),
|
|
239
|
+
a(P, {
|
|
240
240
|
type: "primary",
|
|
241
241
|
"native-type": "submit",
|
|
242
242
|
size: "lg",
|
|
243
243
|
block: "",
|
|
244
244
|
loading: w.value,
|
|
245
|
-
disabled:
|
|
245
|
+
disabled: O.value
|
|
246
246
|
}, {
|
|
247
247
|
default: t(() => [
|
|
248
|
-
|
|
248
|
+
c(i(o.value.submit), 1)
|
|
249
249
|
]),
|
|
250
250
|
_: 1
|
|
251
251
|
}, 8, ["loading", "disabled"])
|
|
@@ -257,20 +257,20 @@ const ft = ["title", "aria-label", "aria-pressed"], ht = /* @__PURE__ */ Q({
|
|
|
257
257
|
});
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
|
-
}), ve = (
|
|
261
|
-
const l =
|
|
262
|
-
for (const [
|
|
263
|
-
l[
|
|
260
|
+
}), ve = (s, r) => {
|
|
261
|
+
const l = s.__vccOpts || s;
|
|
262
|
+
for (const [u, v] of r)
|
|
263
|
+
l[u] = v;
|
|
264
264
|
return l;
|
|
265
|
-
},
|
|
266
|
-
function
|
|
267
|
-
return
|
|
265
|
+
}, kt = /* @__PURE__ */ ve(gt, [["__scopeId", "data-v-3c206e31"]]);
|
|
266
|
+
function Ye(s) {
|
|
267
|
+
return s.types["wx-media"]?.component ?? null;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
const
|
|
271
|
-
return
|
|
269
|
+
function Je(s) {
|
|
270
|
+
const r = s.assetUrls;
|
|
271
|
+
return r ? async (l) => (await r([l]))[l] ?? null : null;
|
|
272
272
|
}
|
|
273
|
-
const
|
|
273
|
+
const Qe = {
|
|
274
274
|
card: {
|
|
275
275
|
email: "Email",
|
|
276
276
|
password: "Password",
|
|
@@ -378,6 +378,56 @@ const je = {
|
|
|
378
378
|
done: ":client is disconnected",
|
|
379
379
|
deleted: "Administrator #:id"
|
|
380
380
|
},
|
|
381
|
+
// Keys for programs, issued and revoked under Administrators → Keys.
|
|
382
|
+
keys: {
|
|
383
|
+
title: "Keys",
|
|
384
|
+
issue: "Issue a key",
|
|
385
|
+
"issue-short": "Issue",
|
|
386
|
+
lead: "A key lets a program — a queue watcher, a nightly import — work in this panel without a browser. It acts as the administrator you choose and can never do more than they may. A key is a program, not a person: what a module keeps for a person, such as a stage checked by hand, it cannot do.",
|
|
387
|
+
name: "Name",
|
|
388
|
+
"name-hint": 'What the program is, so that the list says it: "queue watcher", "nightly import".',
|
|
389
|
+
who: "Acts as",
|
|
390
|
+
"who-hint": "Everything the key changes is done in this administrator's name, within their permissions.",
|
|
391
|
+
allowed: "What is allowed",
|
|
392
|
+
everything: "Everything the administrator may do",
|
|
393
|
+
chosen: "Only the scopes chosen below",
|
|
394
|
+
scopes: "Scopes",
|
|
395
|
+
"scopes-hint": "A module installed later is out of reach until a new key names it.",
|
|
396
|
+
"scopes-required": "Choose at least one scope.",
|
|
397
|
+
lifetime: "Lives for",
|
|
398
|
+
"lifetime-hint": "A key cannot be extended: issue a new one before this one runs out, then revoke the old one.",
|
|
399
|
+
"days-30": "30 days",
|
|
400
|
+
"days-90": "90 days",
|
|
401
|
+
"days-365": "1 year",
|
|
402
|
+
"days-1095": "3 years",
|
|
403
|
+
"days-3650": "10 years",
|
|
404
|
+
"issued-title": "Copy the key now",
|
|
405
|
+
"issued-text": "This is the only time the key is shown. Nobody can see it again — not here, not on the server. If it is lost, revoke it and issue a new one.",
|
|
406
|
+
secret: "Key",
|
|
407
|
+
copy: "Copy",
|
|
408
|
+
copied: "Copied",
|
|
409
|
+
"copy-failed": "Could not reach the clipboard. Select the key and copy it by hand.",
|
|
410
|
+
address: "Server address",
|
|
411
|
+
"header-hint": "The program sends the key in a header: Authorization: Bearer <key>.",
|
|
412
|
+
done: "Done",
|
|
413
|
+
cancel: "Cancel",
|
|
414
|
+
expires: "Expires",
|
|
415
|
+
until: "until",
|
|
416
|
+
"last-used": "Last used",
|
|
417
|
+
"never-used": "Never",
|
|
418
|
+
"issued-by": "Issued by :name",
|
|
419
|
+
"issued-console": "Issued in a terminal",
|
|
420
|
+
full: "Everything :name can do",
|
|
421
|
+
deleted: "Administrator #:id",
|
|
422
|
+
revoke: "Revoke",
|
|
423
|
+
revoked: "Revoked",
|
|
424
|
+
expired: "Expired",
|
|
425
|
+
"confirm-title": "Revoke :name?",
|
|
426
|
+
"confirm-text": "The program using it is refused from its next call. A revoked key cannot be switched back on.",
|
|
427
|
+
confirm: "Revoke",
|
|
428
|
+
"revoked-done": ":name is revoked",
|
|
429
|
+
empty: "No keys have been issued"
|
|
430
|
+
},
|
|
381
431
|
connect: {
|
|
382
432
|
lead: "An AI agent — Claude, ChatGPT, Cursor — can work in this panel as you. Give it the address below; it will ask you to sign in and then ask what it may do.",
|
|
383
433
|
title: "Connect an agent",
|
|
@@ -440,56 +490,56 @@ const je = {
|
|
|
440
490
|
"site-bar": "Panel on the site"
|
|
441
491
|
}
|
|
442
492
|
};
|
|
443
|
-
function
|
|
444
|
-
const
|
|
493
|
+
function pe(s) {
|
|
494
|
+
const r = `${s.apiPath}/auth`, l = (u) => u.data;
|
|
445
495
|
return {
|
|
446
|
-
list: (
|
|
496
|
+
list: (u = {}) => s.http.get(`${r}/admins`, {
|
|
447
497
|
query: {
|
|
448
|
-
q:
|
|
449
|
-
role:
|
|
450
|
-
active:
|
|
451
|
-
sort:
|
|
452
|
-
page:
|
|
453
|
-
per_page:
|
|
498
|
+
q: u.q || void 0,
|
|
499
|
+
role: u.role ?? void 0,
|
|
500
|
+
active: u.active ?? void 0,
|
|
501
|
+
sort: u.sort,
|
|
502
|
+
page: u.page,
|
|
503
|
+
per_page: u.per_page
|
|
454
504
|
}
|
|
455
|
-
}).then((
|
|
456
|
-
get: (
|
|
457
|
-
create: (
|
|
458
|
-
update: (
|
|
459
|
-
remove: (
|
|
460
|
-
roles: () =>
|
|
461
|
-
calls: (
|
|
505
|
+
}).then((v) => ({ ...v.meta, data: v.data })),
|
|
506
|
+
get: (u) => s.http.get(`${r}/admins/${u}`).then(l),
|
|
507
|
+
create: (u) => s.http.post(`${r}/admins`, u).then(l),
|
|
508
|
+
update: (u, v) => s.http.patch(`${r}/admins/${u}`, v).then(l),
|
|
509
|
+
remove: (u) => s.http.delete(`${r}/admins/${u}`),
|
|
510
|
+
roles: () => s.http.get(`${r}/roles`).then(l),
|
|
511
|
+
calls: (u = {}) => s.http.get(`${r}/mcp-calls`, {
|
|
462
512
|
query: {
|
|
463
|
-
user:
|
|
464
|
-
tool:
|
|
465
|
-
outcome:
|
|
466
|
-
page:
|
|
467
|
-
per_page:
|
|
513
|
+
user: u.user ?? void 0,
|
|
514
|
+
tool: u.tool ?? void 0,
|
|
515
|
+
outcome: u.outcome ?? void 0,
|
|
516
|
+
page: u.page,
|
|
517
|
+
per_page: u.per_page
|
|
468
518
|
}
|
|
469
|
-
}).then((
|
|
519
|
+
}).then((v) => ({ ...v.meta, data: v.data, filters: v.filters }))
|
|
470
520
|
};
|
|
471
521
|
}
|
|
472
|
-
const
|
|
473
|
-
function
|
|
522
|
+
const Te = /* @__PURE__ */ new WeakSet();
|
|
523
|
+
function ee() {
|
|
474
524
|
try {
|
|
475
|
-
const { i18n:
|
|
476
|
-
|
|
525
|
+
const { i18n: s } = X();
|
|
526
|
+
Te.has(s) || (s.defaults("webx-auth", Qe), Te.add(s));
|
|
477
527
|
} catch {
|
|
478
528
|
}
|
|
479
529
|
}
|
|
480
|
-
const
|
|
530
|
+
const wt = { class: "wx-admin-form" }, xt = {
|
|
481
531
|
key: 0,
|
|
482
532
|
class: "wx-admin-form__aside"
|
|
483
|
-
},
|
|
533
|
+
}, Ct = { class: "wx-admin-form__fields" }, $t = /* @__PURE__ */ Q({
|
|
484
534
|
__name: "AdminDialog",
|
|
485
535
|
props: {
|
|
486
536
|
admin: { default: null },
|
|
487
537
|
avatarField: { default: void 0 }
|
|
488
538
|
},
|
|
489
|
-
setup(
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
const
|
|
539
|
+
setup(s) {
|
|
540
|
+
const r = s, { resolve: l, dismiss: u, open: v } = _e(), y = X(), V = pe(y), o = Ne();
|
|
541
|
+
ee();
|
|
542
|
+
const h = G("webx-auth"), F = re(), d = A([]), w = A(!1), x = A({}), p = A({
|
|
493
543
|
name: "",
|
|
494
544
|
email: "",
|
|
495
545
|
password: "",
|
|
@@ -498,60 +548,60 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
498
548
|
is_super: !1,
|
|
499
549
|
locale: null,
|
|
500
550
|
roles: []
|
|
501
|
-
}),
|
|
502
|
-
get: () =>
|
|
503
|
-
set: (
|
|
504
|
-
|
|
551
|
+
}), g = T({
|
|
552
|
+
get: () => p.value.avatar ? { path: p.value.avatar } : null,
|
|
553
|
+
set: (n) => {
|
|
554
|
+
p.value.avatar = n?.path ?? null;
|
|
505
555
|
}
|
|
506
|
-
}),
|
|
507
|
-
{ value: "auto", label:
|
|
508
|
-
...
|
|
556
|
+
}), _ = T(() => r.admin !== null), k = T(() => d.value.map((n) => ({ value: n.id, label: n.name }))), B = T(() => [
|
|
557
|
+
{ value: "auto", label: h("admins.locale-auto") },
|
|
558
|
+
...o.state.panelLocales.map((n) => ({ value: n.code, label: n.nativeName }))
|
|
509
559
|
]);
|
|
510
|
-
|
|
511
|
-
() =>
|
|
512
|
-
(
|
|
513
|
-
|
|
514
|
-
name:
|
|
515
|
-
email:
|
|
560
|
+
V.roles().then((n) => d.value = n), de(
|
|
561
|
+
() => r.admin,
|
|
562
|
+
(n) => {
|
|
563
|
+
p.value = {
|
|
564
|
+
name: n?.name ?? "",
|
|
565
|
+
email: n?.email ?? "",
|
|
516
566
|
password: "",
|
|
517
|
-
avatar:
|
|
518
|
-
is_active:
|
|
519
|
-
is_super:
|
|
520
|
-
locale:
|
|
521
|
-
roles:
|
|
567
|
+
avatar: n?.avatar ?? null,
|
|
568
|
+
is_active: n?.is_active ?? !0,
|
|
569
|
+
is_super: n?.is_super ?? !1,
|
|
570
|
+
locale: n?.locale ?? "auto",
|
|
571
|
+
roles: n?.roles.map(($) => $.id) ?? []
|
|
522
572
|
}, x.value = {};
|
|
523
573
|
},
|
|
524
574
|
{ immediate: !0 }
|
|
525
575
|
);
|
|
526
|
-
function
|
|
527
|
-
return x.value[
|
|
576
|
+
function C(n) {
|
|
577
|
+
return x.value[n]?.[0];
|
|
528
578
|
}
|
|
529
|
-
async function
|
|
579
|
+
async function O() {
|
|
530
580
|
w.value = !0, x.value = {};
|
|
531
|
-
const
|
|
532
|
-
name:
|
|
533
|
-
email:
|
|
534
|
-
avatar:
|
|
535
|
-
is_active:
|
|
536
|
-
is_super:
|
|
537
|
-
locale:
|
|
538
|
-
roles:
|
|
581
|
+
const n = {
|
|
582
|
+
name: p.value.name,
|
|
583
|
+
email: p.value.email,
|
|
584
|
+
avatar: p.value.avatar,
|
|
585
|
+
is_active: p.value.is_active,
|
|
586
|
+
is_super: p.value.is_super,
|
|
587
|
+
locale: p.value.locale === "auto" ? null : p.value.locale,
|
|
588
|
+
roles: p.value.roles ?? []
|
|
539
589
|
};
|
|
540
|
-
|
|
590
|
+
p.value.password && (n.password = p.value.password);
|
|
541
591
|
try {
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
} catch (
|
|
545
|
-
const
|
|
546
|
-
|
|
592
|
+
const $ = r.admin ? await V.update(r.admin.id, n) : await V.create(n);
|
|
593
|
+
K.success(h(_.value ? "admins.updated" : "admins.created")), l($);
|
|
594
|
+
} catch ($) {
|
|
595
|
+
const R = $.body;
|
|
596
|
+
R?.errors ? x.value = R.errors : K.danger(F($));
|
|
547
597
|
} finally {
|
|
548
598
|
w.value = !1;
|
|
549
599
|
}
|
|
550
600
|
}
|
|
551
|
-
return (
|
|
552
|
-
open: e(
|
|
553
|
-
"onUpdate:open":
|
|
554
|
-
title:
|
|
601
|
+
return (n, $) => (m(), b(e(be), {
|
|
602
|
+
open: e(v),
|
|
603
|
+
"onUpdate:open": $[9] || ($[9] = (R) => Ve(v) ? v.value = R : null),
|
|
604
|
+
title: _.value ? e(h)("admins.edit-short") : e(h)("admins.new-short"),
|
|
555
605
|
width: 720
|
|
556
606
|
}, {
|
|
557
607
|
footer: t(() => [
|
|
@@ -559,20 +609,20 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
559
609
|
default: t(() => [
|
|
560
610
|
a(e(N), {
|
|
561
611
|
variant: "outline",
|
|
562
|
-
onClick:
|
|
612
|
+
onClick: $[8] || ($[8] = (R) => e(u)())
|
|
563
613
|
}, {
|
|
564
614
|
default: t(() => [
|
|
565
|
-
|
|
615
|
+
c(i(e(h)("admins.cancel")), 1)
|
|
566
616
|
]),
|
|
567
617
|
_: 1
|
|
568
618
|
}),
|
|
569
619
|
a(e(N), {
|
|
570
620
|
type: "primary",
|
|
571
621
|
loading: w.value,
|
|
572
|
-
onClick:
|
|
622
|
+
onClick: O
|
|
573
623
|
}, {
|
|
574
624
|
default: t(() => [
|
|
575
|
-
|
|
625
|
+
c(i(e(h)("admins.save")), 1)
|
|
576
626
|
]),
|
|
577
627
|
_: 1
|
|
578
628
|
}, 8, ["loading"])
|
|
@@ -581,41 +631,41 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
581
631
|
})
|
|
582
632
|
]),
|
|
583
633
|
default: t(() => [
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
class:
|
|
634
|
+
S("div", wt, [
|
|
635
|
+
S("div", {
|
|
636
|
+
class: Be(["wx-admin-form__grid", { "has-aside": s.avatarField }])
|
|
587
637
|
}, [
|
|
588
|
-
|
|
589
|
-
(
|
|
590
|
-
modelValue:
|
|
591
|
-
"onUpdate:modelValue":
|
|
592
|
-
label: e(
|
|
638
|
+
s.avatarField ? (m(), H("div", xt, [
|
|
639
|
+
(m(), b(Ee(s.avatarField), {
|
|
640
|
+
modelValue: g.value,
|
|
641
|
+
"onUpdate:modelValue": $[0] || ($[0] = (R) => g.value = R),
|
|
642
|
+
label: e(h)("admins.avatar"),
|
|
593
643
|
aspect: "1/1",
|
|
594
644
|
captions: !1
|
|
595
645
|
}, null, 8, ["modelValue", "label"]))
|
|
596
|
-
])) :
|
|
597
|
-
|
|
598
|
-
a(e(
|
|
599
|
-
label: e(
|
|
600
|
-
error:
|
|
646
|
+
])) : I("", !0),
|
|
647
|
+
S("div", Ct, [
|
|
648
|
+
a(e(M), {
|
|
649
|
+
label: e(h)("admins.name"),
|
|
650
|
+
error: C("name")
|
|
601
651
|
}, {
|
|
602
652
|
default: t(() => [
|
|
603
653
|
a(e(le), {
|
|
604
|
-
modelValue:
|
|
605
|
-
"onUpdate:modelValue":
|
|
654
|
+
modelValue: p.value.name,
|
|
655
|
+
"onUpdate:modelValue": $[1] || ($[1] = (R) => p.value.name = R),
|
|
606
656
|
name: "name"
|
|
607
657
|
}, null, 8, ["modelValue"])
|
|
608
658
|
]),
|
|
609
659
|
_: 1
|
|
610
660
|
}, 8, ["label", "error"]),
|
|
611
|
-
a(e(
|
|
612
|
-
label: e(
|
|
613
|
-
error:
|
|
661
|
+
a(e(M), {
|
|
662
|
+
label: e(h)("admins.email"),
|
|
663
|
+
error: C("email")
|
|
614
664
|
}, {
|
|
615
665
|
default: t(() => [
|
|
616
666
|
a(e(le), {
|
|
617
|
-
modelValue:
|
|
618
|
-
"onUpdate:modelValue":
|
|
667
|
+
modelValue: p.value.email,
|
|
668
|
+
"onUpdate:modelValue": $[2] || ($[2] = (R) => p.value.email = R),
|
|
619
669
|
type: "email",
|
|
620
670
|
name: "email",
|
|
621
671
|
autocomplete: "off"
|
|
@@ -623,15 +673,15 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
623
673
|
]),
|
|
624
674
|
_: 1
|
|
625
675
|
}, 8, ["label", "error"]),
|
|
626
|
-
a(e(
|
|
627
|
-
label: e(
|
|
628
|
-
error:
|
|
629
|
-
help:
|
|
676
|
+
a(e(M), {
|
|
677
|
+
label: e(h)("admins.password"),
|
|
678
|
+
error: C("password"),
|
|
679
|
+
help: _.value ? e(h)("admins.password-keep") : e(h)("admins.password-hint")
|
|
630
680
|
}, {
|
|
631
681
|
default: t(() => [
|
|
632
682
|
a(e(le), {
|
|
633
|
-
modelValue:
|
|
634
|
-
"onUpdate:modelValue":
|
|
683
|
+
modelValue: p.value.password,
|
|
684
|
+
"onUpdate:modelValue": $[3] || ($[3] = (R) => p.value.password = R),
|
|
635
685
|
type: "password",
|
|
636
686
|
name: "password",
|
|
637
687
|
autocomplete: "new-password"
|
|
@@ -639,28 +689,28 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
639
689
|
]),
|
|
640
690
|
_: 1
|
|
641
691
|
}, 8, ["label", "error", "help"]),
|
|
642
|
-
a(e(
|
|
643
|
-
label: e(
|
|
644
|
-
error:
|
|
692
|
+
a(e(M), {
|
|
693
|
+
label: e(h)("admins.roles"),
|
|
694
|
+
error: C("roles")
|
|
645
695
|
}, {
|
|
646
696
|
default: t(() => [
|
|
647
697
|
a(e(ne), {
|
|
648
|
-
modelValue:
|
|
649
|
-
"onUpdate:modelValue":
|
|
650
|
-
options:
|
|
698
|
+
modelValue: p.value.roles,
|
|
699
|
+
"onUpdate:modelValue": $[4] || ($[4] = (R) => p.value.roles = R),
|
|
700
|
+
options: k.value,
|
|
651
701
|
multiple: ""
|
|
652
702
|
}, null, 8, ["modelValue", "options"])
|
|
653
703
|
]),
|
|
654
704
|
_: 1
|
|
655
705
|
}, 8, ["label", "error"]),
|
|
656
|
-
a(e(
|
|
657
|
-
label: e(
|
|
706
|
+
a(e(M), {
|
|
707
|
+
label: e(h)("admins.locale")
|
|
658
708
|
}, {
|
|
659
709
|
default: t(() => [
|
|
660
710
|
a(e(ne), {
|
|
661
|
-
modelValue:
|
|
662
|
-
"onUpdate:modelValue":
|
|
663
|
-
options:
|
|
711
|
+
modelValue: p.value.locale,
|
|
712
|
+
"onUpdate:modelValue": $[5] || ($[5] = (R) => p.value.locale = R),
|
|
713
|
+
options: B.value
|
|
664
714
|
}, null, 8, ["modelValue", "options"])
|
|
665
715
|
]),
|
|
666
716
|
_: 1
|
|
@@ -668,24 +718,24 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
668
718
|
a(e(se), { size: "md" }, {
|
|
669
719
|
default: t(() => [
|
|
670
720
|
a(e(Le), {
|
|
671
|
-
modelValue:
|
|
672
|
-
"onUpdate:modelValue":
|
|
673
|
-
label: e(
|
|
721
|
+
modelValue: p.value.is_active,
|
|
722
|
+
"onUpdate:modelValue": $[6] || ($[6] = (R) => p.value.is_active = R),
|
|
723
|
+
label: e(h)("admins.active")
|
|
674
724
|
}, null, 8, ["modelValue", "label"]),
|
|
675
725
|
a(e(Le), {
|
|
676
|
-
modelValue:
|
|
677
|
-
"onUpdate:modelValue":
|
|
678
|
-
label: e(
|
|
726
|
+
modelValue: p.value.is_super,
|
|
727
|
+
"onUpdate:modelValue": $[7] || ($[7] = (R) => p.value.is_super = R),
|
|
728
|
+
label: e(h)("admins.super")
|
|
679
729
|
}, null, 8, ["modelValue", "label"])
|
|
680
730
|
]),
|
|
681
731
|
_: 1
|
|
682
732
|
}),
|
|
683
|
-
a(e(
|
|
733
|
+
a(e(E), {
|
|
684
734
|
size: "sm",
|
|
685
735
|
tone: "muted"
|
|
686
736
|
}, {
|
|
687
737
|
default: t(() => [
|
|
688
|
-
|
|
738
|
+
c(i(e(h)("admins.super-hint")), 1)
|
|
689
739
|
]),
|
|
690
740
|
_: 1
|
|
691
741
|
})
|
|
@@ -696,7 +746,7 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
696
746
|
_: 1
|
|
697
747
|
}, 8, ["open", "title"]));
|
|
698
748
|
}
|
|
699
|
-
}),
|
|
749
|
+
}), Ue = 480, Xe = /* @__PURE__ */ Q({
|
|
700
750
|
__name: "AdminList",
|
|
701
751
|
props: {
|
|
702
752
|
picking: { type: Boolean, default: !1 },
|
|
@@ -706,41 +756,41 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
706
756
|
resolveAvatar: { type: Function, default: void 0 }
|
|
707
757
|
},
|
|
708
758
|
emits: ["open", "chosen", "selection", "remove"],
|
|
709
|
-
setup(
|
|
710
|
-
const
|
|
711
|
-
|
|
712
|
-
const
|
|
713
|
-
let
|
|
714
|
-
const
|
|
715
|
-
{ value: "all", label:
|
|
716
|
-
...
|
|
717
|
-
]),
|
|
718
|
-
{ value: "any", label:
|
|
719
|
-
{ value: "yes", label:
|
|
720
|
-
{ value: "no", label:
|
|
721
|
-
]),
|
|
722
|
-
const
|
|
723
|
-
return
|
|
759
|
+
setup(s, { expose: r, emit: l }) {
|
|
760
|
+
const u = s, v = l, y = X(), V = pe(y);
|
|
761
|
+
ee();
|
|
762
|
+
const o = oe("root"), h = ge(o), F = T(() => h.value > 0 && h.value < Ue), d = G("webx-auth"), w = G("webx-admin"), x = A(null), p = A([]), g = A(!1), _ = A("all"), k = A("any"), B = A([]), C = A({});
|
|
763
|
+
let O = { page: 1, perPage: 20, sort: null, search: "" };
|
|
764
|
+
const n = T(() => [
|
|
765
|
+
{ value: "all", label: d("admins.all-roles") },
|
|
766
|
+
...p.value.map((D) => ({ value: D.slug, label: D.name }))
|
|
767
|
+
]), $ = T(() => [
|
|
768
|
+
{ value: "any", label: d("admins.any-state") },
|
|
769
|
+
{ value: "yes", label: d("admins.only-active") },
|
|
770
|
+
{ value: "no", label: d("admins.only-inactive") }
|
|
771
|
+
]), R = T(() => {
|
|
772
|
+
const D = [], j = p.value.find((P) => P.slug === _.value);
|
|
773
|
+
return j && D.push({
|
|
724
774
|
key: "role",
|
|
725
|
-
label: `${
|
|
726
|
-
clear: () =>
|
|
727
|
-
}),
|
|
775
|
+
label: `${d("admins.filter-role")}: ${j.name}`,
|
|
776
|
+
clear: () => _.value = "all"
|
|
777
|
+
}), k.value !== "any" && D.push({
|
|
728
778
|
key: "state",
|
|
729
|
-
label: `${
|
|
730
|
-
clear: () =>
|
|
731
|
-
}),
|
|
779
|
+
label: `${d("admins.filter-state")}: ${k.value === "yes" ? d("admins.only-active") : d("admins.only-inactive")}`,
|
|
780
|
+
clear: () => k.value = "any"
|
|
781
|
+
}), D;
|
|
732
782
|
});
|
|
733
|
-
function
|
|
734
|
-
|
|
783
|
+
function Y() {
|
|
784
|
+
_.value = "all", k.value = "any";
|
|
735
785
|
}
|
|
736
|
-
const
|
|
737
|
-
{ key: "name", label:
|
|
738
|
-
{ key: "email", label:
|
|
739
|
-
{ key: "roles", label:
|
|
740
|
-
{ key: "is_active", label:
|
|
786
|
+
const U = T(() => F.value ? [{ key: "card", label: "" }] : [
|
|
787
|
+
{ key: "name", label: d("admins.name"), sortable: !0 },
|
|
788
|
+
{ key: "email", label: d("admins.email"), sortable: !0, hideBelow: 560 },
|
|
789
|
+
{ key: "roles", label: d("admins.roles"), hideBelow: 760 },
|
|
790
|
+
{ key: "is_active", label: d("admins.active"), align: "center", hideBelow: 660 },
|
|
741
791
|
{
|
|
742
792
|
key: "last_login_at",
|
|
743
|
-
label:
|
|
793
|
+
label: d("admins.last-login"),
|
|
744
794
|
sortable: !0,
|
|
745
795
|
hideBelow: 900,
|
|
746
796
|
// The first thing to go when a row becomes a card: it is a date somebody scans down a
|
|
@@ -750,205 +800,205 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
750
800
|
{
|
|
751
801
|
key: "actions",
|
|
752
802
|
label: "",
|
|
753
|
-
width:
|
|
803
|
+
width: ot,
|
|
754
804
|
align: "right",
|
|
755
|
-
hidden: !
|
|
805
|
+
hidden: !u.removable,
|
|
756
806
|
// A card puts them along its top instead, through the `card-actions` slot.
|
|
757
807
|
hideOnCards: !0
|
|
758
808
|
}
|
|
759
809
|
]);
|
|
760
|
-
|
|
761
|
-
async function
|
|
762
|
-
|
|
810
|
+
V.roles().then((D) => p.value = D), de([_, k], () => z(O));
|
|
811
|
+
async function z(D) {
|
|
812
|
+
O = D, g.value = !0;
|
|
763
813
|
try {
|
|
764
|
-
x.value = await
|
|
765
|
-
q:
|
|
766
|
-
role:
|
|
767
|
-
active:
|
|
768
|
-
sort:
|
|
769
|
-
page:
|
|
770
|
-
per_page:
|
|
771
|
-
}),
|
|
814
|
+
x.value = await V.list({
|
|
815
|
+
q: D.search,
|
|
816
|
+
role: _.value === "all" ? null : _.value,
|
|
817
|
+
active: k.value === "any" ? null : k.value,
|
|
818
|
+
sort: D.sort ? `${D.sort.order === "desc" ? "-" : ""}${D.sort.key}` : "name",
|
|
819
|
+
page: D.page,
|
|
820
|
+
per_page: D.perPage
|
|
821
|
+
}), f();
|
|
772
822
|
} finally {
|
|
773
|
-
|
|
823
|
+
g.value = !1;
|
|
774
824
|
}
|
|
775
825
|
}
|
|
776
|
-
async function
|
|
777
|
-
const
|
|
778
|
-
if (
|
|
779
|
-
for (const
|
|
780
|
-
if (!
|
|
781
|
-
const
|
|
782
|
-
|
|
826
|
+
async function f() {
|
|
827
|
+
const D = u.resolveAvatar;
|
|
828
|
+
if (D)
|
|
829
|
+
for (const j of x.value?.data ?? []) {
|
|
830
|
+
if (!j.avatar || C.value[j.avatar]) continue;
|
|
831
|
+
const P = await D(j.avatar);
|
|
832
|
+
P && (C.value = { ...C.value, [j.avatar]: P });
|
|
783
833
|
}
|
|
784
834
|
}
|
|
785
|
-
function
|
|
835
|
+
function L(D) {
|
|
786
836
|
return [
|
|
787
837
|
{
|
|
788
838
|
key: "delete",
|
|
789
839
|
icon: "trash",
|
|
790
|
-
label:
|
|
840
|
+
label: d("admins.delete"),
|
|
791
841
|
danger: !0,
|
|
792
|
-
run: () =>
|
|
842
|
+
run: () => v("remove", D)
|
|
793
843
|
}
|
|
794
844
|
];
|
|
795
845
|
}
|
|
796
|
-
function
|
|
797
|
-
if (
|
|
798
|
-
|
|
846
|
+
function W(D) {
|
|
847
|
+
if (u.picking) {
|
|
848
|
+
v("chosen", [D]);
|
|
799
849
|
return;
|
|
800
850
|
}
|
|
801
|
-
|
|
851
|
+
v("open", D);
|
|
802
852
|
}
|
|
803
|
-
const
|
|
804
|
-
function
|
|
805
|
-
|
|
853
|
+
const te = T(() => !(u.picking && u.multiple));
|
|
854
|
+
function fe(D, j) {
|
|
855
|
+
B.value = j, v("selection", j);
|
|
806
856
|
}
|
|
807
|
-
return
|
|
857
|
+
return r({ reload: () => z(O), chosen: () => B.value }), (D, j) => (m(), H("div", {
|
|
808
858
|
ref_key: "root",
|
|
809
|
-
ref:
|
|
859
|
+
ref: o,
|
|
810
860
|
class: "wx-admin-list"
|
|
811
861
|
}, [
|
|
812
|
-
a(e(
|
|
862
|
+
a(e(ke), {
|
|
813
863
|
data: x.value,
|
|
814
|
-
columns:
|
|
864
|
+
columns: U.value,
|
|
815
865
|
"row-key": "id",
|
|
816
866
|
searchable: "",
|
|
817
|
-
clickable:
|
|
818
|
-
hover:
|
|
867
|
+
clickable: te.value,
|
|
868
|
+
hover: te.value,
|
|
819
869
|
flush: "",
|
|
820
|
-
loading:
|
|
821
|
-
"search-placeholder": e(
|
|
822
|
-
"empty-text": e(
|
|
823
|
-
selectable:
|
|
870
|
+
loading: g.value,
|
|
871
|
+
"search-placeholder": e(d)("admins.search"),
|
|
872
|
+
"empty-text": e(d)("admins.empty"),
|
|
873
|
+
selectable: s.picking && s.multiple,
|
|
824
874
|
"select-row-label": e(w)("filters.select-row"),
|
|
825
875
|
"select-all-label": e(w)("filters.select-all"),
|
|
826
|
-
"cards-below":
|
|
827
|
-
"filters-count":
|
|
876
|
+
"cards-below": Ue,
|
|
877
|
+
"filters-count": R.value.length,
|
|
828
878
|
"filters-label": e(w)("filters.title"),
|
|
829
|
-
onRowClick:
|
|
830
|
-
onStateChange:
|
|
831
|
-
onSelectionChange:
|
|
832
|
-
},
|
|
833
|
-
"cell-name": t(({ row:
|
|
879
|
+
onRowClick: W,
|
|
880
|
+
onStateChange: z,
|
|
881
|
+
onSelectionChange: fe
|
|
882
|
+
}, Ae({
|
|
883
|
+
"cell-name": t(({ row: P }) => [
|
|
834
884
|
a(e(se), {
|
|
835
885
|
size: "sm",
|
|
836
886
|
align: "center"
|
|
837
887
|
}, {
|
|
838
888
|
default: t(() => [
|
|
839
|
-
a(e(
|
|
840
|
-
name:
|
|
841
|
-
src:
|
|
889
|
+
a(e(dt), {
|
|
890
|
+
name: P.name,
|
|
891
|
+
src: P.avatar ? C.value[P.avatar] : void 0,
|
|
842
892
|
size: "sm"
|
|
843
893
|
}, null, 8, ["name", "src"]),
|
|
844
|
-
|
|
845
|
-
|
|
894
|
+
S("span", null, i(P.name), 1),
|
|
895
|
+
P.is_super ? (m(), b(e(q), {
|
|
846
896
|
key: 0,
|
|
847
897
|
type: "warning"
|
|
848
898
|
}, {
|
|
849
899
|
default: t(() => [
|
|
850
|
-
|
|
900
|
+
c(i(e(d)("admins.super")), 1)
|
|
851
901
|
]),
|
|
852
902
|
_: 1
|
|
853
|
-
})) :
|
|
903
|
+
})) : I("", !0)
|
|
854
904
|
]),
|
|
855
905
|
_: 2
|
|
856
906
|
}, 1024)
|
|
857
907
|
]),
|
|
858
|
-
"cell-roles": t(({ row:
|
|
859
|
-
|
|
908
|
+
"cell-roles": t(({ row: P }) => [
|
|
909
|
+
P.roles.length > 0 ? (m(), b(e(se), {
|
|
860
910
|
key: 0,
|
|
861
911
|
size: "xs",
|
|
862
912
|
wrap: ""
|
|
863
913
|
}, {
|
|
864
914
|
default: t(() => [
|
|
865
|
-
(
|
|
866
|
-
key:
|
|
915
|
+
(m(!0), H(ue, null, Ce(P.roles, (ie) => (m(), b(e(q), {
|
|
916
|
+
key: ie.id
|
|
867
917
|
}, {
|
|
868
918
|
default: t(() => [
|
|
869
|
-
|
|
919
|
+
c(i(ie.name), 1)
|
|
870
920
|
]),
|
|
871
921
|
_: 2
|
|
872
922
|
}, 1024))), 128))
|
|
873
923
|
]),
|
|
874
924
|
_: 2
|
|
875
|
-
}, 1024)) : (
|
|
925
|
+
}, 1024)) : (m(), b(e(E), {
|
|
876
926
|
key: 1,
|
|
877
927
|
size: "sm",
|
|
878
928
|
tone: "muted"
|
|
879
929
|
}, {
|
|
880
930
|
default: t(() => [
|
|
881
|
-
|
|
931
|
+
c(i(e(d)("admins.no-roles")), 1)
|
|
882
932
|
]),
|
|
883
933
|
_: 1
|
|
884
934
|
}))
|
|
885
935
|
]),
|
|
886
|
-
"cell-is_active": t(({ row:
|
|
887
|
-
a(e(
|
|
888
|
-
type:
|
|
936
|
+
"cell-is_active": t(({ row: P }) => [
|
|
937
|
+
a(e(q), {
|
|
938
|
+
type: P.is_active ? "success" : "default",
|
|
889
939
|
dot: ""
|
|
890
940
|
}, {
|
|
891
941
|
default: t(() => [
|
|
892
|
-
|
|
942
|
+
c(i(P.is_active ? e(d)("admins.active") : e(d)("admins.only-inactive")), 1)
|
|
893
943
|
]),
|
|
894
944
|
_: 2
|
|
895
945
|
}, 1032, ["type"])
|
|
896
946
|
]),
|
|
897
|
-
"card-actions": t(({ row:
|
|
898
|
-
|
|
947
|
+
"card-actions": t(({ row: P }) => [
|
|
948
|
+
s.removable ? (m(), b(e(Se), {
|
|
899
949
|
key: 0,
|
|
900
|
-
actions:
|
|
901
|
-
label:
|
|
902
|
-
}, null, 8, ["actions", "label"])) :
|
|
950
|
+
actions: L(P),
|
|
951
|
+
label: P.name
|
|
952
|
+
}, null, 8, ["actions", "label"])) : I("", !0)
|
|
903
953
|
]),
|
|
904
|
-
"cell-actions": t(({ row:
|
|
954
|
+
"cell-actions": t(({ row: P }) => [
|
|
905
955
|
a(e(Se), {
|
|
906
|
-
actions:
|
|
907
|
-
label:
|
|
956
|
+
actions: L(P),
|
|
957
|
+
label: P.name
|
|
908
958
|
}, null, 8, ["actions", "label"])
|
|
909
959
|
]),
|
|
910
|
-
"cell-last_login_at": t(({ row:
|
|
911
|
-
a(e(
|
|
912
|
-
value:
|
|
913
|
-
tone:
|
|
960
|
+
"cell-last_login_at": t(({ row: P }) => [
|
|
961
|
+
a(e(ae), {
|
|
962
|
+
value: P.last_login_at,
|
|
963
|
+
tone: P.last_login_at ? "default" : "muted",
|
|
914
964
|
compact: ""
|
|
915
965
|
}, null, 8, ["value", "tone"])
|
|
916
966
|
]),
|
|
917
|
-
"cell-card": t(({ row:
|
|
918
|
-
a(e(
|
|
967
|
+
"cell-card": t(({ row: P }) => [
|
|
968
|
+
a(e(we), {
|
|
919
969
|
variant: "plain",
|
|
920
970
|
shape: "circle",
|
|
921
|
-
title:
|
|
922
|
-
image:
|
|
923
|
-
subtitle:
|
|
971
|
+
title: P.name,
|
|
972
|
+
image: P.avatar ? C.value[P.avatar] : void 0,
|
|
973
|
+
subtitle: P.email
|
|
924
974
|
}, {
|
|
925
975
|
meta: t(() => [
|
|
926
|
-
|
|
976
|
+
P.is_super ? (m(), b(e(q), {
|
|
927
977
|
key: 0,
|
|
928
978
|
type: "warning",
|
|
929
979
|
size: "sm"
|
|
930
980
|
}, {
|
|
931
981
|
default: t(() => [
|
|
932
|
-
|
|
982
|
+
c(i(e(d)("admins.super")), 1)
|
|
933
983
|
]),
|
|
934
984
|
_: 1
|
|
935
|
-
})) :
|
|
936
|
-
(
|
|
937
|
-
key:
|
|
985
|
+
})) : I("", !0),
|
|
986
|
+
(m(!0), H(ue, null, Ce(P.roles, (ie) => (m(), b(e(q), {
|
|
987
|
+
key: ie.id,
|
|
938
988
|
size: "sm"
|
|
939
989
|
}, {
|
|
940
990
|
default: t(() => [
|
|
941
|
-
|
|
991
|
+
c(i(ie.name), 1)
|
|
942
992
|
]),
|
|
943
993
|
_: 2
|
|
944
994
|
}, 1024))), 128)),
|
|
945
|
-
a(e(
|
|
946
|
-
type:
|
|
995
|
+
a(e(q), {
|
|
996
|
+
type: P.is_active ? "success" : "default",
|
|
947
997
|
dot: "",
|
|
948
998
|
size: "sm"
|
|
949
999
|
}, {
|
|
950
1000
|
default: t(() => [
|
|
951
|
-
|
|
1001
|
+
c(i(P.is_active ? e(d)("admins.active") : e(d)("admins.only-inactive")), 1)
|
|
952
1002
|
]),
|
|
953
1003
|
_: 2
|
|
954
1004
|
}, 1032, ["type"])
|
|
@@ -958,410 +1008,410 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
958
1008
|
]),
|
|
959
1009
|
_: 2
|
|
960
1010
|
}, [
|
|
961
|
-
|
|
1011
|
+
s.filters ? {
|
|
962
1012
|
name: "filters",
|
|
963
1013
|
fn: t(() => [
|
|
964
|
-
a(e(
|
|
965
|
-
label: e(
|
|
1014
|
+
a(e(M), {
|
|
1015
|
+
label: e(d)("admins.filter-role")
|
|
966
1016
|
}, {
|
|
967
1017
|
default: t(() => [
|
|
968
1018
|
a(e(ne), {
|
|
969
|
-
modelValue:
|
|
970
|
-
"onUpdate:modelValue":
|
|
971
|
-
options:
|
|
1019
|
+
modelValue: _.value,
|
|
1020
|
+
"onUpdate:modelValue": j[0] || (j[0] = (P) => _.value = P),
|
|
1021
|
+
options: n.value,
|
|
972
1022
|
size: "sm"
|
|
973
1023
|
}, null, 8, ["modelValue", "options"])
|
|
974
1024
|
]),
|
|
975
1025
|
_: 1
|
|
976
1026
|
}, 8, ["label"]),
|
|
977
|
-
a(e(
|
|
978
|
-
label: e(
|
|
1027
|
+
a(e(M), {
|
|
1028
|
+
label: e(d)("admins.filter-state")
|
|
979
1029
|
}, {
|
|
980
1030
|
default: t(() => [
|
|
981
1031
|
a(e(ne), {
|
|
982
|
-
modelValue:
|
|
983
|
-
"onUpdate:modelValue":
|
|
984
|
-
options:
|
|
1032
|
+
modelValue: k.value,
|
|
1033
|
+
"onUpdate:modelValue": j[1] || (j[1] = (P) => k.value = P),
|
|
1034
|
+
options: $.value,
|
|
985
1035
|
size: "sm"
|
|
986
1036
|
}, null, 8, ["modelValue", "options"])
|
|
987
1037
|
]),
|
|
988
1038
|
_: 1
|
|
989
1039
|
}, 8, ["label"]),
|
|
990
|
-
|
|
1040
|
+
R.value.length > 0 ? (m(), b(e(N), {
|
|
991
1041
|
key: 0,
|
|
992
1042
|
variant: "text",
|
|
993
1043
|
size: "sm",
|
|
994
1044
|
block: "",
|
|
995
|
-
onClick:
|
|
1045
|
+
onClick: Y
|
|
996
1046
|
}, {
|
|
997
1047
|
icon: t(() => [
|
|
998
|
-
a(e(
|
|
1048
|
+
a(e(Z), { name: "close" })
|
|
999
1049
|
]),
|
|
1000
1050
|
default: t(() => [
|
|
1001
|
-
|
|
1051
|
+
c(" " + i(e(w)("filters.reset")), 1)
|
|
1002
1052
|
]),
|
|
1003
1053
|
_: 1
|
|
1004
|
-
})) :
|
|
1054
|
+
})) : I("", !0)
|
|
1005
1055
|
]),
|
|
1006
1056
|
key: "0"
|
|
1007
1057
|
} : void 0,
|
|
1008
|
-
|
|
1058
|
+
s.filters ? {
|
|
1009
1059
|
name: "applied",
|
|
1010
1060
|
fn: t(() => [
|
|
1011
|
-
a(e(
|
|
1061
|
+
a(e(Me), { filters: R.value }, null, 8, ["filters"])
|
|
1012
1062
|
]),
|
|
1013
1063
|
key: "1"
|
|
1014
1064
|
} : void 0
|
|
1015
1065
|
]), 1032, ["data", "columns", "clickable", "hover", "loading", "search-placeholder", "empty-text", "selectable", "select-row-label", "select-all-label", "filters-count", "filters-label"])
|
|
1016
1066
|
], 512));
|
|
1017
1067
|
}
|
|
1018
|
-
}),
|
|
1068
|
+
}), Vt = { class: "wx-call-list__details" }, At = { class: "wx-call-list__label" }, zt = {
|
|
1019
1069
|
key: 1,
|
|
1020
1070
|
class: "wx-call-list__arguments"
|
|
1021
|
-
},
|
|
1071
|
+
}, Wt = {
|
|
1022
1072
|
class: "wx-call-list__glyph",
|
|
1023
1073
|
"aria-hidden": "true"
|
|
1024
|
-
},
|
|
1074
|
+
}, St = {
|
|
1025
1075
|
key: 2,
|
|
1026
1076
|
class: "wx-call-list__arguments"
|
|
1027
|
-
},
|
|
1077
|
+
}, Pe = 480, Lt = /* @__PURE__ */ Q({
|
|
1028
1078
|
__name: "CallList",
|
|
1029
|
-
setup(
|
|
1030
|
-
const l =
|
|
1031
|
-
|
|
1032
|
-
const
|
|
1033
|
-
let
|
|
1034
|
-
function
|
|
1035
|
-
return
|
|
1079
|
+
setup(s, { expose: r }) {
|
|
1080
|
+
const l = X(), u = pe(l);
|
|
1081
|
+
ee();
|
|
1082
|
+
const v = oe("root"), y = ge(v), V = T(() => y.value > 0 && y.value < Pe), o = G("webx-auth"), h = G("webx-admin"), F = A(null), d = A({ users: [], tools: [] }), w = A(!1), x = A("all"), p = A("all"), g = A("any");
|
|
1083
|
+
let _ = { page: 1, perPage: 30, sort: null, search: "" };
|
|
1084
|
+
function k(f) {
|
|
1085
|
+
return f === null ? o("calls.local") : f.name ?? o("calls.deleted", { id: f.id });
|
|
1036
1086
|
}
|
|
1037
|
-
const
|
|
1038
|
-
{ value: "all", label:
|
|
1039
|
-
...
|
|
1040
|
-
value:
|
|
1041
|
-
label:
|
|
1087
|
+
const B = T(() => [
|
|
1088
|
+
{ value: "all", label: o("calls.everybody") },
|
|
1089
|
+
...d.value.users.map((f) => ({
|
|
1090
|
+
value: f.id === null ? "none" : String(f.id),
|
|
1091
|
+
label: k(f.id === null ? null : { id: f.id, name: f.name })
|
|
1042
1092
|
}))
|
|
1043
|
-
]),
|
|
1044
|
-
{ value: "all", label:
|
|
1045
|
-
...
|
|
1046
|
-
]),
|
|
1047
|
-
{ value: "any", label:
|
|
1048
|
-
{ value: "ok", label:
|
|
1049
|
-
{ value: "failed", label:
|
|
1050
|
-
{ value: "dry", label:
|
|
1051
|
-
]),
|
|
1052
|
-
const
|
|
1053
|
-
x.value !== "all" &&
|
|
1093
|
+
]), C = T(() => [
|
|
1094
|
+
{ value: "all", label: o("calls.all-tools") },
|
|
1095
|
+
...d.value.tools.map((f) => ({ value: f, label: f }))
|
|
1096
|
+
]), O = T(() => [
|
|
1097
|
+
{ value: "any", label: o("calls.any-outcome") },
|
|
1098
|
+
{ value: "ok", label: o("calls.only-answered") },
|
|
1099
|
+
{ value: "failed", label: o("calls.only-refused") },
|
|
1100
|
+
{ value: "dry", label: o("calls.only-dry") }
|
|
1101
|
+
]), n = T(() => {
|
|
1102
|
+
const f = [], L = B.value.find((te) => te.value === x.value);
|
|
1103
|
+
x.value !== "all" && L && f.push({
|
|
1054
1104
|
key: "user",
|
|
1055
|
-
label: `${
|
|
1105
|
+
label: `${o("calls.filter-user")}: ${L.label}`,
|
|
1056
1106
|
clear: () => x.value = "all"
|
|
1057
|
-
}),
|
|
1107
|
+
}), p.value !== "all" && f.push({
|
|
1058
1108
|
key: "tool",
|
|
1059
|
-
label: `${
|
|
1060
|
-
clear: () =>
|
|
1109
|
+
label: `${o("calls.filter-tool")}: ${p.value}`,
|
|
1110
|
+
clear: () => p.value = "all"
|
|
1061
1111
|
});
|
|
1062
|
-
const
|
|
1063
|
-
return
|
|
1112
|
+
const W = O.value.find((te) => te.value === g.value);
|
|
1113
|
+
return g.value !== "any" && W && f.push({
|
|
1064
1114
|
key: "outcome",
|
|
1065
|
-
label: `${
|
|
1066
|
-
clear: () =>
|
|
1067
|
-
}),
|
|
1115
|
+
label: `${o("calls.filter-outcome")}: ${W.label}`,
|
|
1116
|
+
clear: () => g.value = "any"
|
|
1117
|
+
}), f;
|
|
1068
1118
|
});
|
|
1069
|
-
function
|
|
1070
|
-
x.value = "all",
|
|
1119
|
+
function $() {
|
|
1120
|
+
x.value = "all", p.value = "all", g.value = "any";
|
|
1071
1121
|
}
|
|
1072
|
-
const
|
|
1073
|
-
{ key: "at", label:
|
|
1074
|
-
{ key: "user", label:
|
|
1075
|
-
{ key: "tool", label:
|
|
1076
|
-
{ key: "outcome", label:
|
|
1077
|
-
{ key: "duration_ms", label:
|
|
1078
|
-
{ key: "client", label:
|
|
1122
|
+
const R = T(() => V.value ? [{ key: "card", label: "" }] : [
|
|
1123
|
+
{ key: "at", label: o("calls.when") },
|
|
1124
|
+
{ key: "user", label: o("calls.who"), hideBelow: 640 },
|
|
1125
|
+
{ key: "tool", label: o("calls.tool") },
|
|
1126
|
+
{ key: "outcome", label: o("calls.outcome") },
|
|
1127
|
+
{ key: "duration_ms", label: o("calls.took"), align: "right", hideBelow: 820 },
|
|
1128
|
+
{ key: "client", label: o("calls.client"), hideBelow: 960 }
|
|
1079
1129
|
]);
|
|
1080
|
-
|
|
1081
|
-
async function
|
|
1082
|
-
|
|
1130
|
+
de([x, p, g], () => Y({ ..._, page: 1 }));
|
|
1131
|
+
async function Y(f) {
|
|
1132
|
+
_ = f, w.value = !0;
|
|
1083
1133
|
try {
|
|
1084
|
-
|
|
1134
|
+
F.value = await u.calls({
|
|
1085
1135
|
user: x.value === "all" ? null : x.value,
|
|
1086
|
-
tool:
|
|
1087
|
-
outcome:
|
|
1088
|
-
page:
|
|
1089
|
-
per_page:
|
|
1090
|
-
}),
|
|
1136
|
+
tool: p.value === "all" ? null : p.value,
|
|
1137
|
+
outcome: g.value === "any" ? null : g.value,
|
|
1138
|
+
page: f.page,
|
|
1139
|
+
per_page: f.perPage
|
|
1140
|
+
}), d.value = F.value.filters;
|
|
1091
1141
|
} finally {
|
|
1092
1142
|
w.value = !1;
|
|
1093
1143
|
}
|
|
1094
1144
|
}
|
|
1095
|
-
function
|
|
1096
|
-
return
|
|
1145
|
+
function U(f) {
|
|
1146
|
+
return f.ok ? f.dry_run ? { type: "info", label: o("calls.dry-run") } : { type: "success", label: o("calls.answered") } : { type: "danger", label: o("calls.refused") };
|
|
1097
1147
|
}
|
|
1098
|
-
function
|
|
1099
|
-
return
|
|
1148
|
+
function z(f) {
|
|
1149
|
+
return f.arguments !== null || f.error !== null;
|
|
1100
1150
|
}
|
|
1101
|
-
return
|
|
1151
|
+
return r({ reload: () => Y(_) }), (f, L) => (m(), H("div", {
|
|
1102
1152
|
ref_key: "root",
|
|
1103
|
-
ref:
|
|
1153
|
+
ref: v,
|
|
1104
1154
|
class: "wx-call-list"
|
|
1105
1155
|
}, [
|
|
1106
|
-
a(e(
|
|
1107
|
-
data:
|
|
1108
|
-
columns:
|
|
1156
|
+
a(e(ke), {
|
|
1157
|
+
data: F.value,
|
|
1158
|
+
columns: R.value,
|
|
1109
1159
|
"row-key": "id",
|
|
1110
1160
|
flush: "",
|
|
1111
1161
|
loading: w.value,
|
|
1112
1162
|
clickable: !1,
|
|
1113
|
-
expandable: !
|
|
1114
|
-
"expandable-if":
|
|
1115
|
-
"empty-text": e(
|
|
1116
|
-
"cards-below":
|
|
1117
|
-
"filters-count":
|
|
1118
|
-
"filters-label": e(
|
|
1119
|
-
onStateChange:
|
|
1163
|
+
expandable: !V.value,
|
|
1164
|
+
"expandable-if": z,
|
|
1165
|
+
"empty-text": e(o)("calls.empty"),
|
|
1166
|
+
"cards-below": Pe,
|
|
1167
|
+
"filters-count": n.value.length,
|
|
1168
|
+
"filters-label": e(h)("filters.title"),
|
|
1169
|
+
onStateChange: Y
|
|
1120
1170
|
}, {
|
|
1121
1171
|
filters: t(() => [
|
|
1122
|
-
a(e(
|
|
1123
|
-
label: e(
|
|
1172
|
+
a(e(M), {
|
|
1173
|
+
label: e(o)("calls.filter-user")
|
|
1124
1174
|
}, {
|
|
1125
1175
|
default: t(() => [
|
|
1126
1176
|
a(e(ne), {
|
|
1127
1177
|
modelValue: x.value,
|
|
1128
|
-
"onUpdate:modelValue":
|
|
1129
|
-
options:
|
|
1178
|
+
"onUpdate:modelValue": L[0] || (L[0] = (W) => x.value = W),
|
|
1179
|
+
options: B.value,
|
|
1130
1180
|
size: "sm"
|
|
1131
1181
|
}, null, 8, ["modelValue", "options"])
|
|
1132
1182
|
]),
|
|
1133
1183
|
_: 1
|
|
1134
1184
|
}, 8, ["label"]),
|
|
1135
|
-
a(e(
|
|
1136
|
-
label: e(
|
|
1185
|
+
a(e(M), {
|
|
1186
|
+
label: e(o)("calls.filter-tool")
|
|
1137
1187
|
}, {
|
|
1138
1188
|
default: t(() => [
|
|
1139
1189
|
a(e(ne), {
|
|
1140
|
-
modelValue:
|
|
1141
|
-
"onUpdate:modelValue":
|
|
1142
|
-
options:
|
|
1190
|
+
modelValue: p.value,
|
|
1191
|
+
"onUpdate:modelValue": L[1] || (L[1] = (W) => p.value = W),
|
|
1192
|
+
options: C.value,
|
|
1143
1193
|
size: "sm"
|
|
1144
1194
|
}, null, 8, ["modelValue", "options"])
|
|
1145
1195
|
]),
|
|
1146
1196
|
_: 1
|
|
1147
1197
|
}, 8, ["label"]),
|
|
1148
|
-
a(e(
|
|
1149
|
-
label: e(
|
|
1198
|
+
a(e(M), {
|
|
1199
|
+
label: e(o)("calls.filter-outcome")
|
|
1150
1200
|
}, {
|
|
1151
1201
|
default: t(() => [
|
|
1152
1202
|
a(e(ne), {
|
|
1153
|
-
modelValue:
|
|
1154
|
-
"onUpdate:modelValue":
|
|
1155
|
-
options:
|
|
1203
|
+
modelValue: g.value,
|
|
1204
|
+
"onUpdate:modelValue": L[2] || (L[2] = (W) => g.value = W),
|
|
1205
|
+
options: O.value,
|
|
1156
1206
|
size: "sm"
|
|
1157
1207
|
}, null, 8, ["modelValue", "options"])
|
|
1158
1208
|
]),
|
|
1159
1209
|
_: 1
|
|
1160
1210
|
}, 8, ["label"]),
|
|
1161
|
-
|
|
1211
|
+
n.value.length > 0 ? (m(), b(e(N), {
|
|
1162
1212
|
key: 0,
|
|
1163
1213
|
variant: "text",
|
|
1164
1214
|
size: "sm",
|
|
1165
1215
|
block: "",
|
|
1166
|
-
onClick:
|
|
1216
|
+
onClick: $
|
|
1167
1217
|
}, {
|
|
1168
1218
|
icon: t(() => [
|
|
1169
|
-
a(e(
|
|
1219
|
+
a(e(Z), { name: "close" })
|
|
1170
1220
|
]),
|
|
1171
1221
|
default: t(() => [
|
|
1172
|
-
|
|
1222
|
+
c(" " + i(e(h)("filters.reset")), 1)
|
|
1173
1223
|
]),
|
|
1174
1224
|
_: 1
|
|
1175
|
-
})) :
|
|
1225
|
+
})) : I("", !0)
|
|
1176
1226
|
]),
|
|
1177
1227
|
applied: t(() => [
|
|
1178
|
-
a(e(
|
|
1228
|
+
a(e(Me), { filters: n.value }, null, 8, ["filters"])
|
|
1179
1229
|
]),
|
|
1180
|
-
"cell-at": t(({ row:
|
|
1181
|
-
a(e(
|
|
1182
|
-
value:
|
|
1230
|
+
"cell-at": t(({ row: W }) => [
|
|
1231
|
+
a(e(ae), {
|
|
1232
|
+
value: W.at,
|
|
1183
1233
|
tone: "default",
|
|
1184
1234
|
compact: ""
|
|
1185
1235
|
}, null, 8, ["value"])
|
|
1186
1236
|
]),
|
|
1187
|
-
"cell-user": t(({ row:
|
|
1188
|
-
a(e(
|
|
1189
|
-
tone:
|
|
1237
|
+
"cell-user": t(({ row: W }) => [
|
|
1238
|
+
a(e(E), {
|
|
1239
|
+
tone: W.user === null || W.user.name === null ? "muted" : "default"
|
|
1190
1240
|
}, {
|
|
1191
1241
|
default: t(() => [
|
|
1192
|
-
|
|
1242
|
+
c(i(k(W.user)), 1)
|
|
1193
1243
|
]),
|
|
1194
1244
|
_: 2
|
|
1195
1245
|
}, 1032, ["tone"])
|
|
1196
1246
|
]),
|
|
1197
|
-
"cell-tool": t(({ row:
|
|
1198
|
-
a(e(
|
|
1247
|
+
"cell-tool": t(({ row: W }) => [
|
|
1248
|
+
a(e(E), {
|
|
1199
1249
|
mono: "",
|
|
1200
1250
|
size: "sm"
|
|
1201
1251
|
}, {
|
|
1202
1252
|
default: t(() => [
|
|
1203
|
-
|
|
1253
|
+
c(i(W.tool), 1)
|
|
1204
1254
|
]),
|
|
1205
1255
|
_: 2
|
|
1206
1256
|
}, 1024)
|
|
1207
1257
|
]),
|
|
1208
|
-
"cell-outcome": t(({ row:
|
|
1209
|
-
a(e(
|
|
1210
|
-
type:
|
|
1258
|
+
"cell-outcome": t(({ row: W }) => [
|
|
1259
|
+
a(e(q), {
|
|
1260
|
+
type: U(W).type,
|
|
1211
1261
|
dot: ""
|
|
1212
1262
|
}, {
|
|
1213
1263
|
default: t(() => [
|
|
1214
|
-
|
|
1264
|
+
c(i(U(W).label), 1)
|
|
1215
1265
|
]),
|
|
1216
1266
|
_: 2
|
|
1217
1267
|
}, 1032, ["type"])
|
|
1218
1268
|
]),
|
|
1219
|
-
"cell-duration_ms": t(({ row:
|
|
1220
|
-
a(e(
|
|
1269
|
+
"cell-duration_ms": t(({ row: W }) => [
|
|
1270
|
+
a(e(E), {
|
|
1221
1271
|
size: "sm",
|
|
1222
1272
|
tone: "muted"
|
|
1223
1273
|
}, {
|
|
1224
1274
|
default: t(() => [
|
|
1225
|
-
|
|
1275
|
+
c(i(e(o)("calls.ms", { count: W.duration_ms })), 1)
|
|
1226
1276
|
]),
|
|
1227
1277
|
_: 2
|
|
1228
1278
|
}, 1024)
|
|
1229
1279
|
]),
|
|
1230
|
-
"cell-client": t(({ row:
|
|
1231
|
-
|
|
1280
|
+
"cell-client": t(({ row: W }) => [
|
|
1281
|
+
W.client ? (m(), b(e(E), {
|
|
1232
1282
|
key: 0,
|
|
1233
1283
|
size: "sm"
|
|
1234
1284
|
}, {
|
|
1235
1285
|
default: t(() => [
|
|
1236
|
-
|
|
1286
|
+
c(i(W.client), 1)
|
|
1237
1287
|
]),
|
|
1238
1288
|
_: 2
|
|
1239
|
-
}, 1024)) : (
|
|
1289
|
+
}, 1024)) : (m(), b(e(E), {
|
|
1240
1290
|
key: 1,
|
|
1241
1291
|
size: "sm",
|
|
1242
1292
|
tone: "muted"
|
|
1243
1293
|
}, {
|
|
1244
|
-
default: t(() => [...
|
|
1245
|
-
|
|
1294
|
+
default: t(() => [...L[3] || (L[3] = [
|
|
1295
|
+
c("—", -1)
|
|
1246
1296
|
])]),
|
|
1247
1297
|
_: 1
|
|
1248
1298
|
}))
|
|
1249
1299
|
]),
|
|
1250
|
-
expanded: t(({ row:
|
|
1251
|
-
|
|
1252
|
-
|
|
1300
|
+
expanded: t(({ row: W }) => [
|
|
1301
|
+
S("div", Vt, [
|
|
1302
|
+
W.error ? (m(), b(e(E), {
|
|
1253
1303
|
key: 0,
|
|
1254
1304
|
tone: "danger",
|
|
1255
1305
|
size: "sm",
|
|
1256
1306
|
class: "wx-call-list__error"
|
|
1257
1307
|
}, {
|
|
1258
1308
|
default: t(() => [
|
|
1259
|
-
|
|
1260
|
-
|
|
1309
|
+
S("strong", null, i(e(o)("calls.error")) + ":", 1),
|
|
1310
|
+
c(" " + i(W.error), 1)
|
|
1261
1311
|
]),
|
|
1262
1312
|
_: 2
|
|
1263
|
-
}, 1024)) :
|
|
1264
|
-
|
|
1265
|
-
a(e(
|
|
1313
|
+
}, 1024)) : I("", !0),
|
|
1314
|
+
S("div", At, [
|
|
1315
|
+
a(e(E), {
|
|
1266
1316
|
size: "sm",
|
|
1267
1317
|
weight: "semibold"
|
|
1268
1318
|
}, {
|
|
1269
1319
|
default: t(() => [
|
|
1270
|
-
|
|
1320
|
+
c(i(e(o)("calls.request")), 1)
|
|
1271
1321
|
]),
|
|
1272
1322
|
_: 1
|
|
1273
1323
|
}),
|
|
1274
|
-
a(e(
|
|
1324
|
+
a(e(E), {
|
|
1275
1325
|
size: "xs",
|
|
1276
1326
|
tone: "muted"
|
|
1277
1327
|
}, {
|
|
1278
1328
|
default: t(() => [
|
|
1279
|
-
|
|
1329
|
+
c(i(e(o)("calls.request-hint")), 1)
|
|
1280
1330
|
]),
|
|
1281
1331
|
_: 1
|
|
1282
1332
|
})
|
|
1283
1333
|
]),
|
|
1284
|
-
|
|
1334
|
+
W.arguments ? (m(), H("pre", zt, i(W.arguments), 1)) : (m(), b(e(E), {
|
|
1285
1335
|
key: 2,
|
|
1286
1336
|
size: "sm",
|
|
1287
1337
|
tone: "muted"
|
|
1288
1338
|
}, {
|
|
1289
1339
|
default: t(() => [
|
|
1290
|
-
|
|
1340
|
+
c(i(e(o)("calls.no-arguments")), 1)
|
|
1291
1341
|
]),
|
|
1292
1342
|
_: 1
|
|
1293
1343
|
}))
|
|
1294
1344
|
])
|
|
1295
1345
|
]),
|
|
1296
|
-
"cell-card": t(({ row:
|
|
1297
|
-
a(e(
|
|
1346
|
+
"cell-card": t(({ row: W }) => [
|
|
1347
|
+
a(e(we), {
|
|
1298
1348
|
variant: "plain",
|
|
1299
|
-
title:
|
|
1300
|
-
subtitle:
|
|
1349
|
+
title: W.tool,
|
|
1350
|
+
subtitle: k(W.user)
|
|
1301
1351
|
}, {
|
|
1302
1352
|
media: t(() => [
|
|
1303
|
-
|
|
1304
|
-
a(e(
|
|
1353
|
+
S("span", Wt, [
|
|
1354
|
+
a(e(Z), { name: "sliders" })
|
|
1305
1355
|
])
|
|
1306
1356
|
]),
|
|
1307
1357
|
meta: t(() => [
|
|
1308
|
-
a(e(
|
|
1309
|
-
type:
|
|
1358
|
+
a(e(q), {
|
|
1359
|
+
type: U(W).type,
|
|
1310
1360
|
dot: "",
|
|
1311
1361
|
size: "sm"
|
|
1312
1362
|
}, {
|
|
1313
1363
|
default: t(() => [
|
|
1314
|
-
|
|
1364
|
+
c(i(U(W).label), 1)
|
|
1315
1365
|
]),
|
|
1316
1366
|
_: 2
|
|
1317
1367
|
}, 1032, ["type"]),
|
|
1318
|
-
a(e(
|
|
1319
|
-
value:
|
|
1368
|
+
a(e(ae), {
|
|
1369
|
+
value: W.at,
|
|
1320
1370
|
compact: ""
|
|
1321
1371
|
}, null, 8, ["value"]),
|
|
1322
|
-
|
|
1372
|
+
W.client ? (m(), b(e(E), {
|
|
1323
1373
|
key: 0,
|
|
1324
1374
|
size: "xs",
|
|
1325
1375
|
tone: "muted"
|
|
1326
1376
|
}, {
|
|
1327
1377
|
default: t(() => [
|
|
1328
|
-
|
|
1378
|
+
c(i(W.client), 1)
|
|
1329
1379
|
]),
|
|
1330
1380
|
_: 2
|
|
1331
|
-
}, 1024)) :
|
|
1381
|
+
}, 1024)) : I("", !0)
|
|
1332
1382
|
]),
|
|
1333
1383
|
default: t(() => [
|
|
1334
|
-
|
|
1384
|
+
z(W) ? (m(), b(e(se), {
|
|
1335
1385
|
key: 0,
|
|
1336
1386
|
direction: "vertical",
|
|
1337
1387
|
size: "xs",
|
|
1338
1388
|
class: "wx-call-list__card-details"
|
|
1339
1389
|
}, {
|
|
1340
1390
|
default: t(() => [
|
|
1341
|
-
|
|
1391
|
+
W.error ? (m(), b(e(E), {
|
|
1342
1392
|
key: 0,
|
|
1343
1393
|
tone: "danger",
|
|
1344
1394
|
size: "sm"
|
|
1345
1395
|
}, {
|
|
1346
1396
|
default: t(() => [
|
|
1347
|
-
|
|
1397
|
+
c(i(W.error), 1)
|
|
1348
1398
|
]),
|
|
1349
1399
|
_: 2
|
|
1350
|
-
}, 1024)) :
|
|
1351
|
-
|
|
1400
|
+
}, 1024)) : I("", !0),
|
|
1401
|
+
W.arguments ? (m(), b(e(E), {
|
|
1352
1402
|
key: 1,
|
|
1353
1403
|
size: "xs",
|
|
1354
1404
|
tone: "muted"
|
|
1355
1405
|
}, {
|
|
1356
1406
|
default: t(() => [
|
|
1357
|
-
|
|
1407
|
+
c(i(e(o)("calls.request")), 1)
|
|
1358
1408
|
]),
|
|
1359
1409
|
_: 1
|
|
1360
|
-
})) :
|
|
1361
|
-
|
|
1410
|
+
})) : I("", !0),
|
|
1411
|
+
W.arguments ? (m(), H("pre", St, i(W.arguments), 1)) : I("", !0)
|
|
1362
1412
|
]),
|
|
1363
1413
|
_: 2
|
|
1364
|
-
}, 1024)) :
|
|
1414
|
+
}, 1024)) : I("", !0)
|
|
1365
1415
|
]),
|
|
1366
1416
|
_: 2
|
|
1367
1417
|
}, 1032, ["title", "subtitle"])
|
|
@@ -1371,111 +1421,111 @@ const _t = { class: "wx-admin-form" }, bt = {
|
|
|
1371
1421
|
], 512));
|
|
1372
1422
|
}
|
|
1373
1423
|
});
|
|
1374
|
-
function
|
|
1375
|
-
const
|
|
1424
|
+
function Tt(s) {
|
|
1425
|
+
const r = `${s.apiPath}/auth/connections`;
|
|
1376
1426
|
return {
|
|
1377
|
-
list: (l = "mine") =>
|
|
1378
|
-
data:
|
|
1379
|
-
scope:
|
|
1380
|
-
canSeeEverybody:
|
|
1427
|
+
list: (l = "mine") => s.http.get(r, { query: { all: l === "all" ? 1 : void 0 } }).then((u) => ({
|
|
1428
|
+
data: u.data,
|
|
1429
|
+
scope: u.meta.scope,
|
|
1430
|
+
canSeeEverybody: u.meta.can_see_everybody
|
|
1381
1431
|
})),
|
|
1382
|
-
disconnect: (l) =>
|
|
1432
|
+
disconnect: (l) => s.http.delete(`${r}/${l}`).then((u) => u.data)
|
|
1383
1433
|
};
|
|
1384
1434
|
}
|
|
1385
|
-
const
|
|
1435
|
+
const Ut = {
|
|
1386
1436
|
class: "wx-connection-list__glyph",
|
|
1387
1437
|
"aria-hidden": "true"
|
|
1388
|
-
},
|
|
1438
|
+
}, Fe = 560, Ze = /* @__PURE__ */ Q({
|
|
1389
1439
|
__name: "ConnectionList",
|
|
1390
1440
|
props: {
|
|
1391
1441
|
scope: { default: "mine" }
|
|
1392
1442
|
},
|
|
1393
|
-
setup(
|
|
1394
|
-
const l =
|
|
1395
|
-
|
|
1396
|
-
const
|
|
1397
|
-
{ key: "client", label:
|
|
1398
|
-
...l.scope === "all" ? [{ key: "user", label:
|
|
1399
|
-
{ key: "read_only", label:
|
|
1400
|
-
{ key: "connected_at", label:
|
|
1401
|
-
{ key: "last_used_at", label:
|
|
1443
|
+
setup(s, { expose: r }) {
|
|
1444
|
+
const l = s, u = X(), v = Tt(u);
|
|
1445
|
+
ee();
|
|
1446
|
+
const y = G("webx-auth"), V = re(), o = oe("root"), h = ge(o), F = T(() => h.value > 0 && h.value < Fe), d = A([]), w = A(!1), x = A(null), p = T(() => F.value ? [{ key: "card", label: "" }] : [
|
|
1447
|
+
{ key: "client", label: y("connections.client"), minWidth: 210 },
|
|
1448
|
+
...l.scope === "all" ? [{ key: "user", label: y("connections.who"), minWidth: 140 }] : [],
|
|
1449
|
+
{ key: "read_only", label: y("connections.allowed"), minWidth: 160 },
|
|
1450
|
+
{ key: "connected_at", label: y("connections.connected"), hideBelow: 860 },
|
|
1451
|
+
{ key: "last_used_at", label: y("connections.last-used"), minWidth: 130 },
|
|
1402
1452
|
{ key: "end", label: "", align: "right", width: 140 }
|
|
1403
1453
|
]);
|
|
1404
|
-
function
|
|
1405
|
-
return
|
|
1454
|
+
function g(C) {
|
|
1455
|
+
return C.user.name ?? y("calls.deleted", { id: C.user.id });
|
|
1406
1456
|
}
|
|
1407
|
-
function
|
|
1408
|
-
if (
|
|
1409
|
-
if (l.scope !== "all") return
|
|
1410
|
-
const
|
|
1411
|
-
return
|
|
1457
|
+
function _(C) {
|
|
1458
|
+
if (C.read_only) return y("connections.read-only");
|
|
1459
|
+
if (l.scope !== "all") return y("connections.full-you");
|
|
1460
|
+
const O = C.user.name?.split(" ")[0];
|
|
1461
|
+
return y("connections.full", { name: O || g(C) });
|
|
1412
1462
|
}
|
|
1413
|
-
async function
|
|
1463
|
+
async function k() {
|
|
1414
1464
|
w.value = !0;
|
|
1415
1465
|
try {
|
|
1416
|
-
|
|
1417
|
-
} catch (
|
|
1418
|
-
|
|
1466
|
+
d.value = (await v.list(l.scope)).data;
|
|
1467
|
+
} catch (C) {
|
|
1468
|
+
K.danger(V(C));
|
|
1419
1469
|
} finally {
|
|
1420
1470
|
w.value = !1;
|
|
1421
1471
|
}
|
|
1422
1472
|
}
|
|
1423
|
-
async function
|
|
1424
|
-
if (await
|
|
1425
|
-
title:
|
|
1426
|
-
message:
|
|
1427
|
-
confirmText:
|
|
1428
|
-
cancelText:
|
|
1473
|
+
async function B(C) {
|
|
1474
|
+
if (await ze({
|
|
1475
|
+
title: y("connections.confirm-title", { client: C.client }),
|
|
1476
|
+
message: y("connections.confirm-text"),
|
|
1477
|
+
confirmText: y("connections.confirm"),
|
|
1478
|
+
cancelText: y("connections.cancel"),
|
|
1429
1479
|
tone: "danger"
|
|
1430
1480
|
})) {
|
|
1431
|
-
x.value =
|
|
1481
|
+
x.value = C.id;
|
|
1432
1482
|
try {
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1435
|
-
} catch (
|
|
1436
|
-
|
|
1483
|
+
const n = await v.disconnect(C.id);
|
|
1484
|
+
d.value = d.value.map(($) => $.id === n.id ? n : $), K.success(y("connections.done", { client: C.client }));
|
|
1485
|
+
} catch (n) {
|
|
1486
|
+
K.danger(V(n));
|
|
1437
1487
|
} finally {
|
|
1438
1488
|
x.value = null;
|
|
1439
1489
|
}
|
|
1440
1490
|
}
|
|
1441
1491
|
}
|
|
1442
|
-
return
|
|
1492
|
+
return de(() => l.scope, k, { immediate: !0 }), r({ reload: k }), (C, O) => (m(), H("div", {
|
|
1443
1493
|
ref_key: "root",
|
|
1444
|
-
ref:
|
|
1494
|
+
ref: o,
|
|
1445
1495
|
class: "wx-connection-list"
|
|
1446
1496
|
}, [
|
|
1447
|
-
a(e(
|
|
1448
|
-
data:
|
|
1449
|
-
columns:
|
|
1497
|
+
a(e(ke), {
|
|
1498
|
+
data: d.value,
|
|
1499
|
+
columns: p.value,
|
|
1450
1500
|
"row-key": "id",
|
|
1451
1501
|
flush: "",
|
|
1452
1502
|
loading: w.value,
|
|
1453
1503
|
clickable: !1,
|
|
1454
|
-
"empty-text":
|
|
1455
|
-
"cards-below":
|
|
1456
|
-
"row-class": (
|
|
1504
|
+
"empty-text": s.scope === "all" ? e(y)("connections.empty-all") : e(y)("connections.empty"),
|
|
1505
|
+
"cards-below": Fe,
|
|
1506
|
+
"row-class": (n) => n.revoked_at ? "is-ended" : ""
|
|
1457
1507
|
}, {
|
|
1458
|
-
"cell-client": t(({ row:
|
|
1508
|
+
"cell-client": t(({ row: n }) => [
|
|
1459
1509
|
a(e(se), {
|
|
1460
1510
|
direction: "vertical",
|
|
1461
1511
|
size: "none"
|
|
1462
1512
|
}, {
|
|
1463
1513
|
default: t(() => [
|
|
1464
|
-
a(e(
|
|
1465
|
-
tone:
|
|
1514
|
+
a(e(E), {
|
|
1515
|
+
tone: n.revoked_at ? "muted" : "default",
|
|
1466
1516
|
weight: "medium"
|
|
1467
1517
|
}, {
|
|
1468
1518
|
default: t(() => [
|
|
1469
|
-
|
|
1519
|
+
c(i(n.client), 1)
|
|
1470
1520
|
]),
|
|
1471
1521
|
_: 2
|
|
1472
1522
|
}, 1032, ["tone"]),
|
|
1473
|
-
a(e(
|
|
1523
|
+
a(e(E), {
|
|
1474
1524
|
size: "xs",
|
|
1475
1525
|
tone: "muted"
|
|
1476
1526
|
}, {
|
|
1477
1527
|
default: t(() => [
|
|
1478
|
-
|
|
1528
|
+
c(i(e(y)("connections.returns-to", { host: n.host })), 1)
|
|
1479
1529
|
]),
|
|
1480
1530
|
_: 2
|
|
1481
1531
|
}, 1024)
|
|
@@ -1483,145 +1533,145 @@ const St = {
|
|
|
1483
1533
|
_: 2
|
|
1484
1534
|
}, 1024)
|
|
1485
1535
|
]),
|
|
1486
|
-
"cell-user": t(({ row:
|
|
1487
|
-
a(e(
|
|
1488
|
-
tone:
|
|
1536
|
+
"cell-user": t(({ row: n }) => [
|
|
1537
|
+
a(e(E), {
|
|
1538
|
+
tone: n.user.name === null ? "muted" : "default"
|
|
1489
1539
|
}, {
|
|
1490
1540
|
default: t(() => [
|
|
1491
|
-
|
|
1541
|
+
c(i(g(n)), 1)
|
|
1492
1542
|
]),
|
|
1493
1543
|
_: 2
|
|
1494
1544
|
}, 1032, ["tone"])
|
|
1495
1545
|
]),
|
|
1496
|
-
"cell-read_only": t(({ row:
|
|
1497
|
-
|
|
1546
|
+
"cell-read_only": t(({ row: n }) => [
|
|
1547
|
+
n.revoked_at ? (m(), b(e(q), {
|
|
1498
1548
|
key: 0,
|
|
1499
1549
|
type: "default",
|
|
1500
1550
|
dot: ""
|
|
1501
1551
|
}, {
|
|
1502
1552
|
default: t(() => [
|
|
1503
|
-
|
|
1553
|
+
c(i(e(y)("connections.disconnected")), 1)
|
|
1504
1554
|
]),
|
|
1505
1555
|
_: 1
|
|
1506
|
-
})) : (
|
|
1556
|
+
})) : (m(), b(e(q), {
|
|
1507
1557
|
key: 1,
|
|
1508
|
-
type:
|
|
1558
|
+
type: n.read_only ? "info" : "success",
|
|
1509
1559
|
dot: ""
|
|
1510
1560
|
}, {
|
|
1511
1561
|
default: t(() => [
|
|
1512
|
-
|
|
1562
|
+
c(i(_(n)), 1)
|
|
1513
1563
|
]),
|
|
1514
1564
|
_: 2
|
|
1515
1565
|
}, 1032, ["type"]))
|
|
1516
1566
|
]),
|
|
1517
|
-
"cell-connected_at": t(({ row:
|
|
1518
|
-
a(e(
|
|
1519
|
-
value:
|
|
1567
|
+
"cell-connected_at": t(({ row: n }) => [
|
|
1568
|
+
a(e(ae), {
|
|
1569
|
+
value: n.connected_at,
|
|
1520
1570
|
tone: "muted",
|
|
1521
1571
|
compact: ""
|
|
1522
1572
|
}, null, 8, ["value"])
|
|
1523
1573
|
]),
|
|
1524
|
-
"cell-last_used_at": t(({ row:
|
|
1525
|
-
|
|
1574
|
+
"cell-last_used_at": t(({ row: n }) => [
|
|
1575
|
+
n.last_used_at ? (m(), b(e(ae), {
|
|
1526
1576
|
key: 0,
|
|
1527
|
-
value:
|
|
1577
|
+
value: n.last_used_at,
|
|
1528
1578
|
tone: "default",
|
|
1529
1579
|
compact: ""
|
|
1530
|
-
}, null, 8, ["value"])) : (
|
|
1580
|
+
}, null, 8, ["value"])) : (m(), b(e(E), {
|
|
1531
1581
|
key: 1,
|
|
1532
1582
|
size: "sm",
|
|
1533
1583
|
tone: "muted"
|
|
1534
1584
|
}, {
|
|
1535
1585
|
default: t(() => [
|
|
1536
|
-
|
|
1586
|
+
c(i(e(y)("connections.never-used")), 1)
|
|
1537
1587
|
]),
|
|
1538
1588
|
_: 1
|
|
1539
1589
|
}))
|
|
1540
1590
|
]),
|
|
1541
|
-
"cell-end": t(({ row:
|
|
1542
|
-
|
|
1591
|
+
"cell-end": t(({ row: n }) => [
|
|
1592
|
+
n.revoked_at ? I("", !0) : (m(), b(e(N), {
|
|
1543
1593
|
key: 0,
|
|
1544
1594
|
type: "danger",
|
|
1545
1595
|
variant: "text",
|
|
1546
1596
|
size: "sm",
|
|
1547
|
-
loading: x.value ===
|
|
1548
|
-
onClick: (
|
|
1597
|
+
loading: x.value === n.id,
|
|
1598
|
+
onClick: ($) => B(n)
|
|
1549
1599
|
}, {
|
|
1550
1600
|
default: t(() => [
|
|
1551
|
-
|
|
1601
|
+
c(i(e(y)("connections.disconnect")), 1)
|
|
1552
1602
|
]),
|
|
1553
1603
|
_: 1
|
|
1554
1604
|
}, 8, ["loading", "onClick"]))
|
|
1555
1605
|
]),
|
|
1556
|
-
"cell-card": t(({ row:
|
|
1557
|
-
a(e(
|
|
1606
|
+
"cell-card": t(({ row: n }) => [
|
|
1607
|
+
a(e(we), {
|
|
1558
1608
|
variant: "plain",
|
|
1559
|
-
title:
|
|
1560
|
-
subtitle: e(
|
|
1609
|
+
title: n.client,
|
|
1610
|
+
subtitle: e(y)("connections.returns-to", { host: n.host })
|
|
1561
1611
|
}, {
|
|
1562
1612
|
media: t(() => [
|
|
1563
|
-
|
|
1564
|
-
a(e(
|
|
1613
|
+
S("span", Ut, [
|
|
1614
|
+
a(e(Z), { name: "link" })
|
|
1565
1615
|
])
|
|
1566
1616
|
]),
|
|
1567
1617
|
meta: t(() => [
|
|
1568
|
-
|
|
1618
|
+
n.revoked_at ? (m(), b(e(q), {
|
|
1569
1619
|
key: 0,
|
|
1570
1620
|
type: "default",
|
|
1571
1621
|
dot: "",
|
|
1572
1622
|
size: "sm"
|
|
1573
1623
|
}, {
|
|
1574
1624
|
default: t(() => [
|
|
1575
|
-
|
|
1625
|
+
c(i(e(y)("connections.disconnected")), 1)
|
|
1576
1626
|
]),
|
|
1577
1627
|
_: 1
|
|
1578
|
-
})) : (
|
|
1628
|
+
})) : (m(), b(e(q), {
|
|
1579
1629
|
key: 1,
|
|
1580
|
-
type:
|
|
1630
|
+
type: n.read_only ? "info" : "success",
|
|
1581
1631
|
dot: "",
|
|
1582
1632
|
size: "sm"
|
|
1583
1633
|
}, {
|
|
1584
1634
|
default: t(() => [
|
|
1585
|
-
|
|
1635
|
+
c(i(_(n)), 1)
|
|
1586
1636
|
]),
|
|
1587
1637
|
_: 2
|
|
1588
1638
|
}, 1032, ["type"])),
|
|
1589
|
-
|
|
1639
|
+
s.scope === "all" ? (m(), b(e(E), {
|
|
1590
1640
|
key: 2,
|
|
1591
1641
|
size: "xs",
|
|
1592
1642
|
tone: "muted"
|
|
1593
1643
|
}, {
|
|
1594
1644
|
default: t(() => [
|
|
1595
|
-
|
|
1645
|
+
c(i(g(n)), 1)
|
|
1596
1646
|
]),
|
|
1597
1647
|
_: 2
|
|
1598
|
-
}, 1024)) :
|
|
1599
|
-
|
|
1648
|
+
}, 1024)) : I("", !0),
|
|
1649
|
+
n.last_used_at ? (m(), b(e(ae), {
|
|
1600
1650
|
key: 3,
|
|
1601
|
-
value:
|
|
1651
|
+
value: n.last_used_at,
|
|
1602
1652
|
compact: ""
|
|
1603
|
-
}, null, 8, ["value"])) : (
|
|
1653
|
+
}, null, 8, ["value"])) : (m(), b(e(E), {
|
|
1604
1654
|
key: 4,
|
|
1605
1655
|
size: "xs",
|
|
1606
1656
|
tone: "muted"
|
|
1607
1657
|
}, {
|
|
1608
1658
|
default: t(() => [
|
|
1609
|
-
|
|
1659
|
+
c(i(e(y)("connections.never-used")), 1)
|
|
1610
1660
|
]),
|
|
1611
1661
|
_: 1
|
|
1612
1662
|
}))
|
|
1613
1663
|
]),
|
|
1614
1664
|
actions: t(() => [
|
|
1615
|
-
|
|
1665
|
+
n.revoked_at ? I("", !0) : (m(), b(e(N), {
|
|
1616
1666
|
key: 0,
|
|
1617
1667
|
type: "danger",
|
|
1618
1668
|
variant: "text",
|
|
1619
1669
|
size: "sm",
|
|
1620
|
-
loading: x.value ===
|
|
1621
|
-
onClick: (
|
|
1670
|
+
loading: x.value === n.id,
|
|
1671
|
+
onClick: ($) => B(n)
|
|
1622
1672
|
}, {
|
|
1623
1673
|
default: t(() => [
|
|
1624
|
-
|
|
1674
|
+
c(i(e(y)("connections.disconnect")), 1)
|
|
1625
1675
|
]),
|
|
1626
1676
|
_: 1
|
|
1627
1677
|
}, 8, ["loading", "onClick"]))
|
|
@@ -1633,7 +1683,563 @@ const St = {
|
|
|
1633
1683
|
}, 8, ["data", "columns", "loading", "empty-text", "row-class"])
|
|
1634
1684
|
], 512));
|
|
1635
1685
|
}
|
|
1636
|
-
})
|
|
1686
|
+
});
|
|
1687
|
+
async function et(s) {
|
|
1688
|
+
try {
|
|
1689
|
+
if (navigator.clipboard?.writeText)
|
|
1690
|
+
return await navigator.clipboard.writeText(s), !0;
|
|
1691
|
+
} catch {
|
|
1692
|
+
}
|
|
1693
|
+
return Pt(s);
|
|
1694
|
+
}
|
|
1695
|
+
function Pt(s) {
|
|
1696
|
+
const r = document.createElement("textarea");
|
|
1697
|
+
r.value = s, r.setAttribute("readonly", ""), r.style.position = "fixed", r.style.opacity = "0", document.body.append(r), r.select();
|
|
1698
|
+
try {
|
|
1699
|
+
return document.execCommand("copy");
|
|
1700
|
+
} catch {
|
|
1701
|
+
return !1;
|
|
1702
|
+
} finally {
|
|
1703
|
+
r.remove();
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
function tt(s) {
|
|
1707
|
+
const r = `${s.apiPath}/auth/keys`;
|
|
1708
|
+
return {
|
|
1709
|
+
list: () => s.http.get(r).then((l) => ({
|
|
1710
|
+
data: l.data,
|
|
1711
|
+
scopes: l.meta.scopes,
|
|
1712
|
+
maxDays: l.meta.max_days
|
|
1713
|
+
})),
|
|
1714
|
+
issue: (l) => s.http.post(r, l).then((u) => ({ key: u.data, token: u.token })),
|
|
1715
|
+
revoke: (l) => s.http.delete(`${r}/${l}`).then((u) => u.data)
|
|
1716
|
+
};
|
|
1717
|
+
}
|
|
1718
|
+
const Ft = {
|
|
1719
|
+
key: 0,
|
|
1720
|
+
class: "wx-key-dialog"
|
|
1721
|
+
}, Rt = { class: "wx-key-dialog__secret" }, Ot = {
|
|
1722
|
+
key: 1,
|
|
1723
|
+
class: "wx-key-dialog"
|
|
1724
|
+
}, Bt = /* @__PURE__ */ Q({
|
|
1725
|
+
__name: "KeyDialog",
|
|
1726
|
+
setup(s) {
|
|
1727
|
+
const { open: r, resolve: l, dismiss: u } = _e(), v = X(), y = tt(v), V = pe(v);
|
|
1728
|
+
ee();
|
|
1729
|
+
const o = G("webx-auth"), h = re(), F = [30, 90, 365, 1095, 3650], d = A({
|
|
1730
|
+
name: "",
|
|
1731
|
+
admin: null,
|
|
1732
|
+
access: "everything",
|
|
1733
|
+
scopes: [],
|
|
1734
|
+
days: 365
|
|
1735
|
+
}), w = A([]), x = A([]), p = A(!1), g = A({}), _ = A(null), k = A(!1), B = T(
|
|
1736
|
+
() => w.value.filter((z) => z !== "mcp:use").map((z) => ({ value: z, label: z }))
|
|
1737
|
+
), C = T(() => [
|
|
1738
|
+
{ value: "everything", label: o("keys.everything") },
|
|
1739
|
+
{ value: "chosen", label: o("keys.chosen") }
|
|
1740
|
+
]), O = T(
|
|
1741
|
+
() => F.map((z) => ({ value: z, label: o(`keys.days-${z}`) }))
|
|
1742
|
+
), n = T(() => {
|
|
1743
|
+
const z = v.state.manifest?.modules.find((f) => f.id === "connect")?.meta;
|
|
1744
|
+
return typeof z?.url == "string" ? z.url : "";
|
|
1745
|
+
});
|
|
1746
|
+
y.list().then(
|
|
1747
|
+
(z) => w.value = z.scopes,
|
|
1748
|
+
(z) => K.danger(h(z))
|
|
1749
|
+
), V.list({ active: "yes", per_page: 100, sort: "name" }).then(
|
|
1750
|
+
(z) => x.value = z.data.map((f) => ({
|
|
1751
|
+
value: f.id,
|
|
1752
|
+
label: `${f.name} · ${f.email}`
|
|
1753
|
+
})),
|
|
1754
|
+
(z) => K.danger(h(z))
|
|
1755
|
+
);
|
|
1756
|
+
function $(z) {
|
|
1757
|
+
return g.value[z]?.[0] ?? g.value[`${z}.0`]?.[0];
|
|
1758
|
+
}
|
|
1759
|
+
async function R() {
|
|
1760
|
+
if (g.value = {}, d.value.access === "chosen" && d.value.scopes.length === 0) {
|
|
1761
|
+
g.value = { scopes: [o("keys.scopes-required")] };
|
|
1762
|
+
return;
|
|
1763
|
+
}
|
|
1764
|
+
p.value = !0;
|
|
1765
|
+
try {
|
|
1766
|
+
_.value = await y.issue({
|
|
1767
|
+
name: d.value.name,
|
|
1768
|
+
admin: d.value.admin ?? 0,
|
|
1769
|
+
scopes: d.value.access === "chosen" ? d.value.scopes : [],
|
|
1770
|
+
days: d.value.days
|
|
1771
|
+
});
|
|
1772
|
+
} catch (z) {
|
|
1773
|
+
const f = z.body;
|
|
1774
|
+
f?.errors ? g.value = f.errors : K.danger(h(z));
|
|
1775
|
+
} finally {
|
|
1776
|
+
p.value = !1;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
async function Y() {
|
|
1780
|
+
_.value !== null && (await et(_.value.token) ? k.value = !0 : K.danger(o("keys.copy-failed")));
|
|
1781
|
+
}
|
|
1782
|
+
function U() {
|
|
1783
|
+
_.value ? l(_.value.key) : u();
|
|
1784
|
+
}
|
|
1785
|
+
return (z, f) => (m(), b(e(be), {
|
|
1786
|
+
open: e(r),
|
|
1787
|
+
title: _.value ? e(o)("keys.issued-title") : e(o)("keys.issue"),
|
|
1788
|
+
width: 640,
|
|
1789
|
+
"onUpdate:open": f[5] || (f[5] = (L) => L ? void 0 : U())
|
|
1790
|
+
}, {
|
|
1791
|
+
footer: t(() => [
|
|
1792
|
+
a(e(se), { size: "sm" }, {
|
|
1793
|
+
default: t(() => [
|
|
1794
|
+
_.value ? (m(), b(e(N), {
|
|
1795
|
+
key: 0,
|
|
1796
|
+
type: "primary",
|
|
1797
|
+
onClick: U
|
|
1798
|
+
}, {
|
|
1799
|
+
default: t(() => [
|
|
1800
|
+
c(i(e(o)("keys.done")), 1)
|
|
1801
|
+
]),
|
|
1802
|
+
_: 1
|
|
1803
|
+
})) : (m(), H(ue, { key: 1 }, [
|
|
1804
|
+
a(e(N), {
|
|
1805
|
+
variant: "outline",
|
|
1806
|
+
onClick: U
|
|
1807
|
+
}, {
|
|
1808
|
+
default: t(() => [
|
|
1809
|
+
c(i(e(o)("keys.cancel")), 1)
|
|
1810
|
+
]),
|
|
1811
|
+
_: 1
|
|
1812
|
+
}),
|
|
1813
|
+
a(e(N), {
|
|
1814
|
+
type: "primary",
|
|
1815
|
+
loading: p.value,
|
|
1816
|
+
onClick: R
|
|
1817
|
+
}, {
|
|
1818
|
+
default: t(() => [
|
|
1819
|
+
c(i(e(o)("keys.issue-short")), 1)
|
|
1820
|
+
]),
|
|
1821
|
+
_: 1
|
|
1822
|
+
}, 8, ["loading"])
|
|
1823
|
+
], 64))
|
|
1824
|
+
]),
|
|
1825
|
+
_: 1
|
|
1826
|
+
})
|
|
1827
|
+
]),
|
|
1828
|
+
default: t(() => [
|
|
1829
|
+
_.value ? (m(), H("div", Ft, [
|
|
1830
|
+
a(e(qe), {
|
|
1831
|
+
type: "warning",
|
|
1832
|
+
closable: !1
|
|
1833
|
+
}, {
|
|
1834
|
+
default: t(() => [
|
|
1835
|
+
c(i(e(o)("keys.issued-text")), 1)
|
|
1836
|
+
]),
|
|
1837
|
+
_: 1
|
|
1838
|
+
}),
|
|
1839
|
+
a(e(M), {
|
|
1840
|
+
label: e(o)("keys.secret")
|
|
1841
|
+
}, {
|
|
1842
|
+
default: t(() => [
|
|
1843
|
+
S("div", Rt, [
|
|
1844
|
+
a(e(le), {
|
|
1845
|
+
"model-value": _.value.token,
|
|
1846
|
+
readonly: "",
|
|
1847
|
+
name: "token"
|
|
1848
|
+
}, null, 8, ["model-value"]),
|
|
1849
|
+
a(e(N), {
|
|
1850
|
+
type: "primary",
|
|
1851
|
+
onClick: Y
|
|
1852
|
+
}, {
|
|
1853
|
+
icon: t(() => [
|
|
1854
|
+
a(e(Z), {
|
|
1855
|
+
name: k.value ? "check" : "copy"
|
|
1856
|
+
}, null, 8, ["name"])
|
|
1857
|
+
]),
|
|
1858
|
+
default: t(() => [
|
|
1859
|
+
c(" " + i(k.value ? e(o)("keys.copied") : e(o)("keys.copy")), 1)
|
|
1860
|
+
]),
|
|
1861
|
+
_: 1
|
|
1862
|
+
})
|
|
1863
|
+
])
|
|
1864
|
+
]),
|
|
1865
|
+
_: 1
|
|
1866
|
+
}, 8, ["label"]),
|
|
1867
|
+
n.value ? (m(), b(e(M), {
|
|
1868
|
+
key: 0,
|
|
1869
|
+
label: e(o)("keys.address")
|
|
1870
|
+
}, {
|
|
1871
|
+
default: t(() => [
|
|
1872
|
+
a(e(le), {
|
|
1873
|
+
"model-value": n.value,
|
|
1874
|
+
readonly: "",
|
|
1875
|
+
name: "address"
|
|
1876
|
+
}, null, 8, ["model-value"])
|
|
1877
|
+
]),
|
|
1878
|
+
_: 1
|
|
1879
|
+
}, 8, ["label"])) : I("", !0),
|
|
1880
|
+
a(e(E), {
|
|
1881
|
+
size: "sm",
|
|
1882
|
+
tone: "muted"
|
|
1883
|
+
}, {
|
|
1884
|
+
default: t(() => [
|
|
1885
|
+
c(i(e(o)("keys.header-hint")), 1)
|
|
1886
|
+
]),
|
|
1887
|
+
_: 1
|
|
1888
|
+
})
|
|
1889
|
+
])) : (m(), H("div", Ot, [
|
|
1890
|
+
a(e(E), {
|
|
1891
|
+
size: "sm",
|
|
1892
|
+
tone: "muted"
|
|
1893
|
+
}, {
|
|
1894
|
+
default: t(() => [
|
|
1895
|
+
c(i(e(o)("keys.lead")), 1)
|
|
1896
|
+
]),
|
|
1897
|
+
_: 1
|
|
1898
|
+
}),
|
|
1899
|
+
a(e(M), {
|
|
1900
|
+
label: e(o)("keys.name"),
|
|
1901
|
+
error: $("name"),
|
|
1902
|
+
help: e(o)("keys.name-hint")
|
|
1903
|
+
}, {
|
|
1904
|
+
default: t(() => [
|
|
1905
|
+
a(e(le), {
|
|
1906
|
+
modelValue: d.value.name,
|
|
1907
|
+
"onUpdate:modelValue": f[0] || (f[0] = (L) => d.value.name = L),
|
|
1908
|
+
name: "name",
|
|
1909
|
+
autocomplete: "off"
|
|
1910
|
+
}, null, 8, ["modelValue"])
|
|
1911
|
+
]),
|
|
1912
|
+
_: 1
|
|
1913
|
+
}, 8, ["label", "error", "help"]),
|
|
1914
|
+
a(e(M), {
|
|
1915
|
+
label: e(o)("keys.who"),
|
|
1916
|
+
error: $("admin"),
|
|
1917
|
+
help: e(o)("keys.who-hint")
|
|
1918
|
+
}, {
|
|
1919
|
+
default: t(() => [
|
|
1920
|
+
a(e(ne), {
|
|
1921
|
+
modelValue: d.value.admin,
|
|
1922
|
+
"onUpdate:modelValue": f[1] || (f[1] = (L) => d.value.admin = L),
|
|
1923
|
+
options: x.value,
|
|
1924
|
+
filterable: "",
|
|
1925
|
+
name: "admin"
|
|
1926
|
+
}, null, 8, ["modelValue", "options"])
|
|
1927
|
+
]),
|
|
1928
|
+
_: 1
|
|
1929
|
+
}, 8, ["label", "error", "help"]),
|
|
1930
|
+
a(e(M), {
|
|
1931
|
+
label: e(o)("keys.allowed")
|
|
1932
|
+
}, {
|
|
1933
|
+
default: t(() => [
|
|
1934
|
+
a(e(mt), {
|
|
1935
|
+
modelValue: d.value.access,
|
|
1936
|
+
"onUpdate:modelValue": f[2] || (f[2] = (L) => d.value.access = L),
|
|
1937
|
+
options: C.value,
|
|
1938
|
+
name: "access"
|
|
1939
|
+
}, null, 8, ["modelValue", "options"])
|
|
1940
|
+
]),
|
|
1941
|
+
_: 1
|
|
1942
|
+
}, 8, ["label"]),
|
|
1943
|
+
d.value.access === "chosen" ? (m(), b(e(M), {
|
|
1944
|
+
key: 0,
|
|
1945
|
+
label: e(o)("keys.scopes"),
|
|
1946
|
+
error: $("scopes"),
|
|
1947
|
+
help: e(o)("keys.scopes-hint")
|
|
1948
|
+
}, {
|
|
1949
|
+
default: t(() => [
|
|
1950
|
+
a(e(ne), {
|
|
1951
|
+
modelValue: d.value.scopes,
|
|
1952
|
+
"onUpdate:modelValue": f[3] || (f[3] = (L) => d.value.scopes = L),
|
|
1953
|
+
options: B.value,
|
|
1954
|
+
multiple: "",
|
|
1955
|
+
filterable: "",
|
|
1956
|
+
name: "scopes"
|
|
1957
|
+
}, null, 8, ["modelValue", "options"])
|
|
1958
|
+
]),
|
|
1959
|
+
_: 1
|
|
1960
|
+
}, 8, ["label", "error", "help"])) : I("", !0),
|
|
1961
|
+
a(e(M), {
|
|
1962
|
+
label: e(o)("keys.lifetime"),
|
|
1963
|
+
error: $("days"),
|
|
1964
|
+
help: e(o)("keys.lifetime-hint")
|
|
1965
|
+
}, {
|
|
1966
|
+
default: t(() => [
|
|
1967
|
+
a(e(ne), {
|
|
1968
|
+
modelValue: d.value.days,
|
|
1969
|
+
"onUpdate:modelValue": f[4] || (f[4] = (L) => d.value.days = L),
|
|
1970
|
+
options: O.value,
|
|
1971
|
+
name: "days"
|
|
1972
|
+
}, null, 8, ["modelValue", "options"])
|
|
1973
|
+
]),
|
|
1974
|
+
_: 1
|
|
1975
|
+
}, 8, ["label", "error", "help"])
|
|
1976
|
+
]))
|
|
1977
|
+
]),
|
|
1978
|
+
_: 1
|
|
1979
|
+
}, 8, ["open", "title"]));
|
|
1980
|
+
}
|
|
1981
|
+
}), Et = {
|
|
1982
|
+
class: "wx-key-list__glyph",
|
|
1983
|
+
"aria-hidden": "true"
|
|
1984
|
+
}, Re = 560, It = /* @__PURE__ */ Q({
|
|
1985
|
+
__name: "KeyList",
|
|
1986
|
+
setup(s, { expose: r }) {
|
|
1987
|
+
const l = X(), u = tt(l);
|
|
1988
|
+
ee();
|
|
1989
|
+
const v = G("webx-auth"), y = re(), V = oe("root"), o = ge(V), h = T(() => o.value > 0 && o.value < Re), F = A([]), d = A(!1), w = A(null), x = T(() => h.value ? [{ key: "card", label: "" }] : [
|
|
1990
|
+
{ key: "name", label: v("keys.name"), minWidth: 200 },
|
|
1991
|
+
{ key: "user", label: v("keys.who"), minWidth: 140 },
|
|
1992
|
+
{ key: "scopes", label: v("keys.allowed"), minWidth: 180 },
|
|
1993
|
+
{ key: "expires_at", label: v("keys.expires"), minWidth: 120 },
|
|
1994
|
+
{ key: "last_used_at", label: v("keys.last-used"), minWidth: 120, hideBelow: 860 },
|
|
1995
|
+
{ key: "end", label: "", align: "right", width: 120 }
|
|
1996
|
+
]);
|
|
1997
|
+
function p(C) {
|
|
1998
|
+
return C.user.name ?? v("keys.deleted", { id: C.user.id });
|
|
1999
|
+
}
|
|
2000
|
+
function g(C) {
|
|
2001
|
+
return C.created_by?.name ? v("keys.issued-by", { name: C.created_by.name }) : v("keys.issued-console");
|
|
2002
|
+
}
|
|
2003
|
+
function _(C) {
|
|
2004
|
+
return C.everything ? v("keys.full", { name: C.user.name?.split(" ")[0] || p(C) }) : C.scopes.join(", ");
|
|
2005
|
+
}
|
|
2006
|
+
async function k() {
|
|
2007
|
+
d.value = !0;
|
|
2008
|
+
try {
|
|
2009
|
+
F.value = (await u.list()).data;
|
|
2010
|
+
} catch (C) {
|
|
2011
|
+
K.danger(y(C));
|
|
2012
|
+
} finally {
|
|
2013
|
+
d.value = !1;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
async function B(C) {
|
|
2017
|
+
if (await ze({
|
|
2018
|
+
title: v("keys.confirm-title", { name: C.name }),
|
|
2019
|
+
message: v("keys.confirm-text"),
|
|
2020
|
+
confirmText: v("keys.confirm"),
|
|
2021
|
+
cancelText: v("keys.cancel"),
|
|
2022
|
+
tone: "danger"
|
|
2023
|
+
})) {
|
|
2024
|
+
w.value = C.id;
|
|
2025
|
+
try {
|
|
2026
|
+
const n = await u.revoke(C.id);
|
|
2027
|
+
F.value = F.value.map(($) => $.id === n.id ? n : $), K.success(v("keys.revoked-done", { name: C.name }));
|
|
2028
|
+
} catch (n) {
|
|
2029
|
+
K.danger(y(n));
|
|
2030
|
+
} finally {
|
|
2031
|
+
w.value = null;
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
return Ie(k), r({ reload: k }), (C, O) => (m(), H("div", {
|
|
2036
|
+
ref_key: "root",
|
|
2037
|
+
ref: V,
|
|
2038
|
+
class: "wx-key-list"
|
|
2039
|
+
}, [
|
|
2040
|
+
a(e(ke), {
|
|
2041
|
+
data: F.value,
|
|
2042
|
+
columns: x.value,
|
|
2043
|
+
"row-key": "id",
|
|
2044
|
+
flush: "",
|
|
2045
|
+
loading: d.value,
|
|
2046
|
+
clickable: !1,
|
|
2047
|
+
"empty-text": e(v)("keys.empty"),
|
|
2048
|
+
"cards-below": Re,
|
|
2049
|
+
"row-class": (n) => n.state === "live" ? "" : "is-ended"
|
|
2050
|
+
}, {
|
|
2051
|
+
"cell-name": t(({ row: n }) => [
|
|
2052
|
+
a(e(se), {
|
|
2053
|
+
direction: "vertical",
|
|
2054
|
+
size: "none"
|
|
2055
|
+
}, {
|
|
2056
|
+
default: t(() => [
|
|
2057
|
+
a(e(E), {
|
|
2058
|
+
tone: n.state === "live" ? "default" : "muted",
|
|
2059
|
+
weight: "medium"
|
|
2060
|
+
}, {
|
|
2061
|
+
default: t(() => [
|
|
2062
|
+
c(i(n.name), 1)
|
|
2063
|
+
]),
|
|
2064
|
+
_: 2
|
|
2065
|
+
}, 1032, ["tone"]),
|
|
2066
|
+
a(e(E), {
|
|
2067
|
+
size: "xs",
|
|
2068
|
+
tone: "muted"
|
|
2069
|
+
}, {
|
|
2070
|
+
default: t(() => [
|
|
2071
|
+
c(i(g(n)) + " · ", 1),
|
|
2072
|
+
a(e(ae), {
|
|
2073
|
+
value: n.created_at,
|
|
2074
|
+
tone: "muted",
|
|
2075
|
+
compact: ""
|
|
2076
|
+
}, null, 8, ["value"])
|
|
2077
|
+
]),
|
|
2078
|
+
_: 2
|
|
2079
|
+
}, 1024)
|
|
2080
|
+
]),
|
|
2081
|
+
_: 2
|
|
2082
|
+
}, 1024)
|
|
2083
|
+
]),
|
|
2084
|
+
"cell-user": t(({ row: n }) => [
|
|
2085
|
+
a(e(E), {
|
|
2086
|
+
tone: n.user.name === null ? "muted" : "default"
|
|
2087
|
+
}, {
|
|
2088
|
+
default: t(() => [
|
|
2089
|
+
c(i(p(n)), 1)
|
|
2090
|
+
]),
|
|
2091
|
+
_: 2
|
|
2092
|
+
}, 1032, ["tone"])
|
|
2093
|
+
]),
|
|
2094
|
+
"cell-scopes": t(({ row: n }) => [
|
|
2095
|
+
n.state === "revoked" ? (m(), b(e(q), {
|
|
2096
|
+
key: 0,
|
|
2097
|
+
type: "default",
|
|
2098
|
+
dot: ""
|
|
2099
|
+
}, {
|
|
2100
|
+
default: t(() => [
|
|
2101
|
+
c(i(e(v)("keys.revoked")), 1)
|
|
2102
|
+
]),
|
|
2103
|
+
_: 1
|
|
2104
|
+
})) : n.state === "expired" ? (m(), b(e(q), {
|
|
2105
|
+
key: 1,
|
|
2106
|
+
type: "default",
|
|
2107
|
+
dot: ""
|
|
2108
|
+
}, {
|
|
2109
|
+
default: t(() => [
|
|
2110
|
+
c(i(e(v)("keys.expired")), 1)
|
|
2111
|
+
]),
|
|
2112
|
+
_: 1
|
|
2113
|
+
})) : (m(), b(e(q), {
|
|
2114
|
+
key: 2,
|
|
2115
|
+
type: n.everything ? "success" : "info",
|
|
2116
|
+
dot: ""
|
|
2117
|
+
}, {
|
|
2118
|
+
default: t(() => [
|
|
2119
|
+
c(i(_(n)), 1)
|
|
2120
|
+
]),
|
|
2121
|
+
_: 2
|
|
2122
|
+
}, 1032, ["type"]))
|
|
2123
|
+
]),
|
|
2124
|
+
"cell-expires_at": t(({ row: n }) => [
|
|
2125
|
+
n.expires_at ? (m(), b(e(ae), {
|
|
2126
|
+
key: 0,
|
|
2127
|
+
value: n.expires_at,
|
|
2128
|
+
compact: ""
|
|
2129
|
+
}, null, 8, ["value"])) : I("", !0)
|
|
2130
|
+
]),
|
|
2131
|
+
"cell-last_used_at": t(({ row: n }) => [
|
|
2132
|
+
n.last_used_at ? (m(), b(e(ae), {
|
|
2133
|
+
key: 0,
|
|
2134
|
+
value: n.last_used_at,
|
|
2135
|
+
compact: ""
|
|
2136
|
+
}, null, 8, ["value"])) : (m(), b(e(E), {
|
|
2137
|
+
key: 1,
|
|
2138
|
+
size: "sm",
|
|
2139
|
+
tone: "muted"
|
|
2140
|
+
}, {
|
|
2141
|
+
default: t(() => [
|
|
2142
|
+
c(i(e(v)("keys.never-used")), 1)
|
|
2143
|
+
]),
|
|
2144
|
+
_: 1
|
|
2145
|
+
}))
|
|
2146
|
+
]),
|
|
2147
|
+
"cell-end": t(({ row: n }) => [
|
|
2148
|
+
n.state === "live" ? (m(), b(e(N), {
|
|
2149
|
+
key: 0,
|
|
2150
|
+
type: "danger",
|
|
2151
|
+
variant: "text",
|
|
2152
|
+
size: "sm",
|
|
2153
|
+
loading: w.value === n.id,
|
|
2154
|
+
onClick: ($) => B(n)
|
|
2155
|
+
}, {
|
|
2156
|
+
default: t(() => [
|
|
2157
|
+
c(i(e(v)("keys.revoke")), 1)
|
|
2158
|
+
]),
|
|
2159
|
+
_: 1
|
|
2160
|
+
}, 8, ["loading", "onClick"])) : I("", !0)
|
|
2161
|
+
]),
|
|
2162
|
+
"cell-card": t(({ row: n }) => [
|
|
2163
|
+
a(e(we), {
|
|
2164
|
+
variant: "plain",
|
|
2165
|
+
title: n.name,
|
|
2166
|
+
subtitle: p(n)
|
|
2167
|
+
}, {
|
|
2168
|
+
media: t(() => [
|
|
2169
|
+
S("span", Et, [
|
|
2170
|
+
a(e(Z), { name: "lock" })
|
|
2171
|
+
])
|
|
2172
|
+
]),
|
|
2173
|
+
meta: t(() => [
|
|
2174
|
+
n.state === "revoked" ? (m(), b(e(q), {
|
|
2175
|
+
key: 0,
|
|
2176
|
+
type: "default",
|
|
2177
|
+
dot: "",
|
|
2178
|
+
size: "sm"
|
|
2179
|
+
}, {
|
|
2180
|
+
default: t(() => [
|
|
2181
|
+
c(i(e(v)("keys.revoked")), 1)
|
|
2182
|
+
]),
|
|
2183
|
+
_: 1
|
|
2184
|
+
})) : n.state === "expired" ? (m(), b(e(q), {
|
|
2185
|
+
key: 1,
|
|
2186
|
+
type: "default",
|
|
2187
|
+
dot: "",
|
|
2188
|
+
size: "sm"
|
|
2189
|
+
}, {
|
|
2190
|
+
default: t(() => [
|
|
2191
|
+
c(i(e(v)("keys.expired")), 1)
|
|
2192
|
+
]),
|
|
2193
|
+
_: 1
|
|
2194
|
+
})) : (m(), b(e(q), {
|
|
2195
|
+
key: 2,
|
|
2196
|
+
type: n.everything ? "success" : "info",
|
|
2197
|
+
dot: "",
|
|
2198
|
+
size: "sm"
|
|
2199
|
+
}, {
|
|
2200
|
+
default: t(() => [
|
|
2201
|
+
c(i(_(n)), 1)
|
|
2202
|
+
]),
|
|
2203
|
+
_: 2
|
|
2204
|
+
}, 1032, ["type"])),
|
|
2205
|
+
n.expires_at ? (m(), b(e(E), {
|
|
2206
|
+
key: 3,
|
|
2207
|
+
size: "xs",
|
|
2208
|
+
tone: "muted"
|
|
2209
|
+
}, {
|
|
2210
|
+
default: t(() => [
|
|
2211
|
+
c(i(e(v)("keys.until")) + " ", 1),
|
|
2212
|
+
a(e(ae), {
|
|
2213
|
+
value: n.expires_at,
|
|
2214
|
+
compact: ""
|
|
2215
|
+
}, null, 8, ["value"])
|
|
2216
|
+
]),
|
|
2217
|
+
_: 2
|
|
2218
|
+
}, 1024)) : I("", !0)
|
|
2219
|
+
]),
|
|
2220
|
+
actions: t(() => [
|
|
2221
|
+
n.state === "live" ? (m(), b(e(N), {
|
|
2222
|
+
key: 0,
|
|
2223
|
+
type: "danger",
|
|
2224
|
+
variant: "text",
|
|
2225
|
+
size: "sm",
|
|
2226
|
+
loading: w.value === n.id,
|
|
2227
|
+
onClick: ($) => B(n)
|
|
2228
|
+
}, {
|
|
2229
|
+
default: t(() => [
|
|
2230
|
+
c(i(e(v)("keys.revoke")), 1)
|
|
2231
|
+
]),
|
|
2232
|
+
_: 1
|
|
2233
|
+
}, 8, ["loading", "onClick"])) : I("", !0)
|
|
2234
|
+
]),
|
|
2235
|
+
_: 2
|
|
2236
|
+
}, 1032, ["title", "subtitle"])
|
|
2237
|
+
]),
|
|
2238
|
+
_: 1
|
|
2239
|
+
}, 8, ["data", "columns", "loading", "empty-text", "row-class"])
|
|
2240
|
+
], 512));
|
|
2241
|
+
}
|
|
2242
|
+
}), Dt = /* @__PURE__ */ Q({
|
|
1637
2243
|
__name: "AdminsPage",
|
|
1638
2244
|
props: {
|
|
1639
2245
|
base: { default: "/admins" },
|
|
@@ -1641,259 +2247,257 @@ const St = {
|
|
|
1641
2247
|
avatarField: { default: void 0 },
|
|
1642
2248
|
resolveAvatar: { type: Function, default: void 0 }
|
|
1643
2249
|
},
|
|
1644
|
-
setup(
|
|
1645
|
-
const
|
|
1646
|
-
|
|
1647
|
-
const
|
|
1648
|
-
() => l.state.manifest?.modules.find((
|
|
1649
|
-
),
|
|
1650
|
-
const
|
|
1651
|
-
return
|
|
1652
|
-
}),
|
|
1653
|
-
get: () =>
|
|
1654
|
-
set: (
|
|
1655
|
-
const
|
|
1656
|
-
|
|
2250
|
+
setup(s) {
|
|
2251
|
+
const r = s, l = X(), u = pe(l), v = r.avatarField ?? Ye(l) ?? void 0, y = r.resolveAvatar ?? Je(l) ?? void 0, V = rt(), o = ct();
|
|
2252
|
+
ee();
|
|
2253
|
+
const h = G("webx-auth"), F = re(), d = oe("list"), w = oe("keys"), x = A(null), p = he($t), g = he(Bt), _ = l.can("admins.manage"), k = l.can("admins.audit"), B = T(
|
|
2254
|
+
() => l.state.manifest?.modules.find((U) => U.id === "admins")?.title ?? h("admins.title")
|
|
2255
|
+
), C = T(() => {
|
|
2256
|
+
const U = [{ value: "admins", label: B.value }];
|
|
2257
|
+
return k && U.push({ value: "calls", label: h("calls.title") }), _ && U.push({ value: "connections", label: h("connections.title") }), _ && U.push({ value: "keys", label: h("keys.title") }), U.length > 1 ? U : void 0;
|
|
2258
|
+
}), O = T({
|
|
2259
|
+
get: () => r.current,
|
|
2260
|
+
set: (U) => {
|
|
2261
|
+
const z = U === "admins" ? r.base : `${r.base}/${String(U)}`;
|
|
2262
|
+
z !== o.path && V.push(z);
|
|
1657
2263
|
}
|
|
1658
|
-
}),
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
F(null);
|
|
1667
|
-
}
|
|
2264
|
+
}), n = T(() => _ ? r.current === "admins" ? [
|
|
2265
|
+
{
|
|
2266
|
+
key: "new",
|
|
2267
|
+
label: h("admins.new-short"),
|
|
2268
|
+
icon: "plus",
|
|
2269
|
+
primary: !0,
|
|
2270
|
+
run: () => {
|
|
2271
|
+
R(null);
|
|
1668
2272
|
}
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
2273
|
+
}
|
|
2274
|
+
] : r.current === "keys" ? [
|
|
2275
|
+
{
|
|
2276
|
+
key: "issue",
|
|
2277
|
+
label: h("keys.issue-short"),
|
|
2278
|
+
icon: "plus",
|
|
2279
|
+
primary: !0,
|
|
2280
|
+
run: () => {
|
|
2281
|
+
$();
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
] : [] : []);
|
|
2285
|
+
async function $() {
|
|
2286
|
+
await g() && w.value?.reload();
|
|
2287
|
+
}
|
|
2288
|
+
async function R(U) {
|
|
2289
|
+
x.value = U, await p({ admin: U, avatarField: v }) && d.value?.reload();
|
|
1673
2290
|
}
|
|
1674
|
-
async function
|
|
1675
|
-
if (await
|
|
1676
|
-
title:
|
|
1677
|
-
message:
|
|
1678
|
-
confirmText:
|
|
1679
|
-
cancelText:
|
|
2291
|
+
async function Y(U) {
|
|
2292
|
+
if (await ze({
|
|
2293
|
+
title: h("admins.delete-title", { name: U.name }),
|
|
2294
|
+
message: h("admins.delete-text"),
|
|
2295
|
+
confirmText: h("admins.delete"),
|
|
2296
|
+
cancelText: h("admins.cancel"),
|
|
1680
2297
|
tone: "danger"
|
|
1681
2298
|
}))
|
|
1682
2299
|
try {
|
|
1683
|
-
await
|
|
1684
|
-
} catch (
|
|
1685
|
-
|
|
2300
|
+
await u.remove(U.id), K.success(h("admins.deleted")), d.value?.reload();
|
|
2301
|
+
} catch (f) {
|
|
2302
|
+
K.danger(F(f));
|
|
1686
2303
|
}
|
|
1687
2304
|
}
|
|
1688
|
-
return (
|
|
1689
|
-
view:
|
|
1690
|
-
"onUpdate:view":
|
|
1691
|
-
title:
|
|
1692
|
-
views:
|
|
1693
|
-
actions:
|
|
2305
|
+
return (U, z) => (m(), b(e(Ke), {
|
|
2306
|
+
view: O.value,
|
|
2307
|
+
"onUpdate:view": z[0] || (z[0] = (f) => O.value = f),
|
|
2308
|
+
title: B.value,
|
|
2309
|
+
views: C.value,
|
|
2310
|
+
actions: n.value
|
|
1694
2311
|
}, {
|
|
1695
2312
|
default: t(() => [
|
|
1696
|
-
|
|
2313
|
+
s.current === "calls" ? (m(), b(Lt, { key: 0 })) : s.current === "connections" ? (m(), b(Ze, {
|
|
1697
2314
|
key: 1,
|
|
1698
2315
|
scope: "all"
|
|
1699
|
-
})) : (
|
|
2316
|
+
})) : s.current === "keys" ? (m(), b(It, {
|
|
1700
2317
|
key: 2,
|
|
2318
|
+
ref: "keys"
|
|
2319
|
+
}, null, 512)) : (m(), b(Xe, {
|
|
2320
|
+
key: 3,
|
|
1701
2321
|
ref_key: "list",
|
|
1702
|
-
ref:
|
|
1703
|
-
removable: e(
|
|
1704
|
-
"resolve-avatar": e(
|
|
1705
|
-
onOpen:
|
|
1706
|
-
onRemove:
|
|
2322
|
+
ref: d,
|
|
2323
|
+
removable: e(_),
|
|
2324
|
+
"resolve-avatar": e(y),
|
|
2325
|
+
onOpen: R,
|
|
2326
|
+
onRemove: Y
|
|
1707
2327
|
}, null, 8, ["removable", "resolve-avatar"]))
|
|
1708
2328
|
]),
|
|
1709
2329
|
_: 1
|
|
1710
2330
|
}, 8, ["view", "title", "views", "actions"]));
|
|
1711
2331
|
}
|
|
1712
|
-
}),
|
|
2332
|
+
}), Nt = {
|
|
1713
2333
|
key: 0,
|
|
1714
2334
|
class: "wx-content-rules"
|
|
1715
|
-
},
|
|
2335
|
+
}, Mt = { class: "wx-content-rules__foot" }, Kt = /* @__PURE__ */ Q({
|
|
1716
2336
|
__name: "ContentRulesCard",
|
|
1717
|
-
setup(
|
|
1718
|
-
const
|
|
1719
|
-
|
|
1720
|
-
const l =
|
|
1721
|
-
const
|
|
1722
|
-
return typeof
|
|
1723
|
-
}),
|
|
1724
|
-
|
|
1725
|
-
if (!(!
|
|
2337
|
+
setup(s) {
|
|
2338
|
+
const r = X();
|
|
2339
|
+
ee();
|
|
2340
|
+
const l = G("webx-auth"), u = G("webx-admin"), v = re(), y = T(() => {
|
|
2341
|
+
const _ = r.state.manifest?.modules.find((k) => k.id === "settings")?.meta?.content_screen;
|
|
2342
|
+
return typeof _ == "string" ? _ : null;
|
|
2343
|
+
}), V = r.can("settings.view") || r.can("settings.manage"), o = r.can("settings.manage"), h = A({}), F = A({}), d = A(!0), w = A(!1), x = `${r.apiPath}/settings/content`;
|
|
2344
|
+
Ie(async () => {
|
|
2345
|
+
if (!(!y.value || !V))
|
|
1726
2346
|
try {
|
|
1727
|
-
const
|
|
1728
|
-
|
|
1729
|
-
} catch (
|
|
1730
|
-
|
|
2347
|
+
const g = await r.http.get(x);
|
|
2348
|
+
h.value = g.data.values;
|
|
2349
|
+
} catch (g) {
|
|
2350
|
+
K.danger(v(g));
|
|
1731
2351
|
} finally {
|
|
1732
|
-
|
|
2352
|
+
d.value = !1;
|
|
1733
2353
|
}
|
|
1734
2354
|
});
|
|
1735
|
-
async function
|
|
1736
|
-
w.value = !0,
|
|
2355
|
+
async function p() {
|
|
2356
|
+
w.value = !0, F.value = {};
|
|
1737
2357
|
try {
|
|
1738
|
-
const
|
|
1739
|
-
values:
|
|
2358
|
+
const g = await r.http.put(x, {
|
|
2359
|
+
values: h.value
|
|
1740
2360
|
});
|
|
1741
|
-
|
|
1742
|
-
} catch (
|
|
1743
|
-
const
|
|
1744
|
-
|
|
2361
|
+
h.value = g.data.values, K.success(u("editor.saved"));
|
|
2362
|
+
} catch (g) {
|
|
2363
|
+
const _ = g.body;
|
|
2364
|
+
_?.errors && (F.value = _.errors), K.danger(v(g));
|
|
1745
2365
|
} finally {
|
|
1746
2366
|
w.value = !1;
|
|
1747
2367
|
}
|
|
1748
2368
|
}
|
|
1749
|
-
return (
|
|
1750
|
-
a(e(
|
|
2369
|
+
return (g, _) => y.value && e(V) ? (m(), H("section", Nt, [
|
|
2370
|
+
a(e(me), {
|
|
1751
2371
|
level: 2,
|
|
1752
2372
|
size: "sm"
|
|
1753
2373
|
}, {
|
|
1754
2374
|
default: t(() => [
|
|
1755
|
-
|
|
2375
|
+
c(i(e(l)("connect.rules")), 1)
|
|
1756
2376
|
]),
|
|
1757
2377
|
_: 1
|
|
1758
2378
|
}),
|
|
1759
|
-
a(e(
|
|
2379
|
+
a(e($e), null, Ae({
|
|
1760
2380
|
default: t(() => [
|
|
1761
|
-
|
|
2381
|
+
d.value ? (m(), b(e(vt), {
|
|
1762
2382
|
key: 0,
|
|
1763
2383
|
rows: 4
|
|
1764
|
-
})) : (
|
|
2384
|
+
})) : (m(), b(e(it), {
|
|
1765
2385
|
key: 1,
|
|
1766
|
-
modelValue:
|
|
1767
|
-
"onUpdate:modelValue":
|
|
1768
|
-
name:
|
|
1769
|
-
errors:
|
|
1770
|
-
disabled: !e(
|
|
2386
|
+
modelValue: h.value,
|
|
2387
|
+
"onUpdate:modelValue": _[0] || (_[0] = (k) => h.value = k),
|
|
2388
|
+
name: y.value,
|
|
2389
|
+
errors: F.value,
|
|
2390
|
+
disabled: !e(o)
|
|
1771
2391
|
}, null, 8, ["modelValue", "name", "errors", "disabled"]))
|
|
1772
2392
|
]),
|
|
1773
2393
|
_: 2
|
|
1774
2394
|
}, [
|
|
1775
|
-
|
|
2395
|
+
d.value ? void 0 : {
|
|
1776
2396
|
name: "footer",
|
|
1777
2397
|
fn: t(() => [
|
|
1778
|
-
|
|
1779
|
-
a(e(
|
|
2398
|
+
S("div", Mt, [
|
|
2399
|
+
a(e(E), {
|
|
1780
2400
|
size: "sm",
|
|
1781
2401
|
tone: "muted"
|
|
1782
2402
|
}, {
|
|
1783
2403
|
default: t(() => [
|
|
1784
|
-
|
|
2404
|
+
c(i(e(l)("connect.rules-hint")), 1)
|
|
1785
2405
|
]),
|
|
1786
2406
|
_: 1
|
|
1787
2407
|
}),
|
|
1788
|
-
e(
|
|
2408
|
+
e(o) ? (m(), b(e(N), {
|
|
1789
2409
|
key: 0,
|
|
1790
2410
|
type: "primary",
|
|
1791
2411
|
loading: w.value,
|
|
1792
|
-
onClick:
|
|
2412
|
+
onClick: p
|
|
1793
2413
|
}, {
|
|
1794
2414
|
default: t(() => [
|
|
1795
|
-
|
|
2415
|
+
c(i(e(u)("editor.save")), 1)
|
|
1796
2416
|
]),
|
|
1797
2417
|
_: 1
|
|
1798
|
-
}, 8, ["loading"])) :
|
|
2418
|
+
}, 8, ["loading"])) : I("", !0)
|
|
1799
2419
|
])
|
|
1800
2420
|
]),
|
|
1801
2421
|
key: "0"
|
|
1802
2422
|
}
|
|
1803
2423
|
]), 1024)
|
|
1804
|
-
])) :
|
|
2424
|
+
])) : I("", !0);
|
|
1805
2425
|
}
|
|
1806
|
-
}),
|
|
2426
|
+
}), qt = /* @__PURE__ */ ve(Kt, [["__scopeId", "data-v-55be157e"]]), Ht = { class: "wx-connect" }, jt = { class: "wx-connect__section" }, Gt = { class: "wx-connect__row" }, Yt = { class: "wx-connect__url" }, Jt = { class: "wx-connect__section" }, Qt = { class: "wx-connect__steps" }, Xt = { class: "wx-connect__steps" }, Zt = { class: "wx-connect__snippet" }, ea = { class: "wx-connect__snippet" }, ta = { class: "wx-connect__section" }, aa = { class: "wx-connect__links" }, la = { class: "wx-connect__steps" }, na = { class: "wx-connect__section" }, sa = /* @__PURE__ */ Q({
|
|
1807
2427
|
__name: "ConnectPage",
|
|
1808
|
-
setup(
|
|
1809
|
-
const
|
|
1810
|
-
|
|
1811
|
-
const l =
|
|
1812
|
-
let
|
|
1813
|
-
const
|
|
1814
|
-
const
|
|
1815
|
-
return typeof
|
|
1816
|
-
}),
|
|
2428
|
+
setup(s) {
|
|
2429
|
+
const r = X();
|
|
2430
|
+
ee();
|
|
2431
|
+
const l = G("webx-auth"), u = A(!1);
|
|
2432
|
+
let v;
|
|
2433
|
+
const y = T(() => {
|
|
2434
|
+
const p = r.state.manifest?.modules.find((g) => g.id === "connect")?.meta;
|
|
2435
|
+
return typeof p?.url == "string" ? p.url : "";
|
|
2436
|
+
}), V = T(() => {
|
|
1817
2437
|
try {
|
|
1818
|
-
return new URL(
|
|
2438
|
+
return new URL(y.value).hostname.split(".")[0] || "webx";
|
|
1819
2439
|
} catch {
|
|
1820
2440
|
return "webx";
|
|
1821
2441
|
}
|
|
1822
|
-
}),
|
|
1823
|
-
url = "${
|
|
1824
|
-
const
|
|
1825
|
-
return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(
|
|
1826
|
-
}),
|
|
1827
|
-
const
|
|
1828
|
-
return `vscode:mcp/install?${encodeURIComponent(
|
|
2442
|
+
}), o = T(() => `claude mcp add --transport http ${V.value} ${y.value}`), h = T(() => `[mcp_servers.${V.value}]
|
|
2443
|
+
url = "${y.value}"`), F = T(() => {
|
|
2444
|
+
const p = w(JSON.stringify({ url: y.value }));
|
|
2445
|
+
return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(V.value)}&config=${p}`;
|
|
2446
|
+
}), d = T(() => {
|
|
2447
|
+
const p = JSON.stringify({ name: V.value, type: "http", url: y.value });
|
|
2448
|
+
return `vscode:mcp/install?${encodeURIComponent(p)}`;
|
|
1829
2449
|
});
|
|
1830
|
-
function w(
|
|
1831
|
-
const
|
|
2450
|
+
function w(p) {
|
|
2451
|
+
const g = new TextEncoder().encode(p);
|
|
1832
2452
|
let _ = "";
|
|
1833
|
-
for (const
|
|
2453
|
+
for (const k of g) _ += String.fromCharCode(k);
|
|
1834
2454
|
return encodeURIComponent(btoa(_));
|
|
1835
2455
|
}
|
|
1836
|
-
async function x(
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
else if (!f(y))
|
|
1841
|
-
throw new Error("no clipboard");
|
|
1842
|
-
s.value = !0, clearTimeout(g), g = setTimeout(() => s.value = !1, 2e3);
|
|
1843
|
-
} catch {
|
|
1844
|
-
if (f(y)) return;
|
|
1845
|
-
G.danger(l("connect.copy-failed"));
|
|
1846
|
-
}
|
|
1847
|
-
}
|
|
1848
|
-
function f(y) {
|
|
1849
|
-
const v = document.createElement("textarea");
|
|
1850
|
-
v.value = y, v.setAttribute("readonly", ""), v.style.position = "fixed", v.style.opacity = "0", document.body.append(v), v.select();
|
|
1851
|
-
try {
|
|
1852
|
-
return document.execCommand("copy");
|
|
1853
|
-
} catch {
|
|
1854
|
-
return !1;
|
|
1855
|
-
} finally {
|
|
1856
|
-
v.remove();
|
|
2456
|
+
async function x(p) {
|
|
2457
|
+
if (!await et(p)) {
|
|
2458
|
+
K.danger(l("connect.copy-failed"));
|
|
2459
|
+
return;
|
|
1857
2460
|
}
|
|
2461
|
+
u.value = !0, clearTimeout(v), v = setTimeout(() => u.value = !1, 2e3);
|
|
1858
2462
|
}
|
|
1859
|
-
return (
|
|
2463
|
+
return (p, g) => (m(), b(e(Ke), {
|
|
1860
2464
|
title: e(l)("connect.title"),
|
|
1861
2465
|
card: !1
|
|
1862
2466
|
}, {
|
|
1863
2467
|
default: t(() => [
|
|
1864
|
-
|
|
1865
|
-
a(e(
|
|
2468
|
+
S("div", Ht, [
|
|
2469
|
+
a(e(E), { class: "wx-connect__lead" }, {
|
|
1866
2470
|
default: t(() => [
|
|
1867
|
-
|
|
2471
|
+
c(i(e(l)("connect.lead")), 1)
|
|
1868
2472
|
]),
|
|
1869
2473
|
_: 1
|
|
1870
2474
|
}),
|
|
1871
|
-
|
|
1872
|
-
a(e(
|
|
2475
|
+
S("section", jt, [
|
|
2476
|
+
a(e(me), {
|
|
1873
2477
|
level: 2,
|
|
1874
2478
|
size: "sm"
|
|
1875
2479
|
}, {
|
|
1876
2480
|
default: t(() => [
|
|
1877
|
-
|
|
2481
|
+
c(i(e(l)("connect.address")), 1)
|
|
1878
2482
|
]),
|
|
1879
2483
|
_: 1
|
|
1880
2484
|
}),
|
|
1881
|
-
a(e(
|
|
2485
|
+
a(e($e), { bordered: "" }, {
|
|
1882
2486
|
default: t(() => [
|
|
1883
|
-
|
|
1884
|
-
|
|
2487
|
+
S("div", Gt, [
|
|
2488
|
+
S("code", Yt, i(y.value), 1),
|
|
1885
2489
|
a(e(N), {
|
|
1886
2490
|
type: "primary",
|
|
1887
|
-
disabled:
|
|
1888
|
-
onClick:
|
|
2491
|
+
disabled: y.value === "",
|
|
2492
|
+
onClick: g[0] || (g[0] = (_) => x(y.value))
|
|
1889
2493
|
}, {
|
|
1890
2494
|
icon: t(() => [
|
|
1891
|
-
a(e(
|
|
1892
|
-
name:
|
|
2495
|
+
a(e(Z), {
|
|
2496
|
+
name: u.value ? "check" : "copy"
|
|
1893
2497
|
}, null, 8, ["name"])
|
|
1894
2498
|
]),
|
|
1895
2499
|
default: t(() => [
|
|
1896
|
-
|
|
2500
|
+
c(" " + i(u.value ? e(l)("connect.copied") : e(l)("connect.copy")), 1)
|
|
1897
2501
|
]),
|
|
1898
2502
|
_: 1
|
|
1899
2503
|
}, 8, ["disabled"])
|
|
@@ -1902,70 +2506,70 @@ url = "${c.value}"`), U = T(() => {
|
|
|
1902
2506
|
_: 1
|
|
1903
2507
|
})
|
|
1904
2508
|
]),
|
|
1905
|
-
|
|
1906
|
-
a(e(
|
|
2509
|
+
S("section", Jt, [
|
|
2510
|
+
a(e(me), {
|
|
1907
2511
|
level: 2,
|
|
1908
2512
|
size: "sm"
|
|
1909
2513
|
}, {
|
|
1910
2514
|
default: t(() => [
|
|
1911
|
-
|
|
2515
|
+
c(i(e(l)("connect.how")), 1)
|
|
1912
2516
|
]),
|
|
1913
2517
|
_: 1
|
|
1914
2518
|
}),
|
|
1915
|
-
a(e(
|
|
2519
|
+
a(e(pt), {
|
|
1916
2520
|
variant: "line",
|
|
1917
2521
|
"aria-label": e(l)("connect.how")
|
|
1918
2522
|
}, {
|
|
1919
2523
|
default: t(() => [
|
|
1920
|
-
a(e(
|
|
2524
|
+
a(e(ye), {
|
|
1921
2525
|
value: "claude",
|
|
1922
2526
|
label: e(l)("connect.claude-title")
|
|
1923
2527
|
}, {
|
|
1924
2528
|
default: t(() => [
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2529
|
+
S("ol", Qt, [
|
|
2530
|
+
S("li", null, i(e(l)("connect.claude-1")), 1),
|
|
2531
|
+
S("li", null, i(e(l)("connect.claude-2")), 1),
|
|
2532
|
+
S("li", null, i(e(l)("connect.claude-3")), 1)
|
|
1929
2533
|
])
|
|
1930
2534
|
]),
|
|
1931
2535
|
_: 1
|
|
1932
2536
|
}, 8, ["label"]),
|
|
1933
|
-
a(e(
|
|
2537
|
+
a(e(ye), {
|
|
1934
2538
|
value: "chatgpt",
|
|
1935
2539
|
label: e(l)("connect.chatgpt-title")
|
|
1936
2540
|
}, {
|
|
1937
2541
|
default: t(() => [
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
2542
|
+
S("ol", Xt, [
|
|
2543
|
+
S("li", null, i(e(l)("connect.chatgpt-1")), 1),
|
|
2544
|
+
S("li", null, i(e(l)("connect.chatgpt-2")), 1),
|
|
2545
|
+
S("li", null, i(e(l)("connect.chatgpt-3")), 1)
|
|
1942
2546
|
])
|
|
1943
2547
|
]),
|
|
1944
2548
|
_: 1
|
|
1945
2549
|
}, 8, ["label"]),
|
|
1946
|
-
a(e(
|
|
2550
|
+
a(e(ye), {
|
|
1947
2551
|
value: "claude-code",
|
|
1948
2552
|
label: e(l)("connect.claude-code-title")
|
|
1949
2553
|
}, {
|
|
1950
2554
|
default: t(() => [
|
|
1951
|
-
a(e(
|
|
2555
|
+
a(e(E), { size: "sm" }, {
|
|
1952
2556
|
default: t(() => [
|
|
1953
|
-
|
|
2557
|
+
c(i(e(l)("connect.claude-code-hint")), 1)
|
|
1954
2558
|
]),
|
|
1955
2559
|
_: 1
|
|
1956
2560
|
}),
|
|
1957
|
-
|
|
1958
|
-
|
|
2561
|
+
S("div", Zt, [
|
|
2562
|
+
S("pre", null, i(o.value), 1),
|
|
1959
2563
|
a(e(N), {
|
|
1960
2564
|
variant: "text",
|
|
1961
2565
|
size: "sm",
|
|
1962
|
-
onClick:
|
|
2566
|
+
onClick: g[1] || (g[1] = (_) => x(o.value))
|
|
1963
2567
|
}, {
|
|
1964
2568
|
icon: t(() => [
|
|
1965
|
-
a(e(
|
|
2569
|
+
a(e(Z), { name: "copy" })
|
|
1966
2570
|
]),
|
|
1967
2571
|
default: t(() => [
|
|
1968
|
-
|
|
2572
|
+
c(" " + i(e(l)("connect.copy-line")), 1)
|
|
1969
2573
|
]),
|
|
1970
2574
|
_: 1
|
|
1971
2575
|
})
|
|
@@ -1973,29 +2577,29 @@ url = "${c.value}"`), U = T(() => {
|
|
|
1973
2577
|
]),
|
|
1974
2578
|
_: 1
|
|
1975
2579
|
}, 8, ["label"]),
|
|
1976
|
-
a(e(
|
|
2580
|
+
a(e(ye), {
|
|
1977
2581
|
value: "codex",
|
|
1978
2582
|
label: e(l)("connect.codex-title")
|
|
1979
2583
|
}, {
|
|
1980
2584
|
default: t(() => [
|
|
1981
|
-
a(e(
|
|
2585
|
+
a(e(E), { size: "sm" }, {
|
|
1982
2586
|
default: t(() => [
|
|
1983
|
-
|
|
2587
|
+
c(i(e(l)("connect.codex-hint")), 1)
|
|
1984
2588
|
]),
|
|
1985
2589
|
_: 1
|
|
1986
2590
|
}),
|
|
1987
|
-
|
|
1988
|
-
|
|
2591
|
+
S("div", ea, [
|
|
2592
|
+
S("pre", null, i(h.value), 1),
|
|
1989
2593
|
a(e(N), {
|
|
1990
2594
|
variant: "text",
|
|
1991
2595
|
size: "sm",
|
|
1992
|
-
onClick:
|
|
2596
|
+
onClick: g[2] || (g[2] = (_) => x(h.value))
|
|
1993
2597
|
}, {
|
|
1994
2598
|
icon: t(() => [
|
|
1995
|
-
a(e(
|
|
2599
|
+
a(e(Z), { name: "copy" })
|
|
1996
2600
|
]),
|
|
1997
2601
|
default: t(() => [
|
|
1998
|
-
|
|
2602
|
+
c(" " + i(e(l)("connect.copy-line")), 1)
|
|
1999
2603
|
]),
|
|
2000
2604
|
_: 1
|
|
2001
2605
|
})
|
|
@@ -2007,83 +2611,83 @@ url = "${c.value}"`), U = T(() => {
|
|
|
2007
2611
|
_: 1
|
|
2008
2612
|
}, 8, ["aria-label"])
|
|
2009
2613
|
]),
|
|
2010
|
-
|
|
2011
|
-
a(e(
|
|
2614
|
+
S("section", ta, [
|
|
2615
|
+
a(e(me), {
|
|
2012
2616
|
level: 2,
|
|
2013
2617
|
size: "sm"
|
|
2014
2618
|
}, {
|
|
2015
2619
|
default: t(() => [
|
|
2016
|
-
|
|
2620
|
+
c(i(e(l)("connect.one-click")), 1)
|
|
2017
2621
|
]),
|
|
2018
2622
|
_: 1
|
|
2019
2623
|
}),
|
|
2020
|
-
a(e(
|
|
2624
|
+
a(e(E), {
|
|
2021
2625
|
size: "sm",
|
|
2022
2626
|
tone: "muted"
|
|
2023
2627
|
}, {
|
|
2024
2628
|
default: t(() => [
|
|
2025
|
-
|
|
2629
|
+
c(i(e(l)("connect.one-click-hint")), 1)
|
|
2026
2630
|
]),
|
|
2027
2631
|
_: 1
|
|
2028
2632
|
}),
|
|
2029
|
-
|
|
2633
|
+
S("div", aa, [
|
|
2030
2634
|
a(e(N), {
|
|
2031
|
-
href:
|
|
2635
|
+
href: F.value,
|
|
2032
2636
|
variant: "outline",
|
|
2033
|
-
disabled:
|
|
2637
|
+
disabled: y.value === "",
|
|
2034
2638
|
class: "wx-connect__link"
|
|
2035
2639
|
}, {
|
|
2036
2640
|
icon: t(() => [
|
|
2037
|
-
a(e(
|
|
2641
|
+
a(e(Z), { name: "external-link" })
|
|
2038
2642
|
]),
|
|
2039
2643
|
default: t(() => [
|
|
2040
|
-
|
|
2644
|
+
c(" " + i(e(l)("connect.install-in", { client: e(l)("connect.cursor-title") })), 1)
|
|
2041
2645
|
]),
|
|
2042
2646
|
_: 1
|
|
2043
2647
|
}, 8, ["href", "disabled"]),
|
|
2044
2648
|
a(e(N), {
|
|
2045
|
-
href:
|
|
2649
|
+
href: d.value,
|
|
2046
2650
|
variant: "outline",
|
|
2047
|
-
disabled:
|
|
2651
|
+
disabled: y.value === "",
|
|
2048
2652
|
class: "wx-connect__link"
|
|
2049
2653
|
}, {
|
|
2050
2654
|
icon: t(() => [
|
|
2051
|
-
a(e(
|
|
2655
|
+
a(e(Z), { name: "external-link" })
|
|
2052
2656
|
]),
|
|
2053
2657
|
default: t(() => [
|
|
2054
|
-
|
|
2658
|
+
c(" " + i(e(l)("connect.install-in", { client: e(l)("connect.vscode-title") })), 1)
|
|
2055
2659
|
]),
|
|
2056
2660
|
_: 1
|
|
2057
2661
|
}, 8, ["href", "disabled"])
|
|
2058
2662
|
])
|
|
2059
2663
|
]),
|
|
2060
|
-
a(e(
|
|
2664
|
+
a(e(qe), {
|
|
2061
2665
|
type: "info",
|
|
2062
2666
|
title: e(l)("connect.next")
|
|
2063
2667
|
}, {
|
|
2064
2668
|
default: t(() => [
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2669
|
+
S("ol", la, [
|
|
2670
|
+
S("li", null, i(e(l)("connect.next-1")), 1),
|
|
2671
|
+
S("li", null, i(e(l)("connect.next-2")), 1),
|
|
2672
|
+
S("li", null, i(e(l)("connect.next-3")), 1)
|
|
2069
2673
|
])
|
|
2070
2674
|
]),
|
|
2071
2675
|
_: 1
|
|
2072
2676
|
}, 8, ["title"]),
|
|
2073
|
-
a(
|
|
2074
|
-
|
|
2075
|
-
a(e(
|
|
2677
|
+
a(qt),
|
|
2678
|
+
S("section", na, [
|
|
2679
|
+
a(e(me), {
|
|
2076
2680
|
level: 2,
|
|
2077
2681
|
size: "sm"
|
|
2078
2682
|
}, {
|
|
2079
2683
|
default: t(() => [
|
|
2080
|
-
|
|
2684
|
+
c(i(e(l)("connect.mine")), 1)
|
|
2081
2685
|
]),
|
|
2082
2686
|
_: 1
|
|
2083
2687
|
}),
|
|
2084
|
-
a(e(
|
|
2688
|
+
a(e($e), { padding: "none" }, {
|
|
2085
2689
|
default: t(() => [
|
|
2086
|
-
a(
|
|
2690
|
+
a(Ze, { scope: "mine" })
|
|
2087
2691
|
]),
|
|
2088
2692
|
_: 1
|
|
2089
2693
|
})
|
|
@@ -2093,78 +2697,81 @@ url = "${c.value}"`), U = T(() => {
|
|
|
2093
2697
|
_: 1
|
|
2094
2698
|
}, 8, ["title"]));
|
|
2095
2699
|
}
|
|
2096
|
-
}),
|
|
2097
|
-
function
|
|
2098
|
-
const
|
|
2099
|
-
render: () =>
|
|
2100
|
-
base:
|
|
2101
|
-
current:
|
|
2102
|
-
avatarField:
|
|
2103
|
-
resolveAvatar:
|
|
2700
|
+
}), oa = /* @__PURE__ */ ve(sa, [["__scopeId", "data-v-19a489e0"]]);
|
|
2701
|
+
function Ca(s = {}) {
|
|
2702
|
+
const r = s.path ?? "/admins", l = (u) => ({
|
|
2703
|
+
render: () => De(Dt, {
|
|
2704
|
+
base: r,
|
|
2705
|
+
current: u,
|
|
2706
|
+
avatarField: s.avatarField,
|
|
2707
|
+
resolveAvatar: s.resolveAvatar
|
|
2104
2708
|
})
|
|
2105
2709
|
});
|
|
2106
2710
|
return {
|
|
2107
2711
|
id: "admins",
|
|
2108
|
-
path:
|
|
2712
|
+
path: r,
|
|
2109
2713
|
routes: [
|
|
2110
|
-
{ path:
|
|
2111
|
-
// What their agents did,
|
|
2714
|
+
{ path: r, name: "webx.admins", component: l("admins") },
|
|
2715
|
+
// What their agents did, which agents they let in, and their keys: more views of the same
|
|
2112
2716
|
// section, each with an address of its own so that its filters survive a trip to the
|
|
2113
2717
|
// people and back.
|
|
2114
|
-
{ path: `${
|
|
2718
|
+
{ path: `${r}/calls`, name: "webx.admins.calls", component: l("calls") },
|
|
2115
2719
|
{
|
|
2116
|
-
path: `${
|
|
2720
|
+
path: `${r}/connections`,
|
|
2117
2721
|
name: "webx.admins.connections",
|
|
2118
2722
|
component: l("connections")
|
|
2119
|
-
}
|
|
2723
|
+
},
|
|
2724
|
+
// Keys for programs: a connection without a browser, issued by somebody who manages
|
|
2725
|
+
// the people it acts as.
|
|
2726
|
+
{ path: `${r}/keys`, name: "webx.admins.keys", component: l("keys") }
|
|
2120
2727
|
]
|
|
2121
2728
|
};
|
|
2122
2729
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const
|
|
2730
|
+
function $a(s = {}) {
|
|
2731
|
+
const r = s.path ?? "/connect";
|
|
2125
2732
|
return {
|
|
2126
2733
|
id: "connect",
|
|
2127
|
-
path:
|
|
2128
|
-
routes: [{ path:
|
|
2734
|
+
path: r,
|
|
2735
|
+
routes: [{ path: r, name: "webx.connect", component: oa }]
|
|
2129
2736
|
};
|
|
2130
2737
|
}
|
|
2131
|
-
const
|
|
2738
|
+
const ia = /* @__PURE__ */ Q({
|
|
2132
2739
|
__name: "AdminPicker",
|
|
2133
2740
|
props: {
|
|
2134
2741
|
multiple: { type: Boolean, default: !1 },
|
|
2135
2742
|
title: { default: void 0 },
|
|
2136
2743
|
resolveAvatar: { type: Function, default: void 0 }
|
|
2137
2744
|
},
|
|
2138
|
-
setup(
|
|
2139
|
-
const
|
|
2140
|
-
|
|
2141
|
-
const
|
|
2142
|
-
function
|
|
2143
|
-
|
|
2745
|
+
setup(s) {
|
|
2746
|
+
const r = s, { open: l, resolve: u, dismiss: v } = _e();
|
|
2747
|
+
ee();
|
|
2748
|
+
const y = G("webx-auth"), V = oe("list"), o = A(0);
|
|
2749
|
+
function h(d) {
|
|
2750
|
+
u(d);
|
|
2144
2751
|
}
|
|
2145
|
-
function
|
|
2146
|
-
|
|
2752
|
+
function F(d) {
|
|
2753
|
+
o.value = d.length;
|
|
2147
2754
|
}
|
|
2148
|
-
return (
|
|
2755
|
+
return (d, w) => (m(), b(e(be), {
|
|
2149
2756
|
open: e(l),
|
|
2150
|
-
"onUpdate:open": w[2] || (w[2] = (x) =>
|
|
2151
|
-
title:
|
|
2757
|
+
"onUpdate:open": w[2] || (w[2] = (x) => Ve(l) ? l.value = x : null),
|
|
2758
|
+
title: s.title ?? e(y)(s.multiple ? "admins.select-many" : "admins.select-one"),
|
|
2152
2759
|
width: 880
|
|
2153
|
-
},
|
|
2760
|
+
}, Ae({
|
|
2154
2761
|
default: t(() => [
|
|
2155
|
-
a(
|
|
2762
|
+
a(Xe, {
|
|
2156
2763
|
ref_key: "list",
|
|
2157
|
-
ref:
|
|
2764
|
+
ref: V,
|
|
2158
2765
|
picking: "",
|
|
2159
|
-
multiple:
|
|
2160
|
-
"resolve-avatar":
|
|
2161
|
-
onChosen:
|
|
2162
|
-
onSelection:
|
|
2766
|
+
multiple: s.multiple,
|
|
2767
|
+
"resolve-avatar": r.resolveAvatar,
|
|
2768
|
+
onChosen: h,
|
|
2769
|
+
onSelection: F
|
|
2163
2770
|
}, null, 8, ["multiple", "resolve-avatar"])
|
|
2164
2771
|
]),
|
|
2165
2772
|
_: 2
|
|
2166
2773
|
}, [
|
|
2167
|
-
|
|
2774
|
+
s.multiple ? {
|
|
2168
2775
|
name: "footer",
|
|
2169
2776
|
fn: t(() => [
|
|
2170
2777
|
a(e(se), {
|
|
@@ -2172,31 +2779,31 @@ const Jt = /* @__PURE__ */ Q({
|
|
|
2172
2779
|
align: "center"
|
|
2173
2780
|
}, {
|
|
2174
2781
|
default: t(() => [
|
|
2175
|
-
a(e(
|
|
2782
|
+
a(e(E), {
|
|
2176
2783
|
size: "sm",
|
|
2177
2784
|
tone: "muted"
|
|
2178
2785
|
}, {
|
|
2179
2786
|
default: t(() => [
|
|
2180
|
-
|
|
2787
|
+
c(i(e(y)("admins.chosen", { count: o.value })), 1)
|
|
2181
2788
|
]),
|
|
2182
2789
|
_: 1
|
|
2183
2790
|
}),
|
|
2184
2791
|
a(e(N), {
|
|
2185
2792
|
variant: "outline",
|
|
2186
|
-
onClick: w[0] || (w[0] = (x) => e(
|
|
2793
|
+
onClick: w[0] || (w[0] = (x) => e(v)())
|
|
2187
2794
|
}, {
|
|
2188
2795
|
default: t(() => [
|
|
2189
|
-
|
|
2796
|
+
c(i(e(y)("admins.cancel")), 1)
|
|
2190
2797
|
]),
|
|
2191
2798
|
_: 1
|
|
2192
2799
|
}),
|
|
2193
2800
|
a(e(N), {
|
|
2194
2801
|
type: "primary",
|
|
2195
|
-
disabled:
|
|
2196
|
-
onClick: w[1] || (w[1] = (x) => e(
|
|
2802
|
+
disabled: o.value === 0,
|
|
2803
|
+
onClick: w[1] || (w[1] = (x) => e(u)(V.value?.chosen() ?? []))
|
|
2197
2804
|
}, {
|
|
2198
2805
|
default: t(() => [
|
|
2199
|
-
|
|
2806
|
+
c(i(e(y)("admins.save")), 1)
|
|
2200
2807
|
]),
|
|
2201
2808
|
_: 1
|
|
2202
2809
|
}, 8, ["disabled"])
|
|
@@ -2208,144 +2815,144 @@ const Jt = /* @__PURE__ */ Q({
|
|
|
2208
2815
|
} : void 0
|
|
2209
2816
|
]), 1032, ["open", "title"]));
|
|
2210
2817
|
}
|
|
2211
|
-
}),
|
|
2212
|
-
async function
|
|
2213
|
-
return (await
|
|
2818
|
+
}), at = he(ia);
|
|
2819
|
+
async function Va(s = {}) {
|
|
2820
|
+
return (await at({ ...s, multiple: !1 }))?.[0];
|
|
2214
2821
|
}
|
|
2215
|
-
function
|
|
2216
|
-
return
|
|
2822
|
+
function Aa(s = {}) {
|
|
2823
|
+
return at({ ...s, multiple: !0 });
|
|
2217
2824
|
}
|
|
2218
|
-
const
|
|
2825
|
+
const ua = { class: "wx-profile-host" }, ra = { class: "wx-profile" }, ca = {
|
|
2219
2826
|
key: 0,
|
|
2220
2827
|
class: "wx-profile__aside"
|
|
2221
|
-
},
|
|
2828
|
+
}, da = { class: "wx-profile__fields" }, ma = /* @__PURE__ */ Q({
|
|
2222
2829
|
__name: "ProfileDialog",
|
|
2223
2830
|
props: {
|
|
2224
2831
|
avatarField: { default: void 0 }
|
|
2225
2832
|
},
|
|
2226
|
-
setup(
|
|
2227
|
-
const
|
|
2228
|
-
|
|
2229
|
-
const
|
|
2230
|
-
name:
|
|
2231
|
-
avatar:
|
|
2833
|
+
setup(s) {
|
|
2834
|
+
const r = s, { resolve: l, dismiss: u, open: v } = _e(), y = X(), V = We();
|
|
2835
|
+
ee();
|
|
2836
|
+
const o = G("webx-auth"), h = re(), F = A(!1), d = A({}), w = A({
|
|
2837
|
+
name: y.state.user?.name ?? "",
|
|
2838
|
+
avatar: y.state.user?.avatar ?? null,
|
|
2232
2839
|
password: "",
|
|
2233
2840
|
current_password: ""
|
|
2234
|
-
}), x =
|
|
2235
|
-
function
|
|
2236
|
-
return
|
|
2841
|
+
}), x = A(w.value.avatar ? { path: w.value.avatar } : null);
|
|
2842
|
+
function p(_) {
|
|
2843
|
+
return d.value[_]?.[0];
|
|
2237
2844
|
}
|
|
2238
|
-
async function
|
|
2239
|
-
|
|
2845
|
+
async function g() {
|
|
2846
|
+
F.value = !0, d.value = {};
|
|
2240
2847
|
try {
|
|
2241
|
-
await
|
|
2848
|
+
await V.updateProfile({
|
|
2242
2849
|
name: w.value.name,
|
|
2243
2850
|
avatar: x.value?.path ?? null,
|
|
2244
2851
|
// Blank is left out entirely rather than sent as an empty string: the server reads a
|
|
2245
2852
|
// filled password as "change it", and an empty one would be a change to nothing.
|
|
2246
2853
|
...w.value.password ? { password: w.value.password, current_password: w.value.current_password } : {}
|
|
2247
|
-
}),
|
|
2248
|
-
} catch (
|
|
2249
|
-
const
|
|
2250
|
-
|
|
2854
|
+
}), K.success(o("profile.saved")), l(!0);
|
|
2855
|
+
} catch (_) {
|
|
2856
|
+
const k = _.body;
|
|
2857
|
+
k?.errors ? d.value = k.errors : K.danger(h(_));
|
|
2251
2858
|
} finally {
|
|
2252
|
-
|
|
2859
|
+
F.value = !1;
|
|
2253
2860
|
}
|
|
2254
2861
|
}
|
|
2255
|
-
return (
|
|
2256
|
-
open: e(
|
|
2257
|
-
"onUpdate:open":
|
|
2258
|
-
title: e(
|
|
2862
|
+
return (_, k) => (m(), b(e(be), {
|
|
2863
|
+
open: e(v),
|
|
2864
|
+
"onUpdate:open": k[5] || (k[5] = (B) => Ve(v) ? v.value = B : null),
|
|
2865
|
+
title: e(o)("profile.title"),
|
|
2259
2866
|
width: 560
|
|
2260
2867
|
}, {
|
|
2261
2868
|
footer: t(() => [
|
|
2262
2869
|
a(e(N), {
|
|
2263
|
-
onClick:
|
|
2870
|
+
onClick: k[4] || (k[4] = (B) => e(u)())
|
|
2264
2871
|
}, {
|
|
2265
2872
|
default: t(() => [
|
|
2266
|
-
|
|
2873
|
+
c(i(e(o)("profile.cancel")), 1)
|
|
2267
2874
|
]),
|
|
2268
2875
|
_: 1
|
|
2269
2876
|
}),
|
|
2270
2877
|
a(e(N), {
|
|
2271
2878
|
type: "primary",
|
|
2272
|
-
loading:
|
|
2273
|
-
onClick:
|
|
2879
|
+
loading: F.value,
|
|
2880
|
+
onClick: g
|
|
2274
2881
|
}, {
|
|
2275
2882
|
default: t(() => [
|
|
2276
|
-
|
|
2883
|
+
c(i(e(o)("profile.save")), 1)
|
|
2277
2884
|
]),
|
|
2278
2885
|
_: 1
|
|
2279
2886
|
}, 8, ["loading"])
|
|
2280
2887
|
]),
|
|
2281
2888
|
default: t(() => [
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
(
|
|
2889
|
+
S("div", ua, [
|
|
2890
|
+
S("div", ra, [
|
|
2891
|
+
r.avatarField ? (m(), H("div", ca, [
|
|
2892
|
+
(m(), b(Ee(r.avatarField), {
|
|
2286
2893
|
modelValue: x.value,
|
|
2287
|
-
"onUpdate:modelValue":
|
|
2288
|
-
label: e(
|
|
2894
|
+
"onUpdate:modelValue": k[0] || (k[0] = (B) => x.value = B),
|
|
2895
|
+
label: e(o)("profile.avatar"),
|
|
2289
2896
|
aspect: "1/1",
|
|
2290
2897
|
captions: !1
|
|
2291
2898
|
}, null, 8, ["modelValue", "label"]))
|
|
2292
|
-
])) :
|
|
2293
|
-
|
|
2294
|
-
a(e(
|
|
2295
|
-
label: e(
|
|
2296
|
-
error:
|
|
2899
|
+
])) : I("", !0),
|
|
2900
|
+
S("div", da, [
|
|
2901
|
+
a(e(M), {
|
|
2902
|
+
label: e(o)("profile.name"),
|
|
2903
|
+
error: p("name")
|
|
2297
2904
|
}, {
|
|
2298
2905
|
default: t(() => [
|
|
2299
2906
|
a(e(le), {
|
|
2300
2907
|
modelValue: w.value.name,
|
|
2301
|
-
"onUpdate:modelValue":
|
|
2908
|
+
"onUpdate:modelValue": k[1] || (k[1] = (B) => w.value.name = B),
|
|
2302
2909
|
name: "name"
|
|
2303
2910
|
}, null, 8, ["modelValue"])
|
|
2304
2911
|
]),
|
|
2305
2912
|
_: 1
|
|
2306
2913
|
}, 8, ["label", "error"]),
|
|
2307
|
-
a(e(
|
|
2308
|
-
label: e(
|
|
2914
|
+
a(e(M), {
|
|
2915
|
+
label: e(o)("admins.email")
|
|
2309
2916
|
}, {
|
|
2310
2917
|
default: t(() => [
|
|
2311
2918
|
a(e(le), {
|
|
2312
|
-
"model-value": e(
|
|
2919
|
+
"model-value": e(y).state.user?.email ?? "",
|
|
2313
2920
|
readonly: ""
|
|
2314
2921
|
}, null, 8, ["model-value"])
|
|
2315
2922
|
]),
|
|
2316
2923
|
_: 1
|
|
2317
2924
|
}, 8, ["label"]),
|
|
2318
|
-
a(e(
|
|
2319
|
-
label: e(
|
|
2320
|
-
help: e(
|
|
2321
|
-
error:
|
|
2925
|
+
a(e(M), {
|
|
2926
|
+
label: e(o)("profile.password"),
|
|
2927
|
+
help: e(o)("profile.password-hint"),
|
|
2928
|
+
error: p("password")
|
|
2322
2929
|
}, {
|
|
2323
2930
|
default: t(() => [
|
|
2324
2931
|
a(e(le), {
|
|
2325
2932
|
modelValue: w.value.password,
|
|
2326
|
-
"onUpdate:modelValue":
|
|
2933
|
+
"onUpdate:modelValue": k[2] || (k[2] = (B) => w.value.password = B),
|
|
2327
2934
|
type: "password",
|
|
2328
2935
|
autocomplete: "new-password"
|
|
2329
2936
|
}, null, 8, ["modelValue"])
|
|
2330
2937
|
]),
|
|
2331
2938
|
_: 1
|
|
2332
2939
|
}, 8, ["label", "help", "error"]),
|
|
2333
|
-
w.value.password ? (
|
|
2940
|
+
w.value.password ? (m(), b(e(M), {
|
|
2334
2941
|
key: 0,
|
|
2335
|
-
label: e(
|
|
2336
|
-
help: e(
|
|
2337
|
-
error:
|
|
2942
|
+
label: e(o)("profile.current-password"),
|
|
2943
|
+
help: e(o)("profile.current-password-hint"),
|
|
2944
|
+
error: p("current_password")
|
|
2338
2945
|
}, {
|
|
2339
2946
|
default: t(() => [
|
|
2340
2947
|
a(e(le), {
|
|
2341
2948
|
modelValue: w.value.current_password,
|
|
2342
|
-
"onUpdate:modelValue":
|
|
2949
|
+
"onUpdate:modelValue": k[3] || (k[3] = (B) => w.value.current_password = B),
|
|
2343
2950
|
type: "password",
|
|
2344
2951
|
autocomplete: "current-password"
|
|
2345
2952
|
}, null, 8, ["modelValue"])
|
|
2346
2953
|
]),
|
|
2347
2954
|
_: 1
|
|
2348
|
-
}, 8, ["label", "help", "error"])) :
|
|
2955
|
+
}, 8, ["label", "help", "error"])) : I("", !0)
|
|
2349
2956
|
])
|
|
2350
2957
|
])
|
|
2351
2958
|
])
|
|
@@ -2353,7 +2960,7 @@ const Qt = { class: "wx-profile-host" }, Xt = { class: "wx-profile" }, Zt = {
|
|
|
2353
2960
|
_: 1
|
|
2354
2961
|
}, 8, ["open", "title"]));
|
|
2355
2962
|
}
|
|
2356
|
-
}),
|
|
2963
|
+
}), va = /* @__PURE__ */ ve(ma, [["__scopeId", "data-v-9583a67a"]]), pa = ["title"], fa = { class: "wx-user-menu__who" }, ya = { class: "wx-user-menu__name" }, ha = { class: "wx-user-menu__email" }, _a = /* @__PURE__ */ Q({
|
|
2357
2964
|
__name: "UserMenu",
|
|
2358
2965
|
props: {
|
|
2359
2966
|
signOutLabel: { default: void 0 },
|
|
@@ -2361,248 +2968,250 @@ const Qt = { class: "wx-profile-host" }, Xt = { class: "wx-profile" }, Zt = {
|
|
|
2361
2968
|
avatarField: { default: void 0 },
|
|
2362
2969
|
expanded: { type: Boolean, default: !1 }
|
|
2363
2970
|
},
|
|
2364
|
-
setup(
|
|
2365
|
-
const
|
|
2366
|
-
() =>
|
|
2367
|
-
),
|
|
2368
|
-
|
|
2369
|
-
() => typeof
|
|
2370
|
-
async (
|
|
2371
|
-
const
|
|
2372
|
-
if (
|
|
2971
|
+
setup(s) {
|
|
2972
|
+
const r = s, l = X(), u = We(), v = Ne(), y = ut(), V = G("webx-auth"), o = v.scope("webx-admin"), h = T(() => l.state.user), F = T(
|
|
2973
|
+
() => v.state.panelLocales.length > 1 ? v.state.panelLocales : []
|
|
2974
|
+
), d = xe(je, null), w = xe(Ge, null), x = A(void 0);
|
|
2975
|
+
de(
|
|
2976
|
+
() => typeof h.value?.avatar == "string" ? h.value.avatar : null,
|
|
2977
|
+
async (O) => {
|
|
2978
|
+
const n = r.resolveAvatar ?? d;
|
|
2979
|
+
if (O === null || O === "" || n === null) {
|
|
2373
2980
|
x.value = void 0;
|
|
2374
2981
|
return;
|
|
2375
2982
|
}
|
|
2376
|
-
const
|
|
2377
|
-
|
|
2983
|
+
const $ = await n(O);
|
|
2984
|
+
h.value?.avatar === O && (x.value = $ ?? void 0);
|
|
2378
2985
|
},
|
|
2379
2986
|
{ immediate: !0 }
|
|
2380
2987
|
);
|
|
2381
|
-
const
|
|
2382
|
-
function
|
|
2988
|
+
const p = he(va);
|
|
2989
|
+
function g() {
|
|
2383
2990
|
setTimeout(
|
|
2384
2991
|
() => {
|
|
2385
|
-
|
|
2992
|
+
p({ avatarField: r.avatarField ?? w ?? void 0 });
|
|
2386
2993
|
},
|
|
2387
2994
|
0
|
|
2388
2995
|
);
|
|
2389
2996
|
}
|
|
2390
|
-
const
|
|
2391
|
-
get: () =>
|
|
2392
|
-
set: (
|
|
2393
|
-
|
|
2997
|
+
const _ = T({
|
|
2998
|
+
get: () => y.state.preference,
|
|
2999
|
+
set: (O) => {
|
|
3000
|
+
y.set(O), u.setTheme(O);
|
|
2394
3001
|
}
|
|
2395
|
-
}),
|
|
2396
|
-
() => typeof
|
|
3002
|
+
}), k = T(
|
|
3003
|
+
() => typeof h.value?.siteBar == "boolean" ? h.value.siteBar : null
|
|
2397
3004
|
);
|
|
2398
|
-
function
|
|
2399
|
-
|
|
3005
|
+
function B() {
|
|
3006
|
+
k.value !== null && u.setSiteBar(!k.value);
|
|
2400
3007
|
}
|
|
2401
|
-
async function
|
|
2402
|
-
|
|
3008
|
+
async function C(O) {
|
|
3009
|
+
O !== v.state.locale && await u.setLocale(O);
|
|
2403
3010
|
}
|
|
2404
|
-
return (
|
|
2405
|
-
const
|
|
2406
|
-
return
|
|
3011
|
+
return (O, n) => {
|
|
3012
|
+
const $ = J("wx-avatar"), R = J("wx-icon"), Y = J("wx-text"), U = J("wx-dropdown-item"), z = J("wx-divider"), f = J("wx-dropdown");
|
|
3013
|
+
return h.value !== null ? (m(), b(f, { key: 0 }, {
|
|
2407
3014
|
trigger: t(() => [
|
|
2408
|
-
|
|
3015
|
+
S("button", {
|
|
2409
3016
|
type: "button",
|
|
2410
|
-
class:
|
|
2411
|
-
title:
|
|
3017
|
+
class: Be(["wx-user-menu__trigger", { "wx-user-menu__trigger--named": s.expanded }]),
|
|
3018
|
+
title: h.value.name
|
|
2412
3019
|
}, [
|
|
2413
|
-
a(
|
|
2414
|
-
name:
|
|
3020
|
+
a($, {
|
|
3021
|
+
name: h.value.name,
|
|
2415
3022
|
src: x.value,
|
|
2416
3023
|
size: "lg"
|
|
2417
3024
|
}, null, 8, ["name", "src"]),
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
3025
|
+
s.expanded ? (m(), H(ue, { key: 0 }, [
|
|
3026
|
+
S("span", fa, [
|
|
3027
|
+
S("span", ya, i(h.value.name), 1),
|
|
3028
|
+
S("span", ha, i(h.value.email), 1)
|
|
2422
3029
|
]),
|
|
2423
|
-
a(
|
|
3030
|
+
a(R, {
|
|
2424
3031
|
name: "chevron-up",
|
|
2425
3032
|
size: "sm",
|
|
2426
3033
|
class: "wx-user-menu__chevron"
|
|
2427
3034
|
})
|
|
2428
|
-
], 64)) :
|
|
2429
|
-
], 10,
|
|
3035
|
+
], 64)) : I("", !0)
|
|
3036
|
+
], 10, pa)
|
|
2430
3037
|
]),
|
|
2431
3038
|
default: t(() => [
|
|
2432
|
-
a(
|
|
3039
|
+
a(U, { disabled: "" }, {
|
|
2433
3040
|
default: t(() => [
|
|
2434
|
-
a(
|
|
3041
|
+
a(Y, { size: "sm" }, {
|
|
2435
3042
|
default: t(() => [
|
|
2436
|
-
|
|
3043
|
+
c(i(h.value.email), 1)
|
|
2437
3044
|
]),
|
|
2438
3045
|
_: 1
|
|
2439
3046
|
})
|
|
2440
3047
|
]),
|
|
2441
3048
|
_: 1
|
|
2442
3049
|
}),
|
|
2443
|
-
a(
|
|
2444
|
-
a(
|
|
3050
|
+
a(z, { spacing: "sm" }),
|
|
3051
|
+
a(U, {
|
|
2445
3052
|
icon: "user",
|
|
2446
|
-
onClick:
|
|
3053
|
+
onClick: g
|
|
2447
3054
|
}, {
|
|
2448
3055
|
default: t(() => [
|
|
2449
|
-
|
|
3056
|
+
c(i(e(V)("profile.menu")), 1)
|
|
2450
3057
|
]),
|
|
2451
3058
|
_: 1
|
|
2452
3059
|
}),
|
|
2453
|
-
a(
|
|
2454
|
-
a(
|
|
3060
|
+
a(z, { spacing: "sm" }),
|
|
3061
|
+
a(U, { disabled: "" }, {
|
|
2455
3062
|
default: t(() => [
|
|
2456
|
-
a(
|
|
3063
|
+
a(Y, {
|
|
2457
3064
|
size: "sm",
|
|
2458
3065
|
tone: "muted"
|
|
2459
3066
|
}, {
|
|
2460
3067
|
default: t(() => [
|
|
2461
|
-
|
|
3068
|
+
c(i(e(o)("theme.label")), 1)
|
|
2462
3069
|
]),
|
|
2463
3070
|
_: 1
|
|
2464
3071
|
})
|
|
2465
3072
|
]),
|
|
2466
3073
|
_: 1
|
|
2467
3074
|
}),
|
|
2468
|
-
|
|
3075
|
+
S("div", {
|
|
2469
3076
|
class: "wx-user-menu__theme",
|
|
2470
|
-
onClick:
|
|
3077
|
+
onClick: n[1] || (n[1] = Oe(() => {
|
|
2471
3078
|
}, ["stop"]))
|
|
2472
3079
|
}, [
|
|
2473
|
-
a(e(
|
|
2474
|
-
modelValue:
|
|
2475
|
-
"onUpdate:modelValue":
|
|
3080
|
+
a(e(ft), {
|
|
3081
|
+
modelValue: _.value,
|
|
3082
|
+
"onUpdate:modelValue": n[0] || (n[0] = (L) => _.value = L),
|
|
2476
3083
|
size: "sm",
|
|
2477
3084
|
block: "",
|
|
2478
|
-
"aria-label": e(
|
|
2479
|
-
"light-label": e(
|
|
2480
|
-
"dark-label": e(
|
|
2481
|
-
"system-label": e(
|
|
3085
|
+
"aria-label": e(o)("theme.label"),
|
|
3086
|
+
"light-label": e(o)("theme.light"),
|
|
3087
|
+
"dark-label": e(o)("theme.dark"),
|
|
3088
|
+
"system-label": e(o)("theme.system")
|
|
2482
3089
|
}, null, 8, ["modelValue", "aria-label", "light-label", "dark-label", "system-label"])
|
|
2483
3090
|
]),
|
|
2484
|
-
|
|
2485
|
-
a(
|
|
2486
|
-
a(
|
|
2487
|
-
icon:
|
|
2488
|
-
onClick:
|
|
3091
|
+
k.value !== null ? (m(), H(ue, { key: 0 }, [
|
|
3092
|
+
a(z, { spacing: "sm" }),
|
|
3093
|
+
a(U, {
|
|
3094
|
+
icon: k.value ? "check" : void 0,
|
|
3095
|
+
onClick: B
|
|
2489
3096
|
}, {
|
|
2490
3097
|
default: t(() => [
|
|
2491
|
-
|
|
3098
|
+
c(i(e(V)("menu.site-bar")), 1)
|
|
2492
3099
|
]),
|
|
2493
3100
|
_: 1
|
|
2494
3101
|
}, 8, ["icon"])
|
|
2495
|
-
], 64)) :
|
|
2496
|
-
|
|
2497
|
-
a(
|
|
2498
|
-
a(
|
|
3102
|
+
], 64)) : I("", !0),
|
|
3103
|
+
F.value.length > 0 ? (m(), H(ue, { key: 1 }, [
|
|
3104
|
+
a(z, { spacing: "sm" }),
|
|
3105
|
+
a(U, { disabled: "" }, {
|
|
2499
3106
|
default: t(() => [
|
|
2500
|
-
a(
|
|
3107
|
+
a(Y, {
|
|
2501
3108
|
size: "sm",
|
|
2502
3109
|
tone: "muted"
|
|
2503
3110
|
}, {
|
|
2504
3111
|
default: t(() => [
|
|
2505
|
-
|
|
3112
|
+
c(i(e(V)("menu.language")), 1)
|
|
2506
3113
|
]),
|
|
2507
3114
|
_: 1
|
|
2508
3115
|
})
|
|
2509
3116
|
]),
|
|
2510
3117
|
_: 1
|
|
2511
3118
|
}),
|
|
2512
|
-
(
|
|
2513
|
-
key:
|
|
2514
|
-
icon:
|
|
2515
|
-
onClick: (
|
|
3119
|
+
(m(!0), H(ue, null, Ce(F.value, (L) => (m(), b(U, {
|
|
3120
|
+
key: L.code,
|
|
3121
|
+
icon: L.code === e(v).state.locale ? "check" : void 0,
|
|
3122
|
+
onClick: (W) => C(L.code)
|
|
2516
3123
|
}, {
|
|
2517
3124
|
default: t(() => [
|
|
2518
|
-
|
|
3125
|
+
c(i(L.nativeName), 1)
|
|
2519
3126
|
]),
|
|
2520
3127
|
_: 2
|
|
2521
3128
|
}, 1032, ["icon", "onClick"]))), 128)),
|
|
2522
|
-
a(
|
|
2523
|
-
], 64)) :
|
|
2524
|
-
a(
|
|
3129
|
+
a(z, { spacing: "sm" })
|
|
3130
|
+
], 64)) : I("", !0),
|
|
3131
|
+
a(U, {
|
|
2525
3132
|
icon: "logout",
|
|
2526
|
-
onClick:
|
|
3133
|
+
onClick: n[2] || (n[2] = (L) => e(u).logout())
|
|
2527
3134
|
}, {
|
|
2528
3135
|
default: t(() => [
|
|
2529
|
-
|
|
3136
|
+
c(i(s.signOutLabel ?? e(V)("menu.sign-out")), 1)
|
|
2530
3137
|
]),
|
|
2531
3138
|
_: 1
|
|
2532
3139
|
})
|
|
2533
3140
|
]),
|
|
2534
3141
|
_: 1
|
|
2535
|
-
})) :
|
|
3142
|
+
})) : I("", !0);
|
|
2536
3143
|
};
|
|
2537
3144
|
}
|
|
2538
|
-
}),
|
|
2539
|
-
function
|
|
2540
|
-
const
|
|
3145
|
+
}), za = /* @__PURE__ */ ve(_a, [["__scopeId", "data-v-22dfea95"]]);
|
|
3146
|
+
function Wa(s = {}) {
|
|
3147
|
+
const r = s.path ?? "/login";
|
|
2541
3148
|
return {
|
|
2542
3149
|
install(l) {
|
|
2543
|
-
const
|
|
2544
|
-
l.i18n.defaults("webx-auth",
|
|
3150
|
+
const u = yt(l.context);
|
|
3151
|
+
l.i18n.defaults("webx-auth", Qe), ht(
|
|
2545
3152
|
l.app,
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
), l.context.useSessionLoader(() =>
|
|
2550
|
-
path:
|
|
3153
|
+
u,
|
|
3154
|
+
s.resolveAvatar ?? Je(l.context),
|
|
3155
|
+
s.avatarField ?? Ye(l.context)
|
|
3156
|
+
), l.context.useSessionLoader(() => u.me()), l.router.addRoute({
|
|
3157
|
+
path: r,
|
|
2551
3158
|
name: "webx.login",
|
|
2552
3159
|
meta: { public: !0 },
|
|
2553
|
-
component: { render: () =>
|
|
2554
|
-
}), l.router.beforeEach((
|
|
3160
|
+
component: { render: () => De(kt, { ...s.card }) }
|
|
3161
|
+
}), l.router.beforeEach((v) => v.meta.public === !0 || l.context.state.status !== "unauthenticated" ? !0 : { path: r, query: v.fullPath === "/" ? {} : { next: v.fullPath } }), de(
|
|
2555
3162
|
() => l.context.state.status,
|
|
2556
|
-
(
|
|
2557
|
-
const
|
|
2558
|
-
if (
|
|
2559
|
-
l.router.replace({ path:
|
|
3163
|
+
(v) => {
|
|
3164
|
+
const y = l.router.currentRoute.value;
|
|
3165
|
+
if (v === "unauthenticated" && y.path !== r) {
|
|
3166
|
+
l.router.replace({ path: r, query: { next: y.fullPath } });
|
|
2560
3167
|
return;
|
|
2561
3168
|
}
|
|
2562
|
-
if (
|
|
2563
|
-
const
|
|
2564
|
-
if (typeof
|
|
2565
|
-
location.assign(
|
|
3169
|
+
if (v === "ready" && y.path === r) {
|
|
3170
|
+
const V = y.query.next;
|
|
3171
|
+
if (typeof V == "string" && ba(V)) {
|
|
3172
|
+
location.assign(V);
|
|
2566
3173
|
return;
|
|
2567
3174
|
}
|
|
2568
|
-
l.router.replace(typeof
|
|
3175
|
+
l.router.replace(typeof V == "string" ? V : "/");
|
|
2569
3176
|
}
|
|
2570
3177
|
}
|
|
2571
3178
|
);
|
|
2572
3179
|
}
|
|
2573
3180
|
};
|
|
2574
3181
|
}
|
|
2575
|
-
function
|
|
2576
|
-
if (!/^https?:\/\//i.test(
|
|
3182
|
+
function ba(s) {
|
|
3183
|
+
if (!/^https?:\/\//i.test(s))
|
|
2577
3184
|
return !1;
|
|
2578
3185
|
try {
|
|
2579
|
-
return new URL(
|
|
3186
|
+
return new URL(s).origin === location.origin;
|
|
2580
3187
|
} catch {
|
|
2581
3188
|
return !1;
|
|
2582
3189
|
}
|
|
2583
3190
|
}
|
|
2584
3191
|
export {
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
3192
|
+
Xe as WxAdminList,
|
|
3193
|
+
Dt as WxAdminsPage,
|
|
3194
|
+
Lt as WxAgentCallList,
|
|
3195
|
+
oa as WxConnectPage,
|
|
3196
|
+
Ze as WxConnectionList,
|
|
3197
|
+
It as WxKeyList,
|
|
3198
|
+
kt as WxLoginCard,
|
|
3199
|
+
va as WxProfileDialog,
|
|
3200
|
+
za as WxUserMenu,
|
|
3201
|
+
Ca as admins,
|
|
3202
|
+
Wa as auth,
|
|
3203
|
+
He as authKey,
|
|
3204
|
+
Qe as authMessages,
|
|
3205
|
+
Ge as avatarFieldKey,
|
|
3206
|
+
je as avatarResolverKey,
|
|
3207
|
+
$a as connect,
|
|
3208
|
+
pe as createAdminsApi,
|
|
3209
|
+
yt as createAuthSession,
|
|
3210
|
+
Tt as createConnectionsApi,
|
|
3211
|
+
tt as createKeysApi,
|
|
3212
|
+
ht as provideAuth,
|
|
3213
|
+
Va as selectAdmin,
|
|
3214
|
+
Aa as selectAdmins,
|
|
3215
|
+
We as useAuth
|
|
2607
3216
|
};
|
|
2608
3217
|
//# sourceMappingURL=index.js.map
|