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