@cobaltcore-dev/aurora 0.23.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/dist/client/App.d.ts +3 -2
  2. package/dist/client/AuroraApp.d.ts +25 -0
  3. package/dist/client/{AuthProvider-CQ6Yppoh.mjs → AuthProvider-BS5OVv8n.mjs} +4 -4
  4. package/dist/client/AuthProvider-BS5OVv8n.mjs.map +1 -0
  5. package/dist/client/{ContentHeader-9KZdhOoA.mjs → ContentHeader-BHMUzd9H.mjs} +27 -26
  6. package/dist/client/ContentHeader-BHMUzd9H.mjs.map +1 -0
  7. package/dist/client/DeleteFlavorModal-BP83t9zX.mjs +721 -0
  8. package/dist/client/DeleteFlavorModal-BP83t9zX.mjs.map +1 -0
  9. package/dist/client/FiltersInput-B8CNBg1L.mjs +82 -0
  10. package/dist/client/FiltersInput-B8CNBg1L.mjs.map +1 -0
  11. package/dist/client/{FloatingIpActionModals-BcceUHcg.mjs → FloatingIpActionModals-BraiJWBi.mjs} +66 -66
  12. package/dist/client/{FloatingIpActionModals-BcceUHcg.mjs.map → FloatingIpActionModals-BraiJWBi.mjs.map} +1 -1
  13. package/dist/client/ImageToastNotifications-BXMHJaIH.mjs +1131 -0
  14. package/dist/client/ImageToastNotifications-BXMHJaIH.mjs.map +1 -0
  15. package/dist/client/{RouteError-Rm08PcxN.mjs → RouteError-hAF8_jbe.mjs} +2 -2
  16. package/dist/client/{RouteError-Rm08PcxN.mjs.map → RouteError-hAF8_jbe.mjs.map} +1 -1
  17. package/dist/client/Slot-CWb612-_.mjs.map +1 -1
  18. package/dist/client/{SortInput-D_q_jDfe.mjs → SortInput-Cqs2poV3.mjs} +9 -9
  19. package/dist/client/{SortInput-D_q_jDfe.mjs.map → SortInput-Cqs2poV3.mjs.map} +1 -1
  20. package/dist/client/{StatusError-2ZU1gFpu.mjs → StatusError-C5KodQOq.mjs} +7 -7
  21. package/dist/client/{StatusError-2ZU1gFpu.mjs.map → StatusError-C5KodQOq.mjs.map} +1 -1
  22. package/dist/client/TwoColumnDescriptionList-DiDx3PnH.mjs +22 -0
  23. package/dist/client/TwoColumnDescriptionList-DiDx3PnH.mjs.map +1 -0
  24. package/dist/client/{_auth-D5_QNUos.mjs → _auth-DJ9wHZaj.mjs} +2 -2
  25. package/dist/client/_auth-DJ9wHZaj.mjs.map +1 -0
  26. package/dist/client/{_flavorId-CFmkmg2Y.mjs → _flavorId-BN_qessZ.mjs} +4 -4
  27. package/dist/client/{_flavorId-CFmkmg2Y.mjs.map → _flavorId-BN_qessZ.mjs.map} +1 -1
  28. package/dist/client/_flavorId-CJjEB_Ao.mjs +210 -0
  29. package/dist/client/_flavorId-CJjEB_Ao.mjs.map +1 -0
  30. package/dist/client/{_floatingIpId-Dzh6_JCI.mjs → _floatingIpId-CwDGHkWm.mjs} +4 -4
  31. package/dist/client/{_floatingIpId-Dzh6_JCI.mjs.map → _floatingIpId-CwDGHkWm.mjs.map} +1 -1
  32. package/dist/client/_floatingIpId-foMIwbE4.mjs +215 -0
  33. package/dist/client/_floatingIpId-foMIwbE4.mjs.map +1 -0
  34. package/dist/client/_imageId-BtJ7GmYB.mjs +558 -0
  35. package/dist/client/_imageId-BtJ7GmYB.mjs.map +1 -0
  36. package/dist/client/{_projectId-D-b7paXE.mjs → _projectId-BmtCuzJu.mjs} +4 -4
  37. package/dist/client/{_projectId-D-b7paXE.mjs.map → _projectId-BmtCuzJu.mjs.map} +1 -1
  38. package/dist/client/_projectId-Byt3GQDW.mjs +99 -0
  39. package/dist/client/_projectId-Byt3GQDW.mjs.map +1 -0
  40. package/dist/client/_projectId-NYk1IN_a.mjs +291 -0
  41. package/dist/client/_projectId-NYk1IN_a.mjs.map +1 -0
  42. package/dist/client/{_projectId-CAQkJHZ4.mjs → _projectId-QueiFczy.mjs} +3 -3
  43. package/dist/client/{_projectId-CAQkJHZ4.mjs.map → _projectId-QueiFczy.mjs.map} +1 -1
  44. package/dist/client/{_securityGroupId-DRkY3Gt6.mjs → _securityGroupId-BcbkRhsN.mjs} +4 -4
  45. package/dist/client/{_securityGroupId-DRkY3Gt6.mjs.map → _securityGroupId-BcbkRhsN.mjs.map} +1 -1
  46. package/dist/client/{_securityGroupId-DFdNKa2l.mjs → _securityGroupId-pPtJsCoe.mjs} +541 -527
  47. package/dist/client/_securityGroupId-pPtJsCoe.mjs.map +1 -0
  48. package/dist/client/_storageType-BmqrU06i.mjs +2202 -0
  49. package/dist/client/_storageType-BmqrU06i.mjs.map +1 -0
  50. package/dist/client/_storageType-zeSZe--V.mjs.map +1 -1
  51. package/dist/client/{about-C8tTrQaW.mjs → about-_73VmpTB.mjs} +8 -8
  52. package/dist/client/about-_73VmpTB.mjs.map +1 -0
  53. package/dist/client/assets/objectDownload.worker-CWWLPDyb.js.map +1 -0
  54. package/dist/client/assets/objectDownload.worker-kZlQuo3F.js.map +1 -0
  55. package/dist/client/{aurora-jyvXcI4T.mjs → aurora-EbwGRLLf.mjs} +2 -2
  56. package/dist/client/aurora-EbwGRLLf.mjs.map +1 -0
  57. package/dist/client/{build-CRLQyqu2.mjs → build-C_4vRMCq.mjs} +8072 -8533
  58. package/dist/client/build-C_4vRMCq.mjs.map +1 -0
  59. package/dist/client/components/Auth/LoginForm.d.ts +1 -1
  60. package/dist/client/components/Auth/SessionExpirationTimer.d.ts +1 -1
  61. package/dist/client/components/ContentHeader/ContentHeader.d.ts +1 -1
  62. package/dist/client/components/Error/RouteError.d.ts +1 -1
  63. package/dist/client/components/Error/StatusError.d.ts +1 -1
  64. package/dist/client/components/JsonEditor.d.ts +1 -1
  65. package/dist/client/components/ListToolbar/FiltersInput.d.ts +3 -1
  66. package/dist/client/components/ListToolbar/SelectedFilters.d.ts +1 -1
  67. package/dist/client/components/ListToolbar/index.d.ts +1 -1
  68. package/dist/client/components/ProjectView/ProjectInfoBox.d.ts +1 -1
  69. package/dist/client/components/Slot.d.ts +1 -1
  70. package/dist/client/components/TwoColumnDescriptionList.d.ts +11 -0
  71. package/dist/client/components/navigation/LanguageSelect.d.ts +1 -1
  72. package/dist/client/components/navigation/MainNavigation.d.ts +1 -1
  73. package/dist/client/components/navigation/UserMenu.d.ts +1 -1
  74. package/dist/client/{flavors-Dy-2mRGv.mjs → flavors-CiHCYrtZ.mjs} +2 -2
  75. package/dist/client/{flavors-Dy-2mRGv.mjs.map → flavors-CiHCYrtZ.mjs.map} +1 -1
  76. package/dist/client/flavors-DWMZ6TuJ.mjs.map +1 -1
  77. package/dist/client/{flavors-BfTXqmoD.mjs → flavors-DY-bDc8l.mjs} +196 -194
  78. package/dist/client/flavors-DY-bDc8l.mjs.map +1 -0
  79. package/dist/client/floatingips-Ci4jHkaG.mjs +591 -0
  80. package/dist/client/floatingips-Ci4jHkaG.mjs.map +1 -0
  81. package/dist/client/formatBytes-CZv_XyCY.mjs.map +1 -1
  82. package/dist/client/helpers-1PpYf-fC.mjs.map +1 -1
  83. package/dist/client/hooks/useAvailableViewportHeight.d.ts +8 -5
  84. package/dist/client/hooks/useVirtualizedTableBody.d.ts +1 -3
  85. package/dist/client/{hooks-Bw3sHHOg.mjs → hooks-LutR2Yg3.mjs} +2 -2
  86. package/dist/client/{hooks-Bw3sHHOg.mjs.map → hooks-LutR2Yg3.mjs.map} +1 -1
  87. package/dist/client/images-91U7tr9Y2.mjs +1976 -0
  88. package/dist/client/images-91U7tr9Y2.mjs.map +1 -0
  89. package/dist/client/{images-DPKUXryV.mjs → images-CS4kZQyu.mjs} +2 -2
  90. package/dist/client/{images-DPKUXryV.mjs.map → images-CS4kZQyu.mjs.map} +1 -1
  91. package/dist/client/images-NBf2bV43.mjs.map +1 -1
  92. package/dist/client/index.d.ts +4 -1
  93. package/dist/client/index.js +559 -545
  94. package/dist/client/index.js.map +1 -1
  95. package/dist/client/{md-CyCflQee.mjs → md-kvaGCNAK.mjs} +6 -78
  96. package/dist/client/{md-CyCflQee.mjs.map → md-kvaGCNAK.mjs.map} +1 -1
  97. package/dist/client/network-DuZm76BZ.mjs.map +1 -1
  98. package/dist/client/objects-C3azvW8m.mjs +10074 -0
  99. package/dist/client/objects-C3azvW8m.mjs.map +1 -0
  100. package/dist/client/objects-CM265S6b.mjs +56 -0
  101. package/dist/client/objects-CM265S6b.mjs.map +1 -0
  102. package/dist/client/objects-EE9Cd1wI.mjs +56 -0
  103. package/dist/client/objects-EE9Cd1wI.mjs.map +1 -0
  104. package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
  105. package/dist/client/{routeInfo-CdTRlSxv.mjs → routeInfo-DXqB2HCf.mjs} +3 -3
  106. package/dist/client/routeInfo-DXqB2HCf.mjs.map +1 -0
  107. package/dist/client/router.d.ts +2 -1
  108. package/dist/client/{routes-BOf-GDMM.mjs → routes-CBd8CCuM.mjs} +27 -24
  109. package/dist/client/routes-CBd8CCuM.mjs.map +1 -0
  110. package/dist/client/{routes-CtfnI-aY.mjs → routes-CdDm-hhO.mjs} +2 -2
  111. package/dist/client/{routes-CtfnI-aY.mjs.map → routes-CdDm-hhO.mjs.map} +1 -1
  112. package/dist/client/securitygroups-Bd_uV4S9.mjs +595 -0
  113. package/dist/client/securitygroups-Bd_uV4S9.mjs.map +1 -0
  114. package/dist/client/{securitygroups-B8aLyFK7.mjs → securitygroups-Byte-iSp.mjs} +2 -2
  115. package/dist/client/{securitygroups-B8aLyFK7.mjs.map → securitygroups-Byte-iSp.mjs.map} +1 -1
  116. package/dist/client/services-D1PbooD1.mjs +6 -0
  117. package/dist/client/services-D1PbooD1.mjs.map +1 -0
  118. package/dist/client/services-DEMVtFyn.mjs +9 -0
  119. package/dist/client/services-DEMVtFyn.mjs.map +1 -0
  120. package/dist/client/store/AuthProvider.d.ts +1 -1
  121. package/dist/client/{trpcClient-Di56hpVv.mjs → trpcClient-D7gpR7YG.mjs} +2 -2
  122. package/dist/client/{trpcClient-Di56hpVv.mjs.map → trpcClient-D7gpR7YG.mjs.map} +1 -1
  123. package/dist/client/trpcClient.d.ts +139 -374
  124. package/dist/client/useModal-DCs1OJh7.mjs.map +1 -1
  125. package/dist/client/{useSecurityGroupPermissions-BPS1ibWq.mjs → useSecurityGroupPermissions-C29mzb3b.mjs} +15 -15
  126. package/dist/client/{useSecurityGroupPermissions-BPS1ibWq.mjs.map → useSecurityGroupPermissions-C29mzb3b.mjs.map} +1 -1
  127. package/dist/server/index.d.ts +164 -376
  128. package/dist/server/index.js +4223 -3131
  129. package/package.json +7 -9
  130. package/dist/client/AuthProvider-CQ6Yppoh.mjs.map +0 -1
  131. package/dist/client/BucketToastNotifications-Dq4dudkM.mjs +0 -665
  132. package/dist/client/BucketToastNotifications-Dq4dudkM.mjs.map +0 -1
  133. package/dist/client/ContentHeader-9KZdhOoA.mjs.map +0 -1
  134. package/dist/client/DeleteFlavorModal-Be2qZo4w.mjs +0 -713
  135. package/dist/client/DeleteFlavorModal-Be2qZo4w.mjs.map +0 -1
  136. package/dist/client/DeletePcaModal-CIFsGWyj.mjs +0 -80
  137. package/dist/client/DeletePcaModal-CIFsGWyj.mjs.map +0 -1
  138. package/dist/client/DetailsInfo-CHVD7d-W.mjs +0 -52
  139. package/dist/client/DetailsInfo-CHVD7d-W.mjs.map +0 -1
  140. package/dist/client/FiltersInput-DqT08Ib-.mjs +0 -81
  141. package/dist/client/FiltersInput-DqT08Ib-.mjs.map +0 -1
  142. package/dist/client/ImageToastNotifications-BGyX2J6j.mjs +0 -1219
  143. package/dist/client/ImageToastNotifications-BGyX2J6j.mjs.map +0 -1
  144. package/dist/client/_auth-D5_QNUos.mjs.map +0 -1
  145. package/dist/client/_flavorId-BsmqS9hP.mjs +0 -194
  146. package/dist/client/_flavorId-BsmqS9hP.mjs.map +0 -1
  147. package/dist/client/_floatingIpId-Bb9ZEJ6b.mjs +0 -228
  148. package/dist/client/_floatingIpId-Bb9ZEJ6b.mjs.map +0 -1
  149. package/dist/client/_imageId-C3As7sHE.mjs +0 -534
  150. package/dist/client/_imageId-C3As7sHE.mjs.map +0 -1
  151. package/dist/client/_pcaId-n0q0aDb6.mjs +0 -545
  152. package/dist/client/_pcaId-n0q0aDb6.mjs.map +0 -1
  153. package/dist/client/_projectId-BuBIFdgG.mjs +0 -291
  154. package/dist/client/_projectId-BuBIFdgG.mjs.map +0 -1
  155. package/dist/client/_projectId-DNZsNxJw.mjs +0 -98
  156. package/dist/client/_projectId-DNZsNxJw.mjs.map +0 -1
  157. package/dist/client/_securityGroupId-DFdNKa2l.mjs.map +0 -1
  158. package/dist/client/_storageType-Cn7TSOki.mjs +0 -81
  159. package/dist/client/_storageType-Cn7TSOki.mjs.map +0 -1
  160. package/dist/client/_storageType-_8Ambhxc.mjs +0 -2859
  161. package/dist/client/_storageType-_8Ambhxc.mjs.map +0 -1
  162. package/dist/client/about-C8tTrQaW.mjs.map +0 -1
  163. package/dist/client/assets/objectDownload.worker-BAc5Au4B.js.map +0 -1
  164. package/dist/client/aurora-jyvXcI4T.mjs.map +0 -1
  165. package/dist/client/build-CRLQyqu2.mjs.map +0 -1
  166. package/dist/client/flavors-BfTXqmoD.mjs.map +0 -1
  167. package/dist/client/floatingips-zhNK6Xxn.mjs +0 -562
  168. package/dist/client/floatingips-zhNK6Xxn.mjs.map +0 -1
  169. package/dist/client/images-DhZnqUG_.mjs +0 -1890
  170. package/dist/client/images-DhZnqUG_.mjs.map +0 -1
  171. package/dist/client/objects-B3mbk6V0.mjs +0 -6636
  172. package/dist/client/objects-B3mbk6V0.mjs.map +0 -1
  173. package/dist/client/objects-BQ8xvSW8.mjs +0 -103
  174. package/dist/client/objects-BQ8xvSW8.mjs.map +0 -1
  175. package/dist/client/objects-o2Cj_ndZ.mjs +0 -8
  176. package/dist/client/objects-o2Cj_ndZ.mjs.map +0 -1
  177. package/dist/client/pca-B60iWWfG.mjs +0 -251
  178. package/dist/client/pca-B60iWWfG.mjs.map +0 -1
  179. package/dist/client/pca-D0kKxHp4.mjs +0 -25
  180. package/dist/client/pca-D0kKxHp4.mjs.map +0 -1
  181. package/dist/client/pcaAccess-Br4kVjLQ.mjs +0 -9
  182. package/dist/client/pcaAccess-Br4kVjLQ.mjs.map +0 -1
  183. package/dist/client/routeInfo-CdTRlSxv.mjs.map +0 -1
  184. package/dist/client/routes-BOf-GDMM.mjs.map +0 -1
  185. package/dist/client/securitygroups-DRhFle2O.mjs +0 -589
  186. package/dist/client/securitygroups-DRhFle2O.mjs.map +0 -1
  187. package/dist/client/useListWithFiltering-aPTUNRaW.mjs +0 -32
  188. package/dist/client/useListWithFiltering-aPTUNRaW.mjs.map +0 -1
@@ -0,0 +1,591 @@
1
+ import { C as e, F as t, I as n, J as r, O as i, S as a, T as o, W as s, X as c, a as l, g as u, l as d, m as f, nt as p, o as m, p as h, st as g, t as _, tt as v, ut as y, x as b } from "./build-C_4vRMCq.mjs";
2
+ import { a as x } from "./trpcClient-D7gpR7YG.mjs";
3
+ import { t as S } from "./useProjectId-DBc5lpoU.mjs";
4
+ import { t as C } from "./SortInput-Cqs2poV3.mjs";
5
+ import { d as w, n as T, o as E } from "./md-kvaGCNAK.mjs";
6
+ import "./hooks-LutR2Yg3.mjs";
7
+ import { t as D } from "./useModal-DCs1OJh7.mjs";
8
+ import { n as O, t as k } from "./FiltersInput-B8CNBg1L.mjs";
9
+ import { t as A } from "./FloatingIpActionModals-BraiJWBi.mjs";
10
+ import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
11
+ import { useEffect as P, useRef as F, useState as I } from "react";
12
+ import { useNavigate as L, useSearch as R } from "@tanstack/react-router";
13
+ import { Trans as z, useLingui as B } from "@lingui/react";
14
+ import { z as V } from "zod";
15
+ import { i18n as H } from "@lingui/core";
16
+ import { useForm as U, useStore as W } from "@tanstack/react-form";
17
+ //#region src/client/routes/_auth/projects/$projectId/network/floatingips/-components/-table/constants.tsx
18
+ var G = {
19
+ ACTIVE: {
20
+ text: "Active",
21
+ icon: /*#__PURE__*/ M(T, {
22
+ size: 18,
23
+ color: "white",
24
+ fill: "#4FB81C"
25
+ })
26
+ },
27
+ DOWN: {
28
+ text: "Down",
29
+ icon: /*#__PURE__*/ M(w, {
30
+ size: 18,
31
+ color: "white",
32
+ fill: "#969696"
33
+ })
34
+ },
35
+ ERROR: {
36
+ text: "Error",
37
+ icon: /*#__PURE__*/ M(E, {
38
+ size: 18,
39
+ color: "white",
40
+ fill: "#C70000"
41
+ })
42
+ }
43
+ }, K = () => [
44
+ H._({ id: "uAQUqI" }),
45
+ H._({ id: "xNG/3n" }),
46
+ H._({ id: "Nc7QKU" }),
47
+ H._({ id: "7NC3vm" }),
48
+ H._({ id: "Nu4oKW" }),
49
+ ""
50
+ ], q = ({ floatingIp: e }) => {
51
+ let { i18n: t, _: n } = B(), r = L(), a = S(), s = () => {
52
+ r({
53
+ to: "/projects/$projectId/network/floatingips/$floatingIpId",
54
+ params: {
55
+ projectId: a,
56
+ floatingIpId: e.id
57
+ }
58
+ });
59
+ };
60
+ return /*#__PURE__*/ N(o, {
61
+ "data-testid": `floating-ip-row-${e.id}`,
62
+ onClick: s,
63
+ children: [
64
+ /*#__PURE__*/ M(_, { children: /*#__PURE__*/ N("div", {
65
+ className: "flex items-center gap-2",
66
+ children: [G[e.status].icon, G[e.status].text]
67
+ }) }),
68
+ /*#__PURE__*/ M(_, { children: e.floating_ip_address }),
69
+ /*#__PURE__*/ M(_, { children: e.fixed_ip_address || "—" }),
70
+ /*#__PURE__*/ M(_, { children: e.floating_network_id }),
71
+ /*#__PURE__*/ M(_, { children: e.description || "—" }),
72
+ /*#__PURE__*/ M(_, {
73
+ onClick: (e) => e.stopPropagation(),
74
+ className: "items-end pr-0",
75
+ children: /*#__PURE__*/ M(A, {
76
+ floatingIp: e,
77
+ children: ({ toggleEditModal: e, toggleAttachModal: n, toggleDetachModal: r, toggleReleaseModal: a }) => /*#__PURE__*/ M(i, { children: /*#__PURE__*/ N(u, { children: [
78
+ /*#__PURE__*/ M(b, {
79
+ label: t._({ id: "rdUucN" }),
80
+ onClick: s
81
+ }),
82
+ /*#__PURE__*/ M(b, {
83
+ label: t._({ id: "n22YIM" }),
84
+ onClick: e
85
+ }),
86
+ /*#__PURE__*/ M(b, {
87
+ label: t._({ id: "igVDFt" }),
88
+ onClick: n
89
+ }),
90
+ /*#__PURE__*/ M(b, {
91
+ label: t._({ id: "FOcBn3" }),
92
+ onClick: r
93
+ }),
94
+ /*#__PURE__*/ M(b, {
95
+ label: t._({ id: "H+a5j6" }),
96
+ onClick: a
97
+ })
98
+ ] }) })
99
+ })
100
+ })
101
+ ]
102
+ }, e.id);
103
+ }, J = ({ floatingIps: e, isLoading: t, isError: n, error: r }) => {
104
+ let { i18n: i, _: l } = B(), u = K(), d = u.length;
105
+ return t ? /*#__PURE__*/ N(c, {
106
+ className: "py-8",
107
+ distribution: "center",
108
+ alignment: "center",
109
+ direction: "vertical",
110
+ children: [/*#__PURE__*/ M(s, {
111
+ variant: "primary",
112
+ size: "large",
113
+ className: "mb-2"
114
+ }), /*#__PURE__*/ M(z, { id: "Z3FXyt" })]
115
+ }) : n ? /*#__PURE__*/ M(c, {
116
+ className: "py-8",
117
+ distribution: "center",
118
+ alignment: "center",
119
+ direction: "vertical",
120
+ children: r?.message ?? i._({ id: "+Nx1wc" })
121
+ }) : e.length === 0 ? /*#__PURE__*/ M(m, {
122
+ columns: d,
123
+ className: "floating-ips",
124
+ "data-testid": "no-floating-ips",
125
+ children: /*#__PURE__*/ M(o, { children: /*#__PURE__*/ N(_, {
126
+ colSpan: d,
127
+ children: [/*#__PURE__*/ M(p, { children: /*#__PURE__*/ M(z, { id: "WCLyHI" }) }), /*#__PURE__*/ M("p", { children: /*#__PURE__*/ M(z, { id: "0eY8Mz" }) })]
128
+ }) })
129
+ }) : /*#__PURE__*/ N(m, {
130
+ columns: d,
131
+ children: [/*#__PURE__*/ M(o, { children: u.map((e) => /*#__PURE__*/ M(a, { children: e }, e)) }), e.map((e) => /*#__PURE__*/ M(q, { floatingIp: e }, e.id))]
132
+ });
133
+ }, Y = /^(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/, X = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(([0-9a-fA-F]{1,4}:){1,7}:)|(([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4})|(([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2})|(([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3})|(([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4})|(([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5})|([0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6}))|(:((:[0-9a-fA-F]{1,4}){1,7}|:))|(::([fF]{4}(:0{1,4})?:)?((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|(([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})))$/, ee = (e) => Y.test(e) || X.test(e), te = /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/, ne = ({ open: e, onClose: i }) => {
134
+ let { i18n: a, _: o } = B(), c = S(), l = x.useUtils(), { isPending: u, ...d } = x.network.floatingIp.create.useMutation({ onSettled: () => l.network.floatingIp.list.invalidate() }), { data: p = [], isLoading: m, error: _ } = x.network.floatingIp.listExternalNetworks.useQuery({ project_id: c }), { data: b = [], isLoading: C, error: w } = x.network.floatingIp.listDnsDomains.useQuery({ project_id: c }), { data: T = [], isLoading: E, error: D } = x.network.floatingIp.listAvailablePorts.useQuery({ project_id: c }), O = V.object({
135
+ floating_network_id: V.string(),
136
+ dns_domain: V.string(),
137
+ dns_name: V.string().trim().max(63, a._({ id: "Zq6Y5u" })).refine((e) => e === "" || te.test(e), { message: a._({ id: "R6kcsL" }) }),
138
+ description: V.string().trim().max(255, a._({ id: "lZvIXd" })),
139
+ floating_ip_address: V.string().trim().refine((e) => e === "" || ee(e), { message: a._({ id: "AZyHwC" }) }),
140
+ port_id: V.string(),
141
+ fixed_ip_address: V.string()
142
+ }), k = U({
143
+ defaultValues: {
144
+ floating_network_id: "",
145
+ dns_domain: "",
146
+ dns_name: "",
147
+ description: "",
148
+ floating_ip_address: "",
149
+ port_id: "",
150
+ fixed_ip_address: ""
151
+ },
152
+ validators: { onSubmit: O },
153
+ onSubmit: async ({ value: e }) => {
154
+ u || (await d.mutateAsync({
155
+ project_id: c,
156
+ tenant_id: c,
157
+ floating_network_id: e.floating_network_id,
158
+ ...e.dns_domain && { dns_domain: e.dns_domain },
159
+ ...e.dns_name && { dns_name: e.dns_name },
160
+ ...e.description && { description: e.description },
161
+ ...e.floating_ip_address && { floating_ip_address: e.floating_ip_address },
162
+ ...e.port_id && { port_id: e.port_id },
163
+ ...e.fixed_ip_address && { fixed_ip_address: e.fixed_ip_address }
164
+ }), A());
165
+ }
166
+ }), A = () => {
167
+ u || (k.reset(), d.reset(), i());
168
+ }, j = W(k.store, (e) => e.values.port_id), P = W(k.store, (e) => e.values.floating_network_id), F = T.find((e) => e.id === j)?.fixed_ips ?? [], I = (_?.message || w?.message || D?.message) ?? d.error?.message ?? null;
169
+ return /*#__PURE__*/ N(r, {
170
+ open: e,
171
+ size: "large",
172
+ title: a._({ id: "h99+4y" }),
173
+ onCancel: A,
174
+ cancelButtonLabel: a._({ id: "dEgA5A" }),
175
+ confirmButtonLabel: a._({ id: "9X8lAk" }),
176
+ onConfirm: k.handleSubmit,
177
+ disableConfirmButton: u || !P,
178
+ children: [
179
+ I && /*#__PURE__*/ M(t, {
180
+ dismissible: !1,
181
+ variant: "error",
182
+ className: "mb-4",
183
+ children: I
184
+ }),
185
+ u && /*#__PURE__*/ N("div", {
186
+ className: "mb-4 flex items-center justify-center gap-2",
187
+ children: [/*#__PURE__*/ M(s, { variant: "primary" }), /*#__PURE__*/ M("span", {
188
+ className: "text-theme-high text-sm",
189
+ children: /*#__PURE__*/ M(z, { id: "HuA8iQ" })
190
+ })]
191
+ }),
192
+ !u && /*#__PURE__*/ N(y, {
193
+ className: "mb-0",
194
+ id: "allocate-floating-ip-form",
195
+ onSubmit: (e) => {
196
+ e.preventDefault(), k.handleSubmit();
197
+ },
198
+ children: [
199
+ /*#__PURE__*/ M(h, {
200
+ className: "mb-4",
201
+ children: /*#__PURE__*/ M(k.Field, {
202
+ name: "floating_network_id",
203
+ children: (e) => /*#__PURE__*/ M(v, {
204
+ id: e.name,
205
+ name: e.name,
206
+ value: e.state.value,
207
+ onChange: (t) => e.handleChange(typeof t == "string" ? t : ""),
208
+ label: a._({ id: "kA2lMP" }),
209
+ helptext: a._({ id: "BoIAP6" }),
210
+ placeholder: a._({ id: "T6Gm5y" }),
211
+ disabled: u || m,
212
+ required: !0,
213
+ loading: m,
214
+ children: p.map(({ id: e, name: t }) => /*#__PURE__*/ M(n, {
215
+ value: e,
216
+ label: t ? `${t} (${e})` : e
217
+ }, e))
218
+ })
219
+ })
220
+ }),
221
+ /*#__PURE__*/ M(h, {
222
+ className: "mb-4",
223
+ children: /*#__PURE__*/ M(k.Field, {
224
+ name: "dns_domain",
225
+ children: (e) => /*#__PURE__*/ M(v, {
226
+ id: e.name,
227
+ name: e.name,
228
+ value: e.state.value,
229
+ onChange: (t) => e.handleChange(typeof t == "string" ? t : ""),
230
+ label: a._({ id: "WlpcJv" }),
231
+ helptext: a._({ id: "1ojTVo" }),
232
+ disabled: u || C,
233
+ loading: C,
234
+ children: b.map(({ id: e, name: t }) => /*#__PURE__*/ M(n, {
235
+ value: t,
236
+ label: t
237
+ }, e))
238
+ })
239
+ })
240
+ }),
241
+ /*#__PURE__*/ M(h, {
242
+ className: "mb-4",
243
+ children: /*#__PURE__*/ M(k.Field, {
244
+ name: "dns_name",
245
+ children: (e) => /*#__PURE__*/ M(f, {
246
+ id: e.name,
247
+ name: e.name,
248
+ value: e.state.value,
249
+ onBlur: e.handleBlur,
250
+ onChange: (t) => e.handleChange(t.target.value),
251
+ label: a._({ id: "eGEHJE" }),
252
+ placeholder: a._({ id: "SLEH7X" }),
253
+ helptext: a._({ id: "Tx4Ym+" }),
254
+ errortext: e.state.meta.errors.map((e) => e?.message).join(", "),
255
+ disabled: u
256
+ })
257
+ })
258
+ }),
259
+ /*#__PURE__*/ M(h, {
260
+ className: "mb-4",
261
+ children: /*#__PURE__*/ M(k.Field, {
262
+ name: "description",
263
+ children: (e) => /*#__PURE__*/ M(g, {
264
+ id: e.name,
265
+ name: e.name,
266
+ value: e.state.value,
267
+ onBlur: e.handleBlur,
268
+ onChange: (t) => e.handleChange(t.target.value),
269
+ placeholder: a._({ id: "Nu4oKW" }),
270
+ errortext: e.state.meta.errors.map((e) => e?.message).join(", "),
271
+ disabled: u
272
+ })
273
+ })
274
+ }),
275
+ /*#__PURE__*/ M(h, {
276
+ className: "mb-4",
277
+ children: /*#__PURE__*/ M(k.Field, {
278
+ name: "floating_ip_address",
279
+ children: (e) => /*#__PURE__*/ M(f, {
280
+ id: e.name,
281
+ name: e.name,
282
+ value: e.state.value,
283
+ onBlur: e.handleBlur,
284
+ onChange: (t) => e.handleChange(t.target.value),
285
+ label: a._({ id: "xNG/3n" }),
286
+ placeholder: a._({ id: "5/wyf8" }),
287
+ helptext: a._({ id: "PAKSdy" }),
288
+ errortext: e.state.meta.errors.map((e) => e?.message).join(", "),
289
+ disabled: u
290
+ })
291
+ })
292
+ }),
293
+ /*#__PURE__*/ M(h, {
294
+ className: "mb-4",
295
+ children: /*#__PURE__*/ M(k.Field, {
296
+ name: "port_id",
297
+ children: (e) => /*#__PURE__*/ M(v, {
298
+ id: e.name,
299
+ name: e.name,
300
+ value: e.state.value,
301
+ onChange: (t) => {
302
+ let n = typeof t == "string" ? t : "";
303
+ e.handleChange(n);
304
+ let r = T.find((e) => e.id === n)?.fixed_ips ?? [];
305
+ k.setFieldValue("fixed_ip_address", r.length === 1 ? r[0].ip_address : "");
306
+ },
307
+ label: a._({ id: "eks7oA" }),
308
+ placeholder: a._({ id: "UztfYZ" }),
309
+ errortext: e.state.meta.errors.map((e) => e?.message).join(", "),
310
+ disabled: u || E,
311
+ loading: E,
312
+ children: T.map((e) => /*#__PURE__*/ M(n, {
313
+ value: e.id,
314
+ label: e.name ? `${e.name} (${e.id})` : e.id
315
+ }, e.id))
316
+ })
317
+ })
318
+ }),
319
+ /*#__PURE__*/ M(h, { children: /*#__PURE__*/ M(k.Field, {
320
+ name: "fixed_ip_address",
321
+ children: (e) => /*#__PURE__*/ M(v, {
322
+ id: e.name,
323
+ name: e.name,
324
+ value: e.state.value,
325
+ onBlur: e.handleBlur,
326
+ onChange: (t) => e.handleChange(typeof t == "string" ? t : ""),
327
+ label: a._({ id: "Nc7QKU" }),
328
+ placeholder: a._({ id: "i41Xuw" }),
329
+ helptext: a._({ id: "PtjzS+" }),
330
+ errortext: e.state.meta.errors.map((e) => e?.message).join(", "),
331
+ disabled: u || F.length === 0,
332
+ children: F.map(({ ip_address: e }) => /*#__PURE__*/ M(n, {
333
+ value: e,
334
+ label: e
335
+ }, e))
336
+ })
337
+ }) })
338
+ ]
339
+ })
340
+ ]
341
+ });
342
+ }, Z = (e) => {
343
+ let t = [];
344
+ return e.status && t.push({
345
+ name: "status",
346
+ value: e.status
347
+ }), t;
348
+ }, re = (e, t) => {
349
+ let n = {};
350
+ if (!e?.length) return n;
351
+ let r = e.filter((e) => !e.inactive).reduce((e, t) => (e[t.name] || (e[t.name] = []), e[t.name].push(t.value), e), {});
352
+ return Object.entries(r).forEach(([e, r]) => {
353
+ t.find((t) => t.filterName === e)?.supportsMultiValue && r.length > 1 ? n[e] = `in:${r.join(",")}` : n[e] = r[0];
354
+ }), n;
355
+ }, ie = (e, t, n) => e.some((e) => e.name === t.name && e.value === t.value) ? e : n.find((e) => e.filterName === t.name)?.supportsMultiValue ? [...e, t] : [...e.filter((e) => e.name !== t.name), t], ae = (e, t, n) => {
356
+ let r = {
357
+ search: n.search,
358
+ sortBy: n.sortBy,
359
+ sortDirection: n.sortDirection
360
+ };
361
+ if (!e?.length) return r;
362
+ let i = e.filter((e) => !e.inactive).reduce((e, t) => (e[t.name] || (e[t.name] = []), e[t.name].push(t.value), e), {});
363
+ return Object.entries(i).forEach(([e, n]) => {
364
+ t.find((t) => t.filterName === e)?.supportsMultiValue && n.length > 1 ? r[e] = `in:${n.join(",")}` : r[e] = n[0];
365
+ }), r;
366
+ }, Q = "fixed_ip_address", $ = "asc", oe = () => {
367
+ let { i18n: n, _: r } = B(), i = L(), a = R({ strict: !1 }), o = S(), [s, u] = D(!1), [f, p] = I(a.search || ""), m = F(void 0);
368
+ P(() => () => clearTimeout(m.current), []);
369
+ let [h, g] = I({
370
+ options: [
371
+ {
372
+ label: n._({ id: "Nc7QKU" }),
373
+ value: "fixed_ip_address"
374
+ },
375
+ {
376
+ label: n._({ id: "xNG/3n" }),
377
+ value: "floating_ip_address"
378
+ },
379
+ {
380
+ label: n._({ id: "2cJIlz" }),
381
+ value: "floating_network_id"
382
+ },
383
+ {
384
+ label: n._({ id: "S0kLOH" }),
385
+ value: "id"
386
+ },
387
+ {
388
+ label: n._({ id: "/bUiYk" }),
389
+ value: "router_id"
390
+ },
391
+ {
392
+ label: n._({ id: "uAQUqI" }),
393
+ value: "status"
394
+ },
395
+ {
396
+ label: n._({ id: "T9Mtpi" }),
397
+ value: "tenant_id"
398
+ },
399
+ {
400
+ label: n._({ id: "mSfwLL" }),
401
+ value: "project_id"
402
+ }
403
+ ],
404
+ sortBy: a.sortBy || Q,
405
+ sortDirection: a.sortDirection || $
406
+ }), [_, v] = I({
407
+ filters: [{
408
+ displayName: n._({ id: "uAQUqI" }),
409
+ filterName: "status",
410
+ values: [
411
+ "ACTIVE",
412
+ "DOWN",
413
+ "ERROR"
414
+ ],
415
+ supportsMultiValue: !1
416
+ }],
417
+ selectedFilters: Z(a)
418
+ }), y = a.search || "", { data: b } = x.network.canUser.useQuery({
419
+ project_id: o,
420
+ permission: ["network:floatingips:create"]
421
+ }, { select: ([e]) => ({ canCreate: e }) });
422
+ P(() => {
423
+ let e = Z(a), t = a.sortBy || Q, n = a.sortDirection || $, r = a.search || "";
424
+ v((t) => ({
425
+ ...t,
426
+ selectedFilters: e
427
+ })), g((e) => ({
428
+ ...e,
429
+ sortBy: t,
430
+ sortDirection: n
431
+ })), p(r);
432
+ }, [
433
+ a.status,
434
+ a.sortBy,
435
+ a.sortDirection,
436
+ a.search
437
+ ]);
438
+ let w = (e) => {
439
+ let t = {
440
+ options: e.options,
441
+ sortBy: e.sortBy?.toString() || Q,
442
+ sortDirection: e.sortDirection || $
443
+ };
444
+ g(t), i({
445
+ search: (e) => ({
446
+ ...e,
447
+ sortBy: t.sortBy,
448
+ sortDirection: t.sortDirection
449
+ }),
450
+ replace: !1
451
+ });
452
+ }, T = (e) => {
453
+ v(e), i({
454
+ search: (t) => ae(e.selectedFilters || [], e.filters, {
455
+ search: t.search,
456
+ sortBy: t.sortBy,
457
+ sortDirection: t.sortDirection
458
+ }),
459
+ replace: !1
460
+ });
461
+ }, E = (e, t = !1) => {
462
+ i({
463
+ search: (t) => ({
464
+ ...t,
465
+ search: e || void 0
466
+ }),
467
+ replace: t
468
+ });
469
+ }, { data: A = [], isLoading: j, isError: V, error: H } = x.network.floatingIp.list.useQuery({
470
+ project_id: o,
471
+ sort_key: h.sortBy,
472
+ sort_dir: h.sortDirection,
473
+ ...re(_.selectedFilters || [], _.filters),
474
+ ...y ? { searchTerm: y } : {}
475
+ }, { placeholderData: (e) => e });
476
+ return j && !A.length ? /*#__PURE__*/ M(c, {
477
+ className: "py-8",
478
+ distribution: "center",
479
+ alignment: "center",
480
+ direction: "vertical",
481
+ children: /*#__PURE__*/ M(z, { id: "Z3FXyt" })
482
+ }) : V && !A.length ? /*#__PURE__*/ M(c, {
483
+ className: "py-8",
484
+ distribution: "center",
485
+ alignment: "center",
486
+ direction: "vertical",
487
+ children: H?.message ?? n._({ id: "+Nx1wc" })
488
+ }) : /*#__PURE__*/ N("div", {
489
+ className: "relative",
490
+ children: [
491
+ V && A.length > 0 && /*#__PURE__*/ M(t, {
492
+ variant: "error",
493
+ className: "mb-4",
494
+ children: H?.message ?? n._({ id: "cL8dHR" })
495
+ }),
496
+ /*#__PURE__*/ M(c, {
497
+ distribution: "end",
498
+ alignment: "center",
499
+ gap: "2",
500
+ className: "pb-2",
501
+ children: /*#__PURE__*/ N(c, {
502
+ gap: "2",
503
+ children: [/*#__PURE__*/ M(C, {
504
+ options: h.options,
505
+ sortBy: h.sortBy,
506
+ sortDirection: h.sortDirection ?? "asc",
507
+ selectClassName: "min-w-40",
508
+ onSortByChange: (e) => w({
509
+ ...h,
510
+ sortBy: e,
511
+ sortDirection: h.sortDirection
512
+ }),
513
+ onSortDirectionChange: (e) => w({
514
+ ...h,
515
+ sortDirection: e
516
+ })
517
+ }), b?.canCreate && /*#__PURE__*/ M(l, {
518
+ onClick: u,
519
+ variant: "primary",
520
+ className: "whitespace-nowrap",
521
+ children: /*#__PURE__*/ M(z, { id: "h99+4y" })
522
+ })]
523
+ })
524
+ }),
525
+ /*#__PURE__*/ M(d, { children: /*#__PURE__*/ N(c, {
526
+ direction: "vertical",
527
+ gap: "2",
528
+ children: [/*#__PURE__*/ N(c, {
529
+ distribution: "between",
530
+ alignment: "center",
531
+ children: [/*#__PURE__*/ M(k, {
532
+ filters: _.filters,
533
+ selectClassName: "sm:min-w-40",
534
+ comboboxClassName: "sm:min-w-40",
535
+ onChange: (e) => {
536
+ let t = ie(_.selectedFilters || [], e, _.filters);
537
+ t !== (_.selectedFilters || []) && T({
538
+ ..._,
539
+ selectedFilters: t
540
+ });
541
+ }
542
+ }), /*#__PURE__*/ M(e, {
543
+ placeholder: n._({ id: "s6lr1k" }),
544
+ "data-testid": "searchbar",
545
+ value: f,
546
+ onInput: (e) => {
547
+ let t = e.currentTarget.value;
548
+ p(t), clearTimeout(m.current), m.current = window.setTimeout(() => E(t, !0), 500);
549
+ },
550
+ onSearch: (e) => {
551
+ clearTimeout(m.current), E(typeof e == "string" ? e : "", !1);
552
+ },
553
+ onClear: () => {
554
+ clearTimeout(m.current), p(""), E("", !1);
555
+ }
556
+ })]
557
+ }), _.selectedFilters && _.selectedFilters.length > 0 && /*#__PURE__*/ M(O, {
558
+ selectedFilters: _.selectedFilters,
559
+ onDelete: (e) => T({
560
+ ..._,
561
+ selectedFilters: (_.selectedFilters || []).filter((t) => t.name !== e.name || t.value !== e.value)
562
+ }),
563
+ onClear: () => T({
564
+ ..._,
565
+ selectedFilters: []
566
+ })
567
+ })]
568
+ }) }),
569
+ /*#__PURE__*/ M(J, {
570
+ floatingIps: A,
571
+ isLoading: j,
572
+ isError: V && !A.length,
573
+ error: H
574
+ }),
575
+ s && /*#__PURE__*/ M(ne, {
576
+ open: s,
577
+ onClose: u
578
+ })
579
+ ]
580
+ });
581
+ };
582
+ //#endregion
583
+ //#region src/client/routes/_auth/projects/$projectId/network/floatingips/index.tsx?tsr-split=component
584
+ function se() {
585
+ let { i18n: e, _: t } = B();
586
+ return /*#__PURE__*/ N(j, { children: [/*#__PURE__*/ M(p, { children: e._({ id: "u77/s4" }) }), /*#__PURE__*/ M(oe, {})] });
587
+ }
588
+ //#endregion
589
+ export { se as component };
590
+
591
+ //# sourceMappingURL=floatingips-Ci4jHkaG.mjs.map