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