@cobaltcore-dev/aurora 0.7.0 → 0.8.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 +101 -7
- package/dist/client/AuroraApp.d.ts +38 -0
- package/dist/client/{ContentHeader-kx1Th5Sq.mjs → ContentHeader-DqsGNvtD.mjs} +17 -17
- package/dist/client/{ContentHeader-kx1Th5Sq.mjs.map → ContentHeader-DqsGNvtD.mjs.map} +1 -1
- package/dist/client/{DeleteFlavorModal-C3cb7YiJ.mjs → DeleteFlavorModal-C3m7bQJu.mjs} +163 -163
- package/dist/client/{DeleteFlavorModal-C3cb7YiJ.mjs.map → DeleteFlavorModal-C3m7bQJu.mjs.map} +1 -1
- package/dist/client/{EditSecurityGroupModal-CpP54WIK.mjs → EditSecurityGroupModal-DKusxfta.mjs} +18 -18
- package/dist/client/{EditSecurityGroupModal-CpP54WIK.mjs.map → EditSecurityGroupModal-DKusxfta.mjs.map} +1 -1
- package/dist/client/{FiltersInput-DxcyR6Bp.mjs → FiltersInput-GzR4D0q6.mjs} +21 -21
- package/dist/client/{FiltersInput-DxcyR6Bp.mjs.map → FiltersInput-GzR4D0q6.mjs.map} +1 -1
- package/dist/client/{FloatingIpActionModals-BP8RWHbu.mjs → FloatingIpActionModals-CRvROJ3H.mjs} +51 -51
- package/dist/client/{FloatingIpActionModals-BP8RWHbu.mjs.map → FloatingIpActionModals-CRvROJ3H.mjs.map} +1 -1
- package/dist/client/{ImageToastNotifications-TZ3EfQg-.mjs → ImageToastNotifications-BuDXpTkl.mjs} +344 -344
- package/dist/client/{ImageToastNotifications-TZ3EfQg-.mjs.map → ImageToastNotifications-BuDXpTkl.mjs.map} +1 -1
- package/dist/client/{RouteError-QSV7qOoJ.mjs → RouteError-DVAiT0mT.mjs} +2 -2
- package/dist/client/{RouteError-QSV7qOoJ.mjs.map → RouteError-DVAiT0mT.mjs.map} +1 -1
- package/dist/client/{SortInput-CYv2_Pur.mjs → SortInput-VK7IYqQv.mjs} +6 -6
- package/dist/client/{SortInput-CYv2_Pur.mjs.map → SortInput-VK7IYqQv.mjs.map} +1 -1
- package/dist/client/{_flavorId-C2x43-6S.mjs → _flavorId-B9Vqkraj.mjs} +8 -8
- package/dist/client/{_flavorId-C2x43-6S.mjs.map → _flavorId-B9Vqkraj.mjs.map} +1 -1
- package/dist/client/{_flavorId-CR8ZUI-P.mjs → _flavorId-CFpNGz52.mjs} +62 -62
- package/dist/client/{_flavorId-CR8ZUI-P.mjs.map → _flavorId-CFpNGz52.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-BCk41_Lb.mjs → _floatingIpId-B5GMSLeQ.mjs} +2 -2
- package/dist/client/{_floatingIpId-BCk41_Lb.mjs.map → _floatingIpId-B5GMSLeQ.mjs.map} +1 -1
- package/dist/client/{_floatingIpId-BGrOAmPT.mjs → _floatingIpId-C2-BeRmF.mjs} +27 -27
- package/dist/client/{_floatingIpId-BGrOAmPT.mjs.map → _floatingIpId-C2-BeRmF.mjs.map} +1 -1
- package/dist/client/_imageId-9NZytfNs.mjs +534 -0
- package/dist/client/{_imageId-CvfD832b.mjs.map → _imageId-9NZytfNs.mjs.map} +1 -1
- package/dist/client/_pcaId-BwTvJJgh.mjs +479 -0
- package/dist/client/_pcaId-BwTvJJgh.mjs.map +1 -0
- package/dist/client/{_pcaId-DOHycvCf.mjs → _pcaId-DUHQd0rB.mjs} +2 -2
- package/dist/client/{_pcaId-DOHycvCf.mjs.map → _pcaId-DUHQd0rB.mjs.map} +1 -1
- package/dist/client/{_projectId-DOgwFiqD.mjs → _projectId-B_2sZKk-.mjs} +2 -2
- package/dist/client/{_projectId-DOgwFiqD.mjs.map → _projectId-B_2sZKk-.mjs.map} +1 -1
- package/dist/client/{_projectId-MxcHrXW4.mjs → _projectId-CLgClx24.mjs} +3 -3
- package/dist/client/{_projectId-MxcHrXW4.mjs.map → _projectId-CLgClx24.mjs.map} +1 -1
- package/dist/client/_projectId-cW9aQ4Ag.mjs +271 -0
- package/dist/client/_projectId-cW9aQ4Ag.mjs.map +1 -0
- package/dist/client/{_securityGroupId-KKw4RPdH.mjs → _securityGroupId-DYxmXUOP.mjs} +319 -319
- package/dist/client/{_securityGroupId-KKw4RPdH.mjs.map → _securityGroupId-DYxmXUOP.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-CJJanWiY.mjs → _securityGroupId-fhK1CuZh.mjs} +2 -2
- package/dist/client/{_securityGroupId-CJJanWiY.mjs.map → _securityGroupId-fhK1CuZh.mjs.map} +1 -1
- package/dist/client/{_storageType-DYjo-6ej.mjs → _storageType-2_fau4B5.mjs} +698 -698
- package/dist/client/{_storageType-DYjo-6ej.mjs.map → _storageType-2_fau4B5.mjs.map} +1 -1
- package/dist/client/{_storageType-4wSxI__0.mjs → _storageType-dRTFMKG3.mjs} +2 -2
- package/dist/client/{_storageType-4wSxI__0.mjs.map → _storageType-dRTFMKG3.mjs.map} +1 -1
- package/dist/client/{about-Bo9vxGHy.mjs → about-Nsxkyh9U.mjs} +2 -2
- package/dist/client/{about-Bo9vxGHy.mjs.map → about-Nsxkyh9U.mjs.map} +1 -1
- package/dist/client/{build-DeJcDjPi.mjs → build-BdRRmNf5.mjs} +3290 -3274
- package/dist/client/{build-DeJcDjPi.mjs.map → build-BdRRmNf5.mjs.map} +1 -1
- package/dist/client/{constants-BmcGYeR-.mjs → constants-J5nm9hbP.mjs} +15 -15
- package/dist/client/{constants-BmcGYeR-.mjs.map → constants-J5nm9hbP.mjs.map} +1 -1
- package/dist/client/{flavors-BxFVqgnb.mjs → flavors-_P7R-CeT.mjs} +2 -2
- package/dist/client/{flavors-BxFVqgnb.mjs.map → flavors-_P7R-CeT.mjs.map} +1 -1
- package/dist/client/{flavors-CfdgjsZY.mjs → flavors-m1qDHzeS.mjs} +238 -221
- package/dist/client/flavors-m1qDHzeS.mjs.map +1 -0
- package/dist/client/{floatingips-ByRb82wS.mjs → floatingips-Dq4DXQYb.mjs} +90 -90
- package/dist/client/{floatingips-ByRb82wS.mjs.map → floatingips-Dq4DXQYb.mjs.map} +1 -1
- package/dist/client/{images-CenluYV8.mjs → images-CpM-T_jM.mjs} +2 -2
- package/dist/client/{images-CenluYV8.mjs.map → images-CpM-T_jM.mjs.map} +1 -1
- package/dist/client/images-DHmVgQAh2.mjs +1890 -0
- package/dist/client/images-DHmVgQAh2.mjs.map +1 -0
- package/dist/client/{images-C_dX7nY6.mjs → images-Dbjo4yKn.mjs} +2 -2
- package/dist/client/{images-C_dX7nY6.mjs.map → images-Dbjo4yKn.mjs.map} +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +382 -351
- package/dist/client/index.js.map +1 -1
- package/dist/client/{objects-gxSjvbvF.mjs → objects-DKWp9RtR.mjs} +2 -2
- package/dist/client/{objects-gxSjvbvF.mjs.map → objects-DKWp9RtR.mjs.map} +1 -1
- package/dist/client/{objects-BJM6YeuF.mjs → objects-DaCuy_CB.mjs} +1156 -1156
- package/dist/client/{objects-BJM6YeuF.mjs.map → objects-DaCuy_CB.mjs.map} +1 -1
- package/dist/client/{pca-Bl8NmoVZ.mjs → pca-C8zWTSSt.mjs} +2 -2
- package/dist/client/{pca-Bl8NmoVZ.mjs.map → pca-C8zWTSSt.mjs.map} +1 -1
- package/dist/client/pca-CK5-j7Kk.mjs +202 -0
- package/dist/client/pca-CK5-j7Kk.mjs.map +1 -0
- package/dist/client/{projects-pe2_dCnV.mjs → projects-CHYn7L5e.mjs} +2 -2
- package/dist/client/{projects-pe2_dCnV.mjs.map → projects-CHYn7L5e.mjs.map} +1 -1
- package/dist/client/{projects-D2iewAzu.mjs → projects-CeLhtLvf.mjs} +2 -2
- package/dist/client/{projects-D2iewAzu.mjs.map → projects-CeLhtLvf.mjs.map} +1 -1
- package/dist/client/{projects-CgclWI16.mjs → projects-ClViaUuv.mjs} +11 -11
- package/dist/client/{projects-CgclWI16.mjs.map → projects-ClViaUuv.mjs.map} +1 -1
- package/dist/client/{_projectId-BDSWnMGj.mjs → routeInfo-DlDJZnpg.mjs} +34 -8
- package/dist/client/routeInfo-DlDJZnpg.mjs.map +1 -0
- package/dist/client/{securitygroups-DahZkVYQ.mjs → securitygroups-CNFLu9zS.mjs} +112 -112
- package/dist/client/{securitygroups-DahZkVYQ.mjs.map → securitygroups-CNFLu9zS.mjs.map} +1 -1
- package/dist/client/{useListWithFiltering-DaYcu5AB.mjs → useListWithFiltering-v2A0-SZb.mjs} +9 -9
- package/dist/client/{useListWithFiltering-DaYcu5AB.mjs.map → useListWithFiltering-v2A0-SZb.mjs.map} +1 -1
- package/dist/server/index.d.ts +6 -1
- package/dist/server/index.js +37 -12
- package/package.json +4 -4
- package/dist/client/_imageId-CvfD832b.mjs +0 -534
- package/dist/client/_pcaId-BxBt5DXi.mjs +0 -459
- package/dist/client/_pcaId-BxBt5DXi.mjs.map +0 -1
- package/dist/client/_projectId-BDSWnMGj.mjs.map +0 -1
- package/dist/client/_projectId-DS4nR59B.mjs +0 -299
- package/dist/client/_projectId-DS4nR59B.mjs.map +0 -1
- package/dist/client/flavors-CfdgjsZY.mjs.map +0 -1
- package/dist/client/images-CKqIXUq52.mjs +0 -1873
- package/dist/client/images-CKqIXUq52.mjs.map +0 -1
- package/dist/client/pca-RSiWpJs9.mjs +0 -182
- package/dist/client/pca-RSiWpJs9.mjs.map +0 -1
|
@@ -1,534 +0,0 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, J as r, K as i, P as a, Q as o, R as s, T as c, Y as l, ct as u, i as d, it as f, m as p, q as m, tt as ee } from "./build-DeJcDjPi.mjs";
|
|
2
|
-
import { r as h } from "./trpcClient-BzPUgiM2.mjs";
|
|
3
|
-
import { n as g, t as te } from "./ContentHeader-kx1Th5Sq.mjs";
|
|
4
|
-
import { A as _, D as ne, E as re, F as v, I as y, N as ie, O as ae, P as b, T as oe, d as se, k as ce, u as le } from "./ImageToastNotifications-TZ3EfQg-.mjs";
|
|
5
|
-
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
6
|
-
import w, { useState as T } from "react";
|
|
7
|
-
import { useNavigate as ue, useParams as de, useSearch as fe } from "@tanstack/react-router";
|
|
8
|
-
import { Trans as E, useLingui as D } from "@lingui/react";
|
|
9
|
-
//#region src/client/routes/_auth/projects/$projectId/compute/-components/Images/-components/ImageDetailsView.tsx
|
|
10
|
-
var O = ({ image: e, myMemberData: t, canUpdateMember: n, onStatusChange: r, isLoading: i }) => {
|
|
11
|
-
let { i18n: a, _: o } = D(), s = t.status === v.PENDING, c = t.status === v.REJECTED, l = t.created_at ? new Date(t.created_at).toLocaleString() : a._({ id: "fj5byd" }), f = t.updated_at ? new Date(t.updated_at).toLocaleString() : a._({ id: "fj5byd" }), m = e.owner ?? "";
|
|
12
|
-
return /*#__PURE__*/ C(p, { children: [
|
|
13
|
-
s && /*#__PURE__*/ S("p", {
|
|
14
|
-
className: "text-theme-highest font-semibold",
|
|
15
|
-
children: /*#__PURE__*/ S(E, { id: "/EcdUM" })
|
|
16
|
-
}),
|
|
17
|
-
/*#__PURE__*/ S("p", { children: /*#__PURE__*/ S(E, {
|
|
18
|
-
id: "Uwo8Xw",
|
|
19
|
-
values: {
|
|
20
|
-
ownerProject: m,
|
|
21
|
-
sharedAt: l
|
|
22
|
-
},
|
|
23
|
-
components: { 0: /*#__PURE__*/ S("span", { className: "font-semibold" }) }
|
|
24
|
-
}) }),
|
|
25
|
-
/*#__PURE__*/ C("ul", { children: [
|
|
26
|
-
/*#__PURE__*/ C("li", { children: [
|
|
27
|
-
/*#__PURE__*/ S("span", {
|
|
28
|
-
className: "font-semibold",
|
|
29
|
-
children: /*#__PURE__*/ S(E, { id: "azXlY+" })
|
|
30
|
-
}),
|
|
31
|
-
" ",
|
|
32
|
-
t.status
|
|
33
|
-
] }),
|
|
34
|
-
/*#__PURE__*/ C("li", { children: [
|
|
35
|
-
/*#__PURE__*/ S("span", {
|
|
36
|
-
className: "font-semibold",
|
|
37
|
-
children: /*#__PURE__*/ S(E, { id: "G6AP+o" })
|
|
38
|
-
}),
|
|
39
|
-
" ",
|
|
40
|
-
l
|
|
41
|
-
] }),
|
|
42
|
-
/*#__PURE__*/ C("li", { children: [
|
|
43
|
-
/*#__PURE__*/ S("span", {
|
|
44
|
-
className: "font-semibold",
|
|
45
|
-
children: /*#__PURE__*/ S(E, { id: "pFg+7w" })
|
|
46
|
-
}),
|
|
47
|
-
" ",
|
|
48
|
-
f
|
|
49
|
-
] })
|
|
50
|
-
] }),
|
|
51
|
-
n && (s || c) && /*#__PURE__*/ C(d, { children: [/*#__PURE__*/ S(u, {
|
|
52
|
-
onClick: () => r(v.ACCEPTED),
|
|
53
|
-
disabled: i,
|
|
54
|
-
children: /*#__PURE__*/ S(E, { id: "g3UF2V" })
|
|
55
|
-
}), s && /*#__PURE__*/ S(u, {
|
|
56
|
-
onClick: () => r(v.REJECTED),
|
|
57
|
-
disabled: i,
|
|
58
|
-
children: /*#__PURE__*/ S(E, { id: "1t/NnN" })
|
|
59
|
-
})] })
|
|
60
|
-
] });
|
|
61
|
-
}, k = ({ image: t }) => {
|
|
62
|
-
let { i18n: n, _: r } = D();
|
|
63
|
-
return /*#__PURE__*/ C(l, {
|
|
64
|
-
px: !1,
|
|
65
|
-
py: !0,
|
|
66
|
-
children: [/*#__PURE__*/ S(m, { children: n._({ id: "nW/hX9" }) }), /*#__PURE__*/ C(e, {
|
|
67
|
-
alignTerms: "right",
|
|
68
|
-
children: [
|
|
69
|
-
/*#__PURE__*/ S(i, { children: n._({ id: "S0kLOH" }) }),
|
|
70
|
-
/*#__PURE__*/ S(c, { children: /*#__PURE__*/ S(g, { text: t.id }) }),
|
|
71
|
-
/*#__PURE__*/ S(i, { children: n._({ id: "6YtxFj" }) }),
|
|
72
|
-
/*#__PURE__*/ S(c, { children: t.name }),
|
|
73
|
-
/*#__PURE__*/ S(i, { children: n._({ id: "uAQUqI" }) }),
|
|
74
|
-
/*#__PURE__*/ S(c, { children: t.status }),
|
|
75
|
-
/*#__PURE__*/ S(i, { children: n._({ id: "Cj2Gtd" }) }),
|
|
76
|
-
/*#__PURE__*/ S(c, { children: /*#__PURE__*/ S(y, { size: t.size }) }),
|
|
77
|
-
/*#__PURE__*/ S(i, { children: n._({ id: "Cxgv2U" }) }),
|
|
78
|
-
/*#__PURE__*/ C(c, { children: [t.min_disk, " GB"] }),
|
|
79
|
-
/*#__PURE__*/ S(i, { children: n._({ id: "B2Czeb" }) }),
|
|
80
|
-
/*#__PURE__*/ C(c, { children: [t.min_ram, " MB"] }),
|
|
81
|
-
/*#__PURE__*/ S(i, { children: n._({ id: "NopYGU" }) }),
|
|
82
|
-
/*#__PURE__*/ S(c, { children: /*#__PURE__*/ S("span", {
|
|
83
|
-
className: "uppercase",
|
|
84
|
-
children: t.disk_format
|
|
85
|
-
}) }),
|
|
86
|
-
/*#__PURE__*/ S(i, { children: n._({ id: "6/xipy" }) }),
|
|
87
|
-
/*#__PURE__*/ S(c, { children: /*#__PURE__*/ S("span", {
|
|
88
|
-
className: "uppercase",
|
|
89
|
-
children: t.container_format
|
|
90
|
-
}) }),
|
|
91
|
-
/*#__PURE__*/ S(i, { children: n._({ id: "88kg0+" }) }),
|
|
92
|
-
/*#__PURE__*/ S(c, { children: t.created_at ? new Date(t.created_at).toLocaleDateString() : n._({ id: "fj5byd" }) }),
|
|
93
|
-
/*#__PURE__*/ S(i, { children: n._({ id: "Llcakz" }) }),
|
|
94
|
-
/*#__PURE__*/ S(c, { children: t.updated_at ? new Date(t.updated_at).toLocaleDateString() : n._({ id: "fj5byd" }) })
|
|
95
|
-
]
|
|
96
|
-
})]
|
|
97
|
-
});
|
|
98
|
-
}, A = ({ image: t, currentProjectId: n }) => {
|
|
99
|
-
let { i18n: r, _: a } = D(), o = t.visibility === "shared" && t.owner !== void 0 && t.owner !== n;
|
|
100
|
-
return /*#__PURE__*/ C(l, {
|
|
101
|
-
px: !1,
|
|
102
|
-
py: !0,
|
|
103
|
-
children: [/*#__PURE__*/ S(m, { children: r._({ id: "a3LDKx" }) }), /*#__PURE__*/ C(e, {
|
|
104
|
-
alignTerms: "right",
|
|
105
|
-
children: [
|
|
106
|
-
/*#__PURE__*/ S(i, { children: o ? r._({ id: "20axE5" }) : r._({ id: "YsrbQh" }) }),
|
|
107
|
-
/*#__PURE__*/ S(c, { children: t.owner ? /*#__PURE__*/ S(g, { text: t.owner }) : "" }),
|
|
108
|
-
/*#__PURE__*/ S(i, { children: r._({ id: "2q/Q7x" }) }),
|
|
109
|
-
/*#__PURE__*/ S(c, { children: t.visibility }),
|
|
110
|
-
/*#__PURE__*/ S(i, { children: r._({ id: "644xgx" }) }),
|
|
111
|
-
/*#__PURE__*/ S(c, { children: t.protected ? r._({ id: "l75CjT" }) : r._({ id: "1UzENP" }) }),
|
|
112
|
-
/*#__PURE__*/ S(i, { children: r._({ id: "PzgYM9" }) }),
|
|
113
|
-
/*#__PURE__*/ S(c, { children: t?.checksum ? t.checksum : "" })
|
|
114
|
-
]
|
|
115
|
-
})]
|
|
116
|
-
});
|
|
117
|
-
}, j = ({ image: t }) => {
|
|
118
|
-
let { i18n: n, _: r } = D(), a = new Set([
|
|
119
|
-
"id",
|
|
120
|
-
"name",
|
|
121
|
-
"status",
|
|
122
|
-
"visibility",
|
|
123
|
-
"size",
|
|
124
|
-
"disk_format",
|
|
125
|
-
"container_format",
|
|
126
|
-
"min_disk",
|
|
127
|
-
"min_ram",
|
|
128
|
-
"owner",
|
|
129
|
-
"protected",
|
|
130
|
-
"created_at",
|
|
131
|
-
"updated_at",
|
|
132
|
-
"checksum"
|
|
133
|
-
]), o = Object.entries(t).filter(([e]) => !a.has(e)).sort(([e], [t]) => e.localeCompare(t)), s = o.length > 0;
|
|
134
|
-
return /*#__PURE__*/ C(l, {
|
|
135
|
-
px: !1,
|
|
136
|
-
py: !0,
|
|
137
|
-
children: [/*#__PURE__*/ S(m, { children: n._({ id: "bc67JN" }) }), s ? /*#__PURE__*/ S(e, {
|
|
138
|
-
alignTerms: "right",
|
|
139
|
-
className: "grid-cols-4",
|
|
140
|
-
children: o.map(([e, t]) => /*#__PURE__*/ C(w.Fragment, { children: [/*#__PURE__*/ S(i, {
|
|
141
|
-
className: "col-span-1",
|
|
142
|
-
children: e
|
|
143
|
-
}), /*#__PURE__*/ S(c, {
|
|
144
|
-
className: "col-span-1",
|
|
145
|
-
children: t == null ? /*#__PURE__*/ S("span", { children: "null" }) : typeof t == "object" ? /*#__PURE__*/ S("span", {
|
|
146
|
-
className: "break-all",
|
|
147
|
-
children: JSON.stringify(t)
|
|
148
|
-
}) : typeof t == "boolean" ? t ? n._({ id: "c+xCSz" }) : n._({ id: "ocUvR+" }) : /*#__PURE__*/ S("span", {
|
|
149
|
-
className: "break-all",
|
|
150
|
-
children: String(t)
|
|
151
|
-
})
|
|
152
|
-
})] }, e))
|
|
153
|
-
}) : /*#__PURE__*/ S("p", {
|
|
154
|
-
className: "text-theme-light",
|
|
155
|
-
children: n._({ id: "9v5VLp" })
|
|
156
|
-
})]
|
|
157
|
-
});
|
|
158
|
-
}, M = (e) => {
|
|
159
|
-
let t = "px-6 py-3 font-semibold border-b-2 transition-colors";
|
|
160
|
-
return e ? `${t} border-theme-accent text-theme-highest` : `${t} border-transparent text-theme-secondary hover:text-theme-high`;
|
|
161
|
-
}, N = ({ image: e, permissions: n, currentProjectId: r }) => {
|
|
162
|
-
let [i, a] = T(!1), [o, s] = T(null), { data: c, isLoading: u } = h.compute.listImageMembers.useQuery({
|
|
163
|
-
project_id: r,
|
|
164
|
-
imageId: e.id
|
|
165
|
-
}, { enabled: !!e.id && !!r });
|
|
166
|
-
return /*#__PURE__*/ C(l, {
|
|
167
|
-
px: !1,
|
|
168
|
-
py: !0,
|
|
169
|
-
children: [o && /*#__PURE__*/ S(t, {
|
|
170
|
-
text: o.text,
|
|
171
|
-
variant: o.type,
|
|
172
|
-
onDismiss: () => s(null),
|
|
173
|
-
className: "mb-4"
|
|
174
|
-
}), /*#__PURE__*/ S(_, {
|
|
175
|
-
image: e,
|
|
176
|
-
imageMembers: c,
|
|
177
|
-
isMembersLoading: u,
|
|
178
|
-
canAdd: n?.canCreateMember ?? !1,
|
|
179
|
-
canRemove: n?.canDeleteMember ?? !1,
|
|
180
|
-
isAddingMember: i,
|
|
181
|
-
setIsAddingMember: a,
|
|
182
|
-
setMessage: s,
|
|
183
|
-
projectId: r
|
|
184
|
-
})]
|
|
185
|
-
});
|
|
186
|
-
}, pe = ({ image: e, currentProjectId: t, activeTab: n = "details", onTabChange: r, permissions: i, myMemberData: a, onMemberStatusChange: s, isMemberStatusChanging: c, actions: l }) => {
|
|
187
|
-
let { i18n: u, _: d } = D(), f = e.visibility === "shared" && e.owner !== void 0 && e.owner !== t, p = e.owner === t && e.visibility === "shared";
|
|
188
|
-
return /*#__PURE__*/ C(o, {
|
|
189
|
-
direction: "vertical",
|
|
190
|
-
gap: "6",
|
|
191
|
-
children: [
|
|
192
|
-
f && a && s && /*#__PURE__*/ S(O, {
|
|
193
|
-
image: e,
|
|
194
|
-
myMemberData: a,
|
|
195
|
-
canUpdateMember: i?.canUpdateMember ?? !1,
|
|
196
|
-
onStatusChange: s,
|
|
197
|
-
isLoading: c ?? !1
|
|
198
|
-
}),
|
|
199
|
-
p && /*#__PURE__*/ S("div", {
|
|
200
|
-
className: "border-theme-background-lvl-3 border-b",
|
|
201
|
-
children: /*#__PURE__*/ C(o, {
|
|
202
|
-
direction: "horizontal",
|
|
203
|
-
gap: "0",
|
|
204
|
-
children: [/*#__PURE__*/ S("button", {
|
|
205
|
-
className: M(n === "details"),
|
|
206
|
-
onClick: () => r?.("details"),
|
|
207
|
-
children: u._({ id: "URmyfc" })
|
|
208
|
-
}), /*#__PURE__*/ S("button", {
|
|
209
|
-
className: M(n === "sharing"),
|
|
210
|
-
onClick: () => r?.("sharing"),
|
|
211
|
-
children: u._({ id: "aG9OiI" })
|
|
212
|
-
})]
|
|
213
|
-
})
|
|
214
|
-
}),
|
|
215
|
-
(n === "details" || !p) && /*#__PURE__*/ C(x, { children: [
|
|
216
|
-
l,
|
|
217
|
-
/*#__PURE__*/ S(k, { image: e }),
|
|
218
|
-
/*#__PURE__*/ S(A, {
|
|
219
|
-
image: e,
|
|
220
|
-
currentProjectId: t
|
|
221
|
-
}),
|
|
222
|
-
/*#__PURE__*/ S(j, { image: e })
|
|
223
|
-
] }),
|
|
224
|
-
n === "sharing" && p && /*#__PURE__*/ S(N, {
|
|
225
|
-
image: e,
|
|
226
|
-
permissions: i
|
|
227
|
-
})
|
|
228
|
-
]
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region src/client/routes/_auth/projects/$projectId/compute/images/$imageId.tsx?tsr-split=component
|
|
233
|
-
function P() {
|
|
234
|
-
let { projectId: e, imageId: t } = de({ from: "/_auth/projects/$projectId/compute/images/$imageId" }), { tab: i } = fe({ from: "/_auth/projects/$projectId/compute/images/$imageId" }), c = ue(), { i18n: l, _: p } = D(), { data: m, status: g, error: _ } = h.compute.getImageById.useQuery({
|
|
235
|
-
project_id: e,
|
|
236
|
-
imageId: t
|
|
237
|
-
}), { data: v } = h.compute.canUser.useQuery({
|
|
238
|
-
project_id: e,
|
|
239
|
-
permission: [
|
|
240
|
-
"images:delete",
|
|
241
|
-
"images:update",
|
|
242
|
-
"images:create_member",
|
|
243
|
-
"images:delete_member",
|
|
244
|
-
"images:update_member"
|
|
245
|
-
]
|
|
246
|
-
}), y = {
|
|
247
|
-
canDelete: v?.[0] ?? !1,
|
|
248
|
-
canUpdate: v?.[1] ?? !1,
|
|
249
|
-
canCreateMember: v?.[2] ?? !1,
|
|
250
|
-
canDeleteMember: v?.[3] ?? !1,
|
|
251
|
-
canUpdateMember: v?.[4] ?? !1
|
|
252
|
-
}, w = h.useUtils(), [O, k] = T(!1), [A, j] = T(!1), [M, N] = T(!1), [P, F] = T(!1), [I, L] = T(!1), [R, z] = T(null), B = h.compute.updateImage.useMutation({ onSuccess: (n) => {
|
|
253
|
-
w.compute.getImageById.setData({
|
|
254
|
-
project_id: e,
|
|
255
|
-
imageId: t
|
|
256
|
-
}, n), w.compute.listImagesWithPagination.invalidate();
|
|
257
|
-
} }), V = h.compute.deleteImage.useMutation({ onSuccess: () => {
|
|
258
|
-
w.compute.listImagesWithPagination.invalidate();
|
|
259
|
-
} }), H = h.compute.deactivateImage.useMutation({ onSuccess: () => {
|
|
260
|
-
w.compute.getImageById.invalidate({
|
|
261
|
-
project_id: e,
|
|
262
|
-
imageId: t
|
|
263
|
-
});
|
|
264
|
-
} }), U = h.compute.reactivateImage.useMutation({ onSuccess: () => {
|
|
265
|
-
w.compute.getImageById.invalidate({
|
|
266
|
-
project_id: e,
|
|
267
|
-
imageId: t
|
|
268
|
-
});
|
|
269
|
-
} }), W = h.compute.updateImageVisibility.useMutation({ onSuccess: (n) => {
|
|
270
|
-
w.compute.getImageById.setData({
|
|
271
|
-
project_id: e,
|
|
272
|
-
imageId: t
|
|
273
|
-
}, n);
|
|
274
|
-
} }), G = m?.visibility === b.SHARED && m?.owner !== void 0 && m?.owner !== e, { data: K } = h.compute.getImageMember.useQuery({
|
|
275
|
-
project_id: e,
|
|
276
|
-
imageId: t,
|
|
277
|
-
memberId: e
|
|
278
|
-
}, { enabled: G && !!t && !!e }), q = h.compute.updateImageMember.useMutation({ onSuccess: () => {
|
|
279
|
-
w.compute.getImageMember.invalidate({
|
|
280
|
-
project_id: e,
|
|
281
|
-
imageId: t,
|
|
282
|
-
memberId: e
|
|
283
|
-
}), w.compute.listImageMembers.invalidate({
|
|
284
|
-
project_id: e,
|
|
285
|
-
imageId: t
|
|
286
|
-
}), w.compute.listImagesWithPagination.invalidate(), w.compute.listSharedImagesByMemberStatus.invalidate();
|
|
287
|
-
} }), J = async (n) => {
|
|
288
|
-
try {
|
|
289
|
-
await q.mutateAsync({
|
|
290
|
-
project_id: e,
|
|
291
|
-
imageId: t,
|
|
292
|
-
memberId: e,
|
|
293
|
-
status: n
|
|
294
|
-
}), z(se(n, { onDismiss: () => z(null) }));
|
|
295
|
-
} catch (e) {
|
|
296
|
-
let t = e?.message;
|
|
297
|
-
z(le(t, { onDismiss: () => z(null) }));
|
|
298
|
-
}
|
|
299
|
-
}, Y = () => {
|
|
300
|
-
c({
|
|
301
|
-
to: "/projects/$projectId/compute/images",
|
|
302
|
-
params: { projectId: e }
|
|
303
|
-
});
|
|
304
|
-
}, X = B.isPending || V.isPending || H.isPending || U.isPending || W.isPending, me = (e, t) => {
|
|
305
|
-
let n = [];
|
|
306
|
-
return Object.entries(e).forEach(([e, r]) => {
|
|
307
|
-
let i = `/${e}`;
|
|
308
|
-
if (r == null) e in t && n.push({
|
|
309
|
-
op: "remove",
|
|
310
|
-
path: i
|
|
311
|
-
});
|
|
312
|
-
else {
|
|
313
|
-
let a = e in t;
|
|
314
|
-
n.push({
|
|
315
|
-
op: a ? "replace" : "add",
|
|
316
|
-
path: i,
|
|
317
|
-
value: r
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
}), n;
|
|
321
|
-
}, Z = async (n) => {
|
|
322
|
-
if (!m) return !1;
|
|
323
|
-
let r = me(n, m);
|
|
324
|
-
try {
|
|
325
|
-
return await B.mutateAsync({
|
|
326
|
-
project_id: e,
|
|
327
|
-
imageId: t,
|
|
328
|
-
operations: r
|
|
329
|
-
}), k(!1), !0;
|
|
330
|
-
} catch {
|
|
331
|
-
return !1;
|
|
332
|
-
}
|
|
333
|
-
}, he = async (t) => {
|
|
334
|
-
try {
|
|
335
|
-
await V.mutateAsync({
|
|
336
|
-
project_id: e,
|
|
337
|
-
imageId: t.id
|
|
338
|
-
}), N(!1), Y();
|
|
339
|
-
} catch {
|
|
340
|
-
N(!1);
|
|
341
|
-
}
|
|
342
|
-
}, ge = async (t) => {
|
|
343
|
-
try {
|
|
344
|
-
await U.mutateAsync({
|
|
345
|
-
project_id: e,
|
|
346
|
-
imageId: t.id
|
|
347
|
-
}), F(!1);
|
|
348
|
-
} catch {
|
|
349
|
-
F(!1);
|
|
350
|
-
}
|
|
351
|
-
}, _e = async (t) => {
|
|
352
|
-
try {
|
|
353
|
-
await H.mutateAsync({
|
|
354
|
-
project_id: e,
|
|
355
|
-
imageId: t.id
|
|
356
|
-
}), L(!1);
|
|
357
|
-
} catch {
|
|
358
|
-
L(!1);
|
|
359
|
-
}
|
|
360
|
-
}, ve = async (t) => {
|
|
361
|
-
if (m) try {
|
|
362
|
-
await W.mutateAsync({
|
|
363
|
-
project_id: e,
|
|
364
|
-
imageId: m.id,
|
|
365
|
-
visibility: t
|
|
366
|
-
});
|
|
367
|
-
} catch {}
|
|
368
|
-
};
|
|
369
|
-
if (g === "pending") return /*#__PURE__*/ C(o, {
|
|
370
|
-
className: "fixed inset-0",
|
|
371
|
-
distribution: "center",
|
|
372
|
-
alignment: "center",
|
|
373
|
-
direction: "vertical",
|
|
374
|
-
children: [/*#__PURE__*/ S(s, {
|
|
375
|
-
variant: "primary",
|
|
376
|
-
size: "large",
|
|
377
|
-
className: "mb-2"
|
|
378
|
-
}), /*#__PURE__*/ S(E, { id: "hH3kDo" })]
|
|
379
|
-
});
|
|
380
|
-
if (g === "error") {
|
|
381
|
-
let e = _?.message || "Unknown error";
|
|
382
|
-
return /*#__PURE__*/ C(o, {
|
|
383
|
-
className: "fixed inset-0",
|
|
384
|
-
distribution: "center",
|
|
385
|
-
alignment: "center",
|
|
386
|
-
direction: "vertical",
|
|
387
|
-
gap: "5",
|
|
388
|
-
children: [
|
|
389
|
-
/*#__PURE__*/ S("p", {
|
|
390
|
-
className: "text-theme-error font-semibold",
|
|
391
|
-
children: /*#__PURE__*/ S(E, { id: "Jh4rAZ" })
|
|
392
|
-
}),
|
|
393
|
-
/*#__PURE__*/ S("p", {
|
|
394
|
-
className: "text-theme-highest",
|
|
395
|
-
children: e
|
|
396
|
-
}),
|
|
397
|
-
/*#__PURE__*/ S(u, {
|
|
398
|
-
onClick: Y,
|
|
399
|
-
variant: "primary",
|
|
400
|
-
children: /*#__PURE__*/ S(E, { id: "bnql/K" })
|
|
401
|
-
})
|
|
402
|
-
]
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
if (!m) return /*#__PURE__*/ C(o, {
|
|
406
|
-
className: "fixed inset-0",
|
|
407
|
-
distribution: "center",
|
|
408
|
-
alignment: "center",
|
|
409
|
-
direction: "vertical",
|
|
410
|
-
gap: "5",
|
|
411
|
-
children: [/*#__PURE__*/ S("p", {
|
|
412
|
-
className: "text-theme-highest",
|
|
413
|
-
children: /*#__PURE__*/ S(E, { id: "1pdLQw" })
|
|
414
|
-
}), /*#__PURE__*/ S(u, {
|
|
415
|
-
onClick: Y,
|
|
416
|
-
variant: "primary",
|
|
417
|
-
children: /*#__PURE__*/ S(E, { id: "bnql/K" })
|
|
418
|
-
})]
|
|
419
|
-
});
|
|
420
|
-
let Q = m.status === ie.DEACTIVATED, ye = m.visibility === b.PRIVATE, be = K?.status === "accepted", $ = m.owner === e, xe = G && be && y.canUpdateMember, Se = !G && y.canUpdate, Ce = !G && y.canDelete && !m.protected, we = !G && $ && m.visibility === b.SHARED && (y.canCreateMember || y.canDeleteMember), Te = xe || Se || Ce || we, Ee = Te || !G && y.canUpdate ? /*#__PURE__*/ C(d, { children: [
|
|
421
|
-
Te && /*#__PURE__*/ C(a, { children: [/*#__PURE__*/ S(n, {
|
|
422
|
-
as: "div",
|
|
423
|
-
children: /*#__PURE__*/ S(u, {
|
|
424
|
-
icon: "moreVert",
|
|
425
|
-
disabled: X,
|
|
426
|
-
children: /*#__PURE__*/ S(E, { id: "PgNNGl" })
|
|
427
|
-
})
|
|
428
|
-
}), /*#__PURE__*/ C(ee, { children: [
|
|
429
|
-
xe && /*#__PURE__*/ S(f, {
|
|
430
|
-
label: l._({ id: "1t/NnN" }),
|
|
431
|
-
onClick: () => J("rejected")
|
|
432
|
-
}),
|
|
433
|
-
!G && y.canUpdate && /*#__PURE__*/ S(f, {
|
|
434
|
-
label: Q ? l._({ id: "FQBaXG" }) : l._({ id: "5y3O+A" }),
|
|
435
|
-
onClick: () => Q ? F(!0) : L(!0)
|
|
436
|
-
}),
|
|
437
|
-
!G && y.canUpdate && ye && /*#__PURE__*/ S(f, {
|
|
438
|
-
label: l._({ id: "gMYsdZ" }),
|
|
439
|
-
onClick: () => ve("shared")
|
|
440
|
-
}),
|
|
441
|
-
!G && $ && m.visibility === b.SHARED && (y.canCreateMember || y.canDeleteMember) && /*#__PURE__*/ S(f, {
|
|
442
|
-
label: l._({ id: "cWbW6w" }),
|
|
443
|
-
onClick: () => c({
|
|
444
|
-
to: "/projects/$projectId/compute/images/$imageId",
|
|
445
|
-
params: {
|
|
446
|
-
projectId: e,
|
|
447
|
-
imageId: m.id
|
|
448
|
-
},
|
|
449
|
-
search: { tab: "sharing" }
|
|
450
|
-
})
|
|
451
|
-
}),
|
|
452
|
-
!G && y.canDelete && !m.protected && /*#__PURE__*/ S(f, {
|
|
453
|
-
label: l._({ id: "cnGeoo" }),
|
|
454
|
-
onClick: () => N(!0)
|
|
455
|
-
})
|
|
456
|
-
] })] }),
|
|
457
|
-
!G && y.canUpdate && /*#__PURE__*/ S(u, {
|
|
458
|
-
onClick: () => j(!0),
|
|
459
|
-
disabled: X,
|
|
460
|
-
children: /*#__PURE__*/ S(E, { id: "SIfYq6" })
|
|
461
|
-
}),
|
|
462
|
-
!G && y.canUpdate && /*#__PURE__*/ S(u, {
|
|
463
|
-
onClick: () => k(!0),
|
|
464
|
-
variant: "primary",
|
|
465
|
-
disabled: X,
|
|
466
|
-
children: /*#__PURE__*/ S(E, { id: "Y1YKad" })
|
|
467
|
-
})
|
|
468
|
-
] }) : void 0;
|
|
469
|
-
return /*#__PURE__*/ C(x, { children: [
|
|
470
|
-
/*#__PURE__*/ S(te, {
|
|
471
|
-
title: String(m.name ?? m.id),
|
|
472
|
-
projectId: e,
|
|
473
|
-
actions: Ee
|
|
474
|
-
}),
|
|
475
|
-
/*#__PURE__*/ S("div", {
|
|
476
|
-
className: "mt-3",
|
|
477
|
-
children: /*#__PURE__*/ S(pe, {
|
|
478
|
-
image: m,
|
|
479
|
-
currentProjectId: e,
|
|
480
|
-
activeTab: i ?? "details",
|
|
481
|
-
onTabChange: (e) => c({ search: { tab: e === "details" ? void 0 : e } }),
|
|
482
|
-
permissions: {
|
|
483
|
-
canCreateMember: y.canCreateMember,
|
|
484
|
-
canDeleteMember: y.canDeleteMember,
|
|
485
|
-
canUpdateMember: y.canUpdateMember
|
|
486
|
-
},
|
|
487
|
-
myMemberData: K,
|
|
488
|
-
onMemberStatusChange: J,
|
|
489
|
-
isMemberStatusChanging: q.isPending
|
|
490
|
-
}, m.id)
|
|
491
|
-
}),
|
|
492
|
-
R && /*#__PURE__*/ S(r, { ...R }),
|
|
493
|
-
O && /*#__PURE__*/ S(ce, {
|
|
494
|
-
image: m,
|
|
495
|
-
isOpen: O,
|
|
496
|
-
isLoading: B.isPending,
|
|
497
|
-
onClose: () => k(!1),
|
|
498
|
-
onSave: Z
|
|
499
|
-
}),
|
|
500
|
-
A && /*#__PURE__*/ S(ae, {
|
|
501
|
-
image: m,
|
|
502
|
-
isOpen: A,
|
|
503
|
-
isLoading: B.isPending,
|
|
504
|
-
onClose: () => j(!1),
|
|
505
|
-
onSave: Z
|
|
506
|
-
}),
|
|
507
|
-
M && /*#__PURE__*/ S(ne, {
|
|
508
|
-
image: m,
|
|
509
|
-
isOpen: M,
|
|
510
|
-
isLoading: V.isPending,
|
|
511
|
-
isDisabled: !!m.protected,
|
|
512
|
-
onClose: () => N(!1),
|
|
513
|
-
onDelete: he
|
|
514
|
-
}),
|
|
515
|
-
P && /*#__PURE__*/ S(re, {
|
|
516
|
-
image: m,
|
|
517
|
-
isOpen: P,
|
|
518
|
-
isLoading: U.isPending,
|
|
519
|
-
onClose: () => F(!1),
|
|
520
|
-
onActivate: ge
|
|
521
|
-
}),
|
|
522
|
-
I && /*#__PURE__*/ S(oe, {
|
|
523
|
-
image: m,
|
|
524
|
-
isOpen: I,
|
|
525
|
-
isLoading: H.isPending,
|
|
526
|
-
onClose: () => L(!1),
|
|
527
|
-
onDeactivate: _e
|
|
528
|
-
})
|
|
529
|
-
] });
|
|
530
|
-
}
|
|
531
|
-
//#endregion
|
|
532
|
-
export { P as component };
|
|
533
|
-
|
|
534
|
-
//# sourceMappingURL=_imageId-CvfD832b.mjs.map
|