@cobaltcore-dev/aurora 2.0.0 → 2.1.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/dist/client/ContentHeader-fKKZVu-o.mjs +116 -0
- package/dist/client/ContentHeader-fKKZVu-o.mjs.map +1 -0
- package/dist/client/{DeleteFlavorModal-C2MqUgGR.mjs → DeleteFlavorModal-Be2GFiB_.mjs} +3 -2
- package/dist/client/DeleteFlavorModal-Be2GFiB_.mjs.map +1 -0
- package/dist/client/{RouteIdLevelDefaultError-CSseJ1yG.mjs → RouteIdLevelDefaultError-DPF_x2tG.mjs} +9 -9
- package/dist/client/RouteIdLevelDefaultError-DPF_x2tG.mjs.map +1 -0
- package/dist/client/StorageNotFound-B-zVinVD.mjs +30 -0
- package/dist/client/StorageNotFound-B-zVinVD.mjs.map +1 -0
- package/dist/client/{_flavorId-DYv_StX22.mjs → _flavorId-0PioWpEp.mjs} +4 -4
- package/dist/client/_flavorId-0PioWpEp.mjs.map +1 -0
- package/dist/client/{_flavorId-YV3jCS5g.mjs → _flavorId-B7fp6Nk8.mjs} +3 -3
- package/dist/client/{_flavorId-YV3jCS5g.mjs.map → _flavorId-B7fp6Nk8.mjs.map} +1 -1
- package/dist/client/{_flavorId-CaA4-Pnf.mjs → _flavorId-CgueqKTs.mjs} +3 -3
- package/dist/client/{_flavorId-CaA4-Pnf.mjs.map → _flavorId-CgueqKTs.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-Dpsc7GU4.mjs → _floatingIpId-B8r64AL9.mjs} +3 -3
- package/dist/client/{_floatingIpId-Dpsc7GU4.mjs.map → _floatingIpId-B8r64AL9.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-BeYElanB.mjs → _floatingIpId-lEobpOER.mjs} +2 -2
- package/dist/client/{_floatingIpId-BeYElanB.mjs.map → _floatingIpId-lEobpOER.mjs.map} +1 -1
- package/dist/client/{_imageId-pBSS0YcC.mjs → _imageId-Ccv8PedW.mjs} +3 -3
- package/dist/client/{_imageId-pBSS0YcC.mjs.map → _imageId-Ccv8PedW.mjs.map} +1 -1
- package/dist/client/_imageId-CiqEQB_J.mjs +558 -0
- package/dist/client/{_imageId-mfKp3JHn.mjs.map → _imageId-CiqEQB_J.mjs.map} +1 -1
- package/dist/client/{_imageId-mpXUMCh_.mjs → _imageId-D9LR-02T.mjs} +3 -3
- package/dist/client/{_imageId-mpXUMCh_.mjs.map → _imageId-D9LR-02T.mjs.map} +1 -1
- package/dist/client/{_projectId-BnTBxKfp.mjs → _projectId-BDARsteX.mjs} +3 -3
- package/dist/client/{_projectId-BnTBxKfp.mjs.map → _projectId-BDARsteX.mjs.map} +1 -1
- package/dist/client/{_projectId-CVrdJ52s.mjs → _projectId-CtyAHqhH.mjs} +2 -2
- package/dist/client/{_projectId-CVrdJ52s.mjs.map → _projectId-CtyAHqhH.mjs.map} +1 -1
- package/dist/client/_projectId-D3VOH5lN.mjs +94 -0
- package/dist/client/_projectId-D3VOH5lN.mjs.map +1 -0
- package/dist/client/{_projectId-AjgJX6Gl.mjs → _projectId-ZBk6vka0.mjs} +83 -81
- package/dist/client/_projectId-ZBk6vka0.mjs.map +1 -0
- package/dist/client/{_securityGroupId-AO3wnH8g.mjs → _securityGroupId-BwgZnoiR.mjs} +2 -2
- package/dist/client/{_securityGroupId-AO3wnH8g.mjs.map → _securityGroupId-BwgZnoiR.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-Bq0ZyG6z.mjs → _securityGroupId-Cz2NUHdB.mjs} +3 -3
- package/dist/client/{_securityGroupId-Bq0ZyG6z.mjs.map → _securityGroupId-Cz2NUHdB.mjs.map} +1 -1
- package/dist/client/{_storageType-CzZ4u9x_.mjs → _storageType-BNpP1A2N.mjs} +3 -2
- package/dist/client/_storageType-BNpP1A2N.mjs.map +1 -0
- package/dist/client/_storageType-BxSGKhAI.mjs +15 -0
- package/dist/client/_storageType-BxSGKhAI.mjs.map +1 -0
- package/dist/client/_storageType-DZYCmiLt.mjs +30 -0
- package/dist/client/_storageType-DZYCmiLt.mjs.map +1 -0
- package/dist/client/{_storageType-c-DAu8qr.mjs → _storageType-UqAMP-8d.mjs} +286 -285
- package/dist/client/_storageType-UqAMP-8d.mjs.map +1 -0
- package/dist/client/_storageType-u51_7OwJ.mjs +7 -0
- package/dist/client/_storageType-u51_7OwJ.mjs.map +1 -0
- package/dist/client/components/Errors/RouteIdLevelDefaultError.d.ts +2 -1
- package/dist/client/{flavors-ZudiAiTU.mjs → flavors-Ce3J-cFa.mjs} +2 -2
- package/dist/client/{flavors-ZudiAiTU.mjs.map → flavors-Ce3J-cFa.mjs.map} +1 -1
- package/dist/client/{flavors-Bgq3KZmx.mjs → flavors-D5ThLaXO.mjs} +84 -77
- package/dist/client/flavors-D5ThLaXO.mjs.map +1 -0
- package/dist/client/{floatingips-B1oLH8z6.mjs → floatingips-DXnRlLvV.mjs} +2 -2
- package/dist/client/{floatingips-B1oLH8z6.mjs.map → floatingips-DXnRlLvV.mjs.map} +1 -1
- package/dist/client/{floatingips-BtLg3yEQ.mjs → floatingips-HRbuLxiN.mjs} +3 -3
- package/dist/client/{floatingips-BtLg3yEQ.mjs.map → floatingips-HRbuLxiN.mjs.map} +1 -1
- package/dist/client/{floatingips-BeQEkVH8.mjs → floatingips-nN1kQmsu.mjs} +2 -2
- package/dist/client/{floatingips-BeQEkVH8.mjs.map → floatingips-nN1kQmsu.mjs.map} +1 -1
- package/dist/client/{images-CnTW3bpy.mjs → images-C8M3ysWR.mjs} +3 -3
- package/dist/client/{images-CnTW3bpy.mjs.map → images-C8M3ysWR.mjs.map} +1 -1
- package/dist/client/{images-DZHDYDQu.mjs → images-Cf5R28NR.mjs} +2 -2
- package/dist/client/{images-DZHDYDQu.mjs.map → images-Cf5R28NR.mjs.map} +1 -1
- package/dist/client/index.js +198 -197
- package/dist/client/index.js.map +1 -1
- package/dist/client/{objects-jYQBFzwg.mjs → objects-BudUAfWY.mjs} +4265 -4275
- package/dist/client/objects-BudUAfWY.mjs.map +1 -0
- package/dist/client/objects-Dc7sKUr8.mjs +67 -0
- package/dist/client/objects-Dc7sKUr8.mjs.map +1 -0
- package/dist/client/objects-Dw7oeTq2.mjs +80 -0
- package/dist/client/objects-Dw7oeTq2.mjs.map +1 -0
- package/dist/client/objects-_g7nGIn5.mjs +25 -0
- package/dist/client/objects-_g7nGIn5.mjs.map +1 -0
- package/dist/client/objects-eBxvY6_n.mjs +78 -0
- package/dist/client/objects-eBxvY6_n.mjs.map +1 -0
- package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
- package/dist/client/{securitygroups-BRndk7wh.mjs → securitygroups-67fFxiwt.mjs} +2 -2
- package/dist/client/{securitygroups-BRndk7wh.mjs.map → securitygroups-67fFxiwt.mjs.map} +1 -1
- package/dist/client/{securitygroups--0PS2wbM.mjs → securitygroups-DXrfyuVF.mjs} +3 -3
- package/dist/client/{securitygroups--0PS2wbM.mjs.map → securitygroups-DXrfyuVF.mjs.map} +1 -1
- package/dist/client/{securitygroups-Cs2Op-tu.mjs → securitygroups-WLB1_IM6.mjs} +3 -3
- package/dist/client/{securitygroups-Cs2Op-tu.mjs.map → securitygroups-WLB1_IM6.mjs.map} +1 -1
- package/dist/client/{securitygroups-CdN4yAAw.mjs → securitygroups-o0IXZM6S.mjs} +2 -2
- package/dist/client/{securitygroups-CdN4yAAw.mjs.map → securitygroups-o0IXZM6S.mjs.map} +1 -1
- package/dist/client/serviceCatalog-B3lKWC9V.mjs +6 -0
- package/dist/client/serviceCatalog-B3lKWC9V.mjs.map +1 -0
- package/dist/client/storageProviders-CJ5rOh13.mjs +15 -0
- package/dist/client/storageProviders-CJ5rOh13.mjs.map +1 -0
- package/dist/client/trpcClient.d.ts +96 -3
- package/dist/client/utils/serviceCatalog.d.ts +9 -0
- package/dist/client/utils/storageProviders.d.ts +44 -0
- package/dist/server/index.d.ts +96 -3
- package/dist/server/index.js +1224 -387
- package/package.json +1 -1
- package/dist/client/ContentHeader-CPJbgYWn.mjs +0 -115
- package/dist/client/ContentHeader-CPJbgYWn.mjs.map +0 -1
- package/dist/client/DeleteFlavorModal-C2MqUgGR.mjs.map +0 -1
- package/dist/client/RouteIdLevelDefaultError-CSseJ1yG.mjs.map +0 -1
- package/dist/client/_flavorId-DYv_StX22.mjs.map +0 -1
- package/dist/client/_imageId-mfKp3JHn.mjs +0 -558
- package/dist/client/_projectId-AjgJX6Gl.mjs.map +0 -1
- package/dist/client/_projectId-DgciZslU.mjs +0 -92
- package/dist/client/_projectId-DgciZslU.mjs.map +0 -1
- package/dist/client/_storageType-BRWWJtow.mjs +0 -14
- package/dist/client/_storageType-BRWWJtow.mjs.map +0 -1
- package/dist/client/_storageType-CzZ4u9x_.mjs.map +0 -1
- package/dist/client/_storageType-c-DAu8qr.mjs.map +0 -1
- package/dist/client/_storageType-zeSZe--V.mjs +0 -7
- package/dist/client/_storageType-zeSZe--V.mjs.map +0 -1
- package/dist/client/flavors-Bgq3KZmx.mjs.map +0 -1
- package/dist/client/objects-25xsh4Ia.mjs +0 -66
- package/dist/client/objects-25xsh4Ia.mjs.map +0 -1
- package/dist/client/objects-KXY6dgwq.mjs +0 -82
- package/dist/client/objects-KXY6dgwq.mjs.map +0 -1
- package/dist/client/objects-QryuClU3.mjs +0 -82
- package/dist/client/objects-QryuClU3.mjs.map +0 -1
- package/dist/client/objects-jYQBFzwg.mjs.map +0 -1
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
import { A as e, B as t, D as n, E as r, L as i, M as a, Q as o, at as s, c, g as l, i as u, n as d, ot as f, r as p, rt as m, s as h, x as g } from "./build-WuxXRAqf.mjs";
|
|
2
|
+
import { a as _ } from "./trpcClient-D7gpR7YG.mjs";
|
|
3
|
+
import { t as v } from "./_imageId-Ccv8PedW.mjs";
|
|
4
|
+
import { t as ee } from "./RouteIdLevelDefaultError-DPF_x2tG.mjs";
|
|
5
|
+
import { n as y, t as te } from "./ContentHeader-fKKZVu-o.mjs";
|
|
6
|
+
import { t as ne } from "./useSetBreadcrumb-tn7lBaQV.mjs";
|
|
7
|
+
import { A as b, C as re, D as ie, E as ae, F as x, I as S, N as oe, O as se, P as C, S as ce, T as le, _ as ue, d as de, f as fe, g as pe, k as me, p as he, u as ge, w as _e } from "./ImageToastNotifications-BWfzOUMc.mjs";
|
|
8
|
+
import { t as w } from "./TwoColumnDescriptionList-DKS42RKa.mjs";
|
|
9
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
10
|
+
import O, { useState as k } from "react";
|
|
11
|
+
import { useNavigate as A, useParams as ve, useSearch as ye } from "@tanstack/react-router";
|
|
12
|
+
import { Trans as j, useLingui as M } from "@lingui/react";
|
|
13
|
+
//#region src/client/routes/_auth/projects/$projectId/compute/images/-components/ImageDetailsView.tsx
|
|
14
|
+
var N = ({ image: e, myMemberData: n, canUpdateMember: r, onStatusChange: i, isLoading: o }) => {
|
|
15
|
+
let { i18n: s, _: c } = M(), l = n.status === x.PENDING, d = n.status === x.REJECTED, f = n.created_at ? new Date(n.created_at).toLocaleString() : s._({ id: "fj5byd" }), p = n.updated_at ? new Date(n.updated_at).toLocaleString() : s._({ id: "fj5byd" }), m = e.owner ?? "";
|
|
16
|
+
return /*#__PURE__*/ D(t, { children: [
|
|
17
|
+
l && /*#__PURE__*/ E("p", {
|
|
18
|
+
className: "text-theme-highest font-semibold",
|
|
19
|
+
children: /*#__PURE__*/ E(j, { id: "/EcdUM" })
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ E("p", { children: /*#__PURE__*/ E(j, {
|
|
22
|
+
id: "Uwo8Xw",
|
|
23
|
+
values: {
|
|
24
|
+
ownerProject: m,
|
|
25
|
+
sharedAt: f
|
|
26
|
+
},
|
|
27
|
+
components: { 0: /*#__PURE__*/ E("span", { className: "font-semibold" }) }
|
|
28
|
+
}) }),
|
|
29
|
+
/*#__PURE__*/ D("ul", { children: [
|
|
30
|
+
/*#__PURE__*/ D("li", { children: [
|
|
31
|
+
/*#__PURE__*/ E("span", {
|
|
32
|
+
className: "font-semibold",
|
|
33
|
+
children: /*#__PURE__*/ E(j, { id: "azXlY+" })
|
|
34
|
+
}),
|
|
35
|
+
" ",
|
|
36
|
+
n.status
|
|
37
|
+
] }),
|
|
38
|
+
/*#__PURE__*/ D("li", { children: [
|
|
39
|
+
/*#__PURE__*/ E("span", {
|
|
40
|
+
className: "font-semibold",
|
|
41
|
+
children: /*#__PURE__*/ E(j, { id: "G6AP+o" })
|
|
42
|
+
}),
|
|
43
|
+
" ",
|
|
44
|
+
f
|
|
45
|
+
] }),
|
|
46
|
+
/*#__PURE__*/ D("li", { children: [
|
|
47
|
+
/*#__PURE__*/ E("span", {
|
|
48
|
+
className: "font-semibold",
|
|
49
|
+
children: /*#__PURE__*/ E(j, { id: "pFg+7w" })
|
|
50
|
+
}),
|
|
51
|
+
" ",
|
|
52
|
+
p
|
|
53
|
+
] })
|
|
54
|
+
] }),
|
|
55
|
+
r && (l || d) && /*#__PURE__*/ D(a, { children: [/*#__PURE__*/ E(u, {
|
|
56
|
+
onClick: () => i(x.ACCEPTED),
|
|
57
|
+
disabled: o,
|
|
58
|
+
children: /*#__PURE__*/ E(j, { id: "g3UF2V" })
|
|
59
|
+
}), l && /*#__PURE__*/ E(u, {
|
|
60
|
+
onClick: () => i(x.REJECTED),
|
|
61
|
+
disabled: o,
|
|
62
|
+
children: /*#__PURE__*/ E(j, { id: "1t/NnN" })
|
|
63
|
+
})] })
|
|
64
|
+
] });
|
|
65
|
+
}, P = ({ image: t }) => {
|
|
66
|
+
let { i18n: n, _: r } = M(), i = [
|
|
67
|
+
{
|
|
68
|
+
label: n._({ id: "S0kLOH" }),
|
|
69
|
+
value: /*#__PURE__*/ E(y, { text: t.id })
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: n._({ id: "6YtxFj" }),
|
|
73
|
+
value: t.name
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: n._({ id: "uAQUqI" }),
|
|
77
|
+
value: t.status
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: n._({ id: "Cj2Gtd" }),
|
|
81
|
+
value: /*#__PURE__*/ E(S, { size: t.size })
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: n._({ id: "Cxgv2U" }),
|
|
85
|
+
value: `${t.min_disk} GB`
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: n._({ id: "B2Czeb" }),
|
|
89
|
+
value: `${t.min_ram} MB`
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: n._({ id: "NopYGU" }),
|
|
93
|
+
value: /*#__PURE__*/ E("span", {
|
|
94
|
+
className: "uppercase",
|
|
95
|
+
children: t.disk_format
|
|
96
|
+
})
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: n._({ id: "6/xipy" }),
|
|
100
|
+
value: /*#__PURE__*/ E("span", {
|
|
101
|
+
className: "uppercase",
|
|
102
|
+
children: t.container_format
|
|
103
|
+
})
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: n._({ id: "88kg0+" }),
|
|
107
|
+
value: t.created_at ? new Date(t.created_at).toLocaleDateString() : n._({ id: "fj5byd" })
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
label: n._({ id: "Llcakz" }),
|
|
111
|
+
value: t.updated_at ? new Date(t.updated_at).toLocaleDateString() : n._({ id: "fj5byd" })
|
|
112
|
+
}
|
|
113
|
+
];
|
|
114
|
+
return /*#__PURE__*/ D(e, {
|
|
115
|
+
px: !1,
|
|
116
|
+
py: !0,
|
|
117
|
+
children: [/*#__PURE__*/ E(s, { children: n._({ id: "nW/hX9" }) }), /*#__PURE__*/ E(w, { items: i })]
|
|
118
|
+
});
|
|
119
|
+
}, F = ({ image: t, currentProjectId: n }) => {
|
|
120
|
+
let { i18n: r, _: i } = M(), a = [
|
|
121
|
+
{
|
|
122
|
+
label: t.visibility === "shared" && t.owner !== void 0 && t.owner !== n ? r._({ id: "20axE5" }) : r._({ id: "YsrbQh" }),
|
|
123
|
+
value: t.owner ? /*#__PURE__*/ E(y, { text: t.owner }) : ""
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
label: r._({ id: "2q/Q7x" }),
|
|
127
|
+
value: t.visibility
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
label: r._({ id: "644xgx" }),
|
|
131
|
+
value: t.protected ? r._({ id: "l75CjT" }) : r._({ id: "1UzENP" })
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
label: r._({ id: "PzgYM9" }),
|
|
135
|
+
value: t?.checksum ? t.checksum : ""
|
|
136
|
+
}
|
|
137
|
+
];
|
|
138
|
+
return /*#__PURE__*/ D(e, {
|
|
139
|
+
px: !1,
|
|
140
|
+
py: !0,
|
|
141
|
+
children: [/*#__PURE__*/ E(s, { children: r._({ id: "a3LDKx" }) }), /*#__PURE__*/ E(w, { items: a })]
|
|
142
|
+
});
|
|
143
|
+
}, I = ({ image: t }) => {
|
|
144
|
+
let { i18n: n, _: i } = M(), a = /* @__PURE__ */ new Set([
|
|
145
|
+
"id",
|
|
146
|
+
"name",
|
|
147
|
+
"status",
|
|
148
|
+
"visibility",
|
|
149
|
+
"size",
|
|
150
|
+
"disk_format",
|
|
151
|
+
"container_format",
|
|
152
|
+
"min_disk",
|
|
153
|
+
"min_ram",
|
|
154
|
+
"owner",
|
|
155
|
+
"protected",
|
|
156
|
+
"created_at",
|
|
157
|
+
"updated_at",
|
|
158
|
+
"checksum"
|
|
159
|
+
]), o = Object.entries(t).filter(([e]) => !a.has(e)).sort(([e], [t]) => e.localeCompare(t)), c = o.length > 0;
|
|
160
|
+
return /*#__PURE__*/ D(e, {
|
|
161
|
+
px: !1,
|
|
162
|
+
py: !0,
|
|
163
|
+
children: [/*#__PURE__*/ E(s, { children: n._({ id: "bc67JN" }) }), c ? /*#__PURE__*/ E(h, {
|
|
164
|
+
alignTerms: "right",
|
|
165
|
+
className: "grid-cols-4",
|
|
166
|
+
children: o.map(([e, t]) => /*#__PURE__*/ D(O.Fragment, { children: [/*#__PURE__*/ E(d, {
|
|
167
|
+
className: "col-span-1",
|
|
168
|
+
children: e
|
|
169
|
+
}), /*#__PURE__*/ E(r, {
|
|
170
|
+
className: "col-span-1",
|
|
171
|
+
children: t == null ? /*#__PURE__*/ E("span", { children: "null" }) : typeof t == "object" ? /*#__PURE__*/ E("span", {
|
|
172
|
+
className: "break-all",
|
|
173
|
+
children: JSON.stringify(t)
|
|
174
|
+
}) : typeof t == "boolean" ? t ? n._({ id: "c+xCSz" }) : n._({ id: "ocUvR+" }) : /*#__PURE__*/ E("span", {
|
|
175
|
+
className: "break-all",
|
|
176
|
+
children: String(t)
|
|
177
|
+
})
|
|
178
|
+
})] }, e))
|
|
179
|
+
}) : /*#__PURE__*/ E("p", {
|
|
180
|
+
className: "text-theme-light",
|
|
181
|
+
children: n._({ id: "9v5VLp" })
|
|
182
|
+
})]
|
|
183
|
+
});
|
|
184
|
+
}, L = (e) => {
|
|
185
|
+
let t = "px-6 py-3 font-semibold border-b-2 transition-colors";
|
|
186
|
+
return e ? `${t} border-theme-accent text-theme-highest` : `${t} border-transparent text-theme-secondary hover:text-theme-high`;
|
|
187
|
+
}, R = ({ image: t, permissions: n, currentProjectId: r }) => {
|
|
188
|
+
let [a, o] = k(!1), [s, c] = k(null), { data: l, isLoading: u } = _.compute.listImageMembers.useQuery({
|
|
189
|
+
project_id: r,
|
|
190
|
+
imageId: t.id
|
|
191
|
+
}, { enabled: !!t.id && !!r });
|
|
192
|
+
return /*#__PURE__*/ D(e, {
|
|
193
|
+
px: !1,
|
|
194
|
+
py: !0,
|
|
195
|
+
children: [s && /*#__PURE__*/ E(i, {
|
|
196
|
+
text: s.text,
|
|
197
|
+
variant: s.type,
|
|
198
|
+
onDismiss: () => c(null),
|
|
199
|
+
className: "mb-4"
|
|
200
|
+
}), /*#__PURE__*/ E(b, {
|
|
201
|
+
image: t,
|
|
202
|
+
imageMembers: l,
|
|
203
|
+
isMembersLoading: u,
|
|
204
|
+
canAdd: n?.canCreateMember ?? !1,
|
|
205
|
+
canRemove: n?.canDeleteMember ?? !1,
|
|
206
|
+
isAddingMember: a,
|
|
207
|
+
setIsAddingMember: o,
|
|
208
|
+
setMessage: c,
|
|
209
|
+
projectId: r
|
|
210
|
+
})]
|
|
211
|
+
});
|
|
212
|
+
}, be = ({ image: e, currentProjectId: t, activeTab: n = "details", onTabChange: r, permissions: i, myMemberData: a, onMemberStatusChange: s, isMemberStatusChanging: c, actions: l }) => {
|
|
213
|
+
let { i18n: u, _: d } = M(), f = e.visibility === "shared" && e.owner !== void 0 && e.owner !== t, p = e.owner === t && e.visibility === "shared";
|
|
214
|
+
return /*#__PURE__*/ D(o, {
|
|
215
|
+
direction: "vertical",
|
|
216
|
+
gap: "6",
|
|
217
|
+
children: [
|
|
218
|
+
f && a && s && /*#__PURE__*/ E(N, {
|
|
219
|
+
image: e,
|
|
220
|
+
myMemberData: a,
|
|
221
|
+
canUpdateMember: i?.canUpdateMember ?? !1,
|
|
222
|
+
onStatusChange: s,
|
|
223
|
+
isLoading: c ?? !1
|
|
224
|
+
}),
|
|
225
|
+
p && /*#__PURE__*/ E("div", {
|
|
226
|
+
className: "border-theme-background-lvl-3 border-b",
|
|
227
|
+
children: /*#__PURE__*/ D(o, {
|
|
228
|
+
direction: "horizontal",
|
|
229
|
+
gap: "0",
|
|
230
|
+
children: [/*#__PURE__*/ E("button", {
|
|
231
|
+
className: L(n === "details"),
|
|
232
|
+
onClick: () => r?.("details"),
|
|
233
|
+
children: u._({ id: "URmyfc" })
|
|
234
|
+
}), /*#__PURE__*/ E("button", {
|
|
235
|
+
className: L(n === "sharing"),
|
|
236
|
+
onClick: () => r?.("sharing"),
|
|
237
|
+
children: u._({ id: "aG9OiI" })
|
|
238
|
+
})]
|
|
239
|
+
})
|
|
240
|
+
}),
|
|
241
|
+
(n === "details" || !p) && /*#__PURE__*/ D(T, { children: [
|
|
242
|
+
l,
|
|
243
|
+
/*#__PURE__*/ E(P, { image: e }),
|
|
244
|
+
/*#__PURE__*/ E(F, {
|
|
245
|
+
image: e,
|
|
246
|
+
currentProjectId: t
|
|
247
|
+
}),
|
|
248
|
+
/*#__PURE__*/ E(I, { image: e })
|
|
249
|
+
] }),
|
|
250
|
+
n === "sharing" && p && /*#__PURE__*/ E(R, {
|
|
251
|
+
image: e,
|
|
252
|
+
permissions: i
|
|
253
|
+
})
|
|
254
|
+
]
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/client/routes/_auth/projects/$projectId/compute/images/$imageId.tsx?tsr-split=component
|
|
259
|
+
function xe() {
|
|
260
|
+
let { i18n: e, _: t } = M(), n = A(), { projectId: r } = v.useParams();
|
|
261
|
+
return /*#__PURE__*/ E(ee, { action: /*#__PURE__*/ E(u, {
|
|
262
|
+
variant: "primary",
|
|
263
|
+
onClick: () => n({
|
|
264
|
+
to: "/projects/$projectId/compute/images",
|
|
265
|
+
params: { projectId: r }
|
|
266
|
+
}),
|
|
267
|
+
children: e._({ id: "bnql/K" })
|
|
268
|
+
}) });
|
|
269
|
+
}
|
|
270
|
+
function z() {
|
|
271
|
+
let { projectId: e, imageId: t } = ve({ from: "/_auth/projects/$projectId/compute/images/$imageId" }), { tab: r } = ye({ from: "/_auth/projects/$projectId/compute/images/$imageId" }), i = A(), { i18n: a, _: s } = M(), { data: d, status: h, error: y } = _.compute.getImageById.useQuery({
|
|
272
|
+
project_id: e,
|
|
273
|
+
imageId: t
|
|
274
|
+
});
|
|
275
|
+
ne(v.id, d?.name);
|
|
276
|
+
let { data: b } = _.compute.canUser.useQuery({
|
|
277
|
+
project_id: e,
|
|
278
|
+
permission: [
|
|
279
|
+
"images:delete",
|
|
280
|
+
"images:update",
|
|
281
|
+
"images:create_member",
|
|
282
|
+
"images:delete_member",
|
|
283
|
+
"images:update_member"
|
|
284
|
+
]
|
|
285
|
+
}), x = {
|
|
286
|
+
canDelete: b?.[0] ?? !1,
|
|
287
|
+
canUpdate: b?.[1] ?? !1,
|
|
288
|
+
canCreateMember: b?.[2] ?? !1,
|
|
289
|
+
canDeleteMember: b?.[3] ?? !1,
|
|
290
|
+
canUpdateMember: b?.[4] ?? !1
|
|
291
|
+
}, S = _.useUtils(), [w, O] = k(!1), [N, P] = k(!1), [F, I] = k(!1), [L, R] = k(!1), [z, B] = k(!1), V = _.compute.updateImage.useMutation({ onSuccess: (n) => {
|
|
292
|
+
S.compute.getImageById.setData({
|
|
293
|
+
project_id: e,
|
|
294
|
+
imageId: t
|
|
295
|
+
}, n), S.compute.listImagesWithPagination.invalidate();
|
|
296
|
+
} }), H = _.compute.deleteImage.useMutation({ onSuccess: () => {
|
|
297
|
+
S.compute.listImagesWithPagination.invalidate();
|
|
298
|
+
} }), U = _.compute.deactivateImage.useMutation({ onSuccess: () => {
|
|
299
|
+
S.compute.getImageById.invalidate({
|
|
300
|
+
project_id: e,
|
|
301
|
+
imageId: t
|
|
302
|
+
});
|
|
303
|
+
} }), W = _.compute.reactivateImage.useMutation({ onSuccess: () => {
|
|
304
|
+
S.compute.getImageById.invalidate({
|
|
305
|
+
project_id: e,
|
|
306
|
+
imageId: t
|
|
307
|
+
});
|
|
308
|
+
} }), G = _.compute.updateImageVisibility.useMutation({ onSuccess: (n) => {
|
|
309
|
+
S.compute.getImageById.setData({
|
|
310
|
+
project_id: e,
|
|
311
|
+
imageId: t
|
|
312
|
+
}, n);
|
|
313
|
+
} }), K = d?.visibility === C.SHARED && d?.owner !== void 0 && d?.owner !== e, { data: q } = _.compute.getImageMember.useQuery({
|
|
314
|
+
project_id: e,
|
|
315
|
+
imageId: t,
|
|
316
|
+
memberId: e
|
|
317
|
+
}, { enabled: K && !!t && !!e }), J = _.compute.updateImageMember.useMutation({ onSuccess: () => {
|
|
318
|
+
S.compute.getImageMember.invalidate({
|
|
319
|
+
project_id: e,
|
|
320
|
+
imageId: t,
|
|
321
|
+
memberId: e
|
|
322
|
+
}), S.compute.listImageMembers.invalidate({
|
|
323
|
+
project_id: e,
|
|
324
|
+
imageId: t
|
|
325
|
+
}), S.compute.listImagesWithPagination.invalidate(), S.compute.listSharedImagesByMemberStatus.invalidate();
|
|
326
|
+
} }), Y = async (n) => {
|
|
327
|
+
try {
|
|
328
|
+
await J.mutateAsync({
|
|
329
|
+
project_id: e,
|
|
330
|
+
imageId: t,
|
|
331
|
+
memberId: e,
|
|
332
|
+
status: n
|
|
333
|
+
});
|
|
334
|
+
let { message: r, ...i } = de(n);
|
|
335
|
+
f.info(r, i);
|
|
336
|
+
} catch (e) {
|
|
337
|
+
let t = e?.message, { message: n, ...r } = ge(t);
|
|
338
|
+
f.error(n, r);
|
|
339
|
+
}
|
|
340
|
+
}, X = () => {
|
|
341
|
+
i({
|
|
342
|
+
to: "/projects/$projectId/compute/images",
|
|
343
|
+
params: { projectId: e }
|
|
344
|
+
});
|
|
345
|
+
}, Z = V.isPending || H.isPending || U.isPending || W.isPending || G.isPending, Se = (e, t) => {
|
|
346
|
+
let n = [];
|
|
347
|
+
return Object.entries(e).forEach(([e, r]) => {
|
|
348
|
+
let i = `/${e}`;
|
|
349
|
+
if (r == null) e in t && n.push({
|
|
350
|
+
op: "remove",
|
|
351
|
+
path: i
|
|
352
|
+
});
|
|
353
|
+
else {
|
|
354
|
+
let a = e in t;
|
|
355
|
+
n.push({
|
|
356
|
+
op: a ? "replace" : "add",
|
|
357
|
+
path: i,
|
|
358
|
+
value: r
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
}), n;
|
|
362
|
+
}, Ce = async (n) => {
|
|
363
|
+
if (!d) return !1;
|
|
364
|
+
let r = Se(n, d);
|
|
365
|
+
try {
|
|
366
|
+
await V.mutateAsync({
|
|
367
|
+
project_id: e,
|
|
368
|
+
imageId: t,
|
|
369
|
+
operations: r
|
|
370
|
+
}), O(!1);
|
|
371
|
+
let { message: n, ...i } = ce(String(d.name ?? d.id));
|
|
372
|
+
return f.success(n, i), !0;
|
|
373
|
+
} catch {
|
|
374
|
+
return !1;
|
|
375
|
+
}
|
|
376
|
+
}, we = async (t) => {
|
|
377
|
+
try {
|
|
378
|
+
await H.mutateAsync({
|
|
379
|
+
project_id: e,
|
|
380
|
+
imageId: t.id
|
|
381
|
+
}), I(!1), X();
|
|
382
|
+
} catch {
|
|
383
|
+
I(!1);
|
|
384
|
+
}
|
|
385
|
+
}, Te = async (t) => {
|
|
386
|
+
try {
|
|
387
|
+
await W.mutateAsync({
|
|
388
|
+
project_id: e,
|
|
389
|
+
imageId: t.id
|
|
390
|
+
}), R(!1);
|
|
391
|
+
let { message: n, ...r } = fe(String(t.name ?? t.id));
|
|
392
|
+
f.success(n, r);
|
|
393
|
+
} catch (e) {
|
|
394
|
+
R(!1);
|
|
395
|
+
let { message: n, ...r } = he(t.id, e?.message ?? "");
|
|
396
|
+
f.error(n, r);
|
|
397
|
+
}
|
|
398
|
+
}, Ee = async (t) => {
|
|
399
|
+
try {
|
|
400
|
+
await U.mutateAsync({
|
|
401
|
+
project_id: e,
|
|
402
|
+
imageId: t.id
|
|
403
|
+
}), B(!1);
|
|
404
|
+
let { message: n, ...r } = pe(String(t.name ?? t.id));
|
|
405
|
+
f.success(n, r);
|
|
406
|
+
} catch (e) {
|
|
407
|
+
B(!1);
|
|
408
|
+
let { message: n, ...r } = ue(t.id, e?.message ?? "");
|
|
409
|
+
f.error(n, r);
|
|
410
|
+
}
|
|
411
|
+
}, De = async (t) => {
|
|
412
|
+
if (d) try {
|
|
413
|
+
await G.mutateAsync({
|
|
414
|
+
project_id: e,
|
|
415
|
+
imageId: d.id,
|
|
416
|
+
visibility: t
|
|
417
|
+
});
|
|
418
|
+
let { message: n, ...r } = _e(String(d.name ?? d.id), t);
|
|
419
|
+
f.success(n, r);
|
|
420
|
+
} catch (e) {
|
|
421
|
+
let { message: t, ...n } = re(String(d.name ?? d.id), e?.message ?? "");
|
|
422
|
+
f.error(t, n);
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
if (h === "pending") return /*#__PURE__*/ E(m, {
|
|
426
|
+
status: "progress",
|
|
427
|
+
title: a._({ id: "hH3kDo" })
|
|
428
|
+
});
|
|
429
|
+
if (h === "error") {
|
|
430
|
+
let e = y?.message || a._({ id: "LobdAW" });
|
|
431
|
+
return /*#__PURE__*/ E(ee, {
|
|
432
|
+
errorTitle: a._({ id: "2bUZog" }),
|
|
433
|
+
errorDescription: e,
|
|
434
|
+
action: /*#__PURE__*/ E(u, {
|
|
435
|
+
onClick: X,
|
|
436
|
+
variant: "primary",
|
|
437
|
+
children: /*#__PURE__*/ E(j, { id: "bnql/K" })
|
|
438
|
+
})
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
if (!d) return /*#__PURE__*/ E(xe, {});
|
|
442
|
+
let Q = d.status === oe.DEACTIVATED, Oe = d.visibility === C.PRIVATE, ke = q?.status === "accepted", Ae = d.owner === e, je = K && ke && x.canUpdateMember, Me = !K && x.canUpdate, Ne = !K && x.canDelete && !d.protected, Pe = !K && Ae && d.visibility === C.SHARED && (x.canCreateMember || x.canDeleteMember), $ = je || Me || Ne || Pe, Fe = ($ || !K && x.canUpdate) && /*#__PURE__*/ D(o, {
|
|
443
|
+
gap: "0.5",
|
|
444
|
+
alignment: "center",
|
|
445
|
+
children: [($ || !K && x.canUpdate) && /*#__PURE__*/ D(n, {
|
|
446
|
+
className: "flex items-center",
|
|
447
|
+
children: [/*#__PURE__*/ E(c, {
|
|
448
|
+
as: "div",
|
|
449
|
+
children: /*#__PURE__*/ E(u, {
|
|
450
|
+
icon: "moreVert",
|
|
451
|
+
title: a._({ id: "PgNNGl" }),
|
|
452
|
+
disabled: Z
|
|
453
|
+
})
|
|
454
|
+
}), /*#__PURE__*/ D(l, { children: [
|
|
455
|
+
!K && x.canUpdate && /*#__PURE__*/ D(T, { children: [/*#__PURE__*/ E(g, {
|
|
456
|
+
label: Q ? a._({ id: "FQBaXG" }) : a._({ id: "5y3O+A" }),
|
|
457
|
+
onClick: () => Q ? R(!0) : B(!0)
|
|
458
|
+
}), /*#__PURE__*/ E(g, {
|
|
459
|
+
onClick: () => P(!0),
|
|
460
|
+
label: a._({ id: "SIfYq6" }),
|
|
461
|
+
disabled: Z
|
|
462
|
+
})] }),
|
|
463
|
+
!K && Ae && d.visibility === C.SHARED && (x.canCreateMember || x.canDeleteMember) && /*#__PURE__*/ E(g, {
|
|
464
|
+
label: a._({ id: "cWbW6w" }),
|
|
465
|
+
onClick: () => i({
|
|
466
|
+
to: "/projects/$projectId/compute/images/$imageId",
|
|
467
|
+
params: {
|
|
468
|
+
projectId: e,
|
|
469
|
+
imageId: d.id
|
|
470
|
+
},
|
|
471
|
+
search: { tab: "sharing" }
|
|
472
|
+
})
|
|
473
|
+
}),
|
|
474
|
+
je && /*#__PURE__*/ E(g, {
|
|
475
|
+
label: a._({ id: "1t/NnN" }),
|
|
476
|
+
onClick: () => Y("rejected")
|
|
477
|
+
}),
|
|
478
|
+
!K && x.canUpdate && Oe && /*#__PURE__*/ E(g, {
|
|
479
|
+
label: a._({ id: "gMYsdZ" }),
|
|
480
|
+
onClick: () => De("shared")
|
|
481
|
+
}),
|
|
482
|
+
!K && x.canDelete && !d.protected && /*#__PURE__*/ D(T, { children: [/*#__PURE__*/ E(p, {}), /*#__PURE__*/ E(g, {
|
|
483
|
+
label: a._({ id: "cnGeoo" }),
|
|
484
|
+
onClick: () => I(!0)
|
|
485
|
+
})] })
|
|
486
|
+
] })]
|
|
487
|
+
}), !K && x.canUpdate && /*#__PURE__*/ E(u, {
|
|
488
|
+
onClick: () => O(!0),
|
|
489
|
+
variant: "primary",
|
|
490
|
+
disabled: Z,
|
|
491
|
+
children: /*#__PURE__*/ E(j, { id: "Y1YKad" })
|
|
492
|
+
})]
|
|
493
|
+
});
|
|
494
|
+
return /*#__PURE__*/ D(T, { children: [
|
|
495
|
+
/*#__PURE__*/ E(te, {
|
|
496
|
+
title: String(d.name ?? d.id),
|
|
497
|
+
projectId: e,
|
|
498
|
+
actions: Fe
|
|
499
|
+
}),
|
|
500
|
+
/*#__PURE__*/ E("div", {
|
|
501
|
+
className: "mt-3",
|
|
502
|
+
children: /*#__PURE__*/ E(be, {
|
|
503
|
+
image: d,
|
|
504
|
+
currentProjectId: e,
|
|
505
|
+
activeTab: r ?? "details",
|
|
506
|
+
onTabChange: (e) => i({ search: { tab: e === "details" ? void 0 : e } }),
|
|
507
|
+
permissions: {
|
|
508
|
+
canCreateMember: x.canCreateMember,
|
|
509
|
+
canDeleteMember: x.canDeleteMember,
|
|
510
|
+
canUpdateMember: x.canUpdateMember
|
|
511
|
+
},
|
|
512
|
+
myMemberData: q,
|
|
513
|
+
onMemberStatusChange: Y,
|
|
514
|
+
isMemberStatusChanging: J.isPending
|
|
515
|
+
}, d.id)
|
|
516
|
+
}),
|
|
517
|
+
w && /*#__PURE__*/ E(me, {
|
|
518
|
+
image: d,
|
|
519
|
+
isOpen: w,
|
|
520
|
+
isLoading: V.isPending,
|
|
521
|
+
onClose: () => O(!1),
|
|
522
|
+
onSave: Ce
|
|
523
|
+
}),
|
|
524
|
+
N && /*#__PURE__*/ E(se, {
|
|
525
|
+
image: d,
|
|
526
|
+
isOpen: N,
|
|
527
|
+
isLoading: V.isPending,
|
|
528
|
+
onClose: () => P(!1),
|
|
529
|
+
onSave: Ce
|
|
530
|
+
}),
|
|
531
|
+
F && /*#__PURE__*/ E(ie, {
|
|
532
|
+
image: d,
|
|
533
|
+
isOpen: F,
|
|
534
|
+
isLoading: H.isPending,
|
|
535
|
+
isDisabled: !!d.protected,
|
|
536
|
+
onClose: () => I(!1),
|
|
537
|
+
onDelete: we
|
|
538
|
+
}),
|
|
539
|
+
L && /*#__PURE__*/ E(ae, {
|
|
540
|
+
image: d,
|
|
541
|
+
isOpen: L,
|
|
542
|
+
isLoading: W.isPending,
|
|
543
|
+
onClose: () => R(!1),
|
|
544
|
+
onActivate: Te
|
|
545
|
+
}),
|
|
546
|
+
z && /*#__PURE__*/ E(le, {
|
|
547
|
+
image: d,
|
|
548
|
+
isOpen: z,
|
|
549
|
+
isLoading: U.isPending,
|
|
550
|
+
onClose: () => B(!1),
|
|
551
|
+
onDeactivate: Ee
|
|
552
|
+
})
|
|
553
|
+
] });
|
|
554
|
+
}
|
|
555
|
+
//#endregion
|
|
556
|
+
export { z as component };
|
|
557
|
+
|
|
558
|
+
//# sourceMappingURL=_imageId-CiqEQB_J.mjs.map
|