@cobaltcore-dev/aurora 1.0.0 → 1.2.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 (205) hide show
  1. package/README.md +59 -9
  2. package/dist/client/App.d.ts +2 -1
  3. package/dist/client/AuroraApp.d.ts +45 -0
  4. package/dist/client/{AuthProvider-5TyZKZkx.mjs → AuthProvider-CVSAwW9f.mjs} +23 -9
  5. package/dist/client/AuthProvider-CVSAwW9f.mjs.map +1 -0
  6. package/dist/client/{ContentHeader-D64NtKvo.mjs → ContentHeader-CPJbgYWn.mjs} +18 -18
  7. package/dist/client/{ContentHeader-D64NtKvo.mjs.map → ContentHeader-CPJbgYWn.mjs.map} +1 -1
  8. package/dist/client/DeleteFlavorModal-V44QCJBd.mjs +773 -0
  9. package/dist/client/DeleteFlavorModal-V44QCJBd.mjs.map +1 -0
  10. package/dist/client/DynamicBreadcrumbContext-CVcUQFou.mjs +26 -0
  11. package/dist/client/DynamicBreadcrumbContext-CVcUQFou.mjs.map +1 -0
  12. package/dist/client/{FiltersInput-Bw8TFfwb.mjs → FiltersInput-CKI6zWnm.mjs} +22 -22
  13. package/dist/client/{FiltersInput-Bw8TFfwb.mjs.map → FiltersInput-CKI6zWnm.mjs.map} +1 -1
  14. package/dist/client/FloatingIpActionModals-CwEC5GR-.mjs +460 -0
  15. package/dist/client/FloatingIpActionModals-CwEC5GR-.mjs.map +1 -0
  16. package/dist/client/ImageToastNotifications-m6c3tVPb.mjs +1152 -0
  17. package/dist/client/ImageToastNotifications-m6c3tVPb.mjs.map +1 -0
  18. package/dist/client/{SortInput-DysAXpB3.mjs → SortInput-4g7nSTHW.mjs} +14 -14
  19. package/dist/client/SortInput-4g7nSTHW.mjs.map +1 -0
  20. package/dist/client/{TwoColumnDescriptionList-B3xunXmz.mjs → TwoColumnDescriptionList-NvgvErua.mjs} +6 -6
  21. package/dist/client/{TwoColumnDescriptionList-B3xunXmz.mjs.map → TwoColumnDescriptionList-NvgvErua.mjs.map} +1 -1
  22. package/dist/client/_-CAsCx-Ay.mjs +6 -0
  23. package/dist/client/_-CAsCx-Ay.mjs.map +1 -0
  24. package/dist/client/_auth-SrDjHL6j.mjs +12 -0
  25. package/dist/client/_auth-SrDjHL6j.mjs.map +1 -0
  26. package/dist/client/_flavorId-9PcBBW52.mjs +231 -0
  27. package/dist/client/_flavorId-9PcBBW52.mjs.map +1 -0
  28. package/dist/client/{_flavorId-Zj7LNL-R.mjs → _flavorId-a9Gu66R1.mjs} +3 -9
  29. package/dist/client/_flavorId-a9Gu66R1.mjs.map +1 -0
  30. package/dist/client/_floatingIpId-AE9Fu8l6.mjs +210 -0
  31. package/dist/client/_floatingIpId-AE9Fu8l6.mjs.map +1 -0
  32. package/dist/client/{_floatingIpId-DCQQpNO-.mjs → _floatingIpId-AZ11Ksmu.mjs} +3 -9
  33. package/dist/client/_floatingIpId-AZ11Ksmu.mjs.map +1 -0
  34. package/dist/client/_imageId-BtAql2Kr.mjs +570 -0
  35. package/dist/client/_imageId-BtAql2Kr.mjs.map +1 -0
  36. package/dist/client/_imageId-D76BxvFY.mjs +39 -0
  37. package/dist/client/_imageId-D76BxvFY.mjs.map +1 -0
  38. package/dist/client/_projectId-7Nl1MQTJ.mjs +99 -0
  39. package/dist/client/_projectId-7Nl1MQTJ.mjs.map +1 -0
  40. package/dist/client/_projectId-B3wmSala.mjs +281 -0
  41. package/dist/client/_projectId-B3wmSala.mjs.map +1 -0
  42. package/dist/client/_projectId-DPzv0CCp.mjs +77 -0
  43. package/dist/client/_projectId-DPzv0CCp.mjs.map +1 -0
  44. package/dist/client/_projectId-DfeVJy0G.mjs +30 -0
  45. package/dist/client/_projectId-DfeVJy0G.mjs.map +1 -0
  46. package/dist/client/_securityGroupId-C5huJNfO.mjs +1810 -0
  47. package/dist/client/_securityGroupId-C5huJNfO.mjs.map +1 -0
  48. package/dist/client/{_securityGroupId-Mj8NJT2-.mjs → _securityGroupId-D85mSigA.mjs} +3 -9
  49. package/dist/client/_securityGroupId-D85mSigA.mjs.map +1 -0
  50. package/dist/client/_serviceType-DS8DxsrP.mjs +20 -0
  51. package/dist/client/_serviceType-DS8DxsrP.mjs.map +1 -0
  52. package/dist/client/_serviceType-M8d9rOT6.mjs +6 -0
  53. package/dist/client/_serviceType-M8d9rOT6.mjs.map +1 -0
  54. package/dist/client/_storageType-BRWWJtow.mjs +14 -0
  55. package/dist/client/_storageType-BRWWJtow.mjs.map +1 -0
  56. package/dist/client/_storageType-CzZ4u9x_.mjs +12 -0
  57. package/dist/client/_storageType-CzZ4u9x_.mjs.map +1 -0
  58. package/dist/client/_storageType-Dy9uCVXr.mjs +845 -0
  59. package/dist/client/_storageType-Dy9uCVXr.mjs.map +1 -0
  60. package/dist/client/_storageType-zeSZe--V.mjs.map +1 -1
  61. package/dist/client/{about-WLyShNgE.mjs → about-BmQTyLWc.mjs} +2 -2
  62. package/dist/client/{about-WLyShNgE.mjs.map → about-BmQTyLWc.mjs.map} +1 -1
  63. package/dist/client/assets/{objectDownload.worker-BXFQIIU_.js.map → objectDownload.worker-CWWLPDyb.js.map} +1 -1
  64. package/dist/client/assets/{objectDownload.worker-ECvFtmOF.js.map → objectDownload.worker-kZlQuo3F.js.map} +1 -1
  65. package/dist/client/{aurora-IMO9HhqJ.mjs → aurora-CIml-f2f.mjs} +2 -2
  66. package/dist/client/{aurora-IMO9HhqJ.mjs.map → aurora-CIml-f2f.mjs.map} +1 -1
  67. package/dist/client/{build-DnD-T35u.mjs → build-WuxXRAqf.mjs} +2335 -2667
  68. package/dist/client/{build-DnD-T35u.mjs.map → build-WuxXRAqf.mjs.map} +1 -1
  69. package/dist/client/components/Breadcrumbs.d.ts +1 -0
  70. package/dist/client/components/ListToolbar/SortInput.d.ts +3 -0
  71. package/dist/client/context/BreadcrumbExtensionContext.d.ts +9 -0
  72. package/dist/client/context/DynamicBreadcrumbContext.d.ts +9 -0
  73. package/dist/client/{flavors-Cp0LEGOH.mjs → flavors-B0rbqffG.mjs} +3 -5
  74. package/dist/client/flavors-B0rbqffG.mjs.map +1 -0
  75. package/dist/client/flavors-DWMZ6TuJ.mjs.map +1 -1
  76. package/dist/client/flavors-Rl20bxVU.mjs +628 -0
  77. package/dist/client/flavors-Rl20bxVU.mjs.map +1 -0
  78. package/dist/client/floatingips-Cz9k80cc.mjs +8 -0
  79. package/dist/client/floatingips-Cz9k80cc.mjs.map +1 -0
  80. package/dist/client/floatingips-xbO_mu4f.mjs +576 -0
  81. package/dist/client/floatingips-xbO_mu4f.mjs.map +1 -0
  82. package/dist/client/hooks/useBreadcrumbs.d.ts +16 -0
  83. package/dist/client/hooks/usePushBreadcrumbs.d.ts +10 -0
  84. package/dist/client/hooks/useSetBreadcrumb.d.ts +11 -0
  85. package/dist/client/{hooks-CrriowRk.mjs → hooks-D0yKIumu.mjs} +2 -2
  86. package/dist/client/{hooks-CrriowRk.mjs.map → hooks-D0yKIumu.mjs.map} +1 -1
  87. package/dist/client/images-BGQv9kKT.mjs +1983 -0
  88. package/dist/client/images-BGQv9kKT.mjs.map +1 -0
  89. package/dist/client/{images-DWiM_72I.mjs → images-CPmMa4SQ.mjs} +3 -5
  90. package/dist/client/images-CPmMa4SQ.mjs.map +1 -0
  91. package/dist/client/images-NBf2bV43.mjs.map +1 -1
  92. package/dist/client/index.d.ts +9 -2
  93. package/dist/client/index.js +567 -695
  94. package/dist/client/index.js.map +1 -1
  95. package/dist/client/{md-DNzcRhmz.mjs → md-kvaGCNAK.mjs} +4 -22
  96. package/dist/client/{md-DNzcRhmz.mjs.map → md-kvaGCNAK.mjs.map} +1 -1
  97. package/dist/client/objects-BE_u5yRt.mjs +12950 -0
  98. package/dist/client/objects-BE_u5yRt.mjs.map +1 -0
  99. package/dist/client/objects-BN-59Th0.mjs +66 -0
  100. package/dist/client/objects-BN-59Th0.mjs.map +1 -0
  101. package/dist/client/objects-D9Luf9KB.mjs +66 -0
  102. package/dist/client/objects-D9Luf9KB.mjs.map +1 -0
  103. package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
  104. package/dist/client/routeInfo-DP3v74Wg.mjs +19 -0
  105. package/dist/client/routeInfo-DP3v74Wg.mjs.map +1 -0
  106. package/dist/client/router.d.ts +2 -1
  107. package/dist/client/{routes-B05u5bk4.mjs → routes-CJj7SR_K.mjs} +2 -2
  108. package/dist/client/routes-CJj7SR_K.mjs.map +1 -0
  109. package/dist/client/routes-xofA3ksU.mjs +110 -0
  110. package/dist/client/routes-xofA3ksU.mjs.map +1 -0
  111. package/dist/client/securitygroups-BjhgLBHm.mjs +620 -0
  112. package/dist/client/securitygroups-BjhgLBHm.mjs.map +1 -0
  113. package/dist/client/securitygroups-CtKne8UQ.mjs +8 -0
  114. package/dist/client/securitygroups-CtKne8UQ.mjs.map +1 -0
  115. package/dist/client/{securitygroups-_7SYN2jN.mjs → securitygroups-DEJQBcxm.mjs} +3 -5
  116. package/dist/client/securitygroups-DEJQBcxm.mjs.map +1 -0
  117. package/dist/client/services-D1PbooD1.mjs +6 -0
  118. package/dist/client/services-D1PbooD1.mjs.map +1 -0
  119. package/dist/client/services-DEMVtFyn.mjs +9 -0
  120. package/dist/client/services-DEMVtFyn.mjs.map +1 -0
  121. package/dist/client/trpcClient.d.ts +153 -370
  122. package/dist/client/useBreadcrumbs-ha3IlaxX.mjs +54 -0
  123. package/dist/client/useBreadcrumbs-ha3IlaxX.mjs.map +1 -0
  124. package/dist/client/useModalTracking-BcOKTYRN.mjs +33 -0
  125. package/dist/client/useModalTracking-BcOKTYRN.mjs.map +1 -0
  126. package/dist/client/{useSecurityGroupPermissions-qPwm4mFt.mjs → useSecurityGroupPermissions-BOyLQLdC.mjs} +78 -12
  127. package/dist/client/useSecurityGroupPermissions-BOyLQLdC.mjs.map +1 -0
  128. package/dist/client/useSetBreadcrumb-tn7lBaQV.mjs +19 -0
  129. package/dist/client/useSetBreadcrumb-tn7lBaQV.mjs.map +1 -0
  130. package/dist/client/utils/formatSwiftDate.d.ts +30 -0
  131. package/dist/server/index.d.ts +179 -373
  132. package/dist/server/index.js +910 -530
  133. package/package.json +37 -38
  134. package/dist/client/AuthProvider-5TyZKZkx.mjs.map +0 -1
  135. package/dist/client/DeleteFlavorModal-C2K43ABZ.mjs +0 -732
  136. package/dist/client/DeleteFlavorModal-C2K43ABZ.mjs.map +0 -1
  137. package/dist/client/DeletePcaModal-D9v8E0Ki.mjs +0 -92
  138. package/dist/client/DeletePcaModal-D9v8E0Ki.mjs.map +0 -1
  139. package/dist/client/DetailsInfo-h7rPJ4Jf.mjs +0 -61
  140. package/dist/client/DetailsInfo-h7rPJ4Jf.mjs.map +0 -1
  141. package/dist/client/FloatingIpActionModals-BfEDfYg9.mjs +0 -417
  142. package/dist/client/FloatingIpActionModals-BfEDfYg9.mjs.map +0 -1
  143. package/dist/client/ImageToastNotifications-C0Tluzq-.mjs +0 -1125
  144. package/dist/client/ImageToastNotifications-C0Tluzq-.mjs.map +0 -1
  145. package/dist/client/RouteError-B-NPGIv7.mjs +0 -25
  146. package/dist/client/RouteError-B-NPGIv7.mjs.map +0 -1
  147. package/dist/client/SortInput-DysAXpB3.mjs.map +0 -1
  148. package/dist/client/StatusError-DX-GvLjq.mjs +0 -39
  149. package/dist/client/StatusError-DX-GvLjq.mjs.map +0 -1
  150. package/dist/client/_auth-R5H2yKFf.mjs +0 -11
  151. package/dist/client/_auth-R5H2yKFf.mjs.map +0 -1
  152. package/dist/client/_flavorId-Dit5mM8I.mjs +0 -210
  153. package/dist/client/_flavorId-Dit5mM8I.mjs.map +0 -1
  154. package/dist/client/_flavorId-Zj7LNL-R.mjs.map +0 -1
  155. package/dist/client/_floatingIpId-B0MCoqE3.mjs +0 -215
  156. package/dist/client/_floatingIpId-B0MCoqE3.mjs.map +0 -1
  157. package/dist/client/_floatingIpId-DCQQpNO-.mjs.map +0 -1
  158. package/dist/client/_imageId-CZYzBAVx.mjs +0 -558
  159. package/dist/client/_imageId-CZYzBAVx.mjs.map +0 -1
  160. package/dist/client/_pcaId-CHRRsWmO.mjs +0 -605
  161. package/dist/client/_pcaId-CHRRsWmO.mjs.map +0 -1
  162. package/dist/client/_projectId-B8wWSxPu.mjs +0 -98
  163. package/dist/client/_projectId-B8wWSxPu.mjs.map +0 -1
  164. package/dist/client/_projectId-C5DUYIjt.mjs +0 -291
  165. package/dist/client/_projectId-C5DUYIjt.mjs.map +0 -1
  166. package/dist/client/_projectId-D2pFfYIs.mjs +0 -46
  167. package/dist/client/_projectId-D2pFfYIs.mjs.map +0 -1
  168. package/dist/client/_projectId-DhSWowQo.mjs +0 -29
  169. package/dist/client/_projectId-DhSWowQo.mjs.map +0 -1
  170. package/dist/client/_securityGroupId-DZ4D4WwB.mjs +0 -1801
  171. package/dist/client/_securityGroupId-DZ4D4WwB.mjs.map +0 -1
  172. package/dist/client/_securityGroupId-Mj8NJT2-.mjs.map +0 -1
  173. package/dist/client/_storageType-C-9bNkmZ.mjs +0 -2211
  174. package/dist/client/_storageType-C-9bNkmZ.mjs.map +0 -1
  175. package/dist/client/components/Error/StatusError.d.ts +0 -11
  176. package/dist/client/components/ProjectView/ProjectInfoBox.d.ts +0 -12
  177. package/dist/client/flavors-Cp0LEGOH.mjs.map +0 -1
  178. package/dist/client/flavors-CwMbDRHm2.mjs +0 -650
  179. package/dist/client/flavors-CwMbDRHm2.mjs.map +0 -1
  180. package/dist/client/floatingips-ICwo-rV_.mjs +0 -591
  181. package/dist/client/floatingips-ICwo-rV_.mjs.map +0 -1
  182. package/dist/client/images-DOGZmr3D.mjs +0 -1937
  183. package/dist/client/images-DOGZmr3D.mjs.map +0 -1
  184. package/dist/client/images-DWiM_72I.mjs.map +0 -1
  185. package/dist/client/objects-D2MKUCxc.mjs +0 -56
  186. package/dist/client/objects-D2MKUCxc.mjs.map +0 -1
  187. package/dist/client/objects-DI1-tnKr.mjs +0 -56
  188. package/dist/client/objects-DI1-tnKr.mjs.map +0 -1
  189. package/dist/client/objects-DeK2WD5K.mjs +0 -10078
  190. package/dist/client/objects-DeK2WD5K.mjs.map +0 -1
  191. package/dist/client/pca-BokFv4Gz.mjs +0 -239
  192. package/dist/client/pca-BokFv4Gz.mjs.map +0 -1
  193. package/dist/client/pca-D5jHAl0b.mjs +0 -26
  194. package/dist/client/pca-D5jHAl0b.mjs.map +0 -1
  195. package/dist/client/pcaAccess-Br4kVjLQ.mjs +0 -9
  196. package/dist/client/pcaAccess-Br4kVjLQ.mjs.map +0 -1
  197. package/dist/client/routeInfo-CdTRlSxv.mjs +0 -32
  198. package/dist/client/routeInfo-CdTRlSxv.mjs.map +0 -1
  199. package/dist/client/routes-B05u5bk4.mjs.map +0 -1
  200. package/dist/client/routes-DOJr5onJ.mjs +0 -115
  201. package/dist/client/routes-DOJr5onJ.mjs.map +0 -1
  202. package/dist/client/securitygroups-Be2Qgmew.mjs +0 -595
  203. package/dist/client/securitygroups-Be2Qgmew.mjs.map +0 -1
  204. package/dist/client/securitygroups-_7SYN2jN.mjs.map +0 -1
  205. package/dist/client/useSecurityGroupPermissions-qPwm4mFt.mjs.map +0 -1
@@ -0,0 +1,570 @@
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