@cobaltcore-dev/aurora 0.4.0 → 0.6.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 (178) hide show
  1. package/README.md +73 -77
  2. package/dist/client/AuroraApp.d.ts +15 -0
  3. package/dist/client/{AuthProvider-D-5Jpa6F.mjs → AuthProvider-Co4d0WzB.mjs} +3 -3
  4. package/dist/client/{AuthProvider-D-5Jpa6F.mjs.map → AuthProvider-Co4d0WzB.mjs.map} +1 -1
  5. package/dist/client/{ContentHeader-BXZoN3B9.mjs → ContentHeader-kx1Th5Sq.mjs} +29 -29
  6. package/dist/client/{ContentHeader-BXZoN3B9.mjs.map → ContentHeader-kx1Th5Sq.mjs.map} +1 -1
  7. package/dist/client/DeleteFlavorModal-C3cb7YiJ.mjs +638 -0
  8. package/dist/client/DeleteFlavorModal-C3cb7YiJ.mjs.map +1 -0
  9. package/dist/client/{EditSecurityGroupModal-DK3WYikA.mjs → EditSecurityGroupModal-CpP54WIK.mjs} +22 -22
  10. package/dist/client/{EditSecurityGroupModal-DK3WYikA.mjs.map → EditSecurityGroupModal-CpP54WIK.mjs.map} +1 -1
  11. package/dist/client/{FiltersInput-OVeIJzIo.mjs → FiltersInput-DxcyR6Bp.mjs} +18 -18
  12. package/dist/client/{FiltersInput-OVeIJzIo.mjs.map → FiltersInput-DxcyR6Bp.mjs.map} +1 -1
  13. package/dist/client/{FloatingIpActionModals-Dok7fJss.mjs → FloatingIpActionModals-BP8RWHbu.mjs} +77 -77
  14. package/dist/client/{FloatingIpActionModals-Dok7fJss.mjs.map → FloatingIpActionModals-BP8RWHbu.mjs.map} +1 -1
  15. package/dist/client/ImageToastNotifications-TZ3EfQg-.mjs +1219 -0
  16. package/dist/client/ImageToastNotifications-TZ3EfQg-.mjs.map +1 -0
  17. package/dist/client/{RouteError-pDEWC_k7.mjs → RouteError-QSV7qOoJ.mjs} +6 -6
  18. package/dist/client/{RouteError-pDEWC_k7.mjs.map → RouteError-QSV7qOoJ.mjs.map} +1 -1
  19. package/dist/client/{SortInput-DXWSqSny.mjs → SortInput-CYv2_Pur.mjs} +6 -6
  20. package/dist/client/{SortInput-DXWSqSny.mjs.map → SortInput-CYv2_Pur.mjs.map} +1 -1
  21. package/dist/client/{_auth-CJj1Cnbm.mjs → _auth-DXJkv9QO.mjs} +3 -3
  22. package/dist/client/{_auth-CJj1Cnbm.mjs.map → _auth-DXJkv9QO.mjs.map} +1 -1
  23. package/dist/client/{_flavorId-BoNcxYmF.mjs → _flavorId-C2x43-6S.mjs} +15 -15
  24. package/dist/client/_flavorId-C2x43-6S.mjs.map +1 -0
  25. package/dist/client/_flavorId-CR8ZUI-P.mjs +194 -0
  26. package/dist/client/_flavorId-CR8ZUI-P.mjs.map +1 -0
  27. package/dist/client/{_floatingIpId-D33bOEmH.mjs → _floatingIpId-BCk41_Lb.mjs} +3 -3
  28. package/dist/client/{_floatingIpId-D33bOEmH.mjs.map → _floatingIpId-BCk41_Lb.mjs.map} +1 -1
  29. package/dist/client/{_floatingIpId-DF_BSJN6.mjs → _floatingIpId-BGrOAmPT.mjs} +48 -48
  30. package/dist/client/{_floatingIpId-DF_BSJN6.mjs.map → _floatingIpId-BGrOAmPT.mjs.map} +1 -1
  31. package/dist/client/_imageId-CvfD832b.mjs +534 -0
  32. package/dist/client/_imageId-CvfD832b.mjs.map +1 -0
  33. package/dist/client/_pcaId-BxBt5DXi.mjs +459 -0
  34. package/dist/client/_pcaId-BxBt5DXi.mjs.map +1 -0
  35. package/dist/client/{_pcaId-BYCoeK6_.mjs → _pcaId-DOHycvCf.mjs} +3 -3
  36. package/dist/client/{_pcaId-BYCoeK6_.mjs.map → _pcaId-DOHycvCf.mjs.map} +1 -1
  37. package/dist/client/_projectId-BDSWnMGj.mjs +46 -0
  38. package/dist/client/_projectId-BDSWnMGj.mjs.map +1 -0
  39. package/dist/client/{_projectId-OW2xkK43.mjs → _projectId-DOgwFiqD.mjs} +3 -3
  40. package/dist/client/{_projectId-OW2xkK43.mjs.map → _projectId-DOgwFiqD.mjs.map} +1 -1
  41. package/dist/client/_projectId-DS4nR59B.mjs +299 -0
  42. package/dist/client/_projectId-DS4nR59B.mjs.map +1 -0
  43. package/dist/client/{_projectId-BwLMEMGC.mjs → _projectId-MxcHrXW4.mjs} +21 -21
  44. package/dist/client/_projectId-MxcHrXW4.mjs.map +1 -0
  45. package/dist/client/{_securityGroupId-B-Z-CzLp.mjs → _securityGroupId-CJJanWiY.mjs} +3 -3
  46. package/dist/client/{_securityGroupId-B-Z-CzLp.mjs.map → _securityGroupId-CJJanWiY.mjs.map} +1 -1
  47. package/dist/client/{_securityGroupId-B1bOYRbX.mjs → _securityGroupId-KKw4RPdH.mjs} +445 -446
  48. package/dist/client/{_securityGroupId-B1bOYRbX.mjs.map → _securityGroupId-KKw4RPdH.mjs.map} +1 -1
  49. package/dist/client/{containers-BjWqjNOx.mjs → _storageType-4wSxI__0.mjs} +19 -16
  50. package/dist/client/_storageType-4wSxI__0.mjs.map +1 -0
  51. package/dist/client/_storageType-DYjo-6ej.mjs +3243 -0
  52. package/dist/client/_storageType-DYjo-6ej.mjs.map +1 -0
  53. package/dist/client/_storageType-zeSZe--V.mjs +7 -0
  54. package/dist/client/_storageType-zeSZe--V.mjs.map +1 -0
  55. package/dist/client/about-Bo9vxGHy.mjs +92 -0
  56. package/dist/client/{about-DLn1ShhF.mjs.map → about-Bo9vxGHy.mjs.map} +1 -1
  57. package/dist/client/aurora-DDzsst74.mjs +19 -0
  58. package/dist/client/{aurora-CRcxVUCo.mjs.map → aurora-DDzsst74.mjs.map} +1 -1
  59. package/dist/client/{build-BJDfnAyi.mjs → build-DeJcDjPi.mjs} +3802 -3376
  60. package/dist/client/build-DeJcDjPi.mjs.map +1 -0
  61. package/dist/client/{buildFilterParams-TeyosGyK.mjs → buildFilterParams-DoZzMKX9.mjs} +1 -1
  62. package/dist/client/{buildFilterParams-TeyosGyK.mjs.map → buildFilterParams-DoZzMKX9.mjs.map} +1 -1
  63. package/dist/client/{cn-C3laVXMm.mjs → cn-DM4Cy3jv.mjs} +1 -1
  64. package/dist/client/{cn-C3laVXMm.mjs.map → cn-DM4Cy3jv.mjs.map} +1 -1
  65. package/dist/client/constants-BmcGYeR-.mjs +153 -0
  66. package/dist/client/constants-BmcGYeR-.mjs.map +1 -0
  67. package/dist/client/{flavors-D8oElC2K.mjs → flavors-BxFVqgnb.mjs} +2 -2
  68. package/dist/client/{flavors-D8oElC2K.mjs.map → flavors-BxFVqgnb.mjs.map} +1 -1
  69. package/dist/client/flavors-CfdgjsZY.mjs +632 -0
  70. package/dist/client/flavors-CfdgjsZY.mjs.map +1 -0
  71. package/dist/client/{flavors-BXPYAFyQ.mjs → flavors-DWMZ6TuJ.mjs} +2 -2
  72. package/dist/client/{flavors-BXPYAFyQ.mjs.map → flavors-DWMZ6TuJ.mjs.map} +1 -1
  73. package/dist/client/{floatingips-Fa6ocNUu.mjs → floatingips-ByRb82wS.mjs} +138 -139
  74. package/dist/client/{floatingips-Fa6ocNUu.mjs.map → floatingips-ByRb82wS.mjs.map} +1 -1
  75. package/dist/client/{formatBytes-tQBEnPoL.mjs → formatBytes-CZv_XyCY.mjs} +1 -1
  76. package/dist/client/{formatBytes-tQBEnPoL.mjs.map → formatBytes-CZv_XyCY.mjs.map} +1 -1
  77. package/dist/client/{helpers--JWXi40U.mjs → helpers-1PpYf-fC.mjs} +1 -1
  78. package/dist/client/{helpers--JWXi40U.mjs.map → helpers-1PpYf-fC.mjs.map} +1 -1
  79. package/dist/client/hooks-dSArr2Ca.mjs +2 -0
  80. package/dist/client/images-CKqIXUq52.mjs +1873 -0
  81. package/dist/client/images-CKqIXUq52.mjs.map +1 -0
  82. package/dist/client/{images-tYfyOkX8.mjs → images-C_dX7nY6.mjs} +3 -3
  83. package/dist/client/{images-tYfyOkX8.mjs.map → images-C_dX7nY6.mjs.map} +1 -1
  84. package/dist/client/{images-CTLCY-yY.mjs → images-CenluYV8.mjs} +2 -2
  85. package/dist/client/{images-CTLCY-yY.mjs.map → images-CenluYV8.mjs.map} +1 -1
  86. package/dist/client/{images-DM9I8G0p.mjs → images-NBf2bV43.mjs} +2 -2
  87. package/dist/client/{images-DM9I8G0p.mjs.map → images-NBf2bV43.mjs.map} +1 -1
  88. package/dist/client/index.js +428 -477
  89. package/dist/client/index.js.map +1 -1
  90. package/dist/client/{md-BivyCkGC.mjs → md-CYTrL5dq.mjs} +58 -22
  91. package/dist/client/{md-BivyCkGC.mjs.map → md-CYTrL5dq.mjs.map} +1 -1
  92. package/dist/client/{network-rYLHyf15.mjs → network-DuZm76BZ.mjs} +2 -2
  93. package/dist/client/{network-rYLHyf15.mjs.map → network-DuZm76BZ.mjs.map} +1 -1
  94. package/dist/client/objects-BJM6YeuF.mjs +5708 -0
  95. package/dist/client/objects-BJM6YeuF.mjs.map +1 -0
  96. package/dist/client/objects-gxSjvbvF.mjs +101 -0
  97. package/dist/client/objects-gxSjvbvF.mjs.map +1 -0
  98. package/dist/client/objects-o2Cj_ndZ.mjs +8 -0
  99. package/dist/client/objects-o2Cj_ndZ.mjs.map +1 -0
  100. package/dist/client/{pca-COmKvp3J.mjs → pca-Bl8NmoVZ.mjs} +2 -2
  101. package/dist/client/{pca-COmKvp3J.mjs.map → pca-Bl8NmoVZ.mjs.map} +1 -1
  102. package/dist/client/pca-RSiWpJs9.mjs +182 -0
  103. package/dist/client/pca-RSiWpJs9.mjs.map +1 -0
  104. package/dist/client/projects-CgclWI16.mjs +105 -0
  105. package/dist/client/projects-CgclWI16.mjs.map +1 -0
  106. package/dist/client/{projects-DI_L4oDw.mjs → projects-D2iewAzu.mjs} +2 -2
  107. package/dist/client/{projects-DI_L4oDw.mjs.map → projects-D2iewAzu.mjs.map} +1 -1
  108. package/dist/client/{projects-Dl5XkXUP.mjs → projects-pe2_dCnV.mjs} +3 -3
  109. package/dist/client/{projects-Dl5XkXUP.mjs.map → projects-pe2_dCnV.mjs.map} +1 -1
  110. package/dist/client/{projects-HoQ0gE5Y.mjs → projects-yiK0HGSA.mjs} +2 -2
  111. package/dist/client/{projects-HoQ0gE5Y.mjs.map → projects-yiK0HGSA.mjs.map} +1 -1
  112. package/dist/client/{securitygroups-BjkmHk2J.mjs → securitygroups-DahZkVYQ.mjs} +139 -140
  113. package/dist/client/{securitygroups-BjkmHk2J.mjs.map → securitygroups-DahZkVYQ.mjs.map} +1 -1
  114. package/dist/client/{trpcClient-BxguzNYF.mjs → trpcClient-BzPUgiM2.mjs} +1 -1
  115. package/dist/client/{trpcClient-BxguzNYF.mjs.map → trpcClient-BzPUgiM2.mjs.map} +1 -1
  116. package/dist/client/{useErrorTranslation-TZVwIAzq.mjs → useErrorTranslation-Dc0eE8Zt.mjs} +1 -1
  117. package/dist/client/{useErrorTranslation-TZVwIAzq.mjs.map → useErrorTranslation-Dc0eE8Zt.mjs.map} +1 -1
  118. package/dist/client/useListWithFiltering-DaYcu5AB.mjs +157 -0
  119. package/dist/client/useListWithFiltering-DaYcu5AB.mjs.map +1 -0
  120. package/dist/client/{useModal-DxxlilRm.mjs → useModal-DCs1OJh7.mjs} +1 -1
  121. package/dist/client/{useModal-DxxlilRm.mjs.map → useModal-DCs1OJh7.mjs.map} +1 -1
  122. package/dist/client/{useProjectId-OQv2KBbG.mjs → useProjectId-DBc5lpoU.mjs} +1 -1
  123. package/dist/client/{useProjectId-OQv2KBbG.mjs.map → useProjectId-DBc5lpoU.mjs.map} +1 -1
  124. package/dist/server/index.js +1285 -435
  125. package/package.json +5 -4
  126. package/dist/client/DeleteFlavorModal-BusYn32r.mjs +0 -629
  127. package/dist/client/DeleteFlavorModal-BusYn32r.mjs.map +0 -1
  128. package/dist/client/ImageToastNotifications-BG9LPnXf.mjs +0 -1267
  129. package/dist/client/ImageToastNotifications-BG9LPnXf.mjs.map +0 -1
  130. package/dist/client/ListToolbar-BojRTNbo.mjs +0 -129
  131. package/dist/client/ListToolbar-BojRTNbo.mjs.map +0 -1
  132. package/dist/client/_flavorId-BRonXvCo.mjs +0 -188
  133. package/dist/client/_flavorId-BRonXvCo.mjs.map +0 -1
  134. package/dist/client/_flavorId-BoNcxYmF.mjs.map +0 -1
  135. package/dist/client/_imageId-BL0I5_pv.mjs +0 -527
  136. package/dist/client/_imageId-BL0I5_pv.mjs.map +0 -1
  137. package/dist/client/_pcaId-CbBhBrX1.mjs +0 -466
  138. package/dist/client/_pcaId-CbBhBrX1.mjs.map +0 -1
  139. package/dist/client/_projectId-5NiasyXm.mjs +0 -26
  140. package/dist/client/_projectId-5NiasyXm.mjs.map +0 -1
  141. package/dist/client/_projectId-BwLMEMGC.mjs.map +0 -1
  142. package/dist/client/_projectId-D35MN1kY.mjs +0 -316
  143. package/dist/client/_projectId-D35MN1kY.mjs.map +0 -1
  144. package/dist/client/about-DLn1ShhF.mjs +0 -92
  145. package/dist/client/aurora-CRcxVUCo.mjs +0 -19
  146. package/dist/client/build-BJDfnAyi.mjs.map +0 -1
  147. package/dist/client/constants-B-P2r5F1.mjs +0 -128
  148. package/dist/client/constants-B-P2r5F1.mjs.map +0 -1
  149. package/dist/client/containers-BjWqjNOx.mjs.map +0 -1
  150. package/dist/client/containers-DsRWc1L5.mjs +0 -7
  151. package/dist/client/containers-DsRWc1L5.mjs.map +0 -1
  152. package/dist/client/containers-J7WFA18U.mjs +0 -3120
  153. package/dist/client/containers-J7WFA18U.mjs.map +0 -1
  154. package/dist/client/flavors-qvgPSI7J.mjs +0 -613
  155. package/dist/client/flavors-qvgPSI7J.mjs.map +0 -1
  156. package/dist/client/hooks-DEjb9d1F.mjs +0 -2
  157. package/dist/client/images-CSFfefAu.mjs +0 -1901
  158. package/dist/client/images-CSFfefAu.mjs.map +0 -1
  159. package/dist/client/objects-BciXwZ00.mjs +0 -86
  160. package/dist/client/objects-BciXwZ00.mjs.map +0 -1
  161. package/dist/client/objects-Cdew99tK.mjs +0 -8
  162. package/dist/client/objects-Cdew99tK.mjs.map +0 -1
  163. package/dist/client/objects-DaElrban.mjs +0 -5340
  164. package/dist/client/objects-DaElrban.mjs.map +0 -1
  165. package/dist/client/overview-BMhjFMIV.mjs +0 -15
  166. package/dist/client/overview-BMhjFMIV.mjs.map +0 -1
  167. package/dist/client/overview-BYIRj7_X.mjs +0 -15
  168. package/dist/client/overview-BYIRj7_X.mjs.map +0 -1
  169. package/dist/client/overview-DRCKNBH2.mjs +0 -15
  170. package/dist/client/overview-DRCKNBH2.mjs.map +0 -1
  171. package/dist/client/overview-urYLOVQE.mjs +0 -173
  172. package/dist/client/overview-urYLOVQE.mjs.map +0 -1
  173. package/dist/client/pca-oc7J0_Xd.mjs +0 -167
  174. package/dist/client/pca-oc7J0_Xd.mjs.map +0 -1
  175. package/dist/client/projects-BUabCzvw.mjs +0 -95
  176. package/dist/client/projects-BUabCzvw.mjs.map +0 -1
  177. package/dist/client/useListWithFiltering-CbhHJO4V.mjs +0 -32
  178. package/dist/client/useListWithFiltering-CbhHJO4V.mjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobaltcore-dev/aurora",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "description": "Aurora OpenStack dashboard — server and client library",
6
6
  "license": "Apache-2.0",
@@ -64,13 +64,14 @@
64
64
  "fastify-plugin": "^5.1.0",
65
65
  "focus-trap-react": "^12.0.0",
66
66
  "node-fetch": "^3.3.2",
67
+ "prom-client": "^15.1.3",
67
68
  "react-error-boundary": "^6.1.0",
68
69
  "react-icons": "^5.6.0",
69
70
  "tailwind-merge": "^3.2.0",
70
71
  "zod": "^4.0.0"
71
72
  },
72
73
  "devDependencies": {
73
- "@cloudoperators/juno-ui-components": "7.0.0",
74
+ "@cloudoperators/juno-ui-components": "8.1.0",
74
75
  "@fastify/vite": "^8.4.1",
75
76
  "@lingui/cli": "^5.9.5",
76
77
  "@lingui/format-po": "^5.9.5",
@@ -99,11 +100,11 @@
99
100
  "prettier": "^3.4.2",
100
101
  "tailwindcss": "^4.1.7",
101
102
  "tsc-alias": "^1.8.16",
103
+ "tsconfig-paths": "^4.2.0",
102
104
  "tsup": "^8.5.1",
103
105
  "tsx": "^4.21.0",
104
- "tsconfig-paths": "^4.2.0",
105
106
  "typescript": "^6.0.2",
106
- "vite": "^8.0.0",
107
+ "vite": "^8.0.16",
107
108
  "vite-plugin-dts": "^5.0.1",
108
109
  "vite-plugin-svgr": "^5.0.0",
109
110
  "vite-tsconfig-paths": "^6.1.1",
@@ -1,629 +0,0 @@
1
- import { B as e, G as t, I as n, M as r, Q as i, T as a, U as o, c as s, h as c, nt as l, ot as u, q as d } from "./build-BJDfnAyi.mjs";
2
- import { t as f } from "./useErrorTranslation-TZVwIAzq.mjs";
3
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
4
- import g, { Suspense as _, startTransition as v, use as y, useEffect as b, useMemo as x, useState as S } from "react";
5
- import { Trans as C, useLingui as w } from "@lingui/react";
6
- //#region src/client/routes/_auth/projects/$projectId/compute/-components/Flavors/-components/SpecFormRow.tsx
7
- var T = ({ specKey: e, value: t, errors: i, isLoading: o, onKeyChange: l, onValueChange: u, onSave: d, onCancel: f }) => {
8
- let { i18n: p, _: g } = w();
9
- return /* @__PURE__ */ h(n, { children: [
10
- /* @__PURE__ */ m(r, {
11
- className: "pl-0",
12
- children: /* @__PURE__ */ m(a, {
13
- value: e,
14
- onChange: (e) => l(e.target.value),
15
- placeholder: p._({ id: "wPrtGF" }),
16
- errortext: i.key,
17
- required: !0
18
- })
19
- }),
20
- /* @__PURE__ */ m(r, {
21
- className: "pl-0",
22
- children: /* @__PURE__ */ m(a, {
23
- value: t,
24
- onChange: (e) => u(e.target.value),
25
- placeholder: p._({ id: "pubQie" }),
26
- errortext: i.value,
27
- required: !0
28
- })
29
- }),
30
- /* @__PURE__ */ m(r, { children: /* @__PURE__ */ h(c, { children: [/* @__PURE__ */ m(s, {
31
- icon: "check",
32
- onClick: d,
33
- variant: "primary",
34
- title: p._({ id: "TyODHt" }),
35
- disabled: o
36
- }), /* @__PURE__ */ m(s, {
37
- icon: "cancel",
38
- onClick: f,
39
- title: p._({ id: "dEgA5A" }),
40
- disabled: o
41
- })] }) })
42
- ] });
43
- }, E = ({ specKey: e, value: t, isDeleting: a, onDelete: o, canDelete: c }) => {
44
- let { i18n: u, _: d } = w(), [f, g] = S(!1);
45
- return b(() => {
46
- if (f) {
47
- let e = setTimeout(() => {
48
- g(!1);
49
- }, 3e3);
50
- return () => clearTimeout(e);
51
- }
52
- }, [f]), /* @__PURE__ */ h(n, { children: [
53
- /* @__PURE__ */ m(r, { children: e }),
54
- /* @__PURE__ */ m(r, { children: t }),
55
- /* @__PURE__ */ m(r, { children: a ? /* @__PURE__ */ m(l, {
56
- distribution: "center",
57
- alignment: "center",
58
- children: /* @__PURE__ */ m(i, { variant: "primary" })
59
- }) : /* @__PURE__ */ m(l, {
60
- distribution: "end",
61
- alignment: "end",
62
- children: c ? f ? /* @__PURE__ */ m(s, {
63
- variant: "primary-danger",
64
- onClick: () => {
65
- g(!1), o();
66
- },
67
- title: u._({ id: "cnGeoo" }),
68
- "aria-label": u._({ id: "cnGeoo" }),
69
- "data-testid": "confirm-deletion",
70
- disabled: a,
71
- children: u._({ id: "cnGeoo" })
72
- }) : /* @__PURE__ */ m(s, {
73
- icon: "deleteForever",
74
- onClick: () => g(!0),
75
- title: u._({
76
- id: "2G6hLq",
77
- values: { specKey: e }
78
- }),
79
- "aria-label": u._({
80
- id: "2G6hLq",
81
- values: { specKey: e }
82
- }),
83
- "data-testid": `delete-${e}`,
84
- disabled: a
85
- }) : /* @__PURE__ */ m(p, {})
86
- }) })
87
- ] });
88
- }, D = (e, t) => e.compute.canUser.query({
89
- project_id: t,
90
- permission: ["flavor_specs:create", "flavor_specs:delete"]
91
- }).then(([e, t]) => ({
92
- canCreate: e,
93
- canDelete: t
94
- })), O = (e, t, n) => e.compute.getExtraSpecs.query({
95
- project_id: t,
96
- flavorId: n
97
- });
98
- function k() {
99
- return /* @__PURE__ */ m(n, { children: /* @__PURE__ */ m(r, {
100
- colSpan: 3,
101
- children: /* @__PURE__ */ m(l, {
102
- distribution: "center",
103
- alignment: "center",
104
- children: /* @__PURE__ */ m(i, { variant: "primary" })
105
- })
106
- }) });
107
- }
108
- function A({ permissionsPromise: e, extraSpecsPromise: i, client: a, project: c, flavor: u, onSpecsUpdate: d, isAddingSpec: g, setIsAddingSpec: _, setMessage: v }) {
109
- let { i18n: b, _: x } = w(), { translateError: C } = f(), D = y(e), [O, k] = S(y(i)), [A, j] = S(""), [M, N] = S(""), [P, F] = S({}), [I, L] = S(null), R = () => {
110
- let e = A.trim(), t = M.trim(), n = {};
111
- return e ? Object.keys(O).includes(e) && (n.key = "Key already exists.") : n.key = "Key is required.", t || (n.value = "Value is required."), F(n), Object.keys(n).length === 0;
112
- }, z = () => {
113
- j(""), N(""), F({});
114
- }, B = async () => {
115
- if (!R()) {
116
- v({
117
- text: b._({ id: "CBFSfX" }),
118
- type: "error"
119
- });
120
- return;
121
- }
122
- try {
123
- let e = A.trim(), t = M.trim();
124
- await a.compute.createExtraSpecs.mutate({
125
- project_id: c,
126
- flavorId: u.id,
127
- extra_specs: { [e]: t }
128
- });
129
- let n = {
130
- [e]: t,
131
- ...O
132
- };
133
- k(n), d(n), v({
134
- text: b._({
135
- id: "2mbisJ",
136
- values: { trimmedKey: e }
137
- }),
138
- type: "info"
139
- }), z(), _(!1);
140
- } catch (e) {
141
- v({
142
- text: C(e instanceof Error ? e.message : "Failed to create extra spec"),
143
- type: "error"
144
- });
145
- }
146
- }, V = async (e) => {
147
- try {
148
- L(e), await a.compute.deleteExtraSpec.mutate({
149
- project_id: c,
150
- flavorId: u.id,
151
- key: e
152
- });
153
- let t = { ...O };
154
- delete t[e], k(t), d(t), v({
155
- text: b._({
156
- id: "7UlHhT",
157
- values: { keyToDelete: e }
158
- }),
159
- type: "info"
160
- });
161
- } catch (t) {
162
- v({
163
- text: C(t instanceof Error ? t.message : `Failed to delete extra spec "${e}"`),
164
- type: "error"
165
- });
166
- } finally {
167
- L(null);
168
- }
169
- }, H = (e) => {
170
- j(e), P.key && F((e) => ({
171
- ...e,
172
- key: void 0
173
- }));
174
- }, U = (e) => {
175
- N(e), P.value && F((e) => ({
176
- ...e,
177
- value: void 0
178
- }));
179
- }, W = Object.keys(O).length === 0 && !g;
180
- return /* @__PURE__ */ h(p, { children: [D.canCreate && /* @__PURE__ */ m(l, {
181
- direction: "horizontal",
182
- className: "bg-theme-background-lvl-1 justify-end p-2",
183
- children: /* @__PURE__ */ m(s, {
184
- label: b._({ id: "u7En0V" }),
185
- "data-testid": "addExtraButton",
186
- onClick: () => _(!0),
187
- variant: "primary",
188
- disabled: g
189
- })
190
- }), /* @__PURE__ */ h(o, {
191
- columns: 3,
192
- children: [
193
- /* @__PURE__ */ h(n, { children: [
194
- /* @__PURE__ */ m(t, { children: b._({ id: "7sMeHQ" }) }),
195
- /* @__PURE__ */ m(t, { children: b._({ id: "wMHvYH" }) }),
196
- /* @__PURE__ */ m(t, {})
197
- ] }),
198
- g && /* @__PURE__ */ m(T, {
199
- specKey: A,
200
- value: M,
201
- errors: P,
202
- isLoading: !1,
203
- onKeyChange: H,
204
- onValueChange: U,
205
- onSave: B,
206
- onCancel: () => {
207
- z(), _(!1), v(null);
208
- }
209
- }),
210
- Object.entries(O).map(([e, t]) => /* @__PURE__ */ m(E, {
211
- specKey: e,
212
- value: t,
213
- isDeleting: I === e,
214
- onDelete: () => V(e),
215
- canDelete: D.canDelete
216
- }, e)),
217
- W && /* @__PURE__ */ m(n, { children: /* @__PURE__ */ m(r, {
218
- colSpan: 3,
219
- className: "text-theme-default py-4 text-center",
220
- children: b._({ id: "S3olSf" })
221
- }) })
222
- ]
223
- })] });
224
- }
225
- var j = ({ client: e, isOpen: t, onClose: n, project: r, flavor: i }) => {
226
- let { i18n: a, _: o } = w(), [s, c] = S(null), [l, f] = S(!1), [p, y] = S(null), b = g.useMemo(() => t ? D(e, r) : null, [
227
- e,
228
- r,
229
- t
230
- ]);
231
- return g.useEffect(() => {
232
- t && i?.id && v(() => {
233
- y(O(e, r, i.id));
234
- });
235
- }, [
236
- t,
237
- i?.id,
238
- e,
239
- r
240
- ]), !t || !i || !b || !p ? null : /* @__PURE__ */ m(u, {
241
- onCancel: () => {
242
- c(null), f(!1), y(null), n();
243
- },
244
- title: a._({ id: "SIfYq6" }),
245
- open: t,
246
- size: "large",
247
- children: /* @__PURE__ */ h("div", { children: [s && /* @__PURE__ */ m(d, {
248
- onDismiss: () => c(null),
249
- text: s.text,
250
- variant: s.type,
251
- className: "mb-4"
252
- }), /* @__PURE__ */ m(_, {
253
- fallback: /* @__PURE__ */ m(k, {}),
254
- children: /* @__PURE__ */ m(A, {
255
- permissionsPromise: b,
256
- extraSpecsPromise: p,
257
- client: e,
258
- project: r,
259
- flavor: i,
260
- onSpecsUpdate: (e) => {
261
- v(() => {
262
- y(Promise.resolve(e));
263
- });
264
- },
265
- isAddingSpec: l,
266
- setIsAddingSpec: f,
267
- message: s,
268
- setMessage: c
269
- })
270
- })] })
271
- });
272
- }, M = ({ tenantId: e, flavorId: t, errors: i, isLoading: o, onTenantIdChange: l, onSave: u, onCancel: d }) => {
273
- let { i18n: f, _: p } = w();
274
- return /* @__PURE__ */ h(n, { children: [
275
- /* @__PURE__ */ m(r, { children: t }),
276
- /* @__PURE__ */ m(r, {
277
- className: "pl-0",
278
- children: /* @__PURE__ */ m(a, {
279
- value: e,
280
- onChange: (e) => l(e.target.value),
281
- placeholder: f._({ id: "wa1Bcq" }),
282
- errortext: i.tenantId,
283
- required: !0
284
- })
285
- }),
286
- /* @__PURE__ */ m(r, { children: /* @__PURE__ */ h(c, { children: [/* @__PURE__ */ m(s, {
287
- icon: "check",
288
- onClick: u,
289
- variant: "primary",
290
- title: f._({ id: "q0Rla3" }),
291
- disabled: o
292
- }), /* @__PURE__ */ m(s, {
293
- icon: "cancel",
294
- onClick: d,
295
- title: f._({ id: "dEgA5A" }),
296
- disabled: o
297
- })] }) })
298
- ] });
299
- }, N = ({ access: e, isDeleting: t, onDelete: a, canDelete: o }) => {
300
- let { i18n: c, _: u } = w(), [d, f] = S(!1);
301
- b(() => {
302
- if (d) {
303
- let e = setTimeout(() => {
304
- f(!1);
305
- }, 3e3);
306
- return () => clearTimeout(e);
307
- }
308
- }, [d]);
309
- let g = () => {
310
- f(!1), a();
311
- };
312
- return /* @__PURE__ */ h(n, { children: [
313
- /* @__PURE__ */ m(r, { children: e.flavor_id }),
314
- /* @__PURE__ */ m(r, {
315
- className: "break-all",
316
- children: e.tenant_id
317
- }),
318
- /* @__PURE__ */ m(r, { children: t ? /* @__PURE__ */ m(l, {
319
- distribution: "center",
320
- alignment: "center",
321
- children: /* @__PURE__ */ m(i, { variant: "primary" })
322
- }) : /* @__PURE__ */ m(l, {
323
- distribution: "end",
324
- alignment: "end",
325
- children: (() => {
326
- if (!o) return /* @__PURE__ */ m(p, {});
327
- if (d) return /* @__PURE__ */ m(s, {
328
- variant: "primary-danger",
329
- onClick: g,
330
- title: c._({ id: "w9+8d7" }),
331
- "aria-label": c._({ id: "w9+8d7" }),
332
- "data-testid": "confirm-removal",
333
- disabled: t,
334
- children: c._({ id: "t/YqKh" })
335
- });
336
- {
337
- let n = e.tenant_id;
338
- return /* @__PURE__ */ m(s, {
339
- icon: "deleteForever",
340
- onClick: () => f(!0),
341
- title: c._({
342
- id: "tfxu04",
343
- values: { tenantId: n }
344
- }),
345
- "aria-label": c._({
346
- id: "tfxu04",
347
- values: { tenantId: n }
348
- }),
349
- "data-testid": `remove-${n}`,
350
- disabled: t
351
- });
352
- }
353
- })()
354
- }) })
355
- ] });
356
- }, P = (e, t) => e.compute.canUser.query({
357
- project_id: t,
358
- permission: ["flavors:add_project", "flavors:remove_project"]
359
- }).then(([e, t]) => ({
360
- canAdd: e,
361
- canRemove: t
362
- })), F = (e, t, n) => e.compute.getFlavorAccess.query({
363
- project_id: t,
364
- flavorId: n
365
- });
366
- function I() {
367
- return /* @__PURE__ */ m(n, { children: /* @__PURE__ */ m(r, {
368
- colSpan: 3,
369
- children: /* @__PURE__ */ m(l, {
370
- distribution: "center",
371
- alignment: "center",
372
- children: /* @__PURE__ */ m(i, { variant: "primary" })
373
- })
374
- }) });
375
- }
376
- function L({ permissionsPromise: e, flavorAccessPromise: i, client: a, project: c, flavor: u, onAccessUpdate: d, isAddingAccess: g, setIsAddingAccess: _, setMessage: v }) {
377
- let { i18n: b, _: x } = w(), { translateError: C } = f(), T = y(e), E = y(i), [D, O] = S(""), [k, A] = S({}), [j, P] = S(/* @__PURE__ */ new Set()), [F, I] = S(!1), L = u["os-flavor-access:is_public"] !== !1, R = E.length === 0 && !g, z = () => {
378
- let e = D.trim(), t = {};
379
- return e ? E.some((t) => t.tenant_id === e) && (t.tenantId = "This tenant already has access to this flavor.") : t.tenantId = "Tenant ID is required.", A(t), Object.keys(t).length === 0;
380
- }, B = () => {
381
- O(""), A({});
382
- }, V = async () => {
383
- if (!z()) {
384
- v({
385
- text: b._({ id: "CBFSfX" }),
386
- type: "error"
387
- });
388
- return;
389
- }
390
- I(!0);
391
- try {
392
- let e = D.trim();
393
- d(await a.compute.addTenantAccess.mutate({
394
- project_id: c,
395
- flavorId: u.id,
396
- targetProjectId: e
397
- })), v({
398
- text: b._({
399
- id: "7flw0l",
400
- values: { trimmedTenantId: e }
401
- }),
402
- type: "info"
403
- }), B(), _(!1);
404
- } catch (e) {
405
- v({
406
- text: C(e?.message || "Failed to add tenant access"),
407
- type: "error"
408
- });
409
- } finally {
410
- I(!1);
411
- }
412
- }, H = async (e) => {
413
- P((t) => new Set(t).add(e));
414
- try {
415
- d(await a.compute.removeTenantAccess.mutate({
416
- project_id: c,
417
- flavorId: u.id,
418
- targetProjectId: e
419
- })), v({
420
- text: b._({
421
- id: "rvXsSb",
422
- values: { tenantIdToRemove: e }
423
- }),
424
- type: "info"
425
- });
426
- } catch (e) {
427
- v({
428
- text: C(e?.message || "Failed to remove tenant access"),
429
- type: "error"
430
- });
431
- } finally {
432
- P((t) => {
433
- let n = new Set(t);
434
- return n.delete(e), n;
435
- });
436
- }
437
- };
438
- return L ? /* @__PURE__ */ h(o, {
439
- columns: 3,
440
- children: [/* @__PURE__ */ h(n, { children: [
441
- /* @__PURE__ */ m(t, { children: b._({ id: "s2ubkU" }) }),
442
- /* @__PURE__ */ m(t, { children: b._({ id: "T9Mtpi" }) }),
443
- /* @__PURE__ */ m(t, { children: " " })
444
- ] }), /* @__PURE__ */ m(n, { children: /* @__PURE__ */ m(r, {
445
- colSpan: 3,
446
- className: "text-theme-default py-4 text-center",
447
- children: b._({ id: "9x6EkK" })
448
- }) })]
449
- }) : /* @__PURE__ */ h(p, { children: [T.canAdd && /* @__PURE__ */ m(l, {
450
- direction: "horizontal",
451
- className: "bg-theme-background-lvl-1 justify-end p-2",
452
- children: /* @__PURE__ */ m(s, {
453
- label: b._({ id: "q0Rla3" }),
454
- "data-testid": "addTenantButton",
455
- onClick: () => _(!0),
456
- variant: "primary",
457
- disabled: g
458
- })
459
- }), /* @__PURE__ */ h(o, {
460
- columns: 3,
461
- children: [
462
- /* @__PURE__ */ h(n, { children: [
463
- /* @__PURE__ */ m(t, { children: b._({ id: "s2ubkU" }) }),
464
- /* @__PURE__ */ m(t, { children: b._({ id: "T9Mtpi" }) }),
465
- /* @__PURE__ */ m(t, {})
466
- ] }),
467
- g && /* @__PURE__ */ m(M, {
468
- tenantId: D,
469
- flavorId: u.id,
470
- errors: k,
471
- isLoading: F,
472
- onTenantIdChange: (e) => {
473
- O(e), k.tenantId && A((e) => ({
474
- ...e,
475
- tenantId: void 0
476
- }));
477
- },
478
- onSave: V,
479
- onCancel: () => {
480
- B(), _(!1), v(null);
481
- }
482
- }),
483
- E.map((e) => /* @__PURE__ */ m(N, {
484
- access: e,
485
- isDeleting: j.has(e.tenant_id),
486
- onDelete: () => H(e.tenant_id),
487
- canDelete: T.canRemove
488
- }, e.tenant_id)),
489
- R && /* @__PURE__ */ m(n, { children: /* @__PURE__ */ m(r, {
490
- colSpan: 3,
491
- className: "text-theme-default py-4 text-center",
492
- children: b._({ id: "Gyd3No" })
493
- }) })
494
- ]
495
- })] });
496
- }
497
- var R = ({ client: e, isOpen: t, onClose: n, project: r, flavor: i }) => {
498
- let { i18n: a, _: o } = w(), { translateError: s } = f(), [c, l] = S(null), [p, g] = S(!1), y = x(() => t ? P(e, r) : null, [
499
- e,
500
- r,
501
- t
502
- ]), C = x(() => !t || !i?.id ? null : F(e, r, i.id).then((e) => e.filter((e, t, n) => n.findIndex((t) => t.tenant_id === e.tenant_id) === t)).catch((e) => (l({
503
- text: s(e?.message || "GET_FLAVOR_ACCESS_FAILED"),
504
- type: "error"
505
- }), [])), [
506
- t,
507
- i?.id,
508
- e,
509
- r
510
- ]);
511
- b(() => {
512
- t && l(null);
513
- }, [t, i?.id]);
514
- let [T, E] = S(null), D = `${t}-${i?.id}`, O = T?.key === D ? T.promise : C, k = () => {
515
- l(null), g(!1), E(null), n();
516
- }, A = (e) => {
517
- let t = e.filter((e, t, n) => n.findIndex((t) => t.tenant_id === e.tenant_id) === t);
518
- v(() => {
519
- E({
520
- key: D,
521
- promise: Promise.resolve(t)
522
- });
523
- });
524
- };
525
- if (!t || !i || !y || !O) return null;
526
- let j = i.name;
527
- return /* @__PURE__ */ m(u, {
528
- onCancel: k,
529
- title: a._({
530
- id: "6Rnrsz",
531
- values: { flavorName: j }
532
- }),
533
- open: t,
534
- size: "xl",
535
- children: /* @__PURE__ */ h("div", { children: [c && /* @__PURE__ */ m(d, {
536
- onDismiss: () => l(null),
537
- text: c.text,
538
- variant: c.type,
539
- className: "mb-4",
540
- dismissible: !0
541
- }), /* @__PURE__ */ m(_, {
542
- fallback: /* @__PURE__ */ m(I, {}),
543
- children: /* @__PURE__ */ m(L, {
544
- permissionsPromise: y,
545
- flavorAccessPromise: O,
546
- client: e,
547
- project: r,
548
- flavor: i,
549
- onAccessUpdate: A,
550
- isAddingAccess: p,
551
- setIsAddingAccess: g,
552
- setMessage: l
553
- })
554
- })] })
555
- });
556
- }, z = ({ client: a, isOpen: p, onClose: g, project: _, flavor: v, onSuccess: y }) => {
557
- let { i18n: b, _: x } = w(), { translateError: T } = f(), [E, D] = S(!1), [O, k] = S(null), A = async () => {
558
- if (!v?.id) {
559
- k(b._({ id: "NlcF/v" }));
560
- return;
561
- }
562
- k(null);
563
- try {
564
- D(!0), await a.compute.deleteFlavor.mutate({
565
- project_id: _,
566
- flavorId: v.id
567
- }), y(), j();
568
- } catch (e) {
569
- k(e?.message ? T(e.message) : b._({ id: "8zAn1f" }));
570
- } finally {
571
- D(!1);
572
- }
573
- }, j = () => {
574
- k(null), g();
575
- };
576
- return /* @__PURE__ */ h(u, {
577
- onCancel: j,
578
- title: b._({ id: "JT3I1g" }),
579
- open: p,
580
- onConfirm: A,
581
- modalFooter: /* @__PURE__ */ m(e, {
582
- className: "flex justify-end",
583
- children: /* @__PURE__ */ h(c, { children: [/* @__PURE__ */ m(s, {
584
- variant: "primary-danger",
585
- onClick: A,
586
- disabled: E,
587
- children: E ? /* @__PURE__ */ m(i, { size: "small" }) : /* @__PURE__ */ m(C, { id: "cnGeoo" })
588
- }), /* @__PURE__ */ m(s, {
589
- variant: "default",
590
- onClick: j,
591
- children: /* @__PURE__ */ m(C, { id: "dEgA5A" })
592
- })] })
593
- }),
594
- children: [E && /* @__PURE__ */ m(l, {
595
- distribution: "center",
596
- alignment: "center",
597
- children: /* @__PURE__ */ m(i, { variant: "primary" })
598
- }), !E && /* @__PURE__ */ h("div", { children: [
599
- O && /* @__PURE__ */ m(d, {
600
- onDismiss: () => {
601
- k(null);
602
- },
603
- text: O,
604
- variant: "error",
605
- className: "mb-4"
606
- }),
607
- /* @__PURE__ */ m(d, {
608
- text: b._({ id: "QQ8wUG" }),
609
- variant: "danger",
610
- className: "mb-4"
611
- }),
612
- v && /* @__PURE__ */ h(o, {
613
- columns: 2,
614
- children: [
615
- /* @__PURE__ */ h(n, { children: [/* @__PURE__ */ m(t, { children: b._({ id: "6YtxFj" }) }), /* @__PURE__ */ m(r, { children: v.name })] }),
616
- /* @__PURE__ */ h(n, { children: [/* @__PURE__ */ m(t, { children: b._({ id: "S0kLOH" }) }), /* @__PURE__ */ m(r, { children: v.id })] }),
617
- /* @__PURE__ */ h(n, { children: [/* @__PURE__ */ m(t, { children: b._({ id: "MZGbkp" }) }), /* @__PURE__ */ m(r, { children: v.vcpus })] }),
618
- /* @__PURE__ */ h(n, { children: [/* @__PURE__ */ m(t, { children: b._({ id: "RGhYAo" }) }), /* @__PURE__ */ h(r, { children: [v.ram, " MiB"] })] }),
619
- /* @__PURE__ */ h(n, { children: [/* @__PURE__ */ m(t, { children: b._({ id: "sPFHpI" }) }), /* @__PURE__ */ h(r, { children: [v.disk, " GiB"] })] }),
620
- v.swap && /* @__PURE__ */ h(n, { children: [/* @__PURE__ */ m(t, { children: b._({ id: "vH2C/2" }) }), /* @__PURE__ */ h(r, { children: [v.swap, " MiB"] })] })
621
- ]
622
- })
623
- ] })]
624
- });
625
- };
626
- //#endregion
627
- export { R as n, j as r, z as t };
628
-
629
- //# sourceMappingURL=DeleteFlavorModal-BusYn32r.mjs.map