@synopackageland/sdk 0.9.0 → 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 +7 -2
- 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 +7 -2
- package/dist/i18n/authorization/ko.json +7 -2
- package/dist/i18n/authorization/zh-CN.json +6 -1
- package/dist/i18n/authorization/zh-TW.json +6 -1
- package/dist/i18n/delegate/de.json +2 -0
- package/dist/i18n/delegate/en.json +2 -0
- package/dist/i18n/delegate/es.json +2 -0
- package/dist/i18n/delegate/fr.json +2 -0
- package/dist/i18n/delegate/it.json +2 -0
- package/dist/i18n/delegate/ja.json +2 -0
- package/dist/i18n/delegate/ko.json +2 -0
- package/dist/i18n/delegate/zh-CN.json +2 -0
- package/dist/i18n/delegate/zh-TW.json +2 -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 +2136 -2029
- 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 +4 -0
- package/dist/src/delegate/long-running.d.ts +1 -1
- 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/i18n.d.ts +3 -2
- package/dist/src/nas/locale.d.ts +3 -0
- package/dist/src/protocol/v1.d.ts +1 -7
- package/dist/src/vue.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/vue.js +1335 -1220
- package/package.json +3 -3
- package/spec/protocol/v1/README.md +11 -0
- package/spec/protocol/v1/errors.json +0 -8
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 d(
|
|
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
|
|
32
|
-
if (!Number.isFinite(
|
|
31
|
+
const q = Date.parse(T.expiresAt) - Date.now();
|
|
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
|
-
}, Math.min(6e4,
|
|
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
55
|
r || d();
|
|
56
56
|
}
|
|
57
|
-
} catch (
|
|
58
|
-
const
|
|
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
|
|
86
|
+
function K() {
|
|
87
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 d = await
|
|
103
|
-
return !a &&
|
|
102
|
+
const d = await o(x.signal);
|
|
103
|
+
return !a && u === m ? d : void 0;
|
|
104
104
|
} catch (d) {
|
|
105
|
-
!a &&
|
|
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 =
|
|
194
|
-
let
|
|
195
|
-
async function
|
|
196
|
-
const
|
|
197
|
-
!
|
|
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);
|
|
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
|
+
}
|
|
216
|
+
async function Y() {
|
|
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 };
|
|
228
|
+
}
|
|
229
|
+
function H(g) {
|
|
230
|
+
p.value = g, m("selected", g?.path);
|
|
231
|
+
}
|
|
232
|
+
function ee(g) {
|
|
233
|
+
(a.mode === "folder" ? g.isDir : !g.isDir) && H(g);
|
|
198
234
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
if (!v || !_ || !a.provider.upload) return;
|
|
202
|
-
V.value = !1, await r.run(async (G) => (await a.provider.upload(v, _, G), !0)) && (H.value = [], await q(d.value), V.value = !0);
|
|
235
|
+
function ae(g) {
|
|
236
|
+
g.isDir ? $e(g) : ee(g);
|
|
203
237
|
}
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
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
|
+
}
|
|
212
253
|
}
|
|
213
|
-
function
|
|
214
|
-
|
|
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);
|
|
215
256
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
if (
|
|
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]);
|
|
222
269
|
}
|
|
270
|
+
f.value = g.at(-1)?.path;
|
|
223
271
|
}
|
|
224
|
-
async function
|
|
225
|
-
const
|
|
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
|
-
d.value =
|
|
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));
|
|
247
300
|
}
|
|
248
|
-
function
|
|
249
|
-
|
|
301
|
+
function $e(g) {
|
|
302
|
+
ke([...d.value, g]);
|
|
250
303
|
}
|
|
251
|
-
|
|
252
|
-
|
|
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));
|
|
253
307
|
}
|
|
254
|
-
function
|
|
255
|
-
n.value || (
|
|
308
|
+
function O(g) {
|
|
309
|
+
n.value || (ue.value += g, le(ye.value[ue.value]));
|
|
256
310
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
311
|
+
function F(g) {
|
|
312
|
+
P.value = { key: g?.key === "bytes" ? "size" : "name", direction: g?.direction ?? "asc" }, le(d.value);
|
|
313
|
+
}
|
|
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": _[2] || (_[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
|
-
p(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": k.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
|
-
p(l(u.value.selectAction), 1)
|
|
430
|
-
]),
|
|
431
|
-
_: 1
|
|
432
|
-
}, 8, ["disabled", "aria-pressed", "aria-label", "onClick"])) : y("", !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
|
-
p(l(u.value.loadMore), 1)
|
|
444
|
-
]),
|
|
445
|
-
_: 1
|
|
446
|
-
}, 8, ["disabled"])) : y("", !0),
|
|
447
|
-
f.mode === "folder" && d.value.length && !e(i) ? (t(), h(e(z), {
|
|
448
|
-
key: 2,
|
|
449
|
-
variant: "secondary",
|
|
450
|
-
disabled: e(n),
|
|
451
|
-
onClick: _[9] || (_[9] = (x) => J(d.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,264 +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
|
-
d = !0,
|
|
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 (d ||
|
|
500
|
-
if (!
|
|
501
|
-
|
|
502
|
-
} catch (
|
|
503
|
-
!d &&
|
|
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
|
-
d || (
|
|
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
|
-
d =
|
|
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
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
734
|
+
const x = /* @__PURE__ */ Symbol("late");
|
|
735
|
+
async function d(p) {
|
|
736
|
+
if (r.value) return;
|
|
737
|
+
r.value = !0, n.value = "";
|
|
738
|
+
const V = p();
|
|
739
|
+
try {
|
|
740
|
+
const C = await Promise.race([V, new Promise((f) => setTimeout(() => f(x), el))]);
|
|
741
|
+
if (C !== x) {
|
|
742
|
+
u(C);
|
|
743
|
+
return;
|
|
695
744
|
}
|
|
745
|
+
V.then(u, () => {
|
|
746
|
+
}), u(await S.portal.status());
|
|
747
|
+
} catch (C) {
|
|
748
|
+
o || (n.value = a[C?.code || ""] || a.portal_unavailable);
|
|
749
|
+
} finally {
|
|
750
|
+
o || (r.value = !1);
|
|
696
751
|
}
|
|
697
752
|
}
|
|
698
|
-
return
|
|
699
|
-
|
|
700
|
-
}),
|
|
701
|
-
|
|
702
|
-
}), (
|
|
753
|
+
return fe(() => {
|
|
754
|
+
S.portal.status().then(u);
|
|
755
|
+
}), de(() => {
|
|
756
|
+
o = !0;
|
|
757
|
+
}), (p, V) => m.value ? (t(), w(e(pe), {
|
|
703
758
|
key: 0,
|
|
704
759
|
title: e(a).title,
|
|
705
760
|
collapsible: !1,
|
|
706
761
|
"aria-busy": r.value
|
|
707
762
|
}, {
|
|
708
763
|
default: s(() => [
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
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,
|
|
713
768
|
external: ""
|
|
714
769
|
}, {
|
|
715
770
|
default: s(() => [
|
|
716
|
-
|
|
771
|
+
k(l(m.value.url), 1)
|
|
717
772
|
]),
|
|
718
773
|
_: 1
|
|
719
774
|
}, 8, ["href"])
|
|
720
|
-
])) :
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
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"]))
|
|
725
780
|
}, {
|
|
726
781
|
default: s(() => [
|
|
727
|
-
|
|
782
|
+
y(e(re), {
|
|
728
783
|
label: e(a).alias,
|
|
729
784
|
"label-for": "portal-alias"
|
|
730
785
|
}, {
|
|
731
786
|
default: s(() => [
|
|
732
|
-
|
|
787
|
+
y(e(me), {
|
|
733
788
|
id: "portal-alias",
|
|
734
|
-
modelValue:
|
|
735
|
-
"onUpdate:modelValue":
|
|
789
|
+
modelValue: i.value,
|
|
790
|
+
"onUpdate:modelValue": V[0] || (V[0] = (C) => i.value = C),
|
|
736
791
|
maxlength: "64",
|
|
737
792
|
autocomplete: "off",
|
|
738
793
|
disabled: r.value
|
|
@@ -740,227 +795,227 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
|
|
|
740
795
|
]),
|
|
741
796
|
_: 1
|
|
742
797
|
}, 8, ["label"]),
|
|
743
|
-
|
|
798
|
+
y(e(_e), null, {
|
|
744
799
|
default: s(() => [
|
|
745
|
-
|
|
800
|
+
y(e(A), {
|
|
746
801
|
type: "submit",
|
|
747
802
|
variant: "primary",
|
|
748
803
|
disabled: r.value
|
|
749
804
|
}, {
|
|
750
805
|
default: s(() => [
|
|
751
|
-
|
|
806
|
+
k(l(e(a).apply), 1)
|
|
752
807
|
]),
|
|
753
808
|
_: 1
|
|
754
809
|
}, 8, ["disabled"]),
|
|
755
|
-
|
|
810
|
+
m.value.state === "active" ? (t(), w(e(A), {
|
|
756
811
|
key: 0,
|
|
757
812
|
variant: "secondary",
|
|
758
813
|
disabled: r.value,
|
|
759
|
-
onClick:
|
|
814
|
+
onClick: V[1] || (V[1] = (C) => d(() => c.portal.disable()))
|
|
760
815
|
}, {
|
|
761
816
|
default: s(() => [
|
|
762
|
-
|
|
817
|
+
k(l(e(a).disable), 1)
|
|
763
818
|
]),
|
|
764
819
|
_: 1
|
|
765
|
-
}, 8, ["disabled"])) :
|
|
820
|
+
}, 8, ["disabled"])) : b("", !0)
|
|
766
821
|
]),
|
|
767
822
|
_: 1
|
|
768
823
|
})
|
|
769
824
|
]),
|
|
770
825
|
_: 1
|
|
771
826
|
}),
|
|
772
|
-
|
|
827
|
+
y(e(A), {
|
|
773
828
|
variant: "secondary",
|
|
774
|
-
onClick:
|
|
829
|
+
onClick: V[3] || (V[3] = (C) => c.portal.openControlPanel())
|
|
775
830
|
}, {
|
|
776
831
|
default: s(() => [
|
|
777
|
-
|
|
832
|
+
k(l(e(a).advanced), 1)
|
|
778
833
|
]),
|
|
779
834
|
_: 1
|
|
780
835
|
})
|
|
781
|
-
], 64)) :
|
|
836
|
+
], 64)) : m.value.controlPanel ? (t(), w(e(A), {
|
|
782
837
|
key: 2,
|
|
783
838
|
variant: "secondary",
|
|
784
|
-
onClick:
|
|
839
|
+
onClick: V[4] || (V[4] = (C) => c.portal.openControlPanel())
|
|
785
840
|
}, {
|
|
786
841
|
default: s(() => [
|
|
787
|
-
|
|
842
|
+
k(l(e(a).controlPanel), 1)
|
|
788
843
|
]),
|
|
789
844
|
_: 1
|
|
790
|
-
})) :
|
|
791
|
-
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), {
|
|
792
847
|
key: 4,
|
|
793
848
|
tone: "danger"
|
|
794
849
|
}, {
|
|
795
850
|
default: s(() => [
|
|
796
|
-
|
|
851
|
+
h("span", ja, l(n.value), 1)
|
|
797
852
|
]),
|
|
798
853
|
_: 1
|
|
799
|
-
})) :
|
|
854
|
+
})) : b("", !0)
|
|
800
855
|
]),
|
|
801
856
|
_: 1
|
|
802
|
-
}, 8, ["title", "aria-busy"])) :
|
|
857
|
+
}, 8, ["title", "aria-busy"])) : b("", !0);
|
|
803
858
|
}
|
|
804
|
-
}),
|
|
859
|
+
}), al = ["aria-busy"], ll = {
|
|
805
860
|
key: 1,
|
|
806
861
|
role: "status"
|
|
807
|
-
},
|
|
862
|
+
}, tl = { role: "alert" }, nl = { role: "status" }, sl = /* @__PURE__ */ se({
|
|
808
863
|
__name: "LoginPage",
|
|
809
864
|
props: {
|
|
810
865
|
session: {},
|
|
811
866
|
locale: {}
|
|
812
867
|
},
|
|
813
|
-
setup(
|
|
814
|
-
const
|
|
815
|
-
let
|
|
816
|
-
function
|
|
817
|
-
const
|
|
818
|
-
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;
|
|
819
874
|
}
|
|
820
|
-
async function
|
|
821
|
-
if (!(
|
|
822
|
-
|
|
875
|
+
async function C() {
|
|
876
|
+
if (!(o.value || !d.value || !m.value || !i.value || n.value && !r.value)) {
|
|
877
|
+
o.value = !0, u.value = "";
|
|
823
878
|
try {
|
|
824
|
-
await
|
|
825
|
-
} catch (
|
|
826
|
-
if (
|
|
827
|
-
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);
|
|
828
883
|
} finally {
|
|
829
|
-
|
|
884
|
+
p || (o.value = !1, n.value && (await la(), p || x.value?.querySelector("input")?.focus()));
|
|
830
885
|
}
|
|
831
886
|
}
|
|
832
887
|
}
|
|
833
|
-
async function
|
|
834
|
-
if (!
|
|
835
|
-
|
|
888
|
+
async function f() {
|
|
889
|
+
if (!o.value) {
|
|
890
|
+
o.value = !0, u.value = "";
|
|
836
891
|
try {
|
|
837
|
-
await
|
|
838
|
-
} catch (
|
|
839
|
-
|
|
892
|
+
await S.session.bootstrap();
|
|
893
|
+
} catch (R) {
|
|
894
|
+
p || (u.value = V(R));
|
|
840
895
|
} finally {
|
|
841
|
-
|
|
896
|
+
p || (o.value = !1);
|
|
842
897
|
}
|
|
843
898
|
}
|
|
844
899
|
}
|
|
845
|
-
function
|
|
846
|
-
|
|
900
|
+
function P() {
|
|
901
|
+
i.value = "", r.value = "", n.value = !1, u.value = "";
|
|
847
902
|
}
|
|
848
|
-
return
|
|
849
|
-
|
|
850
|
-
}), (
|
|
903
|
+
return Le(() => {
|
|
904
|
+
p = !0, i.value = "", r.value = "";
|
|
905
|
+
}), (R, K) => (t(), $("main", {
|
|
851
906
|
class: "identity-login",
|
|
852
|
-
"aria-busy":
|
|
907
|
+
"aria-busy": o.value
|
|
853
908
|
}, [
|
|
854
|
-
|
|
909
|
+
y(e(pe), {
|
|
855
910
|
title: a.value.title,
|
|
856
911
|
collapsible: !1
|
|
857
912
|
}, {
|
|
858
913
|
default: s(() => [
|
|
859
|
-
|
|
860
|
-
d.value ?
|
|
914
|
+
h("p", null, l(a.value.intro), 1),
|
|
915
|
+
d.value ? b("", !0) : (t(), w(e(W), {
|
|
861
916
|
key: 0,
|
|
862
917
|
tone: "warning",
|
|
863
918
|
title: a.value.httpsTitle
|
|
864
919
|
}, {
|
|
865
920
|
default: s(() => [
|
|
866
|
-
|
|
921
|
+
k(l(a.value.errors.https_required), 1)
|
|
867
922
|
]),
|
|
868
923
|
_: 1
|
|
869
924
|
}, 8, ["title"])),
|
|
870
|
-
|
|
871
|
-
|
|
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), {
|
|
872
927
|
key: 2,
|
|
873
928
|
tone: "danger",
|
|
874
929
|
title: a.value.failedTitle
|
|
875
930
|
}, {
|
|
876
931
|
default: s(() => [
|
|
877
|
-
|
|
932
|
+
h("span", tl, l(u.value), 1)
|
|
878
933
|
]),
|
|
879
934
|
_: 1
|
|
880
|
-
}, 8, ["title"])) :
|
|
881
|
-
|
|
882
|
-
onSubmit:
|
|
935
|
+
}, 8, ["title"])) : b("", !0),
|
|
936
|
+
y(e(he), {
|
|
937
|
+
onSubmit: be(C, ["prevent"])
|
|
883
938
|
}, {
|
|
884
939
|
default: s(() => [
|
|
885
|
-
|
|
940
|
+
y(e(re), {
|
|
886
941
|
label: a.value.account
|
|
887
942
|
}, {
|
|
888
943
|
default: s(() => [
|
|
889
|
-
|
|
890
|
-
modelValue:
|
|
891
|
-
"onUpdate:modelValue":
|
|
944
|
+
y(e(me), {
|
|
945
|
+
modelValue: m.value,
|
|
946
|
+
"onUpdate:modelValue": K[0] || (K[0] = (T) => m.value = T),
|
|
892
947
|
autocomplete: "username",
|
|
893
|
-
disabled:
|
|
948
|
+
disabled: o.value || n.value || !d.value
|
|
894
949
|
}, null, 8, ["modelValue", "disabled"])
|
|
895
950
|
]),
|
|
896
951
|
_: 1
|
|
897
952
|
}, 8, ["label"]),
|
|
898
|
-
n.value ? (t(),
|
|
899
|
-
|
|
900
|
-
|
|
953
|
+
n.value ? (t(), $(te, { key: 1 }, [
|
|
954
|
+
h("p", nl, l(a.value.otpPrompt), 1),
|
|
955
|
+
h("div", {
|
|
901
956
|
ref_key: "otpField",
|
|
902
|
-
ref:
|
|
957
|
+
ref: x
|
|
903
958
|
}, [
|
|
904
|
-
|
|
959
|
+
y(e(re), {
|
|
905
960
|
label: a.value.otp
|
|
906
961
|
}, {
|
|
907
962
|
default: s(() => [
|
|
908
|
-
|
|
963
|
+
y(e(me), {
|
|
909
964
|
modelValue: r.value,
|
|
910
|
-
"onUpdate:modelValue":
|
|
965
|
+
"onUpdate:modelValue": K[2] || (K[2] = (T) => r.value = T),
|
|
911
966
|
inputmode: "numeric",
|
|
912
967
|
autocomplete: "one-time-code",
|
|
913
|
-
disabled:
|
|
968
|
+
disabled: o.value
|
|
914
969
|
}, null, 8, ["modelValue", "disabled"])
|
|
915
970
|
]),
|
|
916
971
|
_: 1
|
|
917
972
|
}, 8, ["label"])
|
|
918
973
|
], 512)
|
|
919
|
-
], 64)) : (t(),
|
|
974
|
+
], 64)) : (t(), w(e(re), {
|
|
920
975
|
key: 0,
|
|
921
976
|
label: a.value.password
|
|
922
977
|
}, {
|
|
923
978
|
default: s(() => [
|
|
924
|
-
|
|
925
|
-
modelValue:
|
|
926
|
-
"onUpdate:modelValue":
|
|
979
|
+
y(e(me), {
|
|
980
|
+
modelValue: i.value,
|
|
981
|
+
"onUpdate:modelValue": K[1] || (K[1] = (T) => i.value = T),
|
|
927
982
|
type: "password",
|
|
928
983
|
autocomplete: "current-password",
|
|
929
|
-
disabled:
|
|
984
|
+
disabled: o.value || !d.value
|
|
930
985
|
}, null, 8, ["modelValue", "disabled"])
|
|
931
986
|
]),
|
|
932
987
|
_: 1
|
|
933
988
|
}, 8, ["label"])),
|
|
934
|
-
|
|
989
|
+
y(e(_e), null, {
|
|
935
990
|
default: s(() => [
|
|
936
|
-
|
|
991
|
+
y(e(A), {
|
|
937
992
|
type: "submit",
|
|
938
993
|
variant: "primary",
|
|
939
|
-
disabled:
|
|
994
|
+
disabled: o.value || !d.value || !m.value || !i.value || n.value && !r.value
|
|
940
995
|
}, {
|
|
941
996
|
default: s(() => [
|
|
942
|
-
|
|
997
|
+
k(l(o.value ? a.value.signingIn : n.value ? a.value.verify : a.value.signIn), 1)
|
|
943
998
|
]),
|
|
944
999
|
_: 1
|
|
945
1000
|
}, 8, ["disabled"]),
|
|
946
|
-
n.value ? (t(),
|
|
1001
|
+
n.value ? (t(), w(e(A), {
|
|
947
1002
|
key: 0,
|
|
948
1003
|
variant: "secondary",
|
|
949
|
-
disabled:
|
|
950
|
-
onClick:
|
|
1004
|
+
disabled: o.value,
|
|
1005
|
+
onClick: P
|
|
951
1006
|
}, {
|
|
952
1007
|
default: s(() => [
|
|
953
|
-
|
|
1008
|
+
k(l(a.value.otherAccount), 1)
|
|
954
1009
|
]),
|
|
955
1010
|
_: 1
|
|
956
|
-
}, 8, ["disabled"])) : (t(),
|
|
1011
|
+
}, 8, ["disabled"])) : (t(), w(e(A), {
|
|
957
1012
|
key: 1,
|
|
958
1013
|
variant: "secondary",
|
|
959
|
-
disabled:
|
|
960
|
-
onClick:
|
|
1014
|
+
disabled: o.value || !d.value,
|
|
1015
|
+
onClick: f
|
|
961
1016
|
}, {
|
|
962
1017
|
default: s(() => [
|
|
963
|
-
|
|
1018
|
+
k(l(a.value.continueDSM), 1)
|
|
964
1019
|
]),
|
|
965
1020
|
_: 1
|
|
966
1021
|
}, 8, ["disabled"]))
|
|
@@ -973,337 +1028,337 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
|
|
|
973
1028
|
]),
|
|
974
1029
|
_: 1
|
|
975
1030
|
}, 8, ["title"])
|
|
976
|
-
], 8,
|
|
1031
|
+
], 8, al));
|
|
977
1032
|
}
|
|
978
|
-
}),
|
|
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 = {
|
|
979
1034
|
key: 0,
|
|
980
1035
|
role: "status",
|
|
981
1036
|
"data-bg-picked": ""
|
|
982
|
-
},
|
|
1037
|
+
}, pl = { class: "integration-actions" }, yl = { key: 1 }, ml = {
|
|
983
1038
|
key: 2,
|
|
984
1039
|
class: "integration-jobs"
|
|
985
|
-
},
|
|
1040
|
+
}, bl = ["data-job-state", "data-job-id"], kl = { class: "nas-folder-name" }, hl = {
|
|
986
1041
|
key: 0,
|
|
987
1042
|
class: "integration-help"
|
|
988
|
-
},
|
|
1043
|
+
}, _l = {
|
|
989
1044
|
key: 4,
|
|
990
1045
|
class: "integration-help"
|
|
991
|
-
},
|
|
1046
|
+
}, gl = ["aria-label"], wl = { class: "integration-help" }, Cl = { key: 1 }, $l = {
|
|
992
1047
|
key: 2,
|
|
993
1048
|
class: "integration-jobs"
|
|
994
|
-
},
|
|
1049
|
+
}, xl = ["data-schedule-id"], Sl = { class: "nas-folder-name" }, zl = {
|
|
995
1050
|
key: 0,
|
|
996
1051
|
class: "integration-help"
|
|
997
|
-
},
|
|
1052
|
+
}, Vl = {
|
|
998
1053
|
key: 1,
|
|
999
1054
|
class: "integration-help"
|
|
1000
|
-
},
|
|
1055
|
+
}, Pl = { class: "integration-help" }, Ul = { class: "integration-actions" }, Dl = { class: "integration-actions" }, Il = { class: "integration-actions" }, Al = /* @__PURE__ */ se({
|
|
1001
1056
|
__name: "BackgroundPanel",
|
|
1002
1057
|
props: {
|
|
1003
1058
|
ctx: {}
|
|
1004
1059
|
},
|
|
1005
|
-
setup(
|
|
1006
|
-
const
|
|
1007
|
-
let
|
|
1008
|
-
const
|
|
1009
|
-
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) {
|
|
1010
1065
|
try {
|
|
1011
|
-
return await
|
|
1012
|
-
} catch (
|
|
1066
|
+
return await S.ctx.call(O, F);
|
|
1067
|
+
} catch (U) {
|
|
1013
1068
|
if (L) return;
|
|
1014
|
-
|
|
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);
|
|
1015
1070
|
return;
|
|
1016
1071
|
}
|
|
1017
1072
|
}
|
|
1018
|
-
async function
|
|
1019
|
-
if (!(L ||
|
|
1020
|
-
|
|
1073
|
+
async function ee() {
|
|
1074
|
+
if (!(L || R.value)) {
|
|
1075
|
+
R.value = !0;
|
|
1021
1076
|
try {
|
|
1022
|
-
const
|
|
1023
|
-
if (!
|
|
1024
|
-
if (!
|
|
1077
|
+
const O = await H("bg.status");
|
|
1078
|
+
if (!O || L) return;
|
|
1079
|
+
if (!O.limits || typeof O.admin != "boolean") {
|
|
1025
1080
|
n.value = { code: "unavailable" };
|
|
1026
1081
|
return;
|
|
1027
1082
|
}
|
|
1028
|
-
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
const
|
|
1032
|
-
|
|
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);
|
|
1033
1088
|
} finally {
|
|
1034
|
-
|
|
1089
|
+
R.value = !1;
|
|
1035
1090
|
}
|
|
1036
1091
|
}
|
|
1037
1092
|
}
|
|
1038
|
-
function
|
|
1039
|
-
|
|
1040
|
-
|
|
1093
|
+
function ae() {
|
|
1094
|
+
J || (J = setInterval(() => {
|
|
1095
|
+
ee();
|
|
1041
1096
|
}, 3e3));
|
|
1042
1097
|
}
|
|
1043
|
-
async function O
|
|
1044
|
-
if (!
|
|
1045
|
-
|
|
1098
|
+
async function Q(O) {
|
|
1099
|
+
if (!u.value) {
|
|
1100
|
+
u.value = !0, n.value = void 0;
|
|
1046
1101
|
try {
|
|
1047
|
-
await
|
|
1102
|
+
await O(), await ee(), (x.value.some((F) => F.enabled) || r.value.some((F) => !X(F))) && ae();
|
|
1048
1103
|
} finally {
|
|
1049
|
-
L || (
|
|
1104
|
+
L || (u.value = !1);
|
|
1050
1105
|
}
|
|
1051
1106
|
}
|
|
1052
1107
|
}
|
|
1053
|
-
const
|
|
1054
|
-
if (!
|
|
1055
|
-
await
|
|
1056
|
-
}),
|
|
1057
|
-
d.value =
|
|
1058
|
-
},
|
|
1059
|
-
if (!d.value || !
|
|
1060
|
-
await
|
|
1061
|
-
}),
|
|
1062
|
-
if (!
|
|
1063
|
-
await
|
|
1064
|
-
}),
|
|
1065
|
-
if (!
|
|
1066
|
-
await
|
|
1067
|
-
}),
|
|
1068
|
-
const
|
|
1069
|
-
return Number.isFinite(
|
|
1070
|
-
},
|
|
1071
|
-
const
|
|
1072
|
-
|
|
1073
|
-
},
|
|
1074
|
-
if (!
|
|
1075
|
-
await
|
|
1108
|
+
const E = () => Q(async () => {
|
|
1109
|
+
if (!P.value) return;
|
|
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);
|
|
1076
1131
|
});
|
|
1077
|
-
async function
|
|
1078
|
-
const
|
|
1079
|
-
!
|
|
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`);
|
|
1080
1135
|
}
|
|
1081
|
-
return
|
|
1082
|
-
|
|
1083
|
-
(
|
|
1136
|
+
return fe(() => {
|
|
1137
|
+
ee().then(() => {
|
|
1138
|
+
(x.value.some((O) => O.enabled) || r.value.some((O) => !X(O))) && ae();
|
|
1084
1139
|
});
|
|
1085
|
-
}),
|
|
1086
|
-
L = !0,
|
|
1087
|
-
}), (
|
|
1088
|
-
"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,
|
|
1089
1144
|
title: a.value.title,
|
|
1090
1145
|
collapsible: !1,
|
|
1091
1146
|
"data-background-panel": ""
|
|
1092
1147
|
}, {
|
|
1093
1148
|
default: s(() => [
|
|
1094
|
-
|
|
1149
|
+
o.value ? (t(), w(e(W), {
|
|
1095
1150
|
key: 0,
|
|
1096
1151
|
tone: "warning"
|
|
1097
1152
|
}, {
|
|
1098
1153
|
default: s(() => [
|
|
1099
|
-
|
|
1154
|
+
k(l(a.value.unsupported), 1)
|
|
1100
1155
|
]),
|
|
1101
1156
|
_: 1
|
|
1102
|
-
})) : (t(),
|
|
1103
|
-
|
|
1104
|
-
n.value ? (t(),
|
|
1157
|
+
})) : (t(), $(te, { key: 1 }, [
|
|
1158
|
+
h("p", il, l(a.value.help), 1),
|
|
1159
|
+
n.value ? (t(), w(e(W), {
|
|
1105
1160
|
key: 0,
|
|
1106
1161
|
tone: "danger",
|
|
1107
1162
|
role: "alert"
|
|
1108
1163
|
}, {
|
|
1109
1164
|
default: s(() => [
|
|
1110
|
-
|
|
1165
|
+
k(l(e(We)(n.value, a.value)), 1)
|
|
1111
1166
|
]),
|
|
1112
1167
|
_: 1
|
|
1113
|
-
})) :
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
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), {
|
|
1121
1176
|
variant: "secondary",
|
|
1122
|
-
disabled:
|
|
1123
|
-
onClick:
|
|
1177
|
+
disabled: u.value,
|
|
1178
|
+
onClick: ee
|
|
1124
1179
|
}, {
|
|
1125
1180
|
default: s(() => [
|
|
1126
|
-
|
|
1181
|
+
k(l(a.value.refresh), 1)
|
|
1127
1182
|
]),
|
|
1128
1183
|
_: 1
|
|
1129
1184
|
}, 8, ["disabled"])
|
|
1130
1185
|
]),
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1186
|
+
h("template", null, [
|
|
1187
|
+
h("div", cl, [
|
|
1188
|
+
y(e(A), {
|
|
1134
1189
|
variant: "secondary",
|
|
1135
|
-
disabled:
|
|
1136
|
-
onClick:
|
|
1190
|
+
disabled: u.value,
|
|
1191
|
+
onClick: F[0] || (F[0] = (U) => K.value = !0)
|
|
1137
1192
|
}, {
|
|
1138
1193
|
default: s(() => [
|
|
1139
|
-
|
|
1194
|
+
k(l(a.value.chooseFile), 1)
|
|
1140
1195
|
]),
|
|
1141
1196
|
_: 1
|
|
1142
1197
|
}, 8, ["disabled"]),
|
|
1143
|
-
|
|
1198
|
+
y(e(A), {
|
|
1144
1199
|
variant: "primary",
|
|
1145
|
-
disabled:
|
|
1146
|
-
onClick:
|
|
1200
|
+
disabled: u.value || !T.value,
|
|
1201
|
+
onClick: ue
|
|
1147
1202
|
}, {
|
|
1148
1203
|
default: s(() => [
|
|
1149
|
-
|
|
1204
|
+
k(l(a.value.submit), 1)
|
|
1150
1205
|
]),
|
|
1151
1206
|
_: 1
|
|
1152
1207
|
}, 8, ["disabled"])
|
|
1153
1208
|
]),
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
open:
|
|
1157
|
-
"onUpdate:open":
|
|
1158
|
-
locale:
|
|
1159
|
-
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),
|
|
1160
1215
|
mode: "file",
|
|
1161
1216
|
title: a.value.pickerTitle,
|
|
1162
1217
|
description: a.value.pickerConsent,
|
|
1163
|
-
onSelected:
|
|
1218
|
+
onSelected: ye
|
|
1164
1219
|
}, null, 8, ["open", "locale", "provider", "title", "description"])
|
|
1165
1220
|
]),
|
|
1166
|
-
|
|
1221
|
+
P.value && i.value.admin ? (t(), w(e(W), {
|
|
1167
1222
|
key: 0,
|
|
1168
1223
|
tone: "warning"
|
|
1169
1224
|
}, {
|
|
1170
1225
|
default: s(() => [
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
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), {
|
|
1174
1229
|
variant: "secondary",
|
|
1175
|
-
disabled:
|
|
1176
|
-
onClick:
|
|
1230
|
+
disabled: u.value,
|
|
1231
|
+
onClick: E
|
|
1177
1232
|
}, {
|
|
1178
1233
|
default: s(() => [
|
|
1179
|
-
|
|
1234
|
+
k(l(a.value.confirmPurge), 1)
|
|
1180
1235
|
]),
|
|
1181
1236
|
_: 1
|
|
1182
1237
|
}, 8, ["disabled"]),
|
|
1183
|
-
|
|
1238
|
+
y(e(A), {
|
|
1184
1239
|
variant: "secondary",
|
|
1185
|
-
disabled:
|
|
1186
|
-
onClick:
|
|
1240
|
+
disabled: u.value,
|
|
1241
|
+
onClick: F[2] || (F[2] = (U) => P.value = void 0)
|
|
1187
1242
|
}, {
|
|
1188
1243
|
default: s(() => [
|
|
1189
|
-
|
|
1244
|
+
k(l(a.value.keepJobs), 1)
|
|
1190
1245
|
]),
|
|
1191
1246
|
_: 1
|
|
1192
1247
|
}, 8, ["disabled"])
|
|
1193
1248
|
])
|
|
1194
1249
|
]),
|
|
1195
1250
|
_: 1
|
|
1196
|
-
})) :
|
|
1197
|
-
r.value.length ? (t(),
|
|
1198
|
-
(t(!0),
|
|
1199
|
-
key:
|
|
1200
|
-
"data-job-state":
|
|
1201
|
-
"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
|
|
1202
1257
|
}, [
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
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), {
|
|
1206
1261
|
key: 1,
|
|
1207
1262
|
variant: "secondary",
|
|
1208
|
-
disabled:
|
|
1209
|
-
onClick: (
|
|
1263
|
+
disabled: u.value,
|
|
1264
|
+
onClick: (g) => P.value = U.submitter
|
|
1210
1265
|
}, {
|
|
1211
1266
|
default: s(() => [
|
|
1212
|
-
|
|
1267
|
+
k(l(a.value.purgeOwner), 1)
|
|
1213
1268
|
]),
|
|
1214
1269
|
_: 1
|
|
1215
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1216
|
-
|
|
1270
|
+
}, 8, ["disabled", "onClick"])) : b("", !0),
|
|
1271
|
+
X(U) ? b("", !0) : (t(), w(e(A), {
|
|
1217
1272
|
key: 2,
|
|
1218
1273
|
variant: "secondary",
|
|
1219
|
-
disabled:
|
|
1220
|
-
onClick: (
|
|
1274
|
+
disabled: u.value,
|
|
1275
|
+
onClick: (g) => $e(U.id)
|
|
1221
1276
|
}, {
|
|
1222
1277
|
default: s(() => [
|
|
1223
|
-
|
|
1278
|
+
k(l(a.value.cancel), 1)
|
|
1224
1279
|
]),
|
|
1225
1280
|
_: 1
|
|
1226
1281
|
}, 8, ["disabled", "onClick"])),
|
|
1227
|
-
|
|
1282
|
+
Ce(U) ? (t(), w(e(A), {
|
|
1228
1283
|
key: 3,
|
|
1229
1284
|
variant: "secondary",
|
|
1230
|
-
disabled:
|
|
1231
|
-
onClick: (
|
|
1285
|
+
disabled: u.value,
|
|
1286
|
+
onClick: (g) => _(U)
|
|
1232
1287
|
}, {
|
|
1233
1288
|
default: s(() => [
|
|
1234
|
-
|
|
1289
|
+
k(l(a.value.scheduleCopy), 1)
|
|
1235
1290
|
]),
|
|
1236
1291
|
_: 1
|
|
1237
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1238
|
-
|
|
1239
|
-
|
|
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), {
|
|
1240
1295
|
key: 5,
|
|
1241
1296
|
variant: "secondary",
|
|
1242
|
-
disabled:
|
|
1243
|
-
onClick: (
|
|
1297
|
+
disabled: u.value,
|
|
1298
|
+
onClick: (g) => ke(U)
|
|
1244
1299
|
}, {
|
|
1245
1300
|
default: s(() => [
|
|
1246
|
-
|
|
1301
|
+
k(l(a.value.result), 1)
|
|
1247
1302
|
]),
|
|
1248
1303
|
_: 1
|
|
1249
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1250
|
-
], 8,
|
|
1251
|
-
])) : (t(),
|
|
1252
|
-
|
|
1304
|
+
}, 8, ["disabled", "onClick"])) : b("", !0)
|
|
1305
|
+
], 8, bl))), 128))
|
|
1306
|
+
])) : (t(), $("p", yl, l(a.value.noJobs), 1)),
|
|
1307
|
+
h("section", {
|
|
1253
1308
|
"data-bg-schedules": "",
|
|
1254
1309
|
class: "bg-schedules",
|
|
1255
1310
|
"aria-label": a.value.schedulesTitle
|
|
1256
1311
|
}, [
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
d.value ? (t(),
|
|
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), {
|
|
1260
1315
|
key: 0,
|
|
1261
1316
|
class: "bg-schedule-form",
|
|
1262
|
-
onSubmit:
|
|
1317
|
+
onSubmit: be(z, ["prevent"])
|
|
1263
1318
|
}, {
|
|
1264
1319
|
default: s(() => [
|
|
1265
|
-
|
|
1266
|
-
|
|
1320
|
+
h("p", null, l(m(a.value.scheduleSource, { name: d.value.name })), 1),
|
|
1321
|
+
y(e(re), {
|
|
1267
1322
|
label: a.value.interval
|
|
1268
1323
|
}, {
|
|
1269
1324
|
default: s(() => [
|
|
1270
|
-
|
|
1271
|
-
modelValue:
|
|
1272
|
-
"onUpdate:modelValue":
|
|
1325
|
+
y(e(Ne), {
|
|
1326
|
+
modelValue: V.value,
|
|
1327
|
+
"onUpdate:modelValue": F[3] || (F[3] = (U) => V.value = U),
|
|
1273
1328
|
"data-schedule-interval": "",
|
|
1274
|
-
options:
|
|
1275
|
-
disabled:
|
|
1329
|
+
options: B.value,
|
|
1330
|
+
disabled: u.value
|
|
1276
1331
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
1277
1332
|
]),
|
|
1278
1333
|
_: 1
|
|
1279
1334
|
}, 8, ["label"]),
|
|
1280
|
-
|
|
1281
|
-
modelValue:
|
|
1282
|
-
"onUpdate:modelValue":
|
|
1335
|
+
y(e(ca), {
|
|
1336
|
+
modelValue: p.value,
|
|
1337
|
+
"onUpdate:modelValue": F[4] || (F[4] = (U) => p.value = U),
|
|
1283
1338
|
"data-schedule-consent": "",
|
|
1284
|
-
disabled:
|
|
1339
|
+
disabled: u.value,
|
|
1285
1340
|
label: a.value.scheduleConsent
|
|
1286
1341
|
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
1287
|
-
|
|
1342
|
+
y(e(_e), null, {
|
|
1288
1343
|
default: s(() => [
|
|
1289
|
-
|
|
1344
|
+
y(e(A), {
|
|
1290
1345
|
type: "submit",
|
|
1291
1346
|
variant: "primary",
|
|
1292
|
-
disabled:
|
|
1347
|
+
disabled: u.value || !p.value
|
|
1293
1348
|
}, {
|
|
1294
1349
|
default: s(() => [
|
|
1295
|
-
|
|
1350
|
+
k(l(a.value.createSchedule), 1)
|
|
1296
1351
|
]),
|
|
1297
1352
|
_: 1
|
|
1298
1353
|
}, 8, ["disabled"]),
|
|
1299
|
-
|
|
1354
|
+
y(e(A), {
|
|
1300
1355
|
type: "button",
|
|
1301
1356
|
variant: "secondary",
|
|
1302
|
-
disabled:
|
|
1303
|
-
onClick:
|
|
1357
|
+
disabled: u.value,
|
|
1358
|
+
onClick: F[5] || (F[5] = (U) => d.value = void 0)
|
|
1304
1359
|
}, {
|
|
1305
1360
|
default: s(() => [
|
|
1306
|
-
|
|
1361
|
+
k(l(a.value.cancel), 1)
|
|
1307
1362
|
]),
|
|
1308
1363
|
_: 1
|
|
1309
1364
|
}, 8, ["disabled"])
|
|
@@ -1312,148 +1367,148 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
|
|
|
1312
1367
|
})
|
|
1313
1368
|
]),
|
|
1314
1369
|
_: 1
|
|
1315
|
-
})) :
|
|
1316
|
-
|
|
1317
|
-
(t(!0),
|
|
1318
|
-
key:
|
|
1319
|
-
"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
|
|
1320
1375
|
}, [
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
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), {
|
|
1326
1381
|
key: 2,
|
|
1327
1382
|
tone: "warning"
|
|
1328
1383
|
}, {
|
|
1329
1384
|
default: s(() => [
|
|
1330
|
-
|
|
1385
|
+
k(l(a.value.revisionChanged), 1)
|
|
1331
1386
|
]),
|
|
1332
1387
|
_: 1
|
|
1333
|
-
})) :
|
|
1388
|
+
})) : U.reason === "input-unavailable" ? (t(), w(e(W), {
|
|
1334
1389
|
key: 3,
|
|
1335
1390
|
tone: "warning"
|
|
1336
1391
|
}, {
|
|
1337
1392
|
default: s(() => [
|
|
1338
|
-
|
|
1393
|
+
k(l(a.value.errors["input-unavailable"]), 1)
|
|
1339
1394
|
]),
|
|
1340
1395
|
_: 1
|
|
1341
|
-
})) :
|
|
1342
|
-
|
|
1343
|
-
|
|
1396
|
+
})) : b("", !0),
|
|
1397
|
+
h("div", Ul, [
|
|
1398
|
+
U.enabled ? (t(), w(e(A), {
|
|
1344
1399
|
key: 0,
|
|
1345
1400
|
variant: "secondary",
|
|
1346
|
-
disabled:
|
|
1347
|
-
onClick: (
|
|
1401
|
+
disabled: u.value,
|
|
1402
|
+
onClick: (g) => G(U.id)
|
|
1348
1403
|
}, {
|
|
1349
1404
|
default: s(() => [
|
|
1350
|
-
|
|
1405
|
+
k(l(a.value.disableSchedule), 1)
|
|
1351
1406
|
]),
|
|
1352
1407
|
_: 1
|
|
1353
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1408
|
+
}, 8, ["disabled", "onClick"])) : i.value.admin ? (t(), w(e(A), {
|
|
1354
1409
|
key: 1,
|
|
1355
1410
|
variant: "secondary",
|
|
1356
|
-
disabled:
|
|
1357
|
-
onClick: (
|
|
1411
|
+
disabled: u.value,
|
|
1412
|
+
onClick: (g) => f.value = U
|
|
1358
1413
|
}, {
|
|
1359
1414
|
default: s(() => [
|
|
1360
|
-
|
|
1415
|
+
k(l(a.value.enableSchedule), 1)
|
|
1361
1416
|
]),
|
|
1362
1417
|
_: 1
|
|
1363
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1364
|
-
|
|
1418
|
+
}, 8, ["disabled", "onClick"])) : b("", !0),
|
|
1419
|
+
y(e(A), {
|
|
1365
1420
|
variant: "secondary",
|
|
1366
|
-
disabled:
|
|
1367
|
-
onClick: (
|
|
1421
|
+
disabled: u.value,
|
|
1422
|
+
onClick: (g) => C.value = U
|
|
1368
1423
|
}, {
|
|
1369
1424
|
default: s(() => [
|
|
1370
|
-
|
|
1425
|
+
k(l(a.value.deleteSchedule), 1)
|
|
1371
1426
|
]),
|
|
1372
1427
|
_: 1
|
|
1373
1428
|
}, 8, ["disabled", "onClick"])
|
|
1374
1429
|
])
|
|
1375
|
-
], 8,
|
|
1376
|
-
])) : (t(),
|
|
1377
|
-
|
|
1430
|
+
], 8, xl))), 128))
|
|
1431
|
+
])) : (t(), $("p", Cl, l(a.value.noSchedules), 1)),
|
|
1432
|
+
C.value ? (t(), w(e(W), {
|
|
1378
1433
|
key: 3,
|
|
1379
1434
|
tone: "warning"
|
|
1380
1435
|
}, {
|
|
1381
1436
|
default: s(() => [
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1437
|
+
h("p", null, l(m(a.value.deleteScheduleConsent, { name: C.value.name })), 1),
|
|
1438
|
+
h("div", Dl, [
|
|
1439
|
+
y(e(A), {
|
|
1385
1440
|
variant: "danger",
|
|
1386
|
-
disabled:
|
|
1387
|
-
onClick:
|
|
1441
|
+
disabled: u.value,
|
|
1442
|
+
onClick: Z
|
|
1388
1443
|
}, {
|
|
1389
1444
|
default: s(() => [
|
|
1390
|
-
|
|
1445
|
+
k(l(a.value.confirmDeleteSchedule), 1)
|
|
1391
1446
|
]),
|
|
1392
1447
|
_: 1
|
|
1393
1448
|
}, 8, ["disabled"]),
|
|
1394
|
-
|
|
1449
|
+
y(e(A), {
|
|
1395
1450
|
variant: "secondary",
|
|
1396
|
-
disabled:
|
|
1397
|
-
onClick:
|
|
1451
|
+
disabled: u.value,
|
|
1452
|
+
onClick: F[6] || (F[6] = (U) => C.value = void 0)
|
|
1398
1453
|
}, {
|
|
1399
1454
|
default: s(() => [
|
|
1400
|
-
|
|
1455
|
+
k(l(a.value.cancel), 1)
|
|
1401
1456
|
]),
|
|
1402
1457
|
_: 1
|
|
1403
1458
|
}, 8, ["disabled"])
|
|
1404
1459
|
])
|
|
1405
1460
|
]),
|
|
1406
1461
|
_: 1
|
|
1407
|
-
})) :
|
|
1408
|
-
|
|
1462
|
+
})) : b("", !0),
|
|
1463
|
+
f.value ? (t(), w(e(W), {
|
|
1409
1464
|
key: 4,
|
|
1410
1465
|
tone: "warning"
|
|
1411
1466
|
}, {
|
|
1412
1467
|
default: s(() => [
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1468
|
+
h("p", null, l(m(a.value.enableScheduleConsent, { name: f.value.name })), 1),
|
|
1469
|
+
h("div", Il, [
|
|
1470
|
+
y(e(A), {
|
|
1416
1471
|
variant: "primary",
|
|
1417
|
-
disabled:
|
|
1418
|
-
onClick:
|
|
1472
|
+
disabled: u.value,
|
|
1473
|
+
onClick: le
|
|
1419
1474
|
}, {
|
|
1420
1475
|
default: s(() => [
|
|
1421
|
-
|
|
1476
|
+
k(l(a.value.confirmEnableSchedule), 1)
|
|
1422
1477
|
]),
|
|
1423
1478
|
_: 1
|
|
1424
1479
|
}, 8, ["disabled"]),
|
|
1425
|
-
|
|
1480
|
+
y(e(A), {
|
|
1426
1481
|
variant: "secondary",
|
|
1427
|
-
disabled:
|
|
1428
|
-
onClick:
|
|
1482
|
+
disabled: u.value,
|
|
1483
|
+
onClick: F[7] || (F[7] = (U) => f.value = void 0)
|
|
1429
1484
|
}, {
|
|
1430
1485
|
default: s(() => [
|
|
1431
|
-
|
|
1486
|
+
k(l(a.value.cancel), 1)
|
|
1432
1487
|
]),
|
|
1433
1488
|
_: 1
|
|
1434
1489
|
}, 8, ["disabled"])
|
|
1435
1490
|
])
|
|
1436
1491
|
]),
|
|
1437
1492
|
_: 1
|
|
1438
|
-
})) :
|
|
1439
|
-
], 8,
|
|
1440
|
-
|
|
1493
|
+
})) : b("", !0)
|
|
1494
|
+
], 8, gl),
|
|
1495
|
+
q.value ? (t(), w(e(Fe), {
|
|
1441
1496
|
key: 3,
|
|
1442
|
-
href:
|
|
1443
|
-
download:
|
|
1497
|
+
href: q.value,
|
|
1498
|
+
download: j.value
|
|
1444
1499
|
}, {
|
|
1445
1500
|
default: s(() => [
|
|
1446
|
-
|
|
1501
|
+
k(l(a.value.download), 1)
|
|
1447
1502
|
]),
|
|
1448
1503
|
_: 1
|
|
1449
|
-
}, 8, ["href", "download"])) :
|
|
1450
|
-
], 64)) :
|
|
1504
|
+
}, 8, ["href", "download"])) : b("", !0)
|
|
1505
|
+
], 64)) : b("", !0)
|
|
1451
1506
|
], 64))
|
|
1452
1507
|
]),
|
|
1453
1508
|
_: 1
|
|
1454
1509
|
}, 8, ["aria-busy", "title"]));
|
|
1455
1510
|
}
|
|
1456
|
-
}),
|
|
1511
|
+
}), Vt = /* @__PURE__ */ oe(Al, [["__scopeId", "data-v-7954713f"]]), El = { role: "status" }, Rl = { key: 1 }, Tl = { key: 2 }, Pt = /* @__PURE__ */ se({
|
|
1457
1512
|
__name: "ExecutorSettings",
|
|
1458
1513
|
props: {
|
|
1459
1514
|
admin: { type: Boolean },
|
|
@@ -1461,137 +1516,137 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
|
|
|
1461
1516
|
ctx: {}
|
|
1462
1517
|
},
|
|
1463
1518
|
emits: ["confirmed"],
|
|
1464
|
-
setup(
|
|
1465
|
-
const a =
|
|
1466
|
-
let
|
|
1467
|
-
async function
|
|
1468
|
-
const
|
|
1469
|
-
if (
|
|
1470
|
-
const
|
|
1471
|
-
if (
|
|
1472
|
-
const
|
|
1473
|
-
let
|
|
1474
|
-
for (let
|
|
1475
|
-
const
|
|
1476
|
-
if (
|
|
1477
|
-
if (!Array.isArray(
|
|
1478
|
-
for (const
|
|
1479
|
-
|
|
1480
|
-
if (
|
|
1481
|
-
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" };
|
|
1482
1537
|
}
|
|
1483
|
-
|
|
1538
|
+
C.value = ee, V.value = H.selection?.scope ?? H.preselection ?? "";
|
|
1484
1539
|
}
|
|
1485
|
-
async function
|
|
1486
|
-
if (!(!a.admin ||
|
|
1487
|
-
|
|
1540
|
+
async function Y() {
|
|
1541
|
+
if (!(!a.admin || u.value)) {
|
|
1542
|
+
u.value = !0, d.value = !1;
|
|
1488
1543
|
try {
|
|
1489
|
-
await
|
|
1544
|
+
await j();
|
|
1490
1545
|
} catch {
|
|
1491
|
-
|
|
1546
|
+
q || (d.value = !0);
|
|
1492
1547
|
} finally {
|
|
1493
|
-
|
|
1548
|
+
q || (u.value = !1);
|
|
1494
1549
|
}
|
|
1495
1550
|
}
|
|
1496
1551
|
}
|
|
1497
|
-
async function
|
|
1498
|
-
if (!a.admin ||
|
|
1499
|
-
|
|
1500
|
-
const
|
|
1501
|
-
|
|
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;
|
|
1502
1557
|
try {
|
|
1503
|
-
|
|
1504
|
-
await
|
|
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");
|
|
1505
1560
|
} catch {
|
|
1506
|
-
|
|
1561
|
+
q || (d.value = !0);
|
|
1507
1562
|
} finally {
|
|
1508
|
-
|
|
1563
|
+
q || (u.value = !1, x.value = !1);
|
|
1509
1564
|
}
|
|
1510
1565
|
}
|
|
1511
|
-
return
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
}),
|
|
1515
|
-
}),
|
|
1516
|
-
|
|
1517
|
-
}), (
|
|
1566
|
+
return fe(() => {
|
|
1567
|
+
i.subscribe?.((L) => {
|
|
1568
|
+
q || (n.value = L);
|
|
1569
|
+
}), Y();
|
|
1570
|
+
}), de(() => {
|
|
1571
|
+
q = !0, o.value = "";
|
|
1572
|
+
}), (L, X) => c.admin ? (t(), w(e(pe), {
|
|
1518
1573
|
key: 0,
|
|
1519
1574
|
title: r.value.setupTitle,
|
|
1520
1575
|
collapsible: !1,
|
|
1521
|
-
"aria-busy":
|
|
1576
|
+
"aria-busy": u.value
|
|
1522
1577
|
}, {
|
|
1523
1578
|
default: s(() => [
|
|
1524
|
-
|
|
1525
|
-
|
|
1579
|
+
h("p", null, l(r.value.setupHelp), 1),
|
|
1580
|
+
d.value ? (t(), w(e(W), {
|
|
1526
1581
|
key: 0,
|
|
1527
1582
|
tone: "danger",
|
|
1528
1583
|
role: "alert"
|
|
1529
1584
|
}, {
|
|
1530
1585
|
default: s(() => [
|
|
1531
|
-
|
|
1586
|
+
k(l(r.value.setupError), 1)
|
|
1532
1587
|
]),
|
|
1533
1588
|
_: 1
|
|
1534
|
-
})) :
|
|
1535
|
-
|
|
1536
|
-
n.value?.reason && (n.value.state === "blocked" || n.value.state === "unsupported") ? (t(),
|
|
1537
|
-
|
|
1538
|
-
|
|
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), {
|
|
1539
1594
|
key: 3,
|
|
1540
1595
|
tone: "warning"
|
|
1541
1596
|
}, {
|
|
1542
1597
|
default: s(() => [
|
|
1543
|
-
|
|
1598
|
+
k(l(r.value.scopeMismatch) + " " + l(r.value.preselection) + ": " + l(p.value.preselection) + " · " + l(r.value.protectedScope) + ": " + l(p.value.selection?.root), 1)
|
|
1544
1599
|
]),
|
|
1545
1600
|
_: 1
|
|
1546
|
-
})) :
|
|
1547
|
-
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), {
|
|
1548
1603
|
key: 4,
|
|
1549
|
-
onSubmit:
|
|
1604
|
+
onSubmit: be(J, ["prevent"])
|
|
1550
1605
|
}, {
|
|
1551
1606
|
default: s(() => [
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
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), {
|
|
1555
1610
|
label: r.value.scopeLabel,
|
|
1556
1611
|
"label-for": "delegate-scope"
|
|
1557
1612
|
}, {
|
|
1558
1613
|
default: s(() => [
|
|
1559
|
-
|
|
1614
|
+
y(e(Ne), {
|
|
1560
1615
|
id: "delegate-scope",
|
|
1561
|
-
modelValue:
|
|
1562
|
-
"onUpdate:modelValue":
|
|
1563
|
-
options:
|
|
1564
|
-
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
|
|
1565
1620
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
1566
1621
|
]),
|
|
1567
1622
|
_: 1
|
|
1568
1623
|
}, 8, ["label"])
|
|
1569
|
-
], 64)) :
|
|
1570
|
-
|
|
1624
|
+
], 64)) : b("", !0),
|
|
1625
|
+
y(e(re), {
|
|
1571
1626
|
label: r.value.password,
|
|
1572
1627
|
"label-for": "delegate-password"
|
|
1573
1628
|
}, {
|
|
1574
1629
|
default: s(() => [
|
|
1575
|
-
|
|
1630
|
+
y(e(me), {
|
|
1576
1631
|
id: "delegate-password",
|
|
1577
|
-
modelValue:
|
|
1578
|
-
"onUpdate:modelValue":
|
|
1632
|
+
modelValue: o.value,
|
|
1633
|
+
"onUpdate:modelValue": X[1] || (X[1] = (H) => o.value = H),
|
|
1579
1634
|
type: "password",
|
|
1580
1635
|
autocomplete: "current-password",
|
|
1581
|
-
disabled:
|
|
1636
|
+
disabled: u.value || d.value
|
|
1582
1637
|
}, null, 8, ["modelValue", "disabled"])
|
|
1583
1638
|
]),
|
|
1584
1639
|
_: 1
|
|
1585
1640
|
}, 8, ["label"]),
|
|
1586
|
-
|
|
1641
|
+
y(e(_e), null, {
|
|
1587
1642
|
default: s(() => [
|
|
1588
|
-
|
|
1643
|
+
y(e(A), {
|
|
1589
1644
|
type: "submit",
|
|
1590
1645
|
variant: "primary",
|
|
1591
|
-
disabled:
|
|
1646
|
+
disabled: u.value || d.value || !o.value || !R.value || f.value && !!p.value?.selection && !T.value
|
|
1592
1647
|
}, {
|
|
1593
1648
|
default: s(() => [
|
|
1594
|
-
|
|
1649
|
+
k(l(f.value ? p.value?.selection ? r.value.confirmScope : r.value.confirmShare : r.value.authorize), 1)
|
|
1595
1650
|
]),
|
|
1596
1651
|
_: 1
|
|
1597
1652
|
}, 8, ["disabled"])
|
|
@@ -1600,162 +1655,162 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
|
|
|
1600
1655
|
})
|
|
1601
1656
|
]),
|
|
1602
1657
|
_: 1
|
|
1603
|
-
})) :
|
|
1604
|
-
|
|
1658
|
+
})) : b("", !0),
|
|
1659
|
+
y(e(A), {
|
|
1605
1660
|
variant: "secondary",
|
|
1606
|
-
disabled:
|
|
1607
|
-
onClick:
|
|
1661
|
+
disabled: u.value,
|
|
1662
|
+
onClick: Y
|
|
1608
1663
|
}, {
|
|
1609
1664
|
default: s(() => [
|
|
1610
|
-
|
|
1665
|
+
k(l(r.value.refresh), 1)
|
|
1611
1666
|
]),
|
|
1612
1667
|
_: 1
|
|
1613
1668
|
}, 8, ["disabled"])
|
|
1614
1669
|
]),
|
|
1615
1670
|
_: 1
|
|
1616
|
-
}, 8, ["title", "aria-busy"])) :
|
|
1671
|
+
}, 8, ["title", "aria-busy"])) : b("", !0);
|
|
1617
1672
|
}
|
|
1618
|
-
}),
|
|
1673
|
+
}), ql = {
|
|
1619
1674
|
key: 1,
|
|
1620
1675
|
role: "status"
|
|
1621
|
-
},
|
|
1676
|
+
}, Ol = {
|
|
1622
1677
|
key: 2,
|
|
1623
1678
|
role: "status"
|
|
1624
|
-
},
|
|
1679
|
+
}, Bl = {
|
|
1625
1680
|
key: 0,
|
|
1626
1681
|
role: "status",
|
|
1627
1682
|
class: "destination"
|
|
1628
|
-
},
|
|
1683
|
+
}, Ll = { class: "section-heading" }, Fl = { key: 3 }, Nl = {
|
|
1629
1684
|
key: 4,
|
|
1630
1685
|
class: "records"
|
|
1631
|
-
},
|
|
1686
|
+
}, Ml = ["data-job-state"], Kl = ["role"], Hl = { key: 5 }, Gl = {
|
|
1632
1687
|
key: 6,
|
|
1633
1688
|
class: "records"
|
|
1634
|
-
},
|
|
1689
|
+
}, Jl = /* @__PURE__ */ se({
|
|
1635
1690
|
__name: "DelegatePanel",
|
|
1636
1691
|
props: {
|
|
1637
1692
|
ctx: {}
|
|
1638
1693
|
},
|
|
1639
|
-
setup(
|
|
1640
|
-
const
|
|
1641
|
-
let
|
|
1642
|
-
|
|
1643
|
-
|
|
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;
|
|
1644
1699
|
}, { flush: "sync" });
|
|
1645
|
-
const
|
|
1646
|
-
async function
|
|
1647
|
-
if (
|
|
1648
|
-
const [
|
|
1649
|
-
if (!
|
|
1650
|
-
|
|
1651
|
-
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;
|
|
1652
1707
|
}
|
|
1653
1708
|
}
|
|
1654
|
-
async function L(
|
|
1655
|
-
if (!(
|
|
1656
|
-
|
|
1709
|
+
async function L(B) {
|
|
1710
|
+
if (!(o.value || f)) {
|
|
1711
|
+
o.value = !0, u.value = void 0;
|
|
1657
1712
|
try {
|
|
1658
|
-
await
|
|
1659
|
-
} catch (
|
|
1660
|
-
|
|
1713
|
+
await B();
|
|
1714
|
+
} catch (_) {
|
|
1715
|
+
f || (u.value = _);
|
|
1661
1716
|
} finally {
|
|
1662
|
-
|
|
1717
|
+
f || (o.value = !1);
|
|
1663
1718
|
}
|
|
1664
1719
|
}
|
|
1665
1720
|
}
|
|
1666
|
-
const
|
|
1667
|
-
await
|
|
1668
|
-
}),
|
|
1669
|
-
const
|
|
1670
|
-
|
|
1671
|
-
}),
|
|
1672
|
-
|
|
1673
|
-
}),
|
|
1674
|
-
const
|
|
1675
|
-
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);
|
|
1676
1731
|
};
|
|
1677
|
-
return
|
|
1678
|
-
|
|
1679
|
-
n.value.some(
|
|
1732
|
+
return fe(() => {
|
|
1733
|
+
X(), P = setInterval(() => {
|
|
1734
|
+
n.value.some(K) && X();
|
|
1680
1735
|
}, 3e3);
|
|
1681
|
-
}),
|
|
1682
|
-
|
|
1683
|
-
}), (
|
|
1736
|
+
}), de(() => {
|
|
1737
|
+
f = !0, P && clearInterval(P), m.dispose();
|
|
1738
|
+
}), (B, _) => (t(), w(e(pe), {
|
|
1684
1739
|
title: a.value.title,
|
|
1685
1740
|
collapsible: !1,
|
|
1686
|
-
"aria-busy":
|
|
1741
|
+
"aria-busy": o.value,
|
|
1687
1742
|
class: "delegate-panel"
|
|
1688
1743
|
}, {
|
|
1689
1744
|
default: s(() => [
|
|
1690
|
-
|
|
1691
|
-
|
|
1745
|
+
h("p", null, l(a.value.help), 1),
|
|
1746
|
+
u.value && !j.value ? (t(), w(e(W), {
|
|
1692
1747
|
key: 0,
|
|
1693
1748
|
tone: "danger",
|
|
1694
1749
|
role: "alert"
|
|
1695
1750
|
}, {
|
|
1696
1751
|
default: s(() => [
|
|
1697
|
-
|
|
1752
|
+
k(l(e(Ze)(u.value, a.value)), 1)
|
|
1698
1753
|
]),
|
|
1699
1754
|
_: 1
|
|
1700
|
-
})) :
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
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"])
|
|
1705
1760
|
}, {
|
|
1706
1761
|
default: s(() => [
|
|
1707
|
-
|
|
1762
|
+
y(e(re), {
|
|
1708
1763
|
label: a.value.url,
|
|
1709
1764
|
"label-for": "delegate-url"
|
|
1710
1765
|
}, {
|
|
1711
1766
|
default: s(() => [
|
|
1712
|
-
|
|
1767
|
+
y(e(me), {
|
|
1713
1768
|
id: "delegate-url",
|
|
1714
|
-
modelValue:
|
|
1715
|
-
"onUpdate:modelValue":
|
|
1769
|
+
modelValue: V.value,
|
|
1770
|
+
"onUpdate:modelValue": _[0] || (_[0] = (z) => V.value = z),
|
|
1716
1771
|
type: "url",
|
|
1717
|
-
disabled:
|
|
1772
|
+
disabled: o.value || i.value?.state !== "ready"
|
|
1718
1773
|
}, null, 8, ["modelValue", "disabled"])
|
|
1719
1774
|
]),
|
|
1720
1775
|
_: 1
|
|
1721
1776
|
}, 8, ["label"]),
|
|
1722
|
-
|
|
1777
|
+
y(e(re), {
|
|
1723
1778
|
label: a.value.name,
|
|
1724
1779
|
"label-for": "delegate-name"
|
|
1725
1780
|
}, {
|
|
1726
1781
|
default: s(() => [
|
|
1727
|
-
|
|
1782
|
+
y(e(me), {
|
|
1728
1783
|
id: "delegate-name",
|
|
1729
|
-
modelValue:
|
|
1730
|
-
"onUpdate:modelValue":
|
|
1784
|
+
modelValue: C.value,
|
|
1785
|
+
"onUpdate:modelValue": _[1] || (_[1] = (z) => C.value = z),
|
|
1731
1786
|
"data-file-name": "",
|
|
1732
|
-
disabled:
|
|
1787
|
+
disabled: o.value || i.value?.state !== "ready"
|
|
1733
1788
|
}, null, 8, ["modelValue", "disabled"])
|
|
1734
1789
|
]),
|
|
1735
1790
|
_: 1
|
|
1736
1791
|
}, 8, ["label"]),
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
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, {
|
|
1740
1795
|
default: s(() => [
|
|
1741
|
-
|
|
1796
|
+
y(e(A), {
|
|
1742
1797
|
type: "button",
|
|
1743
1798
|
variant: "secondary",
|
|
1744
|
-
disabled:
|
|
1745
|
-
onClick:
|
|
1799
|
+
disabled: o.value || i.value?.state !== "ready",
|
|
1800
|
+
onClick: _[2] || (_[2] = (z) => d.value = !0)
|
|
1746
1801
|
}, {
|
|
1747
1802
|
default: s(() => [
|
|
1748
|
-
|
|
1803
|
+
k(l(a.value.choose), 1)
|
|
1749
1804
|
]),
|
|
1750
1805
|
_: 1
|
|
1751
1806
|
}, 8, ["disabled"]),
|
|
1752
|
-
|
|
1807
|
+
y(e(A), {
|
|
1753
1808
|
type: "submit",
|
|
1754
1809
|
variant: "primary",
|
|
1755
|
-
disabled:
|
|
1810
|
+
disabled: o.value || !ae.value
|
|
1756
1811
|
}, {
|
|
1757
1812
|
default: s(() => [
|
|
1758
|
-
|
|
1813
|
+
k(l(a.value.submit), 1)
|
|
1759
1814
|
]),
|
|
1760
1815
|
_: 1
|
|
1761
1816
|
}, 8, ["disabled"])
|
|
@@ -1765,64 +1820,64 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
|
|
|
1765
1820
|
]),
|
|
1766
1821
|
_: 1
|
|
1767
1822
|
}),
|
|
1768
|
-
|
|
1823
|
+
y(we, {
|
|
1769
1824
|
open: d.value,
|
|
1770
|
-
"onUpdate:open":
|
|
1771
|
-
locale:
|
|
1772
|
-
provider: e(
|
|
1825
|
+
"onUpdate:open": _[3] || (_[3] = (z) => d.value = z),
|
|
1826
|
+
locale: c.ctx.locale,
|
|
1827
|
+
provider: e(m),
|
|
1773
1828
|
mode: "folder",
|
|
1774
|
-
onSelected:
|
|
1829
|
+
onSelected: _[4] || (_[4] = (z) => p.value = z)
|
|
1775
1830
|
}, null, 8, ["open", "locale", "provider"]),
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1831
|
+
h("div", Ll, [
|
|
1832
|
+
h("h3", null, l(a.value.downloads), 1),
|
|
1833
|
+
y(e(A), {
|
|
1779
1834
|
variant: "secondary",
|
|
1780
|
-
disabled:
|
|
1781
|
-
onClick:
|
|
1835
|
+
disabled: o.value,
|
|
1836
|
+
onClick: X
|
|
1782
1837
|
}, {
|
|
1783
1838
|
default: s(() => [
|
|
1784
|
-
|
|
1839
|
+
k(l(a.value.refresh), 1)
|
|
1785
1840
|
]),
|
|
1786
1841
|
_: 1
|
|
1787
1842
|
}, 8, ["disabled"])
|
|
1788
1843
|
]),
|
|
1789
|
-
!n.value.length && !
|
|
1790
|
-
(t(!0),
|
|
1791
|
-
key:
|
|
1792
|
-
"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
|
|
1793
1848
|
}, [
|
|
1794
|
-
|
|
1795
|
-
role:
|
|
1796
|
-
}, l(
|
|
1797
|
-
|
|
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), {
|
|
1798
1853
|
key: 0,
|
|
1799
1854
|
variant: "secondary",
|
|
1800
|
-
disabled:
|
|
1801
|
-
onClick: (
|
|
1855
|
+
disabled: o.value,
|
|
1856
|
+
onClick: (G) => ee(z.id)
|
|
1802
1857
|
}, {
|
|
1803
1858
|
default: s(() => [
|
|
1804
|
-
|
|
1859
|
+
k(l(a.value.cancel), 1)
|
|
1805
1860
|
]),
|
|
1806
1861
|
_: 1
|
|
1807
|
-
}, 8, ["disabled", "onClick"])) :
|
|
1808
|
-
], 8,
|
|
1862
|
+
}, 8, ["disabled", "onClick"])) : b("", !0)
|
|
1863
|
+
], 8, Ml))), 128))
|
|
1809
1864
|
])),
|
|
1810
|
-
|
|
1811
|
-
!r.value.length && !
|
|
1812
|
-
(t(!0),
|
|
1813
|
-
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
|
|
1814
1869
|
}, [
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
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)
|
|
1818
1873
|
]),
|
|
1819
|
-
|
|
1874
|
+
y(e(A), {
|
|
1820
1875
|
variant: "secondary",
|
|
1821
|
-
disabled:
|
|
1822
|
-
onClick: (
|
|
1876
|
+
disabled: o.value,
|
|
1877
|
+
onClick: (G) => H(z.delegation_id)
|
|
1823
1878
|
}, {
|
|
1824
1879
|
default: s(() => [
|
|
1825
|
-
|
|
1880
|
+
k(l(a.value.revoke), 1)
|
|
1826
1881
|
]),
|
|
1827
1882
|
_: 1
|
|
1828
1883
|
}, 8, ["disabled", "onClick"])
|
|
@@ -1832,19 +1887,19 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
|
|
|
1832
1887
|
_: 1
|
|
1833
1888
|
}, 8, ["title", "aria-busy"]));
|
|
1834
1889
|
}
|
|
1835
|
-
}),
|
|
1890
|
+
}), Ut = /* @__PURE__ */ oe(Jl, [["__scopeId", "data-v-d79ee942"]]), Xl = {
|
|
1836
1891
|
key: 1,
|
|
1837
1892
|
role: "status"
|
|
1838
|
-
},
|
|
1893
|
+
}, Ql = {
|
|
1839
1894
|
key: 2,
|
|
1840
1895
|
role: "status"
|
|
1841
|
-
},
|
|
1896
|
+
}, Yl = { key: 3 }, Wl = {
|
|
1842
1897
|
key: 7,
|
|
1843
1898
|
role: "status"
|
|
1844
|
-
},
|
|
1899
|
+
}, Zl = { class: "save-actions" }, jl = { key: 8 }, et = {
|
|
1845
1900
|
key: 10,
|
|
1846
1901
|
class: "save-actions"
|
|
1847
|
-
},
|
|
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({
|
|
1848
1903
|
__name: "BackgroundSavePanel",
|
|
1849
1904
|
props: {
|
|
1850
1905
|
sdk: {},
|
|
@@ -1853,472 +1908,532 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
|
|
|
1853
1908
|
picker: {}
|
|
1854
1909
|
},
|
|
1855
1910
|
emits: ["authorized"],
|
|
1856
|
-
setup(
|
|
1857
|
-
const a =
|
|
1858
|
-
let
|
|
1859
|
-
const
|
|
1860
|
-
function
|
|
1861
|
-
|
|
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;
|
|
1862
1917
|
}
|
|
1863
|
-
async function
|
|
1864
|
-
const [
|
|
1865
|
-
if (!
|
|
1866
|
-
if (!
|
|
1867
|
-
(
|
|
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;
|
|
1868
1923
|
}
|
|
1869
1924
|
}
|
|
1870
|
-
async function
|
|
1871
|
-
if (!(
|
|
1872
|
-
d.value = !0,
|
|
1925
|
+
async function J(E) {
|
|
1926
|
+
if (!(P || d.value)) {
|
|
1927
|
+
d.value = !0, p.value = void 0, V.value = "";
|
|
1873
1928
|
try {
|
|
1874
|
-
await
|
|
1875
|
-
} catch (
|
|
1876
|
-
|
|
1929
|
+
await E();
|
|
1930
|
+
} catch (B) {
|
|
1931
|
+
P || (j(), p.value = B);
|
|
1877
1932
|
} finally {
|
|
1878
|
-
|
|
1933
|
+
P || (d.value = !1);
|
|
1879
1934
|
}
|
|
1880
1935
|
}
|
|
1881
1936
|
}
|
|
1882
|
-
const L = () =>
|
|
1883
|
-
function
|
|
1884
|
-
|
|
1937
|
+
const L = () => J(Y);
|
|
1938
|
+
function X(E) {
|
|
1939
|
+
m("authorized", E), L();
|
|
1885
1940
|
}
|
|
1886
|
-
const
|
|
1887
|
-
if ((await a.sdk.revoke({ delegation_id:
|
|
1888
|
-
await
|
|
1889
|
-
}),
|
|
1890
|
-
await a.sdk.cancel({ delegation_id:
|
|
1891
|
-
}),
|
|
1892
|
-
if (!a.admin || !
|
|
1893
|
-
const
|
|
1894
|
-
if ((
|
|
1895
|
-
await
|
|
1896
|
-
}),
|
|
1897
|
-
const
|
|
1898
|
-
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();
|
|
1899
1954
|
});
|
|
1900
|
-
return
|
|
1901
|
-
L(),
|
|
1902
|
-
|
|
1955
|
+
return fe(() => {
|
|
1956
|
+
L(), R = setInterval(() => {
|
|
1957
|
+
x.value.some(q) && L();
|
|
1903
1958
|
}, 3e3);
|
|
1904
|
-
}),
|
|
1905
|
-
|
|
1906
|
-
}), (
|
|
1959
|
+
}), de(() => {
|
|
1960
|
+
P = !0, R && clearInterval(R);
|
|
1961
|
+
}), (E, B) => (t(), w(e(pe), {
|
|
1907
1962
|
title: n.value.title,
|
|
1908
1963
|
collapsible: !1,
|
|
1909
1964
|
"aria-busy": d.value,
|
|
1910
1965
|
class: "background-save-panel"
|
|
1911
1966
|
}, {
|
|
1912
1967
|
default: s(() => [
|
|
1913
|
-
|
|
1914
|
-
|
|
1968
|
+
h("p", null, l(n.value.help), 1),
|
|
1969
|
+
p.value ? (t(), w(e(W), {
|
|
1915
1970
|
key: 0,
|
|
1916
1971
|
tone: "danger",
|
|
1917
1972
|
role: "alert",
|
|
1918
1973
|
class: "save-message"
|
|
1919
1974
|
}, {
|
|
1920
1975
|
default: s(() => [
|
|
1921
|
-
|
|
1976
|
+
k(l(e(ze)(p.value, n.value)), 1)
|
|
1922
1977
|
]),
|
|
1923
1978
|
_: 1
|
|
1924
|
-
})) :
|
|
1925
|
-
d.value && !
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
])) :
|
|
1931
|
-
|
|
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), {
|
|
1932
1987
|
key: 4,
|
|
1933
1988
|
tone: "warning"
|
|
1934
1989
|
}, {
|
|
1935
1990
|
default: s(() => [
|
|
1936
|
-
|
|
1991
|
+
k(l(n.value.scopeMismatch) + " " + l(o.value.preselection) + " → " + l(o.value.selection?.root), 1)
|
|
1937
1992
|
]),
|
|
1938
1993
|
_: 1
|
|
1939
|
-
})) :
|
|
1940
|
-
|
|
1994
|
+
})) : b("", !0),
|
|
1995
|
+
o.value?.scopeMode === "install-selected" && !o.value.selection ? (t(), w(e(W), {
|
|
1941
1996
|
key: 5,
|
|
1942
1997
|
tone: "warning"
|
|
1943
1998
|
}, {
|
|
1944
1999
|
default: s(() => [
|
|
1945
|
-
|
|
2000
|
+
k(l(n.value.scopeNeeds), 1)
|
|
1946
2001
|
]),
|
|
1947
2002
|
_: 1
|
|
1948
|
-
})) :
|
|
1949
|
-
|
|
2003
|
+
})) : b("", !0),
|
|
2004
|
+
o.value?.disabled ? (t(), w(e(W), {
|
|
1950
2005
|
key: 6,
|
|
1951
2006
|
tone: "warning",
|
|
1952
2007
|
role: "status",
|
|
1953
2008
|
class: "save-message"
|
|
1954
2009
|
}, {
|
|
1955
2010
|
default: s(() => [
|
|
1956
|
-
|
|
2011
|
+
k(l(n.value.disabled), 1)
|
|
1957
2012
|
]),
|
|
1958
2013
|
_: 1
|
|
1959
|
-
})) :
|
|
1960
|
-
|
|
1961
|
-
|
|
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), {
|
|
1962
2017
|
variant: "secondary",
|
|
1963
2018
|
disabled: d.value,
|
|
1964
2019
|
onClick: L
|
|
1965
2020
|
}, {
|
|
1966
2021
|
default: s(() => [
|
|
1967
|
-
|
|
2022
|
+
k(l(n.value.refresh), 1)
|
|
1968
2023
|
]),
|
|
1969
2024
|
_: 1
|
|
1970
2025
|
}, 8, ["disabled"]),
|
|
1971
|
-
|
|
2026
|
+
c.admin && o.value ? (t(), w(e(A), {
|
|
1972
2027
|
key: 0,
|
|
1973
|
-
variant:
|
|
2028
|
+
variant: o.value.disabled ? "secondary" : "danger",
|
|
1974
2029
|
disabled: d.value,
|
|
1975
|
-
onClick:
|
|
2030
|
+
onClick: ae
|
|
1976
2031
|
}, {
|
|
1977
2032
|
default: s(() => [
|
|
1978
|
-
|
|
2033
|
+
k(l(o.value.disabled ? n.value.enable : n.value.disable), 1)
|
|
1979
2034
|
]),
|
|
1980
2035
|
_: 1
|
|
1981
|
-
}, 8, ["variant", "disabled"])) :
|
|
2036
|
+
}, 8, ["variant", "disabled"])) : b("", !0)
|
|
1982
2037
|
]),
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
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), {
|
|
1986
2041
|
key: 9,
|
|
1987
2042
|
tone: "warning"
|
|
1988
2043
|
}, {
|
|
1989
2044
|
default: s(() => [
|
|
1990
|
-
|
|
2045
|
+
k(l(n.value.reselect), 1)
|
|
1991
2046
|
]),
|
|
1992
2047
|
_: 1
|
|
1993
|
-
})) :
|
|
1994
|
-
|
|
1995
|
-
(t(!0),
|
|
1996
|
-
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: _,
|
|
1997
2052
|
variant: "secondary",
|
|
1998
|
-
disabled: d.value || !
|
|
1999
|
-
onClick: (
|
|
2000
|
-
r.value =
|
|
2053
|
+
disabled: d.value || !o.value || o.value.disabled || !f.value,
|
|
2054
|
+
onClick: (z) => {
|
|
2055
|
+
r.value = _, i.value = !0;
|
|
2001
2056
|
}
|
|
2002
2057
|
}, {
|
|
2003
2058
|
default: s(() => [
|
|
2004
|
-
|
|
2059
|
+
k(l(n.value.choose) + " (" + l(_) + ")", 1)
|
|
2005
2060
|
]),
|
|
2006
2061
|
_: 2
|
|
2007
2062
|
}, 1032, ["disabled", "onClick"]))), 128))
|
|
2008
|
-
])) :
|
|
2009
|
-
|
|
2010
|
-
key:
|
|
2011
|
-
open:
|
|
2012
|
-
"onUpdate:open":
|
|
2013
|
-
provider:
|
|
2014
|
-
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,
|
|
2015
2070
|
mode: "folder",
|
|
2016
|
-
destination: { key: r.value, selectDestination:
|
|
2017
|
-
onAuthorized:
|
|
2018
|
-
}, null, 8, ["open", "provider", "locale", "destination"])) :
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
(t(!0),
|
|
2022
|
-
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
|
|
2023
2078
|
}, [
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2079
|
+
h("div", null, [
|
|
2080
|
+
h("strong", null, l(_.path), 1),
|
|
2081
|
+
h("p", null, l(n.value.untilRevoked), 1)
|
|
2027
2082
|
]),
|
|
2028
|
-
|
|
2083
|
+
y(e(A), {
|
|
2029
2084
|
variant: "secondary",
|
|
2030
2085
|
disabled: d.value,
|
|
2031
|
-
onClick: (
|
|
2086
|
+
onClick: (z) => H(_.id)
|
|
2032
2087
|
}, {
|
|
2033
2088
|
default: s(() => [
|
|
2034
|
-
|
|
2089
|
+
k(l(n.value.revoke), 1)
|
|
2035
2090
|
]),
|
|
2036
2091
|
_: 1
|
|
2037
2092
|
}, 8, ["disabled", "onClick"])
|
|
2038
2093
|
]))), 128))
|
|
2039
2094
|
]),
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
(t(!0),
|
|
2044
|
-
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,
|
|
2045
2100
|
variant: "secondary",
|
|
2046
|
-
disabled: d.value ||
|
|
2047
|
-
onClick: (
|
|
2101
|
+
disabled: d.value || o.value?.disabled,
|
|
2102
|
+
onClick: (z) => Q(_.key)
|
|
2048
2103
|
}, {
|
|
2049
2104
|
default: s(() => [
|
|
2050
|
-
|
|
2105
|
+
k(l(n.value.example) + " (" + l(_.key) + ")", 1)
|
|
2051
2106
|
]),
|
|
2052
2107
|
_: 2
|
|
2053
2108
|
}, 1032, ["disabled", "onClick"]))), 128))
|
|
2054
2109
|
])
|
|
2055
|
-
], 64)) :
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
(t(!0),
|
|
2060
|
-
key:
|
|
2061
|
-
"data-job-id":
|
|
2062
|
-
"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(_)
|
|
2063
2118
|
}, [
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
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), {
|
|
2069
2124
|
key: 1,
|
|
2070
2125
|
tone: "warning",
|
|
2071
2126
|
class: "save-message"
|
|
2072
2127
|
}, {
|
|
2073
2128
|
default: s(() => [
|
|
2074
|
-
|
|
2129
|
+
k(l(n.value.uncertainHelp), 1)
|
|
2075
2130
|
]),
|
|
2076
2131
|
_: 1
|
|
2077
|
-
})) :
|
|
2132
|
+
})) : T(_) === "interrupted" ? (t(), w(e(W), {
|
|
2078
2133
|
key: 2,
|
|
2079
2134
|
tone: "warning",
|
|
2080
2135
|
class: "save-message"
|
|
2081
2136
|
}, {
|
|
2082
2137
|
default: s(() => [
|
|
2083
|
-
|
|
2138
|
+
k(l(n.value.interruptedHelp), 1)
|
|
2084
2139
|
]),
|
|
2085
2140
|
_: 1
|
|
2086
|
-
})) :
|
|
2087
|
-
|
|
2141
|
+
})) : b("", !0),
|
|
2142
|
+
T(_) === "interrupted" && _.code ? (t(), $("p", ut, l(e(ze)({ code: _.code }, n.value)), 1)) : b("", !0)
|
|
2088
2143
|
]),
|
|
2089
|
-
|
|
2144
|
+
q(_) ? (t(), w(e(A), {
|
|
2090
2145
|
key: 0,
|
|
2091
2146
|
variant: "secondary",
|
|
2092
2147
|
disabled: d.value,
|
|
2093
|
-
onClick: (
|
|
2148
|
+
onClick: (z) => ee(_)
|
|
2094
2149
|
}, {
|
|
2095
2150
|
default: s(() => [
|
|
2096
|
-
|
|
2151
|
+
k(l(n.value.cancel), 1)
|
|
2097
2152
|
]),
|
|
2098
2153
|
_: 1
|
|
2099
|
-
}, 8, ["disabled", "onClick"])) :
|
|
2100
|
-
], 8,
|
|
2154
|
+
}, 8, ["disabled", "onClick"])) : b("", !0)
|
|
2155
|
+
], 8, it))), 128))
|
|
2101
2156
|
])
|
|
2102
2157
|
]),
|
|
2103
2158
|
_: 1
|
|
2104
2159
|
}, 8, ["title", "aria-busy"]));
|
|
2105
2160
|
}
|
|
2106
|
-
}),
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
"
|
|
2110
|
-
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
|
-
"aria-hidden": "true"
|
|
2114
|
-
}, Xl = { class: "authorization-title" }, Gl = { class: "authorization-body" }, Ql = { class: "authorization-actions" }, Wl = {
|
|
2115
|
-
key: 1,
|
|
2116
|
-
class: "authorization-authorized"
|
|
2117
|
-
}, Yl = { class: "authorization-ready" }, Zl = /* @__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({
|
|
2118
2168
|
__name: "AuthorizationGate",
|
|
2119
2169
|
props: {
|
|
2120
2170
|
ctx: {},
|
|
2121
2171
|
name: {}
|
|
2122
2172
|
},
|
|
2123
2173
|
emits: ["ready"],
|
|
2124
|
-
setup(
|
|
2125
|
-
const a =
|
|
2126
|
-
let
|
|
2127
|
-
const
|
|
2128
|
-
|
|
2129
|
-
if (
|
|
2130
|
-
|
|
2131
|
-
|
|
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;
|
|
2132
2199
|
try {
|
|
2133
|
-
const
|
|
2134
|
-
if (
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
!w && q === d && (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);
|
|
2139
2205
|
} finally {
|
|
2140
|
-
!
|
|
2206
|
+
!d && G === p && (n.value = !1, r.value = void 0, V && (V = !1, Q("status")));
|
|
2141
2207
|
}
|
|
2142
2208
|
}
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
}
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
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), {
|
|
2159
2237
|
key: 0,
|
|
2160
|
-
variant: "
|
|
2238
|
+
variant: "primary",
|
|
2239
|
+
loading: n.value,
|
|
2161
2240
|
disabled: n.value,
|
|
2162
|
-
onClick:
|
|
2241
|
+
onClick: G[0] || (G[0] = (Z) => Q("request"))
|
|
2163
2242
|
}, {
|
|
2164
2243
|
default: s(() => [
|
|
2165
|
-
|
|
2244
|
+
k(l(n.value ? f.value("authorizing") : f.value("authorize")), 1)
|
|
2166
2245
|
]),
|
|
2167
2246
|
_: 1
|
|
2168
|
-
}, 8, ["disabled"])) :
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
b(e(aa), {
|
|
2178
|
-
class: "authorization-card",
|
|
2179
|
-
padding: "lg",
|
|
2180
|
-
raised: "",
|
|
2181
|
-
"aria-label": W.value
|
|
2182
|
-
}, {
|
|
2183
|
-
default: s(() => [
|
|
2184
|
-
g("span", Jl, [
|
|
2185
|
-
(t(), h(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)
|
|
2186
2256
|
]),
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
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), {
|
|
2190
2268
|
key: 0,
|
|
2191
2269
|
class: "authorization-status",
|
|
2192
2270
|
tone: ["grant_missing", "upgrade_reapproval"].includes(L.value) ? "info" : "warning",
|
|
2193
|
-
title:
|
|
2271
|
+
title: f.value("reason." + L.value)
|
|
2194
2272
|
}, {
|
|
2195
2273
|
default: s(() => [
|
|
2196
|
-
|
|
2274
|
+
k(l(f.value(X.value)), 1)
|
|
2197
2275
|
]),
|
|
2198
2276
|
_: 1
|
|
2199
|
-
}, 8, ["tone", "title"])) :
|
|
2200
|
-
|
|
2277
|
+
}, 8, ["tone", "title"])) : b("", !0),
|
|
2278
|
+
o.value ? (t(), w(e(W), {
|
|
2201
2279
|
key: 1,
|
|
2202
2280
|
class: "authorization-failed",
|
|
2203
2281
|
tone: "warning"
|
|
2204
2282
|
}, {
|
|
2205
2283
|
default: s(() => [
|
|
2206
|
-
|
|
2284
|
+
k(l(f.value("failed")), 1)
|
|
2207
2285
|
]),
|
|
2208
2286
|
_: 1
|
|
2209
|
-
})) :
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
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)
|
|
2231
2321
|
]),
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
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), {
|
|
2240
2350
|
open: o.value,
|
|
2241
|
-
"onUpdate:open":
|
|
2242
|
-
title: m
|
|
2243
|
-
|
|
2351
|
+
"onUpdate:open": d[4] || (d[4] = (p) => o.value = p),
|
|
2352
|
+
title: e(m)("revoke.title"),
|
|
2353
|
+
width: "480px"
|
|
2244
2354
|
}, {
|
|
2245
2355
|
footer: s(() => [
|
|
2246
|
-
|
|
2356
|
+
y(e(A), {
|
|
2247
2357
|
variant: "secondary",
|
|
2248
|
-
onClick:
|
|
2358
|
+
onClick: d[2] || (d[2] = (p) => o.value = !1)
|
|
2249
2359
|
}, {
|
|
2250
2360
|
default: s(() => [
|
|
2251
|
-
|
|
2361
|
+
k(l(e(m)("cancel")), 1)
|
|
2252
2362
|
]),
|
|
2253
2363
|
_: 1
|
|
2254
2364
|
}),
|
|
2255
|
-
|
|
2365
|
+
y(e(A), {
|
|
2256
2366
|
variant: "danger",
|
|
2257
|
-
disabled:
|
|
2258
|
-
onClick:
|
|
2259
|
-
o.value = !1,
|
|
2367
|
+
disabled: e(i),
|
|
2368
|
+
onClick: d[3] || (d[3] = (p) => {
|
|
2369
|
+
o.value = !1, e(n)();
|
|
2260
2370
|
})
|
|
2261
2371
|
}, {
|
|
2262
2372
|
default: s(() => [
|
|
2263
|
-
|
|
2373
|
+
k(l(e(m)("revoke")), 1)
|
|
2264
2374
|
]),
|
|
2265
2375
|
_: 1
|
|
2266
2376
|
}, 8, ["disabled"])
|
|
2267
2377
|
]),
|
|
2378
|
+
default: s(() => [
|
|
2379
|
+
h("p", bt, l(e(m)("revoke.body")), 1)
|
|
2380
|
+
]),
|
|
2268
2381
|
_: 1
|
|
2269
|
-
}, 8, ["open", "title"
|
|
2382
|
+
}, 8, ["open", "title"])
|
|
2270
2383
|
], 64));
|
|
2271
2384
|
}
|
|
2272
|
-
}),
|
|
2385
|
+
}), At = /* @__PURE__ */ oe(kt, [["__scopeId", "data-v-f031e7c7"]]);
|
|
2273
2386
|
export {
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
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
|
-
|
|
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
|
|
2324
2439
|
};
|