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