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