@cobaltcore-dev/aurora 0.3.0 → 0.4.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 (134) hide show
  1. package/dist/client/{ContentHeader-B_PWrxbw.mjs → ContentHeader-BXZoN3B9.mjs} +16 -16
  2. package/dist/client/{ContentHeader-B_PWrxbw.mjs.map → ContentHeader-BXZoN3B9.mjs.map} +1 -1
  3. package/dist/client/{DeleteFlavorModal-BkPrQKyE.mjs → DeleteFlavorModal-BusYn32r.mjs} +152 -152
  4. package/dist/client/{DeleteFlavorModal-BkPrQKyE.mjs.map → DeleteFlavorModal-BusYn32r.mjs.map} +1 -1
  5. package/dist/client/{EditSecurityGroupModal-ad4uzlt0.mjs → EditSecurityGroupModal-DK3WYikA.mjs} +15 -15
  6. package/dist/client/{EditSecurityGroupModal-ad4uzlt0.mjs.map → EditSecurityGroupModal-DK3WYikA.mjs.map} +1 -1
  7. package/dist/client/FiltersInput-OVeIJzIo.mjs +81 -0
  8. package/dist/client/FiltersInput-OVeIJzIo.mjs.map +1 -0
  9. package/dist/client/{FloatingIpActionModals-lKMwLuL8.mjs → FloatingIpActionModals-Dok7fJss.mjs} +52 -52
  10. package/dist/client/{FloatingIpActionModals-lKMwLuL8.mjs.map → FloatingIpActionModals-Dok7fJss.mjs.map} +1 -1
  11. package/dist/client/{ImageToastNotifications--U13YiQ_.mjs → ImageToastNotifications-BG9LPnXf.mjs} +324 -324
  12. package/dist/client/{ImageToastNotifications--U13YiQ_.mjs.map → ImageToastNotifications-BG9LPnXf.mjs.map} +1 -1
  13. package/dist/client/ListToolbar-BojRTNbo.mjs +129 -0
  14. package/dist/client/ListToolbar-BojRTNbo.mjs.map +1 -0
  15. package/dist/client/{RouteError-iP1Vd6bY.mjs → RouteError-pDEWC_k7.mjs} +2 -2
  16. package/dist/client/{RouteError-iP1Vd6bY.mjs.map → RouteError-pDEWC_k7.mjs.map} +1 -1
  17. package/dist/client/SortInput-DXWSqSny.mjs +34 -0
  18. package/dist/client/SortInput-DXWSqSny.mjs.map +1 -0
  19. package/dist/client/{_flavorId-BaNXUJhA.mjs → _flavorId-BRonXvCo.mjs} +40 -40
  20. package/dist/client/{_flavorId-BaNXUJhA.mjs.map → _flavorId-BRonXvCo.mjs.map} +1 -1
  21. package/dist/client/{_flavorId-CnO76tuy.mjs → _flavorId-BoNcxYmF.mjs} +9 -9
  22. package/dist/client/{_flavorId-CnO76tuy.mjs.map → _flavorId-BoNcxYmF.mjs.map} +1 -1
  23. package/dist/client/{_floatingIpId-C8G20nNt.mjs → _floatingIpId-D33bOEmH.mjs} +2 -2
  24. package/dist/client/{_floatingIpId-C8G20nNt.mjs.map → _floatingIpId-D33bOEmH.mjs.map} +1 -1
  25. package/dist/client/_floatingIpId-DF_BSJN6.mjs +228 -0
  26. package/dist/client/{_floatingIpId-DdKnjdIV.mjs.map → _floatingIpId-DF_BSJN6.mjs.map} +1 -1
  27. package/dist/client/{_imageId-DdSbxFqG.mjs → _imageId-BL0I5_pv.mjs} +127 -127
  28. package/dist/client/{_imageId-DdSbxFqG.mjs.map → _imageId-BL0I5_pv.mjs.map} +1 -1
  29. package/dist/client/{_pcaId-DX_S-3hE.mjs → _pcaId-BYCoeK6_.mjs} +2 -2
  30. package/dist/client/{_pcaId-DX_S-3hE.mjs.map → _pcaId-BYCoeK6_.mjs.map} +1 -1
  31. package/dist/client/_pcaId-CbBhBrX1.mjs +466 -0
  32. package/dist/client/_pcaId-CbBhBrX1.mjs.map +1 -0
  33. package/dist/client/{_projectId-Dha4XqX4.mjs → _projectId-5NiasyXm.mjs} +3 -3
  34. package/dist/client/{_projectId-Dha4XqX4.mjs.map → _projectId-5NiasyXm.mjs.map} +1 -1
  35. package/dist/client/{_projectId-DYrcZ3E3.mjs → _projectId-BwLMEMGC.mjs} +3 -3
  36. package/dist/client/{_projectId-DYrcZ3E3.mjs.map → _projectId-BwLMEMGC.mjs.map} +1 -1
  37. package/dist/client/{_projectId-DsSVV2EA.mjs → _projectId-D35MN1kY.mjs} +70 -70
  38. package/dist/client/{_projectId-DsSVV2EA.mjs.map → _projectId-D35MN1kY.mjs.map} +1 -1
  39. package/dist/client/{_projectId-KH5si25Q.mjs → _projectId-OW2xkK43.mjs} +2 -2
  40. package/dist/client/{_projectId-KH5si25Q.mjs.map → _projectId-OW2xkK43.mjs.map} +1 -1
  41. package/dist/client/{_securityGroupId-DgaSqYex.mjs → _securityGroupId-B-Z-CzLp.mjs} +2 -2
  42. package/dist/client/{_securityGroupId-DgaSqYex.mjs.map → _securityGroupId-B-Z-CzLp.mjs.map} +1 -1
  43. package/dist/client/{_securityGroupId-O7FXfx0M.mjs → _securityGroupId-B1bOYRbX.mjs} +307 -307
  44. package/dist/client/{_securityGroupId-O7FXfx0M.mjs.map → _securityGroupId-B1bOYRbX.mjs.map} +1 -1
  45. package/dist/client/{about-DN8n8sN8.mjs → about-DLn1ShhF.mjs} +2 -2
  46. package/dist/client/{about-DN8n8sN8.mjs.map → about-DLn1ShhF.mjs.map} +1 -1
  47. package/dist/client/{build-CZRvXrAL.mjs → build-BJDfnAyi.mjs} +541 -537
  48. package/dist/client/{build-CZRvXrAL.mjs.map → build-BJDfnAyi.mjs.map} +1 -1
  49. package/dist/client/{buildFilterParams-ngVK3ybs.mjs → buildFilterParams-TeyosGyK.mjs} +1 -1
  50. package/dist/client/{buildFilterParams-ngVK3ybs.mjs.map → buildFilterParams-TeyosGyK.mjs.map} +1 -1
  51. package/dist/client/{constants-akdIBeTX.mjs → constants-B-P2r5F1.mjs} +11 -11
  52. package/dist/client/{constants-akdIBeTX.mjs.map → constants-B-P2r5F1.mjs.map} +1 -1
  53. package/dist/client/{containers-DmwhE9Uz.mjs → containers-BjWqjNOx.mjs} +2 -2
  54. package/dist/client/containers-BjWqjNOx.mjs.map +1 -0
  55. package/dist/client/{containers-Cs5vOeR2.mjs → containers-DsRWc1L5.mjs} +1 -1
  56. package/dist/client/containers-DsRWc1L5.mjs.map +1 -0
  57. package/dist/client/containers-J7WFA18U.mjs +3120 -0
  58. package/dist/client/containers-J7WFA18U.mjs.map +1 -0
  59. package/dist/client/{flavors-CY7A6--v.mjs → flavors-D8oElC2K.mjs} +2 -2
  60. package/dist/client/{flavors-CY7A6--v.mjs.map → flavors-D8oElC2K.mjs.map} +1 -1
  61. package/dist/client/flavors-qvgPSI7J.mjs +613 -0
  62. package/dist/client/flavors-qvgPSI7J.mjs.map +1 -0
  63. package/dist/client/{floatingips-BtL4d4m-.mjs → floatingips-Fa6ocNUu.mjs} +86 -86
  64. package/dist/client/{floatingips-BtL4d4m-.mjs.map → floatingips-Fa6ocNUu.mjs.map} +1 -1
  65. package/dist/client/{formatBytes-D6oa0wU9.mjs → formatBytes-tQBEnPoL.mjs} +1 -1
  66. package/dist/client/{formatBytes-D6oa0wU9.mjs.map → formatBytes-tQBEnPoL.mjs.map} +1 -1
  67. package/dist/client/{hooks-D0krAKvo.mjs → hooks-DEjb9d1F.mjs} +1 -1
  68. package/dist/client/images-CSFfefAu.mjs +1901 -0
  69. package/dist/client/images-CSFfefAu.mjs.map +1 -0
  70. package/dist/client/{images-I9gQfRa7.mjs → images-CTLCY-yY.mjs} +2 -2
  71. package/dist/client/{images-I9gQfRa7.mjs.map → images-CTLCY-yY.mjs.map} +1 -1
  72. package/dist/client/images-DM9I8G0p.mjs.map +1 -1
  73. package/dist/client/images-tYfyOkX8.mjs +8 -0
  74. package/dist/client/images-tYfyOkX8.mjs.map +1 -0
  75. package/dist/client/index.js +200 -198
  76. package/dist/client/index.js.map +1 -1
  77. package/dist/client/{network-SCVadZsv.mjs → network-rYLHyf15.mjs} +1 -1
  78. package/dist/client/{network-SCVadZsv.mjs.map → network-rYLHyf15.mjs.map} +1 -1
  79. package/dist/client/{objects-BrYe_RaJ.mjs → objects-BciXwZ00.mjs} +2 -2
  80. package/dist/client/objects-BciXwZ00.mjs.map +1 -0
  81. package/dist/client/{objects-B4yrYf_a.mjs → objects-Cdew99tK.mjs} +1 -1
  82. package/dist/client/objects-Cdew99tK.mjs.map +1 -0
  83. package/dist/client/objects-DaElrban.mjs +5340 -0
  84. package/dist/client/objects-DaElrban.mjs.map +1 -0
  85. package/dist/client/{overview-CmQkJ4Hh.mjs → overview-BMhjFMIV.mjs} +2 -2
  86. package/dist/client/{overview-CmQkJ4Hh.mjs.map → overview-BMhjFMIV.mjs.map} +1 -1
  87. package/dist/client/{overview-BjRSFSBh.mjs → overview-BYIRj7_X.mjs} +2 -2
  88. package/dist/client/{overview-BjRSFSBh.mjs.map → overview-BYIRj7_X.mjs.map} +1 -1
  89. package/dist/client/{overview-DTLIAKkJ.mjs → overview-DRCKNBH2.mjs} +2 -2
  90. package/dist/client/{overview-DTLIAKkJ.mjs.map → overview-DRCKNBH2.mjs.map} +1 -1
  91. package/dist/client/{overview-C4gjtc2q.mjs → overview-urYLOVQE.mjs} +3 -3
  92. package/dist/client/{overview-C4gjtc2q.mjs.map → overview-urYLOVQE.mjs.map} +1 -1
  93. package/dist/client/{pca-DzixU9Dl.mjs → pca-COmKvp3J.mjs} +2 -2
  94. package/dist/client/{pca-DzixU9Dl.mjs.map → pca-COmKvp3J.mjs.map} +1 -1
  95. package/dist/client/{pca-CYFJxSZ2.mjs → pca-oc7J0_Xd.mjs} +62 -62
  96. package/dist/client/pca-oc7J0_Xd.mjs.map +1 -0
  97. package/dist/client/{projects-D3hOC1cy.mjs → projects-BUabCzvw.mjs} +33 -33
  98. package/dist/client/projects-BUabCzvw.mjs.map +1 -0
  99. package/dist/client/{projects-BtyjXGq2.mjs → projects-DI_L4oDw.mjs} +2 -2
  100. package/dist/client/{projects-BtyjXGq2.mjs.map → projects-DI_L4oDw.mjs.map} +1 -1
  101. package/dist/client/{projects-DwVawmll.mjs → projects-Dl5XkXUP.mjs} +2 -2
  102. package/dist/client/{projects-DwVawmll.mjs.map → projects-Dl5XkXUP.mjs.map} +1 -1
  103. package/dist/client/{projects-BsN4bvU2.mjs → projects-HoQ0gE5Y.mjs} +1 -1
  104. package/dist/client/{projects-BsN4bvU2.mjs.map → projects-HoQ0gE5Y.mjs.map} +1 -1
  105. package/dist/client/{securitygroups-DMCIDHQS.mjs → securitygroups-BjkmHk2J.mjs} +102 -102
  106. package/dist/client/{securitygroups-DMCIDHQS.mjs.map → securitygroups-BjkmHk2J.mjs.map} +1 -1
  107. package/dist/client/{useListWithFiltering-CEDh1LO-.mjs → useListWithFiltering-CbhHJO4V.mjs} +1 -1
  108. package/dist/client/{useListWithFiltering-CEDh1LO-.mjs.map → useListWithFiltering-CbhHJO4V.mjs.map} +1 -1
  109. package/dist/client/{useProjectId-CgOTejka.mjs → useProjectId-OQv2KBbG.mjs} +1 -1
  110. package/dist/client/{useProjectId-CgOTejka.mjs.map → useProjectId-OQv2KBbG.mjs.map} +1 -1
  111. package/dist/server/index.d.ts +7 -1
  112. package/dist/server/index.js +116 -55
  113. package/package.json +3 -4
  114. package/dist/client/ListToolbar-C5lzTrit.mjs +0 -223
  115. package/dist/client/ListToolbar-C5lzTrit.mjs.map +0 -1
  116. package/dist/client/_floatingIpId-DdKnjdIV.mjs +0 -228
  117. package/dist/client/_pcaId-DFkYJEb5.mjs +0 -369
  118. package/dist/client/_pcaId-DFkYJEb5.mjs.map +0 -1
  119. package/dist/client/containers-BE2QiLBs.mjs +0 -3031
  120. package/dist/client/containers-BE2QiLBs.mjs.map +0 -1
  121. package/dist/client/containers-Cs5vOeR2.mjs.map +0 -1
  122. package/dist/client/containers-DmwhE9Uz.mjs.map +0 -1
  123. package/dist/client/flavors-pEcGkCut.mjs +0 -565
  124. package/dist/client/flavors-pEcGkCut.mjs.map +0 -1
  125. package/dist/client/images-C19gCFSy.mjs +0 -1797
  126. package/dist/client/images-C19gCFSy.mjs.map +0 -1
  127. package/dist/client/objects-B4yrYf_a.mjs.map +0 -1
  128. package/dist/client/objects-BrYe_RaJ.mjs.map +0 -1
  129. package/dist/client/objects-DOYFFn3Y.mjs +0 -4760
  130. package/dist/client/objects-DOYFFn3Y.mjs.map +0 -1
  131. package/dist/client/pca-CYFJxSZ2.mjs.map +0 -1
  132. package/dist/client/projects-D3hOC1cy.mjs.map +0 -1
  133. package/permission_policies/compute.yaml +0 -975
  134. package/permission_policies/image.yaml +0 -71
@@ -1 +0,0 @@
1
- {"version":3,"file":"containers-Cs5vOeR2.mjs","names":["SplitNotFoundComponent","notFoundComponent"],"sources":["../../src/client/routes/_auth/projects/$projectId/storage/$provider/containers/index.tsx?tsr-split=notFoundComponent"],"sourcesContent":["import { createFileRoute, redirect, useParams } from \"@tanstack/react-router\"\nimport { z } from \"zod\"\nimport { getServiceIndex } from \"@/server/Authentication/helpers\"\nimport { ErrorBoundary } from \"react-error-boundary\"\nimport { SwiftContainers } from \"../../-components/Swift/Containers\"\nimport { CephContainers } from \"../../-components/Ceph/Containers\"\nimport { Trans, useLingui } from \"@lingui/react/macro\"\nimport type { RouteInfo } from \"@/client/routes/routeInfo\"\nimport { ContentHeader } from \"@/client/components/ContentHeader/ContentHeader\"\n\nexport const checkServiceAvailability = (\n availableServices: {\n type: string\n name: string\n }[],\n params: {\n projectId: string\n provider: string\n }\n) => {\n const { provider, projectId } = params\n\n const serviceIndex = getServiceIndex(availableServices)\n\n // Redirect to the \"Projects Overview\" page if no storage services available\n if (!serviceIndex[\"object-store\"]) {\n throw redirect({\n to: \"/projects/$projectId\",\n params: { projectId },\n })\n }\n\n // Check provider availability\n const hasSwift = Boolean(serviceIndex[\"object-store\"][\"swift\"])\n const hasCeph = Boolean(serviceIndex[\"object-store\"][\"ceph\"])\n\n // TEMPORARY: Allow Ceph access even if not in catalog (relies on env config)\n // TODO: Properly register Ceph in OpenStack service catalog\n const cephFallbackEnabled = true // Set to false once Ceph is in catalog\n\n // Effective availability includes fallback flag for Ceph\n const hasEffectiveCeph = hasCeph || cephFallbackEnabled\n const fallbackProvider = hasSwift ? \"swift\" : hasEffectiveCeph ? \"ceph\" : null\n\n if (provider !== \"swift\" && provider !== \"ceph\") {\n if (!fallbackProvider) {\n throw redirect({\n to: \"/projects/$projectId\",\n params: { projectId },\n })\n }\n throw redirect({\n to: \"/projects/$projectId/storage/$provider/containers\",\n params: { ...params, provider: fallbackProvider },\n })\n }\n\n if (provider === \"swift\" && !hasSwift) {\n if (!hasEffectiveCeph) {\n throw redirect({\n to: \"/projects/$projectId\",\n params: { projectId },\n })\n }\n\n throw redirect({\n to: \"/projects/$projectId/storage/$provider/containers\",\n params: { ...params, provider: \"ceph\" },\n })\n }\n\n if (provider === \"ceph\" && !hasEffectiveCeph) {\n if (!hasSwift) {\n throw redirect({\n to: \"/projects/$projectId\",\n params: { projectId },\n })\n }\n\n throw redirect({\n to: \"/projects/$projectId/storage/$provider/containers\",\n params: { ...params, provider: \"swift\" },\n })\n }\n}\n\n// Search params schema\n// - sortBy: active sort column — persisted for deep links and back navigation\n// - sortDirection: \"asc\" | \"desc\" — persisted alongside sortBy\n// - search: active filter string — persisted so deep links preserve the current search\nconst containersSearchSchema = z.object({\n sortBy: z.enum([\"name\", \"count\", \"bytes\", \"last_modified\"]).optional(),\n sortDirection: z.enum([\"asc\", \"desc\"]).optional(),\n search: z.string().optional(),\n})\n\nexport const Route = createFileRoute(\"/_auth/projects/$projectId/storage/$provider/containers/\")({\n staticData: {\n section: \"storage\",\n service: \"containers\",\n sectionCrumb: { labelKey: \"Storage\" },\n crumb: { useParamAsLabel: \"provider\" },\n } satisfies RouteInfo,\n validateSearch: containersSearchSchema,\n head: ({ match }) => ({\n meta: [\n {\n title:\n match.params.provider === \"swift\"\n ? \"Object Storage (Swift)\"\n : match.params.provider === \"ceph\"\n ? \"Object Storage (Ceph)\"\n : \"Storage Overview\",\n },\n ],\n }),\n component: () => {\n return <StorageDashboard />\n },\n notFoundComponent: () => {\n return <p>Storage service not found</p>\n },\n loader: async ({ context }) => {\n const { trpcClient } = context\n const availableServices = await trpcClient?.auth.getAvailableServices.query()\n\n return {\n client: trpcClient,\n availableServices,\n }\n },\n beforeLoad: async ({ context, params }) => {\n const { trpcClient } = context\n const availableServices = await trpcClient?.auth.getAvailableServices.query()\n checkServiceAvailability(availableServices!, params)\n },\n})\n\nfunction StorageDashboard() {\n const { project, provider } = useParams({\n from: \"/_auth/projects/$projectId/storage/$provider/containers/\",\n select: (params) => {\n return { project: params.projectId, provider: params.provider }\n },\n })\n\n const { t } = useLingui()\n\n let pageTitle: string\n switch (provider) {\n case \"swift\":\n pageTitle = t`Object Storage (Swift)`\n break\n case \"ceph\":\n pageTitle = t`Object Storage (Ceph)`\n break\n default:\n pageTitle = t`Storage Overview`\n }\n\n return (\n <div>\n <ContentHeader title={pageTitle} projectId={project} />\n {project ? (\n <ErrorBoundary\n fallback={\n <div className=\"p-4 text-center\">\n <Trans>Error loading component</Trans>\n </div>\n }\n >\n {(() => {\n switch (provider) {\n case \"swift\":\n return <SwiftContainers />\n case \"ceph\":\n return <CephContainers />\n default:\n return <div>Storage Overview Page</div> // replace when available\n }\n })()}\n </ErrorBoundary>\n ) : (\n <div className=\"p-4 text-center\">\n <Trans>No project selected</Trans>\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";;AAyFA,IAAAA,UA+BW,kBAAC,KAAA,EAAA,UAAE,6BAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"containers-DmwhE9Uz.mjs","names":["createFileRoute","redirect","z","getServiceIndex","checkServiceAvailability","availableServices","type","name","params","projectId","provider","serviceIndex","to","hasSwift","Boolean","hasCeph","cephFallbackEnabled","hasEffectiveCeph","fallbackProvider","containersSearchSchema","object","sortBy","enum","optional","sortDirection","search","string","Route","staticData","section","service","sectionCrumb","labelKey","crumb","useParamAsLabel","RouteInfo","validateSearch","head","match","meta","title","component","lazyRouteComponent","$$splitComponentImporter","notFoundComponent","$$splitNotFoundComponentImporter","loader","context","trpcClient","auth","getAvailableServices","query","client","beforeLoad"],"sources":["../../src/client/routes/_auth/projects/$projectId/storage/$provider/containers/index.tsx"],"sourcesContent":["import { createFileRoute, redirect, useParams } from \"@tanstack/react-router\"\nimport { z } from \"zod\"\nimport { getServiceIndex } from \"@/server/Authentication/helpers\"\nimport { ErrorBoundary } from \"react-error-boundary\"\nimport { SwiftContainers } from \"../../-components/Swift/Containers\"\nimport { CephContainers } from \"../../-components/Ceph/Containers\"\nimport { Trans, useLingui } from \"@lingui/react/macro\"\nimport type { RouteInfo } from \"@/client/routes/routeInfo\"\nimport { ContentHeader } from \"@/client/components/ContentHeader/ContentHeader\"\n\nexport const checkServiceAvailability = (\n availableServices: {\n type: string\n name: string\n }[],\n params: {\n projectId: string\n provider: string\n }\n) => {\n const { provider, projectId } = params\n\n const serviceIndex = getServiceIndex(availableServices)\n\n // Redirect to the \"Projects Overview\" page if no storage services available\n if (!serviceIndex[\"object-store\"]) {\n throw redirect({\n to: \"/projects/$projectId\",\n params: { projectId },\n })\n }\n\n // Check provider availability\n const hasSwift = Boolean(serviceIndex[\"object-store\"][\"swift\"])\n const hasCeph = Boolean(serviceIndex[\"object-store\"][\"ceph\"])\n\n // TEMPORARY: Allow Ceph access even if not in catalog (relies on env config)\n // TODO: Properly register Ceph in OpenStack service catalog\n const cephFallbackEnabled = true // Set to false once Ceph is in catalog\n\n // Effective availability includes fallback flag for Ceph\n const hasEffectiveCeph = hasCeph || cephFallbackEnabled\n const fallbackProvider = hasSwift ? \"swift\" : hasEffectiveCeph ? \"ceph\" : null\n\n if (provider !== \"swift\" && provider !== \"ceph\") {\n if (!fallbackProvider) {\n throw redirect({\n to: \"/projects/$projectId\",\n params: { projectId },\n })\n }\n throw redirect({\n to: \"/projects/$projectId/storage/$provider/containers\",\n params: { ...params, provider: fallbackProvider },\n })\n }\n\n if (provider === \"swift\" && !hasSwift) {\n if (!hasEffectiveCeph) {\n throw redirect({\n to: \"/projects/$projectId\",\n params: { projectId },\n })\n }\n\n throw redirect({\n to: \"/projects/$projectId/storage/$provider/containers\",\n params: { ...params, provider: \"ceph\" },\n })\n }\n\n if (provider === \"ceph\" && !hasEffectiveCeph) {\n if (!hasSwift) {\n throw redirect({\n to: \"/projects/$projectId\",\n params: { projectId },\n })\n }\n\n throw redirect({\n to: \"/projects/$projectId/storage/$provider/containers\",\n params: { ...params, provider: \"swift\" },\n })\n }\n}\n\n// Search params schema\n// - sortBy: active sort column — persisted for deep links and back navigation\n// - sortDirection: \"asc\" | \"desc\" — persisted alongside sortBy\n// - search: active filter string — persisted so deep links preserve the current search\nconst containersSearchSchema = z.object({\n sortBy: z.enum([\"name\", \"count\", \"bytes\", \"last_modified\"]).optional(),\n sortDirection: z.enum([\"asc\", \"desc\"]).optional(),\n search: z.string().optional(),\n})\n\nexport const Route = createFileRoute(\"/_auth/projects/$projectId/storage/$provider/containers/\")({\n staticData: {\n section: \"storage\",\n service: \"containers\",\n sectionCrumb: { labelKey: \"Storage\" },\n crumb: { useParamAsLabel: \"provider\" },\n } satisfies RouteInfo,\n validateSearch: containersSearchSchema,\n head: ({ match }) => ({\n meta: [\n {\n title:\n match.params.provider === \"swift\"\n ? \"Object Storage (Swift)\"\n : match.params.provider === \"ceph\"\n ? \"Object Storage (Ceph)\"\n : \"Storage Overview\",\n },\n ],\n }),\n component: () => {\n return <StorageDashboard />\n },\n notFoundComponent: () => {\n return <p>Storage service not found</p>\n },\n loader: async ({ context }) => {\n const { trpcClient } = context\n const availableServices = await trpcClient?.auth.getAvailableServices.query()\n\n return {\n client: trpcClient,\n availableServices,\n }\n },\n beforeLoad: async ({ context, params }) => {\n const { trpcClient } = context\n const availableServices = await trpcClient?.auth.getAvailableServices.query()\n checkServiceAvailability(availableServices!, params)\n },\n})\n\nfunction StorageDashboard() {\n const { project, provider } = useParams({\n from: \"/_auth/projects/$projectId/storage/$provider/containers/\",\n select: (params) => {\n return { project: params.projectId, provider: params.provider }\n },\n })\n\n const { t } = useLingui()\n\n let pageTitle: string\n switch (provider) {\n case \"swift\":\n pageTitle = t`Object Storage (Swift)`\n break\n case \"ceph\":\n pageTitle = t`Object Storage (Ceph)`\n break\n default:\n pageTitle = t`Storage Overview`\n }\n\n return (\n <div>\n <ContentHeader title={pageTitle} projectId={project} />\n {project ? (\n <ErrorBoundary\n fallback={\n <div className=\"p-4 text-center\">\n <Trans>Error loading component</Trans>\n </div>\n }\n >\n {(() => {\n switch (provider) {\n case \"swift\":\n return <SwiftContainers />\n case \"ceph\":\n return <CephContainers />\n default:\n return <div>Storage Overview Page</div> // replace when available\n }\n })()}\n </ErrorBoundary>\n ) : (\n <div className=\"p-4 text-center\">\n <Trans>No project selected</Trans>\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";;;;kGAUaI,KACXC,GAIAG,MAAAA;CAKA,IAAM,EAAEE,aAAUD,iBAAcD,GAE1BG,IAAeR,EAAgBE,EAAAA;AAGrC,KAAI,CAACM,EAAa,gBAChB,OAAMV,EAAS;EACbW,IAAI;EACJJ,QAAQ,EAAEC,cAAU;EACtB,CAAA;CAIF,IAAMI,IAAWC,EAAQH,EAAa,gBAAgB,OAQhDM,IAPUH,EAAQH,EAAa,gBAAgB,QAIzB,IAItBO,IAAmBL,IAAW,UAAUI,IAAmB,SAAS;AAE1E,KAAIP,MAAa,WAAWA,MAAa,OAOvC,OAAMT,EANDiB,IAMU;EACbN,IAAI;EACJJ,QAAQ;GAAE,GAAGA;GAAQE,UAAUQ;GAAiB;EAClD,GARiB;EACbN,IAAI;EACJJ,QAAQ,EAAEC,cAAU;EACtB,CAAA;AAQJ,KAAIC,MAAa,WAAW,CAACG,EAQ3B,OAAMZ,EAPDgB,IAOU;EACbL,IAAI;EACJJ,QAAQ;GAAE,GAAGA;GAAQE,UAAU;GAAO;EACxC,GATiB;EACbE,IAAI;EACJJ,QAAQ,EAAEC,cAAU;EACtB,CAAA;AASJ,KAAIC,MAAa,UAAU,CAACO,EAQ1B,OAAMhB,EAPDY,IAOU;EACbD,IAAI;EACJJ,QAAQ;GAAE,GAAGA;GAAQE,UAAU;GAAQ;EACzC,GATiB;EACbE,IAAI;EACJJ,QAAQ,EAAEC,cAAU;EACtB,CAAA;GAcAU,IAAyBjB,EAAEkB,OAAO;CACtCC,QAAQnB,EAAEoB,KAAK;EAAC;EAAQ;EAAS;EAAS;EAAgB,CAAA,CAAEC,UAAQ;CACpEC,eAAetB,EAAEoB,KAAK,CAAC,OAAO,OAAO,CAAA,CAAEC,UAAQ;CAC/CE,QAAQvB,EAAEwB,QAAM,CAAGH,UAAQ;CAC7B,CAAA,EAEaI,IAAQ3B,EAAgB,2DAAA,CAA4D;CAC/F4B,YAAY;EACVC,SAAS;EACTC,SAAS;EACTC,cAAc,EAAEC,UAAU,WAAU;EACpCC,OAAO,EAAEC,iBAAiB,YAAW;EACvC;CACAE,gBAAgBjB;CAChBkB,OAAO,EAAEC,gBAAa,EACpBC,MAAM,CACJ,EACEC,OACEF,EAAM9B,OAAOE,aAAa,UACtB,2BACA4B,EAAM9B,OAAOE,aAAa,SACxB,0BACA,oBACV,CAAC,EAEL;CACA+B,WAASC,EAAAC,GAAA,YAAA;CAGTC,mBAAiBF,EAAAG,GAAA,oBAAA;CAGjBC,QAAQ,OAAO,EAAEC,iBAAS;EACxB,IAAM,EAAEC,kBAAeD;AAGvB,SAAO;GACLK,QAAQJ;GACR3C,mBAJwB,MAAM2C,GAAYC,KAAKC,qBAAqBC,OAAAA;GAKtE;;CAEFE,YAAY,OAAO,EAAEN,YAASvC,gBAAQ;EACpC,IAAM,EAAEwC,kBAAeD;AAEvB3C,IAD0B,MAAM4C,GAAYC,KAAKC,qBAAqBC,OAAAA,EACzB3C,EAAAA;;CAEjD,CAAA"}
@@ -1,565 +0,0 @@
1
- import { $ as e, A as t, C as n, F as r, H as i, J as a, K as o, T as s, W as c, Z as l, at as u, c as d, it as f, j as p, l as m, n as h, rt as g, tt as _, w as v } from "./build-CZRvXrAL.mjs";
2
- import { t as y } from "./useErrorTranslation-TZVwIAzq.mjs";
3
- import { t as b } from "./flavors-CY7A6--v.mjs";
4
- import { n as x, r as S, t as C } from "./DeleteFlavorModal-BkPrQKyE.mjs";
5
- import { t as w } from "./ContentHeader-B_PWrxbw.mjs";
6
- import { t as T } from "./ListToolbar-C5lzTrit.mjs";
7
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
8
- import { Suspense as k, startTransition as A, use as j, useCallback as M, useEffect as N, useState as P } from "react";
9
- import { Link as F, useNavigate as I, useParams as L, useSearch as R } from "@tanstack/react-router";
10
- import { Trans as z, useLingui as B } from "@lingui/react";
11
- //#region src/client/routes/_auth/projects/$projectId/compute/-components/Flavors/-components/FlavorListContainer.tsx
12
- var V = ({ flavors: n, isLoading: o, client: u, project: d, onFlavorDeleted: f, canDeleteFlavor: h, canMangageAccess: g, currentPage: v = 1, totalPages: y = 1, onPageChange: b }) => {
13
- let { i18n: w, _: T } = B(), k = I(), [A, j] = P(!1), [M, N] = P(!1), [R, V] = P(!1), [H, U] = P(null), { projectId: W } = L({ from: "/_auth/projects/$projectId/compute/flavors/" }), G = (e) => {
14
- U(e), j(!0);
15
- }, K = (e) => {
16
- U(e), N(!0);
17
- }, q = (e) => {
18
- U(e), V(!0);
19
- }, J = () => {
20
- j(!1), U(null);
21
- };
22
- return o ? /* @__PURE__ */ D("div", {
23
- "data-testid": "loading",
24
- children: /* @__PURE__ */ D("div", {
25
- "data-testid": "loading",
26
- children: /* @__PURE__ */ D(r, { children: /* @__PURE__ */ D(p, {
27
- colSpan: 3,
28
- children: /* @__PURE__ */ O(_, {
29
- distribution: "center",
30
- alignment: "center",
31
- children: [/* @__PURE__ */ D(l, { variant: "primary" }), /* @__PURE__ */ D(z, { id: "Z3FXyt" })]
32
- })
33
- }) })
34
- })
35
- }) : !n || n.length === 0 ? /* @__PURE__ */ D(i, {
36
- columns: 7,
37
- className: "flavors",
38
- "data-testid": "no-flavors",
39
- children: /* @__PURE__ */ D(r, { children: /* @__PURE__ */ O(p, {
40
- colSpan: 7,
41
- children: [/* @__PURE__ */ D(t, { children: /* @__PURE__ */ D(z, { id: "PiyQJ/" }) }), /* @__PURE__ */ D("p", { children: /* @__PURE__ */ D(z, { id: "KSW/GC" }) })]
42
- }) })
43
- }) : /* @__PURE__ */ O(E, { children: [
44
- /* @__PURE__ */ O(i, {
45
- columns: 6,
46
- minContentColumns: [5],
47
- className: "flavors",
48
- "data-testid": "flavors-table",
49
- children: [/* @__PURE__ */ O(r, { children: [
50
- /* @__PURE__ */ D(c, { children: /* @__PURE__ */ D(z, { id: "6YtxFj" }) }),
51
- /* @__PURE__ */ D(c, { children: /* @__PURE__ */ D(z, { id: "k5nYwm" }) }),
52
- /* @__PURE__ */ D(c, { children: /* @__PURE__ */ D(z, { id: "K+e/0e" }) }),
53
- /* @__PURE__ */ D(c, { children: /* @__PURE__ */ D(z, { id: "n0ZttO" }) }),
54
- /* @__PURE__ */ D(c, { children: /* @__PURE__ */ D(z, { id: "p4nMut" }) }),
55
- /* @__PURE__ */ D(c, {})
56
- ] }), n.map((t) => /* @__PURE__ */ O(r, {
57
- "data-testid": `flavor-row-${t.id}`,
58
- onClick: () => k({
59
- to: "/projects/$projectId/compute/flavors/$flavorId",
60
- params: {
61
- projectId: W,
62
- flavorId: t.id
63
- }
64
- }),
65
- children: [
66
- /* @__PURE__ */ D(p, { children: t.name || t.id }),
67
- /* @__PURE__ */ D(p, { children: t.vcpus || "–" }),
68
- /* @__PURE__ */ D(p, { children: t.ram || "–" }),
69
- /* @__PURE__ */ D(p, { children: t.disk || "–" }),
70
- /* @__PURE__ */ D(p, { children: t.swap || "–" }),
71
- /* @__PURE__ */ D(p, {
72
- onClick: (e) => e.stopPropagation(),
73
- children: /* @__PURE__ */ D(e, { children: /* @__PURE__ */ O(s, { children: [
74
- /* @__PURE__ */ D(a, { children: /* @__PURE__ */ D(F, {
75
- to: "/projects/$projectId/compute/flavors/$flavorId",
76
- params: {
77
- projectId: W,
78
- flavorId: t.id
79
- },
80
- className: "text-theme-default",
81
- children: w._({ id: "URmyfc" })
82
- }) }),
83
- /* @__PURE__ */ D(a, {
84
- label: w._({ id: "6GBt0m" }),
85
- onClick: () => K(t)
86
- }),
87
- g && /* @__PURE__ */ D(a, {
88
- label: w._({ id: "cWbW6w" }),
89
- onClick: () => q(t)
90
- }),
91
- h && /* @__PURE__ */ D(a, {
92
- label: w._({ id: "JT3I1g" }),
93
- onClick: () => G(t)
94
- })
95
- ] }) })
96
- })
97
- ]
98
- }, t.id))]
99
- }),
100
- y > 1 && /* @__PURE__ */ D("div", {
101
- className: "flex justify-center py-4",
102
- children: /* @__PURE__ */ D(m, {
103
- variant: "input",
104
- currentPage: v,
105
- pages: y,
106
- onPressPrevious: () => b?.(Math.max(v - 1, 1)),
107
- onPressNext: () => b?.(Math.min(v + 1, y)),
108
- onSelectChange: (e) => b?.(e)
109
- })
110
- }),
111
- /* @__PURE__ */ D(C, {
112
- client: u,
113
- isOpen: A,
114
- onClose: J,
115
- project: d,
116
- flavor: H,
117
- onSuccess: () => {
118
- H && f && f(H.name || ""), J();
119
- }
120
- }),
121
- /* @__PURE__ */ D(S, {
122
- client: u,
123
- isOpen: M,
124
- onClose: () => N(!1),
125
- project: d,
126
- flavor: H
127
- }),
128
- /* @__PURE__ */ D(x, {
129
- client: u,
130
- isOpen: R,
131
- onClose: () => V(!1),
132
- project: d,
133
- flavor: H
134
- })
135
- ] });
136
- }, H = (e, t, n) => {
137
- switch (e) {
138
- case "id":
139
- if (!t) return;
140
- {
141
- let e = String(t).trim();
142
- return /^[a-zA-Z0-9.\-_]*$/.test(e) ? void 0 : n({ id: "AX9Juz" });
143
- }
144
- case "name": {
145
- let e = String(t || "").trim();
146
- return e.length >= 2 && e.length <= 50 ? void 0 : n({ id: "zDS0JC" });
147
- }
148
- case "vcpus": {
149
- let e = Number(t);
150
- return !isNaN(e) && e >= 1 ? void 0 : n({ id: "uSdnuQ" });
151
- }
152
- case "ram": {
153
- let e = Number(t);
154
- return !isNaN(e) && e >= 128 ? void 0 : n({ id: "g1IxCo" });
155
- }
156
- case "disk": {
157
- let e = Number(t);
158
- return !isNaN(e) && e >= 0 ? void 0 : n({ id: "AJRhSM" });
159
- }
160
- case "swap":
161
- if (t === "" || t == null) return;
162
- {
163
- let e = Number(t);
164
- return !isNaN(e) && e >= 0 ? void 0 : n({ id: "g3BSCe" });
165
- }
166
- case "rxtx_factor": {
167
- let e = Number(t);
168
- return !isNaN(e) && e >= 1 ? void 0 : n({ id: "PIbPRX" });
169
- }
170
- case "description": return t ? String(t).length < 65535 ? void 0 : n({ id: "uuKb0T" }) : void 0;
171
- case "OS-FLV-EXT-DATA:ephemeral": {
172
- let e = Number(t);
173
- return !isNaN(e) && e >= 0 ? void 0 : n({ id: "tLerHy" });
174
- }
175
- case "os-flavor-access:is_public": return t == null || typeof t == "boolean" || typeof t == "string" && (t === "true" || t === "false") ? void 0 : n({ id: "MmtQVF" });
176
- default: return;
177
- }
178
- }, U = (e) => {
179
- let t = {
180
- name: String(e.name),
181
- vcpus: Number(e.vcpus),
182
- ram: Number(e.ram),
183
- disk: Number(e.disk)
184
- }, n = (e) => e != null && e !== "" && String(e).trim() !== "", r = (e) => e != null && e !== "" && String(e).trim() !== "" && !isNaN(Number(e));
185
- return n(e.id) && (t.id = String(e.id).trim()), n(e.description) && (t.description = String(e.description).trim()), r(e.swap) && (t.swap = Number(e.swap)), r(e.rxtx_factor) && (t.rxtx_factor = Number(e.rxtx_factor)), r(e["OS-FLV-EXT-DATA:ephemeral"]) && (t["OS-FLV-EXT-DATA:ephemeral"] = Number(e["OS-FLV-EXT-DATA:ephemeral"])), e["os-flavor-access:is_public"] !== void 0 && (t["os-flavor-access:is_public"] = !!e["os-flavor-access:is_public"]), t;
186
- }, W = ({ client: e, isOpen: t, onClose: r, project: i, onSuccess: a }) => {
187
- let { i18n: s, _: c } = B(), { translateError: d } = y(), [p, m] = P({ "os-flavor-access:is_public": !0 }), [b, x] = P({}), [S, C] = P(!1), [w, T] = P(null), E = (e) => {
188
- let { name: t, value: n, type: r, checked: i } = e.target;
189
- m((e) => ({
190
- ...e,
191
- [t]: r === "checkbox" ? i : n
192
- })), w && T(null);
193
- }, k = (e, t) => {
194
- m((n) => ({
195
- ...n,
196
- [e]: t
197
- })), w && T(null);
198
- }, A = (e) => {
199
- let { name: t, value: n } = e.target, r = H(t, n, c);
200
- x((e) => ({
201
- ...e,
202
- [t]: r
203
- }));
204
- }, j = async (t) => {
205
- t.preventDefault(), T(null);
206
- let n = {};
207
- if ([
208
- "name",
209
- "vcpus",
210
- "ram",
211
- "disk"
212
- ].forEach((e) => {
213
- let t = H(e, p[e], c);
214
- t && (n[e] = t);
215
- }), [
216
- "id",
217
- "swap",
218
- "OS-FLV-EXT-DATA:ephemeral",
219
- "rxtx_factor",
220
- "description",
221
- "os-flavor-access:is_public"
222
- ].forEach((e) => {
223
- let t = p[e];
224
- if (t !== void 0 && t !== "" && t !== null) {
225
- let r = H(e, t, c);
226
- r && (n[e] = r);
227
- }
228
- }), Object.keys(n).length > 0) {
229
- x(n), T(s._({ id: "CBFSfX" }));
230
- return;
231
- }
232
- try {
233
- C(!0);
234
- let t = U(p);
235
- await e.compute.createFlavor.mutate({
236
- project_id: i,
237
- flavor: t
238
- }), a(t.name), M();
239
- } catch (e) {
240
- T(e?.message ? d(e.message) : s._({ id: "OxDN2m" }));
241
- } finally {
242
- C(!1);
243
- }
244
- }, M = () => {
245
- m({ "os-flavor-access:is_public": !0 }), x({}), T(null), r();
246
- };
247
- return /* @__PURE__ */ O(u, {
248
- onCancel: M,
249
- size: "large",
250
- title: s._({ id: "Rlp5zj" }),
251
- open: t,
252
- onConfirm: j,
253
- cancelButtonLabel: s._({ id: "dEgA5A" }),
254
- confirmButtonLabel: s._({ id: "wEfZld" }),
255
- children: [S && /* @__PURE__ */ D(_, {
256
- distribution: "center",
257
- alignment: "center",
258
- children: /* @__PURE__ */ D(l, { variant: "primary" })
259
- }), !S && /* @__PURE__ */ O(f, { children: [w && /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(o, {
260
- onDismiss: () => {
261
- T(null);
262
- },
263
- text: w,
264
- variant: "error"
265
- }) }), /* @__PURE__ */ O(h, { children: [
266
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(v, {
267
- id: "id",
268
- name: "id",
269
- label: s._({ id: "s2ubkU" }),
270
- value: p.id || "",
271
- onChange: E,
272
- onBlur: A,
273
- errortext: b.id
274
- }) }),
275
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(v, {
276
- id: "name",
277
- name: "name",
278
- label: s._({ id: "lWxDDh" }),
279
- value: p.name || "",
280
- onChange: E,
281
- onBlur: A,
282
- errortext: b.name,
283
- required: !0
284
- }) }),
285
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(v, {
286
- id: "description",
287
- name: "description",
288
- label: s._({ id: "Nu4oKW" }),
289
- value: p.description || "",
290
- onChange: E,
291
- onBlur: A,
292
- errortext: b.description
293
- }) }),
294
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(v, {
295
- id: "vcpus",
296
- name: "vcpus",
297
- label: s._({ id: "MZGbkp" }),
298
- value: String(p.vcpus || ""),
299
- onChange: (e) => k("vcpus", Number(e.target.value)),
300
- onBlur: A,
301
- errortext: b.vcpus,
302
- type: "number",
303
- required: !0
304
- }) }),
305
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(v, {
306
- id: "ram",
307
- name: "ram",
308
- label: s._({ id: "K+e/0e" }),
309
- value: String(p.ram || ""),
310
- onChange: (e) => k("ram", Number(e.target.value)),
311
- onBlur: A,
312
- errortext: b.ram,
313
- type: "number",
314
- required: !0
315
- }) }),
316
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(v, {
317
- id: "disk",
318
- name: "disk",
319
- label: s._({ id: "AxZkIr" }),
320
- value: String(p.disk || ""),
321
- onChange: (e) => k("disk", Number(e.target.value)),
322
- onBlur: A,
323
- errortext: b.disk,
324
- type: "number",
325
- required: !0
326
- }) }),
327
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(v, {
328
- id: "OS-FLV-EXT-DATA:ephemeral",
329
- name: "OS-FLV-EXT-DATA:ephemeral",
330
- label: s._({ id: "X2OnDx" }),
331
- value: String(p["OS-FLV-EXT-DATA:ephemeral"] || ""),
332
- onChange: (e) => k("OS-FLV-EXT-DATA:ephemeral", Number(e.target.value)),
333
- onBlur: A,
334
- errortext: b["OS-FLV-EXT-DATA:ephemeral"],
335
- type: "number"
336
- }) }),
337
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(v, {
338
- id: "swap",
339
- name: "swap",
340
- label: s._({ id: "p4nMut" }),
341
- value: String(p.swap || ""),
342
- onChange: (e) => k("swap", e.target.value ? Number(e.target.value) : void 0),
343
- onBlur: A,
344
- errortext: b.swap,
345
- type: "number"
346
- }) }),
347
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(v, {
348
- id: "rxtx_factor",
349
- name: "rxtx_factor",
350
- label: s._({ id: "u5HztT" }),
351
- defaultValue: 1,
352
- value: String(p.rxtx_factor || ""),
353
- onChange: (e) => k("rxtx_factor", Number(e.target.value)),
354
- onBlur: A,
355
- errortext: b.rxtx_factor,
356
- type: "number"
357
- }) }),
358
- /* @__PURE__ */ D(g, { children: /* @__PURE__ */ D(n, {
359
- name: "os-flavor-access:is_public",
360
- label: s._({ id: "vbajgL" }),
361
- helptext: s._({ id: "3nh/7E" }),
362
- checked: !!p["os-flavor-access:is_public"],
363
- onChange: E
364
- }) })
365
- ] })] })]
366
- });
367
- }, G = 50, K = (e, t, n, r, i) => e.compute.getFlavorsByProjectId.query({
368
- project_id: t,
369
- sortBy: n,
370
- sortDirection: r,
371
- searchTerm: i
372
- }), q = (e, t) => e.compute.canUser.query({
373
- project_id: t,
374
- permission: [
375
- "flavors:create",
376
- "flavors:delete",
377
- "flavors:list_projects"
378
- ]
379
- }).then(([e, t, n]) => ({
380
- canCreate: e,
381
- canDelete: t,
382
- canManageAccess: n
383
- }));
384
- function J({ flavorsPromise: e, permissionsPromise: t, client: n, project: r, onFlavorDeleted: i, onFlavorCreated: a, searchTerm: s, setSearchTerm: c, sortSettings: l, handleSortChange: u, createModalOpen: f, setCreateModalOpen: p, currentPage: m, onPageChange: h }) {
385
- let { i18n: g, _ } = B(), { flavors: v, privateFlavorError: y } = j(e), b = j(t), x = Math.max(1, Math.ceil(v.length / G)), S = Math.min(m, x), C = v.slice((S - 1) * G, S * G);
386
- return N(() => {
387
- m > x && h(1);
388
- }, [
389
- x,
390
- m,
391
- h
392
- ]), /* @__PURE__ */ O(E, { children: [
393
- /* @__PURE__ */ D(W, {
394
- client: n,
395
- isOpen: f,
396
- project: r,
397
- onClose: () => p(!1),
398
- onSuccess: a
399
- }),
400
- y && /* @__PURE__ */ D(o, {
401
- className: "mb-4",
402
- text: g._({ id: "3oc18/" }),
403
- variant: "warning"
404
- }),
405
- /* @__PURE__ */ D(T, {
406
- sortSettings: l,
407
- searchTerm: s,
408
- onSort: u,
409
- onSearch: c,
410
- actions: b.canCreate ? /* @__PURE__ */ D(d, {
411
- variant: "primary",
412
- label: g._({ id: "Rlp5zj" }),
413
- onClick: () => p(!0)
414
- }) : null
415
- }),
416
- /* @__PURE__ */ D(V, {
417
- flavors: C,
418
- isLoading: !1,
419
- client: n,
420
- project: r,
421
- onFlavorDeleted: i,
422
- canDeleteFlavor: b.canDelete,
423
- canMangageAccess: b.canManageAccess,
424
- currentPage: S,
425
- totalPages: x,
426
- onPageChange: h
427
- })
428
- ] });
429
- }
430
- var Y = ({ client: e, project: t }) => {
431
- let { i18n: n, _: r } = B(), i = I(), a = R({ strict: !1 }), [s, c] = P({
432
- options: [
433
- {
434
- label: n._({ id: "6YtxFj" }),
435
- value: "name"
436
- },
437
- {
438
- label: n._({ id: "MZGbkp" }),
439
- value: "vcpus"
440
- },
441
- {
442
- label: n._({ id: "RGhYAo" }),
443
- value: "ram"
444
- },
445
- {
446
- label: n._({ id: "cJDQIO" }),
447
- value: "disk"
448
- },
449
- {
450
- label: n._({ id: "vH2C/2" }),
451
- value: "swap"
452
- }
453
- ],
454
- sortBy: a.sortBy || "name",
455
- sortDirection: a.sortDirection || "asc"
456
- }), [u, d] = P(a.search || ""), f = a.page ?? 1, [p, m] = P(), [h, g] = P(!1), [v, y] = P(() => K(e, t, s.sortBy, s.sortDirection, u)), [b] = P(() => q(e, t)), x = () => {
457
- A(() => {
458
- y(K(e, t, s.sortBy, s.sortDirection, u));
459
- });
460
- }, S = (e) => {
461
- m({
462
- message: n._({
463
- id: "20Kpaw",
464
- values: { flavorName: e }
465
- }),
466
- timestamp: Date.now()
467
- }), setTimeout(() => m(void 0), 5e3), x();
468
- }, C = (e) => {
469
- m({
470
- message: n._({
471
- id: "eChIh7",
472
- values: { flavorName: e }
473
- }),
474
- timestamp: Date.now()
475
- }), setTimeout(() => m(void 0), 5e3), x();
476
- }, w = (n) => {
477
- let r = {
478
- options: n.options,
479
- sortBy: n.sortBy?.toString() || "name",
480
- sortDirection: n.sortDirection || "asc"
481
- };
482
- c(r), i({
483
- search: (e) => ({
484
- ...e,
485
- sortBy: r.sortBy,
486
- sortDirection: r.sortDirection,
487
- page: void 0
488
- }),
489
- replace: !0
490
- }), A(() => {
491
- y(K(e, t, r.sortBy, r.sortDirection, u));
492
- });
493
- }, T = (n) => {
494
- let r = typeof n == "string" ? n : "";
495
- d(r), i({
496
- search: (e) => ({
497
- ...e,
498
- search: r || void 0,
499
- page: void 0
500
- }),
501
- replace: !0
502
- }), A(() => {
503
- y(K(e, t, s.sortBy, s.sortDirection, r));
504
- });
505
- }, E = M((e) => {
506
- i({ search: (t) => ({
507
- ...t,
508
- page: e === 1 ? void 0 : e
509
- }) });
510
- }, [i]);
511
- return /* @__PURE__ */ O("div", {
512
- className: "relative",
513
- children: [p && /* @__PURE__ */ D(o, {
514
- className: "absolute -top-14 right-0 left-0 z-50",
515
- text: p.message,
516
- variant: "info",
517
- onDismiss: () => m(void 0),
518
- dismissible: !0
519
- }), /* @__PURE__ */ D(k, {
520
- fallback: /* @__PURE__ */ O(_, {
521
- className: "fixed inset-0",
522
- distribution: "center",
523
- alignment: "center",
524
- direction: "vertical",
525
- children: [/* @__PURE__ */ D(l, {
526
- variant: "primary",
527
- size: "large",
528
- className: "mb-2"
529
- }), /* @__PURE__ */ D(z, { id: "EqSPkP" })]
530
- }),
531
- children: /* @__PURE__ */ D(J, {
532
- flavorsPromise: v,
533
- permissionsPromise: b,
534
- client: e,
535
- project: t,
536
- onFlavorDeleted: S,
537
- onFlavorCreated: C,
538
- searchTerm: u,
539
- setSearchTerm: T,
540
- sortSettings: s,
541
- handleSortChange: w,
542
- createModalOpen: h,
543
- setCreateModalOpen: g,
544
- currentPage: f,
545
- onPageChange: E
546
- })
547
- })]
548
- });
549
- };
550
- //#endregion
551
- //#region src/client/routes/_auth/projects/$projectId/compute/flavors/index.tsx?tsr-split=component
552
- function X() {
553
- let { i18n: e, _: t } = B(), { projectId: n } = b.useParams(), { trpcClient: r } = b.useRouteContext();
554
- return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(w, {
555
- title: e._({ id: "neiJm0" }),
556
- projectId: n
557
- }), /* @__PURE__ */ D(Y, {
558
- project: n,
559
- client: r
560
- })] });
561
- }
562
- //#endregion
563
- export { X as component };
564
-
565
- //# sourceMappingURL=flavors-pEcGkCut.mjs.map