@synopackageland/sdk 0.10.12 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/index.js +6 -3
- package/dist/src/delegate/ExecutorConsent.vue.d.ts +2 -0
- package/dist/src/delegate/executor-setup.d.ts +4 -0
- package/dist/src/delegate/use-scope-approval.d.ts +4 -0
- package/dist/src/protocol/v1.d.ts +19 -3
- package/dist/style.css +1 -1
- package/dist/vue.js +1189 -1176
- package/package.json +3 -3
- package/spec/protocol/v1/README.md +27 -0
- package/spec/protocol/v1/errors.json +8 -0
- package/spec/protocol/v1/schema/delegate.create.json +3 -4
- package/spec/protocol/v1/schema/webapi.call.json +41 -0
- package/spec/protocol/v1/vectors/webapi.jsonl +3 -0
package/dist/vue.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { appRefusal as da, appDenial as Be, delegateCopy as Ve, appLifecycle as Ce, lifecycleRetryDelay as ca, uiLocale as va, lifecycleCopy as Ne, shellCopy as sa, isFullPage as $a, format as Je, nasCopy as Te, nasErrorCopy as Sa, saveCopy as fa, saveError as Ye, createNasProvider as
|
|
2
|
-
import { DEFAULT_REQUEST_TIMEOUT as
|
|
3
|
-
import { inject as
|
|
4
|
-
import { SettingsSection as
|
|
1
|
+
import { appRefusal as da, appDenial as Be, delegateCopy as Ve, appLifecycle as Ce, lifecycleRetryDelay as ca, uiLocale as va, lifecycleCopy as Ne, shellCopy as sa, isFullPage as $a, format as Je, nasCopy as Te, nasErrorCopy as Sa, saveCopy as fa, saveError as Ye, createNasProvider as Pa, identityCopy as Xa, backgroundCopy as Wa, createBackgroundPickerProvider as Ga, backgroundErrorCopy as Ja, requestKey as ba, labelSeparator as Ea, lifecycleRefusal as Ya, errorCopy as Qa, scopedPicker as Za, authorizationCopy as ja } from "./index.js";
|
|
2
|
+
import { DEFAULT_REQUEST_TIMEOUT as xo, FILE_STATION_APP as Co, LIFECYCLE_RETRY_MAX_MS as $o, LIFECYCLE_STARTING_RETRY_MAX_MS as So, activePage as Po, authorizationCatalogs as Eo, backgroundCatalogs as To, bridgeCatalogs as zo, bridgeErrorCopy as Ao, catalogs as Ro, clientTimeout as Io, createBackgroundSaveFacade as Do, createDsmSession as Uo, createFileTransfers as Vo, createPortalAccess as No, createStandaloneContext as Bo, createStandaloneHost as Lo, decodeResponse as Oo, delegateCatalogs as Fo, encodeRequest as qo, fileStationPath as Mo, identityCatalogs as Ko, mergeCatalogs as Ho, nasCatalogs as Xo, openFileInFileStation as Wo, openFolderInFileStation as Go, portalCatalogs as Jo, portalMessages as Yo, protocolCodes as Qo, protocolOps as Zo, protocolSchemas as jo, saveCatalogs as es, shellCatalogs as as, shellPages as ts, uiLocales as ls } from "./index.js";
|
|
3
|
+
import { inject as Ee, ref as y, computed as _, onBeforeUnmount as we, Comment as et, Text as at, Fragment as oe, watch as Oe, onMounted as Se, defineComponent as fe, openBlock as l, createElementBlock as $, normalizeClass as De, createElementVNode as S, createVNode as v, unref as e, toDisplayString as s, createCommentVNode as g, renderList as ge, createTextVNode as h, renderSlot as be, createBlock as b, withCtx as n, resolveDynamicComponent as Xe, normalizeProps as Qe, mergeProps as pa, withModifiers as qe, isRef as Ze, provide as Le, useTemplateRef as He, useSlots as Ta, watchEffect as ga, guardReactiveProps as ha, createSlots as za, Teleport as Aa, markRaw as tt, h as lt, onUnmounted as Ra, nextTick as nt } from "vue";
|
|
4
|
+
import { SettingsSection as ke, Callout as j, Button as V, SettingsRow as xe, Skeleton as Fe, Badge as ia, PathDisplay as Ue, Form as Me, FormItem as $e, Select as ma, Input as ze, Dialog as Ge, ensureDeviceViewport as ot, AppRoot as st, ConfigProvider as it, PageContent as ka, PageHeader as wa, AppLayout as ut, AppSidebar as rt, AppSidebarUser as dt, InfoTip as ct, FileTypeIcon as la, IconButton as na, Breadcrumb as vt, FilePicker as ft, TreeView as pt, DataGrid as mt, Link as ua, FormActions as aa, Card as _a, Checkbox as yt, LoadingArea as bt } from "@synopackageland/ui";
|
|
5
5
|
import { Timer as gt, Info as ht, ShieldCheck as Ia, ChevronRight as Da, ChevronLeft as kt, RotateCw as wt } from "@lucide/vue";
|
|
6
6
|
const We = /* @__PURE__ */ Symbol("executor-setup"), Ua = /* @__PURE__ */ Symbol("executor-preload");
|
|
7
7
|
function _t() {
|
|
8
|
-
return
|
|
8
|
+
return Ee(Ua, y(!1));
|
|
9
9
|
}
|
|
10
10
|
function Va() {
|
|
11
|
-
return
|
|
11
|
+
return Ee(We, {
|
|
12
12
|
async status() {
|
|
13
13
|
return { state: "blocked", reason: "setup-unavailable" };
|
|
14
14
|
},
|
|
@@ -24,135 +24,135 @@ const xt = ["password_rejected", "password_required", "password_confirm_failed"]
|
|
|
24
24
|
function je(t) {
|
|
25
25
|
if (t.state !== "blocked") return;
|
|
26
26
|
if (t.code) return xt.includes(t.code) ? t.code : void 0;
|
|
27
|
-
const
|
|
28
|
-
if (/^dsm_3121\b/.test(
|
|
29
|
-
if (/^\S+: administrator password confirmation failed\./.test(
|
|
27
|
+
const p = t.reason ?? "";
|
|
28
|
+
if (/^dsm_3121\b/.test(p)) return "password_rejected";
|
|
29
|
+
if (/^\S+: administrator password confirmation failed\./.test(p)) return "password_confirm_failed";
|
|
30
30
|
}
|
|
31
31
|
function Ct(t) {
|
|
32
32
|
return /: the executor status request failed\.$/.test(t ?? "");
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
let c = !1,
|
|
37
|
-
function
|
|
38
|
-
clearTimeout(d), clearTimeout(
|
|
34
|
+
function io(t) {
|
|
35
|
+
const p = y(), o = _(() => p.value ? { code: p.value, ...da({ code: p.value }, t.locale, t.displayName) } : void 0), a = y(!1), i = y(!1), u = y(), r = y("");
|
|
36
|
+
let c = !1, m = 0, d, f;
|
|
37
|
+
function x() {
|
|
38
|
+
clearTimeout(d), clearTimeout(f);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
40
|
+
function P(B = "") {
|
|
41
|
+
m++, x(), u.value = void 0, r.value = B;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
return c || !
|
|
43
|
+
function w(B) {
|
|
44
|
+
const K = Be(B);
|
|
45
|
+
return c || !K ? !1 : (P(), p.value = K, !0);
|
|
46
46
|
}
|
|
47
|
-
async function
|
|
48
|
-
const
|
|
47
|
+
async function C(B, K) {
|
|
48
|
+
const L = m;
|
|
49
49
|
try {
|
|
50
|
-
return await t.call(
|
|
51
|
-
} catch (
|
|
52
|
-
throw
|
|
50
|
+
return await t.call(B, K);
|
|
51
|
+
} catch (R) {
|
|
52
|
+
throw L === m && w(R), R;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function E(B) {
|
|
56
56
|
if (c) return;
|
|
57
|
-
const
|
|
58
|
-
if (!Number.isFinite(
|
|
59
|
-
|
|
57
|
+
const K = Date.parse(B.expiresAt) - Date.now();
|
|
58
|
+
if (!Number.isFinite(K) || K <= 0) {
|
|
59
|
+
P("expired");
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
62
|
+
x(), p.value = void 0, u.value = B, r.value = "", d = setTimeout(() => P("expired"), K);
|
|
63
|
+
const L = m;
|
|
64
|
+
f = setTimeout(async () => {
|
|
65
65
|
try {
|
|
66
|
-
const
|
|
67
|
-
!c &&
|
|
68
|
-
} catch (
|
|
69
|
-
!c &&
|
|
66
|
+
const R = await C("identity.session");
|
|
67
|
+
!c && m === L && E(R);
|
|
68
|
+
} catch (R) {
|
|
69
|
+
!c && m === L && !w(R) && P("expired");
|
|
70
70
|
}
|
|
71
|
-
}, Math.min(6e4,
|
|
71
|
+
}, Math.min(6e4, K));
|
|
72
72
|
}
|
|
73
73
|
async function k() {
|
|
74
74
|
try {
|
|
75
|
-
const
|
|
75
|
+
const B = await C("identity.status");
|
|
76
76
|
if (c) return;
|
|
77
|
-
if (
|
|
77
|
+
if (p.value = void 0, a.value = B.enabled === !0, a.value)
|
|
78
78
|
try {
|
|
79
|
-
|
|
80
|
-
} catch (
|
|
81
|
-
!c && !Be(
|
|
79
|
+
E(await C("identity.session", { bootstrap: !0 }));
|
|
80
|
+
} catch (K) {
|
|
81
|
+
!c && !Be(K) && P();
|
|
82
82
|
}
|
|
83
|
-
} catch (
|
|
83
|
+
} catch (B) {
|
|
84
84
|
if (c) return;
|
|
85
|
-
const
|
|
86
|
-
a.value = !Be(
|
|
85
|
+
const K = B?.code;
|
|
86
|
+
a.value = !Be(B) && !["unknown_method", "session_required"].includes(K || ""), a.value && (r.value = "unavailable");
|
|
87
87
|
} finally {
|
|
88
88
|
c || (i.value = !0);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
async function T(
|
|
92
|
-
const
|
|
91
|
+
async function T(B, K) {
|
|
92
|
+
const L = m;
|
|
93
93
|
try {
|
|
94
|
-
const
|
|
95
|
-
if (c || a.value &&
|
|
96
|
-
return
|
|
97
|
-
} catch (
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
throw !c &&
|
|
94
|
+
const R = await t.call(B, K);
|
|
95
|
+
if (c || a.value && L !== m) throw { code: "session_required" };
|
|
96
|
+
return R;
|
|
97
|
+
} catch (R) {
|
|
98
|
+
L === m && w(R);
|
|
99
|
+
const A = R?.code;
|
|
100
|
+
throw !c && L === m && a.value && ["session_required", "session_revalidation_required"].includes(A || "") && P(A === "session_revalidation_required" ? "revalidate" : "expired"), R;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
async function B
|
|
104
|
-
const
|
|
105
|
-
c || (
|
|
103
|
+
async function N(B, K, L) {
|
|
104
|
+
const R = await C("identity.login", { account: B, password: K, otp: L });
|
|
105
|
+
c || (m++, E(R));
|
|
106
106
|
}
|
|
107
107
|
async function te() {
|
|
108
|
-
const
|
|
109
|
-
c || (
|
|
108
|
+
const B = await C("identity.session", { bootstrap: !0 });
|
|
109
|
+
c || (m++, E(B));
|
|
110
110
|
}
|
|
111
|
-
async function
|
|
112
|
-
await
|
|
111
|
+
async function F() {
|
|
112
|
+
await C("identity.logout"), c || P();
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
c = !0,
|
|
114
|
+
function Y() {
|
|
115
|
+
c = !0, P();
|
|
116
116
|
}
|
|
117
|
-
return { enabled: a, ready: i, subject: u, notice: r, denied: o, start: k, call: T, login:
|
|
117
|
+
return { enabled: a, ready: i, subject: u, notice: r, denied: o, start: k, call: T, login: N, bootstrap: te, logout: F, dispose: Y };
|
|
118
118
|
}
|
|
119
119
|
function $t() {
|
|
120
|
-
const t =
|
|
120
|
+
const t = y(!1), p = y();
|
|
121
121
|
let o = !1, a = 0, i;
|
|
122
122
|
function u() {
|
|
123
|
-
a++, i?.abort(), i = void 0, t.value = !1,
|
|
123
|
+
a++, i?.abort(), i = void 0, t.value = !1, p.value = void 0;
|
|
124
124
|
}
|
|
125
125
|
async function r(c) {
|
|
126
126
|
if (o || t.value) return;
|
|
127
|
-
const
|
|
128
|
-
i = d, t.value = !0,
|
|
127
|
+
const m = ++a, d = new AbortController();
|
|
128
|
+
i = d, t.value = !0, p.value = void 0;
|
|
129
129
|
try {
|
|
130
|
-
const
|
|
131
|
-
return !o &&
|
|
132
|
-
} catch (
|
|
133
|
-
!o &&
|
|
130
|
+
const f = await c(d.signal);
|
|
131
|
+
return !o && m === a ? f : void 0;
|
|
132
|
+
} catch (f) {
|
|
133
|
+
!o && m === a && (p.value = f);
|
|
134
134
|
return;
|
|
135
135
|
} finally {
|
|
136
|
-
!o &&
|
|
136
|
+
!o && m === a && (t.value = !1, i = void 0);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
return
|
|
139
|
+
return we(() => {
|
|
140
140
|
o = !0, u();
|
|
141
|
-
}), { busy: t, error:
|
|
141
|
+
}), { busy: t, error: p, run: r, cancel: u };
|
|
142
142
|
}
|
|
143
143
|
const xa = ".sds-standalone-main-window";
|
|
144
144
|
function St(t) {
|
|
145
|
-
const
|
|
145
|
+
const p = { brand: !1, user: !1 };
|
|
146
146
|
try {
|
|
147
147
|
const o = t.closest(xa);
|
|
148
|
-
if (!t.isConnected || !o || o.classList.contains("sds-standalone-main-window--no-banner")) return
|
|
148
|
+
if (!t.isConnected || !o || o.classList.contains("sds-standalone-main-window--no-banner")) return p;
|
|
149
149
|
const a = (i) => Array.from(o.querySelectorAll(i)).some((u) => {
|
|
150
150
|
if (t.contains(u) || u.closest(xa) !== o || !u.textContent?.trim()) return !1;
|
|
151
151
|
const r = u.ownerDocument.defaultView;
|
|
152
152
|
if (!r) return !1;
|
|
153
|
-
for (let
|
|
154
|
-
const d = r.getComputedStyle(
|
|
155
|
-
if (
|
|
153
|
+
for (let m = u; m; m = m.parentElement) {
|
|
154
|
+
const d = r.getComputedStyle(m);
|
|
155
|
+
if (m.hidden || d.display === "none" || d.visibility === "hidden" || d.visibility === "collapse" || d.opacity === "0") return !1;
|
|
156
156
|
}
|
|
157
157
|
const c = u.getBoundingClientRect();
|
|
158
158
|
return c.width > 0 && c.height > 0;
|
|
@@ -162,130 +162,130 @@ function St(t) {
|
|
|
162
162
|
user: a(".sds-standalone-main-window-header .sds-standalone-main-window-header__toolbar__btn")
|
|
163
163
|
};
|
|
164
164
|
} catch {
|
|
165
|
-
return
|
|
165
|
+
return p;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
function Na(t) {
|
|
169
|
-
return Array.isArray(t) && t.some((
|
|
170
|
-
const o =
|
|
171
|
-
return o.type === et ? !1 : o.type === at ? String(o.children).trim() !== "" : o.type ===
|
|
169
|
+
return Array.isArray(t) && t.some((p) => {
|
|
170
|
+
const o = p;
|
|
171
|
+
return o.type === et ? !1 : o.type === at ? String(o.children).trim() !== "" : o.type === oe ? Na(o.children) : !0;
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
return Array.from(t.childNodes).some((
|
|
174
|
+
function Pt(t) {
|
|
175
|
+
return Array.from(t.childNodes).some((p) => p.nodeType === Node.ELEMENT_NODE || p.nodeType === Node.TEXT_NODE && p.textContent.trim() !== "");
|
|
176
176
|
}
|
|
177
|
-
const
|
|
178
|
-
function Tt(t,
|
|
179
|
-
return t.map((o) => typeof o == "string" ? { id: o, title:
|
|
177
|
+
const Et = { status: ht, background: gt };
|
|
178
|
+
function Tt(t, p) {
|
|
179
|
+
return t.map((o) => typeof o == "string" ? { id: o, title: p[o], icon: Et[o] } : o);
|
|
180
180
|
}
|
|
181
181
|
function zt(t) {
|
|
182
|
-
const
|
|
182
|
+
const p = /* @__PURE__ */ new Map(), o = { items: [] };
|
|
183
183
|
for (const a of t) {
|
|
184
184
|
if (a.hidden) continue;
|
|
185
|
-
let i = a.placement === "bottom" ? o :
|
|
186
|
-
i ||
|
|
185
|
+
let i = a.placement === "bottom" ? o : p.get(a.group);
|
|
186
|
+
i || p.set(a.group, i = a.group === void 0 ? { items: [] } : { label: a.group, items: [] }), i.items.push({ key: a.id, label: a.title, icon: a.icon, badge: a.badge });
|
|
187
187
|
}
|
|
188
|
-
return o.items.length ? [...
|
|
188
|
+
return o.items.length ? [...p.values(), o] : [...p.values()];
|
|
189
189
|
}
|
|
190
190
|
const At = { password_rejected: "passwordRejected", password_required: "passwordRequired", password_confirm_failed: "passwordConfirmFailed" }, Rt = 6e4, It = 1e3;
|
|
191
|
-
function Ba(t,
|
|
192
|
-
const o = Va(), a =
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
function Ba(t, p) {
|
|
192
|
+
const o = Va(), a = _(() => Ve(t.locale)), i = y(), u = y(""), r = y(!1), c = y(!1), m = y(!1), d = y(), f = y(!1), x = _(() => f.value ? a.value.passwordRequired : d.value && "confirm" in d.value ? a.value[At[d.value.confirm]] : "");
|
|
193
|
+
Oe(u, () => {
|
|
194
|
+
f.value = !1;
|
|
195
195
|
});
|
|
196
|
-
const
|
|
197
|
-
let
|
|
198
|
-
async function
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
196
|
+
const P = y(), w = y(""), C = y([]), E = _(() => P.value?.scope_mode === "install-selected"), k = _(() => !!P.value?.scope_mode), T = _(() => [{ label: a.value.homeScope, value: "home" }, ...C.value]), N = _(() => !E.value || !!w.value && T.value.some((M) => M.value === w.value)), te = _(() => E.value && !P.value?.selection);
|
|
197
|
+
let F = !1;
|
|
198
|
+
async function Y(M) {
|
|
199
|
+
const se = M ?? await o.status();
|
|
200
|
+
if (F || (i.value = se, !t.ctx || Ce(se))) return;
|
|
201
201
|
const H = await t.ctx.call("delegate.status");
|
|
202
|
-
if (
|
|
203
|
-
const
|
|
204
|
-
let
|
|
202
|
+
if (F || (P.value = H, H.scope_mode !== "install-selected")) return;
|
|
203
|
+
const G = [];
|
|
204
|
+
let le = 0;
|
|
205
205
|
for (let re = 0; re < 128; re++) {
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
208
|
-
if (!Array.isArray(
|
|
209
|
-
for (const X of
|
|
210
|
-
X.isdir && X.path === "/" + X.name && !["home", "homes"].includes(X.name.toLowerCase()) &&
|
|
211
|
-
if (
|
|
206
|
+
const ee = await t.ctx.call("bg.browse", { offset: le });
|
|
207
|
+
if (F) return;
|
|
208
|
+
if (!Array.isArray(ee.shares) || !Number.isSafeInteger(ee.total) || ee.total < 0 || !ee.shares.length && le < ee.total) throw { code: "EXECUTOR_PROTOCOL" };
|
|
209
|
+
for (const X of ee.shares)
|
|
210
|
+
X.isdir && X.path === "/" + X.name && !["home", "homes"].includes(X.name.toLowerCase()) && G.push({ label: X.name, value: "shared:" + X.name });
|
|
211
|
+
if (le += ee.shares.length, le >= ee.total) break;
|
|
212
212
|
if (re === 127) throw { code: "EXECUTOR_PROTOCOL" };
|
|
213
213
|
}
|
|
214
|
-
|
|
214
|
+
C.value = G, w.value = H.selection?.scope ?? H.preselection ?? "";
|
|
215
215
|
}
|
|
216
|
-
async function
|
|
216
|
+
async function B(M) {
|
|
217
217
|
if (!(!t.admin || r.value)) {
|
|
218
|
-
r.value = !0,
|
|
218
|
+
r.value = !0, m.value = !1, d.value = void 0;
|
|
219
219
|
try {
|
|
220
|
-
await
|
|
220
|
+
await Y(M);
|
|
221
221
|
} catch {
|
|
222
|
-
|
|
222
|
+
F || (m.value = !0);
|
|
223
223
|
} finally {
|
|
224
|
-
|
|
224
|
+
F || (r.value = !1);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
-
const
|
|
229
|
-
async function
|
|
230
|
-
if (!t.admin || r.value || !u.value || !
|
|
231
|
-
r.value = !0,
|
|
232
|
-
const M = u.value,
|
|
228
|
+
const K = () => B();
|
|
229
|
+
async function L() {
|
|
230
|
+
if (!t.admin || r.value || !u.value || !N.value || m.value) return;
|
|
231
|
+
r.value = !0, m.value = !1, d.value = void 0;
|
|
232
|
+
const M = u.value, se = w.value;
|
|
233
233
|
u.value = "", c.value = !0;
|
|
234
234
|
try {
|
|
235
|
-
let H =
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
-
|
|
235
|
+
let H = E.value ? await o.authorize(M, w.value) : await o.authorize(M);
|
|
236
|
+
const G = je(H);
|
|
237
|
+
if (G) {
|
|
238
|
+
F || (d.value = { confirm: G }, u.value = M);
|
|
239
239
|
return;
|
|
240
240
|
}
|
|
241
|
-
if (await
|
|
242
|
-
|
|
241
|
+
if (await Y(H), !F && E.value && H.state === "ready" && te.value && (H = await o.authorize(M, w.value), await Y(H)), H.state !== "ready" && H.requested && await A(H.requested) && (H = await o.status(), await Y(H)), H.state === "ready" && E.value && P.value?.selection?.scope !== se) {
|
|
242
|
+
F || (d.value = { reason: "", code: "selection_failed" });
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
245
245
|
if (H.state !== "ready") {
|
|
246
|
-
|
|
246
|
+
F || (d.value = { reason: H.reason ?? "", code: H.code });
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
249
|
-
|
|
249
|
+
F || await p();
|
|
250
250
|
} catch {
|
|
251
|
-
|
|
251
|
+
F || (m.value = !0);
|
|
252
252
|
} finally {
|
|
253
|
-
|
|
253
|
+
F || (r.value = !1, c.value = !1);
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
return !u.value && !r.value ? (
|
|
256
|
+
function R() {
|
|
257
|
+
return !u.value && !r.value ? (f.value = !0, Promise.resolve()) : L();
|
|
258
258
|
}
|
|
259
|
-
async function
|
|
260
|
-
for (const
|
|
259
|
+
async function A(M) {
|
|
260
|
+
for (const se = Date.now() + Rt; !F; await new Promise((H) => setTimeout(H, It))) {
|
|
261
261
|
const H = (await t.ctx?.call("delegate.status").catch(() => {
|
|
262
262
|
}))?.selection;
|
|
263
263
|
if (H?.scope === M.scope && H.generation > M.generation) return !0;
|
|
264
|
-
if (Date.now() >=
|
|
264
|
+
if (Date.now() >= se) return !1;
|
|
265
265
|
}
|
|
266
266
|
return !1;
|
|
267
267
|
}
|
|
268
|
-
const
|
|
268
|
+
const q = (M) => M?.code === "executor_starting" ? a.value.statusStarting : Ct(M?.reason) ? a.value.statusUnreachable : void 0;
|
|
269
269
|
return Se(() => {
|
|
270
270
|
o.subscribe?.((M) => {
|
|
271
|
-
!
|
|
272
|
-
}),
|
|
273
|
-
}),
|
|
274
|
-
|
|
275
|
-
}), { status: i, password: u, busy: r, confirming: c, error:
|
|
271
|
+
!F && !je(M) && (i.value = M);
|
|
272
|
+
}), B(t.initial);
|
|
273
|
+
}), we(() => {
|
|
274
|
+
F = !0, u.value = "";
|
|
275
|
+
}), { status: i, password: u, busy: r, confirming: c, error: m, failure: d, passwordError: x, scope: P, chosen: w, options: T, dynamic: E, files: k, webapiProfiles: o.webapiProfiles, canConfirm: N, needsScope: te, refresh: K, authorize: L, submit: R, explain: q };
|
|
276
276
|
}
|
|
277
|
-
function Ke(t,
|
|
277
|
+
function Ke(t, p) {
|
|
278
278
|
let o = !1, a, i = 0;
|
|
279
279
|
function u() {
|
|
280
280
|
clearTimeout(a), a = setTimeout(() => {
|
|
281
|
-
|
|
281
|
+
p().then(() => {
|
|
282
282
|
!o && t() && u();
|
|
283
283
|
});
|
|
284
284
|
}, ca(i++, t()));
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
Oe(t, (r) => {
|
|
287
287
|
clearTimeout(a), i = 0, r && !o && u();
|
|
288
|
-
}),
|
|
288
|
+
}), we(() => {
|
|
289
289
|
o = !0, clearTimeout(a);
|
|
290
290
|
});
|
|
291
291
|
}
|
|
@@ -298,44 +298,61 @@ const Dt = ["data-audience"], Ut = {
|
|
|
298
298
|
}, Lt = {
|
|
299
299
|
class: "executor-consent-lead",
|
|
300
300
|
"data-consent-lead": ""
|
|
301
|
-
},
|
|
301
|
+
}, Ot = {
|
|
302
302
|
key: 0,
|
|
303
303
|
class: "executor-consent-lead executor-consent-ask",
|
|
304
304
|
"data-consent-ask": ""
|
|
305
|
-
},
|
|
305
|
+
}, Ft = {
|
|
306
306
|
key: 0,
|
|
307
|
+
"data-webapi-profiles": ""
|
|
308
|
+
}, qt = {
|
|
309
|
+
key: 1,
|
|
307
310
|
class: "executor-consent-more",
|
|
308
311
|
"data-consent-points": ""
|
|
309
|
-
},
|
|
312
|
+
}, Mt = /* @__PURE__ */ fe({
|
|
310
313
|
__name: "ExecutorConsent",
|
|
311
314
|
props: {
|
|
312
315
|
admin: { type: Boolean },
|
|
313
316
|
locale: {},
|
|
314
317
|
files: { type: Boolean },
|
|
315
318
|
purpose: {},
|
|
316
|
-
layout: {}
|
|
319
|
+
layout: {},
|
|
320
|
+
webapiProfiles: {}
|
|
317
321
|
},
|
|
318
322
|
setup(t) {
|
|
319
|
-
const
|
|
323
|
+
const p = t, o = _(() => Ve(p.locale)), a = _(() => ["zh-TW", "zh-CN", "ja"].includes(va(p.locale ?? "en")) ? "" : " "), i = _(() => [o.value.consentWhy, p.purpose || (p.files ? o.value.consentPurposeFiles : o.value.consentPurpose)].join(a.value)), u = _(() => [o.value.pointPassword, o.value.pointLimited, o.value.pointUpdate, o.value.pointRevoke]);
|
|
320
324
|
return (r, c) => (l(), $("div", {
|
|
321
325
|
class: De(["executor-consent", `executor-consent-${t.layout ?? "inline"}`]),
|
|
322
326
|
"data-executor-consent": "",
|
|
323
327
|
"data-audience": t.admin ? "admin" : "user"
|
|
324
328
|
}, [
|
|
325
|
-
|
|
329
|
+
S("span", Ut, [
|
|
326
330
|
v(e(Ia), {
|
|
327
331
|
size: t.layout === "page" ? 24 : 18
|
|
328
332
|
}, null, 8, ["size"])
|
|
329
333
|
]),
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
t.admin ? g("", !0) : (l(), $("p",
|
|
334
|
+
S("div", Vt, [
|
|
335
|
+
S("div", Nt, [
|
|
336
|
+
S("p", Bt, s(t.admin ? o.value.consentTitle : o.value.consentTitleUser), 1),
|
|
337
|
+
S("p", Lt, s(i.value), 1),
|
|
338
|
+
t.admin ? g("", !0) : (l(), $("p", Ot, s(o.value.consentAsk), 1))
|
|
335
339
|
]),
|
|
340
|
+
t.webapiProfiles && Object.keys(t.webapiProfiles).length ? (l(), $("ul", Ft, [
|
|
341
|
+
(l(!0), $(oe, null, ge(t.webapiProfiles, (m, d) => (l(), $("li", { key: d }, [
|
|
342
|
+
S("strong", null, s(d), 1),
|
|
343
|
+
h(": " + s(m.purpose) + " ", 1),
|
|
344
|
+
S("details", null, [
|
|
345
|
+
S("summary", null, s(o.value.details), 1),
|
|
346
|
+
(l(!0), $(oe, null, ge(m.apis, (f, x) => (l(), $("div", { key: x }, [
|
|
347
|
+
S("code", null, s(x), 1),
|
|
348
|
+
(l(!0), $(oe, null, ge(f, (P, w) => (l(), $("div", { key: w }, s(w) + " (" + s(P.join(", ")) + ")", 1))), 128))
|
|
349
|
+
]))), 128))
|
|
350
|
+
])
|
|
351
|
+
]))), 128))
|
|
352
|
+
])) : g("", !0),
|
|
336
353
|
be(r.$slots, "default", {}, void 0, !0),
|
|
337
|
-
t.admin ? (l(), $("details",
|
|
338
|
-
|
|
354
|
+
t.admin ? (l(), $("details", qt, [
|
|
355
|
+
S("summary", null, [
|
|
339
356
|
v(e(Da), {
|
|
340
357
|
class: "executor-consent-chevron",
|
|
341
358
|
size: 14,
|
|
@@ -343,28 +360,28 @@ const Dt = ["data-audience"], Ut = {
|
|
|
343
360
|
}),
|
|
344
361
|
h(s(o.value.consentDetails), 1)
|
|
345
362
|
]),
|
|
346
|
-
|
|
347
|
-
(l(!0), $(
|
|
363
|
+
S("ul", null, [
|
|
364
|
+
(l(!0), $(oe, null, ge(u.value, (m) => (l(), $("li", { key: m }, s(m), 1))), 128))
|
|
348
365
|
])
|
|
349
366
|
])) : g("", !0)
|
|
350
367
|
])
|
|
351
368
|
], 10, Dt));
|
|
352
369
|
}
|
|
353
|
-
}), me = (t,
|
|
370
|
+
}), me = (t, p) => {
|
|
354
371
|
const o = t.__vccOpts || t;
|
|
355
|
-
for (const [a, i] of
|
|
372
|
+
for (const [a, i] of p)
|
|
356
373
|
o[a] = i;
|
|
357
374
|
return o;
|
|
358
|
-
}, ea = /* @__PURE__ */ me(
|
|
375
|
+
}, ea = /* @__PURE__ */ me(Mt, [["__scopeId", "data-v-896bcab3"]]), Kt = { class: "executor-alert" }, Ht = {
|
|
359
376
|
key: 0,
|
|
360
377
|
class: "executor-reason"
|
|
361
|
-
},
|
|
378
|
+
}, Xt = {
|
|
362
379
|
key: 0,
|
|
363
380
|
class: "executor-summary"
|
|
364
|
-
},
|
|
381
|
+
}, Wt = {
|
|
365
382
|
key: 1,
|
|
366
383
|
class: "executor-summary"
|
|
367
|
-
},
|
|
384
|
+
}, Gt = ["data-executor-status"], Jt = { class: "executor-reason" }, Yt = /* @__PURE__ */ fe({
|
|
368
385
|
__name: "ExecutorSettings",
|
|
369
386
|
props: {
|
|
370
387
|
admin: { type: Boolean },
|
|
@@ -376,31 +393,31 @@ const Dt = ["data-audience"], Ut = {
|
|
|
376
393
|
layout: {}
|
|
377
394
|
},
|
|
378
395
|
emits: ["confirmed"],
|
|
379
|
-
setup(t, { expose:
|
|
380
|
-
const a = t, i = o, u =
|
|
381
|
-
Ke(() =>
|
|
382
|
-
const
|
|
383
|
-
return
|
|
396
|
+
setup(t, { expose: p, emit: o }) {
|
|
397
|
+
const a = t, i = o, u = _(() => Ve(a.locale)), { status: r, password: c, busy: m, confirming: d, error: f, failure: x, passwordError: P, scope: w, chosen: C, options: E, dynamic: k, files: T, webapiProfiles: N, canConfirm: te, needsScope: F, refresh: Y, submit: B, explain: K } = Ba(a, () => i("confirmed")), L = _(() => d.value ? "confirming" : r.value ? r.value.state === "ready" ? "ready" : "blocked" : void 0), R = _(() => ({ ready: { tone: "success", text: u.value.statusReady }, blocked: { tone: "danger", text: u.value.statusBlocked }, confirming: { tone: "info", text: u.value.statusConfirming } })[L.value ?? "confirming"]), A = _(() => d.value ? void 0 : Ce(r.value));
|
|
398
|
+
Ke(() => A.value, Y);
|
|
399
|
+
const q = _(() => !A.value && (r.value?.state === "needs-admin-approval" || F.value)), M = _(() => q.value || !!r.value?.retry);
|
|
400
|
+
return p({ refresh: Y }), (se, H) => t.admin ? (l(), b(e(ke), {
|
|
384
401
|
key: 0,
|
|
385
402
|
title: t.title ?? u.value.setupTitle,
|
|
386
|
-
description:
|
|
403
|
+
description: q.value ? void 0 : e(T) ? u.value.setupHelpFiles : u.value.setupHelp,
|
|
387
404
|
collapsible: !1,
|
|
388
|
-
"aria-busy": e(
|
|
405
|
+
"aria-busy": e(m) || !e(r) && !e(d) && !e(f)
|
|
389
406
|
}, {
|
|
390
407
|
default: n(() => [
|
|
391
|
-
e(
|
|
408
|
+
e(f) ? (l(), b(e(j), {
|
|
392
409
|
key: 0,
|
|
393
410
|
tone: "danger",
|
|
394
411
|
role: "alert"
|
|
395
412
|
}, {
|
|
396
413
|
default: n(() => [
|
|
397
|
-
|
|
398
|
-
|
|
414
|
+
S("span", Kt, [
|
|
415
|
+
S("span", null, s(u.value.setupError), 1),
|
|
399
416
|
v(e(V), {
|
|
400
417
|
variant: "secondary",
|
|
401
418
|
size: "sm",
|
|
402
|
-
disabled: e(
|
|
403
|
-
onClick: e(
|
|
419
|
+
disabled: e(m),
|
|
420
|
+
onClick: e(Y)
|
|
404
421
|
}, {
|
|
405
422
|
default: n(() => [
|
|
406
423
|
h(s(u.value.retry), 1)
|
|
@@ -410,34 +427,34 @@ const Dt = ["data-audience"], Ut = {
|
|
|
410
427
|
])
|
|
411
428
|
]),
|
|
412
429
|
_: 1
|
|
413
|
-
})) : e(
|
|
430
|
+
})) : e(x) && !("confirm" in e(x)) ? (l(), b(e(j), {
|
|
414
431
|
key: 1,
|
|
415
432
|
tone: "danger",
|
|
416
433
|
role: "alert"
|
|
417
434
|
}, {
|
|
418
435
|
default: n(() => [
|
|
419
|
-
h(s(e(
|
|
420
|
-
e(
|
|
436
|
+
h(s(e(x).code === "session_ended" ? u.value.session : e(K)(e(x)) ?? u.value.setupError), 1),
|
|
437
|
+
e(x).reason ? (l(), $("span", Ht, s(e(x).reason), 1)) : g("", !0)
|
|
421
438
|
]),
|
|
422
439
|
_: 1
|
|
423
440
|
})) : g("", !0),
|
|
424
|
-
|
|
441
|
+
A.value ? (l(), b(e(j), {
|
|
425
442
|
key: 2,
|
|
426
443
|
tone: "info",
|
|
427
444
|
role: "status"
|
|
428
445
|
}, {
|
|
429
446
|
default: n(() => [
|
|
430
|
-
h(s(e(Ne)(
|
|
447
|
+
h(s(e(Ne)(A.value, t.locale)), 1)
|
|
431
448
|
]),
|
|
432
449
|
_: 1
|
|
433
|
-
})) : (l(), $(
|
|
434
|
-
!e(r) && !e(d) && !e(
|
|
435
|
-
v(e(
|
|
450
|
+
})) : (l(), $(oe, { key: 3 }, [
|
|
451
|
+
!e(r) && !e(d) && !e(f) ? (l(), $("div", Xt, [
|
|
452
|
+
v(e(xe), {
|
|
436
453
|
label: u.value.status,
|
|
437
454
|
"data-placeholder-row": ""
|
|
438
455
|
}, {
|
|
439
456
|
default: n(() => [
|
|
440
|
-
v(e(
|
|
457
|
+
v(e(Fe), {
|
|
441
458
|
width: "5rem",
|
|
442
459
|
height: "20px"
|
|
443
460
|
})
|
|
@@ -445,54 +462,54 @@ const Dt = ["data-audience"], Ut = {
|
|
|
445
462
|
_: 1
|
|
446
463
|
}, 8, ["label"])
|
|
447
464
|
])) : g("", !0),
|
|
448
|
-
(e(r) || e(d)) && !
|
|
449
|
-
v(e(
|
|
465
|
+
(e(r) || e(d)) && !q.value ? (l(), $("div", Wt, [
|
|
466
|
+
v(e(xe), {
|
|
450
467
|
label: u.value.status
|
|
451
468
|
}, {
|
|
452
469
|
default: n(() => [
|
|
453
|
-
|
|
470
|
+
S("span", {
|
|
454
471
|
role: "status",
|
|
455
|
-
"data-executor-status":
|
|
472
|
+
"data-executor-status": L.value
|
|
456
473
|
}, [
|
|
457
474
|
v(e(ia), {
|
|
458
|
-
tone:
|
|
475
|
+
tone: R.value.tone
|
|
459
476
|
}, {
|
|
460
477
|
default: n(() => [
|
|
461
|
-
h(s(
|
|
478
|
+
h(s(R.value.text), 1)
|
|
462
479
|
]),
|
|
463
480
|
_: 1
|
|
464
481
|
}, 8, ["tone"])
|
|
465
|
-
], 8,
|
|
482
|
+
], 8, Gt)
|
|
466
483
|
]),
|
|
467
484
|
_: 1
|
|
468
485
|
}, 8, ["label"]),
|
|
469
|
-
e(r)?.reason && (e(r).state === "blocked" || e(r).state === "unsupported") ? (l(), b(e(
|
|
486
|
+
e(r)?.reason && (e(r).state === "blocked" || e(r).state === "unsupported") ? (l(), b(e(xe), {
|
|
470
487
|
key: 0,
|
|
471
488
|
label: u.value.details
|
|
472
489
|
}, {
|
|
473
490
|
default: n(() => [
|
|
474
|
-
e(
|
|
475
|
-
h(s(e(
|
|
476
|
-
|
|
477
|
-
], 64)) : (l(), $(
|
|
491
|
+
e(K)(e(r)) ? (l(), $(oe, { key: 0 }, [
|
|
492
|
+
h(s(e(K)(e(r))), 1),
|
|
493
|
+
S("span", Jt, s(e(r).reason), 1)
|
|
494
|
+
], 64)) : (l(), $(oe, { key: 1 }, [
|
|
478
495
|
h(s(e(r).reason), 1)
|
|
479
496
|
], 64))
|
|
480
497
|
]),
|
|
481
498
|
_: 1
|
|
482
499
|
}, 8, ["label"])) : g("", !0),
|
|
483
|
-
e(
|
|
500
|
+
e(w)?.selection ? (l(), b(e(xe), {
|
|
484
501
|
key: 1,
|
|
485
502
|
label: u.value.protectedScope
|
|
486
503
|
}, {
|
|
487
504
|
default: n(() => [
|
|
488
505
|
v(e(Ue), {
|
|
489
|
-
path: e(
|
|
506
|
+
path: e(w).selection.root
|
|
490
507
|
}, null, 8, ["path"])
|
|
491
508
|
]),
|
|
492
509
|
_: 1
|
|
493
510
|
}, 8, ["label"])) : g("", !0)
|
|
494
511
|
])) : g("", !0),
|
|
495
|
-
|
|
512
|
+
L.value === "blocked" && !q.value ? (l(), b(e(j), {
|
|
496
513
|
key: 2,
|
|
497
514
|
tone: "warning"
|
|
498
515
|
}, {
|
|
@@ -501,7 +518,7 @@ const Dt = ["data-audience"], Ut = {
|
|
|
501
518
|
]),
|
|
502
519
|
_: 1
|
|
503
520
|
})) : g("", !0),
|
|
504
|
-
e(
|
|
521
|
+
e(w)?.mismatch ? (l(), b(e(j), {
|
|
505
522
|
key: 3,
|
|
506
523
|
tone: "warning"
|
|
507
524
|
}, {
|
|
@@ -510,12 +527,12 @@ const Dt = ["data-audience"], Ut = {
|
|
|
510
527
|
]),
|
|
511
528
|
_: 1
|
|
512
529
|
})) : g("", !0),
|
|
513
|
-
|
|
530
|
+
M.value ? (l(), b(Xe(q.value ? ea : "div"), Qe(pa({ key: 4 }, q.value ? { admin: !0, locale: t.locale, files: e(T), purpose: t.purpose, layout: t.layout, webapiProfiles: e(N) } : {})), {
|
|
514
531
|
default: n(() => [
|
|
515
532
|
v(e(Me), {
|
|
516
533
|
direction: "vertical",
|
|
517
534
|
class: "executor-form",
|
|
518
|
-
onSubmit: qe(e(
|
|
535
|
+
onSubmit: qe(e(B), ["prevent"])
|
|
519
536
|
}, {
|
|
520
537
|
default: n(() => [
|
|
521
538
|
e(k) ? (l(), b(e($e), {
|
|
@@ -526,10 +543,10 @@ const Dt = ["data-audience"], Ut = {
|
|
|
526
543
|
default: n(() => [
|
|
527
544
|
v(e(ma), {
|
|
528
545
|
id: "delegate-scope",
|
|
529
|
-
modelValue: e(
|
|
530
|
-
"onUpdate:modelValue":
|
|
531
|
-
options: e(
|
|
532
|
-
disabled: e(
|
|
546
|
+
modelValue: e(C),
|
|
547
|
+
"onUpdate:modelValue": H[0] || (H[0] = (G) => Ze(C) ? C.value = G : null),
|
|
548
|
+
options: e(E),
|
|
549
|
+
disabled: e(m) || e(f)
|
|
533
550
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
534
551
|
]),
|
|
535
552
|
_: 1
|
|
@@ -537,17 +554,17 @@ const Dt = ["data-audience"], Ut = {
|
|
|
537
554
|
v(e($e), {
|
|
538
555
|
label: u.value.password,
|
|
539
556
|
description: e(d) ? u.value.confirmingHelp : u.value.passwordNote,
|
|
540
|
-
help: e(
|
|
541
|
-
"validate-status": e(
|
|
557
|
+
help: e(P),
|
|
558
|
+
"validate-status": e(P) ? "error" : void 0,
|
|
542
559
|
"validate-message-display-mode": "text"
|
|
543
560
|
}, {
|
|
544
|
-
after: n(({ classes:
|
|
561
|
+
after: n(({ classes: G }) => [
|
|
545
562
|
v(e(V), {
|
|
546
|
-
class: De(
|
|
563
|
+
class: De(G.afterItem),
|
|
547
564
|
type: "submit",
|
|
548
565
|
variant: "primary",
|
|
549
566
|
loading: e(d),
|
|
550
|
-
disabled: e(
|
|
567
|
+
disabled: e(m) || e(f) || !e(te)
|
|
551
568
|
}, {
|
|
552
569
|
default: n(() => [
|
|
553
570
|
h(s(e(k) ? u.value.confirmShare : u.value.authorize), 1)
|
|
@@ -559,11 +576,11 @@ const Dt = ["data-audience"], Ut = {
|
|
|
559
576
|
v(e(ze), {
|
|
560
577
|
id: "delegate-password",
|
|
561
578
|
modelValue: e(c),
|
|
562
|
-
"onUpdate:modelValue":
|
|
579
|
+
"onUpdate:modelValue": H[1] || (H[1] = (G) => Ze(c) ? c.value = G : null),
|
|
563
580
|
type: "password",
|
|
564
581
|
autocomplete: "current-password",
|
|
565
|
-
invalid: !!e(
|
|
566
|
-
disabled: e(
|
|
582
|
+
invalid: !!e(P),
|
|
583
|
+
disabled: e(m) || e(f)
|
|
567
584
|
}, null, 8, ["modelValue", "invalid", "disabled"])
|
|
568
585
|
]),
|
|
569
586
|
_: 1
|
|
@@ -579,13 +596,13 @@ const Dt = ["data-audience"], Ut = {
|
|
|
579
596
|
_: 1
|
|
580
597
|
}, 8, ["title", "description", "aria-busy"])) : g("", !0);
|
|
581
598
|
}
|
|
582
|
-
}), La = /* @__PURE__ */ me(
|
|
599
|
+
}), La = /* @__PURE__ */ me(Yt, [["__scopeId", "data-v-5a1f26e3"]]), Qt = {
|
|
583
600
|
key: 0,
|
|
584
601
|
class: "executor-notice"
|
|
585
|
-
},
|
|
602
|
+
}, Zt = {
|
|
586
603
|
key: 1,
|
|
587
604
|
class: "executor-notice"
|
|
588
|
-
},
|
|
605
|
+
}, jt = { class: "executor-notice-body" }, el = /* @__PURE__ */ fe({
|
|
589
606
|
__name: "ExecutorNotice",
|
|
590
607
|
props: {
|
|
591
608
|
locale: {},
|
|
@@ -593,21 +610,21 @@ const Dt = ["data-audience"], Ut = {
|
|
|
593
610
|
ctx: {}
|
|
594
611
|
},
|
|
595
612
|
setup(t) {
|
|
596
|
-
const
|
|
613
|
+
const p = t, o = _(() => Ve(p.locale)), a = Ee(We, void 0) ?? p.ctx.executor;
|
|
597
614
|
a && Le(We, a);
|
|
598
|
-
const i =
|
|
599
|
-
let
|
|
600
|
-
function
|
|
615
|
+
const i = y("checking"), u = y(), r = y(!1), c = _(() => p.ctx.user?.isAdmin === !0), m = _(() => !u.value && (i.value === "needs-admin-approval" || i.value === "blocked")), d = _(() => a?.call ? { call: (k, T) => a.call(k, T) } : p.ctx.call ? p.ctx : void 0);
|
|
616
|
+
let f = !1, x, P, w = 0;
|
|
617
|
+
function C(k) {
|
|
601
618
|
const T = u.value;
|
|
602
|
-
if (u.value = Ce(k), i.value = k?.state ?? "unknown", clearTimeout(
|
|
603
|
-
|
|
619
|
+
if (u.value = Ce(k), i.value = k?.state ?? "unknown", clearTimeout(P), k && !u.value) {
|
|
620
|
+
w = 0;
|
|
604
621
|
return;
|
|
605
622
|
}
|
|
606
|
-
u.value !== T && (
|
|
607
|
-
|
|
608
|
-
}, ca(
|
|
623
|
+
u.value !== T && (w = 0), P = setTimeout(() => {
|
|
624
|
+
E();
|
|
625
|
+
}, ca(w++, u.value));
|
|
609
626
|
}
|
|
610
|
-
async function
|
|
627
|
+
async function E() {
|
|
611
628
|
if (!a) return;
|
|
612
629
|
let k;
|
|
613
630
|
try {
|
|
@@ -615,18 +632,18 @@ const Dt = ["data-audience"], Ut = {
|
|
|
615
632
|
} catch {
|
|
616
633
|
k = void 0;
|
|
617
634
|
}
|
|
618
|
-
|
|
635
|
+
f || C(k);
|
|
619
636
|
}
|
|
620
637
|
return Se(() => {
|
|
621
638
|
a && (a.subscribe?.((k) => {
|
|
622
|
-
!
|
|
623
|
-
}),
|
|
624
|
-
|
|
625
|
-
}),
|
|
626
|
-
}),
|
|
627
|
-
|
|
628
|
-
}), (k, T) => u.value ? (l(), $("div",
|
|
629
|
-
v(e(
|
|
639
|
+
!f && !je(k) && C(k);
|
|
640
|
+
}), x = p.ctx.reopen?.(() => {
|
|
641
|
+
E();
|
|
642
|
+
}), E());
|
|
643
|
+
}), we(() => {
|
|
644
|
+
f = !0, clearTimeout(P), x?.();
|
|
645
|
+
}), (k, T) => u.value ? (l(), $("div", Qt, [
|
|
646
|
+
v(e(j), {
|
|
630
647
|
tone: "info",
|
|
631
648
|
role: "status"
|
|
632
649
|
}, {
|
|
@@ -635,16 +652,16 @@ const Dt = ["data-audience"], Ut = {
|
|
|
635
652
|
]),
|
|
636
653
|
_: 1
|
|
637
654
|
})
|
|
638
|
-
])) :
|
|
639
|
-
v(e(
|
|
655
|
+
])) : m.value ? (l(), $("div", Zt, [
|
|
656
|
+
v(e(j), { tone: "warning" }, {
|
|
640
657
|
default: n(() => [
|
|
641
|
-
|
|
658
|
+
S("span", jt, [
|
|
642
659
|
h(s(c.value ? o.value.noticeAdmin : o.value.noticeUser), 1),
|
|
643
660
|
c.value ? (l(), b(e(V), {
|
|
644
661
|
key: 0,
|
|
645
662
|
variant: "secondary",
|
|
646
663
|
size: "sm",
|
|
647
|
-
onClick: T[0] || (T[0] = (
|
|
664
|
+
onClick: T[0] || (T[0] = (N) => r.value = !0)
|
|
648
665
|
}, {
|
|
649
666
|
default: n(() => [
|
|
650
667
|
h(s(o.value.noticeApprove), 1)
|
|
@@ -657,10 +674,9 @@ const Dt = ["data-audience"], Ut = {
|
|
|
657
674
|
}),
|
|
658
675
|
c.value ? (l(), b(e(Ge), {
|
|
659
676
|
key: 0,
|
|
660
|
-
open: r.value &&
|
|
677
|
+
open: r.value && m.value,
|
|
661
678
|
title: o.value.setupTitle,
|
|
662
|
-
|
|
663
|
-
"onUpdate:open": T[1] || (T[1] = (B) => r.value = B)
|
|
679
|
+
"onUpdate:open": T[1] || (T[1] = (N) => r.value = N)
|
|
664
680
|
}, {
|
|
665
681
|
default: n(() => [
|
|
666
682
|
v(La, {
|
|
@@ -669,20 +685,20 @@ const Dt = ["data-audience"], Ut = {
|
|
|
669
685
|
ctx: d.value,
|
|
670
686
|
purpose: t.purpose,
|
|
671
687
|
title: "",
|
|
672
|
-
onConfirmed:
|
|
688
|
+
onConfirmed: E
|
|
673
689
|
}, null, 8, ["locale", "ctx", "purpose"])
|
|
674
690
|
]),
|
|
675
691
|
_: 1
|
|
676
692
|
}, 8, ["open", "title"])) : g("", !0)
|
|
677
693
|
])) : g("", !0);
|
|
678
694
|
}
|
|
679
|
-
}),
|
|
695
|
+
}), al = /* @__PURE__ */ me(el, [["__scopeId", "data-v-d0aeb4e7"]]), Oa = /* @__PURE__ */ Symbol("synopackageland:page-actions"), Fa = /* @__PURE__ */ Symbol("synopackageland:page-info"), qa = /* @__PURE__ */ Symbol("synopackageland:shell-locale"), tl = { role: "alert" }, ll = {
|
|
680
696
|
ref: "page-info",
|
|
681
697
|
class: "app-page-info"
|
|
682
|
-
},
|
|
698
|
+
}, nl = {
|
|
683
699
|
ref: "page-actions",
|
|
684
700
|
class: "app-page-actions"
|
|
685
|
-
},
|
|
701
|
+
}, ol = ["hidden"], sl = { class: "app-page-content" }, il = /* @__PURE__ */ fe({
|
|
686
702
|
__name: "AppShell",
|
|
687
703
|
props: {
|
|
688
704
|
locale: {},
|
|
@@ -700,68 +716,68 @@ const Dt = ["data-audience"], Ut = {
|
|
|
700
716
|
appRoot: { type: Boolean }
|
|
701
717
|
},
|
|
702
718
|
emits: ["update:modelValue"],
|
|
703
|
-
setup(t, { emit:
|
|
704
|
-
const o = t, a =
|
|
705
|
-
|
|
706
|
-
|
|
719
|
+
setup(t, { emit: p }) {
|
|
720
|
+
const o = t, a = p, i = _(() => sa(o.locale)), u = _(() => Tt(o.pages, i.value)), r = _(() => zt(u.value)), c = _(() => u.value.find((L) => L.id === o.modelValue)), m = _(() => c.value?.title ?? i.value[o.modelValue] ?? i.value.status), d = He("scroller"), f = _(() => o.pages.some((L) => typeof L != "string"));
|
|
721
|
+
Oe(() => o.modelValue, () => {
|
|
722
|
+
f.value && !o.keepScroll && d.value && (d.value.$el.scrollTop = 0);
|
|
707
723
|
}, { flush: "post" });
|
|
708
|
-
const
|
|
709
|
-
function
|
|
724
|
+
const x = Ta(), P = _(() => o.denied === !0 ? {} : o.denied || void 0), w = _(() => da(P.value, o.locale, o.brandName ?? o.ctx?.displayName)), C = _(() => o.ctx !== void 0 && $a(o.ctx)), E = _(() => C.value ? o.ctx : void 0), k = (L, { slots: R }) => R.default?.(), T = _(() => o.ctx !== void 0 && !C.value);
|
|
725
|
+
function N() {
|
|
710
726
|
o.ctx?.host?.activateWindow?.();
|
|
711
727
|
}
|
|
712
|
-
const te = He("layout"),
|
|
713
|
-
|
|
714
|
-
const
|
|
715
|
-
if (!
|
|
716
|
-
|
|
728
|
+
const te = He("layout"), F = y({ brand: !1, user: !1 });
|
|
729
|
+
Oe([C, te], (L, R, A) => {
|
|
730
|
+
const q = te.value?.$el;
|
|
731
|
+
if (!C.value || !q) {
|
|
732
|
+
F.value = { brand: !1, user: !1 };
|
|
717
733
|
return;
|
|
718
734
|
}
|
|
719
735
|
const M = () => {
|
|
720
|
-
const
|
|
721
|
-
(
|
|
736
|
+
const G = St(q);
|
|
737
|
+
(G.brand !== F.value.brand || G.user !== F.value.user) && (F.value = G);
|
|
722
738
|
};
|
|
723
739
|
M();
|
|
724
|
-
const
|
|
725
|
-
|
|
740
|
+
const se = new MutationObserver((G) => {
|
|
741
|
+
G.some((le) => !q.contains(le.target)) && M();
|
|
726
742
|
});
|
|
727
|
-
|
|
728
|
-
const H =
|
|
729
|
-
H?.addEventListener("resize", M),
|
|
730
|
-
|
|
743
|
+
se.observe(q.ownerDocument.body, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["class", "style", "hidden"], characterData: !0 });
|
|
744
|
+
const H = q.ownerDocument.defaultView;
|
|
745
|
+
H?.addEventListener("resize", M), A(() => {
|
|
746
|
+
se.disconnect(), H?.removeEventListener("resize", M);
|
|
731
747
|
});
|
|
732
748
|
}, { flush: "post", immediate: !0 });
|
|
733
|
-
const
|
|
734
|
-
Le(
|
|
735
|
-
const
|
|
736
|
-
return ga((
|
|
737
|
-
const
|
|
738
|
-
if (!
|
|
739
|
-
const
|
|
740
|
-
|
|
749
|
+
const Y = _(() => !F.value.user && E.value?.user?.name ? E.value.user : void 0);
|
|
750
|
+
Le(Oa, He("page-actions")), Le(Fa, He("page-info")), Le(qa, _(() => o.locale));
|
|
751
|
+
const B = He("notices"), K = y(!0);
|
|
752
|
+
return ga((L) => {
|
|
753
|
+
const R = B.value;
|
|
754
|
+
if (!R) return;
|
|
755
|
+
const A = () => {
|
|
756
|
+
K.value = !Pt(R);
|
|
741
757
|
};
|
|
742
|
-
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
}, { flush: "post" }), ga((
|
|
746
|
-
|
|
747
|
-
}), (
|
|
758
|
+
A();
|
|
759
|
+
const q = new MutationObserver(A);
|
|
760
|
+
q.observe(R, { childList: !0, subtree: !0, characterData: !0 }), L(() => q.disconnect());
|
|
761
|
+
}, { flush: "post" }), ga((L) => {
|
|
762
|
+
C.value && L(ot());
|
|
763
|
+
}), (L, R) => (l(), b(Xe(t.appRoot ? e(st) : k), Qe(ha(t.appRoot ? { modalScope: "app", dialogBounds: T.value ? "viewport" : "app", style: "height: 100%;", onActivate: N } : {})), {
|
|
748
764
|
default: n(() => [
|
|
749
765
|
(l(), b(Xe(t.appRoot ? e(it) : k), Qe(ha(t.appRoot ? { locale: e(va)(t.locale) } : {})), {
|
|
750
766
|
default: n(() => [
|
|
751
|
-
|
|
767
|
+
P.value ? (l(), b(e(ka), {
|
|
752
768
|
key: 0,
|
|
753
769
|
class: "app-denied",
|
|
754
770
|
width: t.pageWidth
|
|
755
771
|
}, {
|
|
756
772
|
default: n(() => [
|
|
757
|
-
|
|
773
|
+
P.value.header !== !1 ? (l(), b(e(wa), {
|
|
758
774
|
key: 0,
|
|
759
|
-
title:
|
|
775
|
+
title: P.value.title ?? w.value?.title ?? i.value.deniedTitle
|
|
760
776
|
}, null, 8, ["title"])) : g("", !0),
|
|
761
|
-
be(
|
|
762
|
-
v(e(
|
|
777
|
+
be(L.$slots, "denied", {}, () => [
|
|
778
|
+
v(e(j), { tone: "danger" }, {
|
|
763
779
|
default: n(() => [
|
|
764
|
-
|
|
780
|
+
S("span", tl, s(P.value.message ?? w.value?.message ?? i.value.deniedMessage), 1)
|
|
765
781
|
]),
|
|
766
782
|
_: 1
|
|
767
783
|
})
|
|
@@ -772,9 +788,9 @@ const Dt = ["data-audience"], Ut = {
|
|
|
772
788
|
key: 1,
|
|
773
789
|
ref_key: "layout",
|
|
774
790
|
ref: te,
|
|
775
|
-
class: De(["app-shell", { "app-shell-fill": c.value?.fill, "app-shell-portal-brand":
|
|
791
|
+
class: De(["app-shell", { "app-shell-fill": c.value?.fill, "app-shell-portal-brand": F.value.brand }]),
|
|
776
792
|
"min-height": "0",
|
|
777
|
-
"wide-layout": t.wideLayout ?? (
|
|
793
|
+
"wide-layout": t.wideLayout ?? (C.value ? "web" : "window"),
|
|
778
794
|
"sidebar-storage-key": t.sidebarStorageKey,
|
|
779
795
|
"brand-name": t.brandName ?? t.ctx?.displayName,
|
|
780
796
|
"brand-icon": t.brandIcon ?? t.ctx?.appIcon
|
|
@@ -783,7 +799,7 @@ const Dt = ["data-audience"], Ut = {
|
|
|
783
799
|
v(e(rt), {
|
|
784
800
|
"model-value": t.modelValue,
|
|
785
801
|
groups: r.value,
|
|
786
|
-
"onUpdate:modelValue":
|
|
802
|
+
"onUpdate:modelValue": R[0] || (R[0] = (A) => a("update:modelValue", A))
|
|
787
803
|
}, null, 8, ["model-value", "groups"])
|
|
788
804
|
]),
|
|
789
805
|
default: n(() => [
|
|
@@ -796,37 +812,37 @@ const Dt = ["data-audience"], Ut = {
|
|
|
796
812
|
default: n(() => [
|
|
797
813
|
c.value?.header !== !1 ? (l(), b(e(wa), {
|
|
798
814
|
key: 0,
|
|
799
|
-
title:
|
|
815
|
+
title: m.value,
|
|
800
816
|
description: c.value?.description ?? t.description
|
|
801
817
|
}, {
|
|
802
818
|
meta: n(() => [
|
|
803
|
-
|
|
804
|
-
be(
|
|
819
|
+
S("span", ll, null, 512),
|
|
820
|
+
be(L.$slots, "meta", { page: t.modelValue }, void 0, !0)
|
|
805
821
|
]),
|
|
806
822
|
actions: n(() => [
|
|
807
|
-
|
|
808
|
-
be(
|
|
823
|
+
S("div", nl, null, 512),
|
|
824
|
+
be(L.$slots, "actions", { page: t.modelValue }, void 0, !0)
|
|
809
825
|
]),
|
|
810
826
|
_: 3
|
|
811
827
|
}, 8, ["title", "description"])) : g("", !0),
|
|
812
|
-
t.ctx?.executor ? (l(), b(
|
|
828
|
+
t.ctx?.executor ? (l(), b(al, {
|
|
813
829
|
key: 1,
|
|
814
830
|
ctx: t.ctx,
|
|
815
831
|
locale: t.locale
|
|
816
832
|
}, null, 8, ["ctx", "locale"])) : g("", !0),
|
|
817
|
-
e(Na)(
|
|
833
|
+
e(Na)(x.notices?.({ page: t.modelValue })) ? (l(), $("div", {
|
|
818
834
|
key: 2,
|
|
819
835
|
ref: "notices",
|
|
820
836
|
class: "app-notices",
|
|
821
|
-
hidden:
|
|
837
|
+
hidden: K.value
|
|
822
838
|
}, [
|
|
823
|
-
be(
|
|
824
|
-
], 8,
|
|
825
|
-
|
|
839
|
+
be(L.$slots, "notices", { page: t.modelValue }, void 0, !0)
|
|
840
|
+
], 8, ol)) : g("", !0),
|
|
841
|
+
S("div", sl, [
|
|
826
842
|
c.value?.component ? (l(), b(Xe(c.value.component), {
|
|
827
843
|
key: c.value.id
|
|
828
844
|
})) : g("", !0),
|
|
829
|
-
be(
|
|
845
|
+
be(L.$slots, "default", { page: t.modelValue }, void 0, !0)
|
|
830
846
|
])
|
|
831
847
|
]),
|
|
832
848
|
_: 3
|
|
@@ -834,23 +850,23 @@ const Dt = ["data-audience"], Ut = {
|
|
|
834
850
|
]),
|
|
835
851
|
_: 2
|
|
836
852
|
}, [
|
|
837
|
-
|
|
853
|
+
x["sidebar-footer"] || Y.value ? {
|
|
838
854
|
name: "sidebar-footer",
|
|
839
855
|
fn: n(() => [
|
|
840
|
-
be(
|
|
841
|
-
|
|
856
|
+
be(L.$slots, "sidebar-footer", {}, () => [
|
|
857
|
+
Y.value ? (l(), b(e(dt), {
|
|
842
858
|
key: 0,
|
|
843
|
-
name:
|
|
844
|
-
detail:
|
|
859
|
+
name: Y.value.name,
|
|
860
|
+
detail: Y.value.isAdmin ? i.value.administrator : i.value.dsmUser
|
|
845
861
|
}, null, 8, ["name", "detail"])) : g("", !0)
|
|
846
862
|
], !0)
|
|
847
863
|
]),
|
|
848
864
|
key: "0"
|
|
849
865
|
} : void 0,
|
|
850
|
-
|
|
866
|
+
x.toolbar ? {
|
|
851
867
|
name: "toolbar",
|
|
852
868
|
fn: n(() => [
|
|
853
|
-
be(
|
|
869
|
+
be(L.$slots, "toolbar", { page: t.modelValue }, void 0, !0)
|
|
854
870
|
]),
|
|
855
871
|
key: "1"
|
|
856
872
|
} : void 0
|
|
@@ -862,10 +878,10 @@ const Dt = ["data-audience"], Ut = {
|
|
|
862
878
|
_: 3
|
|
863
879
|
}, 16));
|
|
864
880
|
}
|
|
865
|
-
}),
|
|
881
|
+
}), uo = /* @__PURE__ */ me(il, [["__scopeId", "data-v-59f635a8"]]), ro = /* @__PURE__ */ fe({
|
|
866
882
|
__name: "PageActions",
|
|
867
883
|
setup(t) {
|
|
868
|
-
const
|
|
884
|
+
const p = Ee(Oa, null), o = _(() => p?.value ?? null);
|
|
869
885
|
return (a, i) => o.value ? (l(), b(Aa, {
|
|
870
886
|
key: 0,
|
|
871
887
|
to: o.value
|
|
@@ -873,7 +889,7 @@ const Dt = ["data-audience"], Ut = {
|
|
|
873
889
|
be(a.$slots, "default")
|
|
874
890
|
], 8, ["to"])) : g("", !0);
|
|
875
891
|
}
|
|
876
|
-
}),
|
|
892
|
+
}), ul = { class: "page-info-notes" }, rl = /* @__PURE__ */ fe({
|
|
877
893
|
inheritAttrs: !1,
|
|
878
894
|
__name: "PageInfo",
|
|
879
895
|
props: {
|
|
@@ -885,17 +901,17 @@ const Dt = ["data-audience"], Ut = {
|
|
|
885
901
|
align: { default: "start" }
|
|
886
902
|
},
|
|
887
903
|
setup(t) {
|
|
888
|
-
const
|
|
889
|
-
if (
|
|
890
|
-
const
|
|
891
|
-
return o.default ? sa(
|
|
904
|
+
const p = t, o = Ta(), a = _(() => (p.notes ?? []).filter(Boolean)), i = p.inline ? null : Ee(Fa, null), u = _(() => i?.value ?? null), r = Ee(qa, null), c = _(() => {
|
|
905
|
+
if (p.label) return p.label;
|
|
906
|
+
const m = p.locale ?? r?.value ?? "en";
|
|
907
|
+
return o.default ? sa(m).notes : Je(sa(m).notesCount, { count: a.value.length }, m);
|
|
892
908
|
});
|
|
893
|
-
return (
|
|
909
|
+
return (m, d) => (a.value.length || o.default) && (!e(i) || u.value) ? (l(), b(Aa, {
|
|
894
910
|
key: 0,
|
|
895
911
|
to: u.value ?? "body",
|
|
896
912
|
disabled: !e(i)
|
|
897
913
|
}, [
|
|
898
|
-
v(e(ct), pa(
|
|
914
|
+
v(e(ct), pa(m.$attrs, {
|
|
899
915
|
class: "page-info",
|
|
900
916
|
icon: "info",
|
|
901
917
|
"trigger-action": "click",
|
|
@@ -904,9 +920,9 @@ const Dt = ["data-audience"], Ut = {
|
|
|
904
920
|
"aria-label": c.value
|
|
905
921
|
}), {
|
|
906
922
|
default: n(() => [
|
|
907
|
-
be(
|
|
908
|
-
|
|
909
|
-
(l(!0), $(
|
|
923
|
+
be(m.$slots, "default", {}, () => [
|
|
924
|
+
S("ul", ul, [
|
|
925
|
+
(l(!0), $(oe, null, ge(a.value, (f) => (l(), $("li", { key: f }, s(f), 1))), 128))
|
|
910
926
|
])
|
|
911
927
|
], !0)
|
|
912
928
|
]),
|
|
@@ -914,27 +930,27 @@ const Dt = ["data-audience"], Ut = {
|
|
|
914
930
|
}, 16, ["side", "align", "aria-label"])
|
|
915
931
|
], 8, ["to", "disabled"])) : g("", !0);
|
|
916
932
|
}
|
|
917
|
-
}),
|
|
918
|
-
function ra(t,
|
|
933
|
+
}), co = /* @__PURE__ */ me(rl, [["__scopeId", "data-v-93861654"]]), Ca = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
934
|
+
function ra(t, p) {
|
|
919
935
|
let o = 0, a = t;
|
|
920
936
|
for (; a >= 1024 && o < Ca.length - 1; )
|
|
921
937
|
a /= 1024, o++;
|
|
922
|
-
return `${new Intl.NumberFormat(
|
|
938
|
+
return `${new Intl.NumberFormat(p, { maximumFractionDigits: o ? 1 : 0 }).format(a)} ${Ca[o]}`;
|
|
923
939
|
}
|
|
924
|
-
const
|
|
940
|
+
const dl = ["aria-busy", "aria-label"], cl = { class: "file-toolbar file-location" }, vl = ["aria-label"], fl = {
|
|
925
941
|
key: 0,
|
|
926
942
|
class: "file-toolbar"
|
|
927
|
-
},
|
|
943
|
+
}, pl = {
|
|
928
944
|
key: 1,
|
|
929
945
|
role: "status"
|
|
930
|
-
},
|
|
946
|
+
}, ml = { role: "alert" }, yl = {
|
|
931
947
|
key: 4,
|
|
932
948
|
role: "status"
|
|
933
|
-
},
|
|
949
|
+
}, bl = { class: "file-columns" }, gl = ["aria-label"], hl = { class: "file-content" }, kl = { class: "file-name" }, wl = { class: "file-empty" }, _l = { class: "file-bytes" }, xl = {
|
|
934
950
|
key: 5,
|
|
935
951
|
class: "file-selection",
|
|
936
952
|
role: "status"
|
|
937
|
-
},
|
|
953
|
+
}, Cl = /* @__PURE__ */ fe({
|
|
938
954
|
__name: "FileBrowser",
|
|
939
955
|
props: {
|
|
940
956
|
provider: {},
|
|
@@ -944,129 +960,129 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
944
960
|
transfers: { type: Boolean, default: !1 }
|
|
945
961
|
},
|
|
946
962
|
emits: ["selected"],
|
|
947
|
-
setup(t, { emit:
|
|
948
|
-
const o = t, a =
|
|
949
|
-
let
|
|
950
|
-
async function
|
|
951
|
-
const D =
|
|
963
|
+
setup(t, { emit: p }) {
|
|
964
|
+
const o = t, a = p, i = _(() => Te(o.locale)), u = $t(), { busy: r, error: c } = u, m = y([]), d = y([]), f = y([]), x = y(), P = y(), w = y(), C = y([]), E = y(), k = y({ key: "name", direction: "asc" }), T = y(0), N = y([]), te = y(!1);
|
|
965
|
+
let F = new AbortController();
|
|
966
|
+
async function Y() {
|
|
967
|
+
const D = x.value;
|
|
952
968
|
!D || D.isDir || !o.provider.download || await u.run(async (U) => (await o.provider.info(D.path, U), o.provider.download(D.path), !0));
|
|
953
969
|
}
|
|
954
|
-
async function
|
|
955
|
-
const D =
|
|
970
|
+
async function B() {
|
|
971
|
+
const D = f.value.at(-1)?.path, U = N.value[0];
|
|
956
972
|
if (!D || !U || !o.provider.upload) return;
|
|
957
|
-
te.value = !1, await u.run(async (
|
|
973
|
+
te.value = !1, await u.run(async (Z) => (await o.provider.upload(D, U, Z), !0)) && (N.value = [], await Q(f.value), te.value = !0);
|
|
958
974
|
}
|
|
959
|
-
const
|
|
975
|
+
const K = _(() => [
|
|
960
976
|
{ key: "name", label: i.value.nameColumn, sortable: !0 },
|
|
961
977
|
{ key: "kind", label: i.value.kindColumn },
|
|
962
978
|
{ key: "bytes", label: i.value.sizeColumn, align: "right", sortable: !0 }
|
|
963
|
-
]),
|
|
964
|
-
function
|
|
965
|
-
return { id: D.path, label: D.name, icon:
|
|
979
|
+
]), L = tt((D, { attrs: U }) => lt(la, { ...U, kind: "folder" }));
|
|
980
|
+
function R(D) {
|
|
981
|
+
return { id: D.path, label: D.name, icon: L, data: D };
|
|
966
982
|
}
|
|
967
|
-
function
|
|
968
|
-
|
|
983
|
+
function A(D) {
|
|
984
|
+
x.value = D, a("selected", D?.path);
|
|
969
985
|
}
|
|
970
|
-
function
|
|
971
|
-
|
|
986
|
+
function q(D) {
|
|
987
|
+
P.value = D.path, A(o.mode === "folder" ? D.isDir ? D : f.value.at(-1) : D.isDir ? void 0 : D);
|
|
972
988
|
}
|
|
973
989
|
function M(D) {
|
|
974
|
-
D.isDir ? Ae(D) :
|
|
975
|
-
}
|
|
976
|
-
const
|
|
977
|
-
function H(D, U,
|
|
978
|
-
for (const
|
|
979
|
-
const ce = [...
|
|
980
|
-
if (
|
|
981
|
-
const
|
|
982
|
-
if (
|
|
990
|
+
D.isDir ? Ae(D) : q(D);
|
|
991
|
+
}
|
|
992
|
+
const se = (D) => m.value.find((U) => U.path === D);
|
|
993
|
+
function H(D, U, O = []) {
|
|
994
|
+
for (const Z of D) {
|
|
995
|
+
const ce = [...O, Z.data];
|
|
996
|
+
if (Z.id === U) return ce;
|
|
997
|
+
const z = H(Z.children ?? [], U, ce);
|
|
998
|
+
if (z) return z;
|
|
983
999
|
}
|
|
984
1000
|
}
|
|
985
|
-
function
|
|
986
|
-
for (const
|
|
987
|
-
if (
|
|
988
|
-
const
|
|
989
|
-
if (
|
|
1001
|
+
function G(D, U) {
|
|
1002
|
+
for (const O of D) {
|
|
1003
|
+
if (O.id === U) return O;
|
|
1004
|
+
const Z = G(O.children ?? [], U);
|
|
1005
|
+
if (Z) return Z;
|
|
990
1006
|
}
|
|
991
1007
|
}
|
|
992
|
-
function
|
|
993
|
-
return D.map((
|
|
1008
|
+
function le(D, U, O) {
|
|
1009
|
+
return D.map((Z) => Z.id === U ? { ...Z, children: O } : Z.children ? { ...Z, children: le(Z.children, U, O) } : Z);
|
|
994
1010
|
}
|
|
995
1011
|
let re = 0;
|
|
996
|
-
async function
|
|
1012
|
+
async function ee(D) {
|
|
997
1013
|
const U = ++re;
|
|
998
|
-
for (const
|
|
999
|
-
const
|
|
1000
|
-
if (!
|
|
1001
|
-
if (
|
|
1002
|
-
const ce = await X(
|
|
1014
|
+
for (const O of D.slice(0, -1)) {
|
|
1015
|
+
const Z = G(d.value, O.path);
|
|
1016
|
+
if (!Z) break;
|
|
1017
|
+
if (Z.children === void 0) {
|
|
1018
|
+
const ce = await X(Z);
|
|
1003
1019
|
if (U !== re || !ce) return;
|
|
1004
|
-
d.value =
|
|
1020
|
+
d.value = le(d.value, Z.id, ce);
|
|
1005
1021
|
}
|
|
1006
|
-
|
|
1022
|
+
C.value.includes(Z.id) || (C.value = [...C.value, Z.id]);
|
|
1007
1023
|
}
|
|
1008
|
-
|
|
1024
|
+
E.value = D.at(-1)?.path;
|
|
1009
1025
|
}
|
|
1010
1026
|
async function X(D) {
|
|
1011
|
-
const U = T.value,
|
|
1027
|
+
const U = T.value, O = F.signal;
|
|
1012
1028
|
try {
|
|
1013
|
-
const
|
|
1029
|
+
const Z = [];
|
|
1014
1030
|
let ce = 0;
|
|
1015
1031
|
for (; ce !== void 0; ) {
|
|
1016
|
-
const
|
|
1017
|
-
if (
|
|
1018
|
-
|
|
1032
|
+
const z = await o.provider.list(D.id, { offset: ce, sortBy: "name", sortDirection: "ASC" }, O);
|
|
1033
|
+
if (O.aborted || U !== T.value) return;
|
|
1034
|
+
Z.push(...z.entries.filter((W) => W.isDir).map(R)), ce = z.nextOffset;
|
|
1019
1035
|
}
|
|
1020
|
-
return
|
|
1021
|
-
} catch (
|
|
1022
|
-
!
|
|
1036
|
+
return Z;
|
|
1037
|
+
} catch (Z) {
|
|
1038
|
+
!O.aborted && U === T.value && (c.value = Z, A());
|
|
1023
1039
|
return;
|
|
1024
1040
|
}
|
|
1025
1041
|
}
|
|
1026
|
-
async function
|
|
1042
|
+
async function Q(D, U = !1) {
|
|
1027
1043
|
if (r.value) return;
|
|
1028
|
-
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
const ce = await u.run((
|
|
1032
|
-
ce && (
|
|
1044
|
+
A(), P.value = void 0, m.value = U ? m.value : [], w.value = U ? w.value : void 0;
|
|
1045
|
+
const O = U ? w.value ?? 0 : 0, Z = D.at(-1)?.path;
|
|
1046
|
+
f.value = D;
|
|
1047
|
+
const ce = await u.run((z) => Z ? o.provider.list(Z, { offset: O, sortBy: k.value.key, sortDirection: k.value.direction === "asc" ? "ASC" : "DESC" }, z) : o.provider.shares(O, z));
|
|
1048
|
+
ce && (m.value = U ? [...m.value, ...ce.entries] : ce.entries, w.value = ce.nextOffset, Z ? o.mode === "folder" && !U && A(D.at(-1)) : d.value = m.value.filter((z) => z.isDir).map(R), U || ee(D));
|
|
1033
1049
|
}
|
|
1034
|
-
const de =
|
|
1035
|
-
function
|
|
1036
|
-
const U = de.value.findIndex((
|
|
1037
|
-
U <
|
|
1050
|
+
const de = _(() => [{ id: "", display: i.value.roots }, ...f.value.map((D) => ({ id: D.path, display: D.name }))]);
|
|
1051
|
+
function he(D) {
|
|
1052
|
+
const U = de.value.findIndex((O) => O.id === D.id);
|
|
1053
|
+
U < f.value.length && ie(f.value.slice(0, U));
|
|
1038
1054
|
}
|
|
1039
1055
|
function Ae(D) {
|
|
1040
|
-
|
|
1056
|
+
ie([...f.value, D]);
|
|
1041
1057
|
}
|
|
1042
|
-
const
|
|
1043
|
-
function
|
|
1044
|
-
r.value || (D.at(-1)?.path !==
|
|
1058
|
+
const _e = y([[]]), J = y(0);
|
|
1059
|
+
function ie(D) {
|
|
1060
|
+
r.value || (D.at(-1)?.path !== f.value.at(-1)?.path && (_e.value = [..._e.value.slice(0, J.value + 1), D], J.value++), Q(D));
|
|
1045
1061
|
}
|
|
1046
|
-
function
|
|
1047
|
-
r.value || (
|
|
1062
|
+
function ne(D) {
|
|
1063
|
+
r.value || (J.value += D, Q(_e.value[J.value]));
|
|
1048
1064
|
}
|
|
1049
1065
|
function ye(D) {
|
|
1050
|
-
k.value = { key: D?.key === "bytes" ? "size" : "name", direction: D?.direction ?? "asc" },
|
|
1066
|
+
k.value = { key: D?.key === "bytes" ? "size" : "name", direction: D?.direction ?? "asc" }, Q(f.value);
|
|
1051
1067
|
}
|
|
1052
|
-
function
|
|
1053
|
-
r.value || (T.value++,
|
|
1068
|
+
function Pe() {
|
|
1069
|
+
r.value || (T.value++, F.abort(), F = new AbortController(), d.value = [], C.value = [], E.value = void 0, _e.value = [[]], J.value = 0, Q([]));
|
|
1054
1070
|
}
|
|
1055
1071
|
return Se(() => {
|
|
1056
|
-
|
|
1057
|
-
}),
|
|
1058
|
-
T.value++,
|
|
1072
|
+
Q([]);
|
|
1073
|
+
}), we(() => {
|
|
1074
|
+
T.value++, F.abort();
|
|
1059
1075
|
}), (D, U) => (l(), $("section", {
|
|
1060
1076
|
class: "file-browser",
|
|
1061
1077
|
"aria-busy": e(r),
|
|
1062
1078
|
"aria-label": i.value.title
|
|
1063
1079
|
}, [
|
|
1064
|
-
|
|
1080
|
+
S("div", cl, [
|
|
1065
1081
|
v(e(na), {
|
|
1066
1082
|
label: i.value.back,
|
|
1067
1083
|
size: "sm",
|
|
1068
|
-
disabled: e(r) ||
|
|
1069
|
-
onClick: U[0] || (U[0] = (
|
|
1084
|
+
disabled: e(r) || J.value === 0,
|
|
1085
|
+
onClick: U[0] || (U[0] = (O) => ne(-1))
|
|
1070
1086
|
}, {
|
|
1071
1087
|
default: n(() => [
|
|
1072
1088
|
v(e(kt), {
|
|
@@ -1079,8 +1095,8 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1079
1095
|
v(e(na), {
|
|
1080
1096
|
label: i.value.forward,
|
|
1081
1097
|
size: "sm",
|
|
1082
|
-
disabled: e(r) ||
|
|
1083
|
-
onClick: U[1] || (U[1] = (
|
|
1098
|
+
disabled: e(r) || J.value === _e.value.length - 1,
|
|
1099
|
+
onClick: U[1] || (U[1] = (O) => ne(1))
|
|
1084
1100
|
}, {
|
|
1085
1101
|
default: n(() => [
|
|
1086
1102
|
v(e(Da), {
|
|
@@ -1094,7 +1110,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1094
1110
|
label: i.value.refresh,
|
|
1095
1111
|
size: "sm",
|
|
1096
1112
|
disabled: e(r),
|
|
1097
|
-
onClick:
|
|
1113
|
+
onClick: Pe
|
|
1098
1114
|
}, {
|
|
1099
1115
|
default: n(() => [
|
|
1100
1116
|
v(e(wt), {
|
|
@@ -1104,32 +1120,32 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1104
1120
|
]),
|
|
1105
1121
|
_: 1
|
|
1106
1122
|
}, 8, ["label", "disabled"]),
|
|
1107
|
-
|
|
1123
|
+
S("nav", {
|
|
1108
1124
|
class: "file-path",
|
|
1109
1125
|
"aria-label": i.value.location
|
|
1110
1126
|
}, [
|
|
1111
1127
|
v(e(vt), {
|
|
1112
1128
|
items: de.value,
|
|
1113
1129
|
"collapsed-label": i.value.fullPath,
|
|
1114
|
-
onClickItem:
|
|
1130
|
+
onClickItem: he
|
|
1115
1131
|
}, null, 8, ["items", "collapsed-label"])
|
|
1116
|
-
], 8,
|
|
1132
|
+
], 8, vl)
|
|
1117
1133
|
]),
|
|
1118
|
-
t.transfers && t.provider.upload &&
|
|
1134
|
+
t.transfers && t.provider.upload && f.value.length ? (l(), $("div", fl, [
|
|
1119
1135
|
v(e(ft), {
|
|
1120
|
-
modelValue:
|
|
1121
|
-
"onUpdate:modelValue": U[2] || (U[2] = (
|
|
1136
|
+
modelValue: N.value,
|
|
1137
|
+
"onUpdate:modelValue": U[2] || (U[2] = (O) => N.value = O),
|
|
1122
1138
|
variant: "compact",
|
|
1123
1139
|
disabled: e(r),
|
|
1124
1140
|
"max-files": 1,
|
|
1125
1141
|
"max-size": 16 * 1024 ** 3,
|
|
1126
1142
|
title: i.value.upload,
|
|
1127
|
-
onRejected: U[3] || (U[3] = (
|
|
1143
|
+
onRejected: U[3] || (U[3] = (O) => c.value = { code: "upload_size_required" })
|
|
1128
1144
|
}, null, 8, ["modelValue", "disabled", "title"]),
|
|
1129
1145
|
v(e(V), {
|
|
1130
1146
|
variant: "primary",
|
|
1131
|
-
disabled: e(r) || !
|
|
1132
|
-
onClick:
|
|
1147
|
+
disabled: e(r) || !N.value.length,
|
|
1148
|
+
onClick: B
|
|
1133
1149
|
}, {
|
|
1134
1150
|
default: n(() => [
|
|
1135
1151
|
h(s(i.value.upload), 1)
|
|
@@ -1137,52 +1153,52 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1137
1153
|
_: 1
|
|
1138
1154
|
}, 8, ["disabled"])
|
|
1139
1155
|
])) : g("", !0),
|
|
1140
|
-
te.value ? (l(), $("p",
|
|
1141
|
-
t.transfers && t.provider.download &&
|
|
1156
|
+
te.value ? (l(), $("p", pl, s(i.value.uploaded), 1)) : g("", !0),
|
|
1157
|
+
t.transfers && t.provider.download && x.value && !x.value.isDir && !e(c) ? (l(), b(e(V), {
|
|
1142
1158
|
key: 2,
|
|
1143
1159
|
variant: "secondary",
|
|
1144
1160
|
disabled: e(r),
|
|
1145
|
-
onClick:
|
|
1161
|
+
onClick: Y
|
|
1146
1162
|
}, {
|
|
1147
1163
|
default: n(() => [
|
|
1148
1164
|
h(s(i.value.download), 1)
|
|
1149
1165
|
]),
|
|
1150
1166
|
_: 1
|
|
1151
1167
|
}, 8, ["disabled"])) : g("", !0),
|
|
1152
|
-
e(c) ? (l(), b(e(
|
|
1168
|
+
e(c) ? (l(), b(e(j), {
|
|
1153
1169
|
key: 3,
|
|
1154
1170
|
tone: "danger"
|
|
1155
1171
|
}, {
|
|
1156
1172
|
default: n(() => [
|
|
1157
|
-
|
|
1173
|
+
S("span", ml, s(e(Sa)(e(c), i.value, t.locale, t.name)), 1)
|
|
1158
1174
|
]),
|
|
1159
1175
|
_: 1
|
|
1160
1176
|
})) : g("", !0),
|
|
1161
|
-
e(r) ? (l(), $("p",
|
|
1162
|
-
|
|
1163
|
-
|
|
1177
|
+
e(r) ? (l(), $("p", yl, s(i.value.loading), 1)) : g("", !0),
|
|
1178
|
+
S("div", bl, [
|
|
1179
|
+
S("aside", {
|
|
1164
1180
|
class: "file-tree",
|
|
1165
1181
|
"aria-label": i.value.roots
|
|
1166
1182
|
}, [
|
|
1167
1183
|
d.value.length ? (l(), b(e(pt), {
|
|
1168
1184
|
key: T.value,
|
|
1169
1185
|
"selection-style": "background",
|
|
1170
|
-
modelValue:
|
|
1171
|
-
"onUpdate:modelValue": U[4] || (U[4] = (
|
|
1186
|
+
modelValue: E.value,
|
|
1187
|
+
"onUpdate:modelValue": U[4] || (U[4] = (O) => E.value = O),
|
|
1172
1188
|
nodes: d.value,
|
|
1173
|
-
"onUpdate:nodes": U[5] || (U[5] = (
|
|
1174
|
-
expanded:
|
|
1175
|
-
"onUpdate:expanded": U[6] || (U[6] = (
|
|
1189
|
+
"onUpdate:nodes": U[5] || (U[5] = (O) => d.value = O),
|
|
1190
|
+
expanded: C.value,
|
|
1191
|
+
"onUpdate:expanded": U[6] || (U[6] = (O) => C.value = O),
|
|
1176
1192
|
"load-children": X,
|
|
1177
|
-
"expand-label": (
|
|
1178
|
-
onSelect: U[7] || (U[7] = (
|
|
1193
|
+
"expand-label": (O, Z) => e(Je)(Z ? i.value.collapse : i.value.expand, { name: O.label }),
|
|
1194
|
+
onSelect: U[7] || (U[7] = (O) => ie(H(d.value, O.id) ?? [O.data]))
|
|
1179
1195
|
}, null, 8, ["modelValue", "nodes", "expanded", "expand-label"])) : g("", !0)
|
|
1180
|
-
], 8,
|
|
1181
|
-
|
|
1196
|
+
], 8, gl),
|
|
1197
|
+
S("div", hl, [
|
|
1182
1198
|
e(c) ? g("", !0) : (l(), b(e(mt), {
|
|
1183
1199
|
key: 0,
|
|
1184
|
-
columns:
|
|
1185
|
-
rows:
|
|
1200
|
+
columns: K.value,
|
|
1201
|
+
rows: m.value.map((O) => ({ ...O, kind: O.isDir ? i.value.directoryKind : i.value.fileKind })),
|
|
1186
1202
|
"row-key": "path",
|
|
1187
1203
|
footer: !1,
|
|
1188
1204
|
resizable: !1,
|
|
@@ -1193,46 +1209,46 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1193
1209
|
sort: { key: k.value.key === "size" ? "bytes" : k.value.key, direction: k.value.direction },
|
|
1194
1210
|
labels: { empty: i.value.emptyFolder },
|
|
1195
1211
|
"single-select": "",
|
|
1196
|
-
"selected-keys":
|
|
1212
|
+
"selected-keys": P.value ? [P.value] : [],
|
|
1197
1213
|
"onUpdate:sort": ye,
|
|
1198
|
-
"onUpdate:selectedKeys": U[8] || (U[8] = (
|
|
1199
|
-
e(r) ||
|
|
1214
|
+
"onUpdate:selectedKeys": U[8] || (U[8] = (O) => {
|
|
1215
|
+
e(r) || q(se(O[0]));
|
|
1200
1216
|
}),
|
|
1201
|
-
onRowActivate: U[9] || (U[9] = (
|
|
1202
|
-
e(r) || M(
|
|
1217
|
+
onRowActivate: U[9] || (U[9] = (O) => {
|
|
1218
|
+
e(r) || M(se(O.path));
|
|
1203
1219
|
}),
|
|
1204
|
-
onRowDblclick: U[10] || (U[10] = (
|
|
1205
|
-
e(r) || M(
|
|
1220
|
+
onRowDblclick: U[10] || (U[10] = (O) => {
|
|
1221
|
+
e(r) || M(se(O.path));
|
|
1206
1222
|
})
|
|
1207
1223
|
}, {
|
|
1208
|
-
"cell-name": n(({ row:
|
|
1209
|
-
|
|
1224
|
+
"cell-name": n(({ row: O }) => [
|
|
1225
|
+
S("span", kl, [
|
|
1210
1226
|
v(e(la), {
|
|
1211
|
-
kind:
|
|
1212
|
-
name:
|
|
1227
|
+
kind: O.isDir ? "folder" : "file",
|
|
1228
|
+
name: O.name
|
|
1213
1229
|
}, null, 8, ["kind", "name"]),
|
|
1214
|
-
h(s(
|
|
1230
|
+
h(s(O.name), 1)
|
|
1215
1231
|
])
|
|
1216
1232
|
]),
|
|
1217
1233
|
empty: n(() => [
|
|
1218
|
-
|
|
1234
|
+
S("div", wl, [
|
|
1219
1235
|
v(e(la), {
|
|
1220
1236
|
kind: "folder",
|
|
1221
1237
|
size: [40, 40]
|
|
1222
1238
|
}),
|
|
1223
|
-
|
|
1239
|
+
S("span", null, s(i.value.emptyFolder), 1)
|
|
1224
1240
|
])
|
|
1225
1241
|
]),
|
|
1226
|
-
"cell-bytes": n(({ row:
|
|
1227
|
-
|
|
1242
|
+
"cell-bytes": n(({ row: O }) => [
|
|
1243
|
+
S("span", _l, s(O.isDir || O.bytes === void 0 ? "—" : e(ra)(O.bytes, e(va)(t.locale))), 1)
|
|
1228
1244
|
]),
|
|
1229
1245
|
_: 1
|
|
1230
1246
|
}, 8, ["columns", "rows", "loading", "loading-text", "sort", "labels", "selected-keys"])),
|
|
1231
|
-
|
|
1247
|
+
w.value !== void 0 && !e(c) ? (l(), b(e(V), {
|
|
1232
1248
|
key: 1,
|
|
1233
1249
|
variant: "secondary",
|
|
1234
1250
|
disabled: e(r),
|
|
1235
|
-
onClick: U[11] || (U[11] = (
|
|
1251
|
+
onClick: U[11] || (U[11] = (O) => Q(f.value, !0))
|
|
1236
1252
|
}, {
|
|
1237
1253
|
default: n(() => [
|
|
1238
1254
|
h(s(i.value.loadMore), 1)
|
|
@@ -1241,13 +1257,13 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1241
1257
|
}, 8, ["disabled"])) : g("", !0)
|
|
1242
1258
|
])
|
|
1243
1259
|
]),
|
|
1244
|
-
|
|
1245
|
-
], 8,
|
|
1260
|
+
x.value && !e(c) ? (l(), $("p", xl, s(e(Je)(i.value.selected, { name: x.value.path })), 1)) : g("", !0)
|
|
1261
|
+
], 8, dl));
|
|
1246
1262
|
}
|
|
1247
|
-
}), Ma = /* @__PURE__ */ me(
|
|
1263
|
+
}), Ma = /* @__PURE__ */ me(Cl, [["__scopeId", "data-v-f4863cea"]]), $l = {
|
|
1248
1264
|
key: 0,
|
|
1249
1265
|
class: "save-consent"
|
|
1250
|
-
},
|
|
1266
|
+
}, Sl = ["aria-busy", "inert"], Pl = /* @__PURE__ */ fe({
|
|
1251
1267
|
__name: "NasPicker",
|
|
1252
1268
|
props: {
|
|
1253
1269
|
open: { type: Boolean },
|
|
@@ -1261,64 +1277,64 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1261
1277
|
errorText: { type: Function }
|
|
1262
1278
|
},
|
|
1263
1279
|
emits: ["update:open", "selected", "authorized", "refused"],
|
|
1264
|
-
setup(t, { emit:
|
|
1265
|
-
const o = t, a =
|
|
1266
|
-
let d = 0,
|
|
1267
|
-
|
|
1268
|
-
d++, i.value = void 0,
|
|
1269
|
-
}),
|
|
1270
|
-
|
|
1280
|
+
setup(t, { emit: p }) {
|
|
1281
|
+
const o = t, a = p, i = y(), u = _(() => Te(o.locale)), r = _(() => fa(o.locale)), c = y(!1), m = y();
|
|
1282
|
+
let d = 0, f = !1;
|
|
1283
|
+
Oe(() => o.open, () => {
|
|
1284
|
+
d++, i.value = void 0, m.value = void 0;
|
|
1285
|
+
}), we(() => {
|
|
1286
|
+
f = !0, d++;
|
|
1271
1287
|
});
|
|
1272
|
-
function
|
|
1288
|
+
function x() {
|
|
1273
1289
|
c.value || (i.value = void 0, a("update:open", !1));
|
|
1274
1290
|
}
|
|
1275
|
-
async function
|
|
1276
|
-
const
|
|
1277
|
-
if (!(!
|
|
1278
|
-
if (!
|
|
1279
|
-
a("selected",
|
|
1291
|
+
async function P() {
|
|
1292
|
+
const w = i.value, C = o.destination, E = d;
|
|
1293
|
+
if (!(!w || c.value || !o.open || f || C && o.mode !== "folder")) {
|
|
1294
|
+
if (!C) {
|
|
1295
|
+
a("selected", w), x();
|
|
1280
1296
|
return;
|
|
1281
1297
|
}
|
|
1282
|
-
c.value = !0,
|
|
1298
|
+
c.value = !0, m.value = void 0;
|
|
1283
1299
|
try {
|
|
1284
|
-
const k = await
|
|
1285
|
-
if (
|
|
1286
|
-
if (!k || typeof k.id != "string" || !k.id || typeof k.username != "string" || !k.username || k.path !==
|
|
1287
|
-
a("authorized", k), c.value = !1,
|
|
1300
|
+
const k = await C.selectDestination({ key: C.key, path: w });
|
|
1301
|
+
if (f || E !== d) return;
|
|
1302
|
+
if (!k || typeof k.id != "string" || !k.id || typeof k.username != "string" || !k.username || k.path !== w || k.key !== C.key || k.lifetime !== "until-revoked") throw { code: "commit-uncertain" };
|
|
1303
|
+
a("authorized", k), c.value = !1, x();
|
|
1288
1304
|
} catch (k) {
|
|
1289
|
-
if (
|
|
1305
|
+
if (f || E !== d) return;
|
|
1290
1306
|
if (k?.code === "APP_DENIED") {
|
|
1291
|
-
c.value = !1, a("refused", k),
|
|
1307
|
+
c.value = !1, a("refused", k), x();
|
|
1292
1308
|
return;
|
|
1293
1309
|
}
|
|
1294
|
-
|
|
1310
|
+
m.value = k;
|
|
1295
1311
|
} finally {
|
|
1296
|
-
|
|
1312
|
+
f || (c.value = !1);
|
|
1297
1313
|
}
|
|
1298
1314
|
}
|
|
1299
1315
|
}
|
|
1300
|
-
return (
|
|
1316
|
+
return (w, C) => (l(), b(e(Ge), {
|
|
1301
1317
|
open: t.open,
|
|
1302
1318
|
title: t.title ?? (t.mode === "folder" ? u.value.choose : u.value.chooseFile),
|
|
1303
1319
|
description: t.description ?? u.value.ownPermissions,
|
|
1304
1320
|
"close-label": u.value.close,
|
|
1305
1321
|
"show-close": !c.value,
|
|
1306
1322
|
width: "800px",
|
|
1307
|
-
onEscapeKeyDown:
|
|
1308
|
-
c.value &&
|
|
1323
|
+
onEscapeKeyDown: C[1] || (C[1] = (E) => {
|
|
1324
|
+
c.value && E.preventDefault();
|
|
1309
1325
|
}),
|
|
1310
|
-
onInteractOutside:
|
|
1311
|
-
c.value &&
|
|
1326
|
+
onInteractOutside: C[2] || (C[2] = (E) => {
|
|
1327
|
+
c.value && E.preventDefault();
|
|
1312
1328
|
}),
|
|
1313
|
-
"onUpdate:open":
|
|
1314
|
-
|
|
1329
|
+
"onUpdate:open": C[3] || (C[3] = (E) => {
|
|
1330
|
+
E || x();
|
|
1315
1331
|
})
|
|
1316
1332
|
}, {
|
|
1317
1333
|
footer: n(() => [
|
|
1318
1334
|
v(e(V), {
|
|
1319
1335
|
variant: "secondary",
|
|
1320
1336
|
disabled: c.value,
|
|
1321
|
-
onClick:
|
|
1337
|
+
onClick: x
|
|
1322
1338
|
}, {
|
|
1323
1339
|
default: n(() => [
|
|
1324
1340
|
h(s(u.value.cancel), 1)
|
|
@@ -1328,7 +1344,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1328
1344
|
v(e(V), {
|
|
1329
1345
|
variant: "primary",
|
|
1330
1346
|
disabled: !i.value || c.value || !!t.destination && t.mode !== "folder",
|
|
1331
|
-
onClick:
|
|
1347
|
+
onClick: P
|
|
1332
1348
|
}, {
|
|
1333
1349
|
default: n(() => [
|
|
1334
1350
|
h(s(u.value.confirm), 1)
|
|
@@ -1337,19 +1353,19 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1337
1353
|
}, 8, ["disabled"])
|
|
1338
1354
|
]),
|
|
1339
1355
|
default: n(() => [
|
|
1340
|
-
t.destination ? (l(), $("p",
|
|
1341
|
-
|
|
1356
|
+
t.destination ? (l(), $("p", $l, s(r.value.selection), 1)) : g("", !0),
|
|
1357
|
+
m.value ? (l(), b(e(j), {
|
|
1342
1358
|
key: 1,
|
|
1343
1359
|
tone: "danger",
|
|
1344
1360
|
role: "alert",
|
|
1345
1361
|
class: "save-message"
|
|
1346
1362
|
}, {
|
|
1347
1363
|
default: n(() => [
|
|
1348
|
-
h(s(t.errorText?.(
|
|
1364
|
+
h(s(t.errorText?.(m.value) ?? e(Ye)(m.value, r.value, "select", t.locale, t.name)), 1)
|
|
1349
1365
|
]),
|
|
1350
1366
|
_: 1
|
|
1351
1367
|
})) : g("", !0),
|
|
1352
|
-
|
|
1368
|
+
S("div", {
|
|
1353
1369
|
class: "nas-picker-content",
|
|
1354
1370
|
"aria-busy": c.value,
|
|
1355
1371
|
inert: c.value
|
|
@@ -1360,44 +1376,44 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1360
1376
|
locale: t.locale,
|
|
1361
1377
|
name: t.name,
|
|
1362
1378
|
mode: t.mode,
|
|
1363
|
-
onSelected:
|
|
1379
|
+
onSelected: C[0] || (C[0] = (E) => i.value = E)
|
|
1364
1380
|
}, null, 8, ["provider", "locale", "name", "mode"])) : g("", !0)
|
|
1365
|
-
], 8,
|
|
1381
|
+
], 8, Sl)
|
|
1366
1382
|
]),
|
|
1367
1383
|
_: 1
|
|
1368
1384
|
}, 8, ["open", "title", "description", "close-label", "show-close"]));
|
|
1369
1385
|
}
|
|
1370
|
-
}), ta = /* @__PURE__ */ me(
|
|
1386
|
+
}), ta = /* @__PURE__ */ me(Pl, [["__scopeId", "data-v-08be5e1e"]]), El = { role: "alert" }, Tl = { class: "files-actions" }, zl = {
|
|
1371
1387
|
key: 0,
|
|
1372
1388
|
class: "files-path",
|
|
1373
1389
|
role: "status"
|
|
1374
|
-
},
|
|
1390
|
+
}, Al = /* @__PURE__ */ fe({
|
|
1375
1391
|
__name: "FilesPage",
|
|
1376
1392
|
props: {
|
|
1377
1393
|
ctx: {}
|
|
1378
1394
|
},
|
|
1379
1395
|
setup(t) {
|
|
1380
|
-
const
|
|
1381
|
-
let
|
|
1382
|
-
async function
|
|
1383
|
-
if (!
|
|
1384
|
-
o.value = void 0, i.value = !1, c.value = "", r.value = !1,
|
|
1396
|
+
const p = t, o = y(), a = y(), i = y(!1), u = y("folder"), r = y(!1), c = y(""), m = y(0), d = Pa(p.ctx);
|
|
1397
|
+
let f = !1, x;
|
|
1398
|
+
async function P() {
|
|
1399
|
+
if (!f) {
|
|
1400
|
+
o.value = void 0, i.value = !1, c.value = "", r.value = !1, m.value++;
|
|
1385
1401
|
try {
|
|
1386
|
-
await
|
|
1387
|
-
} catch (
|
|
1388
|
-
if (
|
|
1389
|
-
a.value = Ce(
|
|
1402
|
+
await p.ctx.call("nas.session.status"), f || (a.value = void 0, i.value = !0);
|
|
1403
|
+
} catch (w) {
|
|
1404
|
+
if (f) return;
|
|
1405
|
+
a.value = Ce(w), !a.value && w?.code !== "unknown_method" && (o.value = w);
|
|
1390
1406
|
}
|
|
1391
1407
|
}
|
|
1392
1408
|
}
|
|
1393
|
-
return Ke(() => a.value,
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
}),
|
|
1397
|
-
}),
|
|
1398
|
-
|
|
1399
|
-
}), (
|
|
1400
|
-
a.value ? (l(), b(e(
|
|
1409
|
+
return Ke(() => a.value, P), Se(() => {
|
|
1410
|
+
x = p.ctx.reopen(() => {
|
|
1411
|
+
P();
|
|
1412
|
+
}), P();
|
|
1413
|
+
}), we(() => {
|
|
1414
|
+
f = !0, x?.(), d.dispose();
|
|
1415
|
+
}), (w, C) => (l(), $(oe, null, [
|
|
1416
|
+
a.value ? (l(), b(e(j), {
|
|
1401
1417
|
key: 0,
|
|
1402
1418
|
tone: "info",
|
|
1403
1419
|
role: "status"
|
|
@@ -1407,15 +1423,15 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1407
1423
|
]),
|
|
1408
1424
|
_: 1
|
|
1409
1425
|
})) : g("", !0),
|
|
1410
|
-
o.value ? (l(), b(e(
|
|
1426
|
+
o.value ? (l(), b(e(j), {
|
|
1411
1427
|
key: 1,
|
|
1412
1428
|
tone: "danger"
|
|
1413
1429
|
}, {
|
|
1414
1430
|
default: n(() => [
|
|
1415
|
-
|
|
1431
|
+
S("span", El, s(e(Sa)(o.value, e(Te)(t.ctx.locale), t.ctx.locale, t.ctx.displayName)), 1),
|
|
1416
1432
|
v(e(V), {
|
|
1417
1433
|
variant: "secondary",
|
|
1418
|
-
onClick:
|
|
1434
|
+
onClick: P
|
|
1419
1435
|
}, {
|
|
1420
1436
|
default: n(() => [
|
|
1421
1437
|
h(s(e(Te)(t.ctx.locale).refresh), 1)
|
|
@@ -1425,17 +1441,17 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1425
1441
|
]),
|
|
1426
1442
|
_: 1
|
|
1427
1443
|
})) : g("", !0),
|
|
1428
|
-
i.value ? (l(), b(e(
|
|
1444
|
+
i.value ? (l(), b(e(ke), {
|
|
1429
1445
|
key: 2,
|
|
1430
1446
|
title: e(Te)(t.ctx.locale).title,
|
|
1431
1447
|
description: e(Te)(t.ctx.locale).ownPermissions,
|
|
1432
1448
|
collapsible: !1
|
|
1433
1449
|
}, {
|
|
1434
1450
|
default: n(() => [
|
|
1435
|
-
|
|
1451
|
+
S("div", Tl, [
|
|
1436
1452
|
v(e(V), {
|
|
1437
1453
|
variant: "secondary",
|
|
1438
|
-
onClick:
|
|
1454
|
+
onClick: C[0] || (C[0] = (E) => {
|
|
1439
1455
|
u.value = "folder", r.value = !0;
|
|
1440
1456
|
})
|
|
1441
1457
|
}, {
|
|
@@ -1446,7 +1462,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1446
1462
|
}),
|
|
1447
1463
|
v(e(V), {
|
|
1448
1464
|
variant: "secondary",
|
|
1449
|
-
onClick:
|
|
1465
|
+
onClick: C[1] || (C[1] = (E) => {
|
|
1450
1466
|
u.value = "file", r.value = !0;
|
|
1451
1467
|
})
|
|
1452
1468
|
}, {
|
|
@@ -1456,11 +1472,11 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1456
1472
|
_: 1
|
|
1457
1473
|
})
|
|
1458
1474
|
]),
|
|
1459
|
-
c.value ? (l(), $("p",
|
|
1475
|
+
c.value ? (l(), $("p", zl, [
|
|
1460
1476
|
v(e(Ue), { path: c.value }, null, 8, ["path"])
|
|
1461
1477
|
])) : g("", !0),
|
|
1462
1478
|
(l(), b(Ma, {
|
|
1463
|
-
key:
|
|
1479
|
+
key: m.value,
|
|
1464
1480
|
provider: e(d),
|
|
1465
1481
|
locale: t.ctx.locale,
|
|
1466
1482
|
name: t.ctx.displayName,
|
|
@@ -1472,101 +1488,101 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1472
1488
|
name: t.ctx.displayName,
|
|
1473
1489
|
mode: u.value,
|
|
1474
1490
|
open: r.value,
|
|
1475
|
-
"onUpdate:open":
|
|
1476
|
-
onSelected:
|
|
1491
|
+
"onUpdate:open": C[2] || (C[2] = (E) => r.value = E),
|
|
1492
|
+
onSelected: C[3] || (C[3] = (E) => c.value = E)
|
|
1477
1493
|
}, null, 8, ["provider", "locale", "name", "mode", "open"])
|
|
1478
1494
|
]),
|
|
1479
1495
|
_: 1
|
|
1480
1496
|
}, 8, ["title", "description"])) : g("", !0)
|
|
1481
1497
|
], 64));
|
|
1482
1498
|
}
|
|
1483
|
-
}),
|
|
1499
|
+
}), vo = /* @__PURE__ */ me(Al, [["__scopeId", "data-v-a8fc5aa4"]]), Rl = { role: "status" }, Il = { role: "alert" }, oa = /* @__PURE__ */ new WeakMap(), fo = /* @__PURE__ */ fe({
|
|
1484
1500
|
__name: "PortalSettings",
|
|
1485
1501
|
props: {
|
|
1486
1502
|
portal: {}
|
|
1487
1503
|
},
|
|
1488
1504
|
setup(t) {
|
|
1489
|
-
const
|
|
1490
|
-
let
|
|
1491
|
-
function
|
|
1492
|
-
if (!
|
|
1505
|
+
const p = t, o = Va(), a = p.portal.messages, i = y(), u = y(""), r = y(!1), c = y(""), m = y(!0), d = y(!1), f = y(oa.get(p.portal));
|
|
1506
|
+
let x = !1, P = !1;
|
|
1507
|
+
function w(R) {
|
|
1508
|
+
if (!P && (i.value = R, u.value = R.alias || R.defaultAlias, R.url))
|
|
1493
1509
|
try {
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1510
|
+
const A = new URL(R.url);
|
|
1511
|
+
x ||= A.origin === window.location.origin && window.location.pathname.startsWith(A.pathname);
|
|
1496
1512
|
} catch {
|
|
1497
1513
|
}
|
|
1498
1514
|
}
|
|
1499
|
-
const
|
|
1500
|
-
|
|
1501
|
-
const
|
|
1502
|
-
async function T(
|
|
1515
|
+
const C = p.portal.lastStatus?.();
|
|
1516
|
+
C && w(C);
|
|
1517
|
+
const E = 5e3, k = /* @__PURE__ */ Symbol("late");
|
|
1518
|
+
async function T(R) {
|
|
1503
1519
|
if (r.value) return;
|
|
1504
1520
|
r.value = !0, c.value = "";
|
|
1505
|
-
const
|
|
1521
|
+
const A = R();
|
|
1506
1522
|
try {
|
|
1507
|
-
const
|
|
1508
|
-
if (
|
|
1509
|
-
|
|
1523
|
+
const q = await Promise.race([A, new Promise((M) => setTimeout(() => M(k), E))]);
|
|
1524
|
+
if (q !== k) {
|
|
1525
|
+
w(q);
|
|
1510
1526
|
return;
|
|
1511
1527
|
}
|
|
1512
|
-
|
|
1528
|
+
w(await p.portal.status());
|
|
1513
1529
|
try {
|
|
1514
|
-
await
|
|
1530
|
+
await A;
|
|
1515
1531
|
} finally {
|
|
1516
|
-
|
|
1532
|
+
w(await p.portal.status());
|
|
1517
1533
|
}
|
|
1518
|
-
} catch (
|
|
1519
|
-
|
|
1534
|
+
} catch (q) {
|
|
1535
|
+
P || (c.value = a[q?.code || ""] || a.portal_unavailable);
|
|
1520
1536
|
} finally {
|
|
1521
|
-
|
|
1537
|
+
P || (r.value = !1);
|
|
1522
1538
|
}
|
|
1523
1539
|
}
|
|
1524
|
-
const
|
|
1525
|
-
const
|
|
1526
|
-
if (
|
|
1527
|
-
if (
|
|
1528
|
-
if (
|
|
1529
|
-
return
|
|
1540
|
+
const N = _(() => !!i.value?.canManage && !!i.value.entry && i.value.entry !== "registered"), te = _(() => {
|
|
1541
|
+
const R = i.value;
|
|
1542
|
+
if (R) {
|
|
1543
|
+
if (N.value) return R.entry === "unregistered" ? a.entryOff : a.cleanupRequired;
|
|
1544
|
+
if (R.state !== "active")
|
|
1545
|
+
return R.canManage ? a.inactive : R.controlPanel ? void 0 : a.askAdmin;
|
|
1530
1546
|
}
|
|
1531
|
-
}),
|
|
1532
|
-
async function
|
|
1533
|
-
const
|
|
1534
|
-
return
|
|
1547
|
+
}), F = a.link?.replace(/\s*[::]\s*$/, "");
|
|
1548
|
+
async function Y() {
|
|
1549
|
+
const R = await p.portal.register();
|
|
1550
|
+
return R.canManage && R.entry === "registered" && R.state === "inactive" ? (w(R), p.portal.apply(R.alias || R.defaultAlias)) : R;
|
|
1535
1551
|
}
|
|
1536
|
-
function
|
|
1537
|
-
!r.value && !
|
|
1552
|
+
function B() {
|
|
1553
|
+
!r.value && !f.value && p.portal.status().then(w, () => {
|
|
1538
1554
|
}).finally(() => {
|
|
1539
|
-
|
|
1555
|
+
P || (m.value = !1);
|
|
1540
1556
|
});
|
|
1541
1557
|
}
|
|
1542
|
-
function
|
|
1543
|
-
|
|
1558
|
+
function K() {
|
|
1559
|
+
x ? d.value = !0 : T(() => p.portal.unregister());
|
|
1544
1560
|
}
|
|
1545
|
-
async function
|
|
1561
|
+
async function L() {
|
|
1546
1562
|
if (d.value = !1, !r.value) {
|
|
1547
|
-
r.value = !0,
|
|
1563
|
+
r.value = !0, f.value = "removalUnconfirmed", oa.set(p.portal, f.value);
|
|
1548
1564
|
try {
|
|
1549
|
-
await
|
|
1565
|
+
await p.portal.unregister(), f.value = "removedFromPage", oa.set(p.portal, f.value);
|
|
1550
1566
|
} catch {
|
|
1551
1567
|
} finally {
|
|
1552
|
-
|
|
1568
|
+
P || (r.value = !1);
|
|
1553
1569
|
}
|
|
1554
1570
|
}
|
|
1555
1571
|
}
|
|
1556
1572
|
return Se(() => {
|
|
1557
|
-
o.subscribe?.(
|
|
1558
|
-
}),
|
|
1559
|
-
|
|
1560
|
-
}), (
|
|
1561
|
-
|
|
1573
|
+
o.subscribe?.(B), B();
|
|
1574
|
+
}), we(() => {
|
|
1575
|
+
P = !0;
|
|
1576
|
+
}), (R, A) => (l(), $(oe, null, [
|
|
1577
|
+
f.value ? (l(), b(e(ke), {
|
|
1562
1578
|
key: 0,
|
|
1563
1579
|
title: e(a).title,
|
|
1564
1580
|
collapsible: !1
|
|
1565
1581
|
}, {
|
|
1566
1582
|
default: n(() => [
|
|
1567
|
-
v(e(
|
|
1583
|
+
v(e(j), { tone: "info" }, {
|
|
1568
1584
|
default: n(() => [
|
|
1569
|
-
|
|
1585
|
+
S("span", Rl, s(e(a)[f.value]), 1)
|
|
1570
1586
|
]),
|
|
1571
1587
|
_: 1
|
|
1572
1588
|
}),
|
|
@@ -1581,7 +1597,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1581
1597
|
})
|
|
1582
1598
|
]),
|
|
1583
1599
|
_: 1
|
|
1584
|
-
}, 8, ["title"])) : i.value ||
|
|
1600
|
+
}, 8, ["title"])) : i.value || m.value ? (l(), b(e(ke), {
|
|
1585
1601
|
key: 1,
|
|
1586
1602
|
title: e(a).title,
|
|
1587
1603
|
description: te.value,
|
|
@@ -1589,10 +1605,10 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1589
1605
|
"aria-busy": r.value || !i.value
|
|
1590
1606
|
}, za({
|
|
1591
1607
|
default: n(() => [
|
|
1592
|
-
i.value ? (l(), $(
|
|
1593
|
-
i.value.state === "active" ? (l(), b(e(
|
|
1608
|
+
i.value ? (l(), $(oe, { key: 1 }, [
|
|
1609
|
+
i.value.state === "active" ? (l(), b(e(xe), {
|
|
1594
1610
|
key: 0,
|
|
1595
|
-
label: e(
|
|
1611
|
+
label: e(F)
|
|
1596
1612
|
}, {
|
|
1597
1613
|
default: n(() => [
|
|
1598
1614
|
v(e(ua), {
|
|
@@ -1607,19 +1623,19 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1607
1623
|
]),
|
|
1608
1624
|
_: 1
|
|
1609
1625
|
}, 8, ["label"])) : g("", !0),
|
|
1610
|
-
i.value.canManage && !
|
|
1626
|
+
i.value.canManage && !N.value ? (l(), b(e(Me), {
|
|
1611
1627
|
key: 1,
|
|
1612
|
-
onSubmit:
|
|
1628
|
+
onSubmit: A[3] || (A[3] = qe((q) => T(() => t.portal.apply(u.value)), ["prevent"]))
|
|
1613
1629
|
}, {
|
|
1614
1630
|
default: n(() => [
|
|
1615
|
-
v(e(
|
|
1631
|
+
v(e(xe), {
|
|
1616
1632
|
label: e(a).alias
|
|
1617
1633
|
}, {
|
|
1618
1634
|
default: n(() => [
|
|
1619
1635
|
v(e(ze), {
|
|
1620
1636
|
id: "portal-alias",
|
|
1621
1637
|
modelValue: u.value,
|
|
1622
|
-
"onUpdate:modelValue":
|
|
1638
|
+
"onUpdate:modelValue": A[0] || (A[0] = (q) => u.value = q),
|
|
1623
1639
|
"aria-label": e(a).alias,
|
|
1624
1640
|
maxlength: "64",
|
|
1625
1641
|
autocomplete: "off",
|
|
@@ -1628,7 +1644,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1628
1644
|
]),
|
|
1629
1645
|
_: 1
|
|
1630
1646
|
}, 8, ["label"]),
|
|
1631
|
-
v(e(
|
|
1647
|
+
v(e(xe), {
|
|
1632
1648
|
label: "",
|
|
1633
1649
|
"field-width": "full"
|
|
1634
1650
|
}, {
|
|
@@ -1649,7 +1665,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1649
1665
|
key: 0,
|
|
1650
1666
|
variant: "secondary",
|
|
1651
1667
|
disabled: r.value,
|
|
1652
|
-
onClick:
|
|
1668
|
+
onClick: A[1] || (A[1] = (q) => T(() => t.portal.disable()))
|
|
1653
1669
|
}, {
|
|
1654
1670
|
default: n(() => [
|
|
1655
1671
|
h(s(e(a).disable), 1)
|
|
@@ -1658,7 +1674,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1658
1674
|
}, 8, ["disabled"])) : g("", !0),
|
|
1659
1675
|
v(e(V), {
|
|
1660
1676
|
variant: "secondary",
|
|
1661
|
-
onClick:
|
|
1677
|
+
onClick: A[2] || (A[2] = (q) => t.portal.openControlPanel())
|
|
1662
1678
|
}, {
|
|
1663
1679
|
default: n(() => [
|
|
1664
1680
|
h(s(e(a).advanced), 1)
|
|
@@ -1669,7 +1685,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1669
1685
|
key: 1,
|
|
1670
1686
|
variant: "secondary",
|
|
1671
1687
|
disabled: r.value,
|
|
1672
|
-
onClick:
|
|
1688
|
+
onClick: K
|
|
1673
1689
|
}, {
|
|
1674
1690
|
default: n(() => [
|
|
1675
1691
|
h(s(e(a).unregister), 1)
|
|
@@ -1685,22 +1701,22 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1685
1701
|
]),
|
|
1686
1702
|
_: 1
|
|
1687
1703
|
})) : g("", !0),
|
|
1688
|
-
c.value ? (l(), b(e(
|
|
1704
|
+
c.value ? (l(), b(e(j), {
|
|
1689
1705
|
key: 2,
|
|
1690
1706
|
tone: "danger"
|
|
1691
1707
|
}, {
|
|
1692
1708
|
default: n(() => [
|
|
1693
|
-
|
|
1709
|
+
S("span", Il, s(c.value), 1)
|
|
1694
1710
|
]),
|
|
1695
1711
|
_: 1
|
|
1696
1712
|
})) : g("", !0)
|
|
1697
|
-
], 64)) : (l(!0), $(
|
|
1698
|
-
key:
|
|
1699
|
-
label:
|
|
1713
|
+
], 64)) : (l(!0), $(oe, { key: 0 }, ge([[e(F), "20px"], [e(a).alias, "32px"], ["", "32px"]], ([q, M], se) => (l(), b(e(xe), {
|
|
1714
|
+
key: se,
|
|
1715
|
+
label: q,
|
|
1700
1716
|
"data-placeholder-row": ""
|
|
1701
1717
|
}, {
|
|
1702
1718
|
default: n(() => [
|
|
1703
|
-
v(e(
|
|
1719
|
+
v(e(Fe), {
|
|
1704
1720
|
width: "16rem",
|
|
1705
1721
|
height: M
|
|
1706
1722
|
}, null, 8, ["height"])
|
|
@@ -1710,14 +1726,14 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1710
1726
|
]),
|
|
1711
1727
|
_: 2
|
|
1712
1728
|
}, [
|
|
1713
|
-
i.value &&
|
|
1729
|
+
i.value && N.value ? {
|
|
1714
1730
|
name: "footer",
|
|
1715
1731
|
fn: n(() => [
|
|
1716
1732
|
i.value.entry === "unregistered" ? (l(), b(e(V), {
|
|
1717
1733
|
key: 0,
|
|
1718
1734
|
variant: "primary",
|
|
1719
1735
|
disabled: r.value,
|
|
1720
|
-
onClick:
|
|
1736
|
+
onClick: A[4] || (A[4] = (q) => T(Y))
|
|
1721
1737
|
}, {
|
|
1722
1738
|
default: n(() => [
|
|
1723
1739
|
h(s(e(a).register), 1)
|
|
@@ -1727,7 +1743,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1727
1743
|
key: 1,
|
|
1728
1744
|
variant: "primary",
|
|
1729
1745
|
disabled: r.value,
|
|
1730
|
-
onClick:
|
|
1746
|
+
onClick: K
|
|
1731
1747
|
}, {
|
|
1732
1748
|
default: n(() => [
|
|
1733
1749
|
h(s(e(a).unregister), 1)
|
|
@@ -1741,7 +1757,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1741
1757
|
fn: n(() => [
|
|
1742
1758
|
v(e(V), {
|
|
1743
1759
|
variant: "secondary",
|
|
1744
|
-
onClick:
|
|
1760
|
+
onClick: A[5] || (A[5] = (q) => t.portal.openControlPanel())
|
|
1745
1761
|
}, {
|
|
1746
1762
|
default: n(() => [
|
|
1747
1763
|
h(s(e(a).controlPanel), 1)
|
|
@@ -1754,16 +1770,15 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1754
1770
|
]), 1032, ["title", "description", "aria-busy"])) : g("", !0),
|
|
1755
1771
|
v(e(Ge), {
|
|
1756
1772
|
open: d.value,
|
|
1757
|
-
"onUpdate:open":
|
|
1773
|
+
"onUpdate:open": A[7] || (A[7] = (q) => d.value = q),
|
|
1758
1774
|
title: e(a).unregister,
|
|
1759
1775
|
description: e(a).removeFromPage,
|
|
1760
|
-
"close-label": e(a).cancel
|
|
1761
|
-
width: "480px"
|
|
1776
|
+
"close-label": e(a).cancel
|
|
1762
1777
|
}, {
|
|
1763
1778
|
footer: n(() => [
|
|
1764
1779
|
v(e(V), {
|
|
1765
1780
|
variant: "secondary",
|
|
1766
|
-
onClick:
|
|
1781
|
+
onClick: A[6] || (A[6] = (q) => d.value = !1)
|
|
1767
1782
|
}, {
|
|
1768
1783
|
default: n(() => [
|
|
1769
1784
|
h(s(e(a).cancel), 1)
|
|
@@ -1773,7 +1788,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1773
1788
|
v(e(V), {
|
|
1774
1789
|
variant: "danger",
|
|
1775
1790
|
disabled: r.value,
|
|
1776
|
-
onClick:
|
|
1791
|
+
onClick: L
|
|
1777
1792
|
}, {
|
|
1778
1793
|
default: n(() => [
|
|
1779
1794
|
h(s(e(a).unregister), 1)
|
|
@@ -1785,63 +1800,63 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1785
1800
|
}, 8, ["open", "title", "description", "close-label"])
|
|
1786
1801
|
], 64));
|
|
1787
1802
|
}
|
|
1788
|
-
}),
|
|
1803
|
+
}), Dl = ["aria-busy"], Ul = { role: "alert" }, Vl = {
|
|
1789
1804
|
key: 2,
|
|
1790
1805
|
role: "status"
|
|
1791
|
-
},
|
|
1806
|
+
}, Nl = { role: "alert" }, Bl = { role: "status" }, Ll = /* @__PURE__ */ fe({
|
|
1792
1807
|
__name: "LoginPage",
|
|
1793
1808
|
props: {
|
|
1794
1809
|
session: {},
|
|
1795
1810
|
locale: {}
|
|
1796
1811
|
},
|
|
1797
1812
|
setup(t) {
|
|
1798
|
-
const
|
|
1799
|
-
let
|
|
1800
|
-
function
|
|
1813
|
+
const p = t, o = _(() => Xa(p.locale)), a = y(""), i = y(""), u = y(""), r = y(!1), c = y(!1), m = y(""), d = y(), f = _(() => window.location.protocol === "https:");
|
|
1814
|
+
let x = !1;
|
|
1815
|
+
function P(k) {
|
|
1801
1816
|
const T = k?.code;
|
|
1802
|
-
return
|
|
1817
|
+
return p.session.denied.value?.message || o.value.errors[T || ""] || o.value.errors.failed;
|
|
1803
1818
|
}
|
|
1804
|
-
async function
|
|
1805
|
-
if (!(c.value || !
|
|
1806
|
-
c.value = !0,
|
|
1819
|
+
async function w() {
|
|
1820
|
+
if (!(c.value || !f.value || !a.value || !i.value || r.value && !u.value)) {
|
|
1821
|
+
c.value = !0, m.value = "";
|
|
1807
1822
|
try {
|
|
1808
|
-
await
|
|
1823
|
+
await p.session.login(a.value, i.value, u.value), i.value = "", u.value = "";
|
|
1809
1824
|
} catch (k) {
|
|
1810
|
-
if (
|
|
1811
|
-
u.value = "", k?.code === "otp_required" ? r.value = !0 : (
|
|
1825
|
+
if (x) return;
|
|
1826
|
+
u.value = "", k?.code === "otp_required" ? r.value = !0 : (m.value = P(k), i.value = "", r.value = !1);
|
|
1812
1827
|
} finally {
|
|
1813
|
-
|
|
1828
|
+
x || (c.value = !1, r.value && (await nt(), x || d.value?.querySelector("input")?.focus()));
|
|
1814
1829
|
}
|
|
1815
1830
|
}
|
|
1816
1831
|
}
|
|
1817
|
-
async function
|
|
1832
|
+
async function C() {
|
|
1818
1833
|
if (!c.value) {
|
|
1819
|
-
c.value = !0,
|
|
1834
|
+
c.value = !0, m.value = "";
|
|
1820
1835
|
try {
|
|
1821
|
-
await
|
|
1836
|
+
await p.session.bootstrap();
|
|
1822
1837
|
} catch (k) {
|
|
1823
|
-
|
|
1838
|
+
x || (m.value = P(k));
|
|
1824
1839
|
} finally {
|
|
1825
|
-
|
|
1840
|
+
x || (c.value = !1);
|
|
1826
1841
|
}
|
|
1827
1842
|
}
|
|
1828
1843
|
}
|
|
1829
|
-
function
|
|
1830
|
-
i.value = "", u.value = "", r.value = !1,
|
|
1844
|
+
function E() {
|
|
1845
|
+
i.value = "", u.value = "", r.value = !1, m.value = "";
|
|
1831
1846
|
}
|
|
1832
1847
|
return Ra(() => {
|
|
1833
|
-
|
|
1848
|
+
x = !0, i.value = "", u.value = "";
|
|
1834
1849
|
}), (k, T) => (l(), $("main", {
|
|
1835
1850
|
class: "identity-login",
|
|
1836
1851
|
"aria-busy": c.value
|
|
1837
1852
|
}, [
|
|
1838
|
-
v(e(
|
|
1853
|
+
v(e(ke), {
|
|
1839
1854
|
title: o.value.title,
|
|
1840
1855
|
description: o.value.intro,
|
|
1841
1856
|
collapsible: !1
|
|
1842
1857
|
}, {
|
|
1843
1858
|
default: n(() => [
|
|
1844
|
-
|
|
1859
|
+
f.value ? g("", !0) : (l(), b(e(j), {
|
|
1845
1860
|
key: 0,
|
|
1846
1861
|
tone: "warning",
|
|
1847
1862
|
title: o.value.httpsTitle
|
|
@@ -1851,28 +1866,28 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1851
1866
|
]),
|
|
1852
1867
|
_: 1
|
|
1853
1868
|
}, 8, ["title"])),
|
|
1854
|
-
t.session.denied.value ? (l(), b(e(
|
|
1869
|
+
t.session.denied.value ? (l(), b(e(j), {
|
|
1855
1870
|
key: 1,
|
|
1856
1871
|
tone: "danger"
|
|
1857
1872
|
}, {
|
|
1858
1873
|
default: n(() => [
|
|
1859
|
-
|
|
1874
|
+
S("span", Ul, s(t.session.denied.value.message), 1)
|
|
1860
1875
|
]),
|
|
1861
1876
|
_: 1
|
|
1862
|
-
})) : t.session.notice.value ? (l(), $("p",
|
|
1863
|
-
|
|
1877
|
+
})) : t.session.notice.value ? (l(), $("p", Vl, s(o.value.notices[t.session.notice.value]), 1)) : g("", !0),
|
|
1878
|
+
m.value && !t.session.denied.value ? (l(), b(e(j), {
|
|
1864
1879
|
key: 3,
|
|
1865
1880
|
tone: "danger",
|
|
1866
1881
|
title: o.value.failedTitle
|
|
1867
1882
|
}, {
|
|
1868
1883
|
default: n(() => [
|
|
1869
|
-
|
|
1884
|
+
S("span", Nl, s(m.value), 1)
|
|
1870
1885
|
]),
|
|
1871
1886
|
_: 1
|
|
1872
1887
|
}, 8, ["title"])) : g("", !0),
|
|
1873
1888
|
t.session.denied.value ? g("", !0) : (l(), b(e(Me), {
|
|
1874
1889
|
key: 4,
|
|
1875
|
-
onSubmit: qe(
|
|
1890
|
+
onSubmit: qe(w, ["prevent"])
|
|
1876
1891
|
}, {
|
|
1877
1892
|
default: n(() => [
|
|
1878
1893
|
v(e($e), {
|
|
@@ -1881,16 +1896,16 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1881
1896
|
default: n(() => [
|
|
1882
1897
|
v(e(ze), {
|
|
1883
1898
|
modelValue: a.value,
|
|
1884
|
-
"onUpdate:modelValue": T[0] || (T[0] = (
|
|
1899
|
+
"onUpdate:modelValue": T[0] || (T[0] = (N) => a.value = N),
|
|
1885
1900
|
autocomplete: "username",
|
|
1886
|
-
disabled: c.value || r.value || !
|
|
1901
|
+
disabled: c.value || r.value || !f.value
|
|
1887
1902
|
}, null, 8, ["modelValue", "disabled"])
|
|
1888
1903
|
]),
|
|
1889
1904
|
_: 1
|
|
1890
1905
|
}, 8, ["label"]),
|
|
1891
|
-
r.value ? (l(), $(
|
|
1892
|
-
|
|
1893
|
-
|
|
1906
|
+
r.value ? (l(), $(oe, { key: 1 }, [
|
|
1907
|
+
S("p", Bl, s(o.value.otpPrompt), 1),
|
|
1908
|
+
S("div", {
|
|
1894
1909
|
ref_key: "otpField",
|
|
1895
1910
|
ref: d
|
|
1896
1911
|
}, [
|
|
@@ -1900,7 +1915,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1900
1915
|
default: n(() => [
|
|
1901
1916
|
v(e(ze), {
|
|
1902
1917
|
modelValue: u.value,
|
|
1903
|
-
"onUpdate:modelValue": T[2] || (T[2] = (
|
|
1918
|
+
"onUpdate:modelValue": T[2] || (T[2] = (N) => u.value = N),
|
|
1904
1919
|
inputmode: "numeric",
|
|
1905
1920
|
autocomplete: "one-time-code",
|
|
1906
1921
|
disabled: c.value
|
|
@@ -1916,10 +1931,10 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1916
1931
|
default: n(() => [
|
|
1917
1932
|
v(e(ze), {
|
|
1918
1933
|
modelValue: i.value,
|
|
1919
|
-
"onUpdate:modelValue": T[1] || (T[1] = (
|
|
1934
|
+
"onUpdate:modelValue": T[1] || (T[1] = (N) => i.value = N),
|
|
1920
1935
|
type: "password",
|
|
1921
1936
|
autocomplete: "current-password",
|
|
1922
|
-
disabled: c.value || !
|
|
1937
|
+
disabled: c.value || !f.value
|
|
1923
1938
|
}, null, 8, ["modelValue", "disabled"])
|
|
1924
1939
|
]),
|
|
1925
1940
|
_: 1
|
|
@@ -1929,7 +1944,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1929
1944
|
v(e(V), {
|
|
1930
1945
|
type: "submit",
|
|
1931
1946
|
variant: "primary",
|
|
1932
|
-
disabled: c.value || !
|
|
1947
|
+
disabled: c.value || !f.value || !a.value || !i.value || r.value && !u.value
|
|
1933
1948
|
}, {
|
|
1934
1949
|
default: n(() => [
|
|
1935
1950
|
h(s(c.value ? o.value.signingIn : r.value ? o.value.verify : o.value.signIn), 1)
|
|
@@ -1940,7 +1955,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1940
1955
|
key: 0,
|
|
1941
1956
|
variant: "secondary",
|
|
1942
1957
|
disabled: c.value,
|
|
1943
|
-
onClick:
|
|
1958
|
+
onClick: E
|
|
1944
1959
|
}, {
|
|
1945
1960
|
default: n(() => [
|
|
1946
1961
|
h(s(o.value.otherAccount), 1)
|
|
@@ -1949,8 +1964,8 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1949
1964
|
}, 8, ["disabled"])) : (l(), b(e(V), {
|
|
1950
1965
|
key: 1,
|
|
1951
1966
|
variant: "secondary",
|
|
1952
|
-
disabled: c.value || !
|
|
1953
|
-
onClick:
|
|
1967
|
+
disabled: c.value || !f.value,
|
|
1968
|
+
onClick: C
|
|
1954
1969
|
}, {
|
|
1955
1970
|
default: n(() => [
|
|
1956
1971
|
h(s(o.value.continueDSM), 1)
|
|
@@ -1966,136 +1981,136 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
1966
1981
|
]),
|
|
1967
1982
|
_: 1
|
|
1968
1983
|
}, 8, ["title", "description"])
|
|
1969
|
-
], 8,
|
|
1984
|
+
], 8, Dl));
|
|
1970
1985
|
}
|
|
1971
|
-
}),
|
|
1986
|
+
}), po = /* @__PURE__ */ me(Ll, [["__scopeId", "data-v-07e4497c"]]), Ol = { class: "integration-actions" }, Fl = { role: "status" }, ql = { class: "integration-help" }, Ml = { class: "integration-help" }, Kl = { class: "integration-help" }, Hl = { class: "integration-actions" }, Xl = {
|
|
1972
1987
|
key: 0,
|
|
1973
1988
|
role: "status",
|
|
1974
1989
|
"data-bg-picked": "",
|
|
1975
1990
|
class: "bg-path"
|
|
1976
|
-
},
|
|
1991
|
+
}, Wl = { class: "integration-actions" }, Gl = { key: 2 }, Jl = {
|
|
1977
1992
|
key: 3,
|
|
1978
1993
|
class: "bg-cards"
|
|
1979
|
-
},
|
|
1994
|
+
}, Yl = { class: "bg-card-body" }, Ql = {
|
|
1980
1995
|
key: 0,
|
|
1981
1996
|
class: "integration-help"
|
|
1982
|
-
},
|
|
1997
|
+
}, Zl = {
|
|
1983
1998
|
key: 1,
|
|
1984
1999
|
class: "integration-help"
|
|
1985
|
-
},
|
|
2000
|
+
}, jl = {
|
|
1986
2001
|
key: 2,
|
|
1987
2002
|
class: "integration-help bg-path"
|
|
1988
|
-
},
|
|
2003
|
+
}, en = {
|
|
1989
2004
|
key: 3,
|
|
1990
2005
|
class: "integration-help"
|
|
1991
|
-
},
|
|
2006
|
+
}, an = {
|
|
1992
2007
|
key: 4,
|
|
1993
2008
|
class: "integration-help"
|
|
1994
|
-
},
|
|
2009
|
+
}, tn = { class: "integration-actions" }, ln = { key: 1 }, nn = {
|
|
1995
2010
|
key: 2,
|
|
1996
2011
|
class: "bg-cards"
|
|
1997
|
-
},
|
|
2012
|
+
}, on = { class: "bg-card-body" }, sn = {
|
|
1998
2013
|
key: 0,
|
|
1999
2014
|
class: "integration-help"
|
|
2000
|
-
},
|
|
2015
|
+
}, un = {
|
|
2001
2016
|
key: 1,
|
|
2002
2017
|
class: "integration-help"
|
|
2003
|
-
},
|
|
2018
|
+
}, rn = { class: "integration-help" }, dn = { class: "integration-actions" }, cn = { class: "integration-actions" }, vn = { class: "integration-actions" }, fn = /* @__PURE__ */ fe({
|
|
2004
2019
|
__name: "BackgroundPanel",
|
|
2005
2020
|
props: {
|
|
2006
2021
|
ctx: {}
|
|
2007
2022
|
},
|
|
2008
|
-
setup(t, { expose:
|
|
2009
|
-
const o = t, a =
|
|
2010
|
-
let
|
|
2011
|
-
const
|
|
2012
|
-
async function
|
|
2023
|
+
setup(t, { expose: p }) {
|
|
2024
|
+
const o = t, a = _(() => Wa(o.ctx.locale)), i = (z, W) => Je(z, W, o.ctx.locale), u = y(), r = y([]), c = y(), m = y(!1), d = y(!1), f = y([]), x = y(), P = y(!1), w = y("3600"), C = y(), E = y(), k = y(), T = y(!1), N = y(), te = _(() => !u.value && !c.value && !m.value && !N.value), F = y(!1), Y = y(), B = y(""), K = y(""), L = Ga(o.ctx);
|
|
2025
|
+
let R, A = !1;
|
|
2026
|
+
const q = (z) => !["queued", "running"].includes(z.state), M = (z) => q(z) && z.state !== "paused", se = (z) => z.state === "running" && z.pauseRequested, H = (z) => se(z) ? a.value.pausing : a.value[`state_${z.state}`], G = (z) => se(z) ? "warning" : { queued: "info", running: "info", paused: "warning", succeeded: "success", failed: "danger", canceled: "neutral", interrupted: "danger" }[z.state];
|
|
2027
|
+
async function le(z, W, I = !1) {
|
|
2013
2028
|
try {
|
|
2014
|
-
return await o.ctx.call(
|
|
2029
|
+
return await o.ctx.call(z, W);
|
|
2015
2030
|
} catch (ve) {
|
|
2016
|
-
if (
|
|
2017
|
-
ve?.code === "unsupported" ? (
|
|
2031
|
+
if (A || I && (N.value = Ce(ve))) return;
|
|
2032
|
+
ve?.code === "unsupported" ? (m.value = !0, r.value = [], f.value = [], x.value = void 0, C.value = void 0, E.value = void 0, u.value = void 0, k.value = void 0, Y.value = void 0, B.value && URL.revokeObjectURL(B.value), B.value = "") : A || (c.value = ve);
|
|
2018
2033
|
return;
|
|
2019
2034
|
}
|
|
2020
2035
|
}
|
|
2021
2036
|
async function re() {
|
|
2022
|
-
if (!(
|
|
2037
|
+
if (!(A || T.value)) {
|
|
2023
2038
|
T.value = !0;
|
|
2024
2039
|
try {
|
|
2025
|
-
const
|
|
2026
|
-
if (!
|
|
2027
|
-
if (
|
|
2040
|
+
const z = await le("bg.status", void 0, !0);
|
|
2041
|
+
if (!z || A) return;
|
|
2042
|
+
if (N.value = void 0, !z.limits || typeof z.admin != "boolean") {
|
|
2028
2043
|
c.value = { code: "unavailable" };
|
|
2029
2044
|
return;
|
|
2030
2045
|
}
|
|
2031
|
-
|
|
2032
|
-
const W = await
|
|
2033
|
-
W && !
|
|
2034
|
-
const I = await
|
|
2035
|
-
I && !
|
|
2046
|
+
m.value = !1, u.value = z;
|
|
2047
|
+
const W = await le("bg.jobs.list", void 0, !0);
|
|
2048
|
+
W && !A && (r.value = W.jobs ?? []);
|
|
2049
|
+
const I = await le("bg.schedules.list", void 0, !0);
|
|
2050
|
+
I && !A && (f.value = I.schedules ?? []), !A && r.value.every(q) && f.value.every((ve) => !ve.enabled) && R && (clearInterval(R), R = void 0);
|
|
2036
2051
|
} finally {
|
|
2037
2052
|
T.value = !1;
|
|
2038
2053
|
}
|
|
2039
2054
|
}
|
|
2040
2055
|
}
|
|
2041
|
-
function
|
|
2042
|
-
|
|
2056
|
+
function ee() {
|
|
2057
|
+
R || (R = setInterval(() => {
|
|
2043
2058
|
re();
|
|
2044
2059
|
}, 3e3));
|
|
2045
2060
|
}
|
|
2046
|
-
async function X(
|
|
2061
|
+
async function X(z) {
|
|
2047
2062
|
if (!d.value) {
|
|
2048
2063
|
d.value = !0, c.value = void 0;
|
|
2049
2064
|
try {
|
|
2050
|
-
await
|
|
2065
|
+
await z(), await re(), (f.value.some((W) => W.enabled) || r.value.some((W) => !q(W))) && ee();
|
|
2051
2066
|
} finally {
|
|
2052
|
-
|
|
2067
|
+
A || (d.value = !1);
|
|
2053
2068
|
}
|
|
2054
2069
|
}
|
|
2055
2070
|
}
|
|
2056
|
-
const
|
|
2071
|
+
const Q = () => X(async () => {
|
|
2057
2072
|
if (!k.value) return;
|
|
2058
|
-
await
|
|
2059
|
-
}), de =
|
|
2060
|
-
|
|
2073
|
+
await le("bg.jobs.purge", { owner: k.value }) && (k.value = void 0);
|
|
2074
|
+
}), de = _(() => [{ value: "3600", label: a.value.hourly }, { value: "86400", label: a.value.daily }, { value: "604800", label: a.value.weekly }]), he = (z) => {
|
|
2075
|
+
x.value = z, P.value = !1, w.value = "3600";
|
|
2061
2076
|
}, Ae = () => X(async () => {
|
|
2062
|
-
if (!
|
|
2063
|
-
await
|
|
2064
|
-
}),
|
|
2065
|
-
if (!
|
|
2066
|
-
await
|
|
2067
|
-
}),
|
|
2068
|
-
if (!
|
|
2069
|
-
await
|
|
2070
|
-
}),
|
|
2071
|
-
const W = new Date(
|
|
2077
|
+
if (!x.value || !P.value) return;
|
|
2078
|
+
await le("bg.schedules.create", { key: ba(), jobId: x.value.id, intervalSeconds: Number(w.value), consent: !0 }) && (x.value = void 0);
|
|
2079
|
+
}), _e = (z) => X(() => le("bg.schedules.disable", { id: z })), J = () => X(async () => {
|
|
2080
|
+
if (!C.value) return;
|
|
2081
|
+
await le("bg.schedules.delete", { id: C.value.id }) && (C.value = void 0);
|
|
2082
|
+
}), ie = () => X(async () => {
|
|
2083
|
+
if (!E.value) return;
|
|
2084
|
+
await le("bg.schedules.enable", { id: E.value.id, consent: !0 }) && (E.value = void 0);
|
|
2085
|
+
}), ne = (z) => {
|
|
2086
|
+
const W = new Date(z);
|
|
2072
2087
|
return Number.isFinite(W.getTime()) ? W.toLocaleString() : a.value.unknownTime;
|
|
2073
|
-
}, ye = (
|
|
2074
|
-
const W =
|
|
2075
|
-
|
|
2076
|
-
},
|
|
2077
|
-
if (!
|
|
2078
|
-
await
|
|
2088
|
+
}, ye = (z) => z.copyRetained && z.state === "succeeded" && !z.scheduleId && z.submitter?.user === u.value?.owner?.user && z.submitter?.uid === u.value?.owner?.uid, Pe = (z) => X(() => le("bg.jobs.cancel", { id: z })), D = (z) => X(() => le("bg.jobs.pause", { id: z })), U = (z) => X(() => le("bg.jobs.resume", { id: z })), O = (z) => {
|
|
2089
|
+
const W = z.lastIndexOf("/");
|
|
2090
|
+
Y.value = { folder: z.slice(0, W), relative: z.slice(W + 1) };
|
|
2091
|
+
}, Z = () => X(async () => {
|
|
2092
|
+
if (!Y.value) return;
|
|
2093
|
+
await le("bg.jobs.submit", { key: ba(), ...Y.value }) && (Y.value = void 0);
|
|
2079
2094
|
});
|
|
2080
|
-
async function ce(
|
|
2081
|
-
const W = await
|
|
2082
|
-
!W ||
|
|
2095
|
+
async function ce(z) {
|
|
2096
|
+
const W = await le("bg.jobs.result", { id: z.id });
|
|
2097
|
+
!W || A || (B.value && URL.revokeObjectURL(B.value), B.value = URL.createObjectURL(new Blob([JSON.stringify(W.result, null, 2)], { type: "application/json" })), K.value = `${z.name || z.id}.sha256.json`);
|
|
2083
2098
|
}
|
|
2084
|
-
return Ke(() =>
|
|
2099
|
+
return Ke(() => N.value, re), p({ refresh: re }), Se(() => {
|
|
2085
2100
|
re().then(() => {
|
|
2086
|
-
(
|
|
2101
|
+
(f.value.some((z) => z.enabled) || r.value.some((z) => !q(z))) && ee();
|
|
2087
2102
|
});
|
|
2088
|
-
}),
|
|
2089
|
-
|
|
2090
|
-
}), (
|
|
2103
|
+
}), we(() => {
|
|
2104
|
+
A = !0, L.dispose(), R && clearInterval(R), B.value && URL.revokeObjectURL(B.value);
|
|
2105
|
+
}), (z, W) => (l(), b(e(ke), {
|
|
2091
2106
|
"aria-busy": d.value || T.value || te.value,
|
|
2092
2107
|
title: a.value.title,
|
|
2093
|
-
description:
|
|
2108
|
+
description: m.value ? void 0 : a.value.help,
|
|
2094
2109
|
collapsible: !1,
|
|
2095
2110
|
"data-background-panel": ""
|
|
2096
2111
|
}, {
|
|
2097
2112
|
default: n(() => [
|
|
2098
|
-
|
|
2113
|
+
m.value ? (l(), b(e(j), {
|
|
2099
2114
|
key: 0,
|
|
2100
2115
|
tone: "warning"
|
|
2101
2116
|
}, {
|
|
@@ -2103,18 +2118,18 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2103
2118
|
h(s(a.value.unsupported), 1)
|
|
2104
2119
|
]),
|
|
2105
2120
|
_: 1
|
|
2106
|
-
})) : (l(), $(
|
|
2107
|
-
|
|
2121
|
+
})) : (l(), $(oe, { key: 1 }, [
|
|
2122
|
+
N.value ? (l(), b(e(j), {
|
|
2108
2123
|
key: 0,
|
|
2109
2124
|
tone: "info",
|
|
2110
2125
|
role: "status"
|
|
2111
2126
|
}, {
|
|
2112
2127
|
default: n(() => [
|
|
2113
|
-
h(s(e(Ne)(
|
|
2128
|
+
h(s(e(Ne)(N.value, t.ctx.locale)), 1)
|
|
2114
2129
|
]),
|
|
2115
2130
|
_: 1
|
|
2116
2131
|
})) : g("", !0),
|
|
2117
|
-
c.value ? (l(), b(e(
|
|
2132
|
+
c.value ? (l(), b(e(j), {
|
|
2118
2133
|
key: 1,
|
|
2119
2134
|
tone: "danger",
|
|
2120
2135
|
role: "alert"
|
|
@@ -2124,17 +2139,17 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2124
2139
|
]),
|
|
2125
2140
|
_: 1
|
|
2126
2141
|
})) : g("", !0),
|
|
2127
|
-
te.value ? (l(), $(
|
|
2128
|
-
(l(), $(
|
|
2142
|
+
te.value ? (l(), $(oe, { key: 2 }, [
|
|
2143
|
+
(l(), $(oe, null, ge(["14rem", "24rem", "18rem", "24rem"], (I, ve) => S("p", {
|
|
2129
2144
|
key: ve,
|
|
2130
2145
|
"data-placeholder-row": ""
|
|
2131
2146
|
}, [
|
|
2132
|
-
v(e(
|
|
2147
|
+
v(e(Fe), {
|
|
2133
2148
|
width: I,
|
|
2134
2149
|
height: "20px"
|
|
2135
2150
|
}, null, 8, ["width"])
|
|
2136
2151
|
])), 64)),
|
|
2137
|
-
|
|
2152
|
+
S("div", Ol, [
|
|
2138
2153
|
v(e(V), {
|
|
2139
2154
|
variant: "secondary",
|
|
2140
2155
|
disabled: ""
|
|
@@ -2155,16 +2170,16 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2155
2170
|
})
|
|
2156
2171
|
])
|
|
2157
2172
|
], 64)) : g("", !0),
|
|
2158
|
-
u.value ? (l(), $(
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2173
|
+
u.value ? (l(), $(oe, { key: 3 }, [
|
|
2174
|
+
S("p", Fl, s(u.value.worker?.alive ? i(a.value.workerRunning, { user: u.value.worker.username }) : a.value.workerStopped), 1),
|
|
2175
|
+
S("p", ql, s(i(a.value.limits, { size: u.value.limits.maxInputBytes / 1024, queue: u.value.limits.maxQueued, seconds: u.value.limits.jobTimeoutSeconds })), 1),
|
|
2176
|
+
S("p", Ml, s(u.value.admin ? a.value.adminScope : a.value.ownerScope), 1),
|
|
2177
|
+
S("p", Kl, s(i(a.value.ownerLimits, { jobs: u.value.limits.maxOwnerPending, size: u.value.limits.maxOwnerBytes / 1024 })), 1),
|
|
2178
|
+
S("div", Hl, [
|
|
2164
2179
|
v(e(V), {
|
|
2165
2180
|
variant: "secondary",
|
|
2166
2181
|
disabled: d.value,
|
|
2167
|
-
onClick: W[0] || (W[0] = (I) =>
|
|
2182
|
+
onClick: W[0] || (W[0] = (I) => F.value = !0)
|
|
2168
2183
|
}, {
|
|
2169
2184
|
default: n(() => [
|
|
2170
2185
|
h(s(a.value.chooseFile), 1)
|
|
@@ -2173,8 +2188,8 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2173
2188
|
}, 8, ["disabled"]),
|
|
2174
2189
|
v(e(V), {
|
|
2175
2190
|
variant: "primary",
|
|
2176
|
-
disabled: d.value || !
|
|
2177
|
-
onClick:
|
|
2191
|
+
disabled: d.value || !Y.value,
|
|
2192
|
+
onClick: Z
|
|
2178
2193
|
}, {
|
|
2179
2194
|
default: n(() => [
|
|
2180
2195
|
h(s(a.value.submit), 1)
|
|
@@ -2182,34 +2197,34 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2182
2197
|
_: 1
|
|
2183
2198
|
}, 8, ["disabled"])
|
|
2184
2199
|
]),
|
|
2185
|
-
|
|
2200
|
+
Y.value ? (l(), $("p", Xl, [
|
|
2186
2201
|
h(s(i(a.value.chosen, { path: "" }).trim()) + " ", 1),
|
|
2187
2202
|
v(e(Ue), {
|
|
2188
|
-
path: `${
|
|
2203
|
+
path: `${Y.value.folder}/${Y.value.relative}`
|
|
2189
2204
|
}, null, 8, ["path"])
|
|
2190
2205
|
])) : g("", !0),
|
|
2191
2206
|
v(ta, {
|
|
2192
|
-
open:
|
|
2193
|
-
"onUpdate:open": W[1] || (W[1] = (I) =>
|
|
2207
|
+
open: F.value,
|
|
2208
|
+
"onUpdate:open": W[1] || (W[1] = (I) => F.value = I),
|
|
2194
2209
|
locale: t.ctx.locale,
|
|
2195
2210
|
name: t.ctx.displayName,
|
|
2196
|
-
provider: e(
|
|
2211
|
+
provider: e(L),
|
|
2197
2212
|
mode: "file",
|
|
2198
2213
|
title: a.value.pickerTitle,
|
|
2199
2214
|
description: a.value.pickerConsent,
|
|
2200
|
-
onSelected:
|
|
2215
|
+
onSelected: O
|
|
2201
2216
|
}, null, 8, ["open", "locale", "name", "provider", "title", "description"]),
|
|
2202
|
-
k.value && u.value.admin ? (l(), b(e(
|
|
2217
|
+
k.value && u.value.admin ? (l(), b(e(j), {
|
|
2203
2218
|
key: 1,
|
|
2204
2219
|
tone: "warning"
|
|
2205
2220
|
}, {
|
|
2206
2221
|
default: n(() => [
|
|
2207
|
-
|
|
2208
|
-
|
|
2222
|
+
S("p", null, s(i(a.value.purgeConfirm, { user: k.value.user, uid: k.value.uid })), 1),
|
|
2223
|
+
S("div", Wl, [
|
|
2209
2224
|
v(e(V), {
|
|
2210
2225
|
variant: "secondary",
|
|
2211
2226
|
disabled: d.value,
|
|
2212
|
-
onClick:
|
|
2227
|
+
onClick: Q
|
|
2213
2228
|
}, {
|
|
2214
2229
|
default: n(() => [
|
|
2215
2230
|
h(s(a.value.confirmPurge), 1)
|
|
@@ -2230,8 +2245,8 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2230
2245
|
]),
|
|
2231
2246
|
_: 1
|
|
2232
2247
|
})) : g("", !0),
|
|
2233
|
-
r.value.length ? (l(), $("div",
|
|
2234
|
-
(l(!0), $(
|
|
2248
|
+
r.value.length ? (l(), $("div", Jl, [
|
|
2249
|
+
(l(!0), $(oe, null, ge(r.value, (I) => (l(), b(e(_a), {
|
|
2235
2250
|
key: I.id,
|
|
2236
2251
|
title: I.name,
|
|
2237
2252
|
"layout-type": "compact",
|
|
@@ -2240,7 +2255,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2240
2255
|
}, {
|
|
2241
2256
|
"header-actions": n(() => [
|
|
2242
2257
|
v(e(ia), {
|
|
2243
|
-
tone:
|
|
2258
|
+
tone: G(I),
|
|
2244
2259
|
"data-bg-state": ""
|
|
2245
2260
|
}, {
|
|
2246
2261
|
default: n(() => [
|
|
@@ -2250,18 +2265,18 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2250
2265
|
}, 1032, ["tone"])
|
|
2251
2266
|
]),
|
|
2252
2267
|
default: n(() => [
|
|
2253
|
-
|
|
2254
|
-
I.progress?.total ? (l(), $("span",
|
|
2255
|
-
I.progress?.totalBytes ? (l(), $("span",
|
|
2256
|
-
I.progress?.item ? (l(), $("span",
|
|
2268
|
+
S("div", Yl, [
|
|
2269
|
+
I.progress?.total ? (l(), $("span", Ql, s(i(a.value.progressItems, { done: I.progress.done, count: I.progress.total })), 1)) : g("", !0),
|
|
2270
|
+
I.progress?.totalBytes ? (l(), $("span", Zl, s(i(a.value.progressBytes, { done: e(ra)(I.progress.bytes, t.ctx.locale), total: e(ra)(I.progress.totalBytes, t.ctx.locale) })), 1)) : g("", !0),
|
|
2271
|
+
I.progress?.item ? (l(), $("span", jl, [
|
|
2257
2272
|
h(s(i(a.value.progressItem, { item: "" }).trim()) + " ", 1),
|
|
2258
2273
|
v(e(Ue), {
|
|
2259
2274
|
path: I.progress.item
|
|
2260
2275
|
}, null, 8, ["path"])
|
|
2261
2276
|
])) : g("", !0),
|
|
2262
|
-
u.value.admin && I.submitter ? (l(), $("span",
|
|
2263
|
-
I.scheduleId ? (l(), $("span",
|
|
2264
|
-
|
|
2277
|
+
u.value.admin && I.submitter ? (l(), $("span", en, s(i(a.value.owner, { user: I.submitter.user, uid: I.submitter.uid })), 1)) : g("", !0),
|
|
2278
|
+
I.scheduleId ? (l(), $("span", an, s(a.value.scheduledJob), 1)) : g("", !0),
|
|
2279
|
+
S("div", tn, [
|
|
2265
2280
|
u.value.admin && I.submitter ? (l(), b(e(V), {
|
|
2266
2281
|
key: 0,
|
|
2267
2282
|
variant: "secondary",
|
|
@@ -2273,7 +2288,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2273
2288
|
]),
|
|
2274
2289
|
_: 1
|
|
2275
2290
|
}, 8, ["disabled", "onClick"])) : g("", !0),
|
|
2276
|
-
!
|
|
2291
|
+
!q(I) && !I.pauseRequested && !I.delegation_id ? (l(), b(e(V), {
|
|
2277
2292
|
key: 1,
|
|
2278
2293
|
variant: "secondary",
|
|
2279
2294
|
disabled: d.value,
|
|
@@ -2284,7 +2299,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2284
2299
|
]),
|
|
2285
2300
|
_: 1
|
|
2286
2301
|
}, 8, ["disabled", "onClick"])) : g("", !0),
|
|
2287
|
-
I.state === "paused" ||
|
|
2302
|
+
I.state === "paused" || se(I) ? (l(), b(e(V), {
|
|
2288
2303
|
key: 2,
|
|
2289
2304
|
variant: "secondary",
|
|
2290
2305
|
disabled: d.value,
|
|
@@ -2299,7 +2314,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2299
2314
|
key: 3,
|
|
2300
2315
|
variant: "secondary",
|
|
2301
2316
|
disabled: d.value,
|
|
2302
|
-
onClick: (ve) =>
|
|
2317
|
+
onClick: (ve) => Pe(I.id)
|
|
2303
2318
|
}, {
|
|
2304
2319
|
default: n(() => [
|
|
2305
2320
|
h(s(a.value.cancel), 1)
|
|
@@ -2310,7 +2325,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2310
2325
|
key: 4,
|
|
2311
2326
|
variant: "secondary",
|
|
2312
2327
|
disabled: d.value,
|
|
2313
|
-
onClick: (ve) =>
|
|
2328
|
+
onClick: (ve) => he(I)
|
|
2314
2329
|
}, {
|
|
2315
2330
|
default: n(() => [
|
|
2316
2331
|
h(s(a.value.scheduleCopy), 1)
|
|
@@ -2333,8 +2348,8 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2333
2348
|
]),
|
|
2334
2349
|
_: 2
|
|
2335
2350
|
}, 1032, ["title", "data-job-state", "data-job-id"]))), 128))
|
|
2336
|
-
])) : (l(), $("p",
|
|
2337
|
-
v(e(
|
|
2351
|
+
])) : (l(), $("p", Gl, s(a.value.noJobs), 1)),
|
|
2352
|
+
v(e(ke), {
|
|
2338
2353
|
"data-bg-schedules": "",
|
|
2339
2354
|
class: "bg-schedules",
|
|
2340
2355
|
title: a.value.schedulesTitle,
|
|
@@ -2342,20 +2357,20 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2342
2357
|
collapsible: !1
|
|
2343
2358
|
}, {
|
|
2344
2359
|
default: n(() => [
|
|
2345
|
-
|
|
2360
|
+
x.value ? (l(), b(e(Me), {
|
|
2346
2361
|
key: 0,
|
|
2347
2362
|
class: "bg-schedule-form",
|
|
2348
2363
|
onSubmit: qe(Ae, ["prevent"])
|
|
2349
2364
|
}, {
|
|
2350
2365
|
default: n(() => [
|
|
2351
|
-
|
|
2366
|
+
S("p", null, s(i(a.value.scheduleSource, { name: x.value.name })), 1),
|
|
2352
2367
|
v(e($e), {
|
|
2353
2368
|
label: a.value.interval
|
|
2354
2369
|
}, {
|
|
2355
2370
|
default: n(() => [
|
|
2356
2371
|
v(e(ma), {
|
|
2357
|
-
modelValue:
|
|
2358
|
-
"onUpdate:modelValue": W[3] || (W[3] = (I) =>
|
|
2372
|
+
modelValue: w.value,
|
|
2373
|
+
"onUpdate:modelValue": W[3] || (W[3] = (I) => w.value = I),
|
|
2359
2374
|
"data-schedule-interval": "",
|
|
2360
2375
|
options: de.value,
|
|
2361
2376
|
disabled: d.value
|
|
@@ -2364,8 +2379,8 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2364
2379
|
_: 1
|
|
2365
2380
|
}, 8, ["label"]),
|
|
2366
2381
|
v(e(yt), {
|
|
2367
|
-
modelValue:
|
|
2368
|
-
"onUpdate:modelValue": W[4] || (W[4] = (I) =>
|
|
2382
|
+
modelValue: P.value,
|
|
2383
|
+
"onUpdate:modelValue": W[4] || (W[4] = (I) => P.value = I),
|
|
2369
2384
|
"data-schedule-consent": "",
|
|
2370
2385
|
disabled: d.value,
|
|
2371
2386
|
label: a.value.scheduleConsent
|
|
@@ -2375,7 +2390,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2375
2390
|
v(e(V), {
|
|
2376
2391
|
type: "submit",
|
|
2377
2392
|
variant: "primary",
|
|
2378
|
-
disabled: d.value || !
|
|
2393
|
+
disabled: d.value || !P.value
|
|
2379
2394
|
}, {
|
|
2380
2395
|
default: n(() => [
|
|
2381
2396
|
h(s(a.value.createSchedule), 1)
|
|
@@ -2386,7 +2401,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2386
2401
|
type: "button",
|
|
2387
2402
|
variant: "secondary",
|
|
2388
2403
|
disabled: d.value,
|
|
2389
|
-
onClick: W[5] || (W[5] = (I) =>
|
|
2404
|
+
onClick: W[5] || (W[5] = (I) => x.value = void 0)
|
|
2390
2405
|
}, {
|
|
2391
2406
|
default: n(() => [
|
|
2392
2407
|
h(s(a.value.cancel), 1)
|
|
@@ -2399,8 +2414,8 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2399
2414
|
]),
|
|
2400
2415
|
_: 1
|
|
2401
2416
|
})) : g("", !0),
|
|
2402
|
-
|
|
2403
|
-
(l(!0), $(
|
|
2417
|
+
f.value.length ? (l(), $("div", nn, [
|
|
2418
|
+
(l(!0), $(oe, null, ge(f.value, (I) => (l(), b(e(_a), {
|
|
2404
2419
|
key: I.id,
|
|
2405
2420
|
title: I.name,
|
|
2406
2421
|
"layout-type": "compact",
|
|
@@ -2418,11 +2433,11 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2418
2433
|
}, 1032, ["tone"])
|
|
2419
2434
|
]),
|
|
2420
2435
|
default: n(() => [
|
|
2421
|
-
|
|
2422
|
-
u.value.admin ? (l(), $("span",
|
|
2423
|
-
I.enabled ? (l(), $("span",
|
|
2424
|
-
|
|
2425
|
-
I.reason === "worker-changed" ? (l(), b(e(
|
|
2436
|
+
S("div", on, [
|
|
2437
|
+
u.value.admin ? (l(), $("span", sn, s(i(a.value.owner, { user: I.owner.user, uid: I.owner.uid })), 1)) : g("", !0),
|
|
2438
|
+
I.enabled ? (l(), $("span", un, s(i(a.value.nextRun, { time: ne(I.nextAt) })), 1)) : g("", !0),
|
|
2439
|
+
S("span", rn, s(i(a.value.missedRuns, { count: I.missed })), 1),
|
|
2440
|
+
I.reason === "worker-changed" ? (l(), b(e(j), {
|
|
2426
2441
|
key: 2,
|
|
2427
2442
|
tone: "warning"
|
|
2428
2443
|
}, {
|
|
@@ -2430,7 +2445,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2430
2445
|
h(s(a.value.revisionChanged), 1)
|
|
2431
2446
|
]),
|
|
2432
2447
|
_: 1
|
|
2433
|
-
})) : I.reason === "input-unavailable" ? (l(), b(e(
|
|
2448
|
+
})) : I.reason === "input-unavailable" ? (l(), b(e(j), {
|
|
2434
2449
|
key: 3,
|
|
2435
2450
|
tone: "warning"
|
|
2436
2451
|
}, {
|
|
@@ -2439,12 +2454,12 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2439
2454
|
]),
|
|
2440
2455
|
_: 1
|
|
2441
2456
|
})) : g("", !0),
|
|
2442
|
-
|
|
2457
|
+
S("div", dn, [
|
|
2443
2458
|
I.enabled ? (l(), b(e(V), {
|
|
2444
2459
|
key: 0,
|
|
2445
2460
|
variant: "secondary",
|
|
2446
2461
|
disabled: d.value,
|
|
2447
|
-
onClick: (ve) =>
|
|
2462
|
+
onClick: (ve) => _e(I.id)
|
|
2448
2463
|
}, {
|
|
2449
2464
|
default: n(() => [
|
|
2450
2465
|
h(s(a.value.disableSchedule), 1)
|
|
@@ -2454,7 +2469,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2454
2469
|
key: 1,
|
|
2455
2470
|
variant: "secondary",
|
|
2456
2471
|
disabled: d.value,
|
|
2457
|
-
onClick: (ve) =>
|
|
2472
|
+
onClick: (ve) => E.value = I
|
|
2458
2473
|
}, {
|
|
2459
2474
|
default: n(() => [
|
|
2460
2475
|
h(s(a.value.enableSchedule), 1)
|
|
@@ -2464,7 +2479,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2464
2479
|
v(e(V), {
|
|
2465
2480
|
variant: "secondary",
|
|
2466
2481
|
disabled: d.value,
|
|
2467
|
-
onClick: (ve) =>
|
|
2482
|
+
onClick: (ve) => C.value = I
|
|
2468
2483
|
}, {
|
|
2469
2484
|
default: n(() => [
|
|
2470
2485
|
h(s(a.value.deleteSchedule), 1)
|
|
@@ -2476,18 +2491,18 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2476
2491
|
]),
|
|
2477
2492
|
_: 2
|
|
2478
2493
|
}, 1032, ["title", "data-schedule-id"]))), 128))
|
|
2479
|
-
])) : (l(), $("p",
|
|
2480
|
-
|
|
2494
|
+
])) : (l(), $("p", ln, s(a.value.noSchedules), 1)),
|
|
2495
|
+
C.value ? (l(), b(e(j), {
|
|
2481
2496
|
key: 3,
|
|
2482
2497
|
tone: "warning"
|
|
2483
2498
|
}, {
|
|
2484
2499
|
default: n(() => [
|
|
2485
|
-
|
|
2486
|
-
|
|
2500
|
+
S("p", null, s(i(a.value.deleteScheduleConsent, { name: C.value.name })), 1),
|
|
2501
|
+
S("div", cn, [
|
|
2487
2502
|
v(e(V), {
|
|
2488
2503
|
variant: "danger",
|
|
2489
2504
|
disabled: d.value,
|
|
2490
|
-
onClick:
|
|
2505
|
+
onClick: J
|
|
2491
2506
|
}, {
|
|
2492
2507
|
default: n(() => [
|
|
2493
2508
|
h(s(a.value.confirmDeleteSchedule), 1)
|
|
@@ -2497,7 +2512,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2497
2512
|
v(e(V), {
|
|
2498
2513
|
variant: "secondary",
|
|
2499
2514
|
disabled: d.value,
|
|
2500
|
-
onClick: W[6] || (W[6] = (I) =>
|
|
2515
|
+
onClick: W[6] || (W[6] = (I) => C.value = void 0)
|
|
2501
2516
|
}, {
|
|
2502
2517
|
default: n(() => [
|
|
2503
2518
|
h(s(a.value.cancel), 1)
|
|
@@ -2508,17 +2523,17 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2508
2523
|
]),
|
|
2509
2524
|
_: 1
|
|
2510
2525
|
})) : g("", !0),
|
|
2511
|
-
|
|
2526
|
+
E.value ? (l(), b(e(j), {
|
|
2512
2527
|
key: 4,
|
|
2513
2528
|
tone: "warning"
|
|
2514
2529
|
}, {
|
|
2515
2530
|
default: n(() => [
|
|
2516
|
-
|
|
2517
|
-
|
|
2531
|
+
S("p", null, s(i(a.value.enableScheduleConsent, { name: E.value.name })), 1),
|
|
2532
|
+
S("div", vn, [
|
|
2518
2533
|
v(e(V), {
|
|
2519
2534
|
variant: "primary",
|
|
2520
2535
|
disabled: d.value,
|
|
2521
|
-
onClick:
|
|
2536
|
+
onClick: ie
|
|
2522
2537
|
}, {
|
|
2523
2538
|
default: n(() => [
|
|
2524
2539
|
h(s(a.value.confirmEnableSchedule), 1)
|
|
@@ -2528,7 +2543,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2528
2543
|
v(e(V), {
|
|
2529
2544
|
variant: "secondary",
|
|
2530
2545
|
disabled: d.value,
|
|
2531
|
-
onClick: W[7] || (W[7] = (I) =>
|
|
2546
|
+
onClick: W[7] || (W[7] = (I) => E.value = void 0)
|
|
2532
2547
|
}, {
|
|
2533
2548
|
default: n(() => [
|
|
2534
2549
|
h(s(a.value.cancel), 1)
|
|
@@ -2542,10 +2557,10 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2542
2557
|
]),
|
|
2543
2558
|
_: 1
|
|
2544
2559
|
}, 8, ["title", "description"]),
|
|
2545
|
-
|
|
2560
|
+
B.value ? (l(), b(e(ua), {
|
|
2546
2561
|
key: 4,
|
|
2547
|
-
href:
|
|
2548
|
-
download:
|
|
2562
|
+
href: B.value,
|
|
2563
|
+
download: K.value
|
|
2549
2564
|
}, {
|
|
2550
2565
|
default: n(() => [
|
|
2551
2566
|
h(s(a.value.download), 1)
|
|
@@ -2558,13 +2573,13 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2558
2573
|
_: 1
|
|
2559
2574
|
}, 8, ["aria-busy", "title", "description"]));
|
|
2560
2575
|
}
|
|
2561
|
-
}),
|
|
2576
|
+
}), mo = /* @__PURE__ */ me(fn, [["__scopeId", "data-v-a7c98d9d"]]), pn = ["inert", "aria-hidden"], mn = {
|
|
2562
2577
|
key: 3,
|
|
2563
2578
|
class: "executor-approval"
|
|
2564
|
-
},
|
|
2579
|
+
}, yn = {
|
|
2565
2580
|
key: 0,
|
|
2566
2581
|
class: "executor-brand"
|
|
2567
|
-
},
|
|
2582
|
+
}, bn = ["src"], gn = /* @__PURE__ */ fe({
|
|
2568
2583
|
__name: "ExecutorApproval",
|
|
2569
2584
|
props: {
|
|
2570
2585
|
admin: { type: Boolean },
|
|
@@ -2574,59 +2589,59 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2574
2589
|
preload: { type: Boolean }
|
|
2575
2590
|
},
|
|
2576
2591
|
setup(t) {
|
|
2577
|
-
const
|
|
2578
|
-
const
|
|
2579
|
-
return (
|
|
2592
|
+
const p = t, o = Ee(We, void 0), a = _(() => Ve(p.locale)), i = y("checking"), u = y(), r = _(() => {
|
|
2593
|
+
const w = p.ctx;
|
|
2594
|
+
return (w?.fullPage ?? (w?.host ? $a({ host: w.host }) : !1)) && w?.displayName ? w : void 0;
|
|
2580
2595
|
});
|
|
2581
|
-
function c(
|
|
2582
|
-
u.value =
|
|
2596
|
+
function c(w) {
|
|
2597
|
+
u.value = w, i.value = w.state;
|
|
2583
2598
|
}
|
|
2584
|
-
let
|
|
2585
|
-
async function
|
|
2599
|
+
let m = !1, d;
|
|
2600
|
+
async function f() {
|
|
2586
2601
|
try {
|
|
2587
|
-
const
|
|
2588
|
-
|
|
2602
|
+
const w = await o.status();
|
|
2603
|
+
m || c(w);
|
|
2589
2604
|
} catch {
|
|
2590
|
-
|
|
2605
|
+
m || (u.value = void 0, i.value = "blocked");
|
|
2591
2606
|
}
|
|
2592
2607
|
}
|
|
2593
|
-
const
|
|
2594
|
-
return Le(Ua,
|
|
2595
|
-
o && (o.subscribe?.((
|
|
2596
|
-
!
|
|
2597
|
-
}), d =
|
|
2598
|
-
|
|
2599
|
-
}),
|
|
2600
|
-
}),
|
|
2601
|
-
|
|
2602
|
-
}), (
|
|
2603
|
-
|
|
2608
|
+
const x = _(() => Ce(u.value)), P = _(() => !!p.preload && !!o && (i.value === "ready" || i.value === "checking"));
|
|
2609
|
+
return Le(Ua, _(() => P.value && i.value === "checking")), Ke(() => x.value, f), Se(() => {
|
|
2610
|
+
o && (o.subscribe?.((w) => {
|
|
2611
|
+
!m && !je(w) && c(w);
|
|
2612
|
+
}), d = p.ctx?.reopen(() => {
|
|
2613
|
+
f();
|
|
2614
|
+
}), f());
|
|
2615
|
+
}), we(() => {
|
|
2616
|
+
m = !0, d?.();
|
|
2617
|
+
}), (w, C) => (l(), $(oe, null, [
|
|
2618
|
+
P.value ? (l(), $("div", {
|
|
2604
2619
|
key: 0,
|
|
2605
2620
|
class: De(["executor-pages", { "executor-preloading": i.value === "checking" }]),
|
|
2606
2621
|
inert: i.value === "checking" || void 0,
|
|
2607
2622
|
"aria-hidden": i.value === "checking" ? "true" : void 0
|
|
2608
2623
|
}, [
|
|
2609
|
-
be(
|
|
2610
|
-
], 10,
|
|
2624
|
+
be(w.$slots, "default", {}, void 0, !0)
|
|
2625
|
+
], 10, pn)) : !e(o) || i.value === "ready" ? be(w.$slots, "default", {}, void 0, !0, 1) : g("", !0),
|
|
2611
2626
|
e(o) && i.value === "checking" ? (l(), b(e(bt), {
|
|
2612
2627
|
key: 2,
|
|
2613
2628
|
text: a.value.loading
|
|
2614
|
-
}, null, 8, ["text"])) : e(o) && i.value !== "ready" ? (l(), $("div",
|
|
2615
|
-
r.value ? (l(), $("header",
|
|
2629
|
+
}, null, 8, ["text"])) : e(o) && i.value !== "ready" ? (l(), $("div", mn, [
|
|
2630
|
+
r.value ? (l(), $("header", yn, [
|
|
2616
2631
|
r.value.appIcon ? (l(), $("img", {
|
|
2617
2632
|
key: 0,
|
|
2618
2633
|
src: r.value.appIcon,
|
|
2619
2634
|
alt: ""
|
|
2620
|
-
}, null, 8,
|
|
2621
|
-
|
|
2635
|
+
}, null, 8, bn)) : g("", !0),
|
|
2636
|
+
S("span", null, s(r.value.displayName), 1)
|
|
2622
2637
|
])) : g("", !0),
|
|
2623
|
-
|
|
2638
|
+
x.value ? (l(), b(e(j), {
|
|
2624
2639
|
key: 1,
|
|
2625
2640
|
tone: "info",
|
|
2626
2641
|
role: "status"
|
|
2627
2642
|
}, {
|
|
2628
2643
|
default: n(() => [
|
|
2629
|
-
h(s(e(Ne)(
|
|
2644
|
+
h(s(e(Ne)(x.value, t.locale)), 1)
|
|
2630
2645
|
]),
|
|
2631
2646
|
_: 1
|
|
2632
2647
|
})) : t.admin ? (l(), b(La, {
|
|
@@ -2637,14 +2652,14 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2637
2652
|
purpose: t.purpose,
|
|
2638
2653
|
title: "",
|
|
2639
2654
|
layout: "page",
|
|
2640
|
-
onConfirmed:
|
|
2655
|
+
onConfirmed: f
|
|
2641
2656
|
}, null, 8, ["locale", "initial", "purpose"])) : i.value === "needs-admin-approval" ? (l(), b(ea, {
|
|
2642
2657
|
key: 3,
|
|
2643
2658
|
admin: !1,
|
|
2644
2659
|
locale: t.locale,
|
|
2645
2660
|
purpose: t.purpose,
|
|
2646
2661
|
layout: "page"
|
|
2647
|
-
}, null, 8, ["locale", "purpose"])) : (l(), b(e(
|
|
2662
|
+
}, null, 8, ["locale", "purpose"])) : (l(), b(e(j), {
|
|
2648
2663
|
key: 4,
|
|
2649
2664
|
tone: "info"
|
|
2650
2665
|
}, {
|
|
@@ -2656,99 +2671,99 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2656
2671
|
])) : g("", !0)
|
|
2657
2672
|
], 64));
|
|
2658
2673
|
}
|
|
2659
|
-
}),
|
|
2674
|
+
}), yo = /* @__PURE__ */ me(gn, [["__scopeId", "data-v-59aae3f3"]]), hn = {
|
|
2660
2675
|
key: 2,
|
|
2661
2676
|
role: "status"
|
|
2662
|
-
},
|
|
2677
|
+
}, kn = {
|
|
2663
2678
|
key: 3,
|
|
2664
2679
|
role: "status"
|
|
2665
|
-
},
|
|
2680
|
+
}, wn = {
|
|
2666
2681
|
key: 0,
|
|
2667
2682
|
role: "status",
|
|
2668
2683
|
class: "destination"
|
|
2669
|
-
},
|
|
2684
|
+
}, _n = {
|
|
2670
2685
|
key: 0,
|
|
2671
2686
|
"data-placeholder-row": ""
|
|
2672
|
-
},
|
|
2687
|
+
}, xn = { key: 1 }, Cn = {
|
|
2673
2688
|
key: 2,
|
|
2674
2689
|
class: "records"
|
|
2675
|
-
},
|
|
2690
|
+
}, $n = ["data-job-state"], Sn = ["role"], Pn = {
|
|
2676
2691
|
key: 0,
|
|
2677
2692
|
"data-placeholder-row": ""
|
|
2678
|
-
}, En = { key: 1 },
|
|
2693
|
+
}, En = { key: 1 }, Tn = {
|
|
2679
2694
|
key: 2,
|
|
2680
2695
|
class: "records"
|
|
2681
|
-
},
|
|
2696
|
+
}, zn = /* @__PURE__ */ fe({
|
|
2682
2697
|
__name: "DelegatePanel",
|
|
2683
2698
|
props: {
|
|
2684
2699
|
ctx: {}
|
|
2685
2700
|
},
|
|
2686
|
-
setup(t, { expose:
|
|
2687
|
-
const o = t, a =
|
|
2688
|
-
let k = !1, T,
|
|
2689
|
-
const te =
|
|
2690
|
-
|
|
2691
|
-
|
|
2701
|
+
setup(t, { expose: p }) {
|
|
2702
|
+
const o = t, a = _(() => Ve(o.ctx.locale)), i = _(() => Ea(o.ctx.locale)), u = Pa(o.ctx), r = y(), c = y([]), m = y([]), d = y(!1), f = y(), x = y(""), P = y(!1), w = y(""), C = y(""), E = y("");
|
|
2703
|
+
let k = !1, T, N;
|
|
2704
|
+
const te = y();
|
|
2705
|
+
Oe([C, w, E], () => {
|
|
2706
|
+
N = void 0;
|
|
2692
2707
|
}, { flush: "sync" });
|
|
2693
|
-
const
|
|
2694
|
-
async function
|
|
2708
|
+
const F = (ee) => ["queued", "running", "waiting_executor"].includes(ee.state), Y = _(() => m.value.some((ee) => ee.state === "waiting_executor")), B = ["EXECUTOR_UNAVAILABLE", "EXECUTOR_TIMEOUT"], K = _(() => Y.value && B.includes(f.value?.code ?? "")), L = _(() => !r.value && !f.value && !te.value), R = _(() => r.value && r.value.state !== "ready" && !(Y.value && r.value.state === "needs-admin-approval" && B.includes(r.value.reason ?? "")));
|
|
2709
|
+
async function A() {
|
|
2695
2710
|
if (k) return;
|
|
2696
|
-
const [
|
|
2711
|
+
const [ee, X, Q] = await Promise.allSettled([o.ctx.call("delegate.status"), o.ctx.call("delegate.list"), o.ctx.call("delegate.jobs.list")]);
|
|
2697
2712
|
if (k) return;
|
|
2698
|
-
|
|
2699
|
-
const de = [
|
|
2713
|
+
ee.status === "fulfilled" && (r.value = ee.value), X.status === "fulfilled" && (c.value = (X.value.delegations ?? []).filter((he) => !he.revoked)), Q.status === "fulfilled" && (m.value = Q.value.jobs ?? []);
|
|
2714
|
+
const de = [ee, X, Q].find((he) => he.status === "rejected");
|
|
2700
2715
|
if (te.value = de && Ce(de.reason), de && !te.value) throw de.reason;
|
|
2701
2716
|
}
|
|
2702
|
-
async function
|
|
2717
|
+
async function q(ee) {
|
|
2703
2718
|
if (!(d.value || k)) {
|
|
2704
|
-
d.value = !0,
|
|
2719
|
+
d.value = !0, f.value = void 0;
|
|
2705
2720
|
try {
|
|
2706
|
-
await
|
|
2721
|
+
await ee();
|
|
2707
2722
|
} catch (X) {
|
|
2708
|
-
k || (
|
|
2723
|
+
k || (f.value = X);
|
|
2709
2724
|
} finally {
|
|
2710
2725
|
k || (d.value = !1);
|
|
2711
2726
|
}
|
|
2712
2727
|
}
|
|
2713
2728
|
}
|
|
2714
|
-
const M = () =>
|
|
2729
|
+
const M = () => q(A);
|
|
2715
2730
|
Ke(() => te.value, M);
|
|
2716
|
-
const
|
|
2717
|
-
await o.ctx.call("delegate.revoke", { delegation_id:
|
|
2718
|
-
}), H = (
|
|
2719
|
-
const X = await o.ctx.call("delegate.jobs.cancel", { id:
|
|
2720
|
-
k || (
|
|
2721
|
-
}),
|
|
2722
|
-
|
|
2723
|
-
}), re = (
|
|
2724
|
-
const X = new Date(
|
|
2731
|
+
const se = (ee) => q(async () => {
|
|
2732
|
+
await o.ctx.call("delegate.revoke", { delegation_id: ee }), await A();
|
|
2733
|
+
}), H = (ee) => q(async () => {
|
|
2734
|
+
const X = await o.ctx.call("delegate.jobs.cancel", { id: ee });
|
|
2735
|
+
k || (x.value = X.revocation_pending ? a.value.pending : ""), await A();
|
|
2736
|
+
}), G = _(() => r.value?.state === "ready" && !!w.value && !!C.value && !!E.value), le = () => q(async () => {
|
|
2737
|
+
G.value && (await o.ctx.call("delegate.jobs.submit", { key: N ?? (N = crypto.randomUUID()), url: C.value, dest: w.value, name: E.value }), k || (C.value = "", E.value = "", w.value = ""), await A());
|
|
2738
|
+
}), re = (ee) => {
|
|
2739
|
+
const X = new Date(ee);
|
|
2725
2740
|
return Number.isNaN(X.getTime()) ? "—" : X.toLocaleString(o.ctx.locale);
|
|
2726
2741
|
};
|
|
2727
|
-
return
|
|
2742
|
+
return p({ refresh: M }), Se(() => {
|
|
2728
2743
|
M(), T = setInterval(() => {
|
|
2729
|
-
|
|
2744
|
+
m.value.some(F) && M();
|
|
2730
2745
|
}, 3e3);
|
|
2731
|
-
}),
|
|
2746
|
+
}), we(() => {
|
|
2732
2747
|
k = !0, T && clearInterval(T), u.dispose();
|
|
2733
|
-
}), (
|
|
2748
|
+
}), (ee, X) => (l(), b(e(ke), {
|
|
2734
2749
|
title: a.value.title,
|
|
2735
2750
|
description: a.value.help,
|
|
2736
2751
|
collapsible: !1,
|
|
2737
|
-
"aria-busy": d.value ||
|
|
2752
|
+
"aria-busy": d.value || L.value,
|
|
2738
2753
|
class: "delegate-panel"
|
|
2739
2754
|
}, {
|
|
2740
2755
|
default: n(() => [
|
|
2741
|
-
|
|
2756
|
+
f.value && !K.value ? (l(), b(e(j), {
|
|
2742
2757
|
key: 0,
|
|
2743
2758
|
tone: "danger",
|
|
2744
2759
|
role: "alert"
|
|
2745
2760
|
}, {
|
|
2746
2761
|
default: n(() => [
|
|
2747
|
-
h(s(e(Ya)(
|
|
2762
|
+
h(s(e(Ya)(f.value, t.ctx.locale) ?? e(Qa)(f.value, a.value, t.ctx.locale, t.ctx.displayName)), 1)
|
|
2748
2763
|
]),
|
|
2749
2764
|
_: 1
|
|
2750
2765
|
})) : g("", !0),
|
|
2751
|
-
te.value ? (l(), b(e(
|
|
2766
|
+
te.value ? (l(), b(e(j), {
|
|
2752
2767
|
key: 1,
|
|
2753
2768
|
tone: "info",
|
|
2754
2769
|
role: "status"
|
|
@@ -2758,11 +2773,11 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2758
2773
|
]),
|
|
2759
2774
|
_: 1
|
|
2760
2775
|
})) : g("", !0),
|
|
2761
|
-
|
|
2762
|
-
|
|
2776
|
+
x.value ? (l(), $("p", hn, s(x.value), 1)) : g("", !0),
|
|
2777
|
+
R.value ? (l(), $("p", kn, s(r.value?.state === "needs-admin-approval" ? a.value.needs : a.value.blocked), 1)) : g("", !0),
|
|
2763
2778
|
v(e(Me), {
|
|
2764
2779
|
direction: "vertical",
|
|
2765
|
-
onSubmit: qe(
|
|
2780
|
+
onSubmit: qe(le, ["prevent"])
|
|
2766
2781
|
}, {
|
|
2767
2782
|
default: n(() => [
|
|
2768
2783
|
v(e($e), {
|
|
@@ -2772,8 +2787,8 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2772
2787
|
default: n(() => [
|
|
2773
2788
|
v(e(ze), {
|
|
2774
2789
|
id: "delegate-url",
|
|
2775
|
-
modelValue:
|
|
2776
|
-
"onUpdate:modelValue": X[0] || (X[0] = (
|
|
2790
|
+
modelValue: C.value,
|
|
2791
|
+
"onUpdate:modelValue": X[0] || (X[0] = (Q) => C.value = Q),
|
|
2777
2792
|
type: "url",
|
|
2778
2793
|
disabled: d.value || r.value?.state !== "ready"
|
|
2779
2794
|
}, null, 8, ["modelValue", "disabled"])
|
|
@@ -2787,18 +2802,18 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2787
2802
|
default: n(() => [
|
|
2788
2803
|
v(e(ze), {
|
|
2789
2804
|
id: "delegate-name",
|
|
2790
|
-
modelValue:
|
|
2791
|
-
"onUpdate:modelValue": X[1] || (X[1] = (
|
|
2805
|
+
modelValue: E.value,
|
|
2806
|
+
"onUpdate:modelValue": X[1] || (X[1] = (Q) => E.value = Q),
|
|
2792
2807
|
"data-file-name": "",
|
|
2793
2808
|
disabled: d.value || r.value?.state !== "ready"
|
|
2794
2809
|
}, null, 8, ["modelValue", "disabled"])
|
|
2795
2810
|
]),
|
|
2796
2811
|
_: 1
|
|
2797
2812
|
}, 8, ["label"]),
|
|
2798
|
-
|
|
2799
|
-
|
|
2813
|
+
S("p", null, s(a.value.size), 1),
|
|
2814
|
+
w.value ? (l(), $("p", wn, [
|
|
2800
2815
|
h(s(a.value.destination) + s(i.value), 1),
|
|
2801
|
-
v(e(Ue), { path:
|
|
2816
|
+
v(e(Ue), { path: w.value }, null, 8, ["path"])
|
|
2802
2817
|
])) : g("", !0),
|
|
2803
2818
|
v(e(aa), null, {
|
|
2804
2819
|
default: n(() => [
|
|
@@ -2806,7 +2821,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2806
2821
|
type: "button",
|
|
2807
2822
|
variant: "secondary",
|
|
2808
2823
|
disabled: d.value || r.value?.state !== "ready",
|
|
2809
|
-
onClick: X[2] || (X[2] = (
|
|
2824
|
+
onClick: X[2] || (X[2] = (Q) => P.value = !0)
|
|
2810
2825
|
}, {
|
|
2811
2826
|
default: n(() => [
|
|
2812
2827
|
h(s(a.value.choose), 1)
|
|
@@ -2816,7 +2831,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2816
2831
|
v(e(V), {
|
|
2817
2832
|
type: "submit",
|
|
2818
2833
|
variant: "primary",
|
|
2819
|
-
disabled: d.value || !
|
|
2834
|
+
disabled: d.value || !G.value
|
|
2820
2835
|
}, {
|
|
2821
2836
|
default: n(() => [
|
|
2822
2837
|
h(s(a.value.submit), 1)
|
|
@@ -2830,74 +2845,74 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2830
2845
|
_: 1
|
|
2831
2846
|
}),
|
|
2832
2847
|
v(ta, {
|
|
2833
|
-
open:
|
|
2834
|
-
"onUpdate:open": X[3] || (X[3] = (
|
|
2848
|
+
open: P.value,
|
|
2849
|
+
"onUpdate:open": X[3] || (X[3] = (Q) => P.value = Q),
|
|
2835
2850
|
locale: t.ctx.locale,
|
|
2836
2851
|
name: t.ctx.displayName,
|
|
2837
2852
|
provider: e(u),
|
|
2838
2853
|
mode: "folder",
|
|
2839
|
-
onSelected: X[4] || (X[4] = (
|
|
2854
|
+
onSelected: X[4] || (X[4] = (Q) => w.value = Q)
|
|
2840
2855
|
}, null, 8, ["open", "locale", "name", "provider"]),
|
|
2841
|
-
v(e(
|
|
2856
|
+
v(e(ke), {
|
|
2842
2857
|
title: a.value.downloads,
|
|
2843
2858
|
collapsible: !1,
|
|
2844
2859
|
class: "delegate-group"
|
|
2845
2860
|
}, {
|
|
2846
2861
|
default: n(() => [
|
|
2847
|
-
|
|
2848
|
-
v(e(
|
|
2862
|
+
L.value ? (l(), $("p", _n, [
|
|
2863
|
+
v(e(Fe), {
|
|
2849
2864
|
width: "12rem",
|
|
2850
2865
|
height: "20px"
|
|
2851
2866
|
})
|
|
2852
|
-
])) : !
|
|
2853
|
-
(l(!0), $(
|
|
2854
|
-
key:
|
|
2855
|
-
"data-job-state":
|
|
2867
|
+
])) : !m.value.length && !f.value ? (l(), $("p", xn, s(a.value.noJobs), 1)) : (l(), $("ul", Cn, [
|
|
2868
|
+
(l(!0), $(oe, null, ge(m.value, (Q) => (l(), $("li", {
|
|
2869
|
+
key: Q.id,
|
|
2870
|
+
"data-job-state": Q.state
|
|
2856
2871
|
}, [
|
|
2857
|
-
|
|
2858
|
-
role:
|
|
2859
|
-
}, s(
|
|
2860
|
-
|
|
2872
|
+
S("span", {
|
|
2873
|
+
role: Q.state === "waiting_executor" ? "status" : void 0
|
|
2874
|
+
}, s(Q.name) + " · " + s(a.value[Q.state]), 9, Sn),
|
|
2875
|
+
F(Q) ? (l(), b(e(V), {
|
|
2861
2876
|
key: 0,
|
|
2862
2877
|
variant: "secondary",
|
|
2863
2878
|
disabled: d.value,
|
|
2864
|
-
onClick: (de) => H(
|
|
2879
|
+
onClick: (de) => H(Q.id)
|
|
2865
2880
|
}, {
|
|
2866
2881
|
default: n(() => [
|
|
2867
2882
|
h(s(a.value.cancel), 1)
|
|
2868
2883
|
]),
|
|
2869
2884
|
_: 1
|
|
2870
2885
|
}, 8, ["disabled", "onClick"])) : g("", !0)
|
|
2871
|
-
], 8,
|
|
2886
|
+
], 8, $n))), 128))
|
|
2872
2887
|
]))
|
|
2873
2888
|
]),
|
|
2874
2889
|
_: 1
|
|
2875
2890
|
}, 8, ["title"]),
|
|
2876
|
-
v(e(
|
|
2891
|
+
v(e(ke), {
|
|
2877
2892
|
title: a.value.delegations,
|
|
2878
2893
|
collapsible: !1,
|
|
2879
2894
|
class: "delegate-group"
|
|
2880
2895
|
}, {
|
|
2881
2896
|
default: n(() => [
|
|
2882
|
-
|
|
2883
|
-
v(e(
|
|
2897
|
+
L.value ? (l(), $("p", Pn, [
|
|
2898
|
+
v(e(Fe), {
|
|
2884
2899
|
width: "12rem",
|
|
2885
2900
|
height: "20px"
|
|
2886
2901
|
})
|
|
2887
|
-
])) : !c.value.length && !
|
|
2888
|
-
(l(!0), $(
|
|
2889
|
-
key:
|
|
2902
|
+
])) : !c.value.length && !f.value ? (l(), $("p", En, s(a.value.noDelegations), 1)) : (l(), $("ul", Tn, [
|
|
2903
|
+
(l(!0), $(oe, null, ge(c.value, (Q) => (l(), $("li", {
|
|
2904
|
+
key: Q.delegation_id
|
|
2890
2905
|
}, [
|
|
2891
|
-
|
|
2906
|
+
S("div", null, [
|
|
2892
2907
|
v(e(Ue), {
|
|
2893
|
-
path:
|
|
2908
|
+
path: Q.path
|
|
2894
2909
|
}, null, 8, ["path"]),
|
|
2895
|
-
|
|
2910
|
+
S("p", null, s(a.value.expires) + s(i.value) + s(re(Q.expires_at)), 1)
|
|
2896
2911
|
]),
|
|
2897
2912
|
v(e(V), {
|
|
2898
2913
|
variant: "secondary",
|
|
2899
2914
|
disabled: d.value,
|
|
2900
|
-
onClick: (de) =>
|
|
2915
|
+
onClick: (de) => se(Q.delegation_id)
|
|
2901
2916
|
}, {
|
|
2902
2917
|
default: n(() => [
|
|
2903
2918
|
h(s(a.value.revoke), 1)
|
|
@@ -2913,19 +2928,19 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2913
2928
|
_: 1
|
|
2914
2929
|
}, 8, ["title", "description", "aria-busy"]));
|
|
2915
2930
|
}
|
|
2916
|
-
}),
|
|
2931
|
+
}), bo = /* @__PURE__ */ me(zn, [["__scopeId", "data-v-987b56d5"]]), An = { class: "save-alert" }, Rn = { "data-save-error": "" }, In = { class: "save-alert" }, Dn = {
|
|
2917
2932
|
key: 0,
|
|
2918
2933
|
class: "save-reason"
|
|
2919
|
-
},
|
|
2934
|
+
}, Un = {
|
|
2920
2935
|
key: 0,
|
|
2921
2936
|
class: "save-reason"
|
|
2922
|
-
},
|
|
2937
|
+
}, Vn = { class: "save-alert" }, Nn = {
|
|
2923
2938
|
key: 0,
|
|
2924
2939
|
class: "save-help"
|
|
2925
|
-
},
|
|
2940
|
+
}, Bn = { class: "save-actions" }, Ln = {
|
|
2926
2941
|
key: 1,
|
|
2927
2942
|
class: "save-none"
|
|
2928
|
-
},
|
|
2943
|
+
}, On = /* @__PURE__ */ fe({
|
|
2929
2944
|
__name: "BackgroundSaveSettings",
|
|
2930
2945
|
props: {
|
|
2931
2946
|
sdk: {},
|
|
@@ -2937,119 +2952,119 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
2937
2952
|
pickerErrorText: { type: Function }
|
|
2938
2953
|
},
|
|
2939
2954
|
emits: ["authorized", "confirmed", "destinations"],
|
|
2940
|
-
setup(t, { expose:
|
|
2941
|
-
const a = t, i = o, u =
|
|
2955
|
+
setup(t, { expose: p, emit: o }) {
|
|
2956
|
+
const a = t, i = o, u = _(() => fa(a.locale)), r = _(() => Ve(a.locale)), c = Ee(We, void 0), m = _(() => a.ctx ?? (c?.call ? { call: c.call.bind(c) } : void 0)), d = Ba({ get admin() {
|
|
2942
2957
|
return a.admin;
|
|
2943
2958
|
}, get locale() {
|
|
2944
2959
|
return a.locale;
|
|
2945
2960
|
}, get ctx() {
|
|
2946
|
-
return
|
|
2947
|
-
} },
|
|
2948
|
-
let
|
|
2949
|
-
async function
|
|
2961
|
+
return m.value;
|
|
2962
|
+
} }, J), { password: f, busy: x, confirming: P, failure: w, passwordError: C, scope: E, chosen: k, options: T, dynamic: N, canConfirm: te } = d, F = y(), Y = y([]), B = y(!1), K = y(!1), L = y(), R = y(!1), A = y(!1), q = y(!1), M = y(""), se = y(), H = _(() => se.value ?? (B.value ? Ce(d.status.value) : void 0));
|
|
2963
|
+
let G = !1;
|
|
2964
|
+
async function le() {
|
|
2950
2965
|
let ue;
|
|
2951
2966
|
try {
|
|
2952
2967
|
ue = await a.sdk.status();
|
|
2953
|
-
} catch (
|
|
2954
|
-
const Re = Ce(
|
|
2955
|
-
if (!Re &&
|
|
2956
|
-
|
|
2968
|
+
} catch (ae) {
|
|
2969
|
+
const Re = Ce(ae);
|
|
2970
|
+
if (!Re && ae?.code !== "EXECUTOR_UNAVAILABLE") throw ae;
|
|
2971
|
+
G || (se.value = Re, B.value = !Re, F.value = void 0, Y.value = []);
|
|
2957
2972
|
return;
|
|
2958
2973
|
}
|
|
2959
|
-
const pe = await Promise.all((a.picker?.keys ?? []).map((
|
|
2960
|
-
|
|
2974
|
+
const pe = await Promise.all((a.picker?.keys ?? []).map((ae) => a.sdk.destination(ae)));
|
|
2975
|
+
G || (se.value = void 0, B.value = !1, F.value = ue, Y.value = pe, i("destinations", pe));
|
|
2961
2976
|
}
|
|
2962
2977
|
async function re(ue) {
|
|
2963
|
-
if (!(
|
|
2964
|
-
|
|
2978
|
+
if (!(G || K.value)) {
|
|
2979
|
+
K.value = !0, L.value = void 0, R.value = !1;
|
|
2965
2980
|
try {
|
|
2966
2981
|
await ue();
|
|
2967
2982
|
} catch (pe) {
|
|
2968
|
-
|
|
2983
|
+
G || (L.value = pe);
|
|
2969
2984
|
} finally {
|
|
2970
|
-
|
|
2985
|
+
G || (K.value = !1);
|
|
2971
2986
|
}
|
|
2972
2987
|
}
|
|
2973
2988
|
}
|
|
2974
|
-
const
|
|
2989
|
+
const ee = () => re(le), X = () => Promise.all([ee(), a.admin ? d.refresh() : void 0]).then(() => {
|
|
2975
2990
|
});
|
|
2976
|
-
function
|
|
2977
|
-
i("authorized", ue),
|
|
2991
|
+
function Q(ue) {
|
|
2992
|
+
i("authorized", ue), ee();
|
|
2978
2993
|
}
|
|
2979
2994
|
function de(ue) {
|
|
2980
|
-
|
|
2995
|
+
G || (L.value = ue, R.value = !0);
|
|
2981
2996
|
}
|
|
2982
|
-
const
|
|
2997
|
+
const he = _(() => R.value ? a.pickerErrorText?.(L.value) ?? Ye(L.value, u.value, "select", a.locale, a.ctx?.displayName) : Ye(L.value, u.value, "save", a.locale, a.ctx?.displayName)), Ae = (ue) => re(async () => {
|
|
2983
2998
|
if ((await a.sdk.revoke({ delegation_id: ue }))?.revoked !== !0) throw { code: "commit-uncertain" };
|
|
2984
|
-
await
|
|
2985
|
-
}),
|
|
2999
|
+
await le();
|
|
3000
|
+
}), _e = () => re(async () => {
|
|
2986
3001
|
if (a.admin) {
|
|
2987
3002
|
if ((await a.sdk.enable())?.disabled !== !1) throw { code: "commit-uncertain" };
|
|
2988
|
-
await
|
|
3003
|
+
await le();
|
|
2989
3004
|
}
|
|
2990
3005
|
});
|
|
2991
|
-
async function
|
|
3006
|
+
async function J() {
|
|
2992
3007
|
await re(async () => {
|
|
2993
|
-
if (
|
|
2994
|
-
const ue = await a.sdk.status(), pe =
|
|
2995
|
-
if (!
|
|
2996
|
-
if (
|
|
2997
|
-
const
|
|
2998
|
-
if (!pe || !
|
|
3008
|
+
if (G) return;
|
|
3009
|
+
const ue = await a.sdk.status(), pe = E.value?.selection;
|
|
3010
|
+
if (!G) {
|
|
3011
|
+
if (N.value) {
|
|
3012
|
+
const ae = ue.selection;
|
|
3013
|
+
if (!pe || !ae || ae.scope !== k.value || ae.scope !== pe.scope || ae.generation !== pe.generation || ae.root !== pe.root) throw { code: "commit-uncertain" };
|
|
2999
3014
|
const Re = M.value ? [M.value] : a.picker?.keys ?? [];
|
|
3000
3015
|
for (const ya of Re) {
|
|
3001
|
-
if (
|
|
3016
|
+
if (G) return;
|
|
3002
3017
|
let Ie;
|
|
3003
3018
|
try {
|
|
3004
|
-
Ie = await a.sdk.selectDestination({ key: ya, path:
|
|
3019
|
+
Ie = await a.sdk.selectDestination({ key: ya, path: ae.root });
|
|
3005
3020
|
} catch (Ha) {
|
|
3006
|
-
throw
|
|
3021
|
+
throw R.value = !0, Ha;
|
|
3007
3022
|
}
|
|
3008
|
-
if (!Ie?.id || !Ie.username || Ie.path !==
|
|
3009
|
-
if (
|
|
3023
|
+
if (!Ie?.id || !Ie.username || Ie.path !== ae.root || Ie.key !== ya || Ie.lifetime !== "until-revoked") throw { code: "commit-uncertain" };
|
|
3024
|
+
if (G) return;
|
|
3010
3025
|
i("authorized", Ie);
|
|
3011
3026
|
}
|
|
3012
3027
|
}
|
|
3013
|
-
|
|
3028
|
+
G || (A.value = !1, i("confirmed"), await le());
|
|
3014
3029
|
}
|
|
3015
3030
|
});
|
|
3016
3031
|
}
|
|
3017
|
-
function
|
|
3018
|
-
M.value = ue, a.admin &&
|
|
3032
|
+
function ie(ue) {
|
|
3033
|
+
M.value = ue, a.admin && N.value ? A.value = !0 : q.value = !0;
|
|
3019
3034
|
}
|
|
3020
|
-
const
|
|
3021
|
-
const ue =
|
|
3035
|
+
const ne = _(() => F.value?.selection), ye = _(() => !F.value && !B.value && !L.value && !H.value), Pe = _(() => B.value && (!a.admin || d.status.value?.state !== "blocked") || F.value?.scopeMode === "install-selected" && !ne.value), D = _(() => a.admin && B.value && d.status.value?.state === "blocked" && !d.status.value.retry), U = _(() => !!F.value && !Pe.value && !F.value.disabled), O = _(() => a.admin && (Pe.value || B.value && !!d.status.value?.retry)), Z = _(() => a.picker ? ne.value ? Za(a.picker.provider, ne.value.root) : F.value?.scopeMode === "install-selected" ? void 0 : a.picker.provider : void 0), ce = (ue) => a.picker?.labels?.[ue] ?? u.value.folder, z = _(() => {
|
|
3036
|
+
const ue = w.value;
|
|
3022
3037
|
return !ue || "confirm" in ue ? "" : ue.code === "session_ended" ? r.value.session : d.explain(ue) ?? r.value.setupError;
|
|
3023
|
-
}), W =
|
|
3038
|
+
}), W = _(() => a.admin && Pe.value && !A.value), I = _(() => x.value || K.value || d.error.value || !te.value);
|
|
3024
3039
|
function ve() {
|
|
3025
|
-
|
|
3040
|
+
A.value = !1, f.value = "", w.value = void 0, k.value = E.value?.selection?.scope ?? "";
|
|
3026
3041
|
}
|
|
3027
|
-
return Ke(() => H.value, () => Promise.all([
|
|
3028
|
-
|
|
3029
|
-
}),
|
|
3030
|
-
|
|
3031
|
-
}), (ue, pe) => (l(), b(e(
|
|
3042
|
+
return Ke(() => H.value, () => Promise.all([ee(), a.admin ? d.refresh() : void 0])), p({ refresh: X }), Se(() => {
|
|
3043
|
+
ee();
|
|
3044
|
+
}), we(() => {
|
|
3045
|
+
G = !0;
|
|
3046
|
+
}), (ue, pe) => (l(), b(e(ke), {
|
|
3032
3047
|
title: t.title ?? u.value.title,
|
|
3033
|
-
description:
|
|
3048
|
+
description: Pe.value && !A.value ? void 0 : u.value.help,
|
|
3034
3049
|
collapsible: !1,
|
|
3035
|
-
"aria-busy":
|
|
3050
|
+
"aria-busy": K.value || e(x) || ye.value,
|
|
3036
3051
|
class: "background-save-settings"
|
|
3037
3052
|
}, {
|
|
3038
3053
|
default: n(() => [
|
|
3039
|
-
ye.value ? (l(!0), $(
|
|
3040
|
-
key:
|
|
3041
|
-
label: ce(
|
|
3054
|
+
ye.value ? (l(!0), $(oe, { key: 0 }, ge(t.picker?.keys ?? [], (ae) => (l(), b(e(xe), {
|
|
3055
|
+
key: ae,
|
|
3056
|
+
label: ce(ae),
|
|
3042
3057
|
"field-width": "full",
|
|
3043
3058
|
"data-placeholder-row": ""
|
|
3044
3059
|
}, {
|
|
3045
3060
|
default: n(() => [
|
|
3046
|
-
v(e(
|
|
3061
|
+
v(e(Fe), {
|
|
3047
3062
|
width: "20rem",
|
|
3048
3063
|
height: "28px"
|
|
3049
3064
|
})
|
|
3050
3065
|
]),
|
|
3051
3066
|
_: 1
|
|
3052
|
-
}, 8, ["label"]))), 128)) : H.value ? (l(), b(e(
|
|
3067
|
+
}, 8, ["label"]))), 128)) : H.value ? (l(), b(e(j), {
|
|
3053
3068
|
key: 1,
|
|
3054
3069
|
tone: "info",
|
|
3055
3070
|
role: "status"
|
|
@@ -3058,20 +3073,20 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3058
3073
|
h(s(e(Ne)(H.value, t.locale)), 1)
|
|
3059
3074
|
]),
|
|
3060
3075
|
_: 1
|
|
3061
|
-
})) : (l(), $(
|
|
3062
|
-
|
|
3076
|
+
})) : (l(), $(oe, { key: 2 }, [
|
|
3077
|
+
L.value ? (l(), b(e(j), {
|
|
3063
3078
|
key: 0,
|
|
3064
3079
|
tone: "danger",
|
|
3065
3080
|
role: "alert"
|
|
3066
3081
|
}, {
|
|
3067
3082
|
default: n(() => [
|
|
3068
|
-
|
|
3069
|
-
|
|
3083
|
+
S("span", An, [
|
|
3084
|
+
S("span", Rn, s(he.value), 1),
|
|
3070
3085
|
v(e(V), {
|
|
3071
3086
|
variant: "secondary",
|
|
3072
3087
|
size: "sm",
|
|
3073
|
-
disabled:
|
|
3074
|
-
onClick:
|
|
3088
|
+
disabled: K.value,
|
|
3089
|
+
onClick: ee
|
|
3075
3090
|
}, {
|
|
3076
3091
|
default: n(() => [
|
|
3077
3092
|
h(s(u.value.retry), 1)
|
|
@@ -3082,18 +3097,18 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3082
3097
|
]),
|
|
3083
3098
|
_: 1
|
|
3084
3099
|
})) : g("", !0),
|
|
3085
|
-
e(d).error.value ? (l(), b(e(
|
|
3100
|
+
e(d).error.value ? (l(), b(e(j), {
|
|
3086
3101
|
key: 1,
|
|
3087
3102
|
tone: "danger",
|
|
3088
3103
|
role: "alert"
|
|
3089
3104
|
}, {
|
|
3090
3105
|
default: n(() => [
|
|
3091
|
-
|
|
3106
|
+
S("span", In, [
|
|
3092
3107
|
h(s(r.value.setupError), 1),
|
|
3093
3108
|
v(e(V), {
|
|
3094
3109
|
variant: "secondary",
|
|
3095
3110
|
size: "sm",
|
|
3096
|
-
disabled: e(
|
|
3111
|
+
disabled: e(x),
|
|
3097
3112
|
onClick: e(d).refresh
|
|
3098
3113
|
}, {
|
|
3099
3114
|
default: n(() => [
|
|
@@ -3105,45 +3120,45 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3105
3120
|
]),
|
|
3106
3121
|
_: 1
|
|
3107
3122
|
})) : g("", !0),
|
|
3108
|
-
|
|
3123
|
+
z.value ? (l(), b(e(j), {
|
|
3109
3124
|
key: 2,
|
|
3110
3125
|
tone: "danger",
|
|
3111
3126
|
role: "alert"
|
|
3112
3127
|
}, {
|
|
3113
3128
|
default: n(() => [
|
|
3114
|
-
h(s(
|
|
3115
|
-
e(
|
|
3129
|
+
h(s(z.value), 1),
|
|
3130
|
+
e(w) && "reason" in e(w) && e(w).reason ? (l(), $("span", Dn, s(e(w).reason), 1)) : g("", !0)
|
|
3116
3131
|
]),
|
|
3117
3132
|
_: 1
|
|
3118
3133
|
})) : g("", !0),
|
|
3119
|
-
D.value ? (l(), b(e(
|
|
3134
|
+
D.value ? (l(), b(e(j), {
|
|
3120
3135
|
key: 3,
|
|
3121
3136
|
tone: "warning"
|
|
3122
3137
|
}, {
|
|
3123
3138
|
default: n(() => [
|
|
3124
3139
|
h(s(e(d).explain(e(d).status.value) ?? r.value.blocked), 1),
|
|
3125
|
-
e(d).status.value?.reason ? (l(), $("span",
|
|
3140
|
+
e(d).status.value?.reason ? (l(), $("span", Un, s(e(d).status.value.reason), 1)) : g("", !0)
|
|
3126
3141
|
]),
|
|
3127
3142
|
_: 1
|
|
3128
|
-
})) :
|
|
3143
|
+
})) : Pe.value && !t.admin ? (l(), b(ea, {
|
|
3129
3144
|
key: 4,
|
|
3130
3145
|
admin: !1,
|
|
3131
3146
|
locale: t.locale,
|
|
3132
3147
|
files: ""
|
|
3133
3148
|
}, null, 8, ["locale"])) : g("", !0),
|
|
3134
|
-
|
|
3149
|
+
F.value?.disabled ? (l(), b(e(j), {
|
|
3135
3150
|
key: 5,
|
|
3136
3151
|
tone: "warning"
|
|
3137
3152
|
}, {
|
|
3138
3153
|
default: n(() => [
|
|
3139
|
-
|
|
3140
|
-
|
|
3154
|
+
S("span", Vn, [
|
|
3155
|
+
S("span", null, s(u.value.disabled), 1),
|
|
3141
3156
|
t.admin ? (l(), b(e(V), {
|
|
3142
3157
|
key: 0,
|
|
3143
3158
|
variant: "secondary",
|
|
3144
3159
|
size: "sm",
|
|
3145
|
-
disabled:
|
|
3146
|
-
onClick:
|
|
3160
|
+
disabled: K.value,
|
|
3161
|
+
onClick: _e
|
|
3147
3162
|
}, {
|
|
3148
3163
|
default: n(() => [
|
|
3149
3164
|
h(s(u.value.enable), 1)
|
|
@@ -3154,7 +3169,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3154
3169
|
]),
|
|
3155
3170
|
_: 1
|
|
3156
3171
|
})) : g("", !0),
|
|
3157
|
-
U.value &&
|
|
3172
|
+
U.value && Y.value.some((ae) => ae.status === "reselection-required") ? (l(), b(e(j), {
|
|
3158
3173
|
key: 6,
|
|
3159
3174
|
tone: "warning"
|
|
3160
3175
|
}, {
|
|
@@ -3163,7 +3178,7 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3163
3178
|
]),
|
|
3164
3179
|
_: 1
|
|
3165
3180
|
})) : g("", !0),
|
|
3166
|
-
|
|
3181
|
+
O.value || A.value ? (l(), b(Xe(W.value ? ea : "div"), Qe(pa({ key: 7 }, W.value ? { admin: !0, locale: t.locale, files: !0 } : {})), {
|
|
3167
3182
|
default: n(() => [
|
|
3168
3183
|
v(e(Me), {
|
|
3169
3184
|
direction: "vertical",
|
|
@@ -3171,8 +3186,8 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3171
3186
|
onSubmit: qe(e(d).submit, ["prevent"])
|
|
3172
3187
|
}, {
|
|
3173
3188
|
default: n(() => [
|
|
3174
|
-
|
|
3175
|
-
e(
|
|
3189
|
+
A.value ? (l(), $("p", Nn, s(u.value.changeHelp), 1)) : g("", !0),
|
|
3190
|
+
e(N) ? (l(), b(e($e), {
|
|
3176
3191
|
key: 1,
|
|
3177
3192
|
label: u.value.folder,
|
|
3178
3193
|
description: W.value ? u.value.approveHelp : void 0,
|
|
@@ -3182,39 +3197,39 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3182
3197
|
v(e(ma), {
|
|
3183
3198
|
id: "save-scope",
|
|
3184
3199
|
modelValue: e(k),
|
|
3185
|
-
"onUpdate:modelValue": pe[0] || (pe[0] = (
|
|
3200
|
+
"onUpdate:modelValue": pe[0] || (pe[0] = (ae) => Ze(k) ? k.value = ae : null),
|
|
3186
3201
|
options: e(T),
|
|
3187
|
-
disabled: e(
|
|
3202
|
+
disabled: e(x)
|
|
3188
3203
|
}, null, 8, ["modelValue", "options", "disabled"])
|
|
3189
3204
|
]),
|
|
3190
3205
|
_: 1
|
|
3191
3206
|
}, 8, ["label", "description"])) : g("", !0),
|
|
3192
3207
|
v(e($e), {
|
|
3193
3208
|
label: u.value.password,
|
|
3194
|
-
description: e(
|
|
3195
|
-
help: e(
|
|
3196
|
-
"validate-status": e(
|
|
3209
|
+
description: e(P) ? r.value.confirmingHelp : W.value ? r.value.passwordNote : void 0,
|
|
3210
|
+
help: e(C),
|
|
3211
|
+
"validate-status": e(C) ? "error" : void 0,
|
|
3197
3212
|
"validate-message-display-mode": "text"
|
|
3198
3213
|
}, {
|
|
3199
|
-
after: n(({ classes:
|
|
3214
|
+
after: n(({ classes: ae }) => [
|
|
3200
3215
|
v(e(V), {
|
|
3201
|
-
class: De(
|
|
3216
|
+
class: De(ae.afterItem),
|
|
3202
3217
|
type: "submit",
|
|
3203
3218
|
variant: "primary",
|
|
3204
|
-
loading: e(
|
|
3219
|
+
loading: e(P),
|
|
3205
3220
|
disabled: I.value
|
|
3206
3221
|
}, {
|
|
3207
3222
|
default: n(() => [
|
|
3208
|
-
h(s(
|
|
3223
|
+
h(s(A.value ? u.value.confirmChange : u.value.approve), 1)
|
|
3209
3224
|
]),
|
|
3210
3225
|
_: 1
|
|
3211
3226
|
}, 8, ["class", "loading", "disabled"]),
|
|
3212
|
-
|
|
3227
|
+
A.value ? (l(), b(e(V), {
|
|
3213
3228
|
key: 0,
|
|
3214
|
-
class: De(
|
|
3229
|
+
class: De(ae.afterItem),
|
|
3215
3230
|
type: "button",
|
|
3216
3231
|
variant: "secondary",
|
|
3217
|
-
disabled: e(
|
|
3232
|
+
disabled: e(x),
|
|
3218
3233
|
onClick: ve
|
|
3219
3234
|
}, {
|
|
3220
3235
|
default: n(() => [
|
|
@@ -3226,12 +3241,12 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3226
3241
|
default: n(() => [
|
|
3227
3242
|
v(e(ze), {
|
|
3228
3243
|
id: "save-password",
|
|
3229
|
-
modelValue: e(
|
|
3230
|
-
"onUpdate:modelValue": pe[1] || (pe[1] = (
|
|
3244
|
+
modelValue: e(f),
|
|
3245
|
+
"onUpdate:modelValue": pe[1] || (pe[1] = (ae) => Ze(f) ? f.value = ae : null),
|
|
3231
3246
|
type: "password",
|
|
3232
3247
|
autocomplete: "current-password",
|
|
3233
|
-
invalid: !!e(
|
|
3234
|
-
disabled: e(
|
|
3248
|
+
invalid: !!e(C),
|
|
3249
|
+
disabled: e(x)
|
|
3235
3250
|
}, null, 8, ["modelValue", "invalid", "disabled"])
|
|
3236
3251
|
]),
|
|
3237
3252
|
_: 1
|
|
@@ -3242,35 +3257,35 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3242
3257
|
]),
|
|
3243
3258
|
_: 1
|
|
3244
3259
|
}, 16)) : g("", !0),
|
|
3245
|
-
U.value && !
|
|
3246
|
-
key:
|
|
3247
|
-
label: ce(
|
|
3260
|
+
U.value && !A.value && !O.value ? (l(!0), $(oe, { key: 8 }, ge(Y.value, (ae) => (l(), b(e(xe), {
|
|
3261
|
+
key: ae.key,
|
|
3262
|
+
label: ce(ae.key),
|
|
3248
3263
|
"field-width": "full",
|
|
3249
3264
|
"data-save-row": "folder"
|
|
3250
3265
|
}, {
|
|
3251
3266
|
default: n(() => [
|
|
3252
|
-
|
|
3253
|
-
|
|
3267
|
+
S("div", Bn, [
|
|
3268
|
+
ae.status === "active" && ae.destination ? (l(), b(e(Ue), {
|
|
3254
3269
|
key: 0,
|
|
3255
|
-
path:
|
|
3256
|
-
}, null, 8, ["path"])) : (l(), $("span",
|
|
3270
|
+
path: ae.destination.path
|
|
3271
|
+
}, null, 8, ["path"])) : (l(), $("span", Ln, s(u.value.folderNone), 1)),
|
|
3257
3272
|
v(e(V), {
|
|
3258
3273
|
variant: "secondary",
|
|
3259
3274
|
size: "sm",
|
|
3260
|
-
disabled:
|
|
3261
|
-
onClick: (Re) =>
|
|
3275
|
+
disabled: K.value || e(x) || (t.admin && F.value?.scopeMode === "install-selected" ? !e(N) || e(d).error.value : !Z.value),
|
|
3276
|
+
onClick: (Re) => ie(ae.key)
|
|
3262
3277
|
}, {
|
|
3263
3278
|
default: n(() => [
|
|
3264
3279
|
h(s(u.value.choose), 1)
|
|
3265
3280
|
]),
|
|
3266
3281
|
_: 1
|
|
3267
3282
|
}, 8, ["disabled", "onClick"]),
|
|
3268
|
-
|
|
3283
|
+
ae.status === "active" && ae.destination ? (l(), b(e(V), {
|
|
3269
3284
|
key: 2,
|
|
3270
3285
|
variant: "ghost",
|
|
3271
3286
|
size: "sm",
|
|
3272
|
-
disabled:
|
|
3273
|
-
onClick: (Re) => Ae(
|
|
3287
|
+
disabled: K.value,
|
|
3288
|
+
onClick: (Re) => Ae(ae.destination.id)
|
|
3274
3289
|
}, {
|
|
3275
3290
|
default: n(() => [
|
|
3276
3291
|
h(s(u.value.revoke), 1)
|
|
@@ -3283,16 +3298,16 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3283
3298
|
}, 1032, ["label"]))), 128)) : g("", !0)
|
|
3284
3299
|
], 64)),
|
|
3285
3300
|
be(ue.$slots, "default", {}, void 0, !0),
|
|
3286
|
-
|
|
3287
|
-
key:
|
|
3288
|
-
open:
|
|
3289
|
-
"onUpdate:open": pe[2] || (pe[2] = (
|
|
3290
|
-
provider:
|
|
3301
|
+
Z.value ? (l(), b(ta, {
|
|
3302
|
+
key: ne.value?.scope,
|
|
3303
|
+
open: q.value,
|
|
3304
|
+
"onUpdate:open": pe[2] || (pe[2] = (ae) => q.value = ae),
|
|
3305
|
+
provider: Z.value,
|
|
3291
3306
|
locale: t.locale,
|
|
3292
3307
|
name: t.ctx?.displayName,
|
|
3293
3308
|
mode: "folder",
|
|
3294
3309
|
destination: { key: M.value, selectDestination: t.sdk.selectDestination },
|
|
3295
|
-
onAuthorized:
|
|
3310
|
+
onAuthorized: Q,
|
|
3296
3311
|
onRefused: de,
|
|
3297
3312
|
"error-text": t.pickerErrorText
|
|
3298
3313
|
}, null, 8, ["open", "provider", "locale", "name", "destination", "error-text"])) : g("", !0)
|
|
@@ -3300,10 +3315,10 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3300
3315
|
_: 3
|
|
3301
3316
|
}, 8, ["title", "description", "aria-busy"]));
|
|
3302
3317
|
}
|
|
3303
|
-
}), Fn = /* @__PURE__ */ me(
|
|
3318
|
+
}), Fn = /* @__PURE__ */ me(On, [["__scopeId", "data-v-79ce68f8"]]), qn = { class: "background-save-panel" }, Mn = {
|
|
3304
3319
|
key: 1,
|
|
3305
3320
|
class: "save-example"
|
|
3306
|
-
},
|
|
3321
|
+
}, Kn = { class: "save-help" }, Hn = { class: "save-actions" }, Xn = /* @__PURE__ */ fe({
|
|
3307
3322
|
__name: "BackgroundSavePanel",
|
|
3308
3323
|
props: {
|
|
3309
3324
|
sdk: {},
|
|
@@ -3316,25 +3331,25 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3316
3331
|
sampleSave: { type: Boolean }
|
|
3317
3332
|
},
|
|
3318
3333
|
emits: ["authorized"],
|
|
3319
|
-
setup(t, { expose:
|
|
3320
|
-
const a = t, i = o, u =
|
|
3321
|
-
async function
|
|
3322
|
-
if (
|
|
3323
|
-
|
|
3324
|
-
const
|
|
3334
|
+
setup(t, { expose: p, emit: o }) {
|
|
3335
|
+
const a = t, i = o, u = _(() => fa(a.locale)), r = _(() => Ea(a.locale)), c = y([]), m = y(), d = () => (x.value = void 0, m.value?.refresh() ?? Promise.resolve()), f = y(!1), x = y();
|
|
3336
|
+
async function P(C) {
|
|
3337
|
+
if (f.value) return;
|
|
3338
|
+
f.value = !0, x.value = void 0;
|
|
3339
|
+
const E = "example-" + Array.from(crypto.getRandomValues(new Uint8Array(16)), (k) => k.toString(16).padStart(2, "0")).join("");
|
|
3325
3340
|
try {
|
|
3326
|
-
await a.sdk.exportExample({ key:
|
|
3341
|
+
await a.sdk.exportExample({ key: C, job_id: E });
|
|
3327
3342
|
} catch (k) {
|
|
3328
|
-
|
|
3343
|
+
x.value = k;
|
|
3329
3344
|
} finally {
|
|
3330
|
-
|
|
3345
|
+
f.value = !1;
|
|
3331
3346
|
}
|
|
3332
3347
|
}
|
|
3333
|
-
const
|
|
3334
|
-
return
|
|
3348
|
+
const w = (C) => a.picker?.labels?.[C] ? `${u.value.example}${r.value}${a.picker.labels[C]}` : u.value.example;
|
|
3349
|
+
return p({ refresh: d }), (C, E) => (l(), $("div", qn, [
|
|
3335
3350
|
v(Fn, {
|
|
3336
3351
|
ref_key: "settings",
|
|
3337
|
-
ref:
|
|
3352
|
+
ref: m,
|
|
3338
3353
|
sdk: t.sdk,
|
|
3339
3354
|
admin: t.admin,
|
|
3340
3355
|
locale: t.locale,
|
|
@@ -3342,31 +3357,31 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3342
3357
|
picker: t.picker,
|
|
3343
3358
|
ctx: t.ctx,
|
|
3344
3359
|
"picker-error-text": t.pickerErrorText,
|
|
3345
|
-
onAuthorized:
|
|
3346
|
-
onDestinations:
|
|
3360
|
+
onAuthorized: E[0] || (E[0] = (k) => i("authorized", k)),
|
|
3361
|
+
onDestinations: E[1] || (E[1] = (k) => c.value = k.filter((T) => T.status === "active"))
|
|
3347
3362
|
}, {
|
|
3348
3363
|
default: n(() => [
|
|
3349
|
-
|
|
3364
|
+
x.value ? (l(), b(e(j), {
|
|
3350
3365
|
key: 0,
|
|
3351
3366
|
tone: "danger",
|
|
3352
3367
|
role: "alert"
|
|
3353
3368
|
}, {
|
|
3354
3369
|
default: n(() => [
|
|
3355
|
-
h(s(e(Ye)(
|
|
3370
|
+
h(s(e(Ye)(x.value, u.value, "save", t.locale, t.ctx?.displayName)), 1)
|
|
3356
3371
|
]),
|
|
3357
3372
|
_: 1
|
|
3358
3373
|
})) : g("", !0),
|
|
3359
|
-
t.sampleSave && c.value.length ? (l(), $("div",
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
(l(!0), $(
|
|
3374
|
+
t.sampleSave && c.value.length ? (l(), $("div", Mn, [
|
|
3375
|
+
S("p", Kn, s(u.value.exampleHelp), 1),
|
|
3376
|
+
S("div", Hn, [
|
|
3377
|
+
(l(!0), $(oe, null, ge(c.value, (k) => (l(), b(e(V), {
|
|
3363
3378
|
key: k.key,
|
|
3364
3379
|
variant: "secondary",
|
|
3365
|
-
disabled:
|
|
3366
|
-
onClick: (T) =>
|
|
3380
|
+
disabled: f.value,
|
|
3381
|
+
onClick: (T) => P(k.key)
|
|
3367
3382
|
}, {
|
|
3368
3383
|
default: n(() => [
|
|
3369
|
-
h(s(
|
|
3384
|
+
h(s(w(k.key)), 1)
|
|
3370
3385
|
]),
|
|
3371
3386
|
_: 2
|
|
3372
3387
|
}, 1032, ["disabled", "onClick"]))), 128))
|
|
@@ -3377,103 +3392,102 @@ const rl = ["aria-busy", "aria-label"], dl = { class: "file-toolbar file-locatio
|
|
|
3377
3392
|
}, 8, ["sdk", "admin", "locale", "title", "picker", "ctx", "picker-error-text"])
|
|
3378
3393
|
]));
|
|
3379
3394
|
}
|
|
3380
|
-
}),
|
|
3381
|
-
function
|
|
3382
|
-
const { code:
|
|
3383
|
-
return !!Be(t) || typeof
|
|
3395
|
+
}), go = /* @__PURE__ */ me(Xn, [["__scopeId", "data-v-05618cb8"]]);
|
|
3396
|
+
function Wn(t) {
|
|
3397
|
+
const { code: p, message: o } = t ?? {};
|
|
3398
|
+
return !!Be(t) || typeof p == "string" && ["APP_DENIED", "PERMISSION_DENIED", "cross_origin", "origin_required"].includes(p) || p === "bad_response" && /HTTP 40[13]\b/.test(String(o));
|
|
3384
3399
|
}
|
|
3385
3400
|
const Ka = /* @__PURE__ */ Symbol("authorization");
|
|
3386
|
-
function
|
|
3387
|
-
const t =
|
|
3401
|
+
function Gn() {
|
|
3402
|
+
const t = Ee(Ka, void 0);
|
|
3388
3403
|
if (!t) throw Error("authorization controls must be placed inside AuthorizationGate");
|
|
3389
3404
|
return t;
|
|
3390
3405
|
}
|
|
3391
|
-
const
|
|
3406
|
+
const Jn = { class: "authorization-content" }, Yn = ["aria-busy", "data-authorization-state"], Qn = { class: "authorization-body" }, Zn = /* @__PURE__ */ fe({
|
|
3392
3407
|
__name: "AuthorizationGate",
|
|
3393
3408
|
props: {
|
|
3394
3409
|
ctx: {},
|
|
3395
3410
|
name: {}
|
|
3396
3411
|
},
|
|
3397
3412
|
emits: ["ready"],
|
|
3398
|
-
setup(t, { emit:
|
|
3399
|
-
const o = t, a =
|
|
3400
|
-
let
|
|
3401
|
-
const T =
|
|
3402
|
-
function H(
|
|
3403
|
-
if (!
|
|
3404
|
-
return
|
|
3405
|
-
}
|
|
3406
|
-
const
|
|
3407
|
-
function
|
|
3408
|
-
const { code:
|
|
3409
|
-
return
|
|
3413
|
+
setup(t, { emit: p }) {
|
|
3414
|
+
const o = t, a = p, i = y(), u = y(), r = y(!1), c = y(!1), m = y(!1), d = _t();
|
|
3415
|
+
let f = [], x = !1, P = 0, w = !1, C, E = 0, k;
|
|
3416
|
+
const T = _(() => ja(o.ctx.locale, o.name ?? o.ctx.displayName ?? "")), N = _(() => i.value || u.value), te = _(() => N.value?.state === "authorization_required"), F = _(() => ["helper_untrusted", "cli_untrusted"].includes(N.value?.reason || "")), Y = _(() => te.value && !F.value), B = _(() => N.value?.state === "unavailable" ? Ce(N.value) : void 0), K = _(() => B.value ?? { credential_not_ready: "credential", access_denied: "denied", check_failed: "config" }[N.value?.reason ?? ""] ?? "unavailable"), L = _(() => da({ code: N.value?.reason }, o.ctx.locale, o.name ?? o.ctx.displayName)), R = _(() => L.value?.title ?? (N.value ? te.value ? T.value("title") : N.value.state === "ready" ? T.value("ready") : N.value.state === "not_admin" ? T.value("not_admin.title") : N.value.state === "session_expired" ? T.value("session_expired.title") : T.value(K.value + ".title") : T.value("checking"))), A = _(() => L.value?.message ?? (te.value ? T.value("purpose") : N.value?.state === "not_admin" ? T.value("not_admin.body") : N.value?.state === "session_expired" ? T.value("session_expired.body") : N.value?.state === "unavailable" ? T.value(K.value + ".body") : T.value("purpose"))), q = ["grant_missing", "upgrade_reapproval", "helper_untrusted", "cli_untrusted", "grant_incompatible", "package_identity_changed", "maintenance_task_missing", "maintenance_task_mismatch", "helper_health_rejected", "capability_missing"], M = _(() => q.includes(N.value?.reason || "") ? N.value.reason : "unknown"), se = _(() => F.value ? "next.reinstall" : M.value === "grant_missing" ? "next.install" : M.value === "upgrade_reapproval" || M.value === "grant_incompatible" ? "next.update" : "next.repair");
|
|
3417
|
+
function H(J) {
|
|
3418
|
+
if (!J || J.command !== "authorization" || J.schema_version !== 1 || !["ready", "authorization_required", "not_admin", "session_expired", "unavailable"].includes(J.state) || J.reason === "upgrade_reapproval" && J.state !== "authorization_required") throw Error("invalid status");
|
|
3419
|
+
return J;
|
|
3420
|
+
}
|
|
3421
|
+
const G = ["service_unavailable", "request_timeout", "request_canceled", "network", "app_unavailable", "internal", "auth_unavailable", "EXECUTOR_UNAVAILABLE", "EXECUTOR_TIMEOUT", "EXECUTOR_PAUSED"];
|
|
3422
|
+
function le(J) {
|
|
3423
|
+
const { code: ie } = J ?? {}, ne = Ce(J);
|
|
3424
|
+
return ne ? ne === "stopped" ? "APP_STOPPED" : "APP_STARTING" : ie === "credential_not_ready" ? ie : Be(J) ? Be(J) : Wn(J) ? "access_denied" : typeof ie == "string" && G.includes(ie) || ie === void 0 ? "service_unavailable" : "check_failed";
|
|
3410
3425
|
}
|
|
3411
3426
|
let re;
|
|
3412
|
-
function
|
|
3413
|
-
clearTimeout(
|
|
3414
|
-
r.value ?
|
|
3415
|
-
}, ca(
|
|
3427
|
+
function ee() {
|
|
3428
|
+
clearTimeout(C), B.value !== re && (re = B.value, E = 0), B.value && (C = setTimeout(() => {
|
|
3429
|
+
r.value ? w = !0 : de("status");
|
|
3430
|
+
}, ca(E++, B.value)));
|
|
3416
3431
|
}
|
|
3417
3432
|
const X = [1e3, 3e3];
|
|
3418
|
-
async function J
|
|
3419
|
-
const
|
|
3420
|
-
for (let
|
|
3433
|
+
async function Q(J) {
|
|
3434
|
+
const ie = J === "status" && !m.value ? X : [];
|
|
3435
|
+
for (let ne = 0; ; ne++) {
|
|
3421
3436
|
try {
|
|
3422
|
-
const ye = H(await o.ctx.authorization?.[
|
|
3423
|
-
if (ye.state !== "unavailable" ||
|
|
3437
|
+
const ye = H(await o.ctx.authorization?.[J]());
|
|
3438
|
+
if (ye.state !== "unavailable" || ne >= ie.length) return ye;
|
|
3424
3439
|
} catch (ye) {
|
|
3425
|
-
if (["session_required", "credential_not_ready"].includes(ye.code) ||
|
|
3440
|
+
if (["session_required", "credential_not_ready"].includes(ye.code) || ne >= ie.length) throw ye;
|
|
3426
3441
|
}
|
|
3427
|
-
if (await new Promise((ye) => setTimeout(ye,
|
|
3442
|
+
if (await new Promise((ye) => setTimeout(ye, ie[ne])), x) throw Error("disposed");
|
|
3428
3443
|
}
|
|
3429
3444
|
}
|
|
3430
|
-
async function de(
|
|
3431
|
-
if (r.value ||
|
|
3432
|
-
const
|
|
3433
|
-
u.value =
|
|
3445
|
+
async function de(J) {
|
|
3446
|
+
if (r.value || x) return;
|
|
3447
|
+
const ie = ++P;
|
|
3448
|
+
u.value = J === "request" && i.value?.state === "authorization_required" ? i.value : void 0, r.value = !0, c.value = !1, i.value = void 0;
|
|
3434
3449
|
try {
|
|
3435
|
-
const
|
|
3436
|
-
if (
|
|
3437
|
-
i.value =
|
|
3438
|
-
} catch (
|
|
3439
|
-
!
|
|
3450
|
+
const ne = await Q(J);
|
|
3451
|
+
if (x || ie !== P) return;
|
|
3452
|
+
i.value = ne, m.value = ne.state !== "ready", ne.state === "ready" && he(!0), ne.state === "ready" && a("ready");
|
|
3453
|
+
} catch (ne) {
|
|
3454
|
+
!x && ie === P && (i.value = ne.code === "session_required" ? { command: "authorization", schema_version: 1, state: "session_expired", reason: "session_expired" } : u.value || { command: "authorization", schema_version: 1, state: "unavailable", reason: le(ne) }, c.value = !L.value && K.value === "unavailable", m.value = !0);
|
|
3440
3455
|
} finally {
|
|
3441
|
-
!
|
|
3456
|
+
!x && ie === P && (r.value = !1, u.value = void 0, w ? (w = !1, de("status")) : ee());
|
|
3442
3457
|
}
|
|
3443
3458
|
}
|
|
3444
|
-
function
|
|
3445
|
-
const
|
|
3446
|
-
|
|
3459
|
+
function he(J) {
|
|
3460
|
+
const ie = f;
|
|
3461
|
+
f = [], ie.forEach((ne) => ne(J));
|
|
3447
3462
|
}
|
|
3448
|
-
function Ae(
|
|
3449
|
-
|
|
3463
|
+
function Ae(J) {
|
|
3464
|
+
m.value = J, J || he(!1);
|
|
3450
3465
|
}
|
|
3451
|
-
function
|
|
3452
|
-
return i.value?.state === "ready" ? Promise.resolve(!0) : (r.value || (
|
|
3466
|
+
function _e() {
|
|
3467
|
+
return i.value?.state === "ready" ? Promise.resolve(!0) : (r.value || (m.value = !0), new Promise((J) => f.push(J)));
|
|
3453
3468
|
}
|
|
3454
|
-
return Le(Ka, { state:
|
|
3469
|
+
return Le(Ka, { state: _(() => i.value?.state ?? "checking"), requireAuthorization: _e, text: T, busy: r, canManage: () => !!o.ctx.authorization?.canManage?.(), revoke: () => de("revoke") }), Se(() => {
|
|
3455
3470
|
k = o.ctx.reopen(() => {
|
|
3456
|
-
r.value ?
|
|
3471
|
+
r.value ? w = !0 : de("status");
|
|
3457
3472
|
}), de("status");
|
|
3458
3473
|
}), Ra(() => {
|
|
3459
|
-
|
|
3460
|
-
}), (
|
|
3461
|
-
|
|
3462
|
-
be(
|
|
3474
|
+
x = !0, P++, clearTimeout(C), he(!1), typeof k == "function" && k();
|
|
3475
|
+
}), (J, ie) => (l(), $(oe, null, [
|
|
3476
|
+
S("div", Jn, [
|
|
3477
|
+
be(J.$slots, "default", {}, void 0, !0)
|
|
3463
3478
|
]),
|
|
3464
3479
|
v(e(Ge), {
|
|
3465
|
-
open:
|
|
3466
|
-
title:
|
|
3467
|
-
width: "480px",
|
|
3480
|
+
open: m.value && !e(d),
|
|
3481
|
+
title: R.value,
|
|
3468
3482
|
"onUpdate:open": Ae
|
|
3469
3483
|
}, {
|
|
3470
3484
|
footer: n(() => [
|
|
3471
|
-
|
|
3485
|
+
Y.value ? (l(), b(e(V), {
|
|
3472
3486
|
key: 0,
|
|
3473
3487
|
variant: "primary",
|
|
3474
3488
|
loading: r.value,
|
|
3475
3489
|
disabled: r.value,
|
|
3476
|
-
onClick:
|
|
3490
|
+
onClick: ie[0] || (ie[0] = (ne) => de("request"))
|
|
3477
3491
|
}, {
|
|
3478
3492
|
default: n(() => [
|
|
3479
3493
|
h(s(r.value ? T.value("authorizing") : T.value("authorize")), 1)
|
|
@@ -3484,7 +3498,7 @@ const Gn = { class: "authorization-content" }, Jn = ["aria-busy", "data-authoriz
|
|
|
3484
3498
|
variant: "primary",
|
|
3485
3499
|
loading: r.value,
|
|
3486
3500
|
disabled: r.value,
|
|
3487
|
-
onClick:
|
|
3501
|
+
onClick: ie[1] || (ie[1] = (ne) => de("status"))
|
|
3488
3502
|
}, {
|
|
3489
3503
|
default: n(() => [
|
|
3490
3504
|
h(s(r.value ? T.value("checking") : T.value("retry")), 1)
|
|
@@ -3493,24 +3507,24 @@ const Gn = { class: "authorization-content" }, Jn = ["aria-busy", "data-authoriz
|
|
|
3493
3507
|
}, 8, ["loading", "disabled"]))
|
|
3494
3508
|
]),
|
|
3495
3509
|
default: n(() => [
|
|
3496
|
-
|
|
3510
|
+
S("div", {
|
|
3497
3511
|
class: "authorization-view",
|
|
3498
3512
|
"aria-busy": r.value,
|
|
3499
3513
|
"data-authorization-state": i.value?.state || "checking"
|
|
3500
3514
|
}, [
|
|
3501
|
-
|
|
3502
|
-
te.value ? (l(), b(e(
|
|
3515
|
+
S("p", Qn, s(A.value), 1),
|
|
3516
|
+
te.value ? (l(), b(e(j), {
|
|
3503
3517
|
key: 0,
|
|
3504
3518
|
class: "authorization-status",
|
|
3505
3519
|
tone: ["grant_missing", "upgrade_reapproval"].includes(M.value) ? "info" : "warning",
|
|
3506
3520
|
title: T.value("reason." + M.value)
|
|
3507
3521
|
}, {
|
|
3508
3522
|
default: n(() => [
|
|
3509
|
-
h(s(T.value(
|
|
3523
|
+
h(s(T.value(se.value)), 1)
|
|
3510
3524
|
]),
|
|
3511
3525
|
_: 1
|
|
3512
3526
|
}, 8, ["tone", "title"])) : g("", !0),
|
|
3513
|
-
c.value ? (l(), b(e(
|
|
3527
|
+
c.value ? (l(), b(e(j), {
|
|
3514
3528
|
key: 1,
|
|
3515
3529
|
class: "authorization-failed",
|
|
3516
3530
|
tone: "warning"
|
|
@@ -3520,54 +3534,54 @@ const Gn = { class: "authorization-content" }, Jn = ["aria-busy", "data-authoriz
|
|
|
3520
3534
|
]),
|
|
3521
3535
|
_: 1
|
|
3522
3536
|
})) : g("", !0)
|
|
3523
|
-
], 8,
|
|
3537
|
+
], 8, Yn)
|
|
3524
3538
|
]),
|
|
3525
3539
|
_: 1
|
|
3526
3540
|
}, 8, ["open", "title"])
|
|
3527
3541
|
], 64));
|
|
3528
3542
|
}
|
|
3529
|
-
}),
|
|
3543
|
+
}), ho = /* @__PURE__ */ me(Zn, [["__scopeId", "data-v-42db0617"]]), jn = { class: "authorization-setting" }, eo = {
|
|
3530
3544
|
class: "authorization-state",
|
|
3531
3545
|
role: "status"
|
|
3532
|
-
},
|
|
3546
|
+
}, ao = { class: "authorization-revoke-body" }, to = /* @__PURE__ */ fe({
|
|
3533
3547
|
__name: "AuthorizationSettings",
|
|
3534
3548
|
setup(t) {
|
|
3535
|
-
const { state:
|
|
3536
|
-
return (d,
|
|
3537
|
-
v(e(
|
|
3549
|
+
const { state: p, requireAuthorization: o, text: a, busy: i, canManage: u, revoke: r } = Gn(), c = y(!1), m = { checking: "checking", ready: "ready", authorization_required: "state.required", not_admin: "not_admin.title", session_expired: "session_expired.title", unavailable: "state.unavailable" };
|
|
3550
|
+
return (d, f) => (l(), $(oe, null, [
|
|
3551
|
+
v(e(ke), {
|
|
3538
3552
|
title: e(a)("settings.title"),
|
|
3539
3553
|
collapsible: !1
|
|
3540
3554
|
}, {
|
|
3541
3555
|
default: n(() => [
|
|
3542
|
-
v(e(
|
|
3556
|
+
v(e(xe), {
|
|
3543
3557
|
label: e(a)("settings.status"),
|
|
3544
3558
|
description: e(a)("purpose"),
|
|
3545
3559
|
align: "center"
|
|
3546
3560
|
}, {
|
|
3547
3561
|
default: n(() => [
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
e(
|
|
3562
|
+
S("div", jn, [
|
|
3563
|
+
S("span", eo, [
|
|
3564
|
+
e(p) === "ready" ? (l(), b(e(Ia), {
|
|
3551
3565
|
key: 0,
|
|
3552
3566
|
size: 16,
|
|
3553
3567
|
"aria-hidden": "true"
|
|
3554
3568
|
})) : g("", !0),
|
|
3555
|
-
h(s(e(a)(
|
|
3569
|
+
h(s(e(a)(m[e(p)])), 1)
|
|
3556
3570
|
]),
|
|
3557
|
-
e(
|
|
3571
|
+
e(p) === "ready" && e(u)() ? (l(), b(e(V), {
|
|
3558
3572
|
key: 0,
|
|
3559
3573
|
variant: "secondary",
|
|
3560
3574
|
disabled: e(i),
|
|
3561
|
-
onClick:
|
|
3575
|
+
onClick: f[0] || (f[0] = (x) => c.value = !0)
|
|
3562
3576
|
}, {
|
|
3563
3577
|
default: n(() => [
|
|
3564
3578
|
h(s(e(a)("revoke")), 1)
|
|
3565
3579
|
]),
|
|
3566
3580
|
_: 1
|
|
3567
|
-
}, 8, ["disabled"])) : e(
|
|
3581
|
+
}, 8, ["disabled"])) : e(p) !== "ready" && e(p) !== "checking" ? (l(), b(e(V), {
|
|
3568
3582
|
key: 1,
|
|
3569
3583
|
variant: "secondary",
|
|
3570
|
-
onClick:
|
|
3584
|
+
onClick: f[1] || (f[1] = (x) => e(o)())
|
|
3571
3585
|
}, {
|
|
3572
3586
|
default: n(() => [
|
|
3573
3587
|
h(s(e(a)("settings.details")), 1)
|
|
@@ -3583,14 +3597,13 @@ const Gn = { class: "authorization-content" }, Jn = ["aria-busy", "data-authoriz
|
|
|
3583
3597
|
}, 8, ["title"]),
|
|
3584
3598
|
v(e(Ge), {
|
|
3585
3599
|
open: c.value,
|
|
3586
|
-
"onUpdate:open":
|
|
3587
|
-
title: e(a)("revoke.title")
|
|
3588
|
-
width: "480px"
|
|
3600
|
+
"onUpdate:open": f[4] || (f[4] = (x) => c.value = x),
|
|
3601
|
+
title: e(a)("revoke.title")
|
|
3589
3602
|
}, {
|
|
3590
3603
|
footer: n(() => [
|
|
3591
3604
|
v(e(V), {
|
|
3592
3605
|
variant: "secondary",
|
|
3593
|
-
onClick:
|
|
3606
|
+
onClick: f[2] || (f[2] = (x) => c.value = !1)
|
|
3594
3607
|
}, {
|
|
3595
3608
|
default: n(() => [
|
|
3596
3609
|
h(s(e(a)("cancel")), 1)
|
|
@@ -3600,7 +3613,7 @@ const Gn = { class: "authorization-content" }, Jn = ["aria-busy", "data-authoriz
|
|
|
3600
3613
|
v(e(V), {
|
|
3601
3614
|
variant: "danger",
|
|
3602
3615
|
disabled: e(i),
|
|
3603
|
-
onClick:
|
|
3616
|
+
onClick: f[3] || (f[3] = (x) => {
|
|
3604
3617
|
c.value = !1, e(r)();
|
|
3605
3618
|
})
|
|
3606
3619
|
}, {
|
|
@@ -3611,97 +3624,97 @@ const Gn = { class: "authorization-content" }, Jn = ["aria-busy", "data-authoriz
|
|
|
3611
3624
|
}, 8, ["disabled"])
|
|
3612
3625
|
]),
|
|
3613
3626
|
default: n(() => [
|
|
3614
|
-
|
|
3627
|
+
S("p", ao, s(e(a)("revoke.body")), 1)
|
|
3615
3628
|
]),
|
|
3616
3629
|
_: 1
|
|
3617
3630
|
}, 8, ["open", "title"])
|
|
3618
3631
|
], 64));
|
|
3619
3632
|
}
|
|
3620
|
-
}),
|
|
3633
|
+
}), ko = /* @__PURE__ */ me(to, [["__scopeId", "data-v-fc7dce79"]]);
|
|
3621
3634
|
export {
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3635
|
+
uo as AppShell,
|
|
3636
|
+
ho as AuthorizationGate,
|
|
3637
|
+
ko as AuthorizationSettings,
|
|
3638
|
+
mo as BackgroundPanel,
|
|
3639
|
+
go as BackgroundSavePanel,
|
|
3627
3640
|
Fn as BackgroundSaveSettings,
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3641
|
+
xo as DEFAULT_REQUEST_TIMEOUT,
|
|
3642
|
+
bo as DelegatePanel,
|
|
3643
|
+
yo as ExecutorApproval,
|
|
3644
|
+
al as ExecutorNotice,
|
|
3632
3645
|
Ua as ExecutorPreloadKey,
|
|
3633
3646
|
La as ExecutorSettings,
|
|
3634
3647
|
We as ExecutorSetupKey,
|
|
3635
|
-
|
|
3648
|
+
Co as FILE_STATION_APP,
|
|
3636
3649
|
Ma as FileBrowser,
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3650
|
+
vo as FilesPage,
|
|
3651
|
+
$o as LIFECYCLE_RETRY_MAX_MS,
|
|
3652
|
+
So as LIFECYCLE_STARTING_RETRY_MAX_MS,
|
|
3653
|
+
po as LoginPage,
|
|
3641
3654
|
ta as NasPicker,
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3655
|
+
ro as PageActions,
|
|
3656
|
+
Oa as PageActionsTarget,
|
|
3657
|
+
co as PageInfo,
|
|
3658
|
+
Fa as PageInfoTarget,
|
|
3659
|
+
fo as PortalSettings,
|
|
3660
|
+
Po as activePage,
|
|
3648
3661
|
Be as appDenial,
|
|
3649
3662
|
Ce as appLifecycle,
|
|
3650
3663
|
da as appRefusal,
|
|
3651
3664
|
Eo as authorizationCatalogs,
|
|
3652
3665
|
ja as authorizationCopy,
|
|
3653
|
-
|
|
3666
|
+
To as backgroundCatalogs,
|
|
3654
3667
|
Wa as backgroundCopy,
|
|
3655
3668
|
Ja as backgroundErrorCopy,
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3669
|
+
zo as bridgeCatalogs,
|
|
3670
|
+
Ao as bridgeErrorCopy,
|
|
3671
|
+
Ro as catalogs,
|
|
3672
|
+
Io as clientTimeout,
|
|
3660
3673
|
Ga as createBackgroundPickerProvider,
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3674
|
+
Do as createBackgroundSaveFacade,
|
|
3675
|
+
Uo as createDsmSession,
|
|
3676
|
+
Vo as createFileTransfers,
|
|
3677
|
+
Pa as createNasProvider,
|
|
3678
|
+
No as createPortalAccess,
|
|
3679
|
+
io as createSession,
|
|
3680
|
+
Bo as createStandaloneContext,
|
|
3681
|
+
Lo as createStandaloneHost,
|
|
3682
|
+
Oo as decodeResponse,
|
|
3670
3683
|
Fo as delegateCatalogs,
|
|
3671
3684
|
Ve as delegateCopy,
|
|
3672
|
-
|
|
3685
|
+
qo as encodeRequest,
|
|
3673
3686
|
Qa as errorCopy,
|
|
3674
|
-
|
|
3687
|
+
Mo as fileStationPath,
|
|
3675
3688
|
Je as format,
|
|
3676
|
-
|
|
3689
|
+
Ko as identityCatalogs,
|
|
3677
3690
|
Xa as identityCopy,
|
|
3678
3691
|
$a as isFullPage,
|
|
3679
|
-
|
|
3692
|
+
Ea as labelSeparator,
|
|
3680
3693
|
Ne as lifecycleCopy,
|
|
3681
3694
|
Ya as lifecycleRefusal,
|
|
3682
3695
|
ca as lifecycleRetryDelay,
|
|
3683
|
-
|
|
3684
|
-
|
|
3696
|
+
Ho as mergeCatalogs,
|
|
3697
|
+
Xo as nasCatalogs,
|
|
3685
3698
|
Te as nasCopy,
|
|
3686
3699
|
Sa as nasErrorCopy,
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3700
|
+
Wo as openFileInFileStation,
|
|
3701
|
+
Go as openFolderInFileStation,
|
|
3702
|
+
Jo as portalCatalogs,
|
|
3703
|
+
Yo as portalMessages,
|
|
3704
|
+
Qo as protocolCodes,
|
|
3705
|
+
Zo as protocolOps,
|
|
3706
|
+
jo as protocolSchemas,
|
|
3694
3707
|
ba as requestKey,
|
|
3695
|
-
|
|
3708
|
+
es as saveCatalogs,
|
|
3696
3709
|
fa as saveCopy,
|
|
3697
3710
|
Ye as saveError,
|
|
3698
3711
|
Za as scopedPicker,
|
|
3699
|
-
|
|
3712
|
+
as as shellCatalogs,
|
|
3700
3713
|
sa as shellCopy,
|
|
3701
|
-
|
|
3714
|
+
ts as shellPages,
|
|
3702
3715
|
va as uiLocale,
|
|
3703
|
-
|
|
3704
|
-
|
|
3716
|
+
ls as uiLocales,
|
|
3717
|
+
Gn as useAuthorization,
|
|
3705
3718
|
_t as useExecutorPreload,
|
|
3706
3719
|
Va as useExecutorSetup,
|
|
3707
3720
|
$t as useNasRequest
|