@synopackageland/sdk 0.10.0 → 0.10.2
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/README.md +56 -3
- package/dist/i18n/bridge/de.json +1 -0
- package/dist/i18n/bridge/en.json +1 -0
- package/dist/i18n/bridge/es.json +1 -0
- package/dist/i18n/bridge/fr.json +1 -0
- package/dist/i18n/bridge/it.json +1 -0
- package/dist/i18n/bridge/ja.json +1 -0
- package/dist/i18n/bridge/ko.json +1 -0
- package/dist/i18n/bridge/zh-CN.json +2 -1
- package/dist/i18n/bridge/zh-TW.json +1 -0
- package/dist/i18n/delegate/de.json +9 -2
- package/dist/i18n/delegate/en.json +9 -2
- package/dist/i18n/delegate/es.json +9 -2
- package/dist/i18n/delegate/fr.json +9 -2
- package/dist/i18n/delegate/it.json +9 -2
- package/dist/i18n/delegate/ja.json +9 -2
- package/dist/i18n/delegate/ko.json +9 -2
- package/dist/i18n/delegate/zh-CN.json +9 -2
- package/dist/i18n/delegate/zh-TW.json +9 -2
- package/dist/i18n/shell/zh-CN.json +1 -1
- package/dist/index.js +1667 -1595
- package/dist/src/bridge/i18n.d.ts +2 -2
- package/dist/src/context.d.ts +2 -2
- package/dist/src/delegate/ExecutorApproval.vue.d.ts +19 -0
- package/dist/src/delegate/ExecutorNotice.vue.d.ts +8 -0
- package/dist/src/delegate/copy.d.ts +14 -0
- package/dist/src/delegate/executor-setup.d.ts +1 -0
- package/dist/src/vue.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/vue.js +1613 -1461
- package/package.json +1 -1
package/dist/vue.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { shellCopy as
|
|
2
|
-
import { DEFAULT_REQUEST_TIMEOUT as
|
|
3
|
-
import { inject as
|
|
4
|
-
import {
|
|
5
|
-
import { Timer as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
return
|
|
1
|
+
import { delegateCopy as Ue, shellCopy as fa, isFullPage as je, uiLocale as ea, nasCopy as ge, nasErrorCopy as aa, format as Oe, saveCopy as ta, saveError as Ie, createNasProvider as la, identityCopy as ya, backgroundCopy as ma, createBackgroundPickerProvider as ba, backgroundErrorCopy as ga, requestKey as He, labelSeparator as na, errorCopy as ha, scopedPicker as ka, openFolderInFileStation as _a, authorizationCopy as wa } from "./index.js";
|
|
2
|
+
import { DEFAULT_REQUEST_TIMEOUT as Vn, FILE_STATION_APP as An, activePage as In, authorizationCatalogs as En, backgroundCatalogs as Tn, bridgeCatalogs as Un, bridgeErrorCopy as Rn, catalogs as Dn, clientTimeout as Bn, createBackgroundSaveFacade as Fn, createFileTransfers as qn, createPortalAccess as Nn, createStandaloneContext as On, createStandaloneHost as Ln, decodeResponse as Mn, delegateCatalogs as Kn, encodeRequest as Hn, fileStationPath as Gn, identityCatalogs as Jn, mergeCatalogs as Wn, nasCatalogs as Xn, openFileInFileStation as Qn, portalCatalogs as Yn, portalMessages as Zn, protocolCodes as jn, protocolOps as es, protocolSchemas as as, saveCatalogs as ts, shellCatalogs as ls, shellPages as ns, uiLocales as ss } from "./index.js";
|
|
3
|
+
import { inject as Re, ref as m, onBeforeUnmount as ve, Comment as xa, Text as Ca, Fragment as oe, defineComponent as ie, computed as I, onMounted as pe, openBlock as n, createBlock as g, unref as e, withCtx as t, createElementVNode as z, createTextVNode as k, toDisplayString as l, createElementBlock as T, createCommentVNode as y, createVNode as f, withModifiers as ze, provide as sa, useTemplateRef as $a, watch as Me, useSlots as Sa, watchEffect as za, resolveDynamicComponent as Fe, normalizeProps as Ge, guardReactiveProps as Je, renderSlot as he, normalizeClass as We, createSlots as Ke, markRaw as Pa, h as Va, onUnmounted as oa, nextTick as Aa, renderList as we } from "vue";
|
|
4
|
+
import { SettingsSection as _e, Callout as G, Button as F, KeyValueRow as $e, Badge as Se, PathDisplay as me, Form as Pe, FormItem as ke, Select as ia, Input as xe, FormActions as Ve, Dialog as De, ensureDeviceViewport as Ia, AppRoot as Ea, ConfigProvider as Ta, PageContent as Xe, PageHeader as Qe, AppLayout as Ua, AppSidebar as Ra, AppSidebarUser as Da, FileTypeIcon as qe, IconButton as Ne, Breadcrumb as Ba, FilePicker as Fa, TreeView as qa, DataGrid as Na, SettingsRow as Ee, Link as ua, Card as Ye, Checkbox as Oa, LoadingArea as La, DataTable as Ma, formatFileSize as Ka, Pagination as Ha } from "@synopackageland/ui";
|
|
5
|
+
import { Timer as Ga, Info as Ja, ChevronLeft as Wa, ChevronRight as Xa, RotateCw as Qa, FolderOpen as Ya, ShieldCheck as Za } from "@lucide/vue";
|
|
6
|
+
const Te = /* @__PURE__ */ Symbol("executor-setup");
|
|
7
|
+
function ra() {
|
|
8
|
+
return Re(Te, {
|
|
9
9
|
async status() {
|
|
10
10
|
return { state: "blocked", reason: "setup-unavailable" };
|
|
11
11
|
},
|
|
@@ -17,124 +17,450 @@ function ia() {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
let
|
|
23
|
-
function
|
|
24
|
-
clearTimeout(s), clearTimeout(
|
|
20
|
+
function mn(r) {
|
|
21
|
+
const C = m(!1), i = m(!1), a = m(), u = m("");
|
|
22
|
+
let v = !1, o = 0, s, c;
|
|
23
|
+
function d() {
|
|
24
|
+
clearTimeout(s), clearTimeout(c);
|
|
25
25
|
}
|
|
26
|
-
function p(
|
|
27
|
-
|
|
26
|
+
function p(P = "") {
|
|
27
|
+
o++, d(), a.value = void 0, u.value = P;
|
|
28
28
|
}
|
|
29
|
-
function h(
|
|
30
|
-
if (
|
|
31
|
-
const
|
|
32
|
-
if (!Number.isFinite(
|
|
29
|
+
function h(P) {
|
|
30
|
+
if (v) return;
|
|
31
|
+
const A = Date.parse(P.expiresAt) - Date.now();
|
|
32
|
+
if (!Number.isFinite(A) || A <= 0) {
|
|
33
33
|
p("expired");
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
36
|
+
d(), a.value = P, u.value = "", s = setTimeout(() => p("expired"), A);
|
|
37
|
+
const K = o;
|
|
38
|
+
c = setTimeout(async () => {
|
|
39
39
|
try {
|
|
40
|
-
const
|
|
41
|
-
!
|
|
40
|
+
const Q = await r.call("identity.session");
|
|
41
|
+
!v && o === K && h(Q);
|
|
42
42
|
} catch {
|
|
43
|
-
!
|
|
43
|
+
!v && o === K && p("expired");
|
|
44
44
|
}
|
|
45
|
-
}, Math.min(6e4,
|
|
45
|
+
}, Math.min(6e4, A));
|
|
46
46
|
}
|
|
47
|
-
async function
|
|
47
|
+
async function R() {
|
|
48
48
|
try {
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
if (
|
|
49
|
+
const P = await r.call("identity.status");
|
|
50
|
+
if (v) return;
|
|
51
|
+
if (C.value = P.enabled === !0, C.value)
|
|
52
52
|
try {
|
|
53
53
|
h(await r.call("identity.session", { bootstrap: !0 }));
|
|
54
54
|
} catch {
|
|
55
|
-
|
|
55
|
+
v || p();
|
|
56
56
|
}
|
|
57
|
-
} catch (
|
|
58
|
-
const
|
|
59
|
-
|
|
57
|
+
} catch (P) {
|
|
58
|
+
const A = P?.code;
|
|
59
|
+
C.value = !["unknown_method", "admin_required", "app_privilege_denied", "session_required"].includes(A || ""), C.value && (u.value = "unavailable");
|
|
60
60
|
} finally {
|
|
61
|
-
|
|
61
|
+
v || (i.value = !0);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
async function
|
|
65
|
-
const
|
|
64
|
+
async function x(P, A) {
|
|
65
|
+
const K = o;
|
|
66
66
|
try {
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
return
|
|
70
|
-
} catch (
|
|
71
|
-
const
|
|
72
|
-
throw !
|
|
67
|
+
const Q = await r.call(P, A);
|
|
68
|
+
if (v || C.value && K !== o) throw { code: "session_required" };
|
|
69
|
+
return Q;
|
|
70
|
+
} catch (Q) {
|
|
71
|
+
const Y = Q?.code;
|
|
72
|
+
throw !v && K === o && C.value && ["session_required", "session_revalidation_required"].includes(Y || "") && p(Y === "session_revalidation_required" ? "revalidate" : "expired"), Q;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
async function _(
|
|
76
|
-
const
|
|
77
|
-
|
|
75
|
+
async function _(P, A, K) {
|
|
76
|
+
const Q = await r.call("identity.login", { account: P, password: A, otp: K });
|
|
77
|
+
v || (o++, h(Q));
|
|
78
78
|
}
|
|
79
|
-
async function
|
|
80
|
-
const
|
|
81
|
-
|
|
79
|
+
async function U() {
|
|
80
|
+
const P = await r.call("identity.session", { bootstrap: !0 });
|
|
81
|
+
v || (o++, h(P));
|
|
82
82
|
}
|
|
83
|
-
async function
|
|
84
|
-
await r.call("identity.logout"),
|
|
83
|
+
async function $() {
|
|
84
|
+
await r.call("identity.logout"), v || p();
|
|
85
85
|
}
|
|
86
86
|
function V() {
|
|
87
|
-
|
|
87
|
+
v = !0, p();
|
|
88
88
|
}
|
|
89
|
-
return { enabled:
|
|
89
|
+
return { enabled: C, ready: i, subject: a, notice: u, start: R, call: x, login: _, bootstrap: U, logout: $, dispose: V };
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
const r =
|
|
93
|
-
let
|
|
94
|
-
function
|
|
95
|
-
a++, u?.abort(), u = void 0, r.value = !1,
|
|
91
|
+
function ja() {
|
|
92
|
+
const r = m(!1), C = m();
|
|
93
|
+
let i = !1, a = 0, u;
|
|
94
|
+
function v() {
|
|
95
|
+
a++, u?.abort(), u = void 0, r.value = !1, C.value = void 0;
|
|
96
96
|
}
|
|
97
|
-
async function
|
|
98
|
-
if (
|
|
99
|
-
const
|
|
100
|
-
u =
|
|
97
|
+
async function o(s) {
|
|
98
|
+
if (i || r.value) return;
|
|
99
|
+
const c = ++a, d = new AbortController();
|
|
100
|
+
u = d, r.value = !0, C.value = void 0;
|
|
101
101
|
try {
|
|
102
|
-
const p = await s(
|
|
103
|
-
return !
|
|
102
|
+
const p = await s(d.signal);
|
|
103
|
+
return !i && c === a ? p : void 0;
|
|
104
104
|
} catch (p) {
|
|
105
|
-
!
|
|
105
|
+
!i && c === a && (C.value = p);
|
|
106
106
|
return;
|
|
107
107
|
} finally {
|
|
108
|
-
!
|
|
108
|
+
!i && c === a && (r.value = !1, u = void 0);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
return
|
|
112
|
-
|
|
113
|
-
}), { busy: r, error:
|
|
111
|
+
return ve(() => {
|
|
112
|
+
i = !0, v();
|
|
113
|
+
}), { busy: r, error: C, run: o, cancel: v };
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return Array.isArray(r) && r.some((
|
|
117
|
-
const
|
|
118
|
-
return
|
|
115
|
+
function da(r) {
|
|
116
|
+
return Array.isArray(r) && r.some((C) => {
|
|
117
|
+
const i = C;
|
|
118
|
+
return i.type === xa ? !1 : i.type === Ca ? String(i.children).trim() !== "" : i.type === oe ? da(i.children) : !0;
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
123
|
-
return r.map((
|
|
121
|
+
const et = { status: Ja, background: Ga };
|
|
122
|
+
function at(r, C) {
|
|
123
|
+
return r.map((i) => typeof i == "string" ? { id: i, title: C[i], icon: et[i] } : i);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
const
|
|
127
|
-
for (const
|
|
128
|
-
if (
|
|
129
|
-
let a =
|
|
130
|
-
a ||
|
|
125
|
+
function tt(r) {
|
|
126
|
+
const C = /* @__PURE__ */ new Map();
|
|
127
|
+
for (const i of r) {
|
|
128
|
+
if (i.hidden) continue;
|
|
129
|
+
let a = C.get(i.group);
|
|
130
|
+
a || C.set(i.group, a = i.group === void 0 ? { items: [] } : { label: i.group, items: [] }), a.items.push({ key: i.id, label: i.title, icon: i.icon, badge: i.badge });
|
|
131
131
|
}
|
|
132
|
-
return [...
|
|
132
|
+
return [...C.values()];
|
|
133
133
|
}
|
|
134
|
-
const
|
|
134
|
+
const lt = { class: "executor-alert" }, nt = {
|
|
135
|
+
key: 0,
|
|
136
|
+
class: "executor-reason"
|
|
137
|
+
}, st = {
|
|
135
138
|
key: 1,
|
|
139
|
+
class: "executor-summary"
|
|
140
|
+
}, ot = ["data-executor-status"], it = { class: "executor-help" }, ut = {
|
|
141
|
+
key: 0,
|
|
142
|
+
class: "executor-hint"
|
|
143
|
+
}, rt = /* @__PURE__ */ ie({
|
|
144
|
+
__name: "ExecutorSettings",
|
|
145
|
+
props: {
|
|
146
|
+
admin: { type: Boolean },
|
|
147
|
+
locale: {},
|
|
148
|
+
ctx: {}
|
|
149
|
+
},
|
|
150
|
+
emits: ["confirmed"],
|
|
151
|
+
setup(r, { expose: C, emit: i }) {
|
|
152
|
+
const a = r, u = i, v = ra(), o = I(() => Ue(a.locale)), s = m(), c = m(""), d = m(!1), p = m(!1), h = m(!1), R = m(""), x = m(), _ = m(""), U = m([]), $ = I(() => x.value?.scope_mode === "install-selected"), V = I(() => !!x.value?.scope_mode), P = I(() => [{ label: o.value.homeScope, value: "home" }, ...U.value]), A = I(() => !$.value || !!_.value && P.value.some((H) => H.value === _.value)), K = I(() => $.value && !x.value?.selection), Q = I(() => _.value !== x.value?.selection?.scope);
|
|
153
|
+
let Y = !1;
|
|
154
|
+
async function X(H) {
|
|
155
|
+
const W = H ?? await v.status();
|
|
156
|
+
if (Y || (s.value = W, !a.ctx)) return;
|
|
157
|
+
const q = await a.ctx.call("delegate.status");
|
|
158
|
+
if (Y || (x.value = q, q.scope_mode !== "install-selected")) return;
|
|
159
|
+
const B = [];
|
|
160
|
+
let O = 0;
|
|
161
|
+
for (let Z = 0; Z < 128; Z++) {
|
|
162
|
+
const ae = await a.ctx.call("bg.browse", { offset: O });
|
|
163
|
+
if (Y) return;
|
|
164
|
+
if (!Array.isArray(ae.shares) || !Number.isSafeInteger(ae.total) || ae.total < 0 || !ae.shares.length && O < ae.total) throw { code: "EXECUTOR_PROTOCOL" };
|
|
165
|
+
for (const ue of ae.shares)
|
|
166
|
+
ue.isdir && ue.path === "/" + ue.name && !["home", "homes"].includes(ue.name.toLowerCase()) && B.push({ label: ue.name, value: "shared:" + ue.name });
|
|
167
|
+
if (O += ae.shares.length, O >= ae.total) break;
|
|
168
|
+
if (Z === 127) throw { code: "EXECUTOR_PROTOCOL" };
|
|
169
|
+
}
|
|
170
|
+
U.value = B, _.value = q.selection?.scope ?? q.preselection ?? "";
|
|
171
|
+
}
|
|
172
|
+
async function J() {
|
|
173
|
+
if (!(!a.admin || d.value)) {
|
|
174
|
+
d.value = !0, h.value = !1, R.value = "";
|
|
175
|
+
try {
|
|
176
|
+
await X();
|
|
177
|
+
} catch {
|
|
178
|
+
Y || (h.value = !0);
|
|
179
|
+
} finally {
|
|
180
|
+
Y || (d.value = !1);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
async function j() {
|
|
185
|
+
if (!a.admin || d.value || !c.value || !A.value || h.value) return;
|
|
186
|
+
d.value = !0, h.value = !1, R.value = "";
|
|
187
|
+
const H = c.value;
|
|
188
|
+
c.value = "", p.value = !0;
|
|
189
|
+
try {
|
|
190
|
+
let W = $.value ? await v.authorize(H, _.value) : await v.authorize(H);
|
|
191
|
+
if (await X(W), !Y && $.value && W.state === "ready" && K.value && (W = await v.authorize(H, _.value), await X(W)), W.state === "needs-admin-approval")
|
|
192
|
+
throw R.value = W.reason ?? "", W;
|
|
193
|
+
Y || u("confirmed");
|
|
194
|
+
} catch {
|
|
195
|
+
Y || (h.value = !0);
|
|
196
|
+
} finally {
|
|
197
|
+
Y || (d.value = !1, p.value = !1);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const ee = I(() => p.value ? "confirming" : s.value ? s.value.state === "ready" ? K.value ? "scope" : "ready" : s.value.state === "needs-admin-approval" ? "needs" : "blocked" : void 0), se = I(() => ({ ready: { tone: "success", text: o.value.statusReady }, scope: { tone: "warning", text: o.value.statusScope }, needs: { tone: "warning", text: o.value.statusNeeds }, blocked: { tone: "danger", text: o.value.statusBlocked }, confirming: { tone: "info", text: o.value.statusConfirming } })[ee.value ?? "confirming"]), te = I(() => $.value && !!x.value?.selection && !Q.value), ne = I(() => p.value ? o.value.confirmingHelp : d.value || h.value ? "" : te.value ? o.value.hintUnchanged : c.value ? "" : o.value.hintPassword);
|
|
201
|
+
return C({ refresh: J }), pe(() => {
|
|
202
|
+
v.subscribe?.((H) => {
|
|
203
|
+
Y || (s.value = H);
|
|
204
|
+
}), J();
|
|
205
|
+
}), ve(() => {
|
|
206
|
+
Y = !0, c.value = "";
|
|
207
|
+
}), (H, W) => r.admin ? (n(), g(e(_e), {
|
|
208
|
+
key: 0,
|
|
209
|
+
title: o.value.setupTitle,
|
|
210
|
+
description: V.value ? o.value.setupHelpFiles : o.value.setupHelp,
|
|
211
|
+
loading: !s.value && !p.value && !h.value,
|
|
212
|
+
collapsible: !1,
|
|
213
|
+
"aria-busy": d.value
|
|
214
|
+
}, {
|
|
215
|
+
default: t(() => [
|
|
216
|
+
h.value ? (n(), g(e(G), {
|
|
217
|
+
key: 0,
|
|
218
|
+
tone: "danger",
|
|
219
|
+
role: "alert"
|
|
220
|
+
}, {
|
|
221
|
+
default: t(() => [
|
|
222
|
+
z("span", lt, [
|
|
223
|
+
z("span", null, [
|
|
224
|
+
k(l(o.value.setupError), 1),
|
|
225
|
+
R.value ? (n(), T("span", nt, l(R.value), 1)) : y("", !0)
|
|
226
|
+
]),
|
|
227
|
+
f(e(F), {
|
|
228
|
+
variant: "secondary",
|
|
229
|
+
size: "sm",
|
|
230
|
+
disabled: d.value,
|
|
231
|
+
onClick: J
|
|
232
|
+
}, {
|
|
233
|
+
default: t(() => [
|
|
234
|
+
k(l(o.value.retry), 1)
|
|
235
|
+
]),
|
|
236
|
+
_: 1
|
|
237
|
+
}, 8, ["disabled"])
|
|
238
|
+
])
|
|
239
|
+
]),
|
|
240
|
+
_: 1
|
|
241
|
+
})) : y("", !0),
|
|
242
|
+
s.value || p.value ? (n(), T("div", st, [
|
|
243
|
+
f(e($e), {
|
|
244
|
+
label: o.value.status,
|
|
245
|
+
"label-width": "10rem"
|
|
246
|
+
}, {
|
|
247
|
+
default: t(() => [
|
|
248
|
+
z("span", {
|
|
249
|
+
role: "status",
|
|
250
|
+
"data-executor-status": ee.value
|
|
251
|
+
}, [
|
|
252
|
+
f(e(Se), {
|
|
253
|
+
tone: se.value.tone
|
|
254
|
+
}, {
|
|
255
|
+
default: t(() => [
|
|
256
|
+
k(l(se.value.text), 1)
|
|
257
|
+
]),
|
|
258
|
+
_: 1
|
|
259
|
+
}, 8, ["tone"])
|
|
260
|
+
], 8, ot)
|
|
261
|
+
]),
|
|
262
|
+
_: 1
|
|
263
|
+
}, 8, ["label"]),
|
|
264
|
+
s.value?.reason && (s.value.state === "blocked" || s.value.state === "unsupported") ? (n(), g(e($e), {
|
|
265
|
+
key: 0,
|
|
266
|
+
label: o.value.details,
|
|
267
|
+
"label-width": "10rem"
|
|
268
|
+
}, {
|
|
269
|
+
default: t(() => [
|
|
270
|
+
k(l(s.value.reason), 1)
|
|
271
|
+
]),
|
|
272
|
+
_: 1
|
|
273
|
+
}, 8, ["label"])) : y("", !0),
|
|
274
|
+
x.value?.selection ? (n(), g(e($e), {
|
|
275
|
+
key: 1,
|
|
276
|
+
label: o.value.protectedScope,
|
|
277
|
+
"label-width": "10rem"
|
|
278
|
+
}, {
|
|
279
|
+
default: t(() => [
|
|
280
|
+
f(e(me), {
|
|
281
|
+
path: x.value.selection.root
|
|
282
|
+
}, null, 8, ["path"])
|
|
283
|
+
]),
|
|
284
|
+
_: 1
|
|
285
|
+
}, 8, ["label"])) : y("", !0)
|
|
286
|
+
])) : y("", !0),
|
|
287
|
+
ee.value === "needs" ? (n(), g(e(G), {
|
|
288
|
+
key: 2,
|
|
289
|
+
tone: "info"
|
|
290
|
+
}, {
|
|
291
|
+
default: t(() => [
|
|
292
|
+
k(l(V.value ? o.value.needs : o.value.executorNeeds), 1)
|
|
293
|
+
]),
|
|
294
|
+
_: 1
|
|
295
|
+
})) : ee.value === "scope" ? (n(), g(e(G), {
|
|
296
|
+
key: 3,
|
|
297
|
+
tone: "warning"
|
|
298
|
+
}, {
|
|
299
|
+
default: t(() => [
|
|
300
|
+
k(l(o.value.scopeNeeds), 1)
|
|
301
|
+
]),
|
|
302
|
+
_: 1
|
|
303
|
+
})) : ee.value === "blocked" ? (n(), g(e(G), {
|
|
304
|
+
key: 4,
|
|
305
|
+
tone: "warning"
|
|
306
|
+
}, {
|
|
307
|
+
default: t(() => [
|
|
308
|
+
k(l(V.value ? o.value.blocked : o.value.executorBlocked), 1)
|
|
309
|
+
]),
|
|
310
|
+
_: 1
|
|
311
|
+
})) : y("", !0),
|
|
312
|
+
x.value?.mismatch ? (n(), g(e(G), {
|
|
313
|
+
key: 5,
|
|
314
|
+
tone: "warning"
|
|
315
|
+
}, {
|
|
316
|
+
default: t(() => [
|
|
317
|
+
k(l(o.value.scopeMismatch), 1)
|
|
318
|
+
]),
|
|
319
|
+
_: 1
|
|
320
|
+
})) : y("", !0),
|
|
321
|
+
s.value?.state === "needs-admin-approval" || s.value?.retry || $.value && s.value?.state === "ready" ? (n(), g(e(Pe), {
|
|
322
|
+
key: 6,
|
|
323
|
+
direction: "vertical",
|
|
324
|
+
class: "executor-form",
|
|
325
|
+
onSubmit: ze(j, ["prevent"])
|
|
326
|
+
}, {
|
|
327
|
+
default: t(() => [
|
|
328
|
+
$.value ? (n(), T(oe, { key: 0 }, [
|
|
329
|
+
z("p", it, l(x.value?.selection ? o.value.scopeChangeHelp : o.value.preselectionHelp), 1),
|
|
330
|
+
f(e(ke), {
|
|
331
|
+
label: o.value.scopeLabel,
|
|
332
|
+
"label-for": "delegate-scope"
|
|
333
|
+
}, {
|
|
334
|
+
default: t(() => [
|
|
335
|
+
f(e(ia), {
|
|
336
|
+
id: "delegate-scope",
|
|
337
|
+
modelValue: _.value,
|
|
338
|
+
"onUpdate:modelValue": W[0] || (W[0] = (q) => _.value = q),
|
|
339
|
+
options: P.value,
|
|
340
|
+
disabled: d.value || h.value
|
|
341
|
+
}, null, 8, ["modelValue", "options", "disabled"])
|
|
342
|
+
]),
|
|
343
|
+
_: 1
|
|
344
|
+
}, 8, ["label"])
|
|
345
|
+
], 64)) : y("", !0),
|
|
346
|
+
f(e(ke), {
|
|
347
|
+
label: o.value.password,
|
|
348
|
+
"label-for": "delegate-password"
|
|
349
|
+
}, {
|
|
350
|
+
default: t(() => [
|
|
351
|
+
f(e(xe), {
|
|
352
|
+
id: "delegate-password",
|
|
353
|
+
modelValue: c.value,
|
|
354
|
+
"onUpdate:modelValue": W[1] || (W[1] = (q) => c.value = q),
|
|
355
|
+
type: "password",
|
|
356
|
+
autocomplete: "current-password",
|
|
357
|
+
disabled: d.value || h.value
|
|
358
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
359
|
+
]),
|
|
360
|
+
_: 1
|
|
361
|
+
}, 8, ["label"]),
|
|
362
|
+
f(e(Ve), null, {
|
|
363
|
+
default: t(() => [
|
|
364
|
+
f(e(F), {
|
|
365
|
+
type: "submit",
|
|
366
|
+
variant: "primary",
|
|
367
|
+
disabled: d.value || h.value || !c.value || !A.value || te.value
|
|
368
|
+
}, {
|
|
369
|
+
default: t(() => [
|
|
370
|
+
k(l($.value ? x.value?.selection ? o.value.confirmScope : o.value.confirmShare : o.value.authorize), 1)
|
|
371
|
+
]),
|
|
372
|
+
_: 1
|
|
373
|
+
}, 8, ["disabled"]),
|
|
374
|
+
ne.value ? (n(), T("span", ut, l(ne.value), 1)) : y("", !0)
|
|
375
|
+
]),
|
|
376
|
+
_: 1
|
|
377
|
+
})
|
|
378
|
+
]),
|
|
379
|
+
_: 1
|
|
380
|
+
})) : y("", !0)
|
|
381
|
+
]),
|
|
382
|
+
_: 1
|
|
383
|
+
}, 8, ["title", "description", "loading", "aria-busy"])) : y("", !0);
|
|
384
|
+
}
|
|
385
|
+
}), re = (r, C) => {
|
|
386
|
+
const i = r.__vccOpts || r;
|
|
387
|
+
for (const [a, u] of C)
|
|
388
|
+
i[a] = u;
|
|
389
|
+
return i;
|
|
390
|
+
}, ca = /* @__PURE__ */ re(rt, [["__scopeId", "data-v-928609ab"]]), dt = {
|
|
391
|
+
key: 0,
|
|
392
|
+
class: "executor-notice"
|
|
393
|
+
}, ct = { class: "executor-notice-body" }, vt = /* @__PURE__ */ ie({
|
|
394
|
+
__name: "ExecutorNotice",
|
|
395
|
+
props: {
|
|
396
|
+
locale: {},
|
|
397
|
+
ctx: {}
|
|
398
|
+
},
|
|
399
|
+
setup(r) {
|
|
400
|
+
const C = r, i = I(() => Ue(C.locale)), a = Re(Te, void 0) ?? C.ctx.executor;
|
|
401
|
+
a && sa(Te, a);
|
|
402
|
+
const u = m("checking"), v = m(!1), o = I(() => C.ctx.user?.isAdmin === !0), s = I(() => u.value === "needs-admin-approval" || u.value === "blocked"), c = I(() => a?.call ? { call: (R, x) => a.call(R, x) } : C.ctx.call ? C.ctx : void 0);
|
|
403
|
+
let d = !1, p;
|
|
404
|
+
async function h() {
|
|
405
|
+
if (a)
|
|
406
|
+
try {
|
|
407
|
+
const R = await a.status();
|
|
408
|
+
d || (u.value = R.state);
|
|
409
|
+
} catch {
|
|
410
|
+
d || (u.value = "blocked");
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return pe(() => {
|
|
414
|
+
a && (a.subscribe?.((R) => {
|
|
415
|
+
d || (u.value = R.state);
|
|
416
|
+
}), p = C.ctx.reopen?.(() => {
|
|
417
|
+
h();
|
|
418
|
+
}), h());
|
|
419
|
+
}), ve(() => {
|
|
420
|
+
d = !0, p?.();
|
|
421
|
+
}), (R, x) => s.value ? (n(), T("div", dt, [
|
|
422
|
+
f(e(G), { tone: "warning" }, {
|
|
423
|
+
default: t(() => [
|
|
424
|
+
z("span", ct, [
|
|
425
|
+
k(l(o.value ? i.value.noticeAdmin : i.value.noticeUser), 1),
|
|
426
|
+
o.value ? (n(), g(e(F), {
|
|
427
|
+
key: 0,
|
|
428
|
+
variant: "secondary",
|
|
429
|
+
size: "sm",
|
|
430
|
+
onClick: x[0] || (x[0] = (_) => v.value = !0)
|
|
431
|
+
}, {
|
|
432
|
+
default: t(() => [
|
|
433
|
+
k(l(i.value.noticeApprove), 1)
|
|
434
|
+
]),
|
|
435
|
+
_: 1
|
|
436
|
+
})) : y("", !0)
|
|
437
|
+
])
|
|
438
|
+
]),
|
|
439
|
+
_: 1
|
|
440
|
+
}),
|
|
441
|
+
o.value ? (n(), g(e(De), {
|
|
442
|
+
key: 0,
|
|
443
|
+
open: v.value && s.value,
|
|
444
|
+
title: i.value.authorize,
|
|
445
|
+
width: "560px",
|
|
446
|
+
"onUpdate:open": x[1] || (x[1] = (_) => v.value = _)
|
|
447
|
+
}, {
|
|
448
|
+
default: t(() => [
|
|
449
|
+
f(ca, {
|
|
450
|
+
admin: !0,
|
|
451
|
+
locale: r.locale,
|
|
452
|
+
ctx: c.value,
|
|
453
|
+
onConfirmed: h
|
|
454
|
+
}, null, 8, ["locale", "ctx"])
|
|
455
|
+
]),
|
|
456
|
+
_: 1
|
|
457
|
+
}, 8, ["open", "title"])) : y("", !0)
|
|
458
|
+
])) : y("", !0);
|
|
459
|
+
}
|
|
460
|
+
}), pt = /* @__PURE__ */ re(vt, [["__scopeId", "data-v-771da19a"]]), ft = { role: "alert" }, yt = {
|
|
461
|
+
key: 2,
|
|
136
462
|
class: "app-notices"
|
|
137
|
-
},
|
|
463
|
+
}, mt = { class: "app-page-content" }, bt = /* @__PURE__ */ ie({
|
|
138
464
|
__name: "AppShell",
|
|
139
465
|
props: {
|
|
140
466
|
locale: {},
|
|
@@ -152,84 +478,89 @@ const at = { role: "alert" }, tt = {
|
|
|
152
478
|
appRoot: { type: Boolean }
|
|
153
479
|
},
|
|
154
480
|
emits: ["update:modelValue"],
|
|
155
|
-
setup(r, { emit:
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
p.value && !
|
|
481
|
+
setup(r, { emit: C }) {
|
|
482
|
+
const i = r, a = C, u = I(() => fa(i.locale)), v = I(() => at(i.pages, u.value)), o = I(() => tt(v.value)), s = I(() => v.value.find((A) => A.id === i.modelValue)), c = I(() => s.value?.title ?? u.value[i.modelValue] ?? u.value.status), d = $a("scroller"), p = I(() => i.pages.some((A) => typeof A != "string"));
|
|
483
|
+
Me(() => i.modelValue, () => {
|
|
484
|
+
p.value && !i.keepScroll && d.value && (d.value.$el.scrollTop = 0);
|
|
159
485
|
}, { flush: "post" });
|
|
160
|
-
const h =
|
|
486
|
+
const h = Sa(), R = I(() => i.denied === !0 ? {} : i.denied || void 0), x = I(() => i.ctx !== void 0 && je(i.ctx)), _ = I(() => x.value ? i.ctx : void 0), U = (A, { slots: K }) => K.default?.(), $ = I(() => i.ctx !== void 0 && !x.value);
|
|
161
487
|
function V() {
|
|
162
|
-
|
|
488
|
+
i.ctx?.host?.activateWindow?.();
|
|
163
489
|
}
|
|
164
|
-
const
|
|
165
|
-
return
|
|
166
|
-
|
|
167
|
-
}), (
|
|
490
|
+
const P = I(() => _.value?.user?.name ? _.value.user : void 0);
|
|
491
|
+
return za((A) => {
|
|
492
|
+
x.value && A(Ia());
|
|
493
|
+
}), (A, K) => (n(), g(Fe(r.appRoot ? e(Ea) : U), Ge(Je(r.appRoot ? { modalScope: "app", dialogBounds: $.value ? "viewport" : "app", style: "height: 100%;", onActivate: V } : {})), {
|
|
168
494
|
default: t(() => [
|
|
169
|
-
(n(),
|
|
495
|
+
(n(), g(Fe(r.appRoot ? e(Ta) : U), Ge(Je(r.appRoot ? { locale: e(ea)(r.locale) } : {})), {
|
|
170
496
|
default: t(() => [
|
|
171
|
-
|
|
497
|
+
R.value ? (n(), g(e(Xe), {
|
|
172
498
|
key: 0,
|
|
173
499
|
class: "app-denied",
|
|
174
500
|
width: r.pageWidth
|
|
175
501
|
}, {
|
|
176
502
|
default: t(() => [
|
|
177
|
-
|
|
503
|
+
R.value.header !== !1 ? (n(), g(e(Qe), {
|
|
178
504
|
key: 0,
|
|
179
|
-
title:
|
|
180
|
-
}, null, 8, ["title"])) :
|
|
181
|
-
|
|
182
|
-
|
|
505
|
+
title: R.value.title ?? u.value.deniedTitle
|
|
506
|
+
}, null, 8, ["title"])) : y("", !0),
|
|
507
|
+
he(A.$slots, "denied", {}, () => [
|
|
508
|
+
f(e(G), { tone: "danger" }, {
|
|
183
509
|
default: t(() => [
|
|
184
|
-
|
|
510
|
+
z("span", ft, l(R.value.message ?? u.value.deniedMessage), 1)
|
|
185
511
|
]),
|
|
186
512
|
_: 1
|
|
187
513
|
})
|
|
188
514
|
], !0)
|
|
189
515
|
]),
|
|
190
516
|
_: 3
|
|
191
|
-
}, 8, ["width"])) : (n(),
|
|
517
|
+
}, 8, ["width"])) : (n(), g(e(Ua), {
|
|
192
518
|
key: 1,
|
|
193
|
-
class:
|
|
519
|
+
class: We(["app-shell", { "app-shell-fill": s.value?.fill }]),
|
|
194
520
|
"min-height": "0",
|
|
195
|
-
"wide-layout": r.wideLayout ?? (
|
|
521
|
+
"wide-layout": r.wideLayout ?? (x.value ? "web" : "window"),
|
|
196
522
|
"sidebar-storage-key": r.sidebarStorageKey,
|
|
197
|
-
"brand-name": r.brandName ??
|
|
198
|
-
"brand-icon": r.brandIcon ??
|
|
199
|
-
},
|
|
523
|
+
"brand-name": r.brandName ?? r.ctx?.displayName,
|
|
524
|
+
"brand-icon": r.brandIcon ?? r.ctx?.appIcon
|
|
525
|
+
}, Ke({
|
|
200
526
|
sidebar: t(() => [
|
|
201
|
-
|
|
527
|
+
f(e(Ra), {
|
|
202
528
|
"model-value": r.modelValue,
|
|
203
|
-
groups:
|
|
204
|
-
"onUpdate:modelValue":
|
|
529
|
+
groups: o.value,
|
|
530
|
+
"onUpdate:modelValue": K[0] || (K[0] = (Q) => a("update:modelValue", Q))
|
|
205
531
|
}, null, 8, ["model-value", "groups"])
|
|
206
532
|
]),
|
|
207
533
|
default: t(() => [
|
|
208
|
-
|
|
534
|
+
f(e(Xe), {
|
|
209
535
|
ref_key: "scroller",
|
|
210
|
-
ref:
|
|
211
|
-
class:
|
|
536
|
+
ref: d,
|
|
537
|
+
class: We(["app-page", { "app-page-fill": s.value?.fill }]),
|
|
212
538
|
width: r.pageWidth
|
|
213
539
|
}, {
|
|
214
540
|
default: t(() => [
|
|
215
|
-
s.value?.header !== !1 ? (n(),
|
|
541
|
+
s.value?.header !== !1 ? (n(), g(e(Qe), {
|
|
216
542
|
key: 0,
|
|
217
|
-
title:
|
|
543
|
+
title: c.value,
|
|
218
544
|
description: s.value?.description ?? r.description
|
|
219
545
|
}, {
|
|
220
546
|
actions: t(() => [
|
|
221
|
-
|
|
547
|
+
he(A.$slots, "actions", { page: r.modelValue }, void 0, !0)
|
|
222
548
|
]),
|
|
223
549
|
_: 3
|
|
224
|
-
}, 8, ["title", "description"])) :
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
550
|
+
}, 8, ["title", "description"])) : y("", !0),
|
|
551
|
+
r.ctx?.executor ? (n(), g(pt, {
|
|
552
|
+
key: 1,
|
|
553
|
+
ctx: r.ctx,
|
|
554
|
+
locale: r.locale
|
|
555
|
+
}, null, 8, ["ctx", "locale"])) : y("", !0),
|
|
556
|
+
e(da)(h.notices?.({ page: r.modelValue })) ? (n(), T("div", yt, [
|
|
557
|
+
he(A.$slots, "notices", { page: r.modelValue }, void 0, !0)
|
|
558
|
+
])) : y("", !0),
|
|
559
|
+
z("div", mt, [
|
|
560
|
+
s.value?.component ? (n(), g(Fe(s.value.component), {
|
|
230
561
|
key: s.value.id
|
|
231
|
-
})) :
|
|
232
|
-
|
|
562
|
+
})) : y("", !0),
|
|
563
|
+
he(A.$slots, "default", { page: r.modelValue }, void 0, !0)
|
|
233
564
|
])
|
|
234
565
|
]),
|
|
235
566
|
_: 3
|
|
@@ -237,15 +568,15 @@ const at = { role: "alert" }, tt = {
|
|
|
237
568
|
]),
|
|
238
569
|
_: 2
|
|
239
570
|
}, [
|
|
240
|
-
h["sidebar-footer"] ||
|
|
571
|
+
h["sidebar-footer"] || P.value ? {
|
|
241
572
|
name: "sidebar-footer",
|
|
242
573
|
fn: t(() => [
|
|
243
|
-
|
|
244
|
-
|
|
574
|
+
he(A.$slots, "sidebar-footer", {}, () => [
|
|
575
|
+
P.value ? (n(), g(e(Da), {
|
|
245
576
|
key: 0,
|
|
246
|
-
name:
|
|
247
|
-
detail:
|
|
248
|
-
}, null, 8, ["name", "detail"])) :
|
|
577
|
+
name: P.value.name,
|
|
578
|
+
detail: P.value.isAdmin ? u.value.administrator : u.value.dsmUser
|
|
579
|
+
}, null, 8, ["name", "detail"])) : y("", !0)
|
|
249
580
|
], !0)
|
|
250
581
|
]),
|
|
251
582
|
key: "0"
|
|
@@ -253,7 +584,7 @@ const at = { role: "alert" }, tt = {
|
|
|
253
584
|
h.toolbar ? {
|
|
254
585
|
name: "toolbar",
|
|
255
586
|
fn: t(() => [
|
|
256
|
-
|
|
587
|
+
he(A.$slots, "toolbar", { page: r.modelValue }, void 0, !0)
|
|
257
588
|
]),
|
|
258
589
|
key: "1"
|
|
259
590
|
} : void 0
|
|
@@ -265,32 +596,27 @@ const at = { role: "alert" }, tt = {
|
|
|
265
596
|
_: 3
|
|
266
597
|
}, 16));
|
|
267
598
|
}
|
|
268
|
-
}),
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
function Fe(r, T) {
|
|
275
|
-
let o = 0, a = r;
|
|
276
|
-
for (; a >= 1024 && o < Xe.length - 1; )
|
|
277
|
-
a /= 1024, o++;
|
|
278
|
-
return `${new Intl.NumberFormat(T, { maximumFractionDigits: o ? 1 : 0 }).format(a)} ${Xe[o]}`;
|
|
599
|
+
}), bn = /* @__PURE__ */ re(bt, [["__scopeId", "data-v-098c9e72"]]), Ze = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
600
|
+
function Le(r, C) {
|
|
601
|
+
let i = 0, a = r;
|
|
602
|
+
for (; a >= 1024 && i < Ze.length - 1; )
|
|
603
|
+
a /= 1024, i++;
|
|
604
|
+
return `${new Intl.NumberFormat(C, { maximumFractionDigits: i ? 1 : 0 }).format(a)} ${Ze[i]}`;
|
|
279
605
|
}
|
|
280
|
-
const
|
|
606
|
+
const gt = ["aria-busy", "aria-label"], ht = { class: "file-toolbar file-location" }, kt = ["aria-label"], _t = {
|
|
281
607
|
key: 0,
|
|
282
608
|
class: "file-toolbar"
|
|
283
|
-
},
|
|
609
|
+
}, wt = {
|
|
284
610
|
key: 1,
|
|
285
611
|
role: "status"
|
|
286
|
-
},
|
|
612
|
+
}, xt = { role: "alert" }, Ct = {
|
|
287
613
|
key: 4,
|
|
288
614
|
role: "status"
|
|
289
|
-
},
|
|
615
|
+
}, $t = { class: "file-columns" }, St = ["aria-label"], zt = { class: "file-content" }, Pt = { class: "file-name" }, Vt = { class: "file-empty" }, At = { class: "file-bytes" }, It = {
|
|
290
616
|
key: 5,
|
|
291
617
|
class: "file-selection",
|
|
292
618
|
role: "status"
|
|
293
|
-
},
|
|
619
|
+
}, Et = /* @__PURE__ */ ie({
|
|
294
620
|
__name: "FileBrowser",
|
|
295
621
|
props: {
|
|
296
622
|
provider: {},
|
|
@@ -299,310 +625,310 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
299
625
|
transfers: { type: Boolean, default: !1 }
|
|
300
626
|
},
|
|
301
627
|
emits: ["selected"],
|
|
302
|
-
setup(r, { emit:
|
|
303
|
-
const
|
|
304
|
-
let
|
|
305
|
-
async function
|
|
306
|
-
const
|
|
307
|
-
!
|
|
628
|
+
setup(r, { emit: C }) {
|
|
629
|
+
const i = r, a = C, u = I(() => ge(i.locale)), v = ja(), { busy: o, error: s } = v, c = m([]), d = m([]), p = m([]), h = m(), R = m(), x = m(), _ = m([]), U = m(), $ = m({ key: "name", direction: "asc" }), V = m(0), P = m([]), A = m(!1);
|
|
630
|
+
let K = new AbortController();
|
|
631
|
+
async function Q() {
|
|
632
|
+
const S = h.value;
|
|
633
|
+
!S || S.isDir || !i.provider.download || await v.run(async (E) => (await i.provider.info(S.path, E), i.provider.download(S.path), !0));
|
|
308
634
|
}
|
|
309
|
-
async function
|
|
310
|
-
const
|
|
311
|
-
if (!
|
|
312
|
-
|
|
635
|
+
async function Y() {
|
|
636
|
+
const S = p.value.at(-1)?.path, E = P.value[0];
|
|
637
|
+
if (!S || !E || !i.provider.upload) return;
|
|
638
|
+
A.value = !1, await v.run(async (b) => (await i.provider.upload(S, E, b), !0)) && (P.value = [], await ae(p.value), A.value = !0);
|
|
313
639
|
}
|
|
314
|
-
const
|
|
640
|
+
const X = I(() => [
|
|
315
641
|
{ key: "name", label: u.value.nameColumn, sortable: !0 },
|
|
316
642
|
{ key: "kind", label: u.value.kindColumn },
|
|
317
643
|
{ key: "bytes", label: u.value.sizeColumn, align: "right", sortable: !0 }
|
|
318
|
-
]),
|
|
319
|
-
function j(
|
|
320
|
-
return { id:
|
|
644
|
+
]), J = Pa((S, { attrs: E }) => Va(qe, { ...E, kind: "folder" }));
|
|
645
|
+
function j(S) {
|
|
646
|
+
return { id: S.path, label: S.name, icon: J, data: S };
|
|
321
647
|
}
|
|
322
|
-
function
|
|
323
|
-
h.value =
|
|
648
|
+
function ee(S) {
|
|
649
|
+
h.value = S, a("selected", S?.path);
|
|
324
650
|
}
|
|
325
|
-
function
|
|
326
|
-
|
|
651
|
+
function se(S) {
|
|
652
|
+
R.value = S.path, ee(i.mode === "folder" ? S.isDir ? S : p.value.at(-1) : S.isDir ? void 0 : S);
|
|
327
653
|
}
|
|
328
|
-
function
|
|
329
|
-
|
|
654
|
+
function te(S) {
|
|
655
|
+
S.isDir ? fe(S) : se(S);
|
|
330
656
|
}
|
|
331
|
-
const
|
|
332
|
-
function
|
|
333
|
-
for (const
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
336
|
-
const w =
|
|
657
|
+
const ne = (S) => c.value.find((E) => E.path === S);
|
|
658
|
+
function H(S, E, D = []) {
|
|
659
|
+
for (const b of S) {
|
|
660
|
+
const L = [...D, b.data];
|
|
661
|
+
if (b.id === E) return L;
|
|
662
|
+
const w = H(b.children ?? [], E, L);
|
|
337
663
|
if (w) return w;
|
|
338
664
|
}
|
|
339
665
|
}
|
|
340
|
-
function
|
|
341
|
-
for (const
|
|
342
|
-
if (
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
666
|
+
function W(S, E) {
|
|
667
|
+
for (const D of S) {
|
|
668
|
+
if (D.id === E) return D;
|
|
669
|
+
const b = W(D.children ?? [], E);
|
|
670
|
+
if (b) return b;
|
|
345
671
|
}
|
|
346
672
|
}
|
|
347
|
-
function
|
|
348
|
-
return
|
|
673
|
+
function q(S, E, D) {
|
|
674
|
+
return S.map((b) => b.id === E ? { ...b, children: D } : b.children ? { ...b, children: q(b.children, E, D) } : b);
|
|
349
675
|
}
|
|
350
|
-
let
|
|
351
|
-
async function
|
|
352
|
-
const
|
|
353
|
-
for (const
|
|
354
|
-
const
|
|
355
|
-
if (!
|
|
356
|
-
if (
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
359
|
-
|
|
676
|
+
let B = 0;
|
|
677
|
+
async function O(S) {
|
|
678
|
+
const E = ++B;
|
|
679
|
+
for (const D of S.slice(0, -1)) {
|
|
680
|
+
const b = W(d.value, D.path);
|
|
681
|
+
if (!b) break;
|
|
682
|
+
if (b.children === void 0) {
|
|
683
|
+
const L = await Z(b);
|
|
684
|
+
if (E !== B || !L) return;
|
|
685
|
+
d.value = q(d.value, b.id, L);
|
|
360
686
|
}
|
|
361
|
-
_.value.includes(
|
|
687
|
+
_.value.includes(b.id) || (_.value = [..._.value, b.id]);
|
|
362
688
|
}
|
|
363
|
-
|
|
689
|
+
U.value = S.at(-1)?.path;
|
|
364
690
|
}
|
|
365
|
-
async function
|
|
366
|
-
const
|
|
691
|
+
async function Z(S) {
|
|
692
|
+
const E = V.value, D = K.signal;
|
|
367
693
|
try {
|
|
368
|
-
const
|
|
369
|
-
let
|
|
370
|
-
for (;
|
|
371
|
-
const w = await
|
|
372
|
-
if (
|
|
373
|
-
|
|
694
|
+
const b = [];
|
|
695
|
+
let L = 0;
|
|
696
|
+
for (; L !== void 0; ) {
|
|
697
|
+
const w = await i.provider.list(S.id, { offset: L, sortBy: "name", sortDirection: "ASC" }, D);
|
|
698
|
+
if (D.aborted || E !== V.value) return;
|
|
699
|
+
b.push(...w.entries.filter((de) => de.isDir).map(j)), L = w.nextOffset;
|
|
374
700
|
}
|
|
375
|
-
return
|
|
376
|
-
} catch (
|
|
377
|
-
!
|
|
701
|
+
return b;
|
|
702
|
+
} catch (b) {
|
|
703
|
+
!D.aborted && E === V.value && (s.value = b, ee());
|
|
378
704
|
return;
|
|
379
705
|
}
|
|
380
706
|
}
|
|
381
|
-
async function
|
|
382
|
-
if (
|
|
383
|
-
|
|
384
|
-
const
|
|
385
|
-
p.value =
|
|
386
|
-
const
|
|
387
|
-
|
|
707
|
+
async function ae(S, E = !1) {
|
|
708
|
+
if (o.value) return;
|
|
709
|
+
ee(), R.value = void 0, c.value = E ? c.value : [], x.value = E ? x.value : void 0;
|
|
710
|
+
const D = E ? x.value ?? 0 : 0, b = S.at(-1)?.path;
|
|
711
|
+
p.value = S;
|
|
712
|
+
const L = await v.run((w) => b ? i.provider.list(b, { offset: D, sortBy: $.value.key, sortDirection: $.value.direction === "asc" ? "ASC" : "DESC" }, w) : i.provider.shares(D, w));
|
|
713
|
+
L && (c.value = E ? [...c.value, ...L.entries] : L.entries, x.value = L.nextOffset, b ? i.mode === "folder" && !E && ee(S.at(-1)) : d.value = c.value.filter((w) => w.isDir).map(j), E || O(S));
|
|
388
714
|
}
|
|
389
|
-
const
|
|
390
|
-
function Ce(
|
|
391
|
-
const
|
|
392
|
-
|
|
715
|
+
const ue = I(() => [{ id: "", display: u.value.roots }, ...p.value.map((S) => ({ id: S.path, display: S.name }))]);
|
|
716
|
+
function Ce(S) {
|
|
717
|
+
const E = ue.value.findIndex((D) => D.id === S.id);
|
|
718
|
+
E < p.value.length && be(p.value.slice(0, E));
|
|
393
719
|
}
|
|
394
|
-
function
|
|
395
|
-
|
|
720
|
+
function fe(S) {
|
|
721
|
+
be([...p.value, S]);
|
|
396
722
|
}
|
|
397
|
-
const
|
|
398
|
-
function
|
|
399
|
-
|
|
723
|
+
const ye = m([[]]), ce = m(0);
|
|
724
|
+
function be(S) {
|
|
725
|
+
o.value || (S.at(-1)?.path !== p.value.at(-1)?.path && (ye.value = [...ye.value.slice(0, ce.value + 1), S], ce.value++), ae(S));
|
|
400
726
|
}
|
|
401
|
-
function
|
|
402
|
-
|
|
727
|
+
function M(S) {
|
|
728
|
+
o.value || (ce.value += S, ae(ye.value[ce.value]));
|
|
403
729
|
}
|
|
404
|
-
function
|
|
405
|
-
|
|
730
|
+
function le(S) {
|
|
731
|
+
$.value = { key: S?.key === "bytes" ? "size" : "name", direction: S?.direction ?? "asc" }, ae(p.value);
|
|
406
732
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
733
|
+
function N() {
|
|
734
|
+
o.value || (V.value++, K.abort(), K = new AbortController(), d.value = [], _.value = [], U.value = void 0, ye.value = [[]], ce.value = 0, ae([]));
|
|
409
735
|
}
|
|
410
|
-
return
|
|
411
|
-
|
|
412
|
-
}),
|
|
413
|
-
V.value++,
|
|
414
|
-
}), (
|
|
736
|
+
return pe(() => {
|
|
737
|
+
ae([]);
|
|
738
|
+
}), ve(() => {
|
|
739
|
+
V.value++, K.abort();
|
|
740
|
+
}), (S, E) => (n(), T("section", {
|
|
415
741
|
class: "file-browser",
|
|
416
|
-
"aria-busy": e(
|
|
742
|
+
"aria-busy": e(o),
|
|
417
743
|
"aria-label": u.value.title
|
|
418
744
|
}, [
|
|
419
|
-
|
|
420
|
-
|
|
745
|
+
z("div", ht, [
|
|
746
|
+
f(e(Ne), {
|
|
421
747
|
label: u.value.back,
|
|
422
748
|
size: "sm",
|
|
423
|
-
disabled: e(
|
|
424
|
-
onClick:
|
|
749
|
+
disabled: e(o) || ce.value === 0,
|
|
750
|
+
onClick: E[0] || (E[0] = (D) => M(-1))
|
|
425
751
|
}, {
|
|
426
752
|
default: t(() => [
|
|
427
|
-
|
|
753
|
+
f(e(Wa), {
|
|
428
754
|
size: 16,
|
|
429
755
|
"aria-hidden": "true"
|
|
430
756
|
})
|
|
431
757
|
]),
|
|
432
758
|
_: 1
|
|
433
759
|
}, 8, ["label", "disabled"]),
|
|
434
|
-
|
|
760
|
+
f(e(Ne), {
|
|
435
761
|
label: u.value.forward,
|
|
436
762
|
size: "sm",
|
|
437
|
-
disabled: e(
|
|
438
|
-
onClick:
|
|
763
|
+
disabled: e(o) || ce.value === ye.value.length - 1,
|
|
764
|
+
onClick: E[1] || (E[1] = (D) => M(1))
|
|
439
765
|
}, {
|
|
440
766
|
default: t(() => [
|
|
441
|
-
|
|
767
|
+
f(e(Xa), {
|
|
442
768
|
size: 16,
|
|
443
769
|
"aria-hidden": "true"
|
|
444
770
|
})
|
|
445
771
|
]),
|
|
446
772
|
_: 1
|
|
447
773
|
}, 8, ["label", "disabled"]),
|
|
448
|
-
|
|
774
|
+
f(e(Ne), {
|
|
449
775
|
label: u.value.refresh,
|
|
450
776
|
size: "sm",
|
|
451
|
-
disabled: e(
|
|
452
|
-
onClick:
|
|
777
|
+
disabled: e(o),
|
|
778
|
+
onClick: N
|
|
453
779
|
}, {
|
|
454
780
|
default: t(() => [
|
|
455
|
-
|
|
781
|
+
f(e(Qa), {
|
|
456
782
|
size: 14,
|
|
457
783
|
"aria-hidden": "true"
|
|
458
784
|
})
|
|
459
785
|
]),
|
|
460
786
|
_: 1
|
|
461
787
|
}, 8, ["label", "disabled"]),
|
|
462
|
-
|
|
788
|
+
z("nav", {
|
|
463
789
|
class: "file-path",
|
|
464
790
|
"aria-label": u.value.location
|
|
465
791
|
}, [
|
|
466
|
-
|
|
467
|
-
items:
|
|
792
|
+
f(e(Ba), {
|
|
793
|
+
items: ue.value,
|
|
468
794
|
"collapsed-label": u.value.fullPath,
|
|
469
795
|
onClickItem: Ce
|
|
470
796
|
}, null, 8, ["items", "collapsed-label"])
|
|
471
|
-
], 8,
|
|
797
|
+
], 8, kt)
|
|
472
798
|
]),
|
|
473
|
-
r.transfers && r.provider.upload && p.value.length ? (n(),
|
|
474
|
-
|
|
475
|
-
modelValue:
|
|
476
|
-
"onUpdate:modelValue":
|
|
799
|
+
r.transfers && r.provider.upload && p.value.length ? (n(), T("div", _t, [
|
|
800
|
+
f(e(Fa), {
|
|
801
|
+
modelValue: P.value,
|
|
802
|
+
"onUpdate:modelValue": E[2] || (E[2] = (D) => P.value = D),
|
|
477
803
|
variant: "compact",
|
|
478
|
-
disabled: e(
|
|
804
|
+
disabled: e(o),
|
|
479
805
|
"max-files": 1,
|
|
480
806
|
"max-size": 16 * 1024 ** 3,
|
|
481
807
|
title: u.value.upload,
|
|
482
|
-
onRejected:
|
|
808
|
+
onRejected: E[3] || (E[3] = (D) => s.value = { code: "upload_size_required" })
|
|
483
809
|
}, null, 8, ["modelValue", "disabled", "title"]),
|
|
484
|
-
|
|
810
|
+
f(e(F), {
|
|
485
811
|
variant: "primary",
|
|
486
|
-
disabled: e(
|
|
487
|
-
onClick:
|
|
812
|
+
disabled: e(o) || !P.value.length,
|
|
813
|
+
onClick: Y
|
|
488
814
|
}, {
|
|
489
815
|
default: t(() => [
|
|
490
|
-
|
|
816
|
+
k(l(u.value.upload), 1)
|
|
491
817
|
]),
|
|
492
818
|
_: 1
|
|
493
819
|
}, 8, ["disabled"])
|
|
494
|
-
])) :
|
|
495
|
-
|
|
496
|
-
r.transfers && r.provider.download && h.value && !h.value.isDir && !e(s) ? (n(),
|
|
820
|
+
])) : y("", !0),
|
|
821
|
+
A.value ? (n(), T("p", wt, l(u.value.uploaded), 1)) : y("", !0),
|
|
822
|
+
r.transfers && r.provider.download && h.value && !h.value.isDir && !e(s) ? (n(), g(e(F), {
|
|
497
823
|
key: 2,
|
|
498
824
|
variant: "secondary",
|
|
499
|
-
disabled: e(
|
|
500
|
-
onClick:
|
|
825
|
+
disabled: e(o),
|
|
826
|
+
onClick: Q
|
|
501
827
|
}, {
|
|
502
828
|
default: t(() => [
|
|
503
|
-
|
|
829
|
+
k(l(u.value.download), 1)
|
|
504
830
|
]),
|
|
505
831
|
_: 1
|
|
506
|
-
}, 8, ["disabled"])) :
|
|
507
|
-
e(s) ? (n(),
|
|
832
|
+
}, 8, ["disabled"])) : y("", !0),
|
|
833
|
+
e(s) ? (n(), g(e(G), {
|
|
508
834
|
key: 3,
|
|
509
835
|
tone: "danger"
|
|
510
836
|
}, {
|
|
511
837
|
default: t(() => [
|
|
512
|
-
|
|
838
|
+
z("span", xt, l(e(aa)(e(s), u.value)), 1)
|
|
513
839
|
]),
|
|
514
840
|
_: 1
|
|
515
|
-
})) :
|
|
516
|
-
e(
|
|
517
|
-
|
|
518
|
-
|
|
841
|
+
})) : y("", !0),
|
|
842
|
+
e(o) ? (n(), T("p", Ct, l(u.value.loading), 1)) : y("", !0),
|
|
843
|
+
z("div", $t, [
|
|
844
|
+
z("aside", {
|
|
519
845
|
class: "file-tree",
|
|
520
846
|
"aria-label": u.value.roots
|
|
521
847
|
}, [
|
|
522
|
-
|
|
848
|
+
d.value.length ? (n(), g(e(qa), {
|
|
523
849
|
key: V.value,
|
|
524
850
|
"selection-style": "background",
|
|
525
|
-
modelValue:
|
|
526
|
-
"onUpdate:modelValue":
|
|
527
|
-
nodes:
|
|
528
|
-
"onUpdate:nodes":
|
|
851
|
+
modelValue: U.value,
|
|
852
|
+
"onUpdate:modelValue": E[4] || (E[4] = (D) => U.value = D),
|
|
853
|
+
nodes: d.value,
|
|
854
|
+
"onUpdate:nodes": E[5] || (E[5] = (D) => d.value = D),
|
|
529
855
|
expanded: _.value,
|
|
530
|
-
"onUpdate:expanded":
|
|
531
|
-
"load-children":
|
|
532
|
-
"expand-label": (
|
|
533
|
-
onSelect:
|
|
534
|
-
}, null, 8, ["modelValue", "nodes", "expanded", "expand-label"])) :
|
|
535
|
-
], 8,
|
|
536
|
-
|
|
537
|
-
e(s) ?
|
|
856
|
+
"onUpdate:expanded": E[6] || (E[6] = (D) => _.value = D),
|
|
857
|
+
"load-children": Z,
|
|
858
|
+
"expand-label": (D, b) => e(Oe)(b ? u.value.collapse : u.value.expand, { name: D.label }),
|
|
859
|
+
onSelect: E[7] || (E[7] = (D) => be(H(d.value, D.id) ?? [D.data]))
|
|
860
|
+
}, null, 8, ["modelValue", "nodes", "expanded", "expand-label"])) : y("", !0)
|
|
861
|
+
], 8, St),
|
|
862
|
+
z("div", zt, [
|
|
863
|
+
e(s) ? y("", !0) : (n(), g(e(Na), {
|
|
538
864
|
key: 0,
|
|
539
|
-
columns:
|
|
540
|
-
rows:
|
|
865
|
+
columns: X.value,
|
|
866
|
+
rows: c.value.map((D) => ({ ...D, kind: D.isDir ? u.value.directoryKind : u.value.fileKind })),
|
|
541
867
|
"row-key": "path",
|
|
542
868
|
footer: !1,
|
|
543
869
|
resizable: !1,
|
|
544
870
|
"local-sort": !1,
|
|
545
871
|
"local-pagination": !1,
|
|
546
|
-
loading: e(
|
|
872
|
+
loading: e(o),
|
|
547
873
|
"loading-text": u.value.loading,
|
|
548
|
-
sort: { key:
|
|
874
|
+
sort: { key: $.value.key === "size" ? "bytes" : $.value.key, direction: $.value.direction },
|
|
549
875
|
labels: { empty: u.value.emptyFolder },
|
|
550
876
|
"single-select": "",
|
|
551
|
-
"selected-keys":
|
|
552
|
-
"onUpdate:sort":
|
|
553
|
-
"onUpdate:selectedKeys":
|
|
554
|
-
e(
|
|
877
|
+
"selected-keys": R.value ? [R.value] : [],
|
|
878
|
+
"onUpdate:sort": le,
|
|
879
|
+
"onUpdate:selectedKeys": E[8] || (E[8] = (D) => {
|
|
880
|
+
e(o) || se(ne(D[0]));
|
|
555
881
|
}),
|
|
556
|
-
onRowActivate:
|
|
557
|
-
e(
|
|
882
|
+
onRowActivate: E[9] || (E[9] = (D) => {
|
|
883
|
+
e(o) || te(ne(D.path));
|
|
558
884
|
}),
|
|
559
|
-
onRowDblclick:
|
|
560
|
-
e(
|
|
885
|
+
onRowDblclick: E[10] || (E[10] = (D) => {
|
|
886
|
+
e(o) || te(ne(D.path));
|
|
561
887
|
})
|
|
562
888
|
}, {
|
|
563
|
-
"cell-name": t(({ row:
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
kind:
|
|
567
|
-
name:
|
|
889
|
+
"cell-name": t(({ row: D }) => [
|
|
890
|
+
z("span", Pt, [
|
|
891
|
+
f(e(qe), {
|
|
892
|
+
kind: D.isDir ? "folder" : "file",
|
|
893
|
+
name: D.name
|
|
568
894
|
}, null, 8, ["kind", "name"]),
|
|
569
|
-
|
|
895
|
+
k(l(D.name), 1)
|
|
570
896
|
])
|
|
571
897
|
]),
|
|
572
898
|
empty: t(() => [
|
|
573
|
-
|
|
574
|
-
|
|
899
|
+
z("div", Vt, [
|
|
900
|
+
f(e(qe), {
|
|
575
901
|
kind: "folder",
|
|
576
902
|
size: [40, 40]
|
|
577
903
|
}),
|
|
578
|
-
|
|
904
|
+
z("span", null, l(u.value.emptyFolder), 1)
|
|
579
905
|
])
|
|
580
906
|
]),
|
|
581
|
-
"cell-bytes": t(({ row:
|
|
582
|
-
|
|
907
|
+
"cell-bytes": t(({ row: D }) => [
|
|
908
|
+
z("span", At, l(D.isDir || D.bytes === void 0 ? "—" : e(Le)(D.bytes, e(ea)(r.locale))), 1)
|
|
583
909
|
]),
|
|
584
910
|
_: 1
|
|
585
911
|
}, 8, ["columns", "rows", "loading", "loading-text", "sort", "labels", "selected-keys"])),
|
|
586
|
-
|
|
912
|
+
x.value !== void 0 && !e(s) ? (n(), g(e(F), {
|
|
587
913
|
key: 1,
|
|
588
914
|
variant: "secondary",
|
|
589
|
-
disabled: e(
|
|
590
|
-
onClick:
|
|
915
|
+
disabled: e(o),
|
|
916
|
+
onClick: E[11] || (E[11] = (D) => ae(p.value, !0))
|
|
591
917
|
}, {
|
|
592
918
|
default: t(() => [
|
|
593
|
-
|
|
919
|
+
k(l(u.value.loadMore), 1)
|
|
594
920
|
]),
|
|
595
921
|
_: 1
|
|
596
|
-
}, 8, ["disabled"])) :
|
|
922
|
+
}, 8, ["disabled"])) : y("", !0)
|
|
597
923
|
])
|
|
598
924
|
]),
|
|
599
|
-
h.value && !e(s) ? (n(),
|
|
600
|
-
], 8,
|
|
925
|
+
h.value && !e(s) ? (n(), T("p", It, l(e(Oe)(u.value.selected, { name: h.value.path })), 1)) : y("", !0)
|
|
926
|
+
], 8, gt));
|
|
601
927
|
}
|
|
602
|
-
}),
|
|
928
|
+
}), va = /* @__PURE__ */ re(Et, [["__scopeId", "data-v-c689761c"]]), Tt = {
|
|
603
929
|
key: 0,
|
|
604
930
|
class: "save-consent"
|
|
605
|
-
},
|
|
931
|
+
}, Ut = ["aria-busy", "inert"], Rt = /* @__PURE__ */ ie({
|
|
606
932
|
__name: "NasPicker",
|
|
607
933
|
props: {
|
|
608
934
|
open: { type: Boolean },
|
|
@@ -615,355 +941,359 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
615
941
|
errorText: { type: Function }
|
|
616
942
|
},
|
|
617
943
|
emits: ["update:open", "selected", "authorized", "refused"],
|
|
618
|
-
setup(r, { emit:
|
|
619
|
-
const
|
|
620
|
-
let
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
}),
|
|
624
|
-
p = !0,
|
|
944
|
+
setup(r, { emit: C }) {
|
|
945
|
+
const i = r, a = C, u = m(), v = I(() => ge(i.locale)), o = I(() => ta(i.locale)), s = m(!1), c = m();
|
|
946
|
+
let d = 0, p = !1;
|
|
947
|
+
Me(() => i.open, () => {
|
|
948
|
+
d++, u.value = void 0, c.value = void 0;
|
|
949
|
+
}), ve(() => {
|
|
950
|
+
p = !0, d++;
|
|
625
951
|
});
|
|
626
952
|
function h() {
|
|
627
953
|
s.value || (u.value = void 0, a("update:open", !1));
|
|
628
954
|
}
|
|
629
|
-
async function
|
|
630
|
-
const
|
|
631
|
-
if (!(!
|
|
955
|
+
async function R() {
|
|
956
|
+
const x = u.value, _ = i.destination, U = d;
|
|
957
|
+
if (!(!x || s.value || !i.open || p || _ && i.mode !== "folder")) {
|
|
632
958
|
if (!_) {
|
|
633
|
-
a("selected",
|
|
959
|
+
a("selected", x), h();
|
|
634
960
|
return;
|
|
635
961
|
}
|
|
636
|
-
s.value = !0,
|
|
962
|
+
s.value = !0, c.value = void 0;
|
|
637
963
|
try {
|
|
638
|
-
const
|
|
639
|
-
if (p ||
|
|
640
|
-
if (
|
|
641
|
-
a("authorized",
|
|
642
|
-
} catch (
|
|
643
|
-
if (p ||
|
|
644
|
-
if (
|
|
645
|
-
s.value = !1, a("refused",
|
|
964
|
+
const $ = await _.selectDestination({ key: _.key, path: x });
|
|
965
|
+
if (p || U !== d) return;
|
|
966
|
+
if (!$ || typeof $.id != "string" || !$.id || typeof $.username != "string" || !$.username || $.path !== x || $.key !== _.key || $.lifetime !== "until-revoked") throw { code: "commit-uncertain" };
|
|
967
|
+
a("authorized", $), s.value = !1, h();
|
|
968
|
+
} catch ($) {
|
|
969
|
+
if (p || U !== d) return;
|
|
970
|
+
if ($?.code === "APP_DENIED") {
|
|
971
|
+
s.value = !1, a("refused", $), h();
|
|
646
972
|
return;
|
|
647
973
|
}
|
|
648
|
-
|
|
974
|
+
c.value = $;
|
|
649
975
|
} finally {
|
|
650
976
|
p || (s.value = !1);
|
|
651
977
|
}
|
|
652
978
|
}
|
|
653
979
|
}
|
|
654
|
-
return (
|
|
980
|
+
return (x, _) => (n(), g(e(De), {
|
|
655
981
|
open: r.open,
|
|
656
|
-
title: r.title ?? (r.mode === "folder" ?
|
|
657
|
-
description: r.description ??
|
|
658
|
-
"close-label":
|
|
982
|
+
title: r.title ?? (r.mode === "folder" ? v.value.choose : v.value.chooseFile),
|
|
983
|
+
description: r.description ?? v.value.ownPermissions,
|
|
984
|
+
"close-label": v.value.close,
|
|
659
985
|
"show-close": !s.value,
|
|
660
986
|
width: "800px",
|
|
661
|
-
onEscapeKeyDown: _[1] || (_[1] = (
|
|
662
|
-
s.value &&
|
|
987
|
+
onEscapeKeyDown: _[1] || (_[1] = (U) => {
|
|
988
|
+
s.value && U.preventDefault();
|
|
663
989
|
}),
|
|
664
|
-
onInteractOutside: _[2] || (_[2] = (
|
|
665
|
-
s.value &&
|
|
990
|
+
onInteractOutside: _[2] || (_[2] = (U) => {
|
|
991
|
+
s.value && U.preventDefault();
|
|
666
992
|
}),
|
|
667
|
-
"onUpdate:open": _[3] || (_[3] = (
|
|
668
|
-
|
|
993
|
+
"onUpdate:open": _[3] || (_[3] = (U) => {
|
|
994
|
+
U || h();
|
|
669
995
|
})
|
|
670
996
|
}, {
|
|
671
997
|
footer: t(() => [
|
|
672
|
-
|
|
998
|
+
f(e(F), {
|
|
673
999
|
variant: "secondary",
|
|
674
1000
|
disabled: s.value,
|
|
675
1001
|
onClick: h
|
|
676
1002
|
}, {
|
|
677
1003
|
default: t(() => [
|
|
678
|
-
|
|
1004
|
+
k(l(v.value.cancel), 1)
|
|
679
1005
|
]),
|
|
680
1006
|
_: 1
|
|
681
1007
|
}, 8, ["disabled"]),
|
|
682
|
-
|
|
1008
|
+
f(e(F), {
|
|
683
1009
|
variant: "primary",
|
|
684
1010
|
disabled: !u.value || s.value || !!r.destination && r.mode !== "folder",
|
|
685
|
-
onClick:
|
|
1011
|
+
onClick: R
|
|
686
1012
|
}, {
|
|
687
1013
|
default: t(() => [
|
|
688
|
-
|
|
1014
|
+
k(l(v.value.confirm), 1)
|
|
689
1015
|
]),
|
|
690
1016
|
_: 1
|
|
691
1017
|
}, 8, ["disabled"])
|
|
692
1018
|
]),
|
|
693
1019
|
default: t(() => [
|
|
694
|
-
r.destination ? (n(),
|
|
695
|
-
|
|
1020
|
+
r.destination ? (n(), T("p", Tt, l(o.value.selection), 1)) : y("", !0),
|
|
1021
|
+
c.value ? (n(), g(e(G), {
|
|
696
1022
|
key: 1,
|
|
697
1023
|
tone: "danger",
|
|
698
1024
|
role: "alert",
|
|
699
1025
|
class: "save-message"
|
|
700
1026
|
}, {
|
|
701
1027
|
default: t(() => [
|
|
702
|
-
|
|
1028
|
+
k(l(r.errorText?.(c.value) ?? e(Ie)(c.value, o.value, "select")), 1)
|
|
703
1029
|
]),
|
|
704
1030
|
_: 1
|
|
705
|
-
})) :
|
|
706
|
-
|
|
1031
|
+
})) : y("", !0),
|
|
1032
|
+
z("div", {
|
|
707
1033
|
class: "nas-picker-content",
|
|
708
1034
|
"aria-busy": s.value,
|
|
709
1035
|
inert: s.value
|
|
710
1036
|
}, [
|
|
711
|
-
r.open ? (n(),
|
|
1037
|
+
r.open ? (n(), g(va, {
|
|
712
1038
|
key: 0,
|
|
713
1039
|
provider: r.provider,
|
|
714
1040
|
locale: r.locale,
|
|
715
1041
|
mode: r.mode,
|
|
716
|
-
onSelected: _[0] || (_[0] = (
|
|
717
|
-
}, null, 8, ["provider", "locale", "mode"])) :
|
|
718
|
-
], 8,
|
|
1042
|
+
onSelected: _[0] || (_[0] = (U) => u.value = U)
|
|
1043
|
+
}, null, 8, ["provider", "locale", "mode"])) : y("", !0)
|
|
1044
|
+
], 8, Ut)
|
|
719
1045
|
]),
|
|
720
1046
|
_: 1
|
|
721
1047
|
}, 8, ["open", "title", "description", "close-label", "show-close"]));
|
|
722
1048
|
}
|
|
723
|
-
}),
|
|
1049
|
+
}), Be = /* @__PURE__ */ re(Rt, [["__scopeId", "data-v-6ed8b8f6"]]), Dt = { role: "alert" }, Bt = { class: "files-actions" }, Ft = {
|
|
724
1050
|
key: 0,
|
|
725
1051
|
class: "files-path",
|
|
726
1052
|
role: "status"
|
|
727
|
-
},
|
|
1053
|
+
}, qt = /* @__PURE__ */ ie({
|
|
728
1054
|
__name: "FilesPage",
|
|
729
1055
|
props: {
|
|
730
1056
|
ctx: {}
|
|
731
1057
|
},
|
|
732
1058
|
setup(r) {
|
|
733
|
-
const
|
|
734
|
-
let
|
|
1059
|
+
const C = r, i = m(), a = m(!1), u = m("folder"), v = m(!1), o = m(""), s = m(0), c = la(C.ctx);
|
|
1060
|
+
let d = !1, p;
|
|
735
1061
|
async function h() {
|
|
736
|
-
if (!
|
|
737
|
-
|
|
1062
|
+
if (!d) {
|
|
1063
|
+
i.value = void 0, a.value = !1, o.value = "", v.value = !1, s.value++;
|
|
738
1064
|
try {
|
|
739
|
-
await
|
|
740
|
-
} catch (
|
|
741
|
-
!
|
|
1065
|
+
await C.ctx.call("nas.session.status"), d || (a.value = !0);
|
|
1066
|
+
} catch (R) {
|
|
1067
|
+
!d && R?.code !== "unknown_method" && (i.value = R);
|
|
742
1068
|
}
|
|
743
1069
|
}
|
|
744
1070
|
}
|
|
745
|
-
return
|
|
746
|
-
p =
|
|
1071
|
+
return pe(() => {
|
|
1072
|
+
p = C.ctx.reopen(() => {
|
|
747
1073
|
h();
|
|
748
1074
|
}), h();
|
|
749
|
-
}),
|
|
750
|
-
|
|
751
|
-
}), (
|
|
752
|
-
|
|
1075
|
+
}), ve(() => {
|
|
1076
|
+
d = !0, p?.(), c.dispose();
|
|
1077
|
+
}), (R, x) => (n(), T(oe, null, [
|
|
1078
|
+
i.value ? (n(), g(e(G), {
|
|
753
1079
|
key: 0,
|
|
754
1080
|
tone: "danger"
|
|
755
1081
|
}, {
|
|
756
1082
|
default: t(() => [
|
|
757
|
-
|
|
758
|
-
|
|
1083
|
+
z("span", Dt, l(e(aa)(i.value, e(ge)(r.ctx.locale))), 1),
|
|
1084
|
+
f(e(F), {
|
|
759
1085
|
variant: "secondary",
|
|
760
1086
|
onClick: h
|
|
761
1087
|
}, {
|
|
762
1088
|
default: t(() => [
|
|
763
|
-
|
|
1089
|
+
k(l(e(ge)(r.ctx.locale).refresh), 1)
|
|
764
1090
|
]),
|
|
765
1091
|
_: 1
|
|
766
1092
|
})
|
|
767
1093
|
]),
|
|
768
1094
|
_: 1
|
|
769
|
-
})) :
|
|
770
|
-
a.value ? (n(),
|
|
1095
|
+
})) : y("", !0),
|
|
1096
|
+
a.value ? (n(), g(e(_e), {
|
|
771
1097
|
key: 1,
|
|
772
|
-
title: e(
|
|
773
|
-
description: e(
|
|
1098
|
+
title: e(ge)(r.ctx.locale).title,
|
|
1099
|
+
description: e(ge)(r.ctx.locale).ownPermissions,
|
|
774
1100
|
collapsible: !1
|
|
775
1101
|
}, {
|
|
776
1102
|
default: t(() => [
|
|
777
|
-
|
|
778
|
-
|
|
1103
|
+
z("div", Bt, [
|
|
1104
|
+
f(e(F), {
|
|
779
1105
|
variant: "secondary",
|
|
780
|
-
onClick:
|
|
781
|
-
u.value = "folder",
|
|
1106
|
+
onClick: x[0] || (x[0] = (_) => {
|
|
1107
|
+
u.value = "folder", v.value = !0;
|
|
782
1108
|
})
|
|
783
1109
|
}, {
|
|
784
1110
|
default: t(() => [
|
|
785
|
-
|
|
1111
|
+
k(l(e(ge)(r.ctx.locale).choose), 1)
|
|
786
1112
|
]),
|
|
787
1113
|
_: 1
|
|
788
1114
|
}),
|
|
789
|
-
|
|
1115
|
+
f(e(F), {
|
|
790
1116
|
variant: "secondary",
|
|
791
|
-
onClick:
|
|
792
|
-
u.value = "file",
|
|
1117
|
+
onClick: x[1] || (x[1] = (_) => {
|
|
1118
|
+
u.value = "file", v.value = !0;
|
|
793
1119
|
})
|
|
794
1120
|
}, {
|
|
795
1121
|
default: t(() => [
|
|
796
|
-
|
|
1122
|
+
k(l(e(ge)(r.ctx.locale).chooseFile), 1)
|
|
797
1123
|
]),
|
|
798
1124
|
_: 1
|
|
799
1125
|
})
|
|
800
1126
|
]),
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
])) :
|
|
804
|
-
(n(),
|
|
1127
|
+
o.value ? (n(), T("p", Ft, [
|
|
1128
|
+
f(e(me), { path: o.value }, null, 8, ["path"])
|
|
1129
|
+
])) : y("", !0),
|
|
1130
|
+
(n(), g(va, {
|
|
805
1131
|
key: s.value,
|
|
806
|
-
provider: e(
|
|
1132
|
+
provider: e(c),
|
|
807
1133
|
locale: r.ctx.locale,
|
|
808
1134
|
transfers: ""
|
|
809
1135
|
}, null, 8, ["provider", "locale"])),
|
|
810
|
-
|
|
811
|
-
provider: e(
|
|
1136
|
+
f(Be, {
|
|
1137
|
+
provider: e(c),
|
|
812
1138
|
locale: r.ctx.locale,
|
|
813
1139
|
mode: u.value,
|
|
814
|
-
open:
|
|
815
|
-
"onUpdate:open":
|
|
816
|
-
onSelected:
|
|
1140
|
+
open: v.value,
|
|
1141
|
+
"onUpdate:open": x[2] || (x[2] = (_) => v.value = _),
|
|
1142
|
+
onSelected: x[3] || (x[3] = (_) => o.value = _)
|
|
817
1143
|
}, null, 8, ["provider", "locale", "mode", "open"])
|
|
818
1144
|
]),
|
|
819
1145
|
_: 1
|
|
820
|
-
}, 8, ["title", "description"])) :
|
|
1146
|
+
}, 8, ["title", "description"])) : y("", !0)
|
|
821
1147
|
], 64));
|
|
822
1148
|
}
|
|
823
|
-
}),
|
|
1149
|
+
}), gn = /* @__PURE__ */ re(qt, [["__scopeId", "data-v-15f9eb8e"]]), Nt = { role: "alert" }, Ot = 5e3, hn = /* @__PURE__ */ ie({
|
|
824
1150
|
__name: "PortalSettings",
|
|
825
1151
|
props: {
|
|
826
1152
|
portal: {}
|
|
827
1153
|
},
|
|
828
1154
|
setup(r) {
|
|
829
|
-
const
|
|
830
|
-
let
|
|
831
|
-
function
|
|
832
|
-
|
|
1155
|
+
const C = r, i = ra(), a = C.portal.messages, u = m(), v = m(""), o = m(!1), s = m("");
|
|
1156
|
+
let c = !1;
|
|
1157
|
+
function d(V) {
|
|
1158
|
+
c || (u.value = V, v.value = V.alias || V.defaultAlias);
|
|
833
1159
|
}
|
|
834
1160
|
const p = /* @__PURE__ */ Symbol("late");
|
|
835
|
-
async function h(
|
|
836
|
-
if (
|
|
837
|
-
|
|
838
|
-
const
|
|
1161
|
+
async function h(V) {
|
|
1162
|
+
if (o.value) return;
|
|
1163
|
+
o.value = !0, s.value = "";
|
|
1164
|
+
const P = V();
|
|
839
1165
|
try {
|
|
840
|
-
const
|
|
841
|
-
if (
|
|
842
|
-
|
|
1166
|
+
const A = await Promise.race([P, new Promise((K) => setTimeout(() => K(p), Ot))]);
|
|
1167
|
+
if (A !== p) {
|
|
1168
|
+
d(A);
|
|
843
1169
|
return;
|
|
844
1170
|
}
|
|
845
|
-
|
|
1171
|
+
d(await C.portal.status());
|
|
846
1172
|
try {
|
|
847
|
-
await
|
|
1173
|
+
await P;
|
|
848
1174
|
} finally {
|
|
849
|
-
|
|
1175
|
+
d(await C.portal.status());
|
|
850
1176
|
}
|
|
851
|
-
} catch (
|
|
852
|
-
|
|
1177
|
+
} catch (A) {
|
|
1178
|
+
c || (s.value = a[A?.code || ""] || a.portal_unavailable);
|
|
853
1179
|
} finally {
|
|
854
|
-
|
|
1180
|
+
c || (o.value = !1);
|
|
855
1181
|
}
|
|
856
1182
|
}
|
|
857
|
-
const
|
|
858
|
-
const
|
|
859
|
-
if (
|
|
860
|
-
if (
|
|
861
|
-
if (
|
|
862
|
-
return
|
|
1183
|
+
const R = I(() => !!u.value?.canManage && !!u.value.entry && u.value.entry !== "registered"), x = I(() => {
|
|
1184
|
+
const V = u.value;
|
|
1185
|
+
if (V) {
|
|
1186
|
+
if (R.value) return V.entry === "unregistered" ? a.entryOff : a.cleanupRequired;
|
|
1187
|
+
if (V.state !== "active")
|
|
1188
|
+
return V.canManage ? a.inactive : V.controlPanel ? void 0 : a.askAdmin;
|
|
863
1189
|
}
|
|
864
1190
|
}), _ = a.link?.replace(/\s*[::]\s*$/, "");
|
|
1191
|
+
async function U() {
|
|
1192
|
+
const V = await C.portal.register();
|
|
1193
|
+
return V.canManage && V.entry === "registered" && V.state === "inactive" ? (d(V), C.portal.apply(V.alias || V.defaultAlias)) : V;
|
|
1194
|
+
}
|
|
865
1195
|
function $() {
|
|
866
|
-
|
|
1196
|
+
o.value || C.portal.status().then(d, () => {
|
|
867
1197
|
});
|
|
868
1198
|
}
|
|
869
|
-
return
|
|
870
|
-
|
|
871
|
-
}),
|
|
872
|
-
|
|
873
|
-
}), (
|
|
1199
|
+
return pe(() => {
|
|
1200
|
+
i.subscribe?.($), $();
|
|
1201
|
+
}), ve(() => {
|
|
1202
|
+
c = !0;
|
|
1203
|
+
}), (V, P) => u.value ? (n(), g(e(_e), {
|
|
874
1204
|
key: 0,
|
|
875
1205
|
title: e(a).title,
|
|
876
|
-
description:
|
|
1206
|
+
description: x.value,
|
|
877
1207
|
collapsible: !1,
|
|
878
|
-
"aria-busy":
|
|
879
|
-
},
|
|
1208
|
+
"aria-busy": o.value
|
|
1209
|
+
}, Ke({
|
|
880
1210
|
default: t(() => [
|
|
881
|
-
u.value.state === "active" ? (n(),
|
|
1211
|
+
u.value.state === "active" ? (n(), g(e(Ee), {
|
|
882
1212
|
key: 0,
|
|
883
1213
|
label: e(_)
|
|
884
1214
|
}, {
|
|
885
1215
|
default: t(() => [
|
|
886
|
-
|
|
1216
|
+
f(e(ua), {
|
|
887
1217
|
href: u.value.url,
|
|
888
1218
|
external: ""
|
|
889
1219
|
}, {
|
|
890
1220
|
default: t(() => [
|
|
891
|
-
|
|
1221
|
+
k(l(u.value.url), 1)
|
|
892
1222
|
]),
|
|
893
1223
|
_: 1
|
|
894
1224
|
}, 8, ["href"])
|
|
895
1225
|
]),
|
|
896
1226
|
_: 1
|
|
897
|
-
}, 8, ["label"])) :
|
|
898
|
-
u.value.canManage && !
|
|
1227
|
+
}, 8, ["label"])) : y("", !0),
|
|
1228
|
+
u.value.canManage && !R.value ? (n(), g(e(Pe), {
|
|
899
1229
|
key: 1,
|
|
900
|
-
onSubmit:
|
|
1230
|
+
onSubmit: P[4] || (P[4] = ze((A) => h(() => r.portal.apply(v.value)), ["prevent"]))
|
|
901
1231
|
}, {
|
|
902
1232
|
default: t(() => [
|
|
903
|
-
|
|
1233
|
+
f(e(Ee), {
|
|
904
1234
|
label: e(a).alias
|
|
905
1235
|
}, {
|
|
906
1236
|
default: t(() => [
|
|
907
|
-
|
|
1237
|
+
f(e(xe), {
|
|
908
1238
|
id: "portal-alias",
|
|
909
|
-
modelValue:
|
|
910
|
-
"onUpdate:modelValue":
|
|
1239
|
+
modelValue: v.value,
|
|
1240
|
+
"onUpdate:modelValue": P[0] || (P[0] = (A) => v.value = A),
|
|
911
1241
|
"aria-label": e(a).alias,
|
|
912
1242
|
maxlength: "64",
|
|
913
1243
|
autocomplete: "off",
|
|
914
|
-
disabled:
|
|
1244
|
+
disabled: o.value
|
|
915
1245
|
}, null, 8, ["modelValue", "aria-label", "disabled"])
|
|
916
1246
|
]),
|
|
917
1247
|
_: 1
|
|
918
1248
|
}, 8, ["label"]),
|
|
919
|
-
|
|
1249
|
+
f(e(Ee), {
|
|
920
1250
|
label: "",
|
|
921
1251
|
"field-width": "full"
|
|
922
1252
|
}, {
|
|
923
1253
|
default: t(() => [
|
|
924
|
-
|
|
1254
|
+
f(e(Ve), null, {
|
|
925
1255
|
default: t(() => [
|
|
926
|
-
|
|
1256
|
+
f(e(F), {
|
|
927
1257
|
type: "submit",
|
|
928
1258
|
variant: "primary",
|
|
929
|
-
disabled:
|
|
1259
|
+
disabled: o.value
|
|
930
1260
|
}, {
|
|
931
1261
|
default: t(() => [
|
|
932
|
-
|
|
1262
|
+
k(l(e(a).apply), 1)
|
|
933
1263
|
]),
|
|
934
1264
|
_: 1
|
|
935
1265
|
}, 8, ["disabled"]),
|
|
936
|
-
u.value.state === "active" ? (n(),
|
|
1266
|
+
u.value.state === "active" ? (n(), g(e(F), {
|
|
937
1267
|
key: 0,
|
|
938
1268
|
variant: "secondary",
|
|
939
|
-
disabled:
|
|
940
|
-
onClick:
|
|
1269
|
+
disabled: o.value,
|
|
1270
|
+
onClick: P[1] || (P[1] = (A) => h(() => r.portal.disable()))
|
|
941
1271
|
}, {
|
|
942
1272
|
default: t(() => [
|
|
943
|
-
|
|
1273
|
+
k(l(e(a).disable), 1)
|
|
944
1274
|
]),
|
|
945
1275
|
_: 1
|
|
946
|
-
}, 8, ["disabled"])) :
|
|
947
|
-
|
|
1276
|
+
}, 8, ["disabled"])) : y("", !0),
|
|
1277
|
+
f(e(F), {
|
|
948
1278
|
variant: "secondary",
|
|
949
|
-
onClick:
|
|
1279
|
+
onClick: P[2] || (P[2] = (A) => r.portal.openControlPanel())
|
|
950
1280
|
}, {
|
|
951
1281
|
default: t(() => [
|
|
952
|
-
|
|
1282
|
+
k(l(e(a).advanced), 1)
|
|
953
1283
|
]),
|
|
954
1284
|
_: 1
|
|
955
1285
|
}),
|
|
956
|
-
u.value.entry ? (n(),
|
|
1286
|
+
u.value.entry ? (n(), g(e(F), {
|
|
957
1287
|
key: 1,
|
|
958
1288
|
variant: "secondary",
|
|
959
|
-
disabled:
|
|
960
|
-
onClick:
|
|
1289
|
+
disabled: o.value,
|
|
1290
|
+
onClick: P[3] || (P[3] = (A) => h(() => r.portal.unregister()))
|
|
961
1291
|
}, {
|
|
962
1292
|
default: t(() => [
|
|
963
|
-
|
|
1293
|
+
k(l(e(a).unregister), 1)
|
|
964
1294
|
]),
|
|
965
1295
|
_: 1
|
|
966
|
-
}, 8, ["disabled"])) :
|
|
1296
|
+
}, 8, ["disabled"])) : y("", !0)
|
|
967
1297
|
]),
|
|
968
1298
|
_: 1
|
|
969
1299
|
})
|
|
@@ -972,40 +1302,40 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
972
1302
|
})
|
|
973
1303
|
]),
|
|
974
1304
|
_: 1
|
|
975
|
-
})) :
|
|
976
|
-
s.value ? (n(),
|
|
1305
|
+
})) : y("", !0),
|
|
1306
|
+
s.value ? (n(), g(e(G), {
|
|
977
1307
|
key: 2,
|
|
978
1308
|
tone: "danger"
|
|
979
1309
|
}, {
|
|
980
1310
|
default: t(() => [
|
|
981
|
-
|
|
1311
|
+
z("span", Nt, l(s.value), 1)
|
|
982
1312
|
]),
|
|
983
1313
|
_: 1
|
|
984
|
-
})) :
|
|
1314
|
+
})) : y("", !0)
|
|
985
1315
|
]),
|
|
986
1316
|
_: 2
|
|
987
1317
|
}, [
|
|
988
|
-
|
|
1318
|
+
R.value ? {
|
|
989
1319
|
name: "footer",
|
|
990
1320
|
fn: t(() => [
|
|
991
|
-
u.value.entry === "unregistered" ? (n(),
|
|
1321
|
+
u.value.entry === "unregistered" ? (n(), g(e(F), {
|
|
992
1322
|
key: 0,
|
|
993
1323
|
variant: "primary",
|
|
994
|
-
disabled:
|
|
995
|
-
onClick:
|
|
1324
|
+
disabled: o.value,
|
|
1325
|
+
onClick: P[5] || (P[5] = (A) => h(U))
|
|
996
1326
|
}, {
|
|
997
1327
|
default: t(() => [
|
|
998
|
-
|
|
1328
|
+
k(l(e(a).register), 1)
|
|
999
1329
|
]),
|
|
1000
1330
|
_: 1
|
|
1001
|
-
}, 8, ["disabled"])) : (n(),
|
|
1331
|
+
}, 8, ["disabled"])) : (n(), g(e(F), {
|
|
1002
1332
|
key: 1,
|
|
1003
1333
|
variant: "primary",
|
|
1004
|
-
disabled:
|
|
1005
|
-
onClick:
|
|
1334
|
+
disabled: o.value,
|
|
1335
|
+
onClick: P[6] || (P[6] = (A) => h(() => r.portal.unregister()))
|
|
1006
1336
|
}, {
|
|
1007
1337
|
default: t(() => [
|
|
1008
|
-
|
|
1338
|
+
k(l(e(a).unregister), 1)
|
|
1009
1339
|
]),
|
|
1010
1340
|
_: 1
|
|
1011
1341
|
}, 8, ["disabled"]))
|
|
@@ -1014,127 +1344,127 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
1014
1344
|
} : !u.value.canManage && u.value.controlPanel ? {
|
|
1015
1345
|
name: "footer",
|
|
1016
1346
|
fn: t(() => [
|
|
1017
|
-
|
|
1347
|
+
f(e(F), {
|
|
1018
1348
|
variant: "secondary",
|
|
1019
|
-
onClick:
|
|
1349
|
+
onClick: P[7] || (P[7] = (A) => r.portal.openControlPanel())
|
|
1020
1350
|
}, {
|
|
1021
1351
|
default: t(() => [
|
|
1022
|
-
|
|
1352
|
+
k(l(e(a).controlPanel), 1)
|
|
1023
1353
|
]),
|
|
1024
1354
|
_: 1
|
|
1025
1355
|
})
|
|
1026
1356
|
]),
|
|
1027
1357
|
key: "1"
|
|
1028
1358
|
} : void 0
|
|
1029
|
-
]), 1032, ["title", "description", "aria-busy"])) :
|
|
1359
|
+
]), 1032, ["title", "description", "aria-busy"])) : y("", !0);
|
|
1030
1360
|
}
|
|
1031
|
-
}),
|
|
1361
|
+
}), Lt = ["aria-busy"], Mt = {
|
|
1032
1362
|
key: 1,
|
|
1033
1363
|
role: "status"
|
|
1034
|
-
},
|
|
1364
|
+
}, Kt = { role: "alert" }, Ht = { role: "status" }, Gt = /* @__PURE__ */ ie({
|
|
1035
1365
|
__name: "LoginPage",
|
|
1036
1366
|
props: {
|
|
1037
1367
|
session: {},
|
|
1038
1368
|
locale: {}
|
|
1039
1369
|
},
|
|
1040
1370
|
setup(r) {
|
|
1041
|
-
const
|
|
1371
|
+
const C = r, i = I(() => ya(C.locale)), a = m(""), u = m(""), v = m(""), o = m(!1), s = m(!1), c = m(""), d = m(), p = I(() => window.location.protocol === "https:");
|
|
1042
1372
|
let h = !1;
|
|
1043
|
-
function
|
|
1044
|
-
const V =
|
|
1045
|
-
return
|
|
1373
|
+
function R($) {
|
|
1374
|
+
const V = $?.code;
|
|
1375
|
+
return i.value.errors[V || ""] || i.value.errors.failed;
|
|
1046
1376
|
}
|
|
1047
|
-
async function
|
|
1048
|
-
if (!(s.value || !p.value || !a.value || !u.value ||
|
|
1049
|
-
s.value = !0,
|
|
1377
|
+
async function x() {
|
|
1378
|
+
if (!(s.value || !p.value || !a.value || !u.value || o.value && !v.value)) {
|
|
1379
|
+
s.value = !0, c.value = "";
|
|
1050
1380
|
try {
|
|
1051
|
-
await
|
|
1052
|
-
} catch (
|
|
1381
|
+
await C.session.login(a.value, u.value, v.value), u.value = "", v.value = "";
|
|
1382
|
+
} catch ($) {
|
|
1053
1383
|
if (h) return;
|
|
1054
|
-
|
|
1384
|
+
v.value = "", $?.code === "otp_required" ? o.value = !0 : (c.value = R($), u.value = "", o.value = !1);
|
|
1055
1385
|
} finally {
|
|
1056
|
-
h || (s.value = !1,
|
|
1386
|
+
h || (s.value = !1, o.value && (await Aa(), h || d.value?.querySelector("input")?.focus()));
|
|
1057
1387
|
}
|
|
1058
1388
|
}
|
|
1059
1389
|
}
|
|
1060
1390
|
async function _() {
|
|
1061
1391
|
if (!s.value) {
|
|
1062
|
-
s.value = !0,
|
|
1392
|
+
s.value = !0, c.value = "";
|
|
1063
1393
|
try {
|
|
1064
|
-
await
|
|
1065
|
-
} catch (
|
|
1066
|
-
h || (
|
|
1394
|
+
await C.session.bootstrap();
|
|
1395
|
+
} catch ($) {
|
|
1396
|
+
h || (c.value = R($));
|
|
1067
1397
|
} finally {
|
|
1068
1398
|
h || (s.value = !1);
|
|
1069
1399
|
}
|
|
1070
1400
|
}
|
|
1071
1401
|
}
|
|
1072
|
-
function
|
|
1073
|
-
u.value = "",
|
|
1402
|
+
function U() {
|
|
1403
|
+
u.value = "", v.value = "", o.value = !1, c.value = "";
|
|
1074
1404
|
}
|
|
1075
|
-
return
|
|
1076
|
-
h = !0, u.value = "",
|
|
1077
|
-
}), (
|
|
1405
|
+
return oa(() => {
|
|
1406
|
+
h = !0, u.value = "", v.value = "";
|
|
1407
|
+
}), ($, V) => (n(), T("main", {
|
|
1078
1408
|
class: "identity-login",
|
|
1079
1409
|
"aria-busy": s.value
|
|
1080
1410
|
}, [
|
|
1081
|
-
|
|
1082
|
-
title:
|
|
1083
|
-
description:
|
|
1411
|
+
f(e(_e), {
|
|
1412
|
+
title: i.value.title,
|
|
1413
|
+
description: i.value.intro,
|
|
1084
1414
|
collapsible: !1
|
|
1085
1415
|
}, {
|
|
1086
1416
|
default: t(() => [
|
|
1087
|
-
p.value ?
|
|
1417
|
+
p.value ? y("", !0) : (n(), g(e(G), {
|
|
1088
1418
|
key: 0,
|
|
1089
1419
|
tone: "warning",
|
|
1090
|
-
title:
|
|
1420
|
+
title: i.value.httpsTitle
|
|
1091
1421
|
}, {
|
|
1092
1422
|
default: t(() => [
|
|
1093
|
-
|
|
1423
|
+
k(l(i.value.errors.https_required), 1)
|
|
1094
1424
|
]),
|
|
1095
1425
|
_: 1
|
|
1096
1426
|
}, 8, ["title"])),
|
|
1097
|
-
r.session.notice.value ? (n(),
|
|
1098
|
-
|
|
1427
|
+
r.session.notice.value ? (n(), T("p", Mt, l(i.value.notices[r.session.notice.value]), 1)) : y("", !0),
|
|
1428
|
+
c.value ? (n(), g(e(G), {
|
|
1099
1429
|
key: 2,
|
|
1100
1430
|
tone: "danger",
|
|
1101
|
-
title:
|
|
1431
|
+
title: i.value.failedTitle
|
|
1102
1432
|
}, {
|
|
1103
1433
|
default: t(() => [
|
|
1104
|
-
|
|
1434
|
+
z("span", Kt, l(c.value), 1)
|
|
1105
1435
|
]),
|
|
1106
1436
|
_: 1
|
|
1107
|
-
}, 8, ["title"])) :
|
|
1108
|
-
|
|
1109
|
-
onSubmit: ze(
|
|
1437
|
+
}, 8, ["title"])) : y("", !0),
|
|
1438
|
+
f(e(Pe), {
|
|
1439
|
+
onSubmit: ze(x, ["prevent"])
|
|
1110
1440
|
}, {
|
|
1111
1441
|
default: t(() => [
|
|
1112
|
-
|
|
1113
|
-
label:
|
|
1442
|
+
f(e(ke), {
|
|
1443
|
+
label: i.value.account
|
|
1114
1444
|
}, {
|
|
1115
1445
|
default: t(() => [
|
|
1116
|
-
|
|
1446
|
+
f(e(xe), {
|
|
1117
1447
|
modelValue: a.value,
|
|
1118
|
-
"onUpdate:modelValue": V[0] || (V[0] = (
|
|
1448
|
+
"onUpdate:modelValue": V[0] || (V[0] = (P) => a.value = P),
|
|
1119
1449
|
autocomplete: "username",
|
|
1120
|
-
disabled: s.value ||
|
|
1450
|
+
disabled: s.value || o.value || !p.value
|
|
1121
1451
|
}, null, 8, ["modelValue", "disabled"])
|
|
1122
1452
|
]),
|
|
1123
1453
|
_: 1
|
|
1124
1454
|
}, 8, ["label"]),
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1455
|
+
o.value ? (n(), T(oe, { key: 1 }, [
|
|
1456
|
+
z("p", Ht, l(i.value.otpPrompt), 1),
|
|
1457
|
+
z("div", {
|
|
1128
1458
|
ref_key: "otpField",
|
|
1129
|
-
ref:
|
|
1459
|
+
ref: d
|
|
1130
1460
|
}, [
|
|
1131
|
-
|
|
1132
|
-
label:
|
|
1461
|
+
f(e(ke), {
|
|
1462
|
+
label: i.value.otp
|
|
1133
1463
|
}, {
|
|
1134
1464
|
default: t(() => [
|
|
1135
|
-
|
|
1136
|
-
modelValue:
|
|
1137
|
-
"onUpdate:modelValue": V[2] || (V[2] = (
|
|
1465
|
+
f(e(xe), {
|
|
1466
|
+
modelValue: v.value,
|
|
1467
|
+
"onUpdate:modelValue": V[2] || (V[2] = (P) => v.value = P),
|
|
1138
1468
|
inputmode: "numeric",
|
|
1139
1469
|
autocomplete: "one-time-code",
|
|
1140
1470
|
disabled: s.value
|
|
@@ -1143,14 +1473,14 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
1143
1473
|
_: 1
|
|
1144
1474
|
}, 8, ["label"])
|
|
1145
1475
|
], 512)
|
|
1146
|
-
], 64)) : (n(),
|
|
1476
|
+
], 64)) : (n(), g(e(ke), {
|
|
1147
1477
|
key: 0,
|
|
1148
|
-
label:
|
|
1478
|
+
label: i.value.password
|
|
1149
1479
|
}, {
|
|
1150
1480
|
default: t(() => [
|
|
1151
|
-
|
|
1481
|
+
f(e(xe), {
|
|
1152
1482
|
modelValue: u.value,
|
|
1153
|
-
"onUpdate:modelValue": V[1] || (V[1] = (
|
|
1483
|
+
"onUpdate:modelValue": V[1] || (V[1] = (P) => u.value = P),
|
|
1154
1484
|
type: "password",
|
|
1155
1485
|
autocomplete: "current-password",
|
|
1156
1486
|
disabled: s.value || !p.value
|
|
@@ -1158,36 +1488,36 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
1158
1488
|
]),
|
|
1159
1489
|
_: 1
|
|
1160
1490
|
}, 8, ["label"])),
|
|
1161
|
-
|
|
1491
|
+
f(e(Ve), null, {
|
|
1162
1492
|
default: t(() => [
|
|
1163
|
-
|
|
1493
|
+
f(e(F), {
|
|
1164
1494
|
type: "submit",
|
|
1165
1495
|
variant: "primary",
|
|
1166
|
-
disabled: s.value || !p.value || !a.value || !u.value ||
|
|
1496
|
+
disabled: s.value || !p.value || !a.value || !u.value || o.value && !v.value
|
|
1167
1497
|
}, {
|
|
1168
1498
|
default: t(() => [
|
|
1169
|
-
|
|
1499
|
+
k(l(s.value ? i.value.signingIn : o.value ? i.value.verify : i.value.signIn), 1)
|
|
1170
1500
|
]),
|
|
1171
1501
|
_: 1
|
|
1172
1502
|
}, 8, ["disabled"]),
|
|
1173
|
-
|
|
1503
|
+
o.value ? (n(), g(e(F), {
|
|
1174
1504
|
key: 0,
|
|
1175
1505
|
variant: "secondary",
|
|
1176
1506
|
disabled: s.value,
|
|
1177
|
-
onClick:
|
|
1507
|
+
onClick: U
|
|
1178
1508
|
}, {
|
|
1179
1509
|
default: t(() => [
|
|
1180
|
-
|
|
1510
|
+
k(l(i.value.otherAccount), 1)
|
|
1181
1511
|
]),
|
|
1182
1512
|
_: 1
|
|
1183
|
-
}, 8, ["disabled"])) : (n(),
|
|
1513
|
+
}, 8, ["disabled"])) : (n(), g(e(F), {
|
|
1184
1514
|
key: 1,
|
|
1185
1515
|
variant: "secondary",
|
|
1186
1516
|
disabled: s.value || !p.value,
|
|
1187
1517
|
onClick: _
|
|
1188
1518
|
}, {
|
|
1189
1519
|
default: t(() => [
|
|
1190
|
-
|
|
1520
|
+
k(l(i.value.continueDSM), 1)
|
|
1191
1521
|
]),
|
|
1192
1522
|
_: 1
|
|
1193
1523
|
}, 8, ["disabled"]))
|
|
@@ -1200,231 +1530,231 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
1200
1530
|
]),
|
|
1201
1531
|
_: 1
|
|
1202
1532
|
}, 8, ["title", "description"])
|
|
1203
|
-
], 8,
|
|
1533
|
+
], 8, Lt));
|
|
1204
1534
|
}
|
|
1205
|
-
}),
|
|
1535
|
+
}), kn = /* @__PURE__ */ re(Gt, [["__scopeId", "data-v-1c0358cd"]]), Jt = { role: "status" }, Wt = { class: "integration-help" }, Xt = { class: "integration-help" }, Qt = { class: "integration-help" }, Yt = { class: "integration-actions" }, Zt = {
|
|
1206
1536
|
key: 0,
|
|
1207
1537
|
role: "status",
|
|
1208
1538
|
"data-bg-picked": "",
|
|
1209
1539
|
class: "bg-path"
|
|
1210
|
-
},
|
|
1540
|
+
}, jt = { class: "integration-actions" }, el = { key: 2 }, al = {
|
|
1211
1541
|
key: 3,
|
|
1212
1542
|
class: "bg-cards"
|
|
1213
|
-
},
|
|
1543
|
+
}, tl = { class: "bg-card-body" }, ll = {
|
|
1214
1544
|
key: 0,
|
|
1215
1545
|
class: "integration-help"
|
|
1216
|
-
},
|
|
1546
|
+
}, nl = {
|
|
1217
1547
|
key: 1,
|
|
1218
1548
|
class: "integration-help"
|
|
1219
|
-
},
|
|
1549
|
+
}, sl = {
|
|
1220
1550
|
key: 2,
|
|
1221
1551
|
class: "integration-help bg-path"
|
|
1222
|
-
},
|
|
1552
|
+
}, ol = {
|
|
1223
1553
|
key: 3,
|
|
1224
1554
|
class: "integration-help"
|
|
1225
|
-
},
|
|
1555
|
+
}, il = {
|
|
1226
1556
|
key: 4,
|
|
1227
1557
|
class: "integration-help"
|
|
1228
|
-
},
|
|
1558
|
+
}, ul = { class: "integration-actions" }, rl = ["aria-label"], dl = { class: "integration-help" }, cl = { key: 1 }, vl = {
|
|
1229
1559
|
key: 2,
|
|
1230
1560
|
class: "bg-cards"
|
|
1231
|
-
},
|
|
1561
|
+
}, pl = { class: "bg-card-body" }, fl = {
|
|
1232
1562
|
key: 0,
|
|
1233
1563
|
class: "integration-help"
|
|
1234
|
-
},
|
|
1564
|
+
}, yl = {
|
|
1235
1565
|
key: 1,
|
|
1236
1566
|
class: "integration-help"
|
|
1237
|
-
},
|
|
1567
|
+
}, ml = { class: "integration-help" }, bl = { class: "integration-actions" }, gl = { class: "integration-actions" }, hl = { class: "integration-actions" }, kl = /* @__PURE__ */ ie({
|
|
1238
1568
|
__name: "BackgroundPanel",
|
|
1239
1569
|
props: {
|
|
1240
1570
|
ctx: {}
|
|
1241
1571
|
},
|
|
1242
|
-
setup(r, { expose:
|
|
1243
|
-
const
|
|
1244
|
-
let
|
|
1245
|
-
const j = (
|
|
1246
|
-
async function
|
|
1572
|
+
setup(r, { expose: C }) {
|
|
1573
|
+
const i = r, a = I(() => ma(i.ctx.locale)), u = (b, L) => Oe(b, L, i.ctx.locale), v = m(), o = m([]), s = m(), c = m(!1), d = m(!1), p = m([]), h = m(), R = m(!1), x = m("3600"), _ = m(), U = m(), $ = m(), V = m(!1), P = m(!1), A = m(), K = m(""), Q = m(""), Y = ba(i.ctx);
|
|
1574
|
+
let X, J = !1;
|
|
1575
|
+
const j = (b) => !["queued", "running"].includes(b.state), ee = (b) => j(b) && b.state !== "paused", se = (b) => b.state === "running" && b.pauseRequested, te = (b) => se(b) ? a.value.pausing : a.value[`state_${b.state}`], ne = (b) => se(b) ? "warning" : { queued: "info", running: "info", paused: "warning", succeeded: "success", failed: "danger", canceled: "neutral", interrupted: "danger" }[b.state];
|
|
1576
|
+
async function H(b, L) {
|
|
1247
1577
|
try {
|
|
1248
|
-
return await
|
|
1578
|
+
return await i.ctx.call(b, L);
|
|
1249
1579
|
} catch (w) {
|
|
1250
|
-
if (
|
|
1251
|
-
w?.code === "unsupported" ? (
|
|
1580
|
+
if (J) return;
|
|
1581
|
+
w?.code === "unsupported" ? (c.value = !0, o.value = [], p.value = [], h.value = void 0, _.value = void 0, U.value = void 0, v.value = void 0, $.value = void 0, A.value = void 0, K.value && URL.revokeObjectURL(K.value), K.value = "") : J || (s.value = w);
|
|
1252
1582
|
return;
|
|
1253
1583
|
}
|
|
1254
1584
|
}
|
|
1255
|
-
async function
|
|
1256
|
-
if (!(
|
|
1585
|
+
async function W() {
|
|
1586
|
+
if (!(J || V.value)) {
|
|
1257
1587
|
V.value = !0;
|
|
1258
1588
|
try {
|
|
1259
|
-
const
|
|
1260
|
-
if (!
|
|
1261
|
-
if (!
|
|
1589
|
+
const b = await H("bg.status");
|
|
1590
|
+
if (!b || J) return;
|
|
1591
|
+
if (!b.limits || typeof b.admin != "boolean") {
|
|
1262
1592
|
s.value = { code: "unavailable" };
|
|
1263
1593
|
return;
|
|
1264
1594
|
}
|
|
1265
|
-
|
|
1266
|
-
const
|
|
1267
|
-
|
|
1268
|
-
const w = await
|
|
1269
|
-
w && !
|
|
1595
|
+
c.value = !1, v.value = b;
|
|
1596
|
+
const L = await H("bg.jobs.list");
|
|
1597
|
+
L && !J && (o.value = L.jobs ?? []);
|
|
1598
|
+
const w = await H("bg.schedules.list");
|
|
1599
|
+
w && !J && (p.value = w.schedules ?? []), !J && o.value.every(j) && p.value.every((de) => !de.enabled) && X && (clearInterval(X), X = void 0);
|
|
1270
1600
|
} finally {
|
|
1271
1601
|
V.value = !1;
|
|
1272
1602
|
}
|
|
1273
1603
|
}
|
|
1274
1604
|
}
|
|
1275
|
-
function
|
|
1276
|
-
|
|
1277
|
-
|
|
1605
|
+
function q() {
|
|
1606
|
+
X || (X = setInterval(() => {
|
|
1607
|
+
W();
|
|
1278
1608
|
}, 3e3));
|
|
1279
1609
|
}
|
|
1280
|
-
async function
|
|
1281
|
-
if (!
|
|
1282
|
-
|
|
1610
|
+
async function B(b) {
|
|
1611
|
+
if (!d.value) {
|
|
1612
|
+
d.value = !0, s.value = void 0;
|
|
1283
1613
|
try {
|
|
1284
|
-
await
|
|
1614
|
+
await b(), await W(), (p.value.some((L) => L.enabled) || o.value.some((L) => !j(L))) && q();
|
|
1285
1615
|
} finally {
|
|
1286
|
-
|
|
1616
|
+
J || (d.value = !1);
|
|
1287
1617
|
}
|
|
1288
1618
|
}
|
|
1289
1619
|
}
|
|
1290
|
-
const
|
|
1291
|
-
if (!x.value) return;
|
|
1292
|
-
await G("bg.jobs.purge", { owner: x.value }) && (x.value = void 0);
|
|
1293
|
-
}), J = D(() => [{ value: "3600", label: a.value.hourly }, { value: "86400", label: a.value.daily }, { value: "604800", label: a.value.weekly }]), ue = (f) => {
|
|
1294
|
-
h.value = f, E.value = !1, z.value = "3600";
|
|
1295
|
-
}, xe = () => U(async () => {
|
|
1296
|
-
if (!h.value || !E.value) return;
|
|
1297
|
-
await G("bg.schedules.create", { key: Ne(), jobId: h.value.id, intervalSeconds: Number(z.value), consent: !0 }) && (h.value = void 0);
|
|
1298
|
-
}), Ce = (f) => U(() => G("bg.schedules.disable", { id: f })), ve = () => U(async () => {
|
|
1299
|
-
if (!_.value) return;
|
|
1300
|
-
await G("bg.schedules.delete", { id: _.value.id }) && (_.value = void 0);
|
|
1301
|
-
}), ce = () => U(async () => {
|
|
1620
|
+
const O = () => B(async () => {
|
|
1302
1621
|
if (!$.value) return;
|
|
1303
|
-
await
|
|
1304
|
-
}),
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1622
|
+
await H("bg.jobs.purge", { owner: $.value }) && ($.value = void 0);
|
|
1623
|
+
}), Z = I(() => [{ value: "3600", label: a.value.hourly }, { value: "86400", label: a.value.daily }, { value: "604800", label: a.value.weekly }]), ae = (b) => {
|
|
1624
|
+
h.value = b, R.value = !1, x.value = "3600";
|
|
1625
|
+
}, ue = () => B(async () => {
|
|
1626
|
+
if (!h.value || !R.value) return;
|
|
1627
|
+
await H("bg.schedules.create", { key: He(), jobId: h.value.id, intervalSeconds: Number(x.value), consent: !0 }) && (h.value = void 0);
|
|
1628
|
+
}), Ce = (b) => B(() => H("bg.schedules.disable", { id: b })), fe = () => B(async () => {
|
|
1629
|
+
if (!_.value) return;
|
|
1630
|
+
await H("bg.schedules.delete", { id: _.value.id }) && (_.value = void 0);
|
|
1631
|
+
}), ye = () => B(async () => {
|
|
1632
|
+
if (!U.value) return;
|
|
1633
|
+
await H("bg.schedules.enable", { id: U.value.id, consent: !0 }) && (U.value = void 0);
|
|
1634
|
+
}), ce = (b) => {
|
|
1635
|
+
const L = new Date(b);
|
|
1636
|
+
return Number.isFinite(L.getTime()) ? L.toLocaleString() : a.value.unknownTime;
|
|
1637
|
+
}, be = (b) => b.copyRetained && b.state === "succeeded" && !b.scheduleId && b.submitter?.user === v.value?.owner?.user && b.submitter?.uid === v.value?.owner?.uid, M = (b) => B(() => H("bg.jobs.cancel", { id: b })), le = (b) => B(() => H("bg.jobs.pause", { id: b })), N = (b) => B(() => H("bg.jobs.resume", { id: b })), S = (b) => {
|
|
1638
|
+
const L = b.lastIndexOf("/");
|
|
1639
|
+
A.value = { folder: b.slice(0, L), relative: b.slice(L + 1) };
|
|
1640
|
+
}, E = () => B(async () => {
|
|
1641
|
+
if (!A.value) return;
|
|
1642
|
+
await H("bg.jobs.submit", { key: He(), ...A.value }) && (A.value = void 0);
|
|
1313
1643
|
});
|
|
1314
|
-
async function
|
|
1315
|
-
const
|
|
1316
|
-
!
|
|
1644
|
+
async function D(b) {
|
|
1645
|
+
const L = await H("bg.jobs.result", { id: b.id });
|
|
1646
|
+
!L || J || (K.value && URL.revokeObjectURL(K.value), K.value = URL.createObjectURL(new Blob([JSON.stringify(L.result, null, 2)], { type: "application/json" })), Q.value = `${b.name || b.id}.sha256.json`);
|
|
1317
1647
|
}
|
|
1318
|
-
return
|
|
1319
|
-
|
|
1320
|
-
(p.value.some((
|
|
1648
|
+
return C({ refresh: W }), pe(() => {
|
|
1649
|
+
W().then(() => {
|
|
1650
|
+
(p.value.some((b) => b.enabled) || o.value.some((b) => !j(b))) && q();
|
|
1321
1651
|
});
|
|
1322
|
-
}),
|
|
1323
|
-
|
|
1324
|
-
}), (
|
|
1325
|
-
"aria-busy":
|
|
1652
|
+
}), ve(() => {
|
|
1653
|
+
J = !0, Y.dispose(), X && clearInterval(X), K.value && URL.revokeObjectURL(K.value);
|
|
1654
|
+
}), (b, L) => (n(), g(e(_e), {
|
|
1655
|
+
"aria-busy": d.value || V.value,
|
|
1326
1656
|
title: a.value.title,
|
|
1327
|
-
description:
|
|
1328
|
-
loading: !
|
|
1657
|
+
description: c.value ? void 0 : a.value.help,
|
|
1658
|
+
loading: !v.value && !s.value && !c.value,
|
|
1329
1659
|
collapsible: !1,
|
|
1330
1660
|
"data-background-panel": ""
|
|
1331
1661
|
}, {
|
|
1332
1662
|
default: t(() => [
|
|
1333
|
-
|
|
1663
|
+
c.value ? (n(), g(e(G), {
|
|
1334
1664
|
key: 0,
|
|
1335
1665
|
tone: "warning"
|
|
1336
1666
|
}, {
|
|
1337
1667
|
default: t(() => [
|
|
1338
|
-
|
|
1668
|
+
k(l(a.value.unsupported), 1)
|
|
1339
1669
|
]),
|
|
1340
1670
|
_: 1
|
|
1341
|
-
})) : (n(),
|
|
1342
|
-
s.value ? (n(),
|
|
1671
|
+
})) : (n(), T(oe, { key: 1 }, [
|
|
1672
|
+
s.value ? (n(), g(e(G), {
|
|
1343
1673
|
key: 0,
|
|
1344
1674
|
tone: "danger",
|
|
1345
1675
|
role: "alert"
|
|
1346
1676
|
}, {
|
|
1347
1677
|
default: t(() => [
|
|
1348
|
-
|
|
1678
|
+
k(l(e(ga)(s.value, a.value)), 1)
|
|
1349
1679
|
]),
|
|
1350
1680
|
_: 1
|
|
1351
|
-
})) :
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1681
|
+
})) : y("", !0),
|
|
1682
|
+
v.value ? (n(), T(oe, { key: 1 }, [
|
|
1683
|
+
z("p", Jt, l(v.value.worker?.alive ? u(a.value.workerRunning, { user: v.value.worker.username }) : a.value.workerStopped), 1),
|
|
1684
|
+
z("p", Wt, l(u(a.value.limits, { size: v.value.limits.maxInputBytes / 1024, queue: v.value.limits.maxQueued, seconds: v.value.limits.jobTimeoutSeconds })), 1),
|
|
1685
|
+
z("p", Xt, l(v.value.admin ? a.value.adminScope : a.value.ownerScope), 1),
|
|
1686
|
+
z("p", Qt, l(u(a.value.ownerLimits, { jobs: v.value.limits.maxOwnerPending, size: v.value.limits.maxOwnerBytes / 1024 })), 1),
|
|
1687
|
+
z("div", Yt, [
|
|
1688
|
+
f(e(F), {
|
|
1359
1689
|
variant: "secondary",
|
|
1360
|
-
disabled:
|
|
1361
|
-
onClick:
|
|
1690
|
+
disabled: d.value,
|
|
1691
|
+
onClick: L[0] || (L[0] = (w) => P.value = !0)
|
|
1362
1692
|
}, {
|
|
1363
1693
|
default: t(() => [
|
|
1364
|
-
|
|
1694
|
+
k(l(a.value.chooseFile), 1)
|
|
1365
1695
|
]),
|
|
1366
1696
|
_: 1
|
|
1367
1697
|
}, 8, ["disabled"]),
|
|
1368
|
-
|
|
1698
|
+
f(e(F), {
|
|
1369
1699
|
variant: "primary",
|
|
1370
|
-
disabled:
|
|
1371
|
-
onClick:
|
|
1700
|
+
disabled: d.value || !A.value,
|
|
1701
|
+
onClick: E
|
|
1372
1702
|
}, {
|
|
1373
1703
|
default: t(() => [
|
|
1374
|
-
|
|
1704
|
+
k(l(a.value.submit), 1)
|
|
1375
1705
|
]),
|
|
1376
1706
|
_: 1
|
|
1377
1707
|
}, 8, ["disabled"])
|
|
1378
1708
|
]),
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
path: `${
|
|
1709
|
+
A.value ? (n(), T("p", Zt, [
|
|
1710
|
+
k(l(u(a.value.chosen, { path: "" }).trim()) + " ", 1),
|
|
1711
|
+
f(e(me), {
|
|
1712
|
+
path: `${A.value.folder}/${A.value.relative}`
|
|
1383
1713
|
}, null, 8, ["path"])
|
|
1384
|
-
])) :
|
|
1385
|
-
|
|
1386
|
-
open:
|
|
1387
|
-
"onUpdate:open":
|
|
1714
|
+
])) : y("", !0),
|
|
1715
|
+
f(Be, {
|
|
1716
|
+
open: P.value,
|
|
1717
|
+
"onUpdate:open": L[1] || (L[1] = (w) => P.value = w),
|
|
1388
1718
|
locale: r.ctx.locale,
|
|
1389
|
-
provider: e(
|
|
1719
|
+
provider: e(Y),
|
|
1390
1720
|
mode: "file",
|
|
1391
1721
|
title: a.value.pickerTitle,
|
|
1392
1722
|
description: a.value.pickerConsent,
|
|
1393
|
-
onSelected:
|
|
1723
|
+
onSelected: S
|
|
1394
1724
|
}, null, 8, ["open", "locale", "provider", "title", "description"]),
|
|
1395
|
-
|
|
1725
|
+
$.value && v.value.admin ? (n(), g(e(G), {
|
|
1396
1726
|
key: 1,
|
|
1397
1727
|
tone: "warning"
|
|
1398
1728
|
}, {
|
|
1399
1729
|
default: t(() => [
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1730
|
+
z("p", null, l(u(a.value.purgeConfirm, { user: $.value.user, uid: $.value.uid })), 1),
|
|
1731
|
+
z("div", jt, [
|
|
1732
|
+
f(e(F), {
|
|
1403
1733
|
variant: "secondary",
|
|
1404
|
-
disabled:
|
|
1405
|
-
onClick:
|
|
1734
|
+
disabled: d.value,
|
|
1735
|
+
onClick: O
|
|
1406
1736
|
}, {
|
|
1407
1737
|
default: t(() => [
|
|
1408
|
-
|
|
1738
|
+
k(l(a.value.confirmPurge), 1)
|
|
1409
1739
|
]),
|
|
1410
1740
|
_: 1
|
|
1411
1741
|
}, 8, ["disabled"]),
|
|
1412
|
-
|
|
1742
|
+
f(e(F), {
|
|
1413
1743
|
variant: "secondary",
|
|
1414
|
-
disabled:
|
|
1415
|
-
onClick:
|
|
1744
|
+
disabled: d.value,
|
|
1745
|
+
onClick: L[2] || (L[2] = (w) => $.value = void 0)
|
|
1416
1746
|
}, {
|
|
1417
1747
|
default: t(() => [
|
|
1418
|
-
|
|
1748
|
+
k(l(a.value.keepJobs), 1)
|
|
1419
1749
|
]),
|
|
1420
1750
|
_: 1
|
|
1421
1751
|
}, 8, ["disabled"])
|
|
1422
1752
|
])
|
|
1423
1753
|
]),
|
|
1424
1754
|
_: 1
|
|
1425
|
-
})) :
|
|
1426
|
-
|
|
1427
|
-
(n(!0),
|
|
1755
|
+
})) : y("", !0),
|
|
1756
|
+
o.value.length ? (n(), T("div", al, [
|
|
1757
|
+
(n(!0), T(oe, null, we(o.value, (w) => (n(), g(e(Ye), {
|
|
1428
1758
|
key: w.id,
|
|
1429
1759
|
title: w.name,
|
|
1430
1760
|
"layout-type": "compact",
|
|
@@ -1432,156 +1762,156 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
1432
1762
|
"data-job-id": w.id
|
|
1433
1763
|
}, {
|
|
1434
1764
|
"header-actions": t(() => [
|
|
1435
|
-
|
|
1436
|
-
tone:
|
|
1765
|
+
f(e(Se), {
|
|
1766
|
+
tone: ne(w),
|
|
1437
1767
|
"data-bg-state": ""
|
|
1438
1768
|
}, {
|
|
1439
1769
|
default: t(() => [
|
|
1440
|
-
|
|
1770
|
+
k(l(te(w)), 1)
|
|
1441
1771
|
]),
|
|
1442
1772
|
_: 2
|
|
1443
1773
|
}, 1032, ["tone"])
|
|
1444
1774
|
]),
|
|
1445
1775
|
default: t(() => [
|
|
1446
|
-
|
|
1447
|
-
w.progress?.total ? (n(),
|
|
1448
|
-
w.progress?.totalBytes ? (n(),
|
|
1449
|
-
w.progress?.item ? (n(),
|
|
1450
|
-
|
|
1451
|
-
|
|
1776
|
+
z("div", tl, [
|
|
1777
|
+
w.progress?.total ? (n(), T("span", ll, l(u(a.value.progressItems, { done: w.progress.done, count: w.progress.total })), 1)) : y("", !0),
|
|
1778
|
+
w.progress?.totalBytes ? (n(), T("span", nl, l(u(a.value.progressBytes, { done: e(Le)(w.progress.bytes, r.ctx.locale), total: e(Le)(w.progress.totalBytes, r.ctx.locale) })), 1)) : y("", !0),
|
|
1779
|
+
w.progress?.item ? (n(), T("span", sl, [
|
|
1780
|
+
k(l(u(a.value.progressItem, { item: "" }).trim()) + " ", 1),
|
|
1781
|
+
f(e(me), {
|
|
1452
1782
|
path: w.progress.item
|
|
1453
1783
|
}, null, 8, ["path"])
|
|
1454
|
-
])) :
|
|
1455
|
-
|
|
1456
|
-
w.scheduleId ? (n(),
|
|
1457
|
-
|
|
1458
|
-
|
|
1784
|
+
])) : y("", !0),
|
|
1785
|
+
v.value.admin && w.submitter ? (n(), T("span", ol, l(u(a.value.owner, { user: w.submitter.user, uid: w.submitter.uid })), 1)) : y("", !0),
|
|
1786
|
+
w.scheduleId ? (n(), T("span", il, l(a.value.scheduledJob), 1)) : y("", !0),
|
|
1787
|
+
z("div", ul, [
|
|
1788
|
+
v.value.admin && w.submitter ? (n(), g(e(F), {
|
|
1459
1789
|
key: 0,
|
|
1460
1790
|
variant: "secondary",
|
|
1461
|
-
disabled:
|
|
1462
|
-
onClick: (
|
|
1791
|
+
disabled: d.value,
|
|
1792
|
+
onClick: (de) => $.value = w.submitter
|
|
1463
1793
|
}, {
|
|
1464
1794
|
default: t(() => [
|
|
1465
|
-
|
|
1795
|
+
k(l(a.value.purgeOwner), 1)
|
|
1466
1796
|
]),
|
|
1467
1797
|
_: 1
|
|
1468
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1469
|
-
!j(w) && !w.pauseRequested && !w.delegation_id ? (n(),
|
|
1798
|
+
}, 8, ["disabled", "onClick"])) : y("", !0),
|
|
1799
|
+
!j(w) && !w.pauseRequested && !w.delegation_id ? (n(), g(e(F), {
|
|
1470
1800
|
key: 1,
|
|
1471
1801
|
variant: "secondary",
|
|
1472
|
-
disabled:
|
|
1473
|
-
onClick: (
|
|
1802
|
+
disabled: d.value,
|
|
1803
|
+
onClick: (de) => le(w.id)
|
|
1474
1804
|
}, {
|
|
1475
1805
|
default: t(() => [
|
|
1476
|
-
|
|
1806
|
+
k(l(a.value.pause), 1)
|
|
1477
1807
|
]),
|
|
1478
1808
|
_: 1
|
|
1479
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1480
|
-
w.state === "paused" ||
|
|
1809
|
+
}, 8, ["disabled", "onClick"])) : y("", !0),
|
|
1810
|
+
w.state === "paused" || se(w) ? (n(), g(e(F), {
|
|
1481
1811
|
key: 2,
|
|
1482
1812
|
variant: "secondary",
|
|
1483
|
-
disabled:
|
|
1484
|
-
onClick: (
|
|
1813
|
+
disabled: d.value,
|
|
1814
|
+
onClick: (de) => N(w.id)
|
|
1485
1815
|
}, {
|
|
1486
1816
|
default: t(() => [
|
|
1487
|
-
|
|
1817
|
+
k(l(a.value.resume), 1)
|
|
1488
1818
|
]),
|
|
1489
1819
|
_: 1
|
|
1490
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1491
|
-
|
|
1820
|
+
}, 8, ["disabled", "onClick"])) : y("", !0),
|
|
1821
|
+
ee(w) ? y("", !0) : (n(), g(e(F), {
|
|
1492
1822
|
key: 3,
|
|
1493
1823
|
variant: "secondary",
|
|
1494
|
-
disabled:
|
|
1495
|
-
onClick: (
|
|
1824
|
+
disabled: d.value,
|
|
1825
|
+
onClick: (de) => M(w.id)
|
|
1496
1826
|
}, {
|
|
1497
1827
|
default: t(() => [
|
|
1498
|
-
|
|
1828
|
+
k(l(a.value.cancel), 1)
|
|
1499
1829
|
]),
|
|
1500
1830
|
_: 1
|
|
1501
1831
|
}, 8, ["disabled", "onClick"])),
|
|
1502
|
-
|
|
1832
|
+
be(w) ? (n(), g(e(F), {
|
|
1503
1833
|
key: 4,
|
|
1504
1834
|
variant: "secondary",
|
|
1505
|
-
disabled:
|
|
1506
|
-
onClick: (
|
|
1835
|
+
disabled: d.value,
|
|
1836
|
+
onClick: (de) => ae(w)
|
|
1507
1837
|
}, {
|
|
1508
1838
|
default: t(() => [
|
|
1509
|
-
|
|
1839
|
+
k(l(a.value.scheduleCopy), 1)
|
|
1510
1840
|
]),
|
|
1511
1841
|
_: 1
|
|
1512
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1513
|
-
w.state === "succeeded" ? (n(),
|
|
1842
|
+
}, 8, ["disabled", "onClick"])) : y("", !0),
|
|
1843
|
+
w.state === "succeeded" ? (n(), g(e(F), {
|
|
1514
1844
|
key: 5,
|
|
1515
1845
|
variant: "secondary",
|
|
1516
|
-
disabled:
|
|
1517
|
-
onClick: (
|
|
1846
|
+
disabled: d.value,
|
|
1847
|
+
onClick: (de) => D(w)
|
|
1518
1848
|
}, {
|
|
1519
1849
|
default: t(() => [
|
|
1520
|
-
|
|
1850
|
+
k(l(a.value.result), 1)
|
|
1521
1851
|
]),
|
|
1522
1852
|
_: 1
|
|
1523
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1853
|
+
}, 8, ["disabled", "onClick"])) : y("", !0)
|
|
1524
1854
|
])
|
|
1525
1855
|
])
|
|
1526
1856
|
]),
|
|
1527
1857
|
_: 2
|
|
1528
1858
|
}, 1032, ["title", "data-job-state", "data-job-id"]))), 128))
|
|
1529
|
-
])) : (n(),
|
|
1530
|
-
|
|
1859
|
+
])) : (n(), T("p", el, l(a.value.noJobs), 1)),
|
|
1860
|
+
z("section", {
|
|
1531
1861
|
"data-bg-schedules": "",
|
|
1532
1862
|
class: "bg-schedules",
|
|
1533
1863
|
"aria-label": a.value.schedulesTitle
|
|
1534
1864
|
}, [
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
h.value ? (n(),
|
|
1865
|
+
z("h3", null, l(a.value.schedulesTitle), 1),
|
|
1866
|
+
z("p", dl, l(a.value.scheduleHelp), 1),
|
|
1867
|
+
h.value ? (n(), g(e(Pe), {
|
|
1538
1868
|
key: 0,
|
|
1539
1869
|
class: "bg-schedule-form",
|
|
1540
|
-
onSubmit: ze(
|
|
1870
|
+
onSubmit: ze(ue, ["prevent"])
|
|
1541
1871
|
}, {
|
|
1542
1872
|
default: t(() => [
|
|
1543
|
-
|
|
1544
|
-
|
|
1873
|
+
z("p", null, l(u(a.value.scheduleSource, { name: h.value.name })), 1),
|
|
1874
|
+
f(e(ke), {
|
|
1545
1875
|
label: a.value.interval
|
|
1546
1876
|
}, {
|
|
1547
1877
|
default: t(() => [
|
|
1548
|
-
|
|
1549
|
-
modelValue:
|
|
1550
|
-
"onUpdate:modelValue":
|
|
1878
|
+
f(e(ia), {
|
|
1879
|
+
modelValue: x.value,
|
|
1880
|
+
"onUpdate:modelValue": L[3] || (L[3] = (w) => x.value = w),
|
|
1551
1881
|
"data-schedule-interval": "",
|
|
1552
|
-
options:
|
|
1553
|
-
disabled:
|
|
1882
|
+
options: Z.value,
|
|
1883
|
+
disabled: d.value
|
|
1554
1884
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
1555
1885
|
]),
|
|
1556
1886
|
_: 1
|
|
1557
1887
|
}, 8, ["label"]),
|
|
1558
|
-
|
|
1559
|
-
modelValue:
|
|
1560
|
-
"onUpdate:modelValue":
|
|
1888
|
+
f(e(Oa), {
|
|
1889
|
+
modelValue: R.value,
|
|
1890
|
+
"onUpdate:modelValue": L[4] || (L[4] = (w) => R.value = w),
|
|
1561
1891
|
"data-schedule-consent": "",
|
|
1562
|
-
disabled:
|
|
1892
|
+
disabled: d.value,
|
|
1563
1893
|
label: a.value.scheduleConsent
|
|
1564
1894
|
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
1565
|
-
|
|
1895
|
+
f(e(Ve), null, {
|
|
1566
1896
|
default: t(() => [
|
|
1567
|
-
|
|
1897
|
+
f(e(F), {
|
|
1568
1898
|
type: "submit",
|
|
1569
1899
|
variant: "primary",
|
|
1570
|
-
disabled:
|
|
1900
|
+
disabled: d.value || !R.value
|
|
1571
1901
|
}, {
|
|
1572
1902
|
default: t(() => [
|
|
1573
|
-
|
|
1903
|
+
k(l(a.value.createSchedule), 1)
|
|
1574
1904
|
]),
|
|
1575
1905
|
_: 1
|
|
1576
1906
|
}, 8, ["disabled"]),
|
|
1577
|
-
|
|
1907
|
+
f(e(F), {
|
|
1578
1908
|
type: "button",
|
|
1579
1909
|
variant: "secondary",
|
|
1580
|
-
disabled:
|
|
1581
|
-
onClick:
|
|
1910
|
+
disabled: d.value,
|
|
1911
|
+
onClick: L[5] || (L[5] = (w) => h.value = void 0)
|
|
1582
1912
|
}, {
|
|
1583
1913
|
default: t(() => [
|
|
1584
|
-
|
|
1914
|
+
k(l(a.value.cancel), 1)
|
|
1585
1915
|
]),
|
|
1586
1916
|
_: 1
|
|
1587
1917
|
}, 8, ["disabled"])
|
|
@@ -1590,76 +1920,76 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
1590
1920
|
})
|
|
1591
1921
|
]),
|
|
1592
1922
|
_: 1
|
|
1593
|
-
})) :
|
|
1594
|
-
p.value.length ? (n(),
|
|
1595
|
-
(n(!0),
|
|
1923
|
+
})) : y("", !0),
|
|
1924
|
+
p.value.length ? (n(), T("div", vl, [
|
|
1925
|
+
(n(!0), T(oe, null, we(p.value, (w) => (n(), g(e(Ye), {
|
|
1596
1926
|
key: w.id,
|
|
1597
1927
|
title: w.name,
|
|
1598
1928
|
"layout-type": "compact",
|
|
1599
1929
|
"data-schedule-id": w.id
|
|
1600
1930
|
}, {
|
|
1601
1931
|
"header-actions": t(() => [
|
|
1602
|
-
|
|
1932
|
+
f(e(Se), {
|
|
1603
1933
|
tone: w.enabled ? "success" : "neutral",
|
|
1604
1934
|
"data-bg-state": ""
|
|
1605
1935
|
}, {
|
|
1606
1936
|
default: t(() => [
|
|
1607
|
-
|
|
1937
|
+
k(l(w.enabled ? a.value.scheduleOn : a.value.scheduleOff), 1)
|
|
1608
1938
|
]),
|
|
1609
1939
|
_: 2
|
|
1610
1940
|
}, 1032, ["tone"])
|
|
1611
1941
|
]),
|
|
1612
1942
|
default: t(() => [
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
w.enabled ? (n(),
|
|
1616
|
-
|
|
1617
|
-
w.reason === "worker-changed" ? (n(),
|
|
1943
|
+
z("div", pl, [
|
|
1944
|
+
v.value.admin ? (n(), T("span", fl, l(u(a.value.owner, { user: w.owner.user, uid: w.owner.uid })), 1)) : y("", !0),
|
|
1945
|
+
w.enabled ? (n(), T("span", yl, l(u(a.value.nextRun, { time: ce(w.nextAt) })), 1)) : y("", !0),
|
|
1946
|
+
z("span", ml, l(u(a.value.missedRuns, { count: w.missed })), 1),
|
|
1947
|
+
w.reason === "worker-changed" ? (n(), g(e(G), {
|
|
1618
1948
|
key: 2,
|
|
1619
1949
|
tone: "warning"
|
|
1620
1950
|
}, {
|
|
1621
1951
|
default: t(() => [
|
|
1622
|
-
|
|
1952
|
+
k(l(a.value.revisionChanged), 1)
|
|
1623
1953
|
]),
|
|
1624
1954
|
_: 1
|
|
1625
|
-
})) : w.reason === "input-unavailable" ? (n(),
|
|
1955
|
+
})) : w.reason === "input-unavailable" ? (n(), g(e(G), {
|
|
1626
1956
|
key: 3,
|
|
1627
1957
|
tone: "warning"
|
|
1628
1958
|
}, {
|
|
1629
1959
|
default: t(() => [
|
|
1630
|
-
|
|
1960
|
+
k(l(a.value.errors["input-unavailable"]), 1)
|
|
1631
1961
|
]),
|
|
1632
1962
|
_: 1
|
|
1633
|
-
})) :
|
|
1634
|
-
|
|
1635
|
-
w.enabled ? (n(),
|
|
1963
|
+
})) : y("", !0),
|
|
1964
|
+
z("div", bl, [
|
|
1965
|
+
w.enabled ? (n(), g(e(F), {
|
|
1636
1966
|
key: 0,
|
|
1637
1967
|
variant: "secondary",
|
|
1638
|
-
disabled:
|
|
1639
|
-
onClick: (
|
|
1968
|
+
disabled: d.value,
|
|
1969
|
+
onClick: (de) => Ce(w.id)
|
|
1640
1970
|
}, {
|
|
1641
1971
|
default: t(() => [
|
|
1642
|
-
|
|
1972
|
+
k(l(a.value.disableSchedule), 1)
|
|
1643
1973
|
]),
|
|
1644
1974
|
_: 1
|
|
1645
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1975
|
+
}, 8, ["disabled", "onClick"])) : v.value.admin ? (n(), g(e(F), {
|
|
1646
1976
|
key: 1,
|
|
1647
1977
|
variant: "secondary",
|
|
1648
|
-
disabled:
|
|
1649
|
-
onClick: (
|
|
1978
|
+
disabled: d.value,
|
|
1979
|
+
onClick: (de) => U.value = w
|
|
1650
1980
|
}, {
|
|
1651
1981
|
default: t(() => [
|
|
1652
|
-
|
|
1982
|
+
k(l(a.value.enableSchedule), 1)
|
|
1653
1983
|
]),
|
|
1654
1984
|
_: 1
|
|
1655
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1656
|
-
|
|
1985
|
+
}, 8, ["disabled", "onClick"])) : y("", !0),
|
|
1986
|
+
f(e(F), {
|
|
1657
1987
|
variant: "secondary",
|
|
1658
|
-
disabled:
|
|
1659
|
-
onClick: (
|
|
1988
|
+
disabled: d.value,
|
|
1989
|
+
onClick: (de) => _.value = w
|
|
1660
1990
|
}, {
|
|
1661
1991
|
default: t(() => [
|
|
1662
|
-
|
|
1992
|
+
k(l(a.value.deleteSchedule), 1)
|
|
1663
1993
|
]),
|
|
1664
1994
|
_: 1
|
|
1665
1995
|
}, 8, ["disabled", "onClick"])
|
|
@@ -1668,475 +1998,295 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
1668
1998
|
]),
|
|
1669
1999
|
_: 2
|
|
1670
2000
|
}, 1032, ["title", "data-schedule-id"]))), 128))
|
|
1671
|
-
])) : (n(),
|
|
1672
|
-
_.value ? (n(),
|
|
2001
|
+
])) : (n(), T("p", cl, l(a.value.noSchedules), 1)),
|
|
2002
|
+
_.value ? (n(), g(e(G), {
|
|
1673
2003
|
key: 3,
|
|
1674
2004
|
tone: "warning"
|
|
1675
2005
|
}, {
|
|
1676
2006
|
default: t(() => [
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
2007
|
+
z("p", null, l(u(a.value.deleteScheduleConsent, { name: _.value.name })), 1),
|
|
2008
|
+
z("div", gl, [
|
|
2009
|
+
f(e(F), {
|
|
1680
2010
|
variant: "danger",
|
|
1681
|
-
disabled:
|
|
1682
|
-
onClick:
|
|
2011
|
+
disabled: d.value,
|
|
2012
|
+
onClick: fe
|
|
1683
2013
|
}, {
|
|
1684
2014
|
default: t(() => [
|
|
1685
|
-
|
|
2015
|
+
k(l(a.value.confirmDeleteSchedule), 1)
|
|
1686
2016
|
]),
|
|
1687
2017
|
_: 1
|
|
1688
2018
|
}, 8, ["disabled"]),
|
|
1689
|
-
|
|
2019
|
+
f(e(F), {
|
|
1690
2020
|
variant: "secondary",
|
|
1691
|
-
disabled:
|
|
1692
|
-
onClick:
|
|
2021
|
+
disabled: d.value,
|
|
2022
|
+
onClick: L[6] || (L[6] = (w) => _.value = void 0)
|
|
1693
2023
|
}, {
|
|
1694
2024
|
default: t(() => [
|
|
1695
|
-
|
|
2025
|
+
k(l(a.value.cancel), 1)
|
|
1696
2026
|
]),
|
|
1697
2027
|
_: 1
|
|
1698
2028
|
}, 8, ["disabled"])
|
|
1699
2029
|
])
|
|
1700
2030
|
]),
|
|
1701
2031
|
_: 1
|
|
1702
|
-
})) :
|
|
1703
|
-
|
|
2032
|
+
})) : y("", !0),
|
|
2033
|
+
U.value ? (n(), g(e(G), {
|
|
1704
2034
|
key: 4,
|
|
1705
2035
|
tone: "warning"
|
|
1706
2036
|
}, {
|
|
1707
2037
|
default: t(() => [
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
2038
|
+
z("p", null, l(u(a.value.enableScheduleConsent, { name: U.value.name })), 1),
|
|
2039
|
+
z("div", hl, [
|
|
2040
|
+
f(e(F), {
|
|
1711
2041
|
variant: "primary",
|
|
1712
|
-
disabled:
|
|
1713
|
-
onClick:
|
|
2042
|
+
disabled: d.value,
|
|
2043
|
+
onClick: ye
|
|
1714
2044
|
}, {
|
|
1715
2045
|
default: t(() => [
|
|
1716
|
-
|
|
2046
|
+
k(l(a.value.confirmEnableSchedule), 1)
|
|
1717
2047
|
]),
|
|
1718
2048
|
_: 1
|
|
1719
2049
|
}, 8, ["disabled"]),
|
|
1720
|
-
|
|
2050
|
+
f(e(F), {
|
|
1721
2051
|
variant: "secondary",
|
|
1722
|
-
disabled:
|
|
1723
|
-
onClick:
|
|
2052
|
+
disabled: d.value,
|
|
2053
|
+
onClick: L[7] || (L[7] = (w) => U.value = void 0)
|
|
1724
2054
|
}, {
|
|
1725
2055
|
default: t(() => [
|
|
1726
|
-
|
|
2056
|
+
k(l(a.value.cancel), 1)
|
|
1727
2057
|
]),
|
|
1728
2058
|
_: 1
|
|
1729
2059
|
}, 8, ["disabled"])
|
|
1730
2060
|
])
|
|
1731
2061
|
]),
|
|
1732
2062
|
_: 1
|
|
1733
|
-
})) :
|
|
1734
|
-
], 8,
|
|
1735
|
-
|
|
2063
|
+
})) : y("", !0)
|
|
2064
|
+
], 8, rl),
|
|
2065
|
+
K.value ? (n(), g(e(ua), {
|
|
1736
2066
|
key: 4,
|
|
1737
|
-
href:
|
|
1738
|
-
download:
|
|
2067
|
+
href: K.value,
|
|
2068
|
+
download: Q.value
|
|
1739
2069
|
}, {
|
|
1740
2070
|
default: t(() => [
|
|
1741
|
-
|
|
2071
|
+
k(l(a.value.download), 1)
|
|
1742
2072
|
]),
|
|
1743
2073
|
_: 1
|
|
1744
|
-
}, 8, ["href", "download"])) :
|
|
1745
|
-
], 64)) :
|
|
2074
|
+
}, 8, ["href", "download"])) : y("", !0)
|
|
2075
|
+
], 64)) : y("", !0)
|
|
1746
2076
|
], 64))
|
|
1747
2077
|
]),
|
|
1748
2078
|
_: 1
|
|
1749
2079
|
}, 8, ["aria-busy", "title", "description", "loading"]));
|
|
1750
2080
|
}
|
|
1751
|
-
}),
|
|
1752
|
-
key:
|
|
1753
|
-
class: "executor-
|
|
1754
|
-
},
|
|
2081
|
+
}), _n = /* @__PURE__ */ re(kl, [["__scopeId", "data-v-fa2b6101"]]), _l = {
|
|
2082
|
+
key: 2,
|
|
2083
|
+
class: "executor-approval"
|
|
2084
|
+
}, wl = {
|
|
1755
2085
|
key: 0,
|
|
1756
|
-
class: "executor-
|
|
1757
|
-
},
|
|
1758
|
-
__name: "
|
|
2086
|
+
class: "executor-brand"
|
|
2087
|
+
}, xl = ["src"], Cl = /* @__PURE__ */ ie({
|
|
2088
|
+
__name: "ExecutorApproval",
|
|
1759
2089
|
props: {
|
|
1760
2090
|
admin: { type: Boolean },
|
|
1761
2091
|
locale: {},
|
|
1762
2092
|
ctx: {}
|
|
1763
2093
|
},
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
const G = await a.ctx.call("delegate.status");
|
|
1772
|
-
if (q || (E.value = G, G.scope_mode !== "install-selected")) return;
|
|
1773
|
-
const le = [];
|
|
1774
|
-
let L = 0;
|
|
1775
|
-
for (let U = 0; U < 128; U++) {
|
|
1776
|
-
const B = await a.ctx.call("bg.browse", { offset: L });
|
|
1777
|
-
if (q) return;
|
|
1778
|
-
if (!Array.isArray(B.shares) || !Number.isSafeInteger(B.total) || B.total < 0 || !B.shares.length && L < B.total) throw { code: "EXECUTOR_PROTOCOL" };
|
|
1779
|
-
for (const J of B.shares)
|
|
1780
|
-
J.isdir && J.path === "/" + J.name && !["home", "homes"].includes(J.name.toLowerCase()) && le.push({ label: J.name, value: "shared:" + J.name });
|
|
1781
|
-
if (L += B.shares.length, L >= B.total) break;
|
|
1782
|
-
if (U === 127) throw { code: "EXECUTOR_PROTOCOL" };
|
|
1783
|
-
}
|
|
1784
|
-
_.value = le, z.value = G.selection?.scope ?? G.preselection ?? "";
|
|
1785
|
-
}
|
|
1786
|
-
async function ae() {
|
|
1787
|
-
if (!(!a.admin || v.value)) {
|
|
1788
|
-
v.value = !0, h.value = !1;
|
|
1789
|
-
try {
|
|
1790
|
-
await X();
|
|
1791
|
-
} catch {
|
|
1792
|
-
q || (h.value = !0);
|
|
1793
|
-
} finally {
|
|
1794
|
-
q || (v.value = !1);
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
}
|
|
1798
|
-
async function Z() {
|
|
1799
|
-
if (!a.admin || v.value || !d.value || !V.value || h.value) return;
|
|
1800
|
-
v.value = !0, h.value = !1;
|
|
1801
|
-
const Q = d.value;
|
|
1802
|
-
d.value = "", p.value = !0;
|
|
2094
|
+
setup(r) {
|
|
2095
|
+
const C = r, i = Re(Te, void 0), a = I(() => Ue(C.locale)), u = m("checking"), v = I(() => {
|
|
2096
|
+
const d = C.ctx;
|
|
2097
|
+
return (d?.fullPage ?? (d?.host ? je({ host: d.host }) : !1)) && d?.displayName ? d : void 0;
|
|
2098
|
+
});
|
|
2099
|
+
let o = !1, s;
|
|
2100
|
+
async function c() {
|
|
1803
2101
|
try {
|
|
1804
|
-
|
|
1805
|
-
|
|
2102
|
+
const d = await i.status();
|
|
2103
|
+
o || (u.value = d.state);
|
|
1806
2104
|
} catch {
|
|
1807
|
-
|
|
1808
|
-
} finally {
|
|
1809
|
-
q || (v.value = !1, p.value = !1);
|
|
2105
|
+
o || (u.value = "blocked");
|
|
1810
2106
|
}
|
|
1811
2107
|
}
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
}, {
|
|
1827
|
-
default: t(() => [
|
|
1828
|
-
h.value ? (n(), k(e(W), {
|
|
2108
|
+
return pe(() => {
|
|
2109
|
+
i && (i.subscribe?.((d) => {
|
|
2110
|
+
o || (u.value = d.state);
|
|
2111
|
+
}), s = C.ctx?.reopen(() => {
|
|
2112
|
+
c();
|
|
2113
|
+
}), c());
|
|
2114
|
+
}), ve(() => {
|
|
2115
|
+
o = !0, s?.();
|
|
2116
|
+
}), (d, p) => !e(i) || u.value === "ready" ? he(d.$slots, "default", {}, void 0, !0, 0) : u.value === "checking" ? (n(), g(e(La), {
|
|
2117
|
+
key: 1,
|
|
2118
|
+
text: a.value.loading
|
|
2119
|
+
}, null, 8, ["text"])) : (n(), T("div", _l, [
|
|
2120
|
+
v.value ? (n(), T("header", wl, [
|
|
2121
|
+
v.value.appIcon ? (n(), T("img", {
|
|
1829
2122
|
key: 0,
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
},
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
})) : b("", !0),
|
|
1851
|
-
s.value || p.value ? (n(), R("div", rl, [
|
|
1852
|
-
c(e($e), {
|
|
1853
|
-
label: i.value.status,
|
|
1854
|
-
"label-width": "10rem"
|
|
1855
|
-
}, {
|
|
1856
|
-
default: t(() => [
|
|
1857
|
-
S("span", {
|
|
1858
|
-
role: "status",
|
|
1859
|
-
"data-executor-status": H.value
|
|
1860
|
-
}, [
|
|
1861
|
-
c(e(Se), {
|
|
1862
|
-
tone: j.value.tone
|
|
1863
|
-
}, {
|
|
1864
|
-
default: t(() => [
|
|
1865
|
-
g(l(j.value.text), 1)
|
|
1866
|
-
]),
|
|
1867
|
-
_: 1
|
|
1868
|
-
}, 8, ["tone"])
|
|
1869
|
-
], 8, dl)
|
|
1870
|
-
]),
|
|
1871
|
-
_: 1
|
|
1872
|
-
}, 8, ["label"]),
|
|
1873
|
-
s.value?.reason && (s.value.state === "blocked" || s.value.state === "unsupported") ? (n(), k(e($e), {
|
|
1874
|
-
key: 0,
|
|
1875
|
-
label: i.value.details,
|
|
1876
|
-
"label-width": "10rem"
|
|
1877
|
-
}, {
|
|
1878
|
-
default: t(() => [
|
|
1879
|
-
g(l(s.value.reason), 1)
|
|
1880
|
-
]),
|
|
1881
|
-
_: 1
|
|
1882
|
-
}, 8, ["label"])) : b("", !0),
|
|
1883
|
-
E.value?.selection ? (n(), k(e($e), {
|
|
1884
|
-
key: 1,
|
|
1885
|
-
label: i.value.protectedScope,
|
|
1886
|
-
"label-width": "10rem"
|
|
1887
|
-
}, {
|
|
1888
|
-
default: t(() => [
|
|
1889
|
-
c(e(pe), {
|
|
1890
|
-
path: E.value.selection.root
|
|
1891
|
-
}, null, 8, ["path"])
|
|
1892
|
-
]),
|
|
1893
|
-
_: 1
|
|
1894
|
-
}, 8, ["label"])) : b("", !0)
|
|
1895
|
-
])) : b("", !0),
|
|
1896
|
-
H.value === "needs" ? (n(), k(e(W), {
|
|
1897
|
-
key: 2,
|
|
1898
|
-
tone: "info"
|
|
1899
|
-
}, {
|
|
1900
|
-
default: t(() => [
|
|
1901
|
-
g(l(i.value.needs), 1)
|
|
1902
|
-
]),
|
|
1903
|
-
_: 1
|
|
1904
|
-
})) : H.value === "scope" ? (n(), k(e(W), {
|
|
1905
|
-
key: 3,
|
|
1906
|
-
tone: "warning"
|
|
1907
|
-
}, {
|
|
1908
|
-
default: t(() => [
|
|
1909
|
-
g(l(i.value.scopeNeeds), 1)
|
|
1910
|
-
]),
|
|
1911
|
-
_: 1
|
|
1912
|
-
})) : H.value === "blocked" ? (n(), k(e(W), {
|
|
1913
|
-
key: 4,
|
|
1914
|
-
tone: "warning"
|
|
1915
|
-
}, {
|
|
1916
|
-
default: t(() => [
|
|
1917
|
-
g(l(i.value.blocked), 1)
|
|
1918
|
-
]),
|
|
1919
|
-
_: 1
|
|
1920
|
-
})) : b("", !0),
|
|
1921
|
-
E.value?.mismatch ? (n(), k(e(W), {
|
|
1922
|
-
key: 5,
|
|
1923
|
-
tone: "warning"
|
|
1924
|
-
}, {
|
|
1925
|
-
default: t(() => [
|
|
1926
|
-
g(l(i.value.scopeMismatch), 1)
|
|
1927
|
-
]),
|
|
1928
|
-
_: 1
|
|
1929
|
-
})) : b("", !0),
|
|
1930
|
-
s.value?.state === "needs-admin-approval" || s.value?.retry || $.value && s.value?.state === "ready" ? (n(), k(e(Pe), {
|
|
1931
|
-
key: 6,
|
|
1932
|
-
direction: "vertical",
|
|
1933
|
-
class: "executor-form",
|
|
1934
|
-
onSubmit: ze(Z, ["prevent"])
|
|
1935
|
-
}, {
|
|
1936
|
-
default: t(() => [
|
|
1937
|
-
$.value ? (n(), R(se, { key: 0 }, [
|
|
1938
|
-
S("p", vl, l(E.value?.selection ? i.value.scopeChangeHelp : i.value.preselectionHelp), 1),
|
|
1939
|
-
c(e(be), {
|
|
1940
|
-
label: i.value.scopeLabel,
|
|
1941
|
-
"label-for": "delegate-scope"
|
|
1942
|
-
}, {
|
|
1943
|
-
default: t(() => [
|
|
1944
|
-
c(e(sa), {
|
|
1945
|
-
id: "delegate-scope",
|
|
1946
|
-
modelValue: z.value,
|
|
1947
|
-
"onUpdate:modelValue": Y[0] || (Y[0] = (G) => z.value = G),
|
|
1948
|
-
options: x.value,
|
|
1949
|
-
disabled: v.value || h.value
|
|
1950
|
-
}, null, 8, ["modelValue", "options", "disabled"])
|
|
1951
|
-
]),
|
|
1952
|
-
_: 1
|
|
1953
|
-
}, 8, ["label"])
|
|
1954
|
-
], 64)) : b("", !0),
|
|
1955
|
-
c(e(be), {
|
|
1956
|
-
label: i.value.password,
|
|
1957
|
-
"label-for": "delegate-password"
|
|
1958
|
-
}, {
|
|
1959
|
-
default: t(() => [
|
|
1960
|
-
c(e(we), {
|
|
1961
|
-
id: "delegate-password",
|
|
1962
|
-
modelValue: d.value,
|
|
1963
|
-
"onUpdate:modelValue": Y[1] || (Y[1] = (G) => d.value = G),
|
|
1964
|
-
type: "password",
|
|
1965
|
-
autocomplete: "current-password",
|
|
1966
|
-
disabled: v.value || h.value
|
|
1967
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
1968
|
-
]),
|
|
1969
|
-
_: 1
|
|
1970
|
-
}, 8, ["label"]),
|
|
1971
|
-
c(e(Ve), null, {
|
|
1972
|
-
default: t(() => [
|
|
1973
|
-
c(e(F), {
|
|
1974
|
-
type: "submit",
|
|
1975
|
-
variant: "primary",
|
|
1976
|
-
disabled: v.value || h.value || !d.value || !V.value || te.value
|
|
1977
|
-
}, {
|
|
1978
|
-
default: t(() => [
|
|
1979
|
-
g(l($.value ? E.value?.selection ? i.value.confirmScope : i.value.confirmShare : i.value.authorize), 1)
|
|
1980
|
-
]),
|
|
1981
|
-
_: 1
|
|
1982
|
-
}, 8, ["disabled"]),
|
|
1983
|
-
ne.value ? (n(), R("span", cl, l(ne.value), 1)) : b("", !0)
|
|
1984
|
-
]),
|
|
1985
|
-
_: 1
|
|
1986
|
-
})
|
|
1987
|
-
]),
|
|
1988
|
-
_: 1
|
|
1989
|
-
})) : b("", !0)
|
|
1990
|
-
]),
|
|
1991
|
-
_: 1
|
|
1992
|
-
}, 8, ["title", "description", "loading", "aria-busy"])) : b("", !0);
|
|
2123
|
+
src: v.value.appIcon,
|
|
2124
|
+
alt: ""
|
|
2125
|
+
}, null, 8, xl)) : y("", !0),
|
|
2126
|
+
z("span", null, l(v.value.displayName), 1)
|
|
2127
|
+
])) : y("", !0),
|
|
2128
|
+
r.admin ? (n(), g(ca, {
|
|
2129
|
+
key: 1,
|
|
2130
|
+
admin: !0,
|
|
2131
|
+
locale: r.locale,
|
|
2132
|
+
onConfirmed: c
|
|
2133
|
+
}, null, 8, ["locale"])) : (n(), g(e(G), {
|
|
2134
|
+
key: 2,
|
|
2135
|
+
tone: "info"
|
|
2136
|
+
}, {
|
|
2137
|
+
default: t(() => [
|
|
2138
|
+
k(l(u.value === "needs-admin-approval" ? a.value.executorNeeds : a.value.executorBlocked), 1)
|
|
2139
|
+
]),
|
|
2140
|
+
_: 1
|
|
2141
|
+
}))
|
|
2142
|
+
]));
|
|
1993
2143
|
}
|
|
1994
|
-
}),
|
|
2144
|
+
}), wn = /* @__PURE__ */ re(Cl, [["__scopeId", "data-v-632b6fba"]]), $l = {
|
|
1995
2145
|
key: 1,
|
|
1996
2146
|
role: "status"
|
|
1997
|
-
},
|
|
2147
|
+
}, Sl = {
|
|
1998
2148
|
key: 2,
|
|
1999
2149
|
role: "status"
|
|
2000
|
-
},
|
|
2150
|
+
}, zl = {
|
|
2001
2151
|
key: 0,
|
|
2002
2152
|
role: "status",
|
|
2003
2153
|
class: "destination"
|
|
2004
|
-
},
|
|
2154
|
+
}, Pl = { key: 3 }, Vl = {
|
|
2005
2155
|
key: 4,
|
|
2006
2156
|
class: "records"
|
|
2007
|
-
},
|
|
2157
|
+
}, Al = ["data-job-state"], Il = ["role"], El = { key: 5 }, Tl = {
|
|
2008
2158
|
key: 6,
|
|
2009
2159
|
class: "records"
|
|
2010
|
-
},
|
|
2160
|
+
}, Ul = /* @__PURE__ */ ie({
|
|
2011
2161
|
__name: "DelegatePanel",
|
|
2012
2162
|
props: {
|
|
2013
2163
|
ctx: {}
|
|
2014
2164
|
},
|
|
2015
|
-
setup(r, { expose:
|
|
2016
|
-
const
|
|
2017
|
-
let
|
|
2018
|
-
|
|
2019
|
-
|
|
2165
|
+
setup(r, { expose: C }) {
|
|
2166
|
+
const i = r, a = I(() => Ue(i.ctx.locale)), u = I(() => na(i.ctx.locale)), v = la(i.ctx), o = m(), s = m([]), c = m([]), d = m(!1), p = m(), h = m(""), R = m(!1), x = m(""), _ = m(""), U = m("");
|
|
2167
|
+
let $ = !1, V, P;
|
|
2168
|
+
Me([_, x, U], () => {
|
|
2169
|
+
P = void 0;
|
|
2020
2170
|
}, { flush: "sync" });
|
|
2021
|
-
const
|
|
2022
|
-
async function
|
|
2023
|
-
if (
|
|
2024
|
-
const [
|
|
2025
|
-
if (
|
|
2026
|
-
|
|
2027
|
-
for (const
|
|
2171
|
+
const A = (q) => ["queued", "running", "waiting_executor"].includes(q.state), K = I(() => c.value.some((q) => q.state === "waiting_executor")), Q = ["EXECUTOR_UNAVAILABLE", "EXECUTOR_TIMEOUT"], Y = I(() => K.value && Q.includes(p.value?.code ?? "")), X = I(() => o.value && o.value.state !== "ready" && !(K.value && o.value.state === "needs-admin-approval" && Q.includes(o.value.reason ?? "")));
|
|
2172
|
+
async function J() {
|
|
2173
|
+
if ($) return;
|
|
2174
|
+
const [q, B, O] = await Promise.allSettled([i.ctx.call("delegate.status"), i.ctx.call("delegate.list"), i.ctx.call("delegate.jobs.list")]);
|
|
2175
|
+
if (!$) {
|
|
2176
|
+
q.status === "fulfilled" && (o.value = q.value), B.status === "fulfilled" && (s.value = (B.value.delegations ?? []).filter((Z) => !Z.revoked)), O.status === "fulfilled" && (c.value = O.value.jobs ?? []);
|
|
2177
|
+
for (const Z of [q, B, O]) if (Z.status === "rejected") throw Z.reason;
|
|
2028
2178
|
}
|
|
2029
2179
|
}
|
|
2030
|
-
async function j(
|
|
2031
|
-
if (!(
|
|
2032
|
-
|
|
2180
|
+
async function j(q) {
|
|
2181
|
+
if (!(d.value || $)) {
|
|
2182
|
+
d.value = !0, p.value = void 0;
|
|
2033
2183
|
try {
|
|
2034
|
-
await
|
|
2035
|
-
} catch (
|
|
2036
|
-
|
|
2184
|
+
await q();
|
|
2185
|
+
} catch (B) {
|
|
2186
|
+
$ || (p.value = B);
|
|
2037
2187
|
} finally {
|
|
2038
|
-
|
|
2188
|
+
$ || (d.value = !1);
|
|
2039
2189
|
}
|
|
2040
2190
|
}
|
|
2041
2191
|
}
|
|
2042
|
-
const
|
|
2043
|
-
await
|
|
2044
|
-
}),
|
|
2045
|
-
const
|
|
2046
|
-
|
|
2047
|
-
}),
|
|
2048
|
-
|
|
2049
|
-
}),
|
|
2050
|
-
const
|
|
2051
|
-
return Number.isNaN(
|
|
2192
|
+
const ee = () => j(J), se = (q) => j(async () => {
|
|
2193
|
+
await i.ctx.call("delegate.revoke", { delegation_id: q }), await J();
|
|
2194
|
+
}), te = (q) => j(async () => {
|
|
2195
|
+
const B = await i.ctx.call("delegate.jobs.cancel", { id: q });
|
|
2196
|
+
$ || (h.value = B.revocation_pending ? a.value.pending : ""), await J();
|
|
2197
|
+
}), ne = I(() => o.value?.state === "ready" && !!x.value && !!_.value && !!U.value), H = () => j(async () => {
|
|
2198
|
+
ne.value && (await i.ctx.call("delegate.jobs.submit", { key: P ?? (P = crypto.randomUUID()), url: _.value, dest: x.value, name: U.value }), $ || (_.value = "", U.value = "", x.value = ""), await J());
|
|
2199
|
+
}), W = (q) => {
|
|
2200
|
+
const B = new Date(q);
|
|
2201
|
+
return Number.isNaN(B.getTime()) ? "—" : B.toLocaleString(i.ctx.locale);
|
|
2052
2202
|
};
|
|
2053
|
-
return
|
|
2054
|
-
|
|
2055
|
-
|
|
2203
|
+
return C({ refresh: ee }), pe(() => {
|
|
2204
|
+
ee(), V = setInterval(() => {
|
|
2205
|
+
c.value.some(A) && ee();
|
|
2056
2206
|
}, 3e3);
|
|
2057
|
-
}),
|
|
2058
|
-
|
|
2059
|
-
}), (
|
|
2207
|
+
}), ve(() => {
|
|
2208
|
+
$ = !0, V && clearInterval(V), v.dispose();
|
|
2209
|
+
}), (q, B) => (n(), g(e(_e), {
|
|
2060
2210
|
title: a.value.title,
|
|
2061
2211
|
description: a.value.help,
|
|
2062
|
-
loading: !
|
|
2212
|
+
loading: !o.value && d.value,
|
|
2063
2213
|
collapsible: !1,
|
|
2064
|
-
"aria-busy":
|
|
2214
|
+
"aria-busy": d.value,
|
|
2065
2215
|
class: "delegate-panel"
|
|
2066
2216
|
}, {
|
|
2067
2217
|
default: t(() => [
|
|
2068
|
-
p.value && !
|
|
2218
|
+
p.value && !Y.value ? (n(), g(e(G), {
|
|
2069
2219
|
key: 0,
|
|
2070
2220
|
tone: "danger",
|
|
2071
2221
|
role: "alert"
|
|
2072
2222
|
}, {
|
|
2073
2223
|
default: t(() => [
|
|
2074
|
-
|
|
2224
|
+
k(l(e(ha)(p.value, a.value)), 1)
|
|
2075
2225
|
]),
|
|
2076
2226
|
_: 1
|
|
2077
|
-
})) :
|
|
2078
|
-
h.value ? (n(),
|
|
2079
|
-
|
|
2080
|
-
|
|
2227
|
+
})) : y("", !0),
|
|
2228
|
+
h.value ? (n(), T("p", $l, l(h.value), 1)) : y("", !0),
|
|
2229
|
+
X.value ? (n(), T("p", Sl, l(o.value?.state === "needs-admin-approval" ? a.value.needs : a.value.blocked), 1)) : y("", !0),
|
|
2230
|
+
f(e(Pe), {
|
|
2081
2231
|
direction: "vertical",
|
|
2082
|
-
onSubmit: ze(
|
|
2232
|
+
onSubmit: ze(H, ["prevent"])
|
|
2083
2233
|
}, {
|
|
2084
2234
|
default: t(() => [
|
|
2085
|
-
|
|
2235
|
+
f(e(ke), {
|
|
2086
2236
|
label: a.value.url,
|
|
2087
2237
|
"label-for": "delegate-url"
|
|
2088
2238
|
}, {
|
|
2089
2239
|
default: t(() => [
|
|
2090
|
-
|
|
2240
|
+
f(e(xe), {
|
|
2091
2241
|
id: "delegate-url",
|
|
2092
2242
|
modelValue: _.value,
|
|
2093
|
-
"onUpdate:modelValue":
|
|
2243
|
+
"onUpdate:modelValue": B[0] || (B[0] = (O) => _.value = O),
|
|
2094
2244
|
type: "url",
|
|
2095
|
-
disabled:
|
|
2245
|
+
disabled: d.value || o.value?.state !== "ready"
|
|
2096
2246
|
}, null, 8, ["modelValue", "disabled"])
|
|
2097
2247
|
]),
|
|
2098
2248
|
_: 1
|
|
2099
2249
|
}, 8, ["label"]),
|
|
2100
|
-
|
|
2250
|
+
f(e(ke), {
|
|
2101
2251
|
label: a.value.name,
|
|
2102
2252
|
"label-for": "delegate-name"
|
|
2103
2253
|
}, {
|
|
2104
2254
|
default: t(() => [
|
|
2105
|
-
|
|
2255
|
+
f(e(xe), {
|
|
2106
2256
|
id: "delegate-name",
|
|
2107
|
-
modelValue:
|
|
2108
|
-
"onUpdate:modelValue":
|
|
2257
|
+
modelValue: U.value,
|
|
2258
|
+
"onUpdate:modelValue": B[1] || (B[1] = (O) => U.value = O),
|
|
2109
2259
|
"data-file-name": "",
|
|
2110
|
-
disabled:
|
|
2260
|
+
disabled: d.value || o.value?.state !== "ready"
|
|
2111
2261
|
}, null, 8, ["modelValue", "disabled"])
|
|
2112
2262
|
]),
|
|
2113
2263
|
_: 1
|
|
2114
2264
|
}, 8, ["label"]),
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
])) :
|
|
2120
|
-
|
|
2265
|
+
z("p", null, l(a.value.size), 1),
|
|
2266
|
+
x.value ? (n(), T("p", zl, [
|
|
2267
|
+
k(l(a.value.destination) + l(u.value), 1),
|
|
2268
|
+
f(e(me), { path: x.value }, null, 8, ["path"])
|
|
2269
|
+
])) : y("", !0),
|
|
2270
|
+
f(e(Ve), null, {
|
|
2121
2271
|
default: t(() => [
|
|
2122
|
-
|
|
2272
|
+
f(e(F), {
|
|
2123
2273
|
type: "button",
|
|
2124
2274
|
variant: "secondary",
|
|
2125
|
-
disabled:
|
|
2126
|
-
onClick:
|
|
2275
|
+
disabled: d.value || o.value?.state !== "ready",
|
|
2276
|
+
onClick: B[2] || (B[2] = (O) => R.value = !0)
|
|
2127
2277
|
}, {
|
|
2128
2278
|
default: t(() => [
|
|
2129
|
-
|
|
2279
|
+
k(l(a.value.choose), 1)
|
|
2130
2280
|
]),
|
|
2131
2281
|
_: 1
|
|
2132
2282
|
}, 8, ["disabled"]),
|
|
2133
|
-
|
|
2283
|
+
f(e(F), {
|
|
2134
2284
|
type: "submit",
|
|
2135
2285
|
variant: "primary",
|
|
2136
|
-
disabled:
|
|
2286
|
+
disabled: d.value || !ne.value
|
|
2137
2287
|
}, {
|
|
2138
2288
|
default: t(() => [
|
|
2139
|
-
|
|
2289
|
+
k(l(a.value.submit), 1)
|
|
2140
2290
|
]),
|
|
2141
2291
|
_: 1
|
|
2142
2292
|
}, 8, ["disabled"])
|
|
@@ -2146,54 +2296,54 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
2146
2296
|
]),
|
|
2147
2297
|
_: 1
|
|
2148
2298
|
}),
|
|
2149
|
-
|
|
2150
|
-
open:
|
|
2151
|
-
"onUpdate:open":
|
|
2299
|
+
f(Be, {
|
|
2300
|
+
open: R.value,
|
|
2301
|
+
"onUpdate:open": B[3] || (B[3] = (O) => R.value = O),
|
|
2152
2302
|
locale: r.ctx.locale,
|
|
2153
|
-
provider: e(
|
|
2303
|
+
provider: e(v),
|
|
2154
2304
|
mode: "folder",
|
|
2155
|
-
onSelected:
|
|
2305
|
+
onSelected: B[4] || (B[4] = (O) => x.value = O)
|
|
2156
2306
|
}, null, 8, ["open", "locale", "provider"]),
|
|
2157
|
-
|
|
2158
|
-
!
|
|
2159
|
-
(n(!0),
|
|
2160
|
-
key:
|
|
2161
|
-
"data-job-state":
|
|
2307
|
+
z("h3", null, l(a.value.downloads), 1),
|
|
2308
|
+
!c.value.length && !p.value ? (n(), T("p", Pl, l(a.value.noJobs), 1)) : (n(), T("ul", Vl, [
|
|
2309
|
+
(n(!0), T(oe, null, we(c.value, (O) => (n(), T("li", {
|
|
2310
|
+
key: O.id,
|
|
2311
|
+
"data-job-state": O.state
|
|
2162
2312
|
}, [
|
|
2163
|
-
|
|
2164
|
-
role:
|
|
2165
|
-
}, l(
|
|
2166
|
-
|
|
2313
|
+
z("span", {
|
|
2314
|
+
role: O.state === "waiting_executor" ? "status" : void 0
|
|
2315
|
+
}, l(O.name) + " · " + l(a.value[O.state]), 9, Il),
|
|
2316
|
+
A(O) ? (n(), g(e(F), {
|
|
2167
2317
|
key: 0,
|
|
2168
2318
|
variant: "secondary",
|
|
2169
|
-
disabled:
|
|
2170
|
-
onClick: (
|
|
2319
|
+
disabled: d.value,
|
|
2320
|
+
onClick: (Z) => te(O.id)
|
|
2171
2321
|
}, {
|
|
2172
2322
|
default: t(() => [
|
|
2173
|
-
|
|
2323
|
+
k(l(a.value.cancel), 1)
|
|
2174
2324
|
]),
|
|
2175
2325
|
_: 1
|
|
2176
|
-
}, 8, ["disabled", "onClick"])) :
|
|
2177
|
-
], 8,
|
|
2326
|
+
}, 8, ["disabled", "onClick"])) : y("", !0)
|
|
2327
|
+
], 8, Al))), 128))
|
|
2178
2328
|
])),
|
|
2179
|
-
|
|
2180
|
-
!s.value.length && !p.value ? (n(),
|
|
2181
|
-
(n(!0),
|
|
2182
|
-
key:
|
|
2329
|
+
z("h3", null, l(a.value.delegations), 1),
|
|
2330
|
+
!s.value.length && !p.value ? (n(), T("p", El, l(a.value.noDelegations), 1)) : (n(), T("ul", Tl, [
|
|
2331
|
+
(n(!0), T(oe, null, we(s.value, (O) => (n(), T("li", {
|
|
2332
|
+
key: O.delegation_id
|
|
2183
2333
|
}, [
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
path:
|
|
2334
|
+
z("div", null, [
|
|
2335
|
+
f(e(me), {
|
|
2336
|
+
path: O.path
|
|
2187
2337
|
}, null, 8, ["path"]),
|
|
2188
|
-
|
|
2338
|
+
z("p", null, l(a.value.expires) + l(u.value) + l(W(O.expires_at)), 1)
|
|
2189
2339
|
]),
|
|
2190
|
-
|
|
2340
|
+
f(e(F), {
|
|
2191
2341
|
variant: "secondary",
|
|
2192
|
-
disabled:
|
|
2193
|
-
onClick: (
|
|
2342
|
+
disabled: d.value,
|
|
2343
|
+
onClick: (Z) => se(O.delegation_id)
|
|
2194
2344
|
}, {
|
|
2195
2345
|
default: t(() => [
|
|
2196
|
-
|
|
2346
|
+
k(l(a.value.revoke), 1)
|
|
2197
2347
|
]),
|
|
2198
2348
|
_: 1
|
|
2199
2349
|
}, 8, ["disabled", "onClick"])
|
|
@@ -2203,37 +2353,37 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
2203
2353
|
_: 1
|
|
2204
2354
|
}, 8, ["title", "description", "loading", "aria-busy"]));
|
|
2205
2355
|
}
|
|
2206
|
-
}),
|
|
2356
|
+
}), xn = /* @__PURE__ */ re(Ul, [["__scopeId", "data-v-c590f505"]]), Rl = { class: "save-alert" }, Dl = { "data-save-error": "" }, Bl = {
|
|
2207
2357
|
key: 2,
|
|
2208
2358
|
class: "save-summary"
|
|
2209
|
-
},
|
|
2359
|
+
}, Fl = ["data-save-status"], ql = {
|
|
2210
2360
|
key: 7,
|
|
2211
2361
|
class: "save-help"
|
|
2212
|
-
},
|
|
2362
|
+
}, Nl = {
|
|
2213
2363
|
key: 8,
|
|
2214
2364
|
class: "save-records"
|
|
2215
|
-
},
|
|
2365
|
+
}, Ol = { class: "save-record" }, Ll = { class: "save-note" }, Ml = {
|
|
2216
2366
|
key: 9,
|
|
2217
2367
|
class: "save-actions"
|
|
2218
|
-
},
|
|
2368
|
+
}, Kl = {
|
|
2219
2369
|
key: 11,
|
|
2220
2370
|
class: "save-example"
|
|
2221
|
-
},
|
|
2371
|
+
}, Hl = { class: "save-help" }, Gl = { class: "save-actions" }, Jl = {
|
|
2222
2372
|
key: 12,
|
|
2223
2373
|
class: "save-help"
|
|
2224
|
-
},
|
|
2374
|
+
}, Wl = {
|
|
2225
2375
|
key: 13,
|
|
2226
2376
|
"data-save-operations": ""
|
|
2227
|
-
},
|
|
2377
|
+
}, Xl = ["data-save-job", "title"], Ql = {
|
|
2228
2378
|
key: 0,
|
|
2229
2379
|
class: "save-note"
|
|
2230
|
-
},
|
|
2380
|
+
}, Yl = {
|
|
2231
2381
|
key: 1,
|
|
2232
2382
|
class: "save-note"
|
|
2233
|
-
},
|
|
2383
|
+
}, Zl = ["data-save-state"], jl = { key: 1 }, en = {
|
|
2234
2384
|
class: "save-danger",
|
|
2235
2385
|
"data-save-danger": ""
|
|
2236
|
-
},
|
|
2386
|
+
}, Ae = 10, an = /* @__PURE__ */ ie({
|
|
2237
2387
|
__name: "BackgroundSavePanel",
|
|
2238
2388
|
props: {
|
|
2239
2389
|
sdk: {},
|
|
@@ -2244,337 +2394,337 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
2244
2394
|
sampleSave: { type: Boolean }
|
|
2245
2395
|
},
|
|
2246
2396
|
emits: ["authorized"],
|
|
2247
|
-
setup(r, { expose:
|
|
2248
|
-
const a = r, u =
|
|
2249
|
-
let V = !1,
|
|
2250
|
-
const
|
|
2251
|
-
function
|
|
2252
|
-
|
|
2397
|
+
setup(r, { expose: C, emit: i }) {
|
|
2398
|
+
const a = r, u = i, v = m(!1), o = m(""), s = I(() => ta(a.locale)), c = m(), d = m([]), p = m([]), h = m(!1), R = m(), x = m(""), _ = m(!1), U = m([]), $ = I(() => a.picker && (c.value?.selection ? ka(a.picker.provider, c.value.selection.root) : c.value?.scopeMode === "install-selected" ? void 0 : a.picker.provider));
|
|
2399
|
+
let V = !1, P;
|
|
2400
|
+
const A = (M) => M.state === "copying" && M.code === "CANCEL_REQUESTED", K = (M) => A(M) ? "canceling" : M.state === "committed" && !M.receipt?.path ? "uncertain" : M.state, Q = (M) => ["queued", "copying"].includes(M.state) && !A(M);
|
|
2401
|
+
function Y() {
|
|
2402
|
+
c.value = void 0, d.value = [], p.value = [], U.value = [], v.value = !1;
|
|
2253
2403
|
}
|
|
2254
|
-
async function
|
|
2255
|
-
const [
|
|
2404
|
+
async function X() {
|
|
2405
|
+
const [M, le, N, S] = await Promise.all([a.sdk.status(), a.sdk.list(), a.sdk.operations(), Promise.all((a.picker?.keys ?? []).map((E) => a.sdk.destination(E)))]);
|
|
2256
2406
|
if (!V) {
|
|
2257
|
-
if (!
|
|
2258
|
-
(
|
|
2407
|
+
if (!M || typeof M.disabled != "boolean" || !Array.isArray(le) || !Array.isArray(N)) throw { code: "unavailable" };
|
|
2408
|
+
(c.value?.selection?.generation !== M.selection?.generation || c.value?.selection?.scope !== M.selection?.scope) && (v.value = !1), c.value = M, d.value = S.length ? le.filter((E) => S.some((D) => D.status === "active" && D.destination?.id === E.id)) : le, p.value = N, U.value = S;
|
|
2259
2409
|
}
|
|
2260
2410
|
}
|
|
2261
|
-
async function
|
|
2411
|
+
async function J(M) {
|
|
2262
2412
|
if (!(V || h.value)) {
|
|
2263
|
-
h.value = !0,
|
|
2413
|
+
h.value = !0, R.value = void 0, x.value = "", _.value = !1;
|
|
2264
2414
|
try {
|
|
2265
|
-
await
|
|
2266
|
-
} catch (
|
|
2267
|
-
V || (
|
|
2415
|
+
await M();
|
|
2416
|
+
} catch (le) {
|
|
2417
|
+
V || (Y(), R.value = le);
|
|
2268
2418
|
} finally {
|
|
2269
2419
|
V || (h.value = !1);
|
|
2270
2420
|
}
|
|
2271
2421
|
}
|
|
2272
2422
|
}
|
|
2273
|
-
const j = () =>
|
|
2274
|
-
function
|
|
2275
|
-
u("authorized",
|
|
2423
|
+
const j = () => J(X);
|
|
2424
|
+
function ee(M) {
|
|
2425
|
+
u("authorized", M), j();
|
|
2276
2426
|
}
|
|
2277
|
-
function
|
|
2278
|
-
V || (
|
|
2427
|
+
function se(M) {
|
|
2428
|
+
V || (x.value = "", R.value = M, _.value = !0);
|
|
2279
2429
|
}
|
|
2280
|
-
const
|
|
2281
|
-
if ((await a.sdk.revoke({ delegation_id:
|
|
2282
|
-
await
|
|
2283
|
-
}),
|
|
2284
|
-
await a.sdk.cancel({ delegation_id:
|
|
2285
|
-
}),
|
|
2286
|
-
if (!a.admin || !
|
|
2287
|
-
const
|
|
2288
|
-
if ((
|
|
2289
|
-
await
|
|
2290
|
-
}),
|
|
2291
|
-
const
|
|
2292
|
-
await a.sdk.exportExample({ key:
|
|
2293
|
-
}),
|
|
2294
|
-
return
|
|
2295
|
-
j(),
|
|
2296
|
-
p.value.some(
|
|
2430
|
+
const te = I(() => _.value ? a.pickerErrorText?.(R.value) ?? Ie(R.value, s.value, "select") : Ie(R.value, s.value)), ne = (M) => J(async () => {
|
|
2431
|
+
if ((await a.sdk.revoke({ delegation_id: M }))?.revoked !== !0) throw { code: "commit-uncertain" };
|
|
2432
|
+
await X(), V || (x.value = s.value.revoked);
|
|
2433
|
+
}), H = (M) => J(async () => {
|
|
2434
|
+
await a.sdk.cancel({ delegation_id: M.delegation_id, job_id: M.job_id }), await X();
|
|
2435
|
+
}), W = () => J(async () => {
|
|
2436
|
+
if (!a.admin || !c.value) return;
|
|
2437
|
+
const M = c.value.disabled;
|
|
2438
|
+
if ((M ? await a.sdk.enable() : await a.sdk.disable())?.disabled !== !M) throw { code: "commit-uncertain" };
|
|
2439
|
+
await X();
|
|
2440
|
+
}), q = (M) => J(async () => {
|
|
2441
|
+
const le = "example-" + Array.from(crypto.getRandomValues(new Uint8Array(16)), (N) => N.toString(16).padStart(2, "0")).join("");
|
|
2442
|
+
await a.sdk.exportExample({ key: M, job_id: le }), await X();
|
|
2443
|
+
}), B = m(1), O = I(() => p.value.slice((B.value - 1) * Ae, B.value * Ae)), Z = I(() => [{ key: "name", label: s.value.file }, { key: "state", label: s.value.status, width: "6.5rem" }, { key: "size", label: s.value.size, width: "6rem", align: "right" }, { key: "location", label: s.value.location, width: "30%" }, { key: "actions", label: "", width: "7.5rem" }]), ae = (M) => ({ committed: "success", canceled: "neutral", canceling: "neutral", interrupted: "danger", uncertain: "warning" })[K(M)] ?? "info", ue = (M) => M.slice(0, M.lastIndexOf("/")) || "/", Ce = I(() => c.value?.scopeMode === "install-selected" && !c.value.selection), fe = I(() => c.value ? c.value.disabled ? "disabled" : Ce.value ? "needs-scope" : "enabled" : void 0), ye = (M) => a.picker?.labels?.[M] ? `${s.value.choose}${be.value}${a.picker.labels[M]}` : s.value.choose, ce = (M) => a.picker?.labels?.[M] ? `${s.value.example}${be.value}${a.picker.labels[M]}` : s.value.example, be = I(() => na(a.locale));
|
|
2444
|
+
return C({ refresh: j }), pe(() => {
|
|
2445
|
+
j(), P = setInterval(() => {
|
|
2446
|
+
p.value.some(Q) && j();
|
|
2297
2447
|
}, 3e3);
|
|
2298
|
-
}),
|
|
2299
|
-
V = !0,
|
|
2300
|
-
}), (
|
|
2448
|
+
}), ve(() => {
|
|
2449
|
+
V = !0, P && clearInterval(P);
|
|
2450
|
+
}), (M, le) => (n(), g(e(_e), {
|
|
2301
2451
|
title: s.value.title,
|
|
2302
2452
|
description: s.value.help,
|
|
2303
|
-
loading: h.value && !
|
|
2453
|
+
loading: h.value && !c.value && !R.value,
|
|
2304
2454
|
collapsible: !1,
|
|
2305
2455
|
"aria-busy": h.value,
|
|
2306
2456
|
class: "background-save-panel"
|
|
2307
|
-
},
|
|
2457
|
+
}, Ke({
|
|
2308
2458
|
default: t(() => [
|
|
2309
|
-
|
|
2459
|
+
R.value ? (n(), g(e(G), {
|
|
2310
2460
|
key: 0,
|
|
2311
2461
|
tone: "danger",
|
|
2312
2462
|
role: "alert",
|
|
2313
2463
|
class: "save-message"
|
|
2314
2464
|
}, {
|
|
2315
2465
|
default: t(() => [
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2466
|
+
z("span", Rl, [
|
|
2467
|
+
z("span", Dl, l(te.value), 1),
|
|
2468
|
+
f(e(F), {
|
|
2319
2469
|
variant: "secondary",
|
|
2320
2470
|
size: "sm",
|
|
2321
2471
|
disabled: h.value,
|
|
2322
2472
|
onClick: j
|
|
2323
2473
|
}, {
|
|
2324
2474
|
default: t(() => [
|
|
2325
|
-
|
|
2475
|
+
k(l(s.value.retry), 1)
|
|
2326
2476
|
]),
|
|
2327
2477
|
_: 1
|
|
2328
2478
|
}, 8, ["disabled"])
|
|
2329
2479
|
])
|
|
2330
2480
|
]),
|
|
2331
2481
|
_: 1
|
|
2332
|
-
})) :
|
|
2333
|
-
|
|
2482
|
+
})) : y("", !0),
|
|
2483
|
+
x.value ? (n(), g(e(G), {
|
|
2334
2484
|
key: 1,
|
|
2335
2485
|
tone: "success",
|
|
2336
2486
|
role: "status"
|
|
2337
2487
|
}, {
|
|
2338
2488
|
default: t(() => [
|
|
2339
|
-
|
|
2489
|
+
k(l(x.value), 1)
|
|
2340
2490
|
]),
|
|
2341
2491
|
_: 1
|
|
2342
|
-
})) :
|
|
2343
|
-
|
|
2344
|
-
|
|
2492
|
+
})) : y("", !0),
|
|
2493
|
+
c.value ? (n(), T("div", Bl, [
|
|
2494
|
+
f(e($e), {
|
|
2345
2495
|
label: s.value.status,
|
|
2346
2496
|
"label-width": "10rem"
|
|
2347
2497
|
}, {
|
|
2348
2498
|
default: t(() => [
|
|
2349
|
-
|
|
2499
|
+
z("span", {
|
|
2350
2500
|
role: "status",
|
|
2351
|
-
"data-save-status":
|
|
2501
|
+
"data-save-status": fe.value
|
|
2352
2502
|
}, [
|
|
2353
|
-
|
|
2354
|
-
tone:
|
|
2503
|
+
f(e(Se), {
|
|
2504
|
+
tone: fe.value === "enabled" ? "success" : fe.value === "disabled" ? "neutral" : "warning"
|
|
2355
2505
|
}, {
|
|
2356
2506
|
default: t(() => [
|
|
2357
|
-
|
|
2507
|
+
k(l(fe.value === "enabled" ? s.value.statusEnabled : fe.value === "disabled" ? s.value.statusDisabled : s.value.statusNeedsScope), 1)
|
|
2358
2508
|
]),
|
|
2359
2509
|
_: 1
|
|
2360
2510
|
}, 8, ["tone"])
|
|
2361
|
-
], 8,
|
|
2511
|
+
], 8, Fl)
|
|
2362
2512
|
]),
|
|
2363
2513
|
_: 1
|
|
2364
2514
|
}, 8, ["label"]),
|
|
2365
|
-
|
|
2515
|
+
c.value.selection ? (n(), g(e($e), {
|
|
2366
2516
|
key: 0,
|
|
2367
2517
|
label: s.value.scope,
|
|
2368
2518
|
"label-width": "10rem",
|
|
2369
2519
|
"data-save-scope": ""
|
|
2370
2520
|
}, {
|
|
2371
2521
|
default: t(() => [
|
|
2372
|
-
|
|
2373
|
-
path:
|
|
2522
|
+
f(e(me), {
|
|
2523
|
+
path: c.value.selection.root
|
|
2374
2524
|
}, null, 8, ["path"])
|
|
2375
2525
|
]),
|
|
2376
2526
|
_: 1
|
|
2377
|
-
}, 8, ["label"])) :
|
|
2378
|
-
])) :
|
|
2379
|
-
|
|
2527
|
+
}, 8, ["label"])) : y("", !0)
|
|
2528
|
+
])) : y("", !0),
|
|
2529
|
+
c.value?.mismatch ? (n(), g(e(G), {
|
|
2380
2530
|
key: 3,
|
|
2381
2531
|
tone: "warning"
|
|
2382
2532
|
}, {
|
|
2383
2533
|
default: t(() => [
|
|
2384
|
-
|
|
2534
|
+
k(l(s.value.scopeMismatch) + " " + l(c.value.preselection) + " → " + l(c.value.selection?.root), 1)
|
|
2385
2535
|
]),
|
|
2386
2536
|
_: 1
|
|
2387
|
-
})) :
|
|
2388
|
-
Ce.value ? (n(),
|
|
2537
|
+
})) : y("", !0),
|
|
2538
|
+
Ce.value ? (n(), g(e(G), {
|
|
2389
2539
|
key: 4,
|
|
2390
2540
|
tone: "warning"
|
|
2391
2541
|
}, {
|
|
2392
2542
|
default: t(() => [
|
|
2393
|
-
|
|
2543
|
+
k(l(s.value.scopeNeeds), 1)
|
|
2394
2544
|
]),
|
|
2395
2545
|
_: 1
|
|
2396
|
-
})) :
|
|
2397
|
-
|
|
2546
|
+
})) : y("", !0),
|
|
2547
|
+
c.value?.disabled ? (n(), g(e(G), {
|
|
2398
2548
|
key: 5,
|
|
2399
2549
|
tone: "warning",
|
|
2400
2550
|
class: "save-message"
|
|
2401
2551
|
}, {
|
|
2402
2552
|
default: t(() => [
|
|
2403
|
-
|
|
2553
|
+
k(l(s.value.disabled), 1)
|
|
2404
2554
|
]),
|
|
2405
2555
|
_: 1
|
|
2406
|
-
})) :
|
|
2407
|
-
|
|
2408
|
-
|
|
2556
|
+
})) : y("", !0),
|
|
2557
|
+
z("h3", null, l(s.value.delegations), 1),
|
|
2558
|
+
U.value.some((N) => N.status === "reselection-required") ? (n(), g(e(G), {
|
|
2409
2559
|
key: 6,
|
|
2410
2560
|
tone: "warning"
|
|
2411
2561
|
}, {
|
|
2412
2562
|
default: t(() => [
|
|
2413
|
-
|
|
2563
|
+
k(l(s.value.reselect), 1)
|
|
2414
2564
|
]),
|
|
2415
2565
|
_: 1
|
|
2416
|
-
})) :
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
(n(!0),
|
|
2420
|
-
key:
|
|
2566
|
+
})) : y("", !0),
|
|
2567
|
+
c.value && !d.value.length ? (n(), T("p", ql, l(s.value.empty), 1)) : y("", !0),
|
|
2568
|
+
d.value.length ? (n(), T("ul", Nl, [
|
|
2569
|
+
(n(!0), T(oe, null, we(d.value, (N) => (n(), T("li", {
|
|
2570
|
+
key: N.id
|
|
2421
2571
|
}, [
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
path:
|
|
2572
|
+
z("div", Ol, [
|
|
2573
|
+
f(e(me), {
|
|
2574
|
+
path: N.path
|
|
2425
2575
|
}, null, 8, ["path"]),
|
|
2426
|
-
|
|
2576
|
+
z("span", Ll, l(s.value.untilRevoked), 1)
|
|
2427
2577
|
]),
|
|
2428
|
-
|
|
2578
|
+
f(e(F), {
|
|
2429
2579
|
variant: "secondary",
|
|
2430
2580
|
disabled: h.value,
|
|
2431
|
-
onClick: (
|
|
2581
|
+
onClick: (S) => ne(N.id)
|
|
2432
2582
|
}, {
|
|
2433
2583
|
default: t(() => [
|
|
2434
|
-
|
|
2584
|
+
k(l(s.value.revoke), 1)
|
|
2435
2585
|
]),
|
|
2436
2586
|
_: 1
|
|
2437
2587
|
}, 8, ["disabled", "onClick"])
|
|
2438
2588
|
]))), 128))
|
|
2439
|
-
])) :
|
|
2440
|
-
r.picker ? (n(),
|
|
2441
|
-
(n(!0),
|
|
2442
|
-
key:
|
|
2589
|
+
])) : y("", !0),
|
|
2590
|
+
r.picker ? (n(), T("div", Ml, [
|
|
2591
|
+
(n(!0), T(oe, null, we(r.picker.keys, (N) => (n(), g(e(F), {
|
|
2592
|
+
key: N,
|
|
2443
2593
|
variant: "secondary",
|
|
2444
|
-
disabled: h.value || !
|
|
2445
|
-
onClick: (
|
|
2446
|
-
|
|
2594
|
+
disabled: h.value || !c.value || c.value.disabled || !$.value,
|
|
2595
|
+
onClick: (S) => {
|
|
2596
|
+
o.value = N, v.value = !0;
|
|
2447
2597
|
}
|
|
2448
2598
|
}, {
|
|
2449
2599
|
default: t(() => [
|
|
2450
|
-
|
|
2600
|
+
k(l(ye(N)), 1)
|
|
2451
2601
|
]),
|
|
2452
2602
|
_: 2
|
|
2453
2603
|
}, 1032, ["disabled", "onClick"]))), 128))
|
|
2454
|
-
])) :
|
|
2455
|
-
|
|
2456
|
-
key:
|
|
2457
|
-
open:
|
|
2458
|
-
"onUpdate:open":
|
|
2459
|
-
provider:
|
|
2604
|
+
])) : y("", !0),
|
|
2605
|
+
$.value ? (n(), g(Be, {
|
|
2606
|
+
key: c.value?.selection?.scope,
|
|
2607
|
+
open: v.value,
|
|
2608
|
+
"onUpdate:open": le[0] || (le[0] = (N) => v.value = N),
|
|
2609
|
+
provider: $.value,
|
|
2460
2610
|
locale: r.locale,
|
|
2461
2611
|
mode: "folder",
|
|
2462
|
-
destination: { key:
|
|
2463
|
-
onAuthorized:
|
|
2464
|
-
onRefused:
|
|
2612
|
+
destination: { key: o.value, selectDestination: r.sdk.selectDestination },
|
|
2613
|
+
onAuthorized: ee,
|
|
2614
|
+
onRefused: se,
|
|
2465
2615
|
"error-text": r.pickerErrorText
|
|
2466
|
-
}, null, 8, ["open", "provider", "locale", "destination", "error-text"])) :
|
|
2467
|
-
r.sampleSave &&
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
(n(!0),
|
|
2471
|
-
key:
|
|
2616
|
+
}, null, 8, ["open", "provider", "locale", "destination", "error-text"])) : y("", !0),
|
|
2617
|
+
r.sampleSave && U.value.some((N) => N.status === "active") ? (n(), T("div", Kl, [
|
|
2618
|
+
z("p", Hl, l(s.value.exampleHelp), 1),
|
|
2619
|
+
z("div", Gl, [
|
|
2620
|
+
(n(!0), T(oe, null, we(U.value.filter((N) => N.status === "active"), (N) => (n(), g(e(F), {
|
|
2621
|
+
key: N.key,
|
|
2472
2622
|
variant: "secondary",
|
|
2473
|
-
disabled: h.value ||
|
|
2474
|
-
onClick: (
|
|
2623
|
+
disabled: h.value || c.value?.disabled,
|
|
2624
|
+
onClick: (S) => q(N.key)
|
|
2475
2625
|
}, {
|
|
2476
2626
|
default: t(() => [
|
|
2477
|
-
|
|
2627
|
+
k(l(ce(N.key)), 1)
|
|
2478
2628
|
]),
|
|
2479
2629
|
_: 2
|
|
2480
2630
|
}, 1032, ["disabled", "onClick"]))), 128))
|
|
2481
2631
|
])
|
|
2482
|
-
])) :
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
p.value.length ? (n(),
|
|
2486
|
-
|
|
2487
|
-
columns:
|
|
2488
|
-
rows:
|
|
2632
|
+
])) : y("", !0),
|
|
2633
|
+
z("h3", null, l(s.value.operations), 1),
|
|
2634
|
+
c.value && !p.value.length ? (n(), T("p", Jl, l(s.value.noOperations), 1)) : y("", !0),
|
|
2635
|
+
p.value.length ? (n(), T("div", Wl, [
|
|
2636
|
+
f(e(Ma), {
|
|
2637
|
+
columns: Z.value,
|
|
2638
|
+
rows: O.value,
|
|
2489
2639
|
"row-key": "job_id"
|
|
2490
2640
|
}, {
|
|
2491
|
-
"cell-name": t(({ row:
|
|
2492
|
-
|
|
2641
|
+
"cell-name": t(({ row: N }) => [
|
|
2642
|
+
z("span", {
|
|
2493
2643
|
class: "save-name",
|
|
2494
|
-
"data-save-job":
|
|
2495
|
-
title:
|
|
2496
|
-
}, l(
|
|
2497
|
-
|
|
2644
|
+
"data-save-job": N.job_id,
|
|
2645
|
+
title: N.name
|
|
2646
|
+
}, l(N.name), 9, Xl),
|
|
2647
|
+
K(N) === "uncertain" ? (n(), T("p", Ql, l(s.value.uncertainHelp), 1)) : K(N) === "interrupted" ? (n(), T("p", Yl, l(N.code ? e(Ie)({ code: N.code }, s.value) : s.value.interruptedHelp), 1)) : y("", !0)
|
|
2498
2648
|
]),
|
|
2499
|
-
"cell-state": t(({ row:
|
|
2500
|
-
|
|
2501
|
-
"data-save-state":
|
|
2649
|
+
"cell-state": t(({ row: N }) => [
|
|
2650
|
+
z("span", {
|
|
2651
|
+
"data-save-state": K(N)
|
|
2502
2652
|
}, [
|
|
2503
|
-
|
|
2504
|
-
tone:
|
|
2653
|
+
f(e(Se), {
|
|
2654
|
+
tone: ae(N)
|
|
2505
2655
|
}, {
|
|
2506
2656
|
default: t(() => [
|
|
2507
|
-
|
|
2657
|
+
k(l(s.value[K(N)]), 1)
|
|
2508
2658
|
]),
|
|
2509
2659
|
_: 2
|
|
2510
2660
|
}, 1032, ["tone"])
|
|
2511
|
-
], 8,
|
|
2661
|
+
], 8, Zl)
|
|
2512
2662
|
]),
|
|
2513
|
-
"cell-size": t(({ row:
|
|
2514
|
-
|
|
2663
|
+
"cell-size": t(({ row: N }) => [
|
|
2664
|
+
k(l(N.receipt?.size !== void 0 ? e(Ka)(N.receipt.size) : "—"), 1)
|
|
2515
2665
|
]),
|
|
2516
|
-
"cell-location": t(({ row:
|
|
2517
|
-
|
|
2666
|
+
"cell-location": t(({ row: N }) => [
|
|
2667
|
+
K(N) === "committed" ? (n(), g(e(me), {
|
|
2518
2668
|
key: 0,
|
|
2519
|
-
path:
|
|
2520
|
-
}, null, 8, ["path"])) : (n(),
|
|
2669
|
+
path: N.receipt.path
|
|
2670
|
+
}, null, 8, ["path"])) : (n(), T("span", jl, "—"))
|
|
2521
2671
|
]),
|
|
2522
|
-
"cell-actions": t(({ row:
|
|
2523
|
-
|
|
2672
|
+
"cell-actions": t(({ row: N }) => [
|
|
2673
|
+
K(N) === "committed" ? (n(), g(e(F), {
|
|
2524
2674
|
key: 0,
|
|
2525
2675
|
variant: "ghost",
|
|
2526
2676
|
size: "sm",
|
|
2527
2677
|
"aria-label": s.value.openFolder,
|
|
2528
2678
|
title: s.value.openFolder,
|
|
2529
|
-
onClick: (
|
|
2679
|
+
onClick: (S) => e(_a)(ue(N.receipt.path))
|
|
2530
2680
|
}, {
|
|
2531
2681
|
default: t(() => [
|
|
2532
|
-
|
|
2682
|
+
f(e(Ya), {
|
|
2533
2683
|
class: "save-icon",
|
|
2534
2684
|
"aria-hidden": "true"
|
|
2535
2685
|
})
|
|
2536
2686
|
]),
|
|
2537
2687
|
_: 1
|
|
2538
|
-
}, 8, ["aria-label", "title", "onClick"])) :
|
|
2539
|
-
|
|
2688
|
+
}, 8, ["aria-label", "title", "onClick"])) : y("", !0),
|
|
2689
|
+
Q(N) ? (n(), g(e(F), {
|
|
2540
2690
|
key: 1,
|
|
2541
2691
|
variant: "secondary",
|
|
2542
2692
|
size: "sm",
|
|
2543
2693
|
disabled: h.value,
|
|
2544
|
-
onClick: (
|
|
2694
|
+
onClick: (S) => H(N)
|
|
2545
2695
|
}, {
|
|
2546
2696
|
default: t(() => [
|
|
2547
|
-
|
|
2697
|
+
k(l(s.value.cancel), 1)
|
|
2548
2698
|
]),
|
|
2549
2699
|
_: 1
|
|
2550
|
-
}, 8, ["disabled", "onClick"])) :
|
|
2700
|
+
}, 8, ["disabled", "onClick"])) : y("", !0)
|
|
2551
2701
|
]),
|
|
2552
2702
|
_: 1
|
|
2553
2703
|
}, 8, ["columns", "rows"]),
|
|
2554
|
-
p.value.length >
|
|
2704
|
+
p.value.length > Ae ? (n(), g(e(Ha), {
|
|
2555
2705
|
key: 0,
|
|
2556
|
-
modelValue:
|
|
2557
|
-
"onUpdate:modelValue":
|
|
2706
|
+
modelValue: B.value,
|
|
2707
|
+
"onUpdate:modelValue": le[1] || (le[1] = (N) => B.value = N),
|
|
2558
2708
|
total: p.value.length,
|
|
2559
|
-
"page-size":
|
|
2709
|
+
"page-size": Ae,
|
|
2560
2710
|
class: "save-pages"
|
|
2561
|
-
}, null, 8, ["modelValue", "total"])) :
|
|
2562
|
-
])) :
|
|
2711
|
+
}, null, 8, ["modelValue", "total"])) : y("", !0)
|
|
2712
|
+
])) : y("", !0)
|
|
2563
2713
|
]),
|
|
2564
2714
|
_: 2
|
|
2565
2715
|
}, [
|
|
2566
|
-
r.admin &&
|
|
2716
|
+
r.admin && c.value ? {
|
|
2567
2717
|
name: "footer",
|
|
2568
2718
|
fn: t(() => [
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
variant:
|
|
2719
|
+
z("div", en, [
|
|
2720
|
+
z("p", null, l(s.value.disableHelp), 1),
|
|
2721
|
+
f(e(F), {
|
|
2722
|
+
variant: c.value.disabled ? "secondary" : "danger",
|
|
2573
2723
|
disabled: h.value,
|
|
2574
|
-
onClick:
|
|
2724
|
+
onClick: W
|
|
2575
2725
|
}, {
|
|
2576
2726
|
default: t(() => [
|
|
2577
|
-
|
|
2727
|
+
k(l(c.value.disabled ? s.value.enable : s.value.disable), 1)
|
|
2578
2728
|
]),
|
|
2579
2729
|
_: 1
|
|
2580
2730
|
}, 8, ["variant", "disabled"])
|
|
@@ -2584,187 +2734,187 @@ const st = ["aria-busy", "aria-label"], it = { class: "file-toolbar file-locatio
|
|
|
2584
2734
|
} : void 0
|
|
2585
2735
|
]), 1032, ["title", "description", "loading", "aria-busy"]));
|
|
2586
2736
|
}
|
|
2587
|
-
}),
|
|
2588
|
-
function
|
|
2589
|
-
const r =
|
|
2737
|
+
}), Cn = /* @__PURE__ */ re(an, [["__scopeId", "data-v-5ef5e256"]]), pa = /* @__PURE__ */ Symbol("authorization");
|
|
2738
|
+
function tn() {
|
|
2739
|
+
const r = Re(pa, void 0);
|
|
2590
2740
|
if (!r) throw Error("authorization controls must be placed inside AuthorizationGate");
|
|
2591
2741
|
return r;
|
|
2592
2742
|
}
|
|
2593
|
-
const
|
|
2743
|
+
const ln = { class: "authorization-content" }, nn = ["aria-busy", "data-authorization-state"], sn = { class: "authorization-body" }, on = /* @__PURE__ */ ie({
|
|
2594
2744
|
__name: "AuthorizationGate",
|
|
2595
2745
|
props: {
|
|
2596
2746
|
ctx: {},
|
|
2597
2747
|
name: {}
|
|
2598
2748
|
},
|
|
2599
2749
|
emits: ["ready"],
|
|
2600
|
-
setup(r, { emit:
|
|
2601
|
-
const
|
|
2602
|
-
let
|
|
2603
|
-
const _ =
|
|
2604
|
-
function j(
|
|
2605
|
-
if (!
|
|
2606
|
-
return
|
|
2750
|
+
setup(r, { emit: C }) {
|
|
2751
|
+
const i = r, a = C, u = m(), v = m(), o = m(!1), s = m(!1), c = m(!1);
|
|
2752
|
+
let d = [], p = !1, h = 0, R = !1, x;
|
|
2753
|
+
const _ = I(() => wa(i.ctx.locale, i.name ?? i.ctx.displayName ?? "")), U = I(() => u.value || v.value), $ = I(() => U.value?.state === "authorization_required"), V = I(() => ["helper_untrusted", "cli_untrusted"].includes(U.value?.reason || "")), P = I(() => $.value && !V.value), A = I(() => U.value?.reason === "credential_not_ready" ? "credential" : "unavailable"), K = I(() => U.value ? $.value ? _.value("title") : U.value.state === "ready" ? _.value("ready") : U.value.state === "not_admin" ? _.value("not_admin.title") : U.value.state === "session_expired" ? _.value("session_expired.title") : _.value(A.value + ".title") : _.value("checking")), Q = I(() => $.value ? _.value("purpose") : U.value?.state === "not_admin" ? _.value("not_admin.body") : U.value?.state === "session_expired" ? _.value("session_expired.body") : U.value?.state === "unavailable" ? _.value(A.value + ".body") : _.value("purpose")), Y = ["grant_missing", "upgrade_reapproval", "helper_untrusted", "cli_untrusted", "grant_incompatible", "package_identity_changed", "maintenance_task_missing", "maintenance_task_mismatch", "helper_health_rejected", "capability_missing"], X = I(() => Y.includes(U.value?.reason || "") ? U.value.reason : "unknown"), J = I(() => V.value ? "next.reinstall" : X.value === "grant_missing" ? "next.install" : X.value === "upgrade_reapproval" || X.value === "grant_incompatible" ? "next.update" : "next.repair");
|
|
2754
|
+
function j(q) {
|
|
2755
|
+
if (!q || q.command !== "authorization" || q.schema_version !== 1 || !["ready", "authorization_required", "not_admin", "session_expired", "unavailable"].includes(q.state) || q.reason === "upgrade_reapproval" && q.state !== "authorization_required") throw Error("invalid status");
|
|
2756
|
+
return q;
|
|
2607
2757
|
}
|
|
2608
|
-
const
|
|
2609
|
-
async function
|
|
2610
|
-
const
|
|
2611
|
-
for (let
|
|
2758
|
+
const ee = [1e3, 3e3];
|
|
2759
|
+
async function se(q) {
|
|
2760
|
+
const B = q === "status" && !c.value ? ee : [];
|
|
2761
|
+
for (let O = 0; ; O++) {
|
|
2612
2762
|
try {
|
|
2613
|
-
const
|
|
2614
|
-
if (
|
|
2615
|
-
} catch (
|
|
2616
|
-
if (
|
|
2763
|
+
const Z = j(await i.ctx.authorization?.[q]());
|
|
2764
|
+
if (Z.state !== "unavailable" || O >= B.length) return Z;
|
|
2765
|
+
} catch (Z) {
|
|
2766
|
+
if (Z.code === "session_required" || O >= B.length) throw Z;
|
|
2617
2767
|
}
|
|
2618
|
-
if (await new Promise((
|
|
2768
|
+
if (await new Promise((Z) => setTimeout(Z, B[O])), p) throw Error("disposed");
|
|
2619
2769
|
}
|
|
2620
2770
|
}
|
|
2621
|
-
async function
|
|
2622
|
-
if (
|
|
2623
|
-
const
|
|
2624
|
-
|
|
2771
|
+
async function te(q) {
|
|
2772
|
+
if (o.value || p) return;
|
|
2773
|
+
const B = ++h;
|
|
2774
|
+
v.value = q === "request" && u.value?.state === "authorization_required" ? u.value : void 0, o.value = !0, s.value = !1, u.value = void 0;
|
|
2625
2775
|
try {
|
|
2626
|
-
const
|
|
2627
|
-
if (p ||
|
|
2628
|
-
u.value =
|
|
2629
|
-
} catch (
|
|
2630
|
-
!p &&
|
|
2776
|
+
const O = await se(q);
|
|
2777
|
+
if (p || B !== h) return;
|
|
2778
|
+
u.value = O, c.value = O.state !== "ready", O.state === "ready" && ne(!0), O.state === "ready" && a("ready");
|
|
2779
|
+
} catch (O) {
|
|
2780
|
+
!p && B === h && (u.value = O.code === "session_required" ? { command: "authorization", schema_version: 1, state: "session_expired", reason: "session_expired" } : v.value || { command: "authorization", schema_version: 1, state: "unavailable", reason: "service_unavailable" }, s.value = !0, c.value = !0);
|
|
2631
2781
|
} finally {
|
|
2632
|
-
!p &&
|
|
2782
|
+
!p && B === h && (o.value = !1, v.value = void 0, R && (R = !1, te("status")));
|
|
2633
2783
|
}
|
|
2634
2784
|
}
|
|
2635
|
-
function
|
|
2636
|
-
const
|
|
2637
|
-
|
|
2785
|
+
function ne(q) {
|
|
2786
|
+
const B = d;
|
|
2787
|
+
d = [], B.forEach((O) => O(q));
|
|
2638
2788
|
}
|
|
2639
|
-
function
|
|
2640
|
-
|
|
2789
|
+
function H(q) {
|
|
2790
|
+
c.value = q, q || ne(!1);
|
|
2641
2791
|
}
|
|
2642
|
-
function
|
|
2643
|
-
return u.value?.state === "ready" ? Promise.resolve(!0) : (
|
|
2792
|
+
function W() {
|
|
2793
|
+
return u.value?.state === "ready" ? Promise.resolve(!0) : (o.value || (c.value = !0), new Promise((q) => d.push(q)));
|
|
2644
2794
|
}
|
|
2645
|
-
return
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
}),
|
|
2649
|
-
}),
|
|
2650
|
-
p = !0, h++,
|
|
2651
|
-
}), (
|
|
2652
|
-
|
|
2653
|
-
|
|
2795
|
+
return sa(pa, { state: I(() => u.value?.state ?? "checking"), requireAuthorization: W, text: _, busy: o, canManage: () => !!i.ctx.authorization?.canManage?.(), revoke: () => te("revoke") }), pe(() => {
|
|
2796
|
+
x = i.ctx.reopen(() => {
|
|
2797
|
+
o.value ? R = !0 : te("status");
|
|
2798
|
+
}), te("status");
|
|
2799
|
+
}), oa(() => {
|
|
2800
|
+
p = !0, h++, ne(!1), typeof x == "function" && x();
|
|
2801
|
+
}), (q, B) => (n(), T(oe, null, [
|
|
2802
|
+
z("div", ln, [
|
|
2803
|
+
he(q.$slots, "default", {}, void 0, !0)
|
|
2654
2804
|
]),
|
|
2655
|
-
|
|
2656
|
-
open:
|
|
2657
|
-
title:
|
|
2805
|
+
f(e(De), {
|
|
2806
|
+
open: c.value,
|
|
2807
|
+
title: K.value,
|
|
2658
2808
|
width: "480px",
|
|
2659
|
-
"onUpdate:open":
|
|
2809
|
+
"onUpdate:open": H
|
|
2660
2810
|
}, {
|
|
2661
2811
|
footer: t(() => [
|
|
2662
|
-
|
|
2812
|
+
P.value ? (n(), g(e(F), {
|
|
2663
2813
|
key: 0,
|
|
2664
2814
|
variant: "primary",
|
|
2665
|
-
loading:
|
|
2666
|
-
disabled:
|
|
2667
|
-
onClick:
|
|
2815
|
+
loading: o.value,
|
|
2816
|
+
disabled: o.value,
|
|
2817
|
+
onClick: B[0] || (B[0] = (O) => te("request"))
|
|
2668
2818
|
}, {
|
|
2669
2819
|
default: t(() => [
|
|
2670
|
-
|
|
2820
|
+
k(l(o.value ? _.value("authorizing") : _.value("authorize")), 1)
|
|
2671
2821
|
]),
|
|
2672
2822
|
_: 1
|
|
2673
|
-
}, 8, ["loading", "disabled"])) : (n(),
|
|
2823
|
+
}, 8, ["loading", "disabled"])) : (n(), g(e(F), {
|
|
2674
2824
|
key: 1,
|
|
2675
2825
|
variant: "primary",
|
|
2676
|
-
loading:
|
|
2677
|
-
disabled:
|
|
2678
|
-
onClick:
|
|
2826
|
+
loading: o.value,
|
|
2827
|
+
disabled: o.value,
|
|
2828
|
+
onClick: B[1] || (B[1] = (O) => te("status"))
|
|
2679
2829
|
}, {
|
|
2680
2830
|
default: t(() => [
|
|
2681
|
-
|
|
2831
|
+
k(l(o.value ? _.value("checking") : _.value("retry")), 1)
|
|
2682
2832
|
]),
|
|
2683
2833
|
_: 1
|
|
2684
2834
|
}, 8, ["loading", "disabled"]))
|
|
2685
2835
|
]),
|
|
2686
2836
|
default: t(() => [
|
|
2687
|
-
|
|
2837
|
+
z("div", {
|
|
2688
2838
|
class: "authorization-view",
|
|
2689
|
-
"aria-busy":
|
|
2839
|
+
"aria-busy": o.value,
|
|
2690
2840
|
"data-authorization-state": u.value?.state || "checking"
|
|
2691
2841
|
}, [
|
|
2692
|
-
|
|
2693
|
-
|
|
2842
|
+
z("p", sn, l(Q.value), 1),
|
|
2843
|
+
$.value ? (n(), g(e(G), {
|
|
2694
2844
|
key: 0,
|
|
2695
2845
|
class: "authorization-status",
|
|
2696
|
-
tone: ["grant_missing", "upgrade_reapproval"].includes(
|
|
2697
|
-
title: _.value("reason." +
|
|
2846
|
+
tone: ["grant_missing", "upgrade_reapproval"].includes(X.value) ? "info" : "warning",
|
|
2847
|
+
title: _.value("reason." + X.value)
|
|
2698
2848
|
}, {
|
|
2699
2849
|
default: t(() => [
|
|
2700
|
-
|
|
2850
|
+
k(l(_.value(J.value)), 1)
|
|
2701
2851
|
]),
|
|
2702
2852
|
_: 1
|
|
2703
|
-
}, 8, ["tone", "title"])) :
|
|
2704
|
-
s.value ? (n(),
|
|
2853
|
+
}, 8, ["tone", "title"])) : y("", !0),
|
|
2854
|
+
s.value ? (n(), g(e(G), {
|
|
2705
2855
|
key: 1,
|
|
2706
2856
|
class: "authorization-failed",
|
|
2707
2857
|
tone: "warning"
|
|
2708
2858
|
}, {
|
|
2709
2859
|
default: t(() => [
|
|
2710
|
-
|
|
2860
|
+
k(l(_.value("failed")), 1)
|
|
2711
2861
|
]),
|
|
2712
2862
|
_: 1
|
|
2713
|
-
})) :
|
|
2714
|
-
], 8,
|
|
2863
|
+
})) : y("", !0)
|
|
2864
|
+
], 8, nn)
|
|
2715
2865
|
]),
|
|
2716
2866
|
_: 1
|
|
2717
2867
|
}, 8, ["open", "title"])
|
|
2718
2868
|
], 64));
|
|
2719
2869
|
}
|
|
2720
|
-
}),
|
|
2870
|
+
}), $n = /* @__PURE__ */ re(on, [["__scopeId", "data-v-e16b5f7d"]]), un = { class: "authorization-setting" }, rn = {
|
|
2721
2871
|
class: "authorization-state",
|
|
2722
2872
|
role: "status"
|
|
2723
|
-
},
|
|
2873
|
+
}, dn = { class: "authorization-revoke-body" }, cn = /* @__PURE__ */ ie({
|
|
2724
2874
|
__name: "AuthorizationSettings",
|
|
2725
2875
|
setup(r) {
|
|
2726
|
-
const { state:
|
|
2727
|
-
return (
|
|
2728
|
-
|
|
2876
|
+
const { state: C, requireAuthorization: i, text: a, busy: u, canManage: v, revoke: o } = tn(), s = m(!1), c = { checking: "checking", ready: "ready", authorization_required: "state.required", not_admin: "not_admin.title", session_expired: "session_expired.title", unavailable: "state.unavailable" };
|
|
2877
|
+
return (d, p) => (n(), T(oe, null, [
|
|
2878
|
+
f(e(_e), {
|
|
2729
2879
|
title: e(a)("settings.title"),
|
|
2730
2880
|
collapsible: !1
|
|
2731
2881
|
}, {
|
|
2732
2882
|
default: t(() => [
|
|
2733
|
-
|
|
2883
|
+
f(e(Ee), {
|
|
2734
2884
|
label: e(a)("settings.status"),
|
|
2735
2885
|
description: e(a)("purpose"),
|
|
2736
2886
|
align: "center"
|
|
2737
2887
|
}, {
|
|
2738
2888
|
default: t(() => [
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
e(
|
|
2889
|
+
z("div", un, [
|
|
2890
|
+
z("span", rn, [
|
|
2891
|
+
e(C) === "ready" ? (n(), g(e(Za), {
|
|
2742
2892
|
key: 0,
|
|
2743
2893
|
size: 16,
|
|
2744
2894
|
"aria-hidden": "true"
|
|
2745
|
-
})) :
|
|
2746
|
-
|
|
2895
|
+
})) : y("", !0),
|
|
2896
|
+
k(l(e(a)(c[e(C)])), 1)
|
|
2747
2897
|
]),
|
|
2748
|
-
e(
|
|
2898
|
+
e(C) === "ready" && e(v)() ? (n(), g(e(F), {
|
|
2749
2899
|
key: 0,
|
|
2750
2900
|
variant: "secondary",
|
|
2751
2901
|
disabled: e(u),
|
|
2752
2902
|
onClick: p[0] || (p[0] = (h) => s.value = !0)
|
|
2753
2903
|
}, {
|
|
2754
2904
|
default: t(() => [
|
|
2755
|
-
|
|
2905
|
+
k(l(e(a)("revoke")), 1)
|
|
2756
2906
|
]),
|
|
2757
2907
|
_: 1
|
|
2758
|
-
}, 8, ["disabled"])) : e(
|
|
2908
|
+
}, 8, ["disabled"])) : e(C) !== "ready" && e(C) !== "checking" ? (n(), g(e(F), {
|
|
2759
2909
|
key: 1,
|
|
2760
2910
|
variant: "secondary",
|
|
2761
|
-
onClick: p[1] || (p[1] = (h) => e(
|
|
2911
|
+
onClick: p[1] || (p[1] = (h) => e(i)())
|
|
2762
2912
|
}, {
|
|
2763
2913
|
default: t(() => [
|
|
2764
|
-
|
|
2914
|
+
k(l(e(a)("settings.details")), 1)
|
|
2765
2915
|
]),
|
|
2766
2916
|
_: 1
|
|
2767
|
-
})) :
|
|
2917
|
+
})) : y("", !0)
|
|
2768
2918
|
])
|
|
2769
2919
|
]),
|
|
2770
2920
|
_: 1
|
|
@@ -2772,110 +2922,112 @@ const Gl = { class: "authorization-content" }, Jl = ["aria-busy", "data-authoriz
|
|
|
2772
2922
|
]),
|
|
2773
2923
|
_: 1
|
|
2774
2924
|
}, 8, ["title"]),
|
|
2775
|
-
|
|
2925
|
+
f(e(De), {
|
|
2776
2926
|
open: s.value,
|
|
2777
2927
|
"onUpdate:open": p[4] || (p[4] = (h) => s.value = h),
|
|
2778
2928
|
title: e(a)("revoke.title"),
|
|
2779
2929
|
width: "480px"
|
|
2780
2930
|
}, {
|
|
2781
2931
|
footer: t(() => [
|
|
2782
|
-
|
|
2932
|
+
f(e(F), {
|
|
2783
2933
|
variant: "secondary",
|
|
2784
2934
|
onClick: p[2] || (p[2] = (h) => s.value = !1)
|
|
2785
2935
|
}, {
|
|
2786
2936
|
default: t(() => [
|
|
2787
|
-
|
|
2937
|
+
k(l(e(a)("cancel")), 1)
|
|
2788
2938
|
]),
|
|
2789
2939
|
_: 1
|
|
2790
2940
|
}),
|
|
2791
|
-
|
|
2941
|
+
f(e(F), {
|
|
2792
2942
|
variant: "danger",
|
|
2793
2943
|
disabled: e(u),
|
|
2794
2944
|
onClick: p[3] || (p[3] = (h) => {
|
|
2795
|
-
s.value = !1, e(
|
|
2945
|
+
s.value = !1, e(o)();
|
|
2796
2946
|
})
|
|
2797
2947
|
}, {
|
|
2798
2948
|
default: t(() => [
|
|
2799
|
-
|
|
2949
|
+
k(l(e(a)("revoke")), 1)
|
|
2800
2950
|
]),
|
|
2801
2951
|
_: 1
|
|
2802
2952
|
}, 8, ["disabled"])
|
|
2803
2953
|
]),
|
|
2804
2954
|
default: t(() => [
|
|
2805
|
-
|
|
2955
|
+
z("p", dn, l(e(a)("revoke.body")), 1)
|
|
2806
2956
|
]),
|
|
2807
2957
|
_: 1
|
|
2808
2958
|
}, 8, ["open", "title"])
|
|
2809
2959
|
], 64));
|
|
2810
2960
|
}
|
|
2811
|
-
}),
|
|
2961
|
+
}), Sn = /* @__PURE__ */ re(cn, [["__scopeId", "data-v-f031e7c7"]]);
|
|
2812
2962
|
export {
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2963
|
+
bn as AppShell,
|
|
2964
|
+
$n as AuthorizationGate,
|
|
2965
|
+
Sn as AuthorizationSettings,
|
|
2966
|
+
_n as BackgroundPanel,
|
|
2967
|
+
Cn as BackgroundSavePanel,
|
|
2968
|
+
Vn as DEFAULT_REQUEST_TIMEOUT,
|
|
2969
|
+
xn as DelegatePanel,
|
|
2970
|
+
wn as ExecutorApproval,
|
|
2971
|
+
pt as ExecutorNotice,
|
|
2972
|
+
ca as ExecutorSettings,
|
|
2973
|
+
Te as ExecutorSetupKey,
|
|
2974
|
+
An as FILE_STATION_APP,
|
|
2975
|
+
va as FileBrowser,
|
|
2976
|
+
gn as FilesPage,
|
|
2977
|
+
kn as LoginPage,
|
|
2978
|
+
Be as NasPicker,
|
|
2979
|
+
hn as PortalSettings,
|
|
2980
|
+
In as activePage,
|
|
2981
|
+
En as authorizationCatalogs,
|
|
2982
|
+
wa as authorizationCopy,
|
|
2983
|
+
Tn as backgroundCatalogs,
|
|
2984
|
+
ma as backgroundCopy,
|
|
2985
|
+
ga as backgroundErrorCopy,
|
|
2986
|
+
Un as bridgeCatalogs,
|
|
2987
|
+
Rn as bridgeErrorCopy,
|
|
2988
|
+
Dn as catalogs,
|
|
2989
|
+
Bn as clientTimeout,
|
|
2990
|
+
ba as createBackgroundPickerProvider,
|
|
2991
|
+
Fn as createBackgroundSaveFacade,
|
|
2992
|
+
qn as createFileTransfers,
|
|
2993
|
+
la as createNasProvider,
|
|
2994
|
+
Nn as createPortalAccess,
|
|
2995
|
+
mn as createSession,
|
|
2996
|
+
On as createStandaloneContext,
|
|
2997
|
+
Ln as createStandaloneHost,
|
|
2998
|
+
Mn as decodeResponse,
|
|
2999
|
+
Kn as delegateCatalogs,
|
|
3000
|
+
Ue as delegateCopy,
|
|
3001
|
+
Hn as encodeRequest,
|
|
3002
|
+
ha as errorCopy,
|
|
3003
|
+
Gn as fileStationPath,
|
|
3004
|
+
Oe as format,
|
|
3005
|
+
Jn as identityCatalogs,
|
|
3006
|
+
ya as identityCopy,
|
|
3007
|
+
je as isFullPage,
|
|
3008
|
+
na as labelSeparator,
|
|
3009
|
+
Wn as mergeCatalogs,
|
|
3010
|
+
Xn as nasCatalogs,
|
|
3011
|
+
ge as nasCopy,
|
|
3012
|
+
aa as nasErrorCopy,
|
|
3013
|
+
Qn as openFileInFileStation,
|
|
3014
|
+
_a as openFolderInFileStation,
|
|
3015
|
+
Yn as portalCatalogs,
|
|
3016
|
+
Zn as portalMessages,
|
|
3017
|
+
jn as protocolCodes,
|
|
3018
|
+
es as protocolOps,
|
|
3019
|
+
as as protocolSchemas,
|
|
3020
|
+
He as requestKey,
|
|
3021
|
+
ts as saveCatalogs,
|
|
3022
|
+
ta as saveCopy,
|
|
3023
|
+
Ie as saveError,
|
|
3024
|
+
ka as scopedPicker,
|
|
3025
|
+
ls as shellCatalogs,
|
|
3026
|
+
fa as shellCopy,
|
|
3027
|
+
ns as shellPages,
|
|
3028
|
+
ea as uiLocale,
|
|
3029
|
+
ss as uiLocales,
|
|
3030
|
+
tn as useAuthorization,
|
|
3031
|
+
ra as useExecutorSetup,
|
|
3032
|
+
ja as useNasRequest
|
|
2881
3033
|
};
|