@cobaltcore-dev/aurora 0.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 (142) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +141 -0
  3. package/dist/client/AuroraApp.d.ts +7 -0
  4. package/dist/client/AuthProvider-D-5Jpa6F.mjs +100 -0
  5. package/dist/client/AuthProvider-D-5Jpa6F.mjs.map +1 -0
  6. package/dist/client/ContentHeader-H8KGY3Wd.mjs +81 -0
  7. package/dist/client/ContentHeader-H8KGY3Wd.mjs.map +1 -0
  8. package/dist/client/DeleteFlavorModal-B98oiHWx.mjs +629 -0
  9. package/dist/client/DeleteFlavorModal-B98oiHWx.mjs.map +1 -0
  10. package/dist/client/EditSecurityGroupModal-wQVNIVg1.mjs +137 -0
  11. package/dist/client/EditSecurityGroupModal-wQVNIVg1.mjs.map +1 -0
  12. package/dist/client/FloatingIpActionModals-qu1NMI5a.mjs +417 -0
  13. package/dist/client/FloatingIpActionModals-qu1NMI5a.mjs.map +1 -0
  14. package/dist/client/ImageToastNotifications-wsQDNEh7.mjs +1267 -0
  15. package/dist/client/ImageToastNotifications-wsQDNEh7.mjs.map +1 -0
  16. package/dist/client/ListToolbar-CHlkZrpl.mjs +223 -0
  17. package/dist/client/ListToolbar-CHlkZrpl.mjs.map +1 -0
  18. package/dist/client/RouteError-BwgDIwJE.mjs +25 -0
  19. package/dist/client/RouteError-BwgDIwJE.mjs.map +1 -0
  20. package/dist/client/_auth-CsliQdkJ.mjs +11 -0
  21. package/dist/client/_auth-CsliQdkJ.mjs.map +1 -0
  22. package/dist/client/_flavorId-D_A53VYa.mjs +56 -0
  23. package/dist/client/_flavorId-D_A53VYa.mjs.map +1 -0
  24. package/dist/client/_flavorId-DbhYLFxY.mjs +190 -0
  25. package/dist/client/_flavorId-DbhYLFxY.mjs.map +1 -0
  26. package/dist/client/_floatingIpId-BGgftRBQ.mjs +21 -0
  27. package/dist/client/_floatingIpId-BGgftRBQ.mjs.map +1 -0
  28. package/dist/client/_floatingIpId-D5myuLFz.mjs +228 -0
  29. package/dist/client/_floatingIpId-D5myuLFz.mjs.map +1 -0
  30. package/dist/client/_imageId-BoHX155h.mjs +27 -0
  31. package/dist/client/_imageId-BoHX155h.mjs.map +1 -0
  32. package/dist/client/_imageId-CTa0c3Av.mjs +530 -0
  33. package/dist/client/_imageId-CTa0c3Av.mjs.map +1 -0
  34. package/dist/client/_pcaId-C7Lrv1H_.mjs +242 -0
  35. package/dist/client/_pcaId-C7Lrv1H_.mjs.map +1 -0
  36. package/dist/client/_pcaId-DBgz5V_9.mjs +21 -0
  37. package/dist/client/_pcaId-DBgz5V_9.mjs.map +1 -0
  38. package/dist/client/_projectId-B9fln31N.mjs +8 -0
  39. package/dist/client/_projectId-B9fln31N.mjs.map +1 -0
  40. package/dist/client/_projectId-Be1Erj68.mjs +300 -0
  41. package/dist/client/_projectId-Be1Erj68.mjs.map +1 -0
  42. package/dist/client/_projectId-C-E4NNgo.mjs +84 -0
  43. package/dist/client/_projectId-C-E4NNgo.mjs.map +1 -0
  44. package/dist/client/_projectId-INhedXor.mjs +26 -0
  45. package/dist/client/_projectId-INhedXor.mjs.map +1 -0
  46. package/dist/client/_securityGroupId-DQoRQ-yA.mjs +1647 -0
  47. package/dist/client/_securityGroupId-DQoRQ-yA.mjs.map +1 -0
  48. package/dist/client/_securityGroupId-ihjy8Lcd.mjs +21 -0
  49. package/dist/client/_securityGroupId-ihjy8Lcd.mjs.map +1 -0
  50. package/dist/client/about-oT6ccz8T.mjs +92 -0
  51. package/dist/client/about-oT6ccz8T.mjs.map +1 -0
  52. package/dist/client/aurora-D_NPTbo-.mjs +19 -0
  53. package/dist/client/aurora-D_NPTbo-.mjs.map +1 -0
  54. package/dist/client/build-eu9eg0zF.mjs +14619 -0
  55. package/dist/client/build-eu9eg0zF.mjs.map +1 -0
  56. package/dist/client/buildFilterParams-BDOIRDeD.mjs +15 -0
  57. package/dist/client/buildFilterParams-BDOIRDeD.mjs.map +1 -0
  58. package/dist/client/cn-C3laVXMm.mjs +10 -0
  59. package/dist/client/cn-C3laVXMm.mjs.map +1 -0
  60. package/dist/client/constants-ByHCdNsI.mjs +128 -0
  61. package/dist/client/constants-ByHCdNsI.mjs.map +1 -0
  62. package/dist/client/containers-B_ozmVlx.mjs +74 -0
  63. package/dist/client/containers-B_ozmVlx.mjs.map +1 -0
  64. package/dist/client/containers-Dx7TYruP.mjs +7 -0
  65. package/dist/client/containers-Dx7TYruP.mjs.map +1 -0
  66. package/dist/client/containers-rn_ntCJu.mjs +3029 -0
  67. package/dist/client/containers-rn_ntCJu.mjs.map +1 -0
  68. package/dist/client/flavors-CT4auvLO.mjs +565 -0
  69. package/dist/client/flavors-CT4auvLO.mjs.map +1 -0
  70. package/dist/client/flavors-DRZb9LJP.mjs +8 -0
  71. package/dist/client/flavors-DRZb9LJP.mjs.map +1 -0
  72. package/dist/client/flavors-DtgMd0Ii.mjs +12 -0
  73. package/dist/client/flavors-DtgMd0Ii.mjs.map +1 -0
  74. package/dist/client/floatingips-DG5cFJSZ.mjs +12 -0
  75. package/dist/client/floatingips-DG5cFJSZ.mjs.map +1 -0
  76. package/dist/client/floatingips-iCMR0ZiL.mjs +436 -0
  77. package/dist/client/floatingips-iCMR0ZiL.mjs.map +1 -0
  78. package/dist/client/formatBytes-GYujK0dP.mjs +38 -0
  79. package/dist/client/formatBytes-GYujK0dP.mjs.map +1 -0
  80. package/dist/client/helpers--JWXi40U.mjs +6 -0
  81. package/dist/client/helpers--JWXi40U.mjs.map +1 -0
  82. package/dist/client/hooks-s-I8vWww.mjs +2 -0
  83. package/dist/client/images-BTqRflJv2.mjs +1794 -0
  84. package/dist/client/images-BTqRflJv2.mjs.map +1 -0
  85. package/dist/client/images-DRTfx8k2.mjs +8 -0
  86. package/dist/client/images-DRTfx8k2.mjs.map +1 -0
  87. package/dist/client/images-xBfsjxkX.mjs +12 -0
  88. package/dist/client/images-xBfsjxkX.mjs.map +1 -0
  89. package/dist/client/index.d.ts +1 -0
  90. package/dist/client/index.js +1033 -0
  91. package/dist/client/index.js.map +1 -0
  92. package/dist/client/md-CI9FmfYv.mjs +390 -0
  93. package/dist/client/md-CI9FmfYv.mjs.map +1 -0
  94. package/dist/client/network-DFVVVNS5.mjs +8 -0
  95. package/dist/client/network-DFVVVNS5.mjs.map +1 -0
  96. package/dist/client/objects-CKk6cST_.mjs +4762 -0
  97. package/dist/client/objects-CKk6cST_.mjs.map +1 -0
  98. package/dist/client/objects-DkDKVSmQ.mjs +8 -0
  99. package/dist/client/objects-DkDKVSmQ.mjs.map +1 -0
  100. package/dist/client/objects-r_Vl31oj.mjs +80 -0
  101. package/dist/client/objects-r_Vl31oj.mjs.map +1 -0
  102. package/dist/client/overview-B7pXx6bt.mjs +173 -0
  103. package/dist/client/overview-B7pXx6bt.mjs.map +1 -0
  104. package/dist/client/overview-CKGLIu6W.mjs +12 -0
  105. package/dist/client/overview-CKGLIu6W.mjs.map +1 -0
  106. package/dist/client/overview-Ca8r3SAz.mjs +16 -0
  107. package/dist/client/overview-Ca8r3SAz.mjs.map +1 -0
  108. package/dist/client/overview-DkPM0Od5.mjs +12 -0
  109. package/dist/client/overview-DkPM0Od5.mjs.map +1 -0
  110. package/dist/client/overview-Dxm7Ef3X.mjs +12 -0
  111. package/dist/client/overview-Dxm7Ef3X.mjs.map +1 -0
  112. package/dist/client/overview-ag4Envez.mjs +16 -0
  113. package/dist/client/overview-ag4Envez.mjs.map +1 -0
  114. package/dist/client/pca-BGv7Mprl.mjs +12 -0
  115. package/dist/client/pca-BGv7Mprl.mjs.map +1 -0
  116. package/dist/client/pca-DpULpMu5.mjs +167 -0
  117. package/dist/client/pca-DpULpMu5.mjs.map +1 -0
  118. package/dist/client/projects-BuN69cxO.mjs +144 -0
  119. package/dist/client/projects-BuN69cxO.mjs.map +1 -0
  120. package/dist/client/projects-D1pP0XdA.mjs +12 -0
  121. package/dist/client/projects-D1pP0XdA.mjs.map +1 -0
  122. package/dist/client/projects-MbS1USl2.mjs +7 -0
  123. package/dist/client/projects-MbS1USl2.mjs.map +1 -0
  124. package/dist/client/projects-_Dfn6eQT.mjs +22 -0
  125. package/dist/client/projects-_Dfn6eQT.mjs.map +1 -0
  126. package/dist/client/securitygroups-DURjFfYK.mjs +12 -0
  127. package/dist/client/securitygroups-DURjFfYK.mjs.map +1 -0
  128. package/dist/client/securitygroups-KC2qvmH8.mjs +442 -0
  129. package/dist/client/securitygroups-KC2qvmH8.mjs.map +1 -0
  130. package/dist/client/trpcClient-BxguzNYF.mjs +57 -0
  131. package/dist/client/trpcClient-BxguzNYF.mjs.map +1 -0
  132. package/dist/client/useErrorTranslation-TZVwIAzq.mjs +83 -0
  133. package/dist/client/useErrorTranslation-TZVwIAzq.mjs.map +1 -0
  134. package/dist/client/useListWithFiltering-mMX_EfyI.mjs +32 -0
  135. package/dist/client/useListWithFiltering-mMX_EfyI.mjs.map +1 -0
  136. package/dist/client/useModal-Dg4CBeqL.mjs +12 -0
  137. package/dist/client/useModal-Dg4CBeqL.mjs.map +1 -0
  138. package/dist/client/useProjectId-BWaeJZOy.mjs +11 -0
  139. package/dist/client/useProjectId-BWaeJZOy.mjs.map +1 -0
  140. package/dist/server/index.d.ts +35 -0
  141. package/dist/server/index.js +36514 -0
  142. package/package.json +129 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2024 SAP SE or an SAP affiliate company and cobaltcore-dev contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,141 @@
1
+ # @cobaltcore-dev/aurora
2
+
3
+ An OpenStack dashboard library. Provides a ready-made Fastify server and a React UI component that you wire up in your own app.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @cobaltcore-dev/aurora
9
+ ```
10
+
11
+ **Peer dependencies** you must also install:
12
+
13
+ ```bash
14
+ npm install react react-dom fastify
15
+ ```
16
+
17
+ ## Quick start
18
+
19
+ Aurora has two entry points: `server` and `client`.
20
+
21
+ ### Server (`src/server/server.ts`)
22
+
23
+ ```ts
24
+ import path from "path"
25
+ import { createServer } from "@cobaltcore-dev/aurora/server"
26
+
27
+ createServer({
28
+ viteRoot: path.resolve(__dirname, "../.."), // root of your app (where dist/client lives)
29
+ identityEndpoint: process.env.IDENTITY_ENDPOINT, // OpenStack Keystone URL
30
+ bffEndpoint: process.env.BFF_ENDPOINT, // tRPC prefix, default "/polaris-bff"
31
+ defaultEndpointInterface: process.env.DEFAULT_ENDPOINT_INTERFACE, // "public" | "internal"
32
+ proxyUrl: process.env.GLOBAL_AGENT_HTTP_PROXY, // optional HTTP proxy (dev only)
33
+ cephRegion: process.env.CEPH_REGION, // Ceph/S3 region for object storage
34
+ imageMetadataExcludedProperties: process.env.IMAGE_METADATA_EXCLUDED_PROPERTIES, // comma-separated
35
+ insecureCookies: process.env.INSECURE_COOKIES === "true", // disable Secure flag locally
36
+ }).then((server) => server.listen({ host: "0.0.0.0", port: 4000 }))
37
+ ```
38
+
39
+ ### Client (`src/client/App.tsx`)
40
+
41
+ ```tsx
42
+ import { AuroraApp } from "@cobaltcore-dev/aurora/client"
43
+ import "@cobaltcore-dev/aurora/client/style.css" // include once at your app root
44
+
45
+ export function App() {
46
+ return (
47
+ <AuroraApp
48
+ bffEndpoint="/polaris-bff" // must match the server's bffEndpoint
49
+ theme="theme-light" // "theme-light" | "theme-dark"
50
+ onThemeChange={(theme) => {
51
+ // called when user toggles — persist however you like
52
+ localStorage.setItem("theme", theme)
53
+ }}
54
+ />
55
+ )
56
+ }
57
+ ```
58
+
59
+ ## Configuration reference
60
+
61
+ ### `createServer(config)`
62
+
63
+ | Option | Type | Default | Description |
64
+ | --------------------------------- | --------- | -------------------------- | ---------------------------------------------------------------- |
65
+ | `identityEndpoint` | `string` | — | OpenStack Keystone v3 URL (required) |
66
+ | `bffEndpoint` | `string` | `"/polaris-bff"` | URL prefix for all tRPC routes |
67
+ | `viteRoot` | `string` | `__dirname/../../` | Directory that contains `dist/client/` in production |
68
+ | `defaultEndpointInterface` | `string` | `"public"` | OpenStack service catalog interface |
69
+ | `proxyUrl` | `string` | — | HTTP proxy for OpenStack calls (dev only, ignored in production) |
70
+ | `cephRegion` | `string` | — | Ceph RGW region for S3 operations |
71
+ | `imageMetadataExcludedProperties` | `string` | — | Comma-separated image metadata keys to hide in the UI |
72
+ | `cookieName` | `string` | `"dashboard-session-auth"` | Override the session cookie name |
73
+ | `crossDomainCookie` | `boolean` | `true` | Share cookie across subdomains |
74
+ | `insecureCookies` | `boolean` | `false` | Disable `Secure` flag — only for HTTP-only local dev |
75
+
76
+ ### `<AuroraApp />`
77
+
78
+ | Prop | Type | Default | Description |
79
+ | --------------- | ------------------------------- | ---------------- | -------------------------------------- |
80
+ | `bffEndpoint` | `string` | `"/polaris-bff"` | Must match the server's `bffEndpoint` |
81
+ | `theme` | `"theme-light" \| "theme-dark"` | `"theme-light"` | Initial theme |
82
+ | `onThemeChange` | `(theme) => void` | — | Called when the user toggles the theme |
83
+
84
+ ## Environment variables
85
+
86
+ Your app reads these from `.env` and passes them to `createServer()`. Aurora itself never reads environment variables.
87
+
88
+ ```env
89
+ IDENTITY_ENDPOINT="https://keystone.example.com/v3/"
90
+ DEFAULT_ENDPOINT_INTERFACE="public"
91
+ BFF_ENDPOINT="/polaris-bff"
92
+ PORT="4000"
93
+
94
+ # Object storage (optional)
95
+ CEPH_REGION="ceph-objectstore-st1-region-1"
96
+
97
+ # Local dev only
98
+ INSECURE_COOKIES=true
99
+ # GLOBAL_AGENT_HTTP_PROXY=http://localhost:8888
100
+ ```
101
+
102
+ The `VITE_BFF_ENDPOINT` variable (prefixed with `VITE_`) is read by Vite and passed to the client:
103
+
104
+ ```env
105
+ VITE_BFF_ENDPOINT="/polaris-bff"
106
+ ```
107
+
108
+ ```tsx
109
+ <AuroraApp bffEndpoint={import.meta.env.VITE_BFF_ENDPOINT} />
110
+ ```
111
+
112
+ ## Vite config
113
+
114
+ In development, point Vite at your own server plugin. In production no extra plugins are needed — aurora ships pre-built CSS and assets.
115
+
116
+ ```js
117
+ // vite.config.mjs
118
+ import { defineConfig } from "vite"
119
+ import react from "@vitejs/plugin-react-swc"
120
+ import viteFastify from "@fastify/vite/plugin"
121
+
122
+ export default defineConfig(({ mode }) => ({
123
+ root: "./src/client",
124
+ build: { outDir: "../../dist/client" },
125
+ plugins: [mode !== "production" && viteFastify(), react()],
126
+ }))
127
+ ```
128
+
129
+ ## Running the app
130
+
131
+ ```bash
132
+ # Development (hot-reload)
133
+ tsx watch --env-file=.env src/server/server.ts
134
+
135
+ # Production
136
+ NODE_ENV=production tsx --env-file=.env src/server/server.ts
137
+ ```
138
+
139
+ ## License
140
+
141
+ Apache-2.0
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ export type AuroraAppProps = {
3
+ theme?: "theme-dark" | "theme-light";
4
+ bffEndpoint?: string;
5
+ onThemeChange?: (theme: "theme-dark" | "theme-light") => void;
6
+ };
7
+ export declare const AuroraApp: FC<AuroraAppProps>;
@@ -0,0 +1,100 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import t, { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
3
+ import { useRouter as o } from "@tanstack/react-router";
4
+ //#region src/client/store/AuthProvider.tsx
5
+ var s = /* @__PURE__ */ t.createContext(null), c = 3600 * 1e3;
6
+ function l({ children: l }) {
7
+ let u = o(), [d, f] = t.useState(null), [p, m] = t.useState(void 0), [h, g] = t.useState(void 0), [_, v] = a(!1), [y, b] = a(void 0), x = i(null), S = i(null), C = !!d, w = n(() => {
8
+ x.current &&= (clearTimeout(x.current), null);
9
+ }, []), T = n(() => {
10
+ S.current &&= (clearTimeout(S.current), null);
11
+ }, []), E = n(() => {
12
+ v(!1), u.navigate({
13
+ to: "/",
14
+ search: y ? { redirect: y } : void 0
15
+ });
16
+ }, [y]), D = n(async (e = "manual") => {
17
+ if (w(), T(), f(null), m(void 0), g(e), e === "inactive" || e === "expired") {
18
+ let e = window.location.pathname + window.location.search;
19
+ e && e.startsWith("/") && b(e), v(!0);
20
+ } else u.invalidate();
21
+ }, [w, T]), O = n(() => {
22
+ C && (T(), S.current = setTimeout(() => {
23
+ D("inactive");
24
+ }, c));
25
+ }, [
26
+ C,
27
+ T,
28
+ D
29
+ ]), k = n(async (e, t) => {
30
+ f(e), g(void 0), v(!1), b(void 0), m(t ? new Date(t) : void 0), O();
31
+ }, [O]);
32
+ return r(() => {
33
+ if (w(), d && p) {
34
+ let e = p.getTime() - Date.now();
35
+ if (e <= 0) {
36
+ D("expired");
37
+ return;
38
+ }
39
+ x.current = setTimeout(() => {
40
+ D("expired");
41
+ }, e);
42
+ }
43
+ return () => {
44
+ w();
45
+ };
46
+ }, [
47
+ d,
48
+ p,
49
+ D,
50
+ w
51
+ ]), r(() => {
52
+ if (!C) {
53
+ T();
54
+ return;
55
+ }
56
+ let e = [
57
+ "mousedown",
58
+ "mousemove",
59
+ "keypress",
60
+ "scroll",
61
+ "touchstart",
62
+ "click"
63
+ ], t = () => {
64
+ O();
65
+ };
66
+ return O(), e.forEach((e) => {
67
+ document.addEventListener(e, t, !0);
68
+ }), () => {
69
+ T(), e.forEach((e) => {
70
+ document.removeEventListener(e, t, !0);
71
+ });
72
+ };
73
+ }, [
74
+ C,
75
+ O,
76
+ T
77
+ ]), /* @__PURE__ */ e(s.Provider, {
78
+ value: {
79
+ isAuthenticated: C,
80
+ user: d,
81
+ login: k,
82
+ logout: D,
83
+ expiresAt: p,
84
+ logoutReason: h,
85
+ showInactivityModal: _,
86
+ closeInactivityModal: E,
87
+ redirectAfterModal: y
88
+ },
89
+ children: l
90
+ });
91
+ }
92
+ function u() {
93
+ let e = t.useContext(s);
94
+ if (!e) throw Error("useAuth must be used within an AuthProvider");
95
+ return e;
96
+ }
97
+ //#endregion
98
+ export { u as n, l as t };
99
+
100
+ //# sourceMappingURL=AuthProvider-D-5Jpa6F.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthProvider-D-5Jpa6F.mjs","names":["React","useEffect","useRef","useCallback","useState","useRouter","AuthContext","createContext","INACTIVITY_TIMEOUT","AuthProvider","children","router","user","setUser","expiresAt","setExpiresAt","undefined","logoutReason","setLogoutReason","showInactivityModal","setShowInactivityModal","redirectAfterModal","setRedirectAfterModal","logoutTimerRef","inactivityTimerRef","isAuthenticated","clearLogoutTimer","current","clearTimeout","clearInactivityTimer","closeInactivityModal","navigate","to","search","redirect","logout","reason","currentPath","window","location","pathname","startsWith","invalidate","resetInactivityTimer","setTimeout","login","expires_at","expiration","Date","timeUntilExpiry","getTime","now","events","handleActivity","forEach","event","document","addEventListener","removeEventListener","Provider","value","useAuth","context","useContext","Error"],"sources":["../../src/client/store/AuthProvider.tsx"],"sourcesContent":["import React, { useEffect, useRef, useCallback, useState } from \"react\"\nimport { TokenData } from \"../../server/Authentication/types/models\"\nimport { useRouter } from \"@tanstack/react-router\"\n\nexport type User = TokenData[\"user\"] | null\n\nexport interface AuthContext {\n isAuthenticated: boolean\n login: (user: User, expires_at?: string) => Promise<void>\n logout: (reason?: \"inactive\" | \"expired\" | \"manual\") => Promise<void>\n user?: User\n expiresAt?: Date\n logoutReason?: \"inactive\" | \"expired\" | \"manual\"\n showInactivityModal: boolean\n closeInactivityModal: () => void\n redirectAfterModal?: string\n}\n\nconst AuthContext = React.createContext<AuthContext | null>(null)\n\nconst INACTIVITY_TIMEOUT = 60 * 60 * 1000 // 60 minutes\n\nexport function AuthProvider({ children }: { children: React.ReactNode }) {\n const router = useRouter()\n const [user, setUser] = React.useState<User | null>(null)\n const [expiresAt, setExpiresAt] = React.useState<Date | undefined>(undefined)\n const [logoutReason, setLogoutReason] = React.useState<\"inactive\" | \"expired\" | \"manual\" | undefined>(undefined)\n const [showInactivityModal, setShowInactivityModal] = useState(false)\n const [redirectAfterModal, setRedirectAfterModal] = useState<string | undefined>(undefined)\n\n const logoutTimerRef = useRef<NodeJS.Timeout | null>(null)\n const inactivityTimerRef = useRef<NodeJS.Timeout | null>(null)\n\n const isAuthenticated = !!user\n\n const clearLogoutTimer = useCallback(() => {\n if (logoutTimerRef.current) {\n clearTimeout(logoutTimerRef.current)\n logoutTimerRef.current = null\n }\n }, [])\n\n const clearInactivityTimer = useCallback(() => {\n if (inactivityTimerRef.current) {\n clearTimeout(inactivityTimerRef.current)\n inactivityTimerRef.current = null\n }\n }, [])\n\n const closeInactivityModal = useCallback(() => {\n setShowInactivityModal(false)\n\n router.navigate({\n to: \"/\",\n search: redirectAfterModal ? { redirect: redirectAfterModal } : undefined,\n })\n }, [redirectAfterModal])\n\n const logout = useCallback(\n async (reason: \"inactive\" | \"expired\" | \"manual\" = \"manual\") => {\n clearLogoutTimer()\n clearInactivityTimer()\n\n setUser(null)\n setExpiresAt(undefined)\n setLogoutReason(reason)\n\n // For inactive/expired: Show modal instead of direct navigation\n if (reason === \"inactive\" || reason === \"expired\") {\n const currentPath = window.location.pathname + window.location.search\n if (currentPath && currentPath.startsWith(\"/\")) {\n setRedirectAfterModal(currentPath)\n }\n\n setShowInactivityModal(true)\n } else {\n // Manual logout: direct navigation\n router.invalidate()\n }\n },\n [clearLogoutTimer, clearInactivityTimer]\n )\n\n const resetInactivityTimer = useCallback(() => {\n if (!isAuthenticated) return\n\n clearInactivityTimer()\n\n inactivityTimerRef.current = setTimeout(() => {\n logout(\"inactive\")\n }, INACTIVITY_TIMEOUT)\n }, [isAuthenticated, clearInactivityTimer, logout])\n\n const login = useCallback(\n async (user: User, expires_at?: string) => {\n setUser(user)\n setLogoutReason(undefined)\n setShowInactivityModal(false)\n setRedirectAfterModal(undefined)\n\n if (expires_at) {\n const expiration = new Date(expires_at)\n setExpiresAt(expiration)\n } else {\n setExpiresAt(undefined)\n }\n\n resetInactivityTimer()\n },\n [resetInactivityTimer]\n )\n\n useEffect(() => {\n clearLogoutTimer()\n\n if (user && expiresAt) {\n const timeUntilExpiry = expiresAt.getTime() - Date.now()\n\n if (timeUntilExpiry <= 0) {\n logout(\"expired\")\n return\n }\n\n logoutTimerRef.current = setTimeout(() => {\n logout(\"expired\")\n }, timeUntilExpiry)\n }\n\n return () => {\n clearLogoutTimer()\n }\n }, [user, expiresAt, logout, clearLogoutTimer])\n\n useEffect(() => {\n if (!isAuthenticated) {\n clearInactivityTimer()\n return\n }\n\n const events = [\"mousedown\", \"mousemove\", \"keypress\", \"scroll\", \"touchstart\", \"click\"]\n\n const handleActivity = () => {\n resetInactivityTimer()\n }\n\n resetInactivityTimer()\n\n events.forEach((event) => {\n document.addEventListener(event, handleActivity, true)\n })\n\n return () => {\n clearInactivityTimer()\n events.forEach((event) => {\n document.removeEventListener(event, handleActivity, true)\n })\n }\n }, [isAuthenticated, resetInactivityTimer, clearInactivityTimer])\n\n return (\n <AuthContext.Provider\n value={{\n isAuthenticated,\n user,\n login,\n logout,\n expiresAt,\n logoutReason,\n showInactivityModal,\n closeInactivityModal,\n redirectAfterModal,\n }}\n >\n {children}\n </AuthContext.Provider>\n )\n}\n\nexport function useAuth() {\n const context = React.useContext(AuthContext)\n if (!context) {\n throw new Error(\"useAuth must be used within an AuthProvider\")\n }\n return context\n}\n"],"mappings":";;;;AAkBA,IAAMM,IAAcN,kBAAMO,cAAkC,KAAA,EAEtDC,IAAqB,OAAU;AAErC,SAAgBC,EAAa,EAAEC,eAAyC;CACtE,IAAMC,IAASN,GAAAA,EACT,CAACO,GAAMC,KAAWb,EAAMI,SAAsB,KAAA,EAC9C,CAACU,GAAWC,KAAgBf,EAAMI,SAA2BY,KAAAA,EAAAA,EAC7D,CAACC,GAAcC,KAAmBlB,EAAMI,SAAwDY,KAAAA,EAAAA,EAChG,CAACG,GAAqBC,KAA0BhB,EAAS,GAAA,EACzD,CAACiB,GAAoBC,KAAyBlB,EAA6BY,KAAAA,EAAAA,EAE3EO,IAAiBrB,EAA8B,KAAA,EAC/CsB,IAAqBtB,EAA8B,KAAA,EAEnDuB,IAAkB,CAAC,CAACb,GAEpBc,IAAmBvB,QAAY;AACnC,EAEEoB,EAAeI,aADfC,aAAaL,EAAeI,QAAO,EACV;IAE1B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AAmB,GAAG;AACxBd,MAAO,UAAA;AACP;;AAGFZ,KAAeI,UAAUiB,iBAAW;AAClCT,MAAO,UAAA;MACNc,EAAAA;;AAGL,eAAO;AACLvB,MAAAA;;IAED;EAACd;EAAME;EAAWqB;EAAQT;EAAiB,CAAA,EAE9CzB,QAAU;AACR,MAAI,CAACwB,GAAiB;AACpBI,MAAAA;AACA;;EAGF,IAAMuB,IAAS;GAAC;GAAa;GAAa;GAAY;GAAU;GAAc;GAAQ,EAEhFC,UAAiB;AACrBV,MAAAA;;AASF,SANAA,GAAAA,EAEAS,EAAOE,SAASC,MAAAA;AACdC,YAASC,iBAAiBF,GAAOF,GAAgB,GAAA;IACnD,QAEO;AAELD,GADAvB,GAAAA,EACAuB,EAAOE,SAASC,MAAAA;AACdC,aAASE,oBAAoBH,GAAOF,GAAgB,GAAA;KACtD;;IAED;EAAC5B;EAAiBkB;EAAsBd;EAAqB,CAAA,EAG9D,kBAACvB,EAAYqD,UAAQ;EACnBC,OAAO;GACLnC;GACAb;GACAiC;GACAV;GACArB;GACAG;GACAE;GACAW;GACAT;GACF;EAECX;;;AAKP,SAAgBmD,IAAAA;CACd,IAAMC,IAAU9D,EAAM+D,WAAWzD,EAAAA;AACjC,KAAI,CAACwD,EACH,OAAUE,MAAM,8CAAA;AAElB,QAAOF"}
@@ -0,0 +1,81 @@
1
+ import { F as e, G as t, U as n, q as r, tt as i, u as a, w as o } from "./build-eu9eg0zF.mjs";
2
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
3
+ import { useState as l } from "react";
4
+ import { Trans as u, useLingui as d } from "@lingui/react";
5
+ //#region src/client/components/ClipboardText.tsx
6
+ var f = ({ text: t, tooltipContent: o, className: u, truncateAt: f, showTooltip: p = !0, ...m }) => {
7
+ let { i18n: h, _: g } = d(), [_, v] = l(!1), [y, b] = l(!1), x = `copyableTooltip inline-flex items-center ${u || ""}`, S = async (e) => {
8
+ e.preventDefault(), e.stopPropagation();
9
+ try {
10
+ await navigator.clipboard.writeText(t), v(!0), b(!1), setTimeout(() => v(!1), 2e3);
11
+ } catch (e) {
12
+ console.error("Failed to copy text:", e);
13
+ }
14
+ }, C = f && t.length > f ? `${t.slice(0, f)}...` : t, w = () => _ ? o || h._({ id: "u+VWhB" }) : h._({ id: "he3ygx" }), T = _ && p || y && p;
15
+ return /* @__PURE__ */ s("div", {
16
+ ...m,
17
+ className: x,
18
+ children: /* @__PURE__ */ c(i, {
19
+ open: T,
20
+ children: [/* @__PURE__ */ s(n, {
21
+ onClick: S,
22
+ onMouseEnter: () => !_ && b(!0),
23
+ onMouseLeave: () => b(!1),
24
+ "aria-label": h._({
25
+ id: "Wbg1jv",
26
+ values: { text: t }
27
+ }),
28
+ className: "cursor-pointer",
29
+ asChild: !0,
30
+ "data-testid": "clipboard-copy-trigger",
31
+ children: /* @__PURE__ */ s("div", {
32
+ className: "group",
33
+ children: /* @__PURE__ */ c(r, {
34
+ direction: "horizontal",
35
+ gap: "1",
36
+ className: "items-center hover:underline",
37
+ children: [/* @__PURE__ */ s("span", {
38
+ className: "select-none",
39
+ children: C
40
+ }), /* @__PURE__ */ s(a, {
41
+ icon: _ ? "check" : "contentCopy",
42
+ size: "18"
43
+ })]
44
+ })
45
+ })
46
+ }), /* @__PURE__ */ s(e, { children: w() })]
47
+ })
48
+ });
49
+ };
50
+ //#endregion
51
+ //#region src/client/components/ContentHeader/ContentHeader.tsx
52
+ function p({ title: e, projectId: n, actions: r }) {
53
+ return /* @__PURE__ */ c("header", { children: [
54
+ /* @__PURE__ */ c("div", {
55
+ className: "flex flex-col sm:flex-row sm:items-center sm:justify-between",
56
+ children: [/* @__PURE__ */ s(o, { children: e }), /* @__PURE__ */ c("div", {
57
+ className: "text-theme-light flex items-center gap-1 text-sm",
58
+ children: [/* @__PURE__ */ c("span", {
59
+ className: "font-semibold",
60
+ children: [
61
+ /* @__PURE__ */ s(u, { id: "mSfwLL" }),
62
+ ":",
63
+ " "
64
+ ]
65
+ }), /* @__PURE__ */ s(f, {
66
+ text: n,
67
+ truncateAt: 15
68
+ })]
69
+ })]
70
+ }),
71
+ /* @__PURE__ */ s(t, { className: "mt-4" }),
72
+ r && /* @__PURE__ */ s("div", {
73
+ className: "mt-2 flex justify-end",
74
+ children: r
75
+ })
76
+ ] });
77
+ }
78
+ //#endregion
79
+ export { p as t };
80
+
81
+ //# sourceMappingURL=ContentHeader-H8KGY3Wd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentHeader-H8KGY3Wd.mjs","names":["React","useState","Tooltip","TooltipTrigger","TooltipContent","Icon","Stack","ClipboardText","text","tooltipContent","className","truncateAt","showTooltip","props","useLingui","copied","setCopied","isHovering","setIsHovering","combinedClassName","handleCopy","e","preventDefault","stopPropagation","navigator","clipboard","writeText","setTimeout","err","console","error","displayText","length","slice","getTooltipContent","t","tooltipIsOpen","div","open","onClick","onMouseEnter","onMouseLeave","aria-label","asChild","data-testid","direction","gap","span","icon","size","Divider","ContentHeading","ClipboardText","ContentHeader","title","projectId","actions","header","div","className","span","text","truncateAt"],"sources":["../../src/client/components/ClipboardText.tsx","../../src/client/components/ContentHeader/ContentHeader.tsx"],"sourcesContent":["import React, { useState } from \"react\"\nimport { Tooltip, TooltipTrigger, TooltipContent, Icon, Stack } from \"@cloudoperators/juno-ui-components\"\nimport { useLingui } from \"@lingui/react/macro\"\n\nexport interface ClipboardTextProps extends React.HTMLAttributes<HTMLDivElement> {\n tooltipContent?: string\n text: string\n className?: string\n truncateAt?: number\n showTooltip?: boolean\n}\n\nconst ClipboardText: React.FC<ClipboardTextProps> = ({\n text,\n tooltipContent,\n className,\n truncateAt,\n showTooltip = true,\n ...props\n}) => {\n const { t } = useLingui()\n const [copied, setCopied] = useState(false)\n const [isHovering, setIsHovering] = useState(false)\n\n const combinedClassName = `copyableTooltip inline-flex items-center ${className || \"\"}`\n\n const handleCopy = async (e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n\n try {\n await navigator.clipboard.writeText(text)\n setCopied(true)\n setIsHovering(false)\n setTimeout(() => setCopied(false), 2000)\n } catch (err) {\n console.error(\"Failed to copy text:\", err)\n }\n }\n\n const displayText = truncateAt && text.length > truncateAt ? `${text.slice(0, truncateAt)}...` : text\n\n // Determine tooltip content based on state\n const getTooltipContent = () => {\n if (copied) {\n return tooltipContent || t`Copied to clipboard!`\n }\n return t`Copy`\n }\n\n const tooltipIsOpen = (copied && showTooltip) || (isHovering && showTooltip)\n\n return (\n <div {...props} className={combinedClassName}>\n <Tooltip open={tooltipIsOpen}>\n <TooltipTrigger\n onClick={handleCopy}\n onMouseEnter={() => !copied && setIsHovering(true)}\n onMouseLeave={() => setIsHovering(false)}\n aria-label={t`Copy ${text} to clipboard`}\n className=\"cursor-pointer\"\n asChild\n data-testid=\"clipboard-copy-trigger\"\n >\n <div className=\"group\">\n <Stack direction=\"horizontal\" gap=\"1\" className=\"items-center hover:underline\">\n <span className=\"select-none\">{displayText}</span>\n <Icon icon={copied ? \"check\" : \"contentCopy\"} size=\"18\" />\n </Stack>\n </div>\n </TooltipTrigger>\n <TooltipContent>{getTooltipContent()}</TooltipContent>\n </Tooltip>\n </div>\n )\n}\n\nexport default ClipboardText\n","import type { ReactNode } from \"react\"\nimport { Divider, ContentHeading } from \"@cloudoperators/juno-ui-components\"\nimport { Trans } from \"@lingui/react/macro\"\nimport ClipboardText from \"../ClipboardText\"\n\ninterface ContentHeaderProps {\n title: string\n projectId: string\n actions?: ReactNode\n}\n\nexport function ContentHeader({ title, projectId, actions }: ContentHeaderProps) {\n return (\n <header>\n <div className=\"flex flex-col sm:flex-row sm:items-center sm:justify-between\">\n <ContentHeading>{title}</ContentHeading>\n <div className=\"text-theme-light flex items-center gap-1 text-sm\">\n <span className=\"font-semibold\">\n <Trans>Project ID</Trans>:{\" \"}\n </span>\n <ClipboardText text={projectId} truncateAt={15} />\n </div>\n </div>\n <Divider className=\"mt-4\" />\n {actions && <div className=\"mt-2 flex justify-end\">{actions}</div>}\n </header>\n )\n}\n"],"mappings":";;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