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