@cobaltcore-dev/aurora 0.23.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/dist/client/App.d.ts +1 -1
  2. package/dist/client/{AuthProvider-CQ6Yppoh.mjs → AuthProvider-5TyZKZkx.mjs} +3 -3
  3. package/dist/client/AuthProvider-5TyZKZkx.mjs.map +1 -0
  4. package/dist/client/{ContentHeader-9KZdhOoA.mjs → ContentHeader-D64NtKvo.mjs} +26 -25
  5. package/dist/client/ContentHeader-D64NtKvo.mjs.map +1 -0
  6. package/dist/client/DeleteFlavorModal-C2K43ABZ.mjs +732 -0
  7. package/dist/client/DeleteFlavorModal-C2K43ABZ.mjs.map +1 -0
  8. package/dist/client/DeletePcaModal-D9v8E0Ki.mjs +92 -0
  9. package/dist/client/DeletePcaModal-D9v8E0Ki.mjs.map +1 -0
  10. package/dist/client/DetailsInfo-h7rPJ4Jf.mjs +61 -0
  11. package/dist/client/DetailsInfo-h7rPJ4Jf.mjs.map +1 -0
  12. package/dist/client/FiltersInput-Bw8TFfwb.mjs +82 -0
  13. package/dist/client/FiltersInput-Bw8TFfwb.mjs.map +1 -0
  14. package/dist/client/{FloatingIpActionModals-BcceUHcg.mjs → FloatingIpActionModals-BfEDfYg9.mjs} +66 -66
  15. package/dist/client/{FloatingIpActionModals-BcceUHcg.mjs.map → FloatingIpActionModals-BfEDfYg9.mjs.map} +1 -1
  16. package/dist/client/ImageToastNotifications-C0Tluzq-.mjs +1125 -0
  17. package/dist/client/ImageToastNotifications-C0Tluzq-.mjs.map +1 -0
  18. package/dist/client/{RouteError-Rm08PcxN.mjs → RouteError-B-NPGIv7.mjs} +2 -2
  19. package/dist/client/{RouteError-Rm08PcxN.mjs.map → RouteError-B-NPGIv7.mjs.map} +1 -1
  20. package/dist/client/Slot-CWb612-_.mjs.map +1 -1
  21. package/dist/client/{SortInput-D_q_jDfe.mjs → SortInput-DysAXpB3.mjs} +6 -6
  22. package/dist/client/{SortInput-D_q_jDfe.mjs.map → SortInput-DysAXpB3.mjs.map} +1 -1
  23. package/dist/client/{StatusError-2ZU1gFpu.mjs → StatusError-DX-GvLjq.mjs} +8 -8
  24. package/dist/client/{StatusError-2ZU1gFpu.mjs.map → StatusError-DX-GvLjq.mjs.map} +1 -1
  25. package/dist/client/TwoColumnDescriptionList-B3xunXmz.mjs +22 -0
  26. package/dist/client/TwoColumnDescriptionList-B3xunXmz.mjs.map +1 -0
  27. package/dist/client/{_auth-D5_QNUos.mjs → _auth-R5H2yKFf.mjs} +2 -2
  28. package/dist/client/_auth-R5H2yKFf.mjs.map +1 -0
  29. package/dist/client/_flavorId-Dit5mM8I.mjs +210 -0
  30. package/dist/client/_flavorId-Dit5mM8I.mjs.map +1 -0
  31. package/dist/client/{_flavorId-CFmkmg2Y.mjs → _flavorId-Zj7LNL-R.mjs} +4 -4
  32. package/dist/client/{_flavorId-CFmkmg2Y.mjs.map → _flavorId-Zj7LNL-R.mjs.map} +1 -1
  33. package/dist/client/_floatingIpId-B0MCoqE3.mjs +215 -0
  34. package/dist/client/_floatingIpId-B0MCoqE3.mjs.map +1 -0
  35. package/dist/client/{_floatingIpId-Dzh6_JCI.mjs → _floatingIpId-DCQQpNO-.mjs} +4 -4
  36. package/dist/client/{_floatingIpId-Dzh6_JCI.mjs.map → _floatingIpId-DCQQpNO-.mjs.map} +1 -1
  37. package/dist/client/_imageId-CZYzBAVx.mjs +558 -0
  38. package/dist/client/_imageId-CZYzBAVx.mjs.map +1 -0
  39. package/dist/client/_pcaId-CHRRsWmO.mjs +605 -0
  40. package/dist/client/_pcaId-CHRRsWmO.mjs.map +1 -0
  41. package/dist/client/{_projectId-DNZsNxJw.mjs → _projectId-B8wWSxPu.mjs} +9 -9
  42. package/dist/client/_projectId-B8wWSxPu.mjs.map +1 -0
  43. package/dist/client/{_projectId-BuBIFdgG.mjs → _projectId-C5DUYIjt.mjs} +117 -117
  44. package/dist/client/{_projectId-BuBIFdgG.mjs.map → _projectId-C5DUYIjt.mjs.map} +1 -1
  45. package/dist/client/{_projectId-CAQkJHZ4.mjs → _projectId-D2pFfYIs.mjs} +3 -3
  46. package/dist/client/{_projectId-CAQkJHZ4.mjs.map → _projectId-D2pFfYIs.mjs.map} +1 -1
  47. package/dist/client/{_projectId-D-b7paXE.mjs → _projectId-DhSWowQo.mjs} +4 -4
  48. package/dist/client/{_projectId-D-b7paXE.mjs.map → _projectId-DhSWowQo.mjs.map} +1 -1
  49. package/dist/client/{_securityGroupId-DFdNKa2l.mjs → _securityGroupId-DZ4D4WwB.mjs} +635 -617
  50. package/dist/client/_securityGroupId-DZ4D4WwB.mjs.map +1 -0
  51. package/dist/client/{_securityGroupId-DRkY3Gt6.mjs → _securityGroupId-Mj8NJT2-.mjs} +4 -4
  52. package/dist/client/{_securityGroupId-DRkY3Gt6.mjs.map → _securityGroupId-Mj8NJT2-.mjs.map} +1 -1
  53. package/dist/client/_storageType-C-9bNkmZ.mjs +2211 -0
  54. package/dist/client/_storageType-C-9bNkmZ.mjs.map +1 -0
  55. package/dist/client/_storageType-zeSZe--V.mjs.map +1 -1
  56. package/dist/client/{about-C8tTrQaW.mjs → about-WLyShNgE.mjs} +8 -8
  57. package/dist/client/about-WLyShNgE.mjs.map +1 -0
  58. package/dist/client/assets/objectDownload.worker-BXFQIIU_.js.map +1 -0
  59. package/dist/client/assets/objectDownload.worker-ECvFtmOF.js.map +1 -0
  60. package/dist/client/{aurora-jyvXcI4T.mjs → aurora-IMO9HhqJ.mjs} +2 -2
  61. package/dist/client/aurora-IMO9HhqJ.mjs.map +1 -0
  62. package/dist/client/{build-CRLQyqu2.mjs → build-DnD-T35u.mjs} +8180 -8212
  63. package/dist/client/build-DnD-T35u.mjs.map +1 -0
  64. package/dist/client/components/Auth/LoginForm.d.ts +1 -1
  65. package/dist/client/components/Auth/SessionExpirationTimer.d.ts +1 -1
  66. package/dist/client/components/ContentHeader/ContentHeader.d.ts +1 -1
  67. package/dist/client/components/Error/RouteError.d.ts +1 -1
  68. package/dist/client/components/Error/StatusError.d.ts +1 -1
  69. package/dist/client/components/JsonEditor.d.ts +1 -1
  70. package/dist/client/components/ListToolbar/FiltersInput.d.ts +3 -1
  71. package/dist/client/components/ListToolbar/SelectedFilters.d.ts +1 -1
  72. package/dist/client/components/ListToolbar/index.d.ts +1 -1
  73. package/dist/client/components/ProjectView/ProjectInfoBox.d.ts +1 -1
  74. package/dist/client/components/Slot.d.ts +1 -1
  75. package/dist/client/components/TwoColumnDescriptionList.d.ts +11 -0
  76. package/dist/client/components/navigation/LanguageSelect.d.ts +1 -1
  77. package/dist/client/components/navigation/MainNavigation.d.ts +1 -1
  78. package/dist/client/components/navigation/UserMenu.d.ts +1 -1
  79. package/dist/client/{flavors-Dy-2mRGv.mjs → flavors-Cp0LEGOH.mjs} +2 -2
  80. package/dist/client/{flavors-Dy-2mRGv.mjs.map → flavors-Cp0LEGOH.mjs.map} +1 -1
  81. package/dist/client/{flavors-BfTXqmoD.mjs → flavors-CwMbDRHm2.mjs} +203 -201
  82. package/dist/client/flavors-CwMbDRHm2.mjs.map +1 -0
  83. package/dist/client/flavors-DWMZ6TuJ.mjs.map +1 -1
  84. package/dist/client/floatingips-ICwo-rV_.mjs +591 -0
  85. package/dist/client/floatingips-ICwo-rV_.mjs.map +1 -0
  86. package/dist/client/formatBytes-CZv_XyCY.mjs.map +1 -1
  87. package/dist/client/helpers-1PpYf-fC.mjs.map +1 -1
  88. package/dist/client/hooks/useAvailableViewportHeight.d.ts +33 -0
  89. package/dist/client/hooks/useVirtualizedTableBody.d.ts +37 -0
  90. package/dist/client/{hooks-Bw3sHHOg.mjs → hooks-CrriowRk.mjs} +2 -2
  91. package/dist/client/{hooks-Bw3sHHOg.mjs.map → hooks-CrriowRk.mjs.map} +1 -1
  92. package/dist/client/images-DOGZmr3D.mjs +1937 -0
  93. package/dist/client/images-DOGZmr3D.mjs.map +1 -0
  94. package/dist/client/{images-DPKUXryV.mjs → images-DWiM_72I.mjs} +2 -2
  95. package/dist/client/{images-DPKUXryV.mjs.map → images-DWiM_72I.mjs.map} +1 -1
  96. package/dist/client/images-NBf2bV43.mjs.map +1 -1
  97. package/dist/client/index.js +601 -445
  98. package/dist/client/index.js.map +1 -1
  99. package/dist/client/{md-CyCflQee.mjs → md-DNzcRhmz.mjs} +6 -60
  100. package/dist/client/{md-CyCflQee.mjs.map → md-DNzcRhmz.mjs.map} +1 -1
  101. package/dist/client/network-DuZm76BZ.mjs.map +1 -1
  102. package/dist/client/objects-D2MKUCxc.mjs +56 -0
  103. package/dist/client/objects-D2MKUCxc.mjs.map +1 -0
  104. package/dist/client/objects-DI1-tnKr.mjs +56 -0
  105. package/dist/client/objects-DI1-tnKr.mjs.map +1 -0
  106. package/dist/client/objects-DeK2WD5K.mjs +10078 -0
  107. package/dist/client/objects-DeK2WD5K.mjs.map +1 -0
  108. package/dist/client/pca-BokFv4Gz.mjs +239 -0
  109. package/dist/client/pca-BokFv4Gz.mjs.map +1 -0
  110. package/dist/client/{pca-D0kKxHp4.mjs → pca-D5jHAl0b.mjs} +4 -3
  111. package/dist/client/{pca-D0kKxHp4.mjs.map → pca-D5jHAl0b.mjs.map} +1 -1
  112. package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
  113. package/dist/client/routeInfo-CdTRlSxv.mjs.map +1 -1
  114. package/dist/client/{routes-CtfnI-aY.mjs → routes-B05u5bk4.mjs} +2 -2
  115. package/dist/client/{routes-CtfnI-aY.mjs.map → routes-B05u5bk4.mjs.map} +1 -1
  116. package/dist/client/{routes-BOf-GDMM.mjs → routes-DOJr5onJ.mjs} +31 -28
  117. package/dist/client/routes-DOJr5onJ.mjs.map +1 -0
  118. package/dist/client/{securitygroups-DRhFle2O.mjs → securitygroups-Be2Qgmew.mjs} +201 -195
  119. package/dist/client/securitygroups-Be2Qgmew.mjs.map +1 -0
  120. package/dist/client/{securitygroups-B8aLyFK7.mjs → securitygroups-_7SYN2jN.mjs} +2 -2
  121. package/dist/client/{securitygroups-B8aLyFK7.mjs.map → securitygroups-_7SYN2jN.mjs.map} +1 -1
  122. package/dist/client/store/AuthProvider.d.ts +1 -1
  123. package/dist/client/{trpcClient-Di56hpVv.mjs → trpcClient-D7gpR7YG.mjs} +2 -2
  124. package/dist/client/{trpcClient-Di56hpVv.mjs.map → trpcClient-D7gpR7YG.mjs.map} +1 -1
  125. package/dist/client/trpcClient.d.ts +125 -11
  126. package/dist/client/useModal-DCs1OJh7.mjs.map +1 -1
  127. package/dist/client/{useSecurityGroupPermissions-BPS1ibWq.mjs → useSecurityGroupPermissions-qPwm4mFt.mjs} +15 -15
  128. package/dist/client/{useSecurityGroupPermissions-BPS1ibWq.mjs.map → useSecurityGroupPermissions-qPwm4mFt.mjs.map} +1 -1
  129. package/dist/server/index.d.ts +125 -11
  130. package/dist/server/index.js +4142 -2845
  131. package/package.json +8 -8
  132. package/dist/client/AuthProvider-CQ6Yppoh.mjs.map +0 -1
  133. package/dist/client/BucketToastNotifications-BhPi4WWw.mjs +0 -613
  134. package/dist/client/BucketToastNotifications-BhPi4WWw.mjs.map +0 -1
  135. package/dist/client/ContentHeader-9KZdhOoA.mjs.map +0 -1
  136. package/dist/client/DeleteFlavorModal-Be2qZo4w.mjs +0 -713
  137. package/dist/client/DeleteFlavorModal-Be2qZo4w.mjs.map +0 -1
  138. package/dist/client/DeletePcaModal-CIFsGWyj.mjs +0 -80
  139. package/dist/client/DeletePcaModal-CIFsGWyj.mjs.map +0 -1
  140. package/dist/client/DetailsInfo-CHVD7d-W.mjs +0 -52
  141. package/dist/client/DetailsInfo-CHVD7d-W.mjs.map +0 -1
  142. package/dist/client/FiltersInput-DqT08Ib-.mjs +0 -81
  143. package/dist/client/FiltersInput-DqT08Ib-.mjs.map +0 -1
  144. package/dist/client/ImageToastNotifications-BGyX2J6j.mjs +0 -1219
  145. package/dist/client/ImageToastNotifications-BGyX2J6j.mjs.map +0 -1
  146. package/dist/client/_auth-D5_QNUos.mjs.map +0 -1
  147. package/dist/client/_flavorId-BsmqS9hP.mjs +0 -194
  148. package/dist/client/_flavorId-BsmqS9hP.mjs.map +0 -1
  149. package/dist/client/_floatingIpId-Bb9ZEJ6b.mjs +0 -228
  150. package/dist/client/_floatingIpId-Bb9ZEJ6b.mjs.map +0 -1
  151. package/dist/client/_imageId-C3As7sHE.mjs +0 -534
  152. package/dist/client/_imageId-C3As7sHE.mjs.map +0 -1
  153. package/dist/client/_pcaId-n0q0aDb6.mjs +0 -545
  154. package/dist/client/_pcaId-n0q0aDb6.mjs.map +0 -1
  155. package/dist/client/_projectId-DNZsNxJw.mjs.map +0 -1
  156. package/dist/client/_securityGroupId-DFdNKa2l.mjs.map +0 -1
  157. package/dist/client/_storageType-BKfQcpgp.mjs +0 -81
  158. package/dist/client/_storageType-BKfQcpgp.mjs.map +0 -1
  159. package/dist/client/_storageType-sMj9NEJz.mjs +0 -2870
  160. package/dist/client/_storageType-sMj9NEJz.mjs.map +0 -1
  161. package/dist/client/about-C8tTrQaW.mjs.map +0 -1
  162. package/dist/client/assets/objectDownload.worker-BAc5Au4B.js.map +0 -1
  163. package/dist/client/aurora-jyvXcI4T.mjs.map +0 -1
  164. package/dist/client/build-CRLQyqu2.mjs.map +0 -1
  165. package/dist/client/flavors-BfTXqmoD.mjs.map +0 -1
  166. package/dist/client/floatingips-zhNK6Xxn.mjs +0 -562
  167. package/dist/client/floatingips-zhNK6Xxn.mjs.map +0 -1
  168. package/dist/client/images-DhZnqUG_.mjs +0 -1890
  169. package/dist/client/images-DhZnqUG_.mjs.map +0 -1
  170. package/dist/client/objects-BG1saVLZ.mjs +0 -6648
  171. package/dist/client/objects-BG1saVLZ.mjs.map +0 -1
  172. package/dist/client/objects-Dahys529.mjs +0 -103
  173. package/dist/client/objects-Dahys529.mjs.map +0 -1
  174. package/dist/client/objects-o2Cj_ndZ.mjs +0 -8
  175. package/dist/client/objects-o2Cj_ndZ.mjs.map +0 -1
  176. package/dist/client/pca-B60iWWfG.mjs +0 -251
  177. package/dist/client/pca-B60iWWfG.mjs.map +0 -1
  178. package/dist/client/routes-BOf-GDMM.mjs.map +0 -1
  179. package/dist/client/securitygroups-DRhFle2O.mjs.map +0 -1
  180. package/dist/client/useListWithFiltering-aPTUNRaW.mjs +0 -32
  181. package/dist/client/useListWithFiltering-aPTUNRaW.mjs.map +0 -1
@@ -0,0 +1,591 @@
1
+ import { C as e, E as t, G as n, I as r, L as i, S as a, Y as o, Z as s, _ as c, a as l, ct as u, dt as d, h as f, k as p, m, nt as h, rt as g, s as _, t as v, u as y, w as b } from "./build-DnD-T35u.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-DysAXpB3.mjs";
5
+ import { d as w, n as T, o as E } from "./md-DNzcRhmz.mjs";
6
+ import "./hooks-CrriowRk.mjs";
7
+ import { t as D } from "./useModal-DCs1OJh7.mjs";
8
+ import { n as O, t as k } from "./FiltersInput-Bw8TFfwb.mjs";
9
+ import { t as A } from "./FloatingIpActionModals-BfEDfYg9.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 ee } from "@tanstack/react-router";
13
+ import { Trans as R, useLingui as z } from "@lingui/react";
14
+ import { z as B } from "zod";
15
+ import { i18n as V } from "@lingui/core";
16
+ import { useForm as H, useStore as U } from "@tanstack/react-form";
17
+ //#region src/client/routes/_auth/projects/$projectId/network/floatingips/-components/-table/constants.tsx
18
+ var W = {
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
+ }, G = () => [
44
+ V._({ id: "uAQUqI" }),
45
+ V._({ id: "xNG/3n" }),
46
+ V._({ id: "Nc7QKU" }),
47
+ V._({ id: "7NC3vm" }),
48
+ V._({ id: "Nu4oKW" }),
49
+ ""
50
+ ], K = ({ floatingIp: e }) => {
51
+ let { i18n: n, _: r } = z(), i = L(), o = S(), s = () => {
52
+ i({
53
+ to: "/projects/$projectId/network/floatingips/$floatingIpId",
54
+ params: {
55
+ projectId: o,
56
+ floatingIpId: e.id
57
+ }
58
+ });
59
+ };
60
+ return /*#__PURE__*/ N(t, {
61
+ "data-testid": `floating-ip-row-${e.id}`,
62
+ onClick: s,
63
+ children: [
64
+ /*#__PURE__*/ M(v, { children: /*#__PURE__*/ N("div", {
65
+ className: "flex items-center gap-2",
66
+ children: [W[e.status].icon, W[e.status].text]
67
+ }) }),
68
+ /*#__PURE__*/ M(v, { children: e.floating_ip_address }),
69
+ /*#__PURE__*/ M(v, { children: e.fixed_ip_address || "—" }),
70
+ /*#__PURE__*/ M(v, { children: e.floating_network_id }),
71
+ /*#__PURE__*/ M(v, { children: e.description || "—" }),
72
+ /*#__PURE__*/ M(v, {
73
+ onClick: (e) => e.stopPropagation(),
74
+ className: "items-end pr-0",
75
+ children: /*#__PURE__*/ M(A, {
76
+ floatingIp: e,
77
+ children: ({ toggleEditModal: e, toggleAttachModal: t, toggleDetachModal: r, toggleReleaseModal: i }) => /*#__PURE__*/ M(p, { children: /*#__PURE__*/ N(c, { children: [
78
+ /*#__PURE__*/ M(a, {
79
+ label: n._({ id: "rdUucN" }),
80
+ onClick: s
81
+ }),
82
+ /*#__PURE__*/ M(a, {
83
+ label: n._({ id: "n22YIM" }),
84
+ onClick: e
85
+ }),
86
+ /*#__PURE__*/ M(a, {
87
+ label: n._({ id: "igVDFt" }),
88
+ onClick: t
89
+ }),
90
+ /*#__PURE__*/ M(a, {
91
+ label: n._({ id: "FOcBn3" }),
92
+ onClick: r
93
+ }),
94
+ /*#__PURE__*/ M(a, {
95
+ label: n._({ id: "H+a5j6" }),
96
+ onClick: i
97
+ })
98
+ ] }) })
99
+ })
100
+ })
101
+ ]
102
+ }, e.id);
103
+ }, q = ({ floatingIps: r, isLoading: i, isError: a, error: o }) => {
104
+ let { i18n: c, _: l } = z(), u = G(), d = u.length;
105
+ return i ? /*#__PURE__*/ N(s, {
106
+ className: "py-8",
107
+ distribution: "center",
108
+ alignment: "center",
109
+ direction: "vertical",
110
+ children: [/*#__PURE__*/ M(n, {
111
+ variant: "primary",
112
+ size: "large",
113
+ className: "mb-2"
114
+ }), /*#__PURE__*/ M(R, { id: "Z3FXyt" })]
115
+ }) : a ? /*#__PURE__*/ M(s, {
116
+ className: "py-8",
117
+ distribution: "center",
118
+ alignment: "center",
119
+ direction: "vertical",
120
+ children: o?.message ?? c._({ id: "+Nx1wc" })
121
+ }) : r.length === 0 ? /*#__PURE__*/ M(_, {
122
+ columns: d,
123
+ className: "floating-ips",
124
+ "data-testid": "no-floating-ips",
125
+ children: /*#__PURE__*/ M(t, { children: /*#__PURE__*/ N(v, {
126
+ colSpan: d,
127
+ children: [/*#__PURE__*/ M(g, { children: /*#__PURE__*/ M(R, { id: "WCLyHI" }) }), /*#__PURE__*/ M("p", { children: /*#__PURE__*/ M(R, { id: "0eY8Mz" }) })]
128
+ }) })
129
+ }) : /*#__PURE__*/ N(_, {
130
+ columns: d,
131
+ children: [/*#__PURE__*/ M(t, { children: u.map((t) => /*#__PURE__*/ M(e, { children: t }, t)) }), r.map((e) => /*#__PURE__*/ M(K, { floatingIp: e }, e.id))]
132
+ });
133
+ }, J = /^(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}$/, Y = /^(([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})))$/, X = (e) => J.test(e) || Y.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: t }) => {
134
+ let { i18n: a, _: s } = z(), c = S(), l = x.useUtils(), { isPending: p, ...g } = x.network.floatingIp.create.useMutation({ onSettled: () => l.network.floatingIp.list.invalidate() }), { data: _ = [], isLoading: v, error: y } = 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 = B.object({
135
+ floating_network_id: B.string(),
136
+ dns_domain: B.string(),
137
+ dns_name: B.string().trim().max(63, a._({ id: "Zq6Y5u" })).refine((e) => e === "" || te.test(e), { message: a._({ id: "R6kcsL" }) }),
138
+ description: B.string().trim().max(255, a._({ id: "lZvIXd" })),
139
+ floating_ip_address: B.string().trim().refine((e) => e === "" || X(e), { message: a._({ id: "AZyHwC" }) }),
140
+ port_id: B.string(),
141
+ fixed_ip_address: B.string()
142
+ }), k = H({
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
+ p || (await g.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
+ p || (k.reset(), g.reset(), t());
168
+ }, j = U(k.store, (e) => e.values.port_id), P = U(k.store, (e) => e.values.floating_network_id), F = T.find((e) => e.id === j)?.fixed_ips ?? [], I = (y?.message || w?.message || D?.message) ?? g.error?.message ?? null;
169
+ return /*#__PURE__*/ N(o, {
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: p || !P,
178
+ children: [
179
+ I && /*#__PURE__*/ M(r, {
180
+ dismissible: !1,
181
+ variant: "error",
182
+ className: "mb-4",
183
+ children: I
184
+ }),
185
+ p && /*#__PURE__*/ N("div", {
186
+ className: "mb-4 flex items-center justify-center gap-2",
187
+ children: [/*#__PURE__*/ M(n, { variant: "primary" }), /*#__PURE__*/ M("span", {
188
+ className: "text-theme-high text-sm",
189
+ children: /*#__PURE__*/ M(R, { id: "HuA8iQ" })
190
+ })]
191
+ }),
192
+ !p && /*#__PURE__*/ N(d, {
193
+ className: "mb-0",
194
+ id: "allocate-floating-ip-form",
195
+ onSubmit: (e) => {
196
+ e.preventDefault(), k.handleSubmit();
197
+ },
198
+ children: [
199
+ /*#__PURE__*/ M(m, {
200
+ className: "mb-4",
201
+ children: /*#__PURE__*/ M(k.Field, {
202
+ name: "floating_network_id",
203
+ children: (e) => /*#__PURE__*/ M(h, {
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: p || v,
212
+ required: !0,
213
+ loading: v,
214
+ children: _.map(({ id: e, name: t }) => /*#__PURE__*/ M(i, {
215
+ value: e,
216
+ label: t ? `${t} (${e})` : e
217
+ }, e))
218
+ })
219
+ })
220
+ }),
221
+ /*#__PURE__*/ M(m, {
222
+ className: "mb-4",
223
+ children: /*#__PURE__*/ M(k.Field, {
224
+ name: "dns_domain",
225
+ children: (e) => /*#__PURE__*/ M(h, {
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: p || C,
233
+ loading: C,
234
+ children: b.map(({ id: e, name: t }) => /*#__PURE__*/ M(i, {
235
+ value: t,
236
+ label: t
237
+ }, e))
238
+ })
239
+ })
240
+ }),
241
+ /*#__PURE__*/ M(m, {
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: p
256
+ })
257
+ })
258
+ }),
259
+ /*#__PURE__*/ M(m, {
260
+ className: "mb-4",
261
+ children: /*#__PURE__*/ M(k.Field, {
262
+ name: "description",
263
+ children: (e) => /*#__PURE__*/ M(u, {
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: p
272
+ })
273
+ })
274
+ }),
275
+ /*#__PURE__*/ M(m, {
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: p
290
+ })
291
+ })
292
+ }),
293
+ /*#__PURE__*/ M(m, {
294
+ className: "mb-4",
295
+ children: /*#__PURE__*/ M(k.Field, {
296
+ name: "port_id",
297
+ children: (e) => /*#__PURE__*/ M(h, {
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: p || E,
311
+ loading: E,
312
+ children: T.map((e) => /*#__PURE__*/ M(i, {
313
+ value: e.id,
314
+ label: e.name ? `${e.name} (${e.id})` : e.id
315
+ }, e.id))
316
+ })
317
+ })
318
+ }),
319
+ /*#__PURE__*/ M(m, { children: /*#__PURE__*/ M(k.Field, {
320
+ name: "fixed_ip_address",
321
+ children: (e) => /*#__PURE__*/ M(h, {
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: p || F.length === 0,
332
+ children: F.map(({ ip_address: e }) => /*#__PURE__*/ M(i, {
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: e, _: t } = z(), n = L(), i = ee({ strict: !1 }), a = S(), [o, c] = D(!1), [u, d] = I(i.search || ""), f = F(void 0);
368
+ P(() => () => clearTimeout(f.current), []);
369
+ let [p, m] = I({
370
+ options: [
371
+ {
372
+ label: e._({ id: "Nc7QKU" }),
373
+ value: "fixed_ip_address"
374
+ },
375
+ {
376
+ label: e._({ id: "xNG/3n" }),
377
+ value: "floating_ip_address"
378
+ },
379
+ {
380
+ label: e._({ id: "2cJIlz" }),
381
+ value: "floating_network_id"
382
+ },
383
+ {
384
+ label: e._({ id: "S0kLOH" }),
385
+ value: "id"
386
+ },
387
+ {
388
+ label: e._({ id: "/bUiYk" }),
389
+ value: "router_id"
390
+ },
391
+ {
392
+ label: e._({ id: "uAQUqI" }),
393
+ value: "status"
394
+ },
395
+ {
396
+ label: e._({ id: "T9Mtpi" }),
397
+ value: "tenant_id"
398
+ },
399
+ {
400
+ label: e._({ id: "mSfwLL" }),
401
+ value: "project_id"
402
+ }
403
+ ],
404
+ sortBy: i.sortBy || Q,
405
+ sortDirection: i.sortDirection || $
406
+ }), [h, g] = I({
407
+ filters: [{
408
+ displayName: e._({ id: "uAQUqI" }),
409
+ filterName: "status",
410
+ values: [
411
+ "ACTIVE",
412
+ "DOWN",
413
+ "ERROR"
414
+ ],
415
+ supportsMultiValue: !1
416
+ }],
417
+ selectedFilters: Z(i)
418
+ }), _ = i.search || "", { data: v } = x.network.canUser.useQuery({
419
+ project_id: a,
420
+ permission: ["network:floatingips:create"]
421
+ }, { select: ([e]) => ({ canCreate: e }) });
422
+ P(() => {
423
+ let e = Z(i), t = i.sortBy || Q, n = i.sortDirection || $, r = i.search || "";
424
+ g((t) => ({
425
+ ...t,
426
+ selectedFilters: e
427
+ })), m((e) => ({
428
+ ...e,
429
+ sortBy: t,
430
+ sortDirection: n
431
+ })), d(r);
432
+ }, [
433
+ i.status,
434
+ i.sortBy,
435
+ i.sortDirection,
436
+ i.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
+ m(t), n({
445
+ search: (e) => ({
446
+ ...e,
447
+ sortBy: t.sortBy,
448
+ sortDirection: t.sortDirection
449
+ }),
450
+ replace: !1
451
+ });
452
+ }, T = (e) => {
453
+ g(e), n({
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
+ n({
463
+ search: (t) => ({
464
+ ...t,
465
+ search: e || void 0
466
+ }),
467
+ replace: t
468
+ });
469
+ }, { data: A = [], isLoading: j, isError: B, error: V } = x.network.floatingIp.list.useQuery({
470
+ project_id: a,
471
+ sort_key: p.sortBy,
472
+ sort_dir: p.sortDirection,
473
+ ...re(h.selectedFilters || [], h.filters),
474
+ ..._ ? { searchTerm: _ } : {}
475
+ }, { placeholderData: (e) => e });
476
+ return j && !A.length ? /*#__PURE__*/ M(s, {
477
+ className: "py-8",
478
+ distribution: "center",
479
+ alignment: "center",
480
+ direction: "vertical",
481
+ children: /*#__PURE__*/ M(R, { id: "Z3FXyt" })
482
+ }) : B && !A.length ? /*#__PURE__*/ M(s, {
483
+ className: "py-8",
484
+ distribution: "center",
485
+ alignment: "center",
486
+ direction: "vertical",
487
+ children: V?.message ?? e._({ id: "+Nx1wc" })
488
+ }) : /*#__PURE__*/ N("div", {
489
+ className: "relative",
490
+ children: [
491
+ B && A.length > 0 && /*#__PURE__*/ M(r, {
492
+ variant: "error",
493
+ className: "mb-4",
494
+ children: V?.message ?? e._({ id: "cL8dHR" })
495
+ }),
496
+ /*#__PURE__*/ M(s, {
497
+ distribution: "end",
498
+ alignment: "center",
499
+ gap: "2",
500
+ className: "pb-2",
501
+ children: /*#__PURE__*/ N(s, {
502
+ gap: "2",
503
+ children: [/*#__PURE__*/ M(C, {
504
+ options: p.options,
505
+ sortBy: p.sortBy,
506
+ sortDirection: p.sortDirection ?? "asc",
507
+ selectClassName: "min-w-40",
508
+ onSortByChange: (e) => w({
509
+ ...p,
510
+ sortBy: e,
511
+ sortDirection: p.sortDirection
512
+ }),
513
+ onSortDirectionChange: (e) => w({
514
+ ...p,
515
+ sortDirection: e
516
+ })
517
+ }), v?.canCreate && /*#__PURE__*/ M(l, {
518
+ onClick: c,
519
+ variant: "primary",
520
+ className: "whitespace-nowrap",
521
+ children: /*#__PURE__*/ M(R, { id: "h99+4y" })
522
+ })]
523
+ })
524
+ }),
525
+ /*#__PURE__*/ M(y, { children: /*#__PURE__*/ N(s, {
526
+ direction: "vertical",
527
+ gap: "2",
528
+ children: [/*#__PURE__*/ N(s, {
529
+ distribution: "between",
530
+ alignment: "center",
531
+ children: [/*#__PURE__*/ M(k, {
532
+ filters: h.filters,
533
+ selectClassName: "sm:min-w-40",
534
+ comboboxClassName: "sm:min-w-40",
535
+ onChange: (e) => {
536
+ let t = ie(h.selectedFilters || [], e, h.filters);
537
+ t !== (h.selectedFilters || []) && T({
538
+ ...h,
539
+ selectedFilters: t
540
+ });
541
+ }
542
+ }), /*#__PURE__*/ M(b, {
543
+ placeholder: e._({ id: "s6lr1k" }),
544
+ "data-testid": "searchbar",
545
+ value: u,
546
+ onInput: (e) => {
547
+ let t = e.currentTarget.value;
548
+ d(t), clearTimeout(f.current), f.current = window.setTimeout(() => E(t, !0), 500);
549
+ },
550
+ onSearch: (e) => {
551
+ clearTimeout(f.current), E(typeof e == "string" ? e : "", !1);
552
+ },
553
+ onClear: () => {
554
+ clearTimeout(f.current), d(""), E("", !1);
555
+ }
556
+ })]
557
+ }), h.selectedFilters && h.selectedFilters.length > 0 && /*#__PURE__*/ M(O, {
558
+ selectedFilters: h.selectedFilters,
559
+ onDelete: (e) => T({
560
+ ...h,
561
+ selectedFilters: (h.selectedFilters || []).filter((t) => t.name !== e.name || t.value !== e.value)
562
+ }),
563
+ onClear: () => T({
564
+ ...h,
565
+ selectedFilters: []
566
+ })
567
+ })]
568
+ }) }),
569
+ /*#__PURE__*/ M(q, {
570
+ floatingIps: A,
571
+ isLoading: j,
572
+ isError: B && !A.length,
573
+ error: V
574
+ }),
575
+ o && /*#__PURE__*/ M(ne, {
576
+ open: o,
577
+ onClose: c
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 } = z();
586
+ return /*#__PURE__*/ N(j, { children: [/*#__PURE__*/ M(g, { children: e._({ id: "u77/s4" }) }), /*#__PURE__*/ M(oe, {})] });
587
+ }
588
+ //#endregion
589
+ export { se as component };
590
+
591
+ //# sourceMappingURL=floatingips-ICwo-rV_.mjs.map