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