@cobaltcore-dev/aurora 0.23.1 → 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.
- package/dist/client/App.d.ts +1 -1
- package/dist/client/{AuthProvider-CQ6Yppoh.mjs → AuthProvider-5TyZKZkx.mjs} +3 -3
- package/dist/client/AuthProvider-5TyZKZkx.mjs.map +1 -0
- package/dist/client/{ContentHeader-9KZdhOoA.mjs → ContentHeader-D64NtKvo.mjs} +26 -25
- package/dist/client/ContentHeader-D64NtKvo.mjs.map +1 -0
- package/dist/client/DeleteFlavorModal-C2K43ABZ.mjs +732 -0
- package/dist/client/DeleteFlavorModal-C2K43ABZ.mjs.map +1 -0
- package/dist/client/DeletePcaModal-D9v8E0Ki.mjs +92 -0
- package/dist/client/DeletePcaModal-D9v8E0Ki.mjs.map +1 -0
- package/dist/client/DetailsInfo-h7rPJ4Jf.mjs +61 -0
- package/dist/client/DetailsInfo-h7rPJ4Jf.mjs.map +1 -0
- package/dist/client/FiltersInput-Bw8TFfwb.mjs +82 -0
- package/dist/client/FiltersInput-Bw8TFfwb.mjs.map +1 -0
- package/dist/client/{FloatingIpActionModals-BcceUHcg.mjs → FloatingIpActionModals-BfEDfYg9.mjs} +66 -66
- package/dist/client/{FloatingIpActionModals-BcceUHcg.mjs.map → FloatingIpActionModals-BfEDfYg9.mjs.map} +1 -1
- package/dist/client/ImageToastNotifications-C0Tluzq-.mjs +1125 -0
- package/dist/client/ImageToastNotifications-C0Tluzq-.mjs.map +1 -0
- package/dist/client/{RouteError-Rm08PcxN.mjs → RouteError-B-NPGIv7.mjs} +2 -2
- package/dist/client/{RouteError-Rm08PcxN.mjs.map → RouteError-B-NPGIv7.mjs.map} +1 -1
- package/dist/client/Slot-CWb612-_.mjs.map +1 -1
- package/dist/client/{SortInput-D_q_jDfe.mjs → SortInput-DysAXpB3.mjs} +6 -6
- package/dist/client/{SortInput-D_q_jDfe.mjs.map → SortInput-DysAXpB3.mjs.map} +1 -1
- package/dist/client/{StatusError-2ZU1gFpu.mjs → StatusError-DX-GvLjq.mjs} +8 -8
- package/dist/client/{StatusError-2ZU1gFpu.mjs.map → StatusError-DX-GvLjq.mjs.map} +1 -1
- package/dist/client/TwoColumnDescriptionList-B3xunXmz.mjs +22 -0
- package/dist/client/TwoColumnDescriptionList-B3xunXmz.mjs.map +1 -0
- package/dist/client/{_auth-D5_QNUos.mjs → _auth-R5H2yKFf.mjs} +2 -2
- package/dist/client/_auth-R5H2yKFf.mjs.map +1 -0
- package/dist/client/_flavorId-Dit5mM8I.mjs +210 -0
- package/dist/client/_flavorId-Dit5mM8I.mjs.map +1 -0
- package/dist/client/{_flavorId-CFmkmg2Y.mjs → _flavorId-Zj7LNL-R.mjs} +4 -4
- package/dist/client/{_flavorId-CFmkmg2Y.mjs.map → _flavorId-Zj7LNL-R.mjs.map} +1 -1
- package/dist/client/_floatingIpId-B0MCoqE3.mjs +215 -0
- package/dist/client/_floatingIpId-B0MCoqE3.mjs.map +1 -0
- package/dist/client/{_floatingIpId-Dzh6_JCI.mjs → _floatingIpId-DCQQpNO-.mjs} +4 -4
- package/dist/client/{_floatingIpId-Dzh6_JCI.mjs.map → _floatingIpId-DCQQpNO-.mjs.map} +1 -1
- package/dist/client/_imageId-CZYzBAVx.mjs +558 -0
- package/dist/client/_imageId-CZYzBAVx.mjs.map +1 -0
- package/dist/client/_pcaId-CHRRsWmO.mjs +605 -0
- package/dist/client/_pcaId-CHRRsWmO.mjs.map +1 -0
- package/dist/client/{_projectId-DNZsNxJw.mjs → _projectId-B8wWSxPu.mjs} +9 -9
- package/dist/client/_projectId-B8wWSxPu.mjs.map +1 -0
- package/dist/client/{_projectId-BuBIFdgG.mjs → _projectId-C5DUYIjt.mjs} +117 -117
- package/dist/client/{_projectId-BuBIFdgG.mjs.map → _projectId-C5DUYIjt.mjs.map} +1 -1
- package/dist/client/{_projectId-CAQkJHZ4.mjs → _projectId-D2pFfYIs.mjs} +3 -3
- package/dist/client/{_projectId-CAQkJHZ4.mjs.map → _projectId-D2pFfYIs.mjs.map} +1 -1
- package/dist/client/{_projectId-D-b7paXE.mjs → _projectId-DhSWowQo.mjs} +4 -4
- package/dist/client/{_projectId-D-b7paXE.mjs.map → _projectId-DhSWowQo.mjs.map} +1 -1
- package/dist/client/{_securityGroupId-DFdNKa2l.mjs → _securityGroupId-DZ4D4WwB.mjs} +635 -617
- package/dist/client/_securityGroupId-DZ4D4WwB.mjs.map +1 -0
- package/dist/client/{_securityGroupId-DRkY3Gt6.mjs → _securityGroupId-Mj8NJT2-.mjs} +4 -4
- package/dist/client/{_securityGroupId-DRkY3Gt6.mjs.map → _securityGroupId-Mj8NJT2-.mjs.map} +1 -1
- package/dist/client/_storageType-C-9bNkmZ.mjs +2211 -0
- package/dist/client/_storageType-C-9bNkmZ.mjs.map +1 -0
- package/dist/client/_storageType-zeSZe--V.mjs.map +1 -1
- package/dist/client/{about-C8tTrQaW.mjs → about-WLyShNgE.mjs} +8 -8
- package/dist/client/about-WLyShNgE.mjs.map +1 -0
- package/dist/client/assets/objectDownload.worker-BXFQIIU_.js.map +1 -0
- package/dist/client/assets/objectDownload.worker-ECvFtmOF.js.map +1 -0
- package/dist/client/{aurora-jyvXcI4T.mjs → aurora-IMO9HhqJ.mjs} +2 -2
- package/dist/client/aurora-IMO9HhqJ.mjs.map +1 -0
- package/dist/client/{build-CRLQyqu2.mjs → build-DnD-T35u.mjs} +8180 -8212
- package/dist/client/build-DnD-T35u.mjs.map +1 -0
- package/dist/client/components/Auth/LoginForm.d.ts +1 -1
- package/dist/client/components/Auth/SessionExpirationTimer.d.ts +1 -1
- package/dist/client/components/ContentHeader/ContentHeader.d.ts +1 -1
- package/dist/client/components/Error/RouteError.d.ts +1 -1
- package/dist/client/components/Error/StatusError.d.ts +1 -1
- package/dist/client/components/JsonEditor.d.ts +1 -1
- package/dist/client/components/ListToolbar/FiltersInput.d.ts +3 -1
- package/dist/client/components/ListToolbar/SelectedFilters.d.ts +1 -1
- package/dist/client/components/ListToolbar/index.d.ts +1 -1
- package/dist/client/components/ProjectView/ProjectInfoBox.d.ts +1 -1
- package/dist/client/components/Slot.d.ts +1 -1
- package/dist/client/components/TwoColumnDescriptionList.d.ts +11 -0
- package/dist/client/components/navigation/LanguageSelect.d.ts +1 -1
- package/dist/client/components/navigation/MainNavigation.d.ts +1 -1
- package/dist/client/components/navigation/UserMenu.d.ts +1 -1
- package/dist/client/{flavors-Dy-2mRGv.mjs → flavors-Cp0LEGOH.mjs} +2 -2
- package/dist/client/{flavors-Dy-2mRGv.mjs.map → flavors-Cp0LEGOH.mjs.map} +1 -1
- package/dist/client/{flavors-BfTXqmoD.mjs → flavors-CwMbDRHm2.mjs} +203 -201
- package/dist/client/flavors-CwMbDRHm2.mjs.map +1 -0
- package/dist/client/flavors-DWMZ6TuJ.mjs.map +1 -1
- package/dist/client/floatingips-ICwo-rV_.mjs +591 -0
- package/dist/client/floatingips-ICwo-rV_.mjs.map +1 -0
- package/dist/client/formatBytes-CZv_XyCY.mjs.map +1 -1
- package/dist/client/helpers-1PpYf-fC.mjs.map +1 -1
- package/dist/client/hooks/useAvailableViewportHeight.d.ts +8 -5
- package/dist/client/hooks/useVirtualizedTableBody.d.ts +1 -3
- package/dist/client/{hooks-Bw3sHHOg.mjs → hooks-CrriowRk.mjs} +2 -2
- package/dist/client/{hooks-Bw3sHHOg.mjs.map → hooks-CrriowRk.mjs.map} +1 -1
- package/dist/client/images-DOGZmr3D.mjs +1937 -0
- package/dist/client/images-DOGZmr3D.mjs.map +1 -0
- package/dist/client/{images-DPKUXryV.mjs → images-DWiM_72I.mjs} +2 -2
- package/dist/client/{images-DPKUXryV.mjs.map → images-DWiM_72I.mjs.map} +1 -1
- package/dist/client/images-NBf2bV43.mjs.map +1 -1
- package/dist/client/index.js +601 -445
- package/dist/client/index.js.map +1 -1
- package/dist/client/{md-CyCflQee.mjs → md-DNzcRhmz.mjs} +6 -60
- package/dist/client/{md-CyCflQee.mjs.map → md-DNzcRhmz.mjs.map} +1 -1
- package/dist/client/network-DuZm76BZ.mjs.map +1 -1
- package/dist/client/objects-D2MKUCxc.mjs +56 -0
- package/dist/client/objects-D2MKUCxc.mjs.map +1 -0
- package/dist/client/objects-DI1-tnKr.mjs +56 -0
- package/dist/client/objects-DI1-tnKr.mjs.map +1 -0
- package/dist/client/objects-DeK2WD5K.mjs +10078 -0
- package/dist/client/objects-DeK2WD5K.mjs.map +1 -0
- package/dist/client/pca-BokFv4Gz.mjs +239 -0
- package/dist/client/pca-BokFv4Gz.mjs.map +1 -0
- package/dist/client/{pca-D0kKxHp4.mjs → pca-D5jHAl0b.mjs} +4 -3
- package/dist/client/{pca-D0kKxHp4.mjs.map → pca-D5jHAl0b.mjs.map} +1 -1
- package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
- package/dist/client/routeInfo-CdTRlSxv.mjs.map +1 -1
- package/dist/client/{routes-CtfnI-aY.mjs → routes-B05u5bk4.mjs} +2 -2
- package/dist/client/{routes-CtfnI-aY.mjs.map → routes-B05u5bk4.mjs.map} +1 -1
- package/dist/client/{routes-BOf-GDMM.mjs → routes-DOJr5onJ.mjs} +31 -28
- package/dist/client/routes-DOJr5onJ.mjs.map +1 -0
- package/dist/client/{securitygroups-DRhFle2O.mjs → securitygroups-Be2Qgmew.mjs} +201 -195
- package/dist/client/securitygroups-Be2Qgmew.mjs.map +1 -0
- package/dist/client/{securitygroups-B8aLyFK7.mjs → securitygroups-_7SYN2jN.mjs} +2 -2
- package/dist/client/{securitygroups-B8aLyFK7.mjs.map → securitygroups-_7SYN2jN.mjs.map} +1 -1
- package/dist/client/store/AuthProvider.d.ts +1 -1
- package/dist/client/{trpcClient-Di56hpVv.mjs → trpcClient-D7gpR7YG.mjs} +2 -2
- package/dist/client/{trpcClient-Di56hpVv.mjs.map → trpcClient-D7gpR7YG.mjs.map} +1 -1
- package/dist/client/trpcClient.d.ts +125 -11
- package/dist/client/useModal-DCs1OJh7.mjs.map +1 -1
- package/dist/client/{useSecurityGroupPermissions-BPS1ibWq.mjs → useSecurityGroupPermissions-qPwm4mFt.mjs} +15 -15
- package/dist/client/{useSecurityGroupPermissions-BPS1ibWq.mjs.map → useSecurityGroupPermissions-qPwm4mFt.mjs.map} +1 -1
- package/dist/server/index.d.ts +125 -11
- package/dist/server/index.js +4142 -2845
- package/package.json +7 -7
- package/dist/client/AuthProvider-CQ6Yppoh.mjs.map +0 -1
- package/dist/client/BucketToastNotifications-Dq4dudkM.mjs +0 -665
- package/dist/client/BucketToastNotifications-Dq4dudkM.mjs.map +0 -1
- package/dist/client/ContentHeader-9KZdhOoA.mjs.map +0 -1
- package/dist/client/DeleteFlavorModal-Be2qZo4w.mjs +0 -713
- package/dist/client/DeleteFlavorModal-Be2qZo4w.mjs.map +0 -1
- package/dist/client/DeletePcaModal-CIFsGWyj.mjs +0 -80
- package/dist/client/DeletePcaModal-CIFsGWyj.mjs.map +0 -1
- package/dist/client/DetailsInfo-CHVD7d-W.mjs +0 -52
- package/dist/client/DetailsInfo-CHVD7d-W.mjs.map +0 -1
- package/dist/client/FiltersInput-DqT08Ib-.mjs +0 -81
- package/dist/client/FiltersInput-DqT08Ib-.mjs.map +0 -1
- package/dist/client/ImageToastNotifications-BGyX2J6j.mjs +0 -1219
- package/dist/client/ImageToastNotifications-BGyX2J6j.mjs.map +0 -1
- package/dist/client/_auth-D5_QNUos.mjs.map +0 -1
- package/dist/client/_flavorId-BsmqS9hP.mjs +0 -194
- package/dist/client/_flavorId-BsmqS9hP.mjs.map +0 -1
- package/dist/client/_floatingIpId-Bb9ZEJ6b.mjs +0 -228
- package/dist/client/_floatingIpId-Bb9ZEJ6b.mjs.map +0 -1
- package/dist/client/_imageId-C3As7sHE.mjs +0 -534
- package/dist/client/_imageId-C3As7sHE.mjs.map +0 -1
- package/dist/client/_pcaId-n0q0aDb6.mjs +0 -545
- package/dist/client/_pcaId-n0q0aDb6.mjs.map +0 -1
- package/dist/client/_projectId-DNZsNxJw.mjs.map +0 -1
- package/dist/client/_securityGroupId-DFdNKa2l.mjs.map +0 -1
- package/dist/client/_storageType-Cn7TSOki.mjs +0 -81
- package/dist/client/_storageType-Cn7TSOki.mjs.map +0 -1
- package/dist/client/_storageType-_8Ambhxc.mjs +0 -2859
- package/dist/client/_storageType-_8Ambhxc.mjs.map +0 -1
- package/dist/client/about-C8tTrQaW.mjs.map +0 -1
- package/dist/client/assets/objectDownload.worker-BAc5Au4B.js.map +0 -1
- package/dist/client/aurora-jyvXcI4T.mjs.map +0 -1
- package/dist/client/build-CRLQyqu2.mjs.map +0 -1
- package/dist/client/flavors-BfTXqmoD.mjs.map +0 -1
- package/dist/client/floatingips-zhNK6Xxn.mjs +0 -562
- package/dist/client/floatingips-zhNK6Xxn.mjs.map +0 -1
- package/dist/client/images-DhZnqUG_.mjs +0 -1890
- package/dist/client/images-DhZnqUG_.mjs.map +0 -1
- package/dist/client/objects-B3mbk6V0.mjs +0 -6636
- package/dist/client/objects-B3mbk6V0.mjs.map +0 -1
- package/dist/client/objects-BQ8xvSW8.mjs +0 -103
- package/dist/client/objects-BQ8xvSW8.mjs.map +0 -1
- package/dist/client/objects-o2Cj_ndZ.mjs +0 -8
- package/dist/client/objects-o2Cj_ndZ.mjs.map +0 -1
- package/dist/client/pca-B60iWWfG.mjs +0 -251
- package/dist/client/pca-B60iWWfG.mjs.map +0 -1
- package/dist/client/routes-BOf-GDMM.mjs.map +0 -1
- package/dist/client/securitygroups-DRhFle2O.mjs.map +0 -1
- package/dist/client/useListWithFiltering-aPTUNRaW.mjs +0 -32
- package/dist/client/useListWithFiltering-aPTUNRaW.mjs.map +0 -1
package/dist/client/App.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ type AppProps = {
|
|
|
8
8
|
onTrackEvent?: OnTrackEventCallback;
|
|
9
9
|
enabledServices?: string[];
|
|
10
10
|
};
|
|
11
|
-
declare const App: (props: AppProps) => import("react
|
|
11
|
+
declare const App: (props: AppProps) => import("react").JSX.Element;
|
|
12
12
|
export default App;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e } from "./trpcClient-
|
|
1
|
+
import { i as e } from "./trpcClient-D7gpR7YG.mjs";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import n, { useEffect as r, useState as i } from "react";
|
|
4
4
|
//#region src/client/store/AuthProvider.tsx
|
|
@@ -7,7 +7,7 @@ function o({ children: n }) {
|
|
|
7
7
|
let [o, s] = i(null), [c, l] = i(!0), [u, d] = i(null), [f, p] = i(null), m = (e = !1) => {
|
|
8
8
|
if (window.location.pathname !== "/") {
|
|
9
9
|
let t = e ? `/?redirect=${encodeURIComponent(window.location.pathname + window.location.search)}` : "/";
|
|
10
|
-
window.location.
|
|
10
|
+
window.location.replace(t);
|
|
11
11
|
}
|
|
12
12
|
}, h = () => {
|
|
13
13
|
s(null), p(null);
|
|
@@ -66,4 +66,4 @@ function s() {
|
|
|
66
66
|
//#endregion
|
|
67
67
|
export { s as n, o as t };
|
|
68
68
|
|
|
69
|
-
//# sourceMappingURL=AuthProvider-
|
|
69
|
+
//# sourceMappingURL=AuthProvider-5TyZKZkx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthProvider-5TyZKZkx.mjs","names":["React","useEffect","useState","trpcClient","AuthContext","createContext","AuthProvider","children","user","setUser","isLoading","setIsLoading","error","setError","expiresAt","setExpiresAt","redirectToLogin","saveReturnUrl","window","location","pathname","returnUrl","encodeURIComponent","search","replace","clearLocalSession","auth","getCurrentUserSession","query","then","session","expires_at","catch","err","Error","message","finally","timeUntilExpiry","Date","getTime","now","handleExpiry","timer","setTimeout","clearTimeout","login","domain","password","createUserSession","mutate","domainName","success","logout","terminateUserSession","Provider","value","isAuthenticated","undefined","useAuth","context","useContext"],"sources":["../../src/client/store/AuthProvider.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\"\nimport { TokenData } from \"../../server/Authentication/types/models\"\nimport { trpcClient } from \"../trpcClient\"\n\nexport type User = TokenData[\"user\"] | null\n\nexport interface AuthContext {\n isAuthenticated: boolean\n isLoading: boolean\n error: string | null\n login: (credentials: { domain: string; user: string; password: string }) => Promise<{ success: boolean }>\n logout: () => Promise<void>\n user?: User\n expiresAt?: Date\n}\n\nconst AuthContext = React.createContext<AuthContext | null>(null)\n\nexport function AuthProvider({ children }: { children: React.ReactNode }) {\n const [user, setUser] = useState<User | null>(null)\n const [isLoading, setIsLoading] = useState(true)\n const [error, setError] = useState<string | null>(null)\n const [expiresAt, setExpiresAt] = useState<string | null>(null)\n\n // Redirect to login, optionally with return URL\n const redirectToLogin = (saveReturnUrl: boolean = false) => {\n if (window.location.pathname !== \"/\") {\n const returnUrl = saveReturnUrl\n ? `/?redirect=${encodeURIComponent(window.location.pathname + window.location.search)}`\n : \"/\"\n window.location.replace(returnUrl)\n }\n }\n\n // Clear local session state\n const clearLocalSession = () => {\n setUser(null)\n setExpiresAt(null)\n }\n\n // Get current session on mount\n useEffect(() => {\n trpcClient.auth.getCurrentUserSession\n .query()\n .then((session) => {\n if (session) {\n setUser(session.user)\n setExpiresAt(session.expires_at)\n }\n })\n .catch((err) => {\n setError(err instanceof Error ? err.message : \"Could not load session\")\n })\n .finally(() => setIsLoading(false))\n }, [])\n\n // Auto-logout when session expires\n useEffect(() => {\n if (!user || !expiresAt) return\n\n const timeUntilExpiry = new Date(expiresAt).getTime() - Date.now()\n\n const handleExpiry = () => {\n clearLocalSession()\n redirectToLogin(true)\n }\n\n if (timeUntilExpiry <= 0) {\n handleExpiry()\n return\n }\n\n const timer = setTimeout(handleExpiry, timeUntilExpiry)\n return () => clearTimeout(timer)\n }, [user, expiresAt])\n\n const login = async ({ domain, user, password }: { domain: string; user: string; password: string }) => {\n setError(null)\n setIsLoading(true)\n try {\n const session = await trpcClient.auth.createUserSession.mutate({ domainName: domain, user, password })\n setUser(session.user)\n setExpiresAt(session.expires_at)\n return { success: true }\n } catch (err) {\n setError(err instanceof Error ? err.message : `Could not create session: ${err}`)\n return { success: false }\n } finally {\n setIsLoading(false)\n }\n }\n\n const logout = async () => {\n setIsLoading(true)\n await trpcClient.auth.terminateUserSession.mutate().catch(() => {})\n clearLocalSession()\n redirectToLogin(false) // Don't save return URL on manual logout\n // If already on login page, no redirect happens - reset loading state\n if (window.location.pathname === \"/\") {\n setIsLoading(false)\n }\n }\n\n return (\n <AuthContext.Provider\n value={{\n user,\n isAuthenticated: !!user,\n isLoading,\n error,\n login,\n logout,\n expiresAt: expiresAt ? new Date(expiresAt) : undefined,\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":";;;;AAgBA,IAAMI,IAAcJ,gBAAMK,cAAkC,IAAA;AAE5D,SAAgBC,EAAa,EAAEC,eAAyC;CACtE,IAAM,CAACC,GAAMC,KAAWP,EAAsB,IAAA,GACxC,CAACQ,GAAWC,KAAgBT,EAAS,EAAA,GACrC,CAACU,GAAOC,KAAYX,EAAwB,IAAA,GAC5C,CAACY,GAAWC,KAAgBb,EAAwB,IAAA,GAGpDc,KAAmBC,IAAyB,OAAK;EACrD,IAAIC,OAAOC,SAASC,aAAa,KAAK;GACpC,IAAMC,IAAYJ,IACd,cAAcK,mBAAmBJ,OAAOC,SAASC,WAAWF,OAAOC,SAASI,MAAM,MAClF;GACJL,OAAOC,SAASK,QAAQH,CAAAA;EAC1B;CACF,GAGMI,UAAoB;EAExBV,AADAN,EAAQ,IAAA,GACRM,EAAa,IAAA;CACf;CAiEA,OA9DAd,QAAU;EACRE,EAAWuB,KAAKC,sBACbC,MAAK,CAAA,CACLC,MAAMC,MAAAA;GACL,AAAIA,MACFrB,EAAQqB,EAAQtB,IAAI,GACpBO,EAAae,EAAQC,UAAU;EAEnC,CAAA,CAAA,CACCC,OAAOC,MAAAA;GACNpB,EAASoB,aAAeC,QAAQD,EAAIE,UAAU,wBAAA;EAChD,CAAA,CAAA,CACCC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C;EAEClD;;AAGP;AAEA,SAAgBmD,IAAAA;CACd,IAAMC,IAAU3D,EAAM4D,WAAWxD,CAAAA;CACjC,IAAI,CAACuD,GACH,MAAUzB,MAAM,6CAAA;CAElB,OAAOyB;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V as e, X as t, Z as n, et as r, f as i, rt as a, v as o } from "./build-DnD-T35u.mjs";
|
|
2
2
|
import { t as s } from "./Slot-CWb612-_.mjs";
|
|
3
3
|
import { t as c } from "./routeInfo-CdTRlSxv.mjs";
|
|
4
4
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
@@ -6,53 +6,54 @@ import { useState as d } from "react";
|
|
|
6
6
|
import { useMatches as f, useParams as p, useRouteContext as m } from "@tanstack/react-router";
|
|
7
7
|
import { Trans as h, useLingui as g } from "@lingui/react";
|
|
8
8
|
//#region src/client/components/ClipboardText.tsx
|
|
9
|
-
var _ = ({ text:
|
|
10
|
-
let { i18n: m, _: h } = g(), [_, v] = d(!1), [y, b] = d(!1), x = `copyableTooltip inline-flex items-center ${s || ""}`, S = async (
|
|
11
|
-
|
|
9
|
+
var _ = ({ text: a, tooltipContent: o, className: s, truncateAt: c, showTooltip: f = !0, ...p }) => {
|
|
10
|
+
let { i18n: m, _: h } = g(), [_, v] = d(!1), [y, b] = d(!1), x = `copyableTooltip inline-flex items-center ${s || ""}`, S = async (e) => {
|
|
11
|
+
e.preventDefault(), e.stopPropagation();
|
|
12
12
|
try {
|
|
13
|
-
await navigator.clipboard.writeText(
|
|
13
|
+
await navigator.clipboard.writeText(a), v(!0), b(!1), setTimeout(() => v(!1), 2e3);
|
|
14
14
|
} catch (e) {
|
|
15
15
|
console.error("Failed to copy text:", e);
|
|
16
16
|
}
|
|
17
|
-
}, C = c &&
|
|
17
|
+
}, C = c && a.length > c ? `${a.slice(0, c)}...` : a, w = () => _ ? o || m._({ id: "u+VWhB" }) : m._({ id: "he3ygx" }), T = _ && f || y && f;
|
|
18
18
|
return /*#__PURE__*/ l("div", {
|
|
19
19
|
...p,
|
|
20
20
|
className: x,
|
|
21
|
-
children: /*#__PURE__*/ u(
|
|
21
|
+
children: /*#__PURE__*/ u(t, {
|
|
22
22
|
open: T,
|
|
23
|
-
children: [/*#__PURE__*/ l(
|
|
23
|
+
children: [/*#__PURE__*/ l(r, {
|
|
24
24
|
onClick: S,
|
|
25
25
|
onMouseEnter: () => !_ && b(!0),
|
|
26
26
|
onMouseLeave: () => b(!1),
|
|
27
27
|
"aria-label": m._({
|
|
28
28
|
id: "Wbg1jv",
|
|
29
|
-
values: { text:
|
|
29
|
+
values: { text: a }
|
|
30
30
|
}),
|
|
31
31
|
className: "cursor-pointer",
|
|
32
32
|
asChild: !0,
|
|
33
33
|
"data-testid": "clipboard-copy-trigger",
|
|
34
|
-
children: /*#__PURE__*/ l("
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
children: /*#__PURE__*/ l("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
className: "group border-none bg-transparent p-0 text-inherit",
|
|
37
|
+
children: /*#__PURE__*/ u(n, {
|
|
37
38
|
direction: "horizontal",
|
|
38
39
|
gap: "1",
|
|
39
40
|
className: "items-center hover:underline",
|
|
40
41
|
children: [/*#__PURE__*/ l("span", {
|
|
41
42
|
className: "select-none",
|
|
42
43
|
children: C
|
|
43
|
-
}), /*#__PURE__*/ l(
|
|
44
|
+
}), /*#__PURE__*/ l(i, {
|
|
44
45
|
icon: _ ? "check" : "contentCopy",
|
|
45
46
|
size: "18"
|
|
46
47
|
})]
|
|
47
48
|
})
|
|
48
49
|
})
|
|
49
|
-
}), /*#__PURE__*/ l(
|
|
50
|
+
}), /*#__PURE__*/ l(e, { children: w() })]
|
|
50
51
|
})
|
|
51
52
|
});
|
|
52
53
|
};
|
|
53
54
|
//#endregion
|
|
54
55
|
//#region src/client/components/ContentHeader/ContentHeader.tsx
|
|
55
|
-
function v({ title:
|
|
56
|
+
function v({ title: e, projectId: t, description: n, actions: r, badges: i }) {
|
|
56
57
|
let { slots: d } = m({ strict: !1 }), g = f(), { provider: v } = p({ strict: !1 }), y = [...g].reverse().find((e) => c(e.staticData)), b = y && c(y.staticData) ? y.staticData.service : void 0, x = b === "containers" && v === "ceph" ? "ceph-containers" : b, S = d?.servicePageActions && x ? /*#__PURE__*/ l(s, {
|
|
57
58
|
component: d.servicePageActions,
|
|
58
59
|
useShadowDOM: !1,
|
|
@@ -72,7 +73,7 @@ function v({ title: t, projectId: r, description: i, actions: a, badges: o }) {
|
|
|
72
73
|
className: "flex flex-col sm:flex-row sm:items-center sm:justify-between",
|
|
73
74
|
children: [/*#__PURE__*/ u("div", {
|
|
74
75
|
className: "flex items-center gap-3",
|
|
75
|
-
children: [/*#__PURE__*/ l(
|
|
76
|
+
children: [/*#__PURE__*/ l(a, { children: e }), S]
|
|
76
77
|
}), /*#__PURE__*/ u("div", {
|
|
77
78
|
className: "text-theme-light flex shrink-0 items-center gap-1 text-sm",
|
|
78
79
|
children: [/*#__PURE__*/ u("span", {
|
|
@@ -83,26 +84,26 @@ function v({ title: t, projectId: r, description: i, actions: a, badges: o }) {
|
|
|
83
84
|
" "
|
|
84
85
|
]
|
|
85
86
|
}), /*#__PURE__*/ l(_, {
|
|
86
|
-
text:
|
|
87
|
+
text: t,
|
|
87
88
|
truncateAt: 15
|
|
88
89
|
})]
|
|
89
90
|
})]
|
|
90
91
|
}),
|
|
91
|
-
|
|
92
|
+
n && /*#__PURE__*/ l("p", {
|
|
92
93
|
className: "text-sm font-normal",
|
|
93
|
-
children:
|
|
94
|
+
children: n
|
|
94
95
|
}),
|
|
95
96
|
C,
|
|
96
97
|
w,
|
|
97
|
-
/*#__PURE__*/ l(
|
|
98
|
-
(
|
|
98
|
+
/*#__PURE__*/ l(o, { className: "mt-4" }),
|
|
99
|
+
(i || r) && /*#__PURE__*/ u("div", {
|
|
99
100
|
className: "mt-3 flex items-start justify-between",
|
|
100
101
|
children: [/*#__PURE__*/ u("div", {
|
|
101
102
|
className: "flex items-center gap-2",
|
|
102
|
-
children: [
|
|
103
|
-
}),
|
|
103
|
+
children: [i, " "]
|
|
104
|
+
}), r && /*#__PURE__*/ l("div", {
|
|
104
105
|
className: "flex gap-2",
|
|
105
|
-
children:
|
|
106
|
+
children: r
|
|
106
107
|
})]
|
|
107
108
|
})
|
|
108
109
|
]
|
|
@@ -111,4 +112,4 @@ function v({ title: t, projectId: r, description: i, actions: a, badges: o }) {
|
|
|
111
112
|
//#endregion
|
|
112
113
|
export { _ as n, v as t };
|
|
113
114
|
|
|
114
|
-
//# sourceMappingURL=ContentHeader-
|
|
115
|
+
//# sourceMappingURL=ContentHeader-D64NtKvo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentHeader-D64NtKvo.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","button","type","direction","gap","span","icon","size","Divider","ContentHeading","useRouteContext","useMatches","useParams","ClipboardText","Slot","isRouteInfo","ContentHeader","title","projectId","description","actions","badges","slots","strict","matches","provider","activeMatch","reverse","find","m","staticData","routeService","service","undefined","currentService","slotActions","servicePageActions","component","useShadowDOM","serviceBanner","projectOverviewBanner","header","className","div","span","text","truncateAt","p"],"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 <button type=\"button\" className=\"group border-none bg-transparent p-0 text-inherit\">\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 </button>\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 { useRouteContext, useMatches, useParams } from \"@tanstack/react-router\"\nimport ClipboardText from \"../ClipboardText\"\nimport { Slot } from \"../Slot\"\nimport { isRouteInfo } from \"@/client/routes/routeInfo\"\n\ninterface ContentHeaderProps {\n title: string\n projectId: string\n description?: string | null\n actions?: ReactNode\n badges?: ReactNode\n}\n\nexport function ContentHeader({ title, projectId, description, actions, badges }: ContentHeaderProps) {\n const { slots } = useRouteContext({ strict: false })\n const matches = useMatches()\n const { provider } = useParams({ strict: false }) as { provider?: string }\n\n const activeMatch = [...matches].reverse().find((m) => isRouteInfo(m.staticData))\n const routeService = activeMatch && isRouteInfo(activeMatch.staticData) ? activeMatch.staticData.service : undefined\n\n // Storage routes share service: \"containers\" for both Swift and Ceph.\n // Distinguish them by the $provider param.\n const currentService = routeService === \"containers\" && provider === \"ceph\" ? \"ceph-containers\" : routeService\n\n const slotActions =\n slots?.servicePageActions && currentService ? (\n <Slot component={slots.servicePageActions} useShadowDOM={false} currentService={currentService} />\n ) : null\n\n const serviceBanner =\n slots?.serviceBanner && currentService ? (\n <Slot component={slots.serviceBanner} useShadowDOM={false} currentService={currentService} />\n ) : null\n\n const projectOverviewBanner =\n slots?.projectOverviewBanner && !currentService ? (\n <Slot component={slots.projectOverviewBanner} useShadowDOM={false} />\n ) : null\n\n return (\n <header className=\"mb-8\">\n <div className=\"flex flex-col sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex items-center gap-3\">\n <ContentHeading>{title}</ContentHeading>\n {slotActions}\n </div>\n <div className=\"text-theme-light flex shrink-0 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 {description && <p className=\"text-sm font-normal\">{description}</p>}\n {serviceBanner}\n {projectOverviewBanner}\n <Divider className=\"mt-4\" />\n {(badges || actions) && (\n <div className=\"mt-3 flex items-start justify-between\">\n <div className=\"flex items-center gap-2\">{badges} </div>\n {actions && <div className=\"flex gap-2\">{actions}</div>}\n </div>\n )}\n </header>\n )\n}\n"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