@prorobotech/openapi-k8s-toolkit 1.1.0-alpha.1 → 1.1.0-alpha.10
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/openapi-k8s-toolkit.es.js +1323 -590
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +1327 -589
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/atoms/CursorDefaultDiv/CursorDefaultDiv.d.ts +2 -2
- package/dist/types/components/atoms/CursorDefaultDiv/index.d.ts +1 -1
- package/dist/types/components/atoms/CursorPointerTag/index.d.ts +1 -1
- package/dist/types/components/atoms/CursorPointerTagMinContent/index.d.ts +1 -1
- package/dist/types/components/atoms/CustomSelect/index.d.ts +1 -1
- package/dist/types/components/atoms/FlexGrow/index.d.ts +1 -1
- package/dist/types/components/atoms/PaddingContainer/index.d.ts +1 -1
- package/dist/types/components/atoms/ResourceLink/ResourceLink.d.ts +19 -0
- package/dist/types/components/atoms/ResourceLink/index.d.ts +1 -0
- package/dist/types/components/atoms/ResourceLink/styled.d.ts +8 -0
- package/dist/types/components/atoms/UncontrolledSelect/index.d.ts +1 -1
- package/dist/types/components/atoms/index.d.ts +19 -13
- package/dist/types/components/molecules/BlackholeForm/atoms/ArrayInsideContainer/ArrayInsideContainer.d.ts +2 -2
- package/dist/types/components/molecules/BlackholeForm/atoms/ArrayInsideContainer/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/CustomCollapse/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/CustomSizeTitle/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/DebugNameViewer/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/HeightContainer/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/HiddenContainer/HiddenContainer.d.ts +4 -2
- package/dist/types/components/molecules/BlackholeForm/atoms/HiddenContainer/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/PersistedCheckbox/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/PossibleHiddenContainer/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/ResetedFormItem/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/atoms/index.d.ts +9 -9
- package/dist/types/components/molecules/BlackholeForm/index.d.ts +2 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormArrayHeader/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormBooleanInput/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormEnumStringInput/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormInlineYamlEditor/FormInlineYamlEditor.d.ts +4 -2
- package/dist/types/components/molecules/BlackholeForm/molecules/FormInlineYamlEditor/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormListInput/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormNamespaceInput/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormNumberInput/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormObjectFromSwagger/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormRangeInput/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormRangeInput/molecules/RangeInput/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormRangeInput/molecules/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormStringInput/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/FormStringMultilineInput/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/YamlEditor/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/YamlEditorSingleton/index.d.ts +1 -1
- package/dist/types/components/molecules/BlackholeForm/molecules/index.d.ts +13 -13
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/BlackholeForm.d.ts +2 -3
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/index.d.ts +1 -0
- package/dist/types/components/molecules/BlackholeForm/organisms/{BlackholeFormDataProvider/BlackholeFormDataProvider.d.ts → BlackholeFormProvider/BlackholeFormProvider.d.ts} +2 -2
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormProvider/index.d.ts +2 -0
- package/dist/types/components/molecules/BlackholeForm/organisms/index.d.ts +4 -2
- package/dist/types/components/molecules/EnrichedTable/index.d.ts +2 -1
- package/dist/types/components/molecules/EnrichedTable/molecules/index.d.ts +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/FilterDropdown/index.d.ts +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/ShortenedTextWithTooltip/index.d.ts +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TableComponents/index.d.ts +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TextAlignContainer/index.d.ts +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TinyButton/index.d.ts +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TrimmedTags/index.d.ts +1 -1
- package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/index.d.ts +6 -6
- package/dist/types/components/molecules/EnrichedTable/organisms/index.d.ts +4 -2
- package/dist/types/components/molecules/Events/Events.d.ts +3 -2
- package/dist/types/components/molecules/Events/index.d.ts +1 -0
- package/dist/types/components/molecules/Events/molecules/EventRow/EventRow.d.ts +1 -0
- package/dist/types/components/molecules/Events/molecules/EventRow/utils.d.ts +0 -20
- package/dist/types/components/molecules/ManageableBreadcrumbs/index.d.ts +2 -3
- package/dist/types/components/molecules/ManageableBreadcrumbs/molecules/CollapsibleBreadcrumb/index.d.ts +1 -1
- package/dist/types/components/molecules/ManageableBreadcrumbs/molecules/index.d.ts +1 -1
- package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbs/ManageableBreadcrumbs.d.ts +8 -0
- package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbs/index.d.ts +2 -0
- package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbsProvider/ManageableBreadcrumbsProvider.d.ts +12 -0
- package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbsProvider/index.d.ts +3 -0
- package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbsProvider/styled.d.ts +276 -0
- package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/index.d.ts +4 -0
- package/dist/types/components/molecules/ManageableSidebar/index.d.ts +2 -3
- package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebar/ManageableSidebar.d.ts +10 -0
- package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebar/index.d.ts +2 -0
- package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/ManageableSidebarProvider.d.ts +15 -0
- package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/index.d.ts +3 -0
- package/dist/types/components/molecules/ManageableSidebar/organisms/index.d.ts +4 -0
- package/dist/types/components/molecules/MarketPlace/atoms/AddCard/index.d.ts +1 -1
- package/dist/types/components/molecules/MarketPlace/atoms/index.d.ts +1 -1
- package/dist/types/components/molecules/MarketPlace/molecules/AddEditFormModal/index.d.ts +1 -1
- package/dist/types/components/molecules/MarketPlace/molecules/MarketplaceCard/index.d.ts +2 -1
- package/dist/types/components/molecules/MarketPlace/molecules/SearchTextInput/index.d.ts +1 -1
- package/dist/types/components/molecules/MarketPlace/molecules/index.d.ts +4 -3
- package/dist/types/components/molecules/ProjectInfoCard/molecules/DropdownAccessGroups/index.d.ts +1 -1
- package/dist/types/components/molecules/ProjectInfoCard/molecules/DropdownActions/index.d.ts +1 -1
- package/dist/types/components/molecules/ProjectInfoCard/molecules/index.d.ts +2 -2
- package/dist/types/components/molecules/Search/Search.d.ts +1 -2
- package/dist/types/components/molecules/Search/index.d.ts +1 -0
- package/dist/types/components/molecules/Terminals/NodeTerminal/molecules/XTerminal/index.d.ts +1 -1
- package/dist/types/components/molecules/Terminals/NodeTerminal/molecules/index.d.ts +1 -1
- package/dist/types/components/molecules/Terminals/PodLogs/molecules/XTerminal/index.d.ts +1 -1
- package/dist/types/components/molecules/Terminals/PodLogs/molecules/index.d.ts +1 -1
- package/dist/types/components/molecules/Terminals/PodLogsMonaco/molecules/MonacoEditor/index.d.ts +1 -1
- package/dist/types/components/molecules/Terminals/PodLogsMonaco/molecules/index.d.ts +1 -1
- package/dist/types/components/molecules/Terminals/PodTerminal/molecules/XTerminal/index.d.ts +1 -1
- package/dist/types/components/molecules/Terminals/PodTerminal/molecules/index.d.ts +1 -1
- package/dist/types/components/molecules/Terminals/index.d.ts +8 -4
- package/dist/types/components/molecules/index.d.ts +18 -9
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/molecules/EditModal/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/molecules/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdButton/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdCard/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdCol/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdFlex/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdLink/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdRow/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdTabs/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/AntdText/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/ArrayOfObjectsToKeyValues/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/ContentCard/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/DefaultDiv/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Events/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/ItemCounter/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/KeyCounter/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Labels/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Labels/molecules/EditModal/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Labels/molecules/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/LabelsToSearchParams/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/MarketplaceCard/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/MultiQuery/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/NodeTerminal/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/OwnerRefs.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/guard.d.ts +2 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/RefsList.d.ts +22 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/RefElement.d.ts +21 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/utils.d.ts +5 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/index.d.ts +1 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/types.d.ts +6 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/ParsedText/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/PartsOfUrl/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/PodLogs/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/PodTerminal/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/ProjectInfoCard/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/ResourceBadge/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/SidebarProvider/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Spacer/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/StatusText/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/molecules/EditModal/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Taints/molecules/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/molecules/EditModal/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/molecules/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/VisibilityContainer/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/YamlEditorSingleton/index.d.ts +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/YamlEditorSingleton/utils.d.ts +10 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +37 -36
- package/dist/types/components/organisms/DynamicComponents/types.d.ts +37 -5
- package/dist/types/components/organisms/DynamicRendererWithProviders/DynamicRendererWithProviders.d.ts +2 -1
- package/dist/types/components/organisms/DynamicRendererWithProviders/hybridDataProvider.d.ts +22 -0
- package/dist/types/components/organisms/DynamicRendererWithProviders/multiK8sProvider.d.ts +22 -0
- package/dist/types/components/organisms/index.d.ts +5 -3
- package/dist/types/hooks/useApiResource.d.ts +1 -0
- package/dist/types/hooks/useBuiltinResource.d.ts +1 -0
- package/dist/types/hooks/useCrdResource.d.ts +1 -0
- package/dist/types/hooks/useK8sSmartResource.d.ts +29 -0
- package/dist/types/hooks/useK8sVerbs.d.ts +13 -0
- package/dist/types/hooks/useListThenWatch/types.d.ts +10 -1
- package/dist/types/hooks/useListThenWatch/useListWatch.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/localTypes/bff/table.d.ts +1 -0
- package/dist/types/localTypes/dynamicRender.d.ts +2 -1
- package/dist/types/localTypes/k8s.d.ts +1 -0
- package/dist/types/localTypes/navigations.d.ts +24 -0
- package/dist/types/utils/createContextFactory/index.d.ts +1 -1
- package/dist/types/utils/deepMerge/index.d.ts +1 -1
- package/dist/types/utils/filterSelectOptions/index.d.ts +1 -1
- package/dist/types/utils/getAllPathsFromObj/index.d.ts +1 -1
- package/dist/types/utils/getGroupsByCategory/index.d.ts +1 -1
- package/dist/types/utils/getPrefixSubArrays/index.d.ts +1 -1
- package/dist/types/utils/getResourceLink/getResourceLink.d.ts +27 -0
- package/dist/types/utils/getResourceLink/index.d.ts +1 -0
- package/dist/types/utils/getSortedKinds/index.d.ts +1 -1
- package/dist/types/utils/getSortedKindsAll/index.d.ts +1 -1
- package/dist/types/utils/getStringByName/index.d.ts +1 -1
- package/dist/types/utils/getUppercase/index.d.ts +1 -1
- package/dist/types/utils/groupsToTreeData/index.d.ts +2 -1
- package/dist/types/utils/hslFromString/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts +25 -22
- package/dist/types/utils/isFlatObject/index.d.ts +1 -1
- package/dist/types/utils/kindByGvr/index.d.ts +1 -1
- package/dist/types/utils/namespacedByGvr/index.d.ts +1 -1
- package/dist/types/utils/nestedStringsArrayInclude/index.d.ts +1 -1
- package/dist/types/utils/normalizeValuesForQuotas/index.d.ts +1 -1
- package/dist/types/utils/parseForQuotaValues/index.d.ts +1 -1
- package/dist/types/utils/pluralByKind/index.d.ts +1 -1
- package/dist/types/utils/prepareTemplate/index.d.ts +1 -1
- package/dist/types/utils/prepareUrlsToFetchForDynamicRenderer/index.d.ts +1 -1
- package/dist/types/utils/tableLocations/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormDataProvider/index.d.ts +0 -2
- package/dist/types/components/molecules/ManageableBreadcrumbs/ManageableBreadcrumbs.d.ts +0 -19
- package/dist/types/components/molecules/ManageableSidebar/ManageableSidebar.d.ts +0 -24
- /package/dist/types/components/molecules/ManageableBreadcrumbs/{styled.d.ts → organisms/ManageableBreadcrumbs/styled.d.ts} +0 -0
- /package/dist/types/components/molecules/ManageableBreadcrumbs/{types.d.ts → organisms/ManageableBreadcrumbsProvider/types.d.ts} +0 -0
- /package/dist/types/components/molecules/ManageableBreadcrumbs/{utils.d.ts → organisms/ManageableBreadcrumbsProvider/utils.d.ts} +0 -0
- /package/dist/types/components/molecules/ManageableSidebar/{styled.d.ts → organisms/ManageableSidebar/styled.d.ts} +0 -0
- /package/dist/types/components/molecules/ManageableSidebar/{types.d.ts → organisms/ManageableSidebarProvider/types.d.ts} +0 -0
- /package/dist/types/components/molecules/ManageableSidebar/{utils.d.ts → organisms/ManageableSidebarProvider/utils.d.ts} +0 -0
|
@@ -1573,7 +1573,7 @@
|
|
|
1573
1573
|
justify-content: center;
|
|
1574
1574
|
}
|
|
1575
1575
|
`;
|
|
1576
|
-
const Styled$
|
|
1576
|
+
const Styled$C = {
|
|
1577
1577
|
CustomTreeProvider
|
|
1578
1578
|
};
|
|
1579
1579
|
|
|
@@ -1638,7 +1638,7 @@
|
|
|
1638
1638
|
});
|
|
1639
1639
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1640
1640
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Search$1, { style: { marginBottom: 8 }, placeholder: "Search", onChange }),
|
|
1641
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
1641
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$C.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1642
1642
|
antd.Tree,
|
|
1643
1643
|
{
|
|
1644
1644
|
treeData: loop(treeData),
|
|
@@ -8167,14 +8167,14 @@
|
|
|
8167
8167
|
display: ${({ $displayFlex }) => $displayFlex ? "flex" : "block"};
|
|
8168
8168
|
flex-flow: ${({ $flexFlow }) => $flexFlow};
|
|
8169
8169
|
`;
|
|
8170
|
-
const Styled$
|
|
8170
|
+
const Styled$B = {
|
|
8171
8171
|
ContentContainer
|
|
8172
8172
|
};
|
|
8173
8173
|
|
|
8174
8174
|
const ContentCard$1 = ({ children, flexGrow, displayFlex, flexFlow, maxHeight }) => {
|
|
8175
8175
|
const { token } = antd.theme.useToken();
|
|
8176
8176
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8177
|
-
Styled$
|
|
8177
|
+
Styled$B.ContentContainer,
|
|
8178
8178
|
{
|
|
8179
8179
|
$flexGrow: flexGrow,
|
|
8180
8180
|
$bgColor: token.colorBgContainer,
|
|
@@ -8235,13 +8235,13 @@
|
|
|
8235
8235
|
padding-inline: 8px;
|
|
8236
8236
|
}
|
|
8237
8237
|
`;
|
|
8238
|
-
const Styled$
|
|
8238
|
+
const Styled$A = {
|
|
8239
8239
|
UncontrolledSelect: UncontrolledSelect$1
|
|
8240
8240
|
};
|
|
8241
8241
|
|
|
8242
8242
|
const UncontrolledSelect = (props) => {
|
|
8243
8243
|
const { isCursorPointer } = props;
|
|
8244
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8244
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$A.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
|
|
8245
8245
|
};
|
|
8246
8246
|
|
|
8247
8247
|
const CustomSelect$5 = styled(antd.Select)`
|
|
@@ -8289,13 +8289,13 @@
|
|
|
8289
8289
|
margin-block: 0 !important;
|
|
8290
8290
|
}
|
|
8291
8291
|
`;
|
|
8292
|
-
const Styled$
|
|
8292
|
+
const Styled$z = {
|
|
8293
8293
|
CustomSelect: CustomSelect$5
|
|
8294
8294
|
};
|
|
8295
8295
|
|
|
8296
8296
|
const CustomSelect$4 = (props) => {
|
|
8297
8297
|
const { paddingContainerEnd, ...rest } = props;
|
|
8298
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$
|
|
8298
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$z.CustomSelect, { $paddingContainerEnd: paddingContainerEnd, ...rest });
|
|
8299
8299
|
};
|
|
8300
8300
|
|
|
8301
8301
|
const CursorPointerTag = styled(antd.Tag)`
|
|
@@ -8315,11 +8315,331 @@
|
|
|
8315
8315
|
padding: ${({ $padding }) => $padding};
|
|
8316
8316
|
`;
|
|
8317
8317
|
|
|
8318
|
-
const
|
|
8319
|
-
const
|
|
8320
|
-
|
|
8321
|
-
|
|
8318
|
+
const getUppercase = (s) => {
|
|
8319
|
+
const uppercases = [...s].filter((c) => c >= "A" && c <= "Z").join("");
|
|
8320
|
+
return uppercases.length > 0 ? uppercases : s[0].toUpperCase();
|
|
8321
|
+
};
|
|
8322
|
+
|
|
8323
|
+
const fnv1a32 = (str) => {
|
|
8324
|
+
let h = 2166136261;
|
|
8325
|
+
for (const ch of str) {
|
|
8326
|
+
h ^= ch.codePointAt(0);
|
|
8327
|
+
h = (h >>> 0) * 16777619;
|
|
8328
|
+
}
|
|
8329
|
+
return h >>> 0;
|
|
8330
|
+
};
|
|
8331
|
+
const pickInRange = (u32, min, max) => min + u32 % (max - min + 1);
|
|
8332
|
+
const hslFromString = (value, theme) => {
|
|
8333
|
+
const hash = fnv1a32(value);
|
|
8334
|
+
const hue = hash % 345;
|
|
8335
|
+
const [sMin, sMax] = theme === "light" ? [90, 100] : [78, 80];
|
|
8336
|
+
const [lMin, lMax] = theme === "light" ? [78, 80] : [25, 35];
|
|
8337
|
+
const s = pickInRange(hash >>> 8, sMin, sMax);
|
|
8338
|
+
const l = pickInRange(hash >>> 16, lMin, lMax);
|
|
8339
|
+
return `hsl(${hue}, ${s}%, ${l}%)`;
|
|
8340
|
+
};
|
|
8341
|
+
|
|
8342
|
+
const parseApiVersion$1 = (apiVersion) => {
|
|
8343
|
+
const parts = apiVersion.split("/");
|
|
8344
|
+
if (parts.length === 1) {
|
|
8345
|
+
return {
|
|
8346
|
+
apiGroup: void 0,
|
|
8347
|
+
apiVersion: parts[0]
|
|
8348
|
+
};
|
|
8349
|
+
}
|
|
8350
|
+
return {
|
|
8351
|
+
apiGroup: parts[0],
|
|
8352
|
+
apiVersion: parts[1]
|
|
8353
|
+
};
|
|
8354
|
+
};
|
|
8355
|
+
const getFactoryKey = ({
|
|
8356
|
+
apiGroup,
|
|
8357
|
+
apiVersion,
|
|
8358
|
+
resource,
|
|
8359
|
+
namespace,
|
|
8360
|
+
baseFactoriesMapping,
|
|
8361
|
+
baseFactoryNamespacedAPIKey,
|
|
8362
|
+
baseFactoryClusterSceopedAPIKey,
|
|
8363
|
+
baseFactoryNamespacedBuiltinKey,
|
|
8364
|
+
baseFactoryClusterSceopedBuiltinKey
|
|
8365
|
+
}) => {
|
|
8366
|
+
if (namespace) {
|
|
8367
|
+
if (apiGroup) {
|
|
8368
|
+
const forcedMapping3 = baseFactoriesMapping?.[`${baseFactoryNamespacedAPIKey}-${apiGroup}-${apiVersion}-${resource}`];
|
|
8369
|
+
return forcedMapping3 || baseFactoryNamespacedAPIKey || "";
|
|
8370
|
+
}
|
|
8371
|
+
const forcedMapping2 = baseFactoriesMapping?.[`${baseFactoryNamespacedBuiltinKey}-${apiVersion}-${resource}`];
|
|
8372
|
+
return forcedMapping2 || baseFactoryNamespacedBuiltinKey || "";
|
|
8373
|
+
}
|
|
8374
|
+
if (apiGroup) {
|
|
8375
|
+
const forcedMapping2 = baseFactoriesMapping?.[`${baseFactoryClusterSceopedAPIKey}-${apiGroup}-${apiVersion}-${resource}`];
|
|
8376
|
+
return forcedMapping2 || baseFactoryClusterSceopedAPIKey || "";
|
|
8377
|
+
}
|
|
8378
|
+
const forcedMapping = baseFactoriesMapping?.[`${baseFactoryClusterSceopedBuiltinKey}-${apiVersion}-${resource}`];
|
|
8379
|
+
return forcedMapping || baseFactoryClusterSceopedBuiltinKey || "";
|
|
8322
8380
|
};
|
|
8381
|
+
const getResourceLink = ({
|
|
8382
|
+
baseprefix,
|
|
8383
|
+
cluster,
|
|
8384
|
+
namespace,
|
|
8385
|
+
apiGroupVersion,
|
|
8386
|
+
pluralName,
|
|
8387
|
+
name,
|
|
8388
|
+
baseFactoryNamespacedAPIKey,
|
|
8389
|
+
baseFactoryClusterSceopedAPIKey,
|
|
8390
|
+
baseFactoryNamespacedBuiltinKey,
|
|
8391
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
8392
|
+
baseFactoriesMapping
|
|
8393
|
+
}) => {
|
|
8394
|
+
if (!pluralName || !name) {
|
|
8395
|
+
return void 0;
|
|
8396
|
+
}
|
|
8397
|
+
const { apiGroup, apiVersion } = parseApiVersion$1(apiGroupVersion);
|
|
8398
|
+
if (apiGroupVersion === "v1") {
|
|
8399
|
+
return `${baseprefix}/${cluster}${namespace ? `/${namespace}` : ""}/factory/${getFactoryKey({
|
|
8400
|
+
apiGroup,
|
|
8401
|
+
apiVersion,
|
|
8402
|
+
resource: pluralName,
|
|
8403
|
+
namespace,
|
|
8404
|
+
baseFactoriesMapping,
|
|
8405
|
+
baseFactoryNamespacedAPIKey,
|
|
8406
|
+
baseFactoryClusterSceopedAPIKey,
|
|
8407
|
+
baseFactoryNamespacedBuiltinKey,
|
|
8408
|
+
baseFactoryClusterSceopedBuiltinKey
|
|
8409
|
+
})}/${apiGroupVersion}/${pluralName}/${name}`;
|
|
8410
|
+
}
|
|
8411
|
+
return `${baseprefix}/${cluster}${namespace ? `/${namespace}` : ""}/factory/${getFactoryKey({
|
|
8412
|
+
apiGroup,
|
|
8413
|
+
apiVersion,
|
|
8414
|
+
resource: pluralName,
|
|
8415
|
+
namespace,
|
|
8416
|
+
baseFactoriesMapping,
|
|
8417
|
+
baseFactoryNamespacedAPIKey,
|
|
8418
|
+
baseFactoryClusterSceopedAPIKey,
|
|
8419
|
+
baseFactoryNamespacedBuiltinKey,
|
|
8420
|
+
baseFactoryClusterSceopedBuiltinKey
|
|
8421
|
+
})}/${apiGroupVersion}/${pluralName}/${name}`;
|
|
8422
|
+
};
|
|
8423
|
+
const getNamespaceLink = ({
|
|
8424
|
+
baseprefix,
|
|
8425
|
+
cluster,
|
|
8426
|
+
apiGroupVersion,
|
|
8427
|
+
pluralName,
|
|
8428
|
+
namespace,
|
|
8429
|
+
baseNamespaceFactoryKey
|
|
8430
|
+
}) => {
|
|
8431
|
+
if (!namespace) {
|
|
8432
|
+
return void 0;
|
|
8433
|
+
}
|
|
8434
|
+
return `${baseprefix}/${cluster}/factory/${baseNamespaceFactoryKey}/${apiGroupVersion}/${pluralName}/${namespace}`;
|
|
8435
|
+
};
|
|
8436
|
+
|
|
8437
|
+
const Abbr$2 = styled.span`
|
|
8438
|
+
background-color: ${({ $bgColor }) => $bgColor};
|
|
8439
|
+
border-radius: 13px;
|
|
8440
|
+
padding: 1px 5px;
|
|
8441
|
+
font-size: 13px;
|
|
8442
|
+
height: min-content;
|
|
8443
|
+
margin-right: 4px;
|
|
8444
|
+
`;
|
|
8445
|
+
const Styled$y = {
|
|
8446
|
+
Abbr: Abbr$2
|
|
8447
|
+
};
|
|
8448
|
+
|
|
8449
|
+
const ResourceLink = ({
|
|
8450
|
+
kind,
|
|
8451
|
+
apiVersion,
|
|
8452
|
+
namespace,
|
|
8453
|
+
name,
|
|
8454
|
+
forcedName,
|
|
8455
|
+
theme,
|
|
8456
|
+
baseprefix,
|
|
8457
|
+
cluster,
|
|
8458
|
+
getPlural,
|
|
8459
|
+
baseFactoryNamespacedAPIKey,
|
|
8460
|
+
baseFactoryClusterSceopedAPIKey,
|
|
8461
|
+
baseFactoryNamespacedBuiltinKey,
|
|
8462
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
8463
|
+
baseFactoriesMapping
|
|
8464
|
+
}) => {
|
|
8465
|
+
const navigate = reactRouterDom.useNavigate();
|
|
8466
|
+
const abbr = kind ? getUppercase(kind) : void 0;
|
|
8467
|
+
const bgColor = kind && abbr ? hslFromString(kind, theme) : "initial";
|
|
8468
|
+
const parsedKind = kind;
|
|
8469
|
+
const parsedApiVersion = apiVersion;
|
|
8470
|
+
const pluralName = parsedKind && parsedApiVersion ? getPlural?.(parsedKind, parsedApiVersion) : void 0;
|
|
8471
|
+
const resourceLink = getResourceLink({
|
|
8472
|
+
baseprefix,
|
|
8473
|
+
cluster,
|
|
8474
|
+
namespace,
|
|
8475
|
+
apiGroupVersion: parsedApiVersion,
|
|
8476
|
+
pluralName,
|
|
8477
|
+
name,
|
|
8478
|
+
baseFactoryNamespacedAPIKey,
|
|
8479
|
+
baseFactoryClusterSceopedAPIKey,
|
|
8480
|
+
baseFactoryNamespacedBuiltinKey,
|
|
8481
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
8482
|
+
baseFactoriesMapping
|
|
8483
|
+
});
|
|
8484
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 8, children: [
|
|
8485
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$y.Abbr, { $bgColor: bgColor, children: abbr }),
|
|
8486
|
+
resourceLink ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8487
|
+
antd.Typography.Link,
|
|
8488
|
+
{
|
|
8489
|
+
onClick: (e) => {
|
|
8490
|
+
e.preventDefault();
|
|
8491
|
+
navigate(resourceLink);
|
|
8492
|
+
},
|
|
8493
|
+
children: forcedName || name
|
|
8494
|
+
}
|
|
8495
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { children: forcedName || name })
|
|
8496
|
+
] });
|
|
8497
|
+
};
|
|
8498
|
+
|
|
8499
|
+
const PositionRelativeContainer = styled.div`
|
|
8500
|
+
position: relative;
|
|
8501
|
+
`;
|
|
8502
|
+
const FullWidthContainer = styled.div`
|
|
8503
|
+
width: 100%;
|
|
8504
|
+
|
|
8505
|
+
.ant-dropdown-trigger svg {
|
|
8506
|
+
display: none;
|
|
8507
|
+
}
|
|
8508
|
+
`;
|
|
8509
|
+
const NoWrapContainer = styled.div`
|
|
8510
|
+
position: absolute;
|
|
8511
|
+
visibility: hidden;
|
|
8512
|
+
pointer-events: none;
|
|
8513
|
+
|
|
8514
|
+
/* stylelint-disable declaration-no-important */
|
|
8515
|
+
|
|
8516
|
+
* {
|
|
8517
|
+
white-space: nowrap !important;
|
|
8518
|
+
}
|
|
8519
|
+
|
|
8520
|
+
ol {
|
|
8521
|
+
flex-wrap: nowrap !important;
|
|
8522
|
+
}
|
|
8523
|
+
`;
|
|
8524
|
+
const Styled$x = {
|
|
8525
|
+
PositionRelativeContainer,
|
|
8526
|
+
FullWidthContainer,
|
|
8527
|
+
NoWrapContainer
|
|
8528
|
+
};
|
|
8529
|
+
|
|
8530
|
+
const CollapsibleBreadcrumb = ({ items }) => {
|
|
8531
|
+
const [isCollapsed, setIsCollapsed] = K.useState(false);
|
|
8532
|
+
const containerRef = K.useRef(null);
|
|
8533
|
+
const breadcrumbRef = K.useRef(null);
|
|
8534
|
+
K.useLayoutEffect(() => {
|
|
8535
|
+
const checkWidth = () => {
|
|
8536
|
+
if (containerRef.current && breadcrumbRef.current) {
|
|
8537
|
+
const containerWidth = containerRef.current.clientWidth;
|
|
8538
|
+
const breadcrumbWidth = breadcrumbRef.current.scrollWidth;
|
|
8539
|
+
setIsCollapsed(breadcrumbWidth > containerWidth);
|
|
8540
|
+
}
|
|
8541
|
+
};
|
|
8542
|
+
checkWidth();
|
|
8543
|
+
window.addEventListener("resize", checkWidth);
|
|
8544
|
+
return () => window.removeEventListener("resize", checkWidth);
|
|
8545
|
+
}, [items]);
|
|
8546
|
+
const renderItems = () => {
|
|
8547
|
+
if (!isCollapsed) {
|
|
8548
|
+
return items;
|
|
8549
|
+
}
|
|
8550
|
+
if (items.length <= 2) {
|
|
8551
|
+
return items;
|
|
8552
|
+
}
|
|
8553
|
+
const firstItem = items[0];
|
|
8554
|
+
const lastItem = items[items.length - 1];
|
|
8555
|
+
const hiddenItems = items.slice(1, -1);
|
|
8556
|
+
const menuItems = hiddenItems.map((item, index) => ({
|
|
8557
|
+
key: String(index),
|
|
8558
|
+
label: item.href ? /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: item.href, children: item.title }) : item.title
|
|
8559
|
+
}));
|
|
8560
|
+
const ellipsisItem = {
|
|
8561
|
+
title: "...",
|
|
8562
|
+
menu: { items: menuItems },
|
|
8563
|
+
dropdownProps: { arrow: false }
|
|
8564
|
+
};
|
|
8565
|
+
return [firstItem, ellipsisItem, lastItem];
|
|
8566
|
+
};
|
|
8567
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$x.PositionRelativeContainer, { children: [
|
|
8568
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$x.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items: renderItems() }) }),
|
|
8569
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$x.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
|
|
8570
|
+
] });
|
|
8571
|
+
};
|
|
8572
|
+
|
|
8573
|
+
const HeightDiv$1 = styled.div`
|
|
8574
|
+
min-height: 22px;
|
|
8575
|
+
width: 100%;
|
|
8576
|
+
`;
|
|
8577
|
+
const Styled$w = {
|
|
8578
|
+
HeightDiv: HeightDiv$1
|
|
8579
|
+
};
|
|
8580
|
+
|
|
8581
|
+
const ManageableBreadcrumbs = ({ data }) => {
|
|
8582
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$w.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
|
|
8583
|
+
};
|
|
8584
|
+
|
|
8585
|
+
const getDirectUnknownResource = async ({ uri }) => {
|
|
8586
|
+
return axios.get(uri);
|
|
8587
|
+
};
|
|
8588
|
+
|
|
8589
|
+
const useDirectUnknownResource = ({
|
|
8590
|
+
uri,
|
|
8591
|
+
queryKey,
|
|
8592
|
+
refetchInterval,
|
|
8593
|
+
isEnabled
|
|
8594
|
+
}) => {
|
|
8595
|
+
return reactQuery.useQuery({
|
|
8596
|
+
queryKey,
|
|
8597
|
+
queryFn: async () => {
|
|
8598
|
+
const response = await getDirectUnknownResource({
|
|
8599
|
+
uri
|
|
8600
|
+
});
|
|
8601
|
+
const data = JSON.parse(JSON.stringify(response.data));
|
|
8602
|
+
if (data.metadata?.resourceVersion) {
|
|
8603
|
+
delete data.metadata.resourceVersion;
|
|
8604
|
+
}
|
|
8605
|
+
return data;
|
|
8606
|
+
},
|
|
8607
|
+
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3,
|
|
8608
|
+
enabled: isEnabled
|
|
8609
|
+
});
|
|
8610
|
+
};
|
|
8611
|
+
|
|
8612
|
+
const useK8sVerbs = ({
|
|
8613
|
+
cluster,
|
|
8614
|
+
group,
|
|
8615
|
+
version,
|
|
8616
|
+
plural,
|
|
8617
|
+
isEnabled = true
|
|
8618
|
+
}) => {
|
|
8619
|
+
const uri = `/api/clusters/${cluster}/openapi-bff/verbs/getResourceVerbs?${new URLSearchParams({
|
|
8620
|
+
...group ? { group } : {},
|
|
8621
|
+
version,
|
|
8622
|
+
plural
|
|
8623
|
+
}).toString()}`;
|
|
8624
|
+
const { data, isError, isLoading, error } = useDirectUnknownResource({
|
|
8625
|
+
uri,
|
|
8626
|
+
queryKey: ["k8s-verbs", cluster, group || "", version, plural],
|
|
8627
|
+
refetchInterval: false,
|
|
8628
|
+
isEnabled: Boolean(isEnabled && cluster && version && plural)
|
|
8629
|
+
});
|
|
8630
|
+
const verbs = data?.verbs || [];
|
|
8631
|
+
const canList = verbs.includes("list");
|
|
8632
|
+
const canWatch = verbs.includes("watch");
|
|
8633
|
+
return {
|
|
8634
|
+
canList,
|
|
8635
|
+
canWatch,
|
|
8636
|
+
isError,
|
|
8637
|
+
isLoading,
|
|
8638
|
+
error
|
|
8639
|
+
};
|
|
8640
|
+
};
|
|
8641
|
+
|
|
8642
|
+
const eventKey$1 = (e) => e.metadata?.uid ?? `${e.metadata?.namespace ?? ""}/${e.metadata?.name ?? ""}`;
|
|
8323
8643
|
const compareRV$1 = (a, b) => {
|
|
8324
8644
|
if (a.length !== b.length) return a.length > b.length ? 1 : -1;
|
|
8325
8645
|
return a > b ? 1 : a < b ? -1 : 0;
|
|
@@ -8403,6 +8723,7 @@
|
|
|
8403
8723
|
const [lastError, setLastError] = K.useState(void 0);
|
|
8404
8724
|
const [isPaused, setIsPaused] = K.useState(paused);
|
|
8405
8725
|
const [isRemoveIgnored, setIsRemoveIgnored] = K.useState(ignoreRemove);
|
|
8726
|
+
const [hasInitial, setHasInitial] = K.useState(false);
|
|
8406
8727
|
const queryRef = K.useRef(query);
|
|
8407
8728
|
const wsRef = K.useRef(null);
|
|
8408
8729
|
const connectingRef = K.useRef(false);
|
|
@@ -8574,19 +8895,6 @@
|
|
|
8574
8895
|
wsRef.current = null;
|
|
8575
8896
|
connect();
|
|
8576
8897
|
}, [closeWS, connect, setStatusSafe]);
|
|
8577
|
-
K.useEffect(() => {
|
|
8578
|
-
if (!mountedRef.current) return;
|
|
8579
|
-
if (isEnabled) {
|
|
8580
|
-
connect();
|
|
8581
|
-
} else {
|
|
8582
|
-
if (reconnectTimerRef.current) {
|
|
8583
|
-
window.clearTimeout(reconnectTimerRef.current);
|
|
8584
|
-
reconnectTimerRef.current = null;
|
|
8585
|
-
}
|
|
8586
|
-
closeWS();
|
|
8587
|
-
setStatusSafe("closed");
|
|
8588
|
-
}
|
|
8589
|
-
}, [isEnabled, closeWS, connect, setStatusSafe]);
|
|
8590
8898
|
const setUrl = K.useCallback(
|
|
8591
8899
|
(next) => {
|
|
8592
8900
|
const changed = next !== urlRef.current;
|
|
@@ -8600,6 +8908,7 @@
|
|
|
8600
8908
|
setHasMore(false);
|
|
8601
8909
|
anchorRVRef.current = void 0;
|
|
8602
8910
|
haveAnchorRef.current = false;
|
|
8911
|
+
setHasInitial(false);
|
|
8603
8912
|
}
|
|
8604
8913
|
if (enabledRef.current) reconnect();
|
|
8605
8914
|
}
|
|
@@ -8618,6 +8927,7 @@
|
|
|
8618
8927
|
dispatch({ type: "RESET", items: [] });
|
|
8619
8928
|
setContToken(void 0);
|
|
8620
8929
|
setHasMore(false);
|
|
8930
|
+
setHasInitial(false);
|
|
8621
8931
|
}
|
|
8622
8932
|
if (prevId !== nextId) {
|
|
8623
8933
|
anchorRVRef.current = void 0;
|
|
@@ -8640,6 +8950,17 @@
|
|
|
8640
8950
|
return;
|
|
8641
8951
|
}
|
|
8642
8952
|
if (!frame) return;
|
|
8953
|
+
if (frame.type === "SERVER_LOG") {
|
|
8954
|
+
const level = frame.level || "info";
|
|
8955
|
+
const msg = frame.message;
|
|
8956
|
+
(console[level] || console.log).call(console, "[useListWatch][server]", msg);
|
|
8957
|
+
return;
|
|
8958
|
+
}
|
|
8959
|
+
if (frame.type === "INITIAL_ERROR") {
|
|
8960
|
+
const msg = frame.message;
|
|
8961
|
+
setErrorSafe(msg);
|
|
8962
|
+
return;
|
|
8963
|
+
}
|
|
8643
8964
|
if (frame.type === "INITIAL") {
|
|
8644
8965
|
dispatch({ type: "RESET", items: frame.items });
|
|
8645
8966
|
setContToken(frame.continue);
|
|
@@ -8652,6 +8973,7 @@
|
|
|
8652
8973
|
anchorRVRef.current = snapshotRV;
|
|
8653
8974
|
haveAnchorRef.current = true;
|
|
8654
8975
|
}
|
|
8976
|
+
setHasInitial(true);
|
|
8655
8977
|
return;
|
|
8656
8978
|
}
|
|
8657
8979
|
if (frame.type === "PAGE") {
|
|
@@ -8710,12 +9032,26 @@
|
|
|
8710
9032
|
K.useEffect(() => {
|
|
8711
9033
|
if (wsUrl !== urlRef.current) setUrl(wsUrl);
|
|
8712
9034
|
}, [wsUrl, setUrl]);
|
|
9035
|
+
K.useEffect(() => {
|
|
9036
|
+
if (!mountedRef.current) return;
|
|
9037
|
+
if (isEnabled) {
|
|
9038
|
+
connect();
|
|
9039
|
+
} else {
|
|
9040
|
+
if (reconnectTimerRef.current) {
|
|
9041
|
+
window.clearTimeout(reconnectTimerRef.current);
|
|
9042
|
+
reconnectTimerRef.current = null;
|
|
9043
|
+
}
|
|
9044
|
+
closeWS();
|
|
9045
|
+
setStatusSafe("closed");
|
|
9046
|
+
}
|
|
9047
|
+
}, [isEnabled, closeWS, connect, setStatusSafe]);
|
|
8713
9048
|
K.useEffect(() => {
|
|
8714
9049
|
if (resIdRef.current !== resId) {
|
|
8715
9050
|
clearErrorSafe();
|
|
8716
9051
|
suppressErrorsRef.current = true;
|
|
8717
9052
|
anchorRVRef.current = void 0;
|
|
8718
9053
|
haveAnchorRef.current = false;
|
|
9054
|
+
setHasInitial(false);
|
|
8719
9055
|
resIdRef.current = resId;
|
|
8720
9056
|
queryRef.current = query;
|
|
8721
9057
|
if (enabledRef.current) reconnect();
|
|
@@ -8800,6 +9136,7 @@
|
|
|
8800
9136
|
continueToken,
|
|
8801
9137
|
status,
|
|
8802
9138
|
lastError,
|
|
9139
|
+
hasInitial,
|
|
8803
9140
|
setPaused: setIsPaused,
|
|
8804
9141
|
setIgnoreRemove: setIsRemoveIgnored,
|
|
8805
9142
|
sendScroll,
|
|
@@ -8810,17 +9147,126 @@
|
|
|
8810
9147
|
};
|
|
8811
9148
|
};
|
|
8812
9149
|
|
|
8813
|
-
const
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
9150
|
+
const buildApiPrefix = (group, version) => {
|
|
9151
|
+
const g = (group ?? "").trim();
|
|
9152
|
+
const v = (version ?? "").trim();
|
|
9153
|
+
const isCore = !g || g === "core" || g === "v1";
|
|
9154
|
+
return isCore ? `/api/${v}` : `/apis/${g}/${v}`;
|
|
9155
|
+
};
|
|
9156
|
+
const buildListUri = ({
|
|
9157
|
+
cluster,
|
|
9158
|
+
group,
|
|
9159
|
+
version,
|
|
9160
|
+
plural,
|
|
9161
|
+
namespace,
|
|
9162
|
+
fieldSelector,
|
|
9163
|
+
labelSelector,
|
|
9164
|
+
limit
|
|
9165
|
+
}) => {
|
|
9166
|
+
const prefix = buildApiPrefix(group, version);
|
|
9167
|
+
const ns = namespace ? `/namespaces/${namespace}` : "";
|
|
9168
|
+
const base = `/api/clusters/${cluster}/k8s${prefix}${ns}/${plural}/`;
|
|
9169
|
+
const params = new URLSearchParams();
|
|
9170
|
+
if (fieldSelector) params.append("fieldSelector", fieldSelector);
|
|
9171
|
+
if (labelSelector) params.append("labelSelector", labelSelector);
|
|
9172
|
+
if (limit) params.append("limit", String(limit));
|
|
9173
|
+
return params.toString() ? `${base}?${params.toString()}` : base;
|
|
9174
|
+
};
|
|
9175
|
+
const useK8sSmartResource = ({
|
|
9176
|
+
cluster,
|
|
9177
|
+
group,
|
|
9178
|
+
version,
|
|
9179
|
+
plural,
|
|
9180
|
+
namespace,
|
|
9181
|
+
fieldSelector,
|
|
9182
|
+
labelSelector,
|
|
9183
|
+
isEnabled = true,
|
|
9184
|
+
listRefetchInterval = 5e3,
|
|
9185
|
+
limit,
|
|
9186
|
+
mapListWatchState
|
|
9187
|
+
}) => {
|
|
9188
|
+
const {
|
|
9189
|
+
canList,
|
|
9190
|
+
canWatch,
|
|
9191
|
+
isLoading: verbsLoading,
|
|
9192
|
+
isError: verbsIsError,
|
|
9193
|
+
error: verbsErrorObj
|
|
9194
|
+
} = useK8sVerbs({
|
|
9195
|
+
cluster,
|
|
9196
|
+
group,
|
|
9197
|
+
version,
|
|
9198
|
+
plural,
|
|
9199
|
+
isEnabled: Boolean(isEnabled && cluster && cluster.length > 0)
|
|
9200
|
+
});
|
|
9201
|
+
const listUri = buildListUri({
|
|
9202
|
+
cluster,
|
|
9203
|
+
group,
|
|
9204
|
+
version,
|
|
9205
|
+
plural,
|
|
9206
|
+
namespace,
|
|
9207
|
+
fieldSelector,
|
|
9208
|
+
labelSelector,
|
|
9209
|
+
limit
|
|
9210
|
+
});
|
|
9211
|
+
const restEnabled = Boolean(
|
|
9212
|
+
cluster && cluster.length > 0 && isEnabled && canList && !canWatch && !verbsLoading && !verbsIsError
|
|
9213
|
+
);
|
|
9214
|
+
const {
|
|
9215
|
+
data: restData,
|
|
9216
|
+
isLoading: restLoading,
|
|
9217
|
+
isError: restIsError,
|
|
9218
|
+
error: restError
|
|
9219
|
+
} = useDirectUnknownResource({
|
|
9220
|
+
uri: listUri,
|
|
9221
|
+
queryKey: [
|
|
9222
|
+
"k8s-list",
|
|
9223
|
+
cluster,
|
|
9224
|
+
group || "",
|
|
9225
|
+
version,
|
|
9226
|
+
namespace || "",
|
|
9227
|
+
plural,
|
|
9228
|
+
fieldSelector || "",
|
|
9229
|
+
labelSelector || ""
|
|
9230
|
+
],
|
|
9231
|
+
refetchInterval: listRefetchInterval,
|
|
9232
|
+
isEnabled: restEnabled
|
|
9233
|
+
});
|
|
9234
|
+
const watchEnabled = Boolean(
|
|
9235
|
+
cluster && cluster.length > 0 && isEnabled && canList && canWatch && !verbsLoading && !verbsIsError
|
|
9236
|
+
);
|
|
9237
|
+
const { state, status, hasInitial, lastError } = useListWatch({
|
|
9238
|
+
wsUrl: `/api/clusters/${cluster}/openapi-bff-ws/listThenWatch/listWatchWs`,
|
|
9239
|
+
paused: false,
|
|
9240
|
+
ignoreRemove: false,
|
|
9241
|
+
autoDrain: true,
|
|
9242
|
+
preserveStateOnUrlChange: true,
|
|
9243
|
+
isEnabled: watchEnabled,
|
|
9244
|
+
pageSize: limit,
|
|
9245
|
+
query: {
|
|
9246
|
+
apiGroup: group,
|
|
9247
|
+
apiVersion: version,
|
|
9248
|
+
plural,
|
|
9249
|
+
namespace,
|
|
9250
|
+
fieldSelector,
|
|
9251
|
+
labelSelector
|
|
9252
|
+
}
|
|
9253
|
+
});
|
|
9254
|
+
const defaultMap = (s) => ({ items: s.order.map((k) => s.byKey[k]) });
|
|
9255
|
+
const watchData = K.useMemo(
|
|
9256
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9257
|
+
() => watchEnabled ? (mapListWatchState ?? defaultMap)(state) : void 0,
|
|
9258
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9259
|
+
[watchEnabled, state, mapListWatchState]
|
|
9260
|
+
);
|
|
9261
|
+
const used = !isEnabled ? "disabled" : verbsLoading ? "verbs-loading" : verbsIsError ? "verbs-error" : watchEnabled ? "watch" : restEnabled ? "list" : "disabled";
|
|
9262
|
+
const isLoading = isEnabled && verbsLoading || used === "watch" && status === "connecting" || used === "watch" && status === "open" && !hasInitial || used === "list" && restLoading;
|
|
9263
|
+
let error;
|
|
9264
|
+
if (verbsIsError) error = verbsErrorObj;
|
|
9265
|
+
else if (used === "watch" && status === "closed" && lastError) error = lastError;
|
|
9266
|
+
else if (used === "list" && restIsError) error = restError;
|
|
9267
|
+
const isError = Boolean(error);
|
|
9268
|
+
const data = used === "watch" ? watchData : used === "list" ? restData : void 0;
|
|
9269
|
+
return { data, isLoading, isError, error, _meta: { used } };
|
|
8824
9270
|
};
|
|
8825
9271
|
|
|
8826
9272
|
const prepareTemplate = ({
|
|
@@ -8874,80 +9320,6 @@
|
|
|
8874
9320
|
return result;
|
|
8875
9321
|
};
|
|
8876
9322
|
|
|
8877
|
-
const PositionRelativeContainer = styled.div`
|
|
8878
|
-
position: relative;
|
|
8879
|
-
`;
|
|
8880
|
-
const FullWidthContainer = styled.div`
|
|
8881
|
-
width: 100%;
|
|
8882
|
-
|
|
8883
|
-
.ant-dropdown-trigger svg {
|
|
8884
|
-
display: none;
|
|
8885
|
-
}
|
|
8886
|
-
`;
|
|
8887
|
-
const NoWrapContainer = styled.div`
|
|
8888
|
-
position: absolute;
|
|
8889
|
-
visibility: hidden;
|
|
8890
|
-
pointer-events: none;
|
|
8891
|
-
|
|
8892
|
-
/* stylelint-disable declaration-no-important */
|
|
8893
|
-
|
|
8894
|
-
* {
|
|
8895
|
-
white-space: nowrap !important;
|
|
8896
|
-
}
|
|
8897
|
-
|
|
8898
|
-
ol {
|
|
8899
|
-
flex-wrap: nowrap !important;
|
|
8900
|
-
}
|
|
8901
|
-
`;
|
|
8902
|
-
const Styled$w = {
|
|
8903
|
-
PositionRelativeContainer,
|
|
8904
|
-
FullWidthContainer,
|
|
8905
|
-
NoWrapContainer
|
|
8906
|
-
};
|
|
8907
|
-
|
|
8908
|
-
const CollapsibleBreadcrumb = ({ items }) => {
|
|
8909
|
-
const [isCollapsed, setIsCollapsed] = K.useState(false);
|
|
8910
|
-
const containerRef = K.useRef(null);
|
|
8911
|
-
const breadcrumbRef = K.useRef(null);
|
|
8912
|
-
K.useLayoutEffect(() => {
|
|
8913
|
-
const checkWidth = () => {
|
|
8914
|
-
if (containerRef.current && breadcrumbRef.current) {
|
|
8915
|
-
const containerWidth = containerRef.current.clientWidth;
|
|
8916
|
-
const breadcrumbWidth = breadcrumbRef.current.scrollWidth;
|
|
8917
|
-
setIsCollapsed(breadcrumbWidth > containerWidth);
|
|
8918
|
-
}
|
|
8919
|
-
};
|
|
8920
|
-
checkWidth();
|
|
8921
|
-
window.addEventListener("resize", checkWidth);
|
|
8922
|
-
return () => window.removeEventListener("resize", checkWidth);
|
|
8923
|
-
}, [items]);
|
|
8924
|
-
const renderItems = () => {
|
|
8925
|
-
if (!isCollapsed) {
|
|
8926
|
-
return items;
|
|
8927
|
-
}
|
|
8928
|
-
if (items.length <= 2) {
|
|
8929
|
-
return items;
|
|
8930
|
-
}
|
|
8931
|
-
const firstItem = items[0];
|
|
8932
|
-
const lastItem = items[items.length - 1];
|
|
8933
|
-
const hiddenItems = items.slice(1, -1);
|
|
8934
|
-
const menuItems = hiddenItems.map((item, index) => ({
|
|
8935
|
-
key: String(index),
|
|
8936
|
-
label: item.href ? /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: item.href, children: item.title }) : item.title
|
|
8937
|
-
}));
|
|
8938
|
-
const ellipsisItem = {
|
|
8939
|
-
title: "...",
|
|
8940
|
-
menu: { items: menuItems },
|
|
8941
|
-
dropdownProps: { arrow: false }
|
|
8942
|
-
};
|
|
8943
|
-
return [firstItem, ellipsisItem, lastItem];
|
|
8944
|
-
};
|
|
8945
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$w.PositionRelativeContainer, { children: [
|
|
8946
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$w.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items: renderItems() }) }),
|
|
8947
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$w.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
|
|
8948
|
-
] });
|
|
8949
|
-
};
|
|
8950
|
-
|
|
8951
9323
|
const HeightDiv = styled.div`
|
|
8952
9324
|
min-height: 22px;
|
|
8953
9325
|
width: 100%;
|
|
@@ -8956,11 +9328,8 @@
|
|
|
8956
9328
|
HeightDiv
|
|
8957
9329
|
};
|
|
8958
9330
|
|
|
8959
|
-
const
|
|
8960
|
-
|
|
8961
|
-
};
|
|
8962
|
-
const ManageableBreadcrumbsWithDataProvider = ({
|
|
8963
|
-
wsUrl,
|
|
9331
|
+
const ManageableBreadcrumbsProvider = ({
|
|
9332
|
+
cluster,
|
|
8964
9333
|
apiGroup,
|
|
8965
9334
|
apiVersion,
|
|
8966
9335
|
plural,
|
|
@@ -8969,28 +9338,17 @@
|
|
|
8969
9338
|
pathname,
|
|
8970
9339
|
idToCompare
|
|
8971
9340
|
}) => {
|
|
8972
|
-
const {
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
plural
|
|
8982
|
-
},
|
|
9341
|
+
const {
|
|
9342
|
+
data: rawData,
|
|
9343
|
+
isError: rawDataError,
|
|
9344
|
+
isLoading: rawDataLoading
|
|
9345
|
+
} = useK8sSmartResource({
|
|
9346
|
+
cluster: cluster || "",
|
|
9347
|
+
group: apiGroup,
|
|
9348
|
+
version: apiVersion,
|
|
9349
|
+
plural,
|
|
8983
9350
|
isEnabled
|
|
8984
9351
|
});
|
|
8985
|
-
const rawDataLoading = status === "connecting";
|
|
8986
|
-
const rawDataError = status === "closed" && lastError ? lastError : void 0;
|
|
8987
|
-
const rawData = {
|
|
8988
|
-
items: state.order.map((key) => {
|
|
8989
|
-
const res = state.byKey[key];
|
|
8990
|
-
return res;
|
|
8991
|
-
})
|
|
8992
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8993
|
-
};
|
|
8994
9352
|
if (rawDataError) {
|
|
8995
9353
|
return null;
|
|
8996
9354
|
}
|
|
@@ -9015,6 +9373,73 @@
|
|
|
9015
9373
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableBreadcrumbs, { data: result });
|
|
9016
9374
|
};
|
|
9017
9375
|
|
|
9376
|
+
const CustomMenu = styled(antd.Menu)`
|
|
9377
|
+
margin-top: ${({ $noMarginTop }) => $noMarginTop ? "0" : "16px"};
|
|
9378
|
+
font-size: 14px;
|
|
9379
|
+
line-height: 24px;
|
|
9380
|
+
border: 0;
|
|
9381
|
+
/* stylelint-disable declaration-no-important */
|
|
9382
|
+
border-inline-end: 0 !important;
|
|
9383
|
+
/* stylelint-enable declaration-no-important */
|
|
9384
|
+
|
|
9385
|
+
.ant-menu-submenu-expand-icon {
|
|
9386
|
+
width: 16px;
|
|
9387
|
+
}
|
|
9388
|
+
|
|
9389
|
+
&& .ant-menu-item-only-child {
|
|
9390
|
+
/* stylelint-disable declaration-no-important */
|
|
9391
|
+
|
|
9392
|
+
/* padding-left: 24px !important; */
|
|
9393
|
+
}
|
|
9394
|
+
|
|
9395
|
+
&& .ant-menu-sub .ant-menu-item {
|
|
9396
|
+
margin: 0 !important;
|
|
9397
|
+
}
|
|
9398
|
+
`;
|
|
9399
|
+
const Styled$u = {
|
|
9400
|
+
CustomMenu
|
|
9401
|
+
};
|
|
9402
|
+
|
|
9403
|
+
const ManageableSidebar = ({ data, noMarginTop }) => {
|
|
9404
|
+
const [selectedKeys, setSelectedKeys] = K.useState([]);
|
|
9405
|
+
const [openKeys, setOpenKeys] = K.useState(() => {
|
|
9406
|
+
try {
|
|
9407
|
+
const saved = localStorage.getItem("menuOpenKeys");
|
|
9408
|
+
return saved ? JSON.parse(saved) : [];
|
|
9409
|
+
} catch (error) {
|
|
9410
|
+
console.error("Failed to parse stored menu keys", error);
|
|
9411
|
+
return [];
|
|
9412
|
+
}
|
|
9413
|
+
});
|
|
9414
|
+
const handleOpenChange = (keys) => {
|
|
9415
|
+
setOpenKeys(keys);
|
|
9416
|
+
try {
|
|
9417
|
+
localStorage.setItem("menuOpenKeys", JSON.stringify(keys));
|
|
9418
|
+
} catch (error) {
|
|
9419
|
+
console.error("Failed to save menu keys to localStorage", error);
|
|
9420
|
+
}
|
|
9421
|
+
};
|
|
9422
|
+
K.useEffect(() => {
|
|
9423
|
+
setSelectedKeys(data.selectedKeys);
|
|
9424
|
+
}, [data.selectedKeys]);
|
|
9425
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9426
|
+
Styled$u.CustomMenu,
|
|
9427
|
+
{
|
|
9428
|
+
selectedKeys,
|
|
9429
|
+
onSelect: () => {
|
|
9430
|
+
},
|
|
9431
|
+
onDeselect: () => {
|
|
9432
|
+
},
|
|
9433
|
+
defaultOpenKeys: data.selectedKeys,
|
|
9434
|
+
openKeys,
|
|
9435
|
+
onOpenChange: handleOpenChange,
|
|
9436
|
+
mode: "inline",
|
|
9437
|
+
items: data.menuItems,
|
|
9438
|
+
$noMarginTop: noMarginTop
|
|
9439
|
+
}
|
|
9440
|
+
);
|
|
9441
|
+
};
|
|
9442
|
+
|
|
9018
9443
|
const getLabel = ({
|
|
9019
9444
|
preparedLink,
|
|
9020
9445
|
label,
|
|
@@ -9109,74 +9534,8 @@
|
|
|
9109
9534
|
return { ...result, selectedKeys: stringedOpenedKeys };
|
|
9110
9535
|
};
|
|
9111
9536
|
|
|
9112
|
-
const
|
|
9113
|
-
|
|
9114
|
-
font-size: 14px;
|
|
9115
|
-
line-height: 24px;
|
|
9116
|
-
border: 0;
|
|
9117
|
-
/* stylelint-disable declaration-no-important */
|
|
9118
|
-
border-inline-end: 0 !important;
|
|
9119
|
-
/* stylelint-enable declaration-no-important */
|
|
9120
|
-
|
|
9121
|
-
.ant-menu-submenu-expand-icon {
|
|
9122
|
-
width: 16px;
|
|
9123
|
-
}
|
|
9124
|
-
|
|
9125
|
-
&& .ant-menu-item-only-child {
|
|
9126
|
-
/* stylelint-disable declaration-no-important */
|
|
9127
|
-
|
|
9128
|
-
/* padding-left: 24px !important; */
|
|
9129
|
-
}
|
|
9130
|
-
|
|
9131
|
-
&& .ant-menu-sub .ant-menu-item {
|
|
9132
|
-
margin: 0 !important;
|
|
9133
|
-
}
|
|
9134
|
-
`;
|
|
9135
|
-
const Styled$u = {
|
|
9136
|
-
CustomMenu
|
|
9137
|
-
};
|
|
9138
|
-
|
|
9139
|
-
const ManageableSidebar = ({ data, noMarginTop }) => {
|
|
9140
|
-
const [selectedKeys, setSelectedKeys] = K.useState([]);
|
|
9141
|
-
const [openKeys, setOpenKeys] = K.useState(() => {
|
|
9142
|
-
try {
|
|
9143
|
-
const saved = localStorage.getItem("menuOpenKeys");
|
|
9144
|
-
return saved ? JSON.parse(saved) : [];
|
|
9145
|
-
} catch (error) {
|
|
9146
|
-
console.error("Failed to parse stored menu keys", error);
|
|
9147
|
-
return [];
|
|
9148
|
-
}
|
|
9149
|
-
});
|
|
9150
|
-
const handleOpenChange = (keys) => {
|
|
9151
|
-
setOpenKeys(keys);
|
|
9152
|
-
try {
|
|
9153
|
-
localStorage.setItem("menuOpenKeys", JSON.stringify(keys));
|
|
9154
|
-
} catch (error) {
|
|
9155
|
-
console.error("Failed to save menu keys to localStorage", error);
|
|
9156
|
-
}
|
|
9157
|
-
};
|
|
9158
|
-
K.useEffect(() => {
|
|
9159
|
-
setSelectedKeys(data.selectedKeys);
|
|
9160
|
-
}, [data.selectedKeys]);
|
|
9161
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9162
|
-
Styled$u.CustomMenu,
|
|
9163
|
-
{
|
|
9164
|
-
selectedKeys,
|
|
9165
|
-
onSelect: () => {
|
|
9166
|
-
},
|
|
9167
|
-
onDeselect: () => {
|
|
9168
|
-
},
|
|
9169
|
-
defaultOpenKeys: data.selectedKeys,
|
|
9170
|
-
openKeys,
|
|
9171
|
-
onOpenChange: handleOpenChange,
|
|
9172
|
-
mode: "inline",
|
|
9173
|
-
items: data.menuItems,
|
|
9174
|
-
$noMarginTop: noMarginTop
|
|
9175
|
-
}
|
|
9176
|
-
);
|
|
9177
|
-
};
|
|
9178
|
-
const ManageableSidebarWithDataProvider = ({
|
|
9179
|
-
wsUrl,
|
|
9537
|
+
const ManageableSidebarProvider = ({
|
|
9538
|
+
cluster,
|
|
9180
9539
|
apiGroup,
|
|
9181
9540
|
apiVersion,
|
|
9182
9541
|
plural,
|
|
@@ -9188,28 +9547,17 @@
|
|
|
9188
9547
|
hidden,
|
|
9189
9548
|
noMarginTop
|
|
9190
9549
|
}) => {
|
|
9191
|
-
const {
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
plural
|
|
9201
|
-
},
|
|
9550
|
+
const {
|
|
9551
|
+
data: rawData,
|
|
9552
|
+
isError: rawDataError,
|
|
9553
|
+
isLoading: rawDataLoading
|
|
9554
|
+
} = useK8sSmartResource({
|
|
9555
|
+
cluster,
|
|
9556
|
+
group: apiGroup,
|
|
9557
|
+
version: apiVersion,
|
|
9558
|
+
plural,
|
|
9202
9559
|
isEnabled
|
|
9203
9560
|
});
|
|
9204
|
-
const rawDataLoading = status === "connecting";
|
|
9205
|
-
const rawDataError = status === "closed" && lastError ? lastError : void 0;
|
|
9206
|
-
const rawData = {
|
|
9207
|
-
items: state.order.map((key) => {
|
|
9208
|
-
const res = state.byKey[key];
|
|
9209
|
-
return res;
|
|
9210
|
-
})
|
|
9211
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9212
|
-
};
|
|
9213
9561
|
if (rawDataError) {
|
|
9214
9562
|
return null;
|
|
9215
9563
|
}
|
|
@@ -33468,49 +33816,97 @@
|
|
|
33468
33816
|
};
|
|
33469
33817
|
|
|
33470
33818
|
const MultiQueryContext = K.createContext(void 0);
|
|
33471
|
-
const
|
|
33472
|
-
|
|
33473
|
-
|
|
33474
|
-
|
|
33475
|
-
|
|
33476
|
-
|
|
33477
|
-
|
|
33819
|
+
const makeEmptyEntry = () => ({
|
|
33820
|
+
data: void 0,
|
|
33821
|
+
isLoading: false,
|
|
33822
|
+
isError: false,
|
|
33823
|
+
error: null
|
|
33824
|
+
});
|
|
33825
|
+
const aggReducer = (state, action) => {
|
|
33826
|
+
switch (action.type) {
|
|
33827
|
+
case "RESET":
|
|
33828
|
+
return { entries: Array.from({ length: action.total }, makeEmptyEntry) };
|
|
33829
|
+
case "SET_ENTRY": {
|
|
33830
|
+
const entries = state.entries.slice();
|
|
33831
|
+
entries[action.index] = action.entry;
|
|
33832
|
+
return { entries };
|
|
33833
|
+
}
|
|
33834
|
+
default:
|
|
33835
|
+
return state;
|
|
33836
|
+
}
|
|
33837
|
+
};
|
|
33838
|
+
const K8sFetcher = ({ index, params, dispatch }) => {
|
|
33839
|
+
const res = useK8sSmartResource(params);
|
|
33840
|
+
K.useEffect(() => {
|
|
33841
|
+
dispatch({
|
|
33842
|
+
type: "SET_ENTRY",
|
|
33843
|
+
index,
|
|
33844
|
+
entry: {
|
|
33845
|
+
data: res.data,
|
|
33846
|
+
isLoading: res.isLoading,
|
|
33847
|
+
isError: res.isError,
|
|
33848
|
+
error: res.error ?? null
|
|
33478
33849
|
}
|
|
33479
|
-
}))
|
|
33480
|
-
});
|
|
33481
|
-
const data = {};
|
|
33482
|
-
const errors = [];
|
|
33483
|
-
let isLoading;
|
|
33484
|
-
let isError;
|
|
33485
|
-
if (!dataToApplyToContext) {
|
|
33486
|
-
queries.forEach((q, i) => {
|
|
33487
|
-
data[`req${i}`] = q.data;
|
|
33488
|
-
errors[i] = q.error ?? null;
|
|
33489
33850
|
});
|
|
33490
|
-
|
|
33491
|
-
|
|
33492
|
-
|
|
33493
|
-
|
|
33494
|
-
|
|
33495
|
-
|
|
33496
|
-
|
|
33497
|
-
const value = K.useMemo(
|
|
33498
|
-
() => ({ data, isLoading, isError, errors }),
|
|
33499
|
-
/*
|
|
33500
|
-
We use JSON.stringify(data) and JSON.stringify(errors) as dependencies to safely memoize when values deeply change (since data is a new object every render).
|
|
33501
|
-
Alternatively, you could use a deep comparison hook or lodash.isEqual if needed.
|
|
33502
|
-
*/
|
|
33503
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33504
|
-
[JSON.stringify(data), isLoading, isError, JSON.stringify(errors)]
|
|
33851
|
+
}, [index, res.data, res.isLoading, res.isError, res.error, dispatch]);
|
|
33852
|
+
return null;
|
|
33853
|
+
};
|
|
33854
|
+
const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
|
|
33855
|
+
const k8sItems = K.useMemo(
|
|
33856
|
+
() => items.filter((x) => typeof x !== "string"),
|
|
33857
|
+
[items]
|
|
33505
33858
|
);
|
|
33506
|
-
|
|
33859
|
+
const urlItems = K.useMemo(() => items.filter((x) => typeof x === "string"), [items]);
|
|
33860
|
+
const k8sCount = k8sItems.length;
|
|
33861
|
+
const urlCount = urlItems.length;
|
|
33862
|
+
const [state, dispatch] = K.useReducer(aggReducer, { entries: Array.from({ length: k8sCount }, makeEmptyEntry) });
|
|
33863
|
+
K.useEffect(() => {
|
|
33864
|
+
dispatch({ type: "RESET", total: k8sCount });
|
|
33865
|
+
}, [k8sCount]);
|
|
33866
|
+
const urlQueries = reactQuery.useQueries({
|
|
33867
|
+
queries: urlItems.map((url, i) => ({
|
|
33868
|
+
queryKey: ["multi-url", i, url],
|
|
33869
|
+
queryFn: async () => {
|
|
33870
|
+
const res = await axios.get(url);
|
|
33871
|
+
return structuredClone(res.data);
|
|
33872
|
+
},
|
|
33873
|
+
structuralSharing: false,
|
|
33874
|
+
refetchInterval: 5e3
|
|
33875
|
+
}))
|
|
33876
|
+
});
|
|
33877
|
+
const value = (() => {
|
|
33878
|
+
if (typeof dataToApplyToContext !== "undefined") {
|
|
33879
|
+
return { data: { req0: dataToApplyToContext }, isLoading: false, isError: false, errors: [] };
|
|
33880
|
+
}
|
|
33881
|
+
const data = {};
|
|
33882
|
+
const errors = [];
|
|
33883
|
+
for (let i = 0; i < k8sCount; i++) {
|
|
33884
|
+
const e = state.entries[i] ?? makeEmptyEntry();
|
|
33885
|
+
data[`req${i}`] = e.data;
|
|
33886
|
+
errors[i] = e.isError ? e.error : null;
|
|
33887
|
+
}
|
|
33888
|
+
for (let i = 0; i < urlCount; i++) {
|
|
33889
|
+
const q = urlQueries[i];
|
|
33890
|
+
const idx = k8sCount + i;
|
|
33891
|
+
data[`req${idx}`] = q?.data;
|
|
33892
|
+
errors[idx] = q?.isError ? q.error ?? null : null;
|
|
33893
|
+
}
|
|
33894
|
+
const isLoading = state.entries.some((e) => e.isLoading) || urlQueries.some((q) => q.isLoading);
|
|
33895
|
+
const isError = state.entries.some((e) => e.isError) || urlQueries.some((q) => q.isError);
|
|
33896
|
+
return { data, isLoading, isError, errors };
|
|
33897
|
+
})();
|
|
33898
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(MultiQueryContext.Provider, { value, children: [
|
|
33899
|
+
k8sItems.map((params, i) => (
|
|
33900
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
33901
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(K8sFetcher, { index: i, params, dispatch }, i)
|
|
33902
|
+
)),
|
|
33903
|
+
children
|
|
33904
|
+
] });
|
|
33507
33905
|
};
|
|
33508
33906
|
const useMultiQuery = () => {
|
|
33509
|
-
const
|
|
33510
|
-
if (!
|
|
33511
|
-
|
|
33512
|
-
}
|
|
33513
|
-
return context;
|
|
33907
|
+
const ctx = K.useContext(MultiQueryContext);
|
|
33908
|
+
if (!ctx) throw new Error("useMultiQuery must be used within a MultiQueryProvider");
|
|
33909
|
+
return ctx;
|
|
33514
33910
|
};
|
|
33515
33911
|
|
|
33516
33912
|
const createContextFactory = () => {
|
|
@@ -33738,7 +34134,7 @@
|
|
|
33738
34134
|
if (isError) {
|
|
33739
34135
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
33740
34136
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
33741
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
34137
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
33742
34138
|
] });
|
|
33743
34139
|
}
|
|
33744
34140
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: preparedText });
|
|
@@ -33768,7 +34164,7 @@
|
|
|
33768
34164
|
if (isError) {
|
|
33769
34165
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
33770
34166
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
33771
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
34167
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
33772
34168
|
] });
|
|
33773
34169
|
}
|
|
33774
34170
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -33805,7 +34201,7 @@
|
|
|
33805
34201
|
if (isError) {
|
|
33806
34202
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
33807
34203
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
33808
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
34204
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
33809
34205
|
] });
|
|
33810
34206
|
}
|
|
33811
34207
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectInfoCard, { clusterName, namespace, accessGroups: parsedAccessGroups, ...props, children });
|
|
@@ -33922,7 +34318,7 @@
|
|
|
33922
34318
|
if (isError) {
|
|
33923
34319
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
33924
34320
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
33925
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
34321
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
33926
34322
|
] });
|
|
33927
34323
|
}
|
|
33928
34324
|
const { type, text } = getResult({
|
|
@@ -33954,7 +34350,7 @@
|
|
|
33954
34350
|
acc[index.toString()] = value;
|
|
33955
34351
|
return acc;
|
|
33956
34352
|
}, {});
|
|
33957
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34353
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableSidebarProvider, { replaceValues, ...props });
|
|
33958
34354
|
};
|
|
33959
34355
|
|
|
33960
34356
|
const checkPermission = async ({
|
|
@@ -34008,33 +34404,6 @@
|
|
|
34008
34404
|
});
|
|
34009
34405
|
};
|
|
34010
34406
|
|
|
34011
|
-
const getDirectUnknownResource = async ({ uri }) => {
|
|
34012
|
-
return axios.get(uri);
|
|
34013
|
-
};
|
|
34014
|
-
|
|
34015
|
-
const useDirectUnknownResource = ({
|
|
34016
|
-
uri,
|
|
34017
|
-
queryKey,
|
|
34018
|
-
refetchInterval,
|
|
34019
|
-
isEnabled
|
|
34020
|
-
}) => {
|
|
34021
|
-
return reactQuery.useQuery({
|
|
34022
|
-
queryKey,
|
|
34023
|
-
queryFn: async () => {
|
|
34024
|
-
const response = await getDirectUnknownResource({
|
|
34025
|
-
uri
|
|
34026
|
-
});
|
|
34027
|
-
const data = JSON.parse(JSON.stringify(response.data));
|
|
34028
|
-
if (data.metadata?.resourceVersion) {
|
|
34029
|
-
delete data.metadata.resourceVersion;
|
|
34030
|
-
}
|
|
34031
|
-
return data;
|
|
34032
|
-
},
|
|
34033
|
-
refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3,
|
|
34034
|
-
enabled: isEnabled
|
|
34035
|
-
});
|
|
34036
|
-
};
|
|
34037
|
-
|
|
34038
34407
|
const getBackLinkToTable = ({ fullPath }) => {
|
|
34039
34408
|
return encodeURIComponent(fullPath);
|
|
34040
34409
|
};
|
|
@@ -34115,6 +34484,7 @@
|
|
|
34115
34484
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
34116
34485
|
id,
|
|
34117
34486
|
fetchUrl,
|
|
34487
|
+
k8sResourceToFetch,
|
|
34118
34488
|
pathToItems,
|
|
34119
34489
|
clusterNamePartOfUrl,
|
|
34120
34490
|
labelSelector,
|
|
@@ -34158,7 +34528,13 @@
|
|
|
34158
34528
|
verb: "create",
|
|
34159
34529
|
refetchInterval: false
|
|
34160
34530
|
});
|
|
34161
|
-
const fetchUrlPrepared = parseAll({ text: fetchUrl, replaceValues, multiQueryData });
|
|
34531
|
+
const fetchUrlPrepared = fetchUrl ? parseAll({ text: fetchUrl, replaceValues, multiQueryData }) : void 0;
|
|
34532
|
+
const k8sResourceToFetchPrepared = k8sResourceToFetch ? {
|
|
34533
|
+
group: k8sResourceToFetch.group ? parseAll({ text: k8sResourceToFetch.group, replaceValues, multiQueryData }) : void 0,
|
|
34534
|
+
version: parseAll({ text: k8sResourceToFetch.version, replaceValues, multiQueryData }),
|
|
34535
|
+
plural: parseAll({ text: k8sResourceToFetch.plural, replaceValues, multiQueryData }),
|
|
34536
|
+
namespace: k8sResourceToFetch.namespace ? parseAll({ text: k8sResourceToFetch.namespace, replaceValues, multiQueryData }) : void 0
|
|
34537
|
+
} : void 0;
|
|
34162
34538
|
const sParams = new URLSearchParams();
|
|
34163
34539
|
if (labelSelector && Object.keys(labelSelector).length > 0) {
|
|
34164
34540
|
const parsedObject = Object.fromEntries(
|
|
@@ -34195,21 +34571,48 @@
|
|
|
34195
34571
|
} = useDirectUnknownResource({
|
|
34196
34572
|
uri: `${fetchUrlPrepared}${searchParams ? `?${searchParams}` : ""}`,
|
|
34197
34573
|
queryKey: [`${fetchUrlPrepared}${searchParams ? `?${searchParams}` : ""}`],
|
|
34198
|
-
isEnabled: !isMultiqueryLoading
|
|
34574
|
+
isEnabled: Boolean(!isMultiqueryLoading && fetchUrlPrepared)
|
|
34199
34575
|
});
|
|
34200
|
-
|
|
34576
|
+
const {
|
|
34577
|
+
data: fetchedDataSocket,
|
|
34578
|
+
isLoading: isFetchedDataSocketLoading,
|
|
34579
|
+
error: fetchedDataSocketError
|
|
34580
|
+
} = useK8sSmartResource({
|
|
34581
|
+
cluster: clusterName || "",
|
|
34582
|
+
namespace: k8sResourceToFetchPrepared?.namespace,
|
|
34583
|
+
group: k8sResourceToFetchPrepared?.group,
|
|
34584
|
+
version: k8sResourceToFetchPrepared?.version || "",
|
|
34585
|
+
plural: k8sResourceToFetchPrepared?.plural || "",
|
|
34586
|
+
fieldSelector: sParams.get("fieldSelector") || void 0,
|
|
34587
|
+
labelSelector: sParams.get("labelSelector") || void 0,
|
|
34588
|
+
isEnabled: Boolean(!isMultiqueryLoading && k8sResourceToFetchPrepared)
|
|
34589
|
+
});
|
|
34590
|
+
if (fetchUrlPrepared && isMultiqueryLoading) {
|
|
34591
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34592
|
+
}
|
|
34593
|
+
if (k8sResourceToFetchPrepared && isMultiqueryLoading) {
|
|
34201
34594
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34202
34595
|
}
|
|
34203
|
-
if (isFetchedDataLoading) {
|
|
34596
|
+
if (fetchUrlPrepared && isFetchedDataLoading) {
|
|
34597
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
|
|
34598
|
+
}
|
|
34599
|
+
if (k8sResourceToFetchPrepared && isFetchedDataSocketLoading) {
|
|
34204
34600
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
|
|
34205
34601
|
}
|
|
34206
|
-
if (fetchedDataError) {
|
|
34602
|
+
if (fetchUrlPrepared && fetchedDataError) {
|
|
34207
34603
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34208
34604
|
"Error: ",
|
|
34209
34605
|
JSON.stringify(fetchedDataError)
|
|
34210
34606
|
] });
|
|
34211
34607
|
}
|
|
34212
|
-
|
|
34608
|
+
if (k8sResourceToFetchPrepared && fetchedDataSocketError) {
|
|
34609
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34610
|
+
"Error: ",
|
|
34611
|
+
JSON.stringify(fetchedDataError)
|
|
34612
|
+
] });
|
|
34613
|
+
}
|
|
34614
|
+
const dataFromOneOfHooks = fetchedData || fetchedDataSocket;
|
|
34615
|
+
const items = Array.isArray(pathToItems) ? _$1.get(dataFromOneOfHooks, pathToItems) : jp.query(dataFromOneOfHooks, `$${pathToItems}`)[0];
|
|
34213
34616
|
if (!items) {
|
|
34214
34617
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34215
34618
|
"No data on this path ",
|
|
@@ -34344,15 +34747,18 @@
|
|
|
34344
34747
|
const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
|
|
34345
34748
|
const podNamePrepared = parseAll({ text: podName, replaceValues, multiQueryData });
|
|
34346
34749
|
const {
|
|
34347
|
-
data:
|
|
34750
|
+
data: podInfoList,
|
|
34348
34751
|
isError: isPodInfoError,
|
|
34349
34752
|
isLoading: isLoadingPodInfo
|
|
34350
|
-
} =
|
|
34351
|
-
|
|
34352
|
-
|
|
34353
|
-
|
|
34753
|
+
} = useK8sSmartResource({
|
|
34754
|
+
cluster: clusterPrepared,
|
|
34755
|
+
namespace: namespacePrepared,
|
|
34756
|
+
version: "v1",
|
|
34757
|
+
plural: "pods",
|
|
34758
|
+
fieldSelector: `metadata.name=${podNamePrepared}`,
|
|
34354
34759
|
isEnabled: clusterPrepared !== void 0 && namespacePrepared !== void 0 && podNamePrepared !== void 0
|
|
34355
34760
|
});
|
|
34761
|
+
const podInfo = podInfoList?.items && podInfoList.items.length > 0 ? podInfoList.items[0] : void 0;
|
|
34356
34762
|
if (isMultiqueryLoading) {
|
|
34357
34763
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34358
34764
|
}
|
|
@@ -34460,15 +34866,18 @@
|
|
|
34460
34866
|
const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
|
|
34461
34867
|
const podNamePrepared = parseAll({ text: podName, replaceValues, multiQueryData });
|
|
34462
34868
|
const {
|
|
34463
|
-
data:
|
|
34869
|
+
data: podInfoList,
|
|
34464
34870
|
isError: isPodInfoError,
|
|
34465
34871
|
isLoading: isLoadingPodInfo
|
|
34466
|
-
} =
|
|
34467
|
-
|
|
34468
|
-
|
|
34469
|
-
|
|
34872
|
+
} = useK8sSmartResource({
|
|
34873
|
+
cluster: clusterPrepared,
|
|
34874
|
+
namespace: namespacePrepared,
|
|
34875
|
+
version: "v1",
|
|
34876
|
+
plural: "pods",
|
|
34877
|
+
fieldSelector: `metadata.name=${podNamePrepared}`,
|
|
34470
34878
|
isEnabled: clusterPrepared !== void 0 && namespacePrepared !== void 0 && podNamePrepared !== void 0
|
|
34471
34879
|
});
|
|
34880
|
+
const podInfo = podInfoList?.items && podInfoList.items.length > 0 ? podInfoList.items[0] : void 0;
|
|
34472
34881
|
if (isMultiqueryLoading) {
|
|
34473
34882
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34474
34883
|
}
|
|
@@ -34504,6 +34913,37 @@
|
|
|
34504
34913
|
] });
|
|
34505
34914
|
};
|
|
34506
34915
|
|
|
34916
|
+
const getDataByPath = ({
|
|
34917
|
+
prefillValuesRaw,
|
|
34918
|
+
pathToData
|
|
34919
|
+
}) => {
|
|
34920
|
+
return Array.isArray(pathToData) ? _$1.get(prefillValuesRaw, pathToData) : jp.query(prefillValuesRaw, `$${pathToData}`)[0];
|
|
34921
|
+
};
|
|
34922
|
+
const getPrefillValuesWithForces = ({
|
|
34923
|
+
prefillValues,
|
|
34924
|
+
forcedKind,
|
|
34925
|
+
apiGroup,
|
|
34926
|
+
apiVersion
|
|
34927
|
+
}) => {
|
|
34928
|
+
if (!forcedKind) {
|
|
34929
|
+
return prefillValues;
|
|
34930
|
+
}
|
|
34931
|
+
const newValues = { ...prefillValues };
|
|
34932
|
+
if (typeof newValues === "object" && newValues !== null) {
|
|
34933
|
+
if ("kind" in newValues) {
|
|
34934
|
+
delete newValues.kind;
|
|
34935
|
+
}
|
|
34936
|
+
if ("apiVersion" in newValues) {
|
|
34937
|
+
delete newValues.apiVersion;
|
|
34938
|
+
}
|
|
34939
|
+
}
|
|
34940
|
+
return {
|
|
34941
|
+
kind: forcedKind,
|
|
34942
|
+
apiVersion: `${apiGroup ? `${apiGroup}/` : ""}${apiVersion}`,
|
|
34943
|
+
...newValues
|
|
34944
|
+
};
|
|
34945
|
+
};
|
|
34946
|
+
|
|
34507
34947
|
const YamlEditorSingleton$1 = ({
|
|
34508
34948
|
data,
|
|
34509
34949
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -34519,7 +34959,9 @@
|
|
|
34519
34959
|
apiGroup,
|
|
34520
34960
|
apiVersion,
|
|
34521
34961
|
typeName,
|
|
34962
|
+
forcedKind,
|
|
34522
34963
|
prefillValuesRequestIndex,
|
|
34964
|
+
pathToData,
|
|
34523
34965
|
substractHeight,
|
|
34524
34966
|
...props
|
|
34525
34967
|
} = data;
|
|
@@ -34545,7 +34987,9 @@
|
|
|
34545
34987
|
const apiGroupPrepared = apiGroup ? parseAll({ text: apiGroup, replaceValues, multiQueryData }) : "no-api-group";
|
|
34546
34988
|
const apiVersionPrepared = apiVersion ? parseAll({ text: apiVersion, replaceValues, multiQueryData }) : "no-api-version";
|
|
34547
34989
|
const typeNamePrepared = parseAll({ text: typeName, replaceValues, multiQueryData });
|
|
34548
|
-
const
|
|
34990
|
+
const prefillValuesRaw = multiQueryData[`req${prefillValuesRequestIndex}`];
|
|
34991
|
+
const prefillValues = pathToData ? getDataByPath({ prefillValuesRaw, pathToData }) : prefillValuesRaw;
|
|
34992
|
+
const prefillValuesWithForces = getPrefillValuesWithForces({ prefillValues, forcedKind, apiGroup, apiVersion });
|
|
34549
34993
|
if (isMultiqueryLoading) {
|
|
34550
34994
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34551
34995
|
}
|
|
@@ -34555,7 +34999,7 @@
|
|
|
34555
34999
|
{
|
|
34556
35000
|
cluster: clusterPrepared,
|
|
34557
35001
|
theme,
|
|
34558
|
-
prefillValuesSchema:
|
|
35002
|
+
prefillValuesSchema: prefillValuesWithForces,
|
|
34559
35003
|
isNameSpaced,
|
|
34560
35004
|
isCreate: false,
|
|
34561
35005
|
type,
|
|
@@ -34654,7 +35098,7 @@
|
|
|
34654
35098
|
if (isMultiQueryErrors) {
|
|
34655
35099
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34656
35100
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
34657
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
35101
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
34658
35102
|
] });
|
|
34659
35103
|
}
|
|
34660
35104
|
const jsonRoot = multiQueryData[`req${reqIndex}`];
|
|
@@ -34721,7 +35165,7 @@
|
|
|
34721
35165
|
if (isMultiQueryErrors) {
|
|
34722
35166
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34723
35167
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
34724
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
35168
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
34725
35169
|
] });
|
|
34726
35170
|
}
|
|
34727
35171
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -34778,7 +35222,7 @@
|
|
|
34778
35222
|
if (isMultiQueryErrors) {
|
|
34779
35223
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34780
35224
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
34781
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
35225
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
34782
35226
|
] });
|
|
34783
35227
|
}
|
|
34784
35228
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -34956,11 +35400,7 @@
|
|
|
34956
35400
|
p === void 0 ? void 0 : Array.isArray(p) ? p : [p]
|
|
34957
35401
|
);
|
|
34958
35402
|
|
|
34959
|
-
const HiddenContainer = ({
|
|
34960
|
-
name,
|
|
34961
|
-
secondName,
|
|
34962
|
-
children
|
|
34963
|
-
}) => {
|
|
35403
|
+
const HiddenContainer = ({ name, secondName, children }) => {
|
|
34964
35404
|
const hiddenPaths = useHiddenPathsLayout();
|
|
34965
35405
|
const nameArr = toArray(name);
|
|
34966
35406
|
const secondArr = toArray(secondName);
|
|
@@ -35163,7 +35603,7 @@
|
|
|
35163
35603
|
if (isMultiQueryErrors) {
|
|
35164
35604
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
35165
35605
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
35166
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
35606
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
35167
35607
|
] });
|
|
35168
35608
|
}
|
|
35169
35609
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -35438,7 +35878,7 @@
|
|
|
35438
35878
|
if (isMultiQueryErrors) {
|
|
35439
35879
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
35440
35880
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
35441
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
35881
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
35442
35882
|
] });
|
|
35443
35883
|
}
|
|
35444
35884
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -35707,7 +36147,7 @@
|
|
|
35707
36147
|
if (isMultiQueryErrors) {
|
|
35708
36148
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
35709
36149
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
35710
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
36150
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
35711
36151
|
] });
|
|
35712
36152
|
}
|
|
35713
36153
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -35951,10 +36391,15 @@
|
|
|
35951
36391
|
...restField,
|
|
35952
36392
|
name: [name, "operator"],
|
|
35953
36393
|
rules: [
|
|
35954
|
-
{
|
|
35955
|
-
|
|
35956
|
-
|
|
35957
|
-
|
|
36394
|
+
({ getFieldValue }) => ({
|
|
36395
|
+
validator(_, v) {
|
|
36396
|
+
const nameV = getFieldValue(["tolerations", name, "key"]);
|
|
36397
|
+
if ((nameV === "nameV" || !nameV) && (!v || v !== "Exists")) {
|
|
36398
|
+
return Promise.reject(new Error("Operator must be Exists when `key` is empty"));
|
|
36399
|
+
}
|
|
36400
|
+
return Promise.resolve();
|
|
36401
|
+
}
|
|
36402
|
+
})
|
|
35958
36403
|
],
|
|
35959
36404
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35960
36405
|
antd.Select,
|
|
@@ -36080,7 +36525,7 @@
|
|
|
36080
36525
|
if (isMultiQueryErrors) {
|
|
36081
36526
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
36082
36527
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
36083
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
36528
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
36084
36529
|
] });
|
|
36085
36530
|
}
|
|
36086
36531
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -36361,7 +36806,7 @@
|
|
|
36361
36806
|
if (isMultiQueryErrors) {
|
|
36362
36807
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
36363
36808
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
36364
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
36809
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
36365
36810
|
] });
|
|
36366
36811
|
}
|
|
36367
36812
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -36579,7 +37024,7 @@
|
|
|
36579
37024
|
if (isError) {
|
|
36580
37025
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
36581
37026
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
36582
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
37027
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
36583
37028
|
] });
|
|
36584
37029
|
}
|
|
36585
37030
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -37396,7 +37841,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37396
37841
|
if (isError) {
|
|
37397
37842
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
37398
37843
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
37399
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
37844
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
37400
37845
|
] });
|
|
37401
37846
|
}
|
|
37402
37847
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -37470,30 +37915,6 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37470
37915
|
] });
|
|
37471
37916
|
};
|
|
37472
37917
|
|
|
37473
|
-
const fnv1a32 = (str) => {
|
|
37474
|
-
let h = 2166136261;
|
|
37475
|
-
for (const ch of str) {
|
|
37476
|
-
h ^= ch.codePointAt(0);
|
|
37477
|
-
h = (h >>> 0) * 16777619;
|
|
37478
|
-
}
|
|
37479
|
-
return h >>> 0;
|
|
37480
|
-
};
|
|
37481
|
-
const pickInRange = (u32, min, max) => min + u32 % (max - min + 1);
|
|
37482
|
-
const hslFromString = (value, theme) => {
|
|
37483
|
-
const hash = fnv1a32(value);
|
|
37484
|
-
const hue = hash % 345;
|
|
37485
|
-
const [sMin, sMax] = theme === "light" ? [90, 100] : [78, 80];
|
|
37486
|
-
const [lMin, lMax] = theme === "light" ? [78, 80] : [25, 35];
|
|
37487
|
-
const s = pickInRange(hash >>> 8, sMin, sMax);
|
|
37488
|
-
const l = pickInRange(hash >>> 16, lMin, lMax);
|
|
37489
|
-
return `hsl(${hue}, ${s}%, ${l}%)`;
|
|
37490
|
-
};
|
|
37491
|
-
|
|
37492
|
-
const getUppercase = (s) => {
|
|
37493
|
-
const uppercases = [...s].filter((c) => c >= "A" && c <= "Z").join("");
|
|
37494
|
-
return uppercases.length > 0 ? uppercases : s[0].toUpperCase();
|
|
37495
|
-
};
|
|
37496
|
-
|
|
37497
37918
|
const RoundSpan = styled.span`
|
|
37498
37919
|
background-color: ${({ $bgColor }) => $bgColor || "none"};
|
|
37499
37920
|
border-radius: 13px;
|
|
@@ -37528,7 +37949,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37528
37949
|
if (isError) {
|
|
37529
37950
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
37530
37951
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
|
|
37531
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
|
|
37952
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
37532
37953
|
] });
|
|
37533
37954
|
}
|
|
37534
37955
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value2, index) => {
|
|
@@ -37583,6 +38004,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37583
38004
|
baseFactoryNamespacedBuiltinKey,
|
|
37584
38005
|
baseFactoryClusterSceopedBuiltinKey,
|
|
37585
38006
|
baseNamespaceFactoryKey,
|
|
38007
|
+
baseNavigationPluralName,
|
|
38008
|
+
baseNavigationSpecificName,
|
|
37586
38009
|
...props
|
|
37587
38010
|
} = data;
|
|
37588
38011
|
const theme = useTheme();
|
|
@@ -37647,6 +38070,354 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37647
38070
|
baseFactoryNamespacedBuiltinKey,
|
|
37648
38071
|
baseFactoryClusterSceopedBuiltinKey,
|
|
37649
38072
|
baseNamespaceFactoryKey,
|
|
38073
|
+
baseNavigationPluralName,
|
|
38074
|
+
baseNavigationSpecificName,
|
|
38075
|
+
...props
|
|
38076
|
+
}
|
|
38077
|
+
),
|
|
38078
|
+
children
|
|
38079
|
+
] });
|
|
38080
|
+
};
|
|
38081
|
+
|
|
38082
|
+
const getKinds = async ({ clusterName }) => {
|
|
38083
|
+
const result = await axios.get(`/api/clusters/${clusterName}/openapi-bff/search/kinds/getKinds`);
|
|
38084
|
+
return result.data;
|
|
38085
|
+
};
|
|
38086
|
+
|
|
38087
|
+
const parseK8sVersion$1 = (raw) => {
|
|
38088
|
+
const m = /^v(?<major>\d+)(?:(?<stage>alpha|beta)(?<stageNum>\d+)?)?$/i.exec(raw ?? "");
|
|
38089
|
+
if (!m?.groups) return { rank: 0, major: -1, stageNum: -1 };
|
|
38090
|
+
const stage = (m.groups.stage ?? "").toLowerCase();
|
|
38091
|
+
const major = Number(m.groups.major);
|
|
38092
|
+
const stageNum = m.groups.stageNum ? Number(m.groups.stageNum) : 0;
|
|
38093
|
+
const rank = stage === "" ? 3 : stage === "beta" ? 2 : 1;
|
|
38094
|
+
return { rank, major, stageNum };
|
|
38095
|
+
};
|
|
38096
|
+
const versionToken$1 = (e) => e.version || (e.groupVersion?.split("/").pop() ?? "");
|
|
38097
|
+
const compareK8sVersionDesc$1 = (a, b) => {
|
|
38098
|
+
const pa = parseK8sVersion$1(versionToken$1(a));
|
|
38099
|
+
const pb = parseK8sVersion$1(versionToken$1(b));
|
|
38100
|
+
return pb.rank - pa.rank || pb.major - pa.major || pb.stageNum - pa.stageNum;
|
|
38101
|
+
};
|
|
38102
|
+
const orderVersions = (versions) => {
|
|
38103
|
+
const preferredIdx = versions.findIndex((v) => v.preferred === true);
|
|
38104
|
+
if (preferredIdx >= 0) {
|
|
38105
|
+
const preferred = versions[preferredIdx];
|
|
38106
|
+
const rest = versions.filter((_, i) => i !== preferredIdx).slice().sort(compareK8sVersionDesc$1);
|
|
38107
|
+
return [preferred, ...rest];
|
|
38108
|
+
}
|
|
38109
|
+
return versions.slice().sort(compareK8sVersionDesc$1);
|
|
38110
|
+
};
|
|
38111
|
+
const getSortedKindsAll = (index) => {
|
|
38112
|
+
const counts = index.items.reduce(
|
|
38113
|
+
(acc, item) => ({ ...acc, [item.kind]: (acc[item.kind] ?? 0) + 1 }),
|
|
38114
|
+
{}
|
|
38115
|
+
);
|
|
38116
|
+
const rows = index.items.flatMap((item) => {
|
|
38117
|
+
const ordered = orderVersions(item.versions);
|
|
38118
|
+
return ordered.map((v) => ({
|
|
38119
|
+
group: item.group,
|
|
38120
|
+
kind: item.kind,
|
|
38121
|
+
// clone to drop Readonly<> without changing fields (incl. preferred)
|
|
38122
|
+
version: { ...v },
|
|
38123
|
+
...counts[item.kind] > 1 ? { notUnique: true } : {}
|
|
38124
|
+
}));
|
|
38125
|
+
});
|
|
38126
|
+
return rows.sort(
|
|
38127
|
+
(a, b) => a.kind.localeCompare(b.kind, void 0, { sensitivity: "base" }) || a.group.localeCompare(b.group, void 0, { sensitivity: "base" })
|
|
38128
|
+
);
|
|
38129
|
+
};
|
|
38130
|
+
|
|
38131
|
+
const parseApiVersion = (apiVersion) => {
|
|
38132
|
+
const parts = apiVersion.trim().split("/");
|
|
38133
|
+
return parts.length === 1 ? { group: "", version: parts[0] } : { group: parts[0], version: parts[1] };
|
|
38134
|
+
};
|
|
38135
|
+
const pluralByKind = (entries) => (kind, apiVersion) => {
|
|
38136
|
+
const norm = (s) => s.trim();
|
|
38137
|
+
const kindNorm = norm(kind);
|
|
38138
|
+
const gv = apiVersion ? parseApiVersion(apiVersion) : void 0;
|
|
38139
|
+
const candidates = entries.filter((e) => norm(e.kind) === kindNorm);
|
|
38140
|
+
if (candidates.length === 0) return void 0;
|
|
38141
|
+
const filtered = gv ? candidates.filter((e) => norm(e.group) === norm(gv.group) && e.version.version === gv.version) : candidates;
|
|
38142
|
+
if (filtered.length === 0) return void 0;
|
|
38143
|
+
const preferredFirst = gv ? filtered : [...filtered.filter((e) => e.version.preferred), ...filtered.filter((e) => !e.version.preferred)];
|
|
38144
|
+
const resources = preferredFirst.map((e) => e.version.resource).filter(Boolean);
|
|
38145
|
+
const uniq = Array.from(new Set(resources));
|
|
38146
|
+
if (!gv && uniq.length > 1) {
|
|
38147
|
+
const first = preferredFirst[0]?.version.resource;
|
|
38148
|
+
return first ?? void 0;
|
|
38149
|
+
}
|
|
38150
|
+
return uniq.length === 1 ? uniq[0] : void 0;
|
|
38151
|
+
};
|
|
38152
|
+
|
|
38153
|
+
const findOwnerReferencePath = (rawObject, jsonPathToArrayOfRefs, reference) => {
|
|
38154
|
+
if (!rawObject || !jsonPathToArrayOfRefs) return void 0;
|
|
38155
|
+
let arrayJsonPath = jsonPathToArrayOfRefs.trim();
|
|
38156
|
+
if (arrayJsonPath.startsWith(".")) {
|
|
38157
|
+
arrayJsonPath = `$${arrayJsonPath}`;
|
|
38158
|
+
}
|
|
38159
|
+
if (!arrayJsonPath.startsWith("$")) {
|
|
38160
|
+
arrayJsonPath = `$${arrayJsonPath}`;
|
|
38161
|
+
}
|
|
38162
|
+
arrayJsonPath = arrayJsonPath.replace(/\[\*\]$/, "");
|
|
38163
|
+
const nodes = jp.nodes(rawObject, arrayJsonPath);
|
|
38164
|
+
if (!nodes.length) return void 0;
|
|
38165
|
+
const arrayNode = nodes[0];
|
|
38166
|
+
const arr = arrayNode.value;
|
|
38167
|
+
if (!Array.isArray(arr)) return void 0;
|
|
38168
|
+
const index = arr.findIndex((item) => {
|
|
38169
|
+
if (!item) return false;
|
|
38170
|
+
return item.name === reference.name && item.kind === reference.kind && item.apiVersion === reference.apiVersion;
|
|
38171
|
+
});
|
|
38172
|
+
if (index === -1) return void 0;
|
|
38173
|
+
const basePathSegs = arrayNode.path.slice(1);
|
|
38174
|
+
return [...basePathSegs, index];
|
|
38175
|
+
};
|
|
38176
|
+
const parseDotPath$1 = (dotPath) => dotPath.split(".").filter(Boolean).map((seg) => seg.match(/^\d+$/) ? Number(seg) : seg);
|
|
38177
|
+
const resolveFormPath$1 = (pathInput, basePathForRelative) => {
|
|
38178
|
+
if (!pathInput) return [];
|
|
38179
|
+
if (Array.isArray(pathInput)) return pathInput;
|
|
38180
|
+
const pathStr = String(pathInput);
|
|
38181
|
+
const isRelative = pathStr.startsWith("./") || pathStr.startsWith("../");
|
|
38182
|
+
if (!isRelative) {
|
|
38183
|
+
return parseDotPath$1(pathStr);
|
|
38184
|
+
}
|
|
38185
|
+
let resolved = [...basePathForRelative];
|
|
38186
|
+
const parts = pathStr.split("/").filter(Boolean);
|
|
38187
|
+
for (const part of parts) {
|
|
38188
|
+
if (part === ".") {
|
|
38189
|
+
continue;
|
|
38190
|
+
}
|
|
38191
|
+
if (part === "..") {
|
|
38192
|
+
resolved = resolved.slice(0, -1);
|
|
38193
|
+
continue;
|
|
38194
|
+
}
|
|
38195
|
+
resolved.push(...parseDotPath$1(part));
|
|
38196
|
+
}
|
|
38197
|
+
return resolved;
|
|
38198
|
+
};
|
|
38199
|
+
|
|
38200
|
+
const RefElement = ({
|
|
38201
|
+
reference,
|
|
38202
|
+
keysToForcedLabel,
|
|
38203
|
+
forcedRelatedValuePath,
|
|
38204
|
+
rawObjectToFindLabel,
|
|
38205
|
+
jsonPathToArrayOfRefs,
|
|
38206
|
+
forcedNamespace,
|
|
38207
|
+
theme,
|
|
38208
|
+
baseprefix,
|
|
38209
|
+
cluster,
|
|
38210
|
+
getPlural,
|
|
38211
|
+
baseFactoryNamespacedAPIKey,
|
|
38212
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38213
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38214
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38215
|
+
baseFactoriesMapping
|
|
38216
|
+
}) => {
|
|
38217
|
+
let forcedName;
|
|
38218
|
+
let objectNamespace;
|
|
38219
|
+
if (keysToForcedLabel && rawObjectToFindLabel) {
|
|
38220
|
+
forcedName = Array.isArray(keysToForcedLabel) ? _$1.get(rawObjectToFindLabel, keysToForcedLabel) : jp.query(rawObjectToFindLabel, `$${keysToForcedLabel}`)[0];
|
|
38221
|
+
}
|
|
38222
|
+
if (forcedRelatedValuePath && rawObjectToFindLabel) {
|
|
38223
|
+
try {
|
|
38224
|
+
const ownerRefPathSegs = findOwnerReferencePath(
|
|
38225
|
+
rawObjectToFindLabel,
|
|
38226
|
+
jsonPathToArrayOfRefs,
|
|
38227
|
+
// ".spec.customRef"
|
|
38228
|
+
reference
|
|
38229
|
+
);
|
|
38230
|
+
const relatedPath = forcedRelatedValuePath && ownerRefPathSegs ? resolveFormPath$1(forcedRelatedValuePath, ownerRefPathSegs) : void 0;
|
|
38231
|
+
if (relatedPath) {
|
|
38232
|
+
forcedName = _$1.get(rawObjectToFindLabel, relatedPath);
|
|
38233
|
+
}
|
|
38234
|
+
} catch {
|
|
38235
|
+
}
|
|
38236
|
+
}
|
|
38237
|
+
if (rawObjectToFindLabel) {
|
|
38238
|
+
try {
|
|
38239
|
+
const defaultFetched = _$1.get(rawObjectToFindLabel, ["metadata", "namespace"]);
|
|
38240
|
+
const socketFetched = _$1.get(rawObjectToFindLabel, ["items", 0, "metadata", "namespace"]);
|
|
38241
|
+
objectNamespace = socketFetched || defaultFetched;
|
|
38242
|
+
} catch {
|
|
38243
|
+
}
|
|
38244
|
+
}
|
|
38245
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38246
|
+
ResourceLink,
|
|
38247
|
+
{
|
|
38248
|
+
kind: reference.kind,
|
|
38249
|
+
apiVersion: reference.apiVersion,
|
|
38250
|
+
namespace: forcedNamespace || reference.namespace || objectNamespace,
|
|
38251
|
+
forcedName,
|
|
38252
|
+
name: reference.name,
|
|
38253
|
+
theme,
|
|
38254
|
+
baseprefix,
|
|
38255
|
+
cluster,
|
|
38256
|
+
getPlural,
|
|
38257
|
+
baseFactoryNamespacedAPIKey,
|
|
38258
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38259
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38260
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38261
|
+
baseFactoriesMapping
|
|
38262
|
+
}
|
|
38263
|
+
);
|
|
38264
|
+
};
|
|
38265
|
+
|
|
38266
|
+
const RefsList = ({
|
|
38267
|
+
theme,
|
|
38268
|
+
baseprefix,
|
|
38269
|
+
cluster,
|
|
38270
|
+
refsArr,
|
|
38271
|
+
keysToForcedLabel,
|
|
38272
|
+
forcedRelatedValuePath,
|
|
38273
|
+
rawObjectToFindLabel,
|
|
38274
|
+
jsonPathToArrayOfRefs,
|
|
38275
|
+
forcedNamespace,
|
|
38276
|
+
baseFactoryNamespacedAPIKey,
|
|
38277
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38278
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38279
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38280
|
+
baseNavigationPluralName,
|
|
38281
|
+
baseNavigationSpecificName,
|
|
38282
|
+
listFlexProps
|
|
38283
|
+
}) => {
|
|
38284
|
+
const [kindIndex, setKindIndex] = K.useState();
|
|
38285
|
+
const [kindsWithVersion, setKindWithVersion] = K.useState();
|
|
38286
|
+
K.useEffect(() => {
|
|
38287
|
+
getKinds({ clusterName: cluster }).then((data) => {
|
|
38288
|
+
setKindIndex(data);
|
|
38289
|
+
setKindWithVersion(getSortedKindsAll(data));
|
|
38290
|
+
}).catch((error) => {
|
|
38291
|
+
console.error(error);
|
|
38292
|
+
});
|
|
38293
|
+
}, [cluster]);
|
|
38294
|
+
const { data: navigationDataArr } = useK8sSmartResource({
|
|
38295
|
+
cluster,
|
|
38296
|
+
group: "front.in-cloud.io",
|
|
38297
|
+
version: "v1alpha1",
|
|
38298
|
+
plural: baseNavigationPluralName,
|
|
38299
|
+
fieldSelector: `metadata.name=${baseNavigationSpecificName}`
|
|
38300
|
+
});
|
|
38301
|
+
const getPlural = kindsWithVersion ? pluralByKind(kindsWithVersion) : void 0;
|
|
38302
|
+
const baseFactoriesMapping = navigationDataArr && navigationDataArr.items && navigationDataArr.items.length > 0 ? navigationDataArr.items[0].spec?.baseFactoriesMapping : void 0;
|
|
38303
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { vertical: true, gap: 8, ...listFlexProps, children: refsArr.map((ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38304
|
+
RefElement,
|
|
38305
|
+
{
|
|
38306
|
+
reference: ref,
|
|
38307
|
+
keysToForcedLabel,
|
|
38308
|
+
forcedRelatedValuePath,
|
|
38309
|
+
rawObjectToFindLabel,
|
|
38310
|
+
jsonPathToArrayOfRefs,
|
|
38311
|
+
forcedNamespace,
|
|
38312
|
+
theme,
|
|
38313
|
+
baseprefix,
|
|
38314
|
+
cluster,
|
|
38315
|
+
getPlural,
|
|
38316
|
+
baseFactoryNamespacedAPIKey,
|
|
38317
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38318
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38319
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38320
|
+
baseFactoriesMapping
|
|
38321
|
+
},
|
|
38322
|
+
JSON.stringify(ref)
|
|
38323
|
+
)) });
|
|
38324
|
+
};
|
|
38325
|
+
|
|
38326
|
+
const isOwnerReference = (value) => {
|
|
38327
|
+
if (!value || typeof value !== "object") {
|
|
38328
|
+
return false;
|
|
38329
|
+
}
|
|
38330
|
+
if (value === null) {
|
|
38331
|
+
return false;
|
|
38332
|
+
}
|
|
38333
|
+
if (!("apiVersion" in value) || typeof value.apiVersion !== "string" || !("kind" in value) || typeof value.kind !== "string" || !("name" in value) || typeof value.name !== "string") {
|
|
38334
|
+
return false;
|
|
38335
|
+
}
|
|
38336
|
+
return true;
|
|
38337
|
+
};
|
|
38338
|
+
|
|
38339
|
+
const OwnerRefs = ({
|
|
38340
|
+
data,
|
|
38341
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38342
|
+
children
|
|
38343
|
+
}) => {
|
|
38344
|
+
const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
|
|
38345
|
+
const {
|
|
38346
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38347
|
+
id,
|
|
38348
|
+
baseprefix,
|
|
38349
|
+
clusterNamePartOfUrl,
|
|
38350
|
+
reqIndex,
|
|
38351
|
+
errorText,
|
|
38352
|
+
notArrayErrorText,
|
|
38353
|
+
emptyArrayErrorText,
|
|
38354
|
+
isNotRefsArrayErrorText,
|
|
38355
|
+
containerStyle,
|
|
38356
|
+
listFlexProps,
|
|
38357
|
+
keysToForcedLabel,
|
|
38358
|
+
forcedRelatedValuePath,
|
|
38359
|
+
jsonPathToArrayOfRefs,
|
|
38360
|
+
forcedNamespace,
|
|
38361
|
+
baseFactoryNamespacedAPIKey,
|
|
38362
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38363
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38364
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38365
|
+
baseNavigationPluralName,
|
|
38366
|
+
baseNavigationSpecificName,
|
|
38367
|
+
...props
|
|
38368
|
+
} = data;
|
|
38369
|
+
const theme = useTheme();
|
|
38370
|
+
const partsOfUrl = usePartsOfUrl();
|
|
38371
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
38372
|
+
acc[index.toString()] = value;
|
|
38373
|
+
return acc;
|
|
38374
|
+
}, {});
|
|
38375
|
+
const clusterName = prepareTemplate({
|
|
38376
|
+
template: clusterNamePartOfUrl,
|
|
38377
|
+
replaceValues
|
|
38378
|
+
});
|
|
38379
|
+
const preparedForcedNamespace = forcedNamespace ? prepareTemplate({
|
|
38380
|
+
template: forcedNamespace,
|
|
38381
|
+
replaceValues
|
|
38382
|
+
}) : void 0;
|
|
38383
|
+
const jsonRoot = multiQueryData[`req${reqIndex}`];
|
|
38384
|
+
if (jsonRoot === void 0) {
|
|
38385
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
|
|
38386
|
+
}
|
|
38387
|
+
const refsArr = jp.query(jsonRoot, `$${jsonPathToArrayOfRefs}`)[0];
|
|
38388
|
+
if (!Array.isArray(refsArr)) {
|
|
38389
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: notArrayErrorText });
|
|
38390
|
+
}
|
|
38391
|
+
if (refsArr.length === 0) {
|
|
38392
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: emptyArrayErrorText });
|
|
38393
|
+
}
|
|
38394
|
+
if (refsArr.some((el) => !isOwnerReference(el))) {
|
|
38395
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: isNotRefsArrayErrorText });
|
|
38396
|
+
}
|
|
38397
|
+
const guardedRefsArr = refsArr;
|
|
38398
|
+
if (isMultiqueryLoading) {
|
|
38399
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
38400
|
+
}
|
|
38401
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
38402
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38403
|
+
RefsList,
|
|
38404
|
+
{
|
|
38405
|
+
theme,
|
|
38406
|
+
baseprefix,
|
|
38407
|
+
cluster: clusterName,
|
|
38408
|
+
refsArr: guardedRefsArr,
|
|
38409
|
+
keysToForcedLabel,
|
|
38410
|
+
forcedRelatedValuePath,
|
|
38411
|
+
jsonPathToArrayOfRefs,
|
|
38412
|
+
forcedNamespace: preparedForcedNamespace,
|
|
38413
|
+
rawObjectToFindLabel: jsonRoot,
|
|
38414
|
+
baseFactoryNamespacedAPIKey,
|
|
38415
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38416
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38417
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38418
|
+
baseNavigationPluralName,
|
|
38419
|
+
baseNavigationSpecificName,
|
|
38420
|
+
listFlexProps,
|
|
37650
38421
|
...props
|
|
37651
38422
|
}
|
|
37652
38423
|
),
|
|
@@ -37690,7 +38461,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37690
38461
|
ConverterBytes,
|
|
37691
38462
|
SecretBase64Plain,
|
|
37692
38463
|
ResourceBadge,
|
|
37693
|
-
Events: Events$1
|
|
38464
|
+
Events: Events$1,
|
|
38465
|
+
OwnerRefs
|
|
37694
38466
|
};
|
|
37695
38467
|
|
|
37696
38468
|
const prepareUrlsToFetchForDynamicRenderer = ({
|
|
@@ -37709,13 +38481,30 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37709
38481
|
);
|
|
37710
38482
|
};
|
|
37711
38483
|
|
|
38484
|
+
const STRING_KEYS = ["cluster", "group", "version", "plural", "namespace", "fieldSelector", "labelSelector"];
|
|
37712
38485
|
const DynamicRendererWithProviders = (props) => {
|
|
37713
38486
|
const location = reactRouterDom.useLocation();
|
|
37714
38487
|
const { urlsToFetch, dataToApplyToContext, theme, nodeTerminalDefaultProfile, disableEventBubbling } = props;
|
|
38488
|
+
const directUrls = urlsToFetch.filter((el) => typeof el === "string");
|
|
38489
|
+
const k8sResourcesUrls = urlsToFetch.filter((el) => typeof el !== "string");
|
|
37715
38490
|
const preparedUrlsToFetch = prepareUrlsToFetchForDynamicRenderer({
|
|
37716
|
-
urls:
|
|
38491
|
+
urls: directUrls,
|
|
37717
38492
|
locationPathname: location.pathname
|
|
37718
38493
|
});
|
|
38494
|
+
const preparedK8sResoucesUrls = k8sResourcesUrls.map((res) => {
|
|
38495
|
+
let next = { ...res };
|
|
38496
|
+
for (const key of STRING_KEYS) {
|
|
38497
|
+
const val = next[key];
|
|
38498
|
+
if (typeof val === "string" && val.length > 0) {
|
|
38499
|
+
const prepared = prepareUrlsToFetchForDynamicRenderer({
|
|
38500
|
+
urls: [val],
|
|
38501
|
+
locationPathname: location.pathname
|
|
38502
|
+
});
|
|
38503
|
+
next = { ...next, [key]: prepared[0] ?? val };
|
|
38504
|
+
}
|
|
38505
|
+
}
|
|
38506
|
+
return next;
|
|
38507
|
+
});
|
|
37719
38508
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37720
38509
|
CursorDefaultDiv,
|
|
37721
38510
|
{
|
|
@@ -37725,7 +38514,14 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37725
38514
|
e.stopPropagation();
|
|
37726
38515
|
}
|
|
37727
38516
|
},
|
|
37728
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FactoryConfigContextProvider, { value: { nodeTerminalDefaultProfile }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PartsOfUrlProvider, { value: { partsOfUrl: location.pathname.split("/") }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38517
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FactoryConfigContextProvider, { value: { nodeTerminalDefaultProfile }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PartsOfUrlProvider, { value: { partsOfUrl: location.pathname.split("/") }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38518
|
+
MultiQueryProvider,
|
|
38519
|
+
{
|
|
38520
|
+
items: [...preparedK8sResoucesUrls, ...preparedUrlsToFetch],
|
|
38521
|
+
dataToApplyToContext,
|
|
38522
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props })
|
|
38523
|
+
}
|
|
38524
|
+
) }) }) })
|
|
37729
38525
|
}
|
|
37730
38526
|
);
|
|
37731
38527
|
};
|
|
@@ -38334,6 +39130,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
38334
39130
|
setIsError(void 0);
|
|
38335
39131
|
setIsLoading(true);
|
|
38336
39132
|
const payload = {
|
|
39133
|
+
clusterName: cluster,
|
|
38337
39134
|
customizationId,
|
|
38338
39135
|
tableMappingsReplaceValues,
|
|
38339
39136
|
forceDefaultAdditionalPrinterColumns,
|
|
@@ -46651,9 +47448,56 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
46651
47448
|
const [yamlData, setYamlData] = K.useState("");
|
|
46652
47449
|
const [isLoading, setIsLoading] = K.useState(false);
|
|
46653
47450
|
const [error, setError] = K.useState();
|
|
47451
|
+
const initialPrefillYamlRef = K.useRef(null);
|
|
47452
|
+
const latestPrefillYamlRef = K.useRef(null);
|
|
47453
|
+
const firstLoadRef = K.useRef(true);
|
|
47454
|
+
const handleReload = () => {
|
|
47455
|
+
const nextYaml = latestPrefillYamlRef.current ?? initialPrefillYamlRef.current;
|
|
47456
|
+
if (nextYaml !== null) {
|
|
47457
|
+
setYamlData(nextYaml);
|
|
47458
|
+
}
|
|
47459
|
+
};
|
|
47460
|
+
const openNotificationYamlChanged = K.useCallback(() => {
|
|
47461
|
+
const key = `open${Date.now()}`;
|
|
47462
|
+
const btn = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47463
|
+
antd.Button,
|
|
47464
|
+
{
|
|
47465
|
+
type: "primary",
|
|
47466
|
+
size: "small",
|
|
47467
|
+
onClick: () => {
|
|
47468
|
+
handleReload();
|
|
47469
|
+
api.destroy(key);
|
|
47470
|
+
},
|
|
47471
|
+
children: "Reload"
|
|
47472
|
+
}
|
|
47473
|
+
);
|
|
47474
|
+
api.info({
|
|
47475
|
+
message: "Data changed",
|
|
47476
|
+
description: "Reload will flush changes and reload data to latest",
|
|
47477
|
+
btn,
|
|
47478
|
+
key,
|
|
47479
|
+
onClose: () => console.log("Notification closed"),
|
|
47480
|
+
placement: "bottomRight",
|
|
47481
|
+
duration: 30
|
|
47482
|
+
// keep it open until user closes
|
|
47483
|
+
});
|
|
47484
|
+
}, [api]);
|
|
46654
47485
|
K.useEffect(() => {
|
|
46655
|
-
|
|
46656
|
-
|
|
47486
|
+
if (prefillValuesSchema === void 0) return;
|
|
47487
|
+
console.log(prefillValuesSchema);
|
|
47488
|
+
const nextYaml = stringify(prefillValuesSchema);
|
|
47489
|
+
if (firstLoadRef.current) {
|
|
47490
|
+
initialPrefillYamlRef.current = nextYaml;
|
|
47491
|
+
latestPrefillYamlRef.current = nextYaml;
|
|
47492
|
+
setYamlData(nextYaml);
|
|
47493
|
+
firstLoadRef.current = false;
|
|
47494
|
+
return;
|
|
47495
|
+
}
|
|
47496
|
+
if (nextYaml !== latestPrefillYamlRef.current) {
|
|
47497
|
+
openNotificationYamlChanged();
|
|
47498
|
+
}
|
|
47499
|
+
latestPrefillYamlRef.current = nextYaml;
|
|
47500
|
+
}, [prefillValuesSchema, openNotificationYamlChanged]);
|
|
46657
47501
|
const onSubmit = () => {
|
|
46658
47502
|
setIsLoading(true);
|
|
46659
47503
|
setError(void 0);
|
|
@@ -46725,7 +47569,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
46725
47569
|
) }),
|
|
46726
47570
|
!readOnly && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$j.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
|
|
46727
47571
|
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "primary", onClick: onSubmit, loading: isLoading, children: "Submit" }),
|
|
46728
|
-
backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: () => navigate(backlink), children: "Cancel" })
|
|
47572
|
+
backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: () => navigate(backlink), children: "Cancel" }),
|
|
47573
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: handleReload, children: "Reload" })
|
|
46729
47574
|
] }) }),
|
|
46730
47575
|
error && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
46731
47576
|
antd.Modal,
|
|
@@ -49818,7 +50663,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
49818
50663
|
] });
|
|
49819
50664
|
};
|
|
49820
50665
|
|
|
49821
|
-
const
|
|
50666
|
+
const BlackholeFormProvider = ({
|
|
49822
50667
|
theme,
|
|
49823
50668
|
cluster,
|
|
49824
50669
|
urlParams,
|
|
@@ -50308,28 +51153,14 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50308
51153
|
apiVersion,
|
|
50309
51154
|
baseprefix
|
|
50310
51155
|
});
|
|
50311
|
-
const {
|
|
50312
|
-
|
|
50313
|
-
|
|
50314
|
-
|
|
50315
|
-
|
|
50316
|
-
|
|
50317
|
-
query: {
|
|
50318
|
-
namespace,
|
|
50319
|
-
apiVersion: apiVersion || "",
|
|
50320
|
-
apiGroup,
|
|
50321
|
-
plural: type
|
|
50322
|
-
},
|
|
51156
|
+
const { data: k8sList, error: k8sListError } = useK8sSmartResource({
|
|
51157
|
+
cluster: clusterName || "",
|
|
51158
|
+
namespace,
|
|
51159
|
+
group: apiGroup,
|
|
51160
|
+
version: apiVersion || "",
|
|
51161
|
+
plural: type,
|
|
50323
51162
|
isEnabled: Boolean(apiVersion && addedMode && type !== "direct")
|
|
50324
51163
|
});
|
|
50325
|
-
const k8sListError = status === "closed" && lastError ? lastError : void 0;
|
|
50326
|
-
const k8sList = {
|
|
50327
|
-
items: state.order.map((key) => {
|
|
50328
|
-
const res = state.byKey[key];
|
|
50329
|
-
return res;
|
|
50330
|
-
})
|
|
50331
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50332
|
-
};
|
|
50333
51164
|
if (addedMode && (k8sListError || type === "direct") && !showZeroResources) {
|
|
50334
51165
|
return null;
|
|
50335
51166
|
}
|
|
@@ -50458,30 +51289,17 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50458
51289
|
const [filteredAndSortedData, setFilterAndSortedData] = K.useState([]);
|
|
50459
51290
|
const [uniqueTags, setUniqueTags] = K.useState([]);
|
|
50460
51291
|
const [selectedTags, setSelectedTags] = K.useState([]);
|
|
50461
|
-
const {
|
|
50462
|
-
|
|
50463
|
-
|
|
50464
|
-
|
|
50465
|
-
|
|
50466
|
-
|
|
50467
|
-
|
|
50468
|
-
|
|
50469
|
-
|
|
50470
|
-
|
|
50471
|
-
},
|
|
50472
|
-
isEnabled: clusterName !== void 0
|
|
51292
|
+
const {
|
|
51293
|
+
data: marketplacePanels,
|
|
51294
|
+
isLoading,
|
|
51295
|
+
error
|
|
51296
|
+
} = useK8sSmartResource({
|
|
51297
|
+
cluster: clusterName || "",
|
|
51298
|
+
group: baseApiGroup,
|
|
51299
|
+
version: baseApiVersion,
|
|
51300
|
+
plural: mpResourceName,
|
|
51301
|
+
isEnabled: Boolean(clusterName !== void 0)
|
|
50473
51302
|
});
|
|
50474
|
-
const isLoading = status === "connecting";
|
|
50475
|
-
const error = status === "closed" && lastError ? lastError : void 0;
|
|
50476
|
-
const marketplacePanels = K.useMemo(() => {
|
|
50477
|
-
return {
|
|
50478
|
-
items: state.order.map((key) => {
|
|
50479
|
-
const res = state.byKey[key];
|
|
50480
|
-
return res;
|
|
50481
|
-
})
|
|
50482
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50483
|
-
};
|
|
50484
|
-
}, [state]);
|
|
50485
51303
|
const createPermission = usePermissions({
|
|
50486
51304
|
group: baseApiGroup,
|
|
50487
51305
|
resource: mpResourceName,
|
|
@@ -50780,52 +51598,30 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
50780
51598
|
children
|
|
50781
51599
|
}) => {
|
|
50782
51600
|
const navigate = reactRouterDom.useNavigate();
|
|
50783
|
-
const { state, status } = useListWatch({
|
|
50784
|
-
wsUrl: `/api/clusters/${clusterName}/openapi-bff-ws/listThenWatch/listWatchWs`,
|
|
50785
|
-
paused: false,
|
|
50786
|
-
ignoreRemove: false,
|
|
50787
|
-
autoDrain: true,
|
|
50788
|
-
preserveStateOnUrlChange: true,
|
|
50789
|
-
query: {
|
|
50790
|
-
apiVersion: baseApiVersion,
|
|
50791
|
-
apiGroup: baseApiGroup,
|
|
50792
|
-
plural: mpResourceName
|
|
50793
|
-
},
|
|
50794
|
-
isEnabled: clusterName !== void 0
|
|
50795
|
-
});
|
|
50796
|
-
const marketplaceIsLoading = status === "connecting";
|
|
50797
|
-
const marketplacePanels = {
|
|
50798
|
-
items: state.order.map((key) => {
|
|
50799
|
-
const res = state.byKey[key];
|
|
50800
|
-
return res;
|
|
50801
|
-
})
|
|
50802
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50803
|
-
};
|
|
50804
51601
|
const {
|
|
50805
|
-
|
|
50806
|
-
|
|
50807
|
-
|
|
50808
|
-
} =
|
|
50809
|
-
|
|
50810
|
-
|
|
50811
|
-
|
|
50812
|
-
|
|
50813
|
-
|
|
50814
|
-
query: {
|
|
50815
|
-
apiVersion: baseProjectVersion,
|
|
50816
|
-
apiGroup: baseProjectApiGroup,
|
|
50817
|
-
plural: projectResourceName,
|
|
50818
|
-
fieldSelector: `metadata.name=${namespace}`
|
|
50819
|
-
},
|
|
50820
|
-
isEnabled: clusterName !== void 0
|
|
51602
|
+
data: marketplacePanels,
|
|
51603
|
+
isLoading: marketplaceIsLoading
|
|
51604
|
+
// error: marketplaceError,
|
|
51605
|
+
} = useK8sSmartResource({
|
|
51606
|
+
cluster: clusterName || "",
|
|
51607
|
+
group: baseApiGroup,
|
|
51608
|
+
version: baseApiVersion,
|
|
51609
|
+
plural: mpResourceName,
|
|
51610
|
+
isEnabled: Boolean(clusterName !== void 0)
|
|
50821
51611
|
});
|
|
50822
|
-
const
|
|
50823
|
-
|
|
50824
|
-
|
|
50825
|
-
|
|
50826
|
-
|
|
51612
|
+
const {
|
|
51613
|
+
data: projectArr,
|
|
51614
|
+
isLoading,
|
|
51615
|
+
error
|
|
51616
|
+
} = useK8sSmartResource({
|
|
51617
|
+
cluster: clusterName || "",
|
|
51618
|
+
group: baseProjectApiGroup,
|
|
51619
|
+
version: baseProjectVersion,
|
|
51620
|
+
plural: projectResourceName,
|
|
51621
|
+
fieldSelector: `metadata.name=${namespace}`,
|
|
51622
|
+
isEnabled: Boolean(clusterName !== void 0)
|
|
50827
51623
|
});
|
|
50828
|
-
const project = projectArr.length > 0 ? projectArr[0] : void 0;
|
|
51624
|
+
const project = projectArr && projectArr.items && projectArr.items.length > 0 ? projectArr.items[0] : void 0;
|
|
50829
51625
|
const [isDeleteModalOpen, setIsDeleteModalOpen] = K.useState(false);
|
|
50830
51626
|
const updatePermission = usePermissions({
|
|
50831
51627
|
group: baseProjectApiGroup,
|
|
@@ -52131,77 +52927,6 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
52131
52927
|
);
|
|
52132
52928
|
};
|
|
52133
52929
|
|
|
52134
|
-
const getKinds = async ({ clusterName }) => {
|
|
52135
|
-
const result = await axios.get(`/api/clusters/${clusterName}/openapi-bff/search/kinds/getKinds`);
|
|
52136
|
-
return result.data;
|
|
52137
|
-
};
|
|
52138
|
-
|
|
52139
|
-
const parseK8sVersion$1 = (raw) => {
|
|
52140
|
-
const m = /^v(?<major>\d+)(?:(?<stage>alpha|beta)(?<stageNum>\d+)?)?$/i.exec(raw ?? "");
|
|
52141
|
-
if (!m?.groups) return { rank: 0, major: -1, stageNum: -1 };
|
|
52142
|
-
const stage = (m.groups.stage ?? "").toLowerCase();
|
|
52143
|
-
const major = Number(m.groups.major);
|
|
52144
|
-
const stageNum = m.groups.stageNum ? Number(m.groups.stageNum) : 0;
|
|
52145
|
-
const rank = stage === "" ? 3 : stage === "beta" ? 2 : 1;
|
|
52146
|
-
return { rank, major, stageNum };
|
|
52147
|
-
};
|
|
52148
|
-
const versionToken$1 = (e) => e.version || (e.groupVersion?.split("/").pop() ?? "");
|
|
52149
|
-
const compareK8sVersionDesc$1 = (a, b) => {
|
|
52150
|
-
const pa = parseK8sVersion$1(versionToken$1(a));
|
|
52151
|
-
const pb = parseK8sVersion$1(versionToken$1(b));
|
|
52152
|
-
return pb.rank - pa.rank || pb.major - pa.major || pb.stageNum - pa.stageNum;
|
|
52153
|
-
};
|
|
52154
|
-
const orderVersions = (versions) => {
|
|
52155
|
-
const preferredIdx = versions.findIndex((v) => v.preferred === true);
|
|
52156
|
-
if (preferredIdx >= 0) {
|
|
52157
|
-
const preferred = versions[preferredIdx];
|
|
52158
|
-
const rest = versions.filter((_, i) => i !== preferredIdx).slice().sort(compareK8sVersionDesc$1);
|
|
52159
|
-
return [preferred, ...rest];
|
|
52160
|
-
}
|
|
52161
|
-
return versions.slice().sort(compareK8sVersionDesc$1);
|
|
52162
|
-
};
|
|
52163
|
-
const getSortedKindsAll = (index) => {
|
|
52164
|
-
const counts = index.items.reduce(
|
|
52165
|
-
(acc, item) => ({ ...acc, [item.kind]: (acc[item.kind] ?? 0) + 1 }),
|
|
52166
|
-
{}
|
|
52167
|
-
);
|
|
52168
|
-
const rows = index.items.flatMap((item) => {
|
|
52169
|
-
const ordered = orderVersions(item.versions);
|
|
52170
|
-
return ordered.map((v) => ({
|
|
52171
|
-
group: item.group,
|
|
52172
|
-
kind: item.kind,
|
|
52173
|
-
// clone to drop Readonly<> without changing fields (incl. preferred)
|
|
52174
|
-
version: { ...v },
|
|
52175
|
-
...counts[item.kind] > 1 ? { notUnique: true } : {}
|
|
52176
|
-
}));
|
|
52177
|
-
});
|
|
52178
|
-
return rows.sort(
|
|
52179
|
-
(a, b) => a.kind.localeCompare(b.kind, void 0, { sensitivity: "base" }) || a.group.localeCompare(b.group, void 0, { sensitivity: "base" })
|
|
52180
|
-
);
|
|
52181
|
-
};
|
|
52182
|
-
|
|
52183
|
-
const parseApiVersion = (apiVersion) => {
|
|
52184
|
-
const parts = apiVersion.trim().split("/");
|
|
52185
|
-
return parts.length === 1 ? { group: "", version: parts[0] } : { group: parts[0], version: parts[1] };
|
|
52186
|
-
};
|
|
52187
|
-
const pluralByKind = (entries) => (kind, apiVersion) => {
|
|
52188
|
-
const norm = (s) => s.trim();
|
|
52189
|
-
const kindNorm = norm(kind);
|
|
52190
|
-
const gv = apiVersion ? parseApiVersion(apiVersion) : void 0;
|
|
52191
|
-
const candidates = entries.filter((e) => norm(e.kind) === kindNorm);
|
|
52192
|
-
if (candidates.length === 0) return void 0;
|
|
52193
|
-
const filtered = gv ? candidates.filter((e) => norm(e.group) === norm(gv.group) && e.version.version === gv.version) : candidates;
|
|
52194
|
-
if (filtered.length === 0) return void 0;
|
|
52195
|
-
const preferredFirst = gv ? filtered : [...filtered.filter((e) => e.version.preferred), ...filtered.filter((e) => !e.version.preferred)];
|
|
52196
|
-
const resources = preferredFirst.map((e) => e.version.resource).filter(Boolean);
|
|
52197
|
-
const uniq = Array.from(new Set(resources));
|
|
52198
|
-
if (!gv && uniq.length > 1) {
|
|
52199
|
-
const first = preferredFirst[0]?.version.resource;
|
|
52200
|
-
return first ?? void 0;
|
|
52201
|
-
}
|
|
52202
|
-
return uniq.length === 1 ? uniq[0] : void 0;
|
|
52203
|
-
};
|
|
52204
|
-
|
|
52205
52930
|
const eventKey = (e) => {
|
|
52206
52931
|
const n = e.metadata?.name ?? "";
|
|
52207
52932
|
const ns = e.metadata?.namespace ?? "";
|
|
@@ -52271,39 +52996,6 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
52271
52996
|
}
|
|
52272
52997
|
return new Date(iso).toLocaleString();
|
|
52273
52998
|
};
|
|
52274
|
-
const getResourceLink = ({
|
|
52275
|
-
baseprefix,
|
|
52276
|
-
cluster,
|
|
52277
|
-
namespace,
|
|
52278
|
-
apiGroupVersion,
|
|
52279
|
-
pluralName,
|
|
52280
|
-
name,
|
|
52281
|
-
baseFactoryNamespacedAPIKey,
|
|
52282
|
-
baseFactoryClusterSceopedAPIKey,
|
|
52283
|
-
baseFactoryNamespacedBuiltinKey,
|
|
52284
|
-
baseFactoryClusterSceopedBuiltinKey
|
|
52285
|
-
}) => {
|
|
52286
|
-
if (!pluralName || !name) {
|
|
52287
|
-
return void 0;
|
|
52288
|
-
}
|
|
52289
|
-
if (apiGroupVersion === "v1") {
|
|
52290
|
-
return `${baseprefix}/${cluster}${namespace ? `/${namespace}` : ""}/factory/${namespace ? baseFactoryNamespacedBuiltinKey : baseFactoryClusterSceopedBuiltinKey}/${apiGroupVersion}/${pluralName}/${name}`;
|
|
52291
|
-
}
|
|
52292
|
-
return `${baseprefix}/${cluster}${namespace ? `/${namespace}` : ""}/factory/${namespace ? baseFactoryNamespacedAPIKey : baseFactoryClusterSceopedAPIKey}/${apiGroupVersion}/${pluralName}/${name}`;
|
|
52293
|
-
};
|
|
52294
|
-
const getNamespaceLink = ({
|
|
52295
|
-
baseprefix,
|
|
52296
|
-
cluster,
|
|
52297
|
-
apiGroupVersion,
|
|
52298
|
-
pluralName,
|
|
52299
|
-
namespace,
|
|
52300
|
-
baseNamespaceFactoryKey
|
|
52301
|
-
}) => {
|
|
52302
|
-
if (!namespace) {
|
|
52303
|
-
return void 0;
|
|
52304
|
-
}
|
|
52305
|
-
return `${baseprefix}/${cluster}/factory/${baseNamespaceFactoryKey}/${apiGroupVersion}/${pluralName}/${namespace}`;
|
|
52306
|
-
};
|
|
52307
52999
|
const formatEventSummary = (event) => {
|
|
52308
53000
|
if (!event.deprecatedCount || !event.deprecatedFirstTimestamp) {
|
|
52309
53001
|
return void 0;
|
|
@@ -52382,28 +53074,12 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
52382
53074
|
baseFactoryClusterSceopedAPIKey,
|
|
52383
53075
|
baseFactoryNamespacedBuiltinKey,
|
|
52384
53076
|
baseFactoryClusterSceopedBuiltinKey,
|
|
52385
|
-
baseNamespaceFactoryKey
|
|
53077
|
+
baseNamespaceFactoryKey,
|
|
53078
|
+
baseFactoriesMapping
|
|
52386
53079
|
}) => {
|
|
52387
53080
|
const { token } = antd.theme.useToken();
|
|
52388
53081
|
const navigate = reactRouterDom.useNavigate();
|
|
52389
|
-
const abbr = e.regarding?.kind ? getUppercase(e.regarding.kind) : void 0;
|
|
52390
|
-
const bgColor = e.regarding?.kind && abbr ? hslFromString(e.regarding?.kind, theme) : "initial";
|
|
52391
53082
|
const bgColorNamespace = hslFromString("Namespace", theme);
|
|
52392
|
-
const regardingKind = e.regarding?.kind;
|
|
52393
|
-
const regardingApiVersion = e.regarding?.apiVersion || "v1";
|
|
52394
|
-
const pluralName = regardingKind && regardingApiVersion ? getPlural?.(regardingKind, regardingApiVersion) : void 0;
|
|
52395
|
-
const resourceLink = getResourceLink({
|
|
52396
|
-
baseprefix,
|
|
52397
|
-
cluster,
|
|
52398
|
-
namespace: e.regarding?.namespace,
|
|
52399
|
-
apiGroupVersion: regardingApiVersion,
|
|
52400
|
-
pluralName,
|
|
52401
|
-
name: e.regarding?.name,
|
|
52402
|
-
baseFactoryNamespacedAPIKey,
|
|
52403
|
-
baseFactoryClusterSceopedAPIKey,
|
|
52404
|
-
baseFactoryNamespacedBuiltinKey,
|
|
52405
|
-
baseFactoryClusterSceopedBuiltinKey
|
|
52406
|
-
});
|
|
52407
53083
|
const namespaceLink = getNamespaceLink({
|
|
52408
53084
|
baseprefix,
|
|
52409
53085
|
cluster,
|
|
@@ -52420,19 +53096,24 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
52420
53096
|
children: [
|
|
52421
53097
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "space-between", align: "center", children: [
|
|
52422
53098
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 16, children: [
|
|
52423
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
52424
|
-
|
|
52425
|
-
|
|
52426
|
-
|
|
52427
|
-
|
|
52428
|
-
|
|
52429
|
-
|
|
52430
|
-
|
|
52431
|
-
|
|
52432
|
-
|
|
52433
|
-
|
|
52434
|
-
|
|
52435
|
-
|
|
53099
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
53100
|
+
ResourceLink,
|
|
53101
|
+
{
|
|
53102
|
+
kind: e.regarding?.kind,
|
|
53103
|
+
apiVersion: e.regarding?.apiVersion || "v1",
|
|
53104
|
+
namespace: e.regarding?.namespace,
|
|
53105
|
+
name: e.regarding?.name,
|
|
53106
|
+
theme,
|
|
53107
|
+
baseprefix,
|
|
53108
|
+
cluster,
|
|
53109
|
+
getPlural,
|
|
53110
|
+
baseFactoryNamespacedAPIKey,
|
|
53111
|
+
baseFactoryClusterSceopedAPIKey,
|
|
53112
|
+
baseFactoryNamespacedBuiltinKey,
|
|
53113
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
53114
|
+
baseFactoriesMapping
|
|
53115
|
+
}
|
|
53116
|
+
),
|
|
52436
53117
|
e.regarding?.namespace && /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 8, children: [
|
|
52437
53118
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.Abbr, { $bgColor: bgColorNamespace, children: "NS" }),
|
|
52438
53119
|
namespaceLink ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -52562,7 +53243,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
52562
53243
|
baseFactoryClusterSceopedAPIKey,
|
|
52563
53244
|
baseFactoryNamespacedBuiltinKey,
|
|
52564
53245
|
baseFactoryClusterSceopedBuiltinKey,
|
|
52565
|
-
baseNamespaceFactoryKey
|
|
53246
|
+
baseNamespaceFactoryKey,
|
|
53247
|
+
baseNavigationPluralName,
|
|
53248
|
+
baseNavigationSpecificName
|
|
52566
53249
|
}) => {
|
|
52567
53250
|
const { token } = antd.theme.useToken();
|
|
52568
53251
|
const [kindIndex, setKindIndex] = K.useState();
|
|
@@ -52575,6 +53258,13 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
52575
53258
|
console.error(error);
|
|
52576
53259
|
});
|
|
52577
53260
|
}, [cluster]);
|
|
53261
|
+
const { data: navigationDataArr } = useK8sSmartResource({
|
|
53262
|
+
cluster,
|
|
53263
|
+
group: "front.in-cloud.io",
|
|
53264
|
+
version: "v1alpha1",
|
|
53265
|
+
plural: baseNavigationPluralName,
|
|
53266
|
+
fieldSelector: `metadata.name=${baseNavigationSpecificName}`
|
|
53267
|
+
});
|
|
52578
53268
|
const [isPaused, setIsPaused] = K.useState(false);
|
|
52579
53269
|
const pausedRef = K.useRef(isPaused);
|
|
52580
53270
|
K.useEffect(() => {
|
|
@@ -52787,6 +53477,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
52787
53477
|
}, [hasMore, sendScroll]);
|
|
52788
53478
|
const total = state.order.length;
|
|
52789
53479
|
const getPlural = kindsWithVersion ? pluralByKind(kindsWithVersion) : void 0;
|
|
53480
|
+
const baseFactoriesMapping = navigationDataArr && navigationDataArr.items && navigationDataArr.items.length > 0 ? navigationDataArr.items[0].spec?.baseFactoriesMapping : void 0;
|
|
52790
53481
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.Root, { $substractHeight: substractHeight || 340, children: [
|
|
52791
53482
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.Header, { children: [
|
|
52792
53483
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Styled.HeaderLeftSide, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "start", align: "center", gap: 10, children: [
|
|
@@ -52847,7 +53538,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
52847
53538
|
baseFactoryClusterSceopedAPIKey,
|
|
52848
53539
|
baseFactoryNamespacedBuiltinKey,
|
|
52849
53540
|
baseFactoryClusterSceopedBuiltinKey,
|
|
52850
|
-
baseNamespaceFactoryKey
|
|
53541
|
+
baseNamespaceFactoryKey,
|
|
53542
|
+
baseFactoriesMapping
|
|
52851
53543
|
},
|
|
52852
53544
|
k
|
|
52853
53545
|
)) : /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Empty, { description: "No events" }),
|
|
@@ -53046,6 +53738,34 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53046
53738
|
}
|
|
53047
53739
|
};
|
|
53048
53740
|
|
|
53741
|
+
const arraysEqual = (arr1, arr2) => {
|
|
53742
|
+
if (arr1.length !== arr2.length) {
|
|
53743
|
+
return false;
|
|
53744
|
+
}
|
|
53745
|
+
for (let i = 0; i < arr1.length; i++) {
|
|
53746
|
+
if (typeof arr2[i] === "number") {
|
|
53747
|
+
if (arr1[i] !== String(arr2[i])) {
|
|
53748
|
+
return false;
|
|
53749
|
+
}
|
|
53750
|
+
}
|
|
53751
|
+
if (arr1[i] !== arr2[i]) {
|
|
53752
|
+
return false;
|
|
53753
|
+
}
|
|
53754
|
+
}
|
|
53755
|
+
return true;
|
|
53756
|
+
};
|
|
53757
|
+
const includesArray = (matrix, target) => {
|
|
53758
|
+
if (!matrix) {
|
|
53759
|
+
return false;
|
|
53760
|
+
}
|
|
53761
|
+
for (const row of matrix) {
|
|
53762
|
+
if (arraysEqual(row, target)) {
|
|
53763
|
+
return true;
|
|
53764
|
+
}
|
|
53765
|
+
}
|
|
53766
|
+
return false;
|
|
53767
|
+
};
|
|
53768
|
+
|
|
53049
53769
|
const getClusterList = async () => {
|
|
53050
53770
|
return axios.get("/clusterlist");
|
|
53051
53771
|
};
|
|
@@ -53467,9 +54187,22 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53467
54187
|
});
|
|
53468
54188
|
};
|
|
53469
54189
|
|
|
54190
|
+
const useInfiniteSentinel = (sentinelRef, hasMore, onNeedMore) => {
|
|
54191
|
+
K.useEffect(() => {
|
|
54192
|
+
const el = sentinelRef.current;
|
|
54193
|
+
if (!el) return void 0;
|
|
54194
|
+
const io = new IntersectionObserver((entries) => {
|
|
54195
|
+
const visible = entries.some((e) => e.isIntersecting);
|
|
54196
|
+
if (visible && hasMore) onNeedMore();
|
|
54197
|
+
});
|
|
54198
|
+
io.observe(el);
|
|
54199
|
+
return () => io.disconnect();
|
|
54200
|
+
}, [sentinelRef, hasMore, onNeedMore]);
|
|
54201
|
+
};
|
|
54202
|
+
|
|
53470
54203
|
exports.BackToDefaultIcon = BackToDefaultIcon;
|
|
53471
54204
|
exports.BlackholeForm = BlackholeForm;
|
|
53472
|
-
exports.
|
|
54205
|
+
exports.BlackholeFormProvider = BlackholeFormProvider;
|
|
53473
54206
|
exports.ContentCard = ContentCard$1;
|
|
53474
54207
|
exports.CursorDefaultDiv = CursorDefaultDiv;
|
|
53475
54208
|
exports.CursorPointerTag = CursorPointerTag;
|
|
@@ -53491,9 +54224,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53491
54224
|
exports.LockedIcon = LockedIcon;
|
|
53492
54225
|
exports.LookingGlassIcon = LookingGlassIcon;
|
|
53493
54226
|
exports.ManageableBreadcrumbs = ManageableBreadcrumbs;
|
|
53494
|
-
exports.
|
|
54227
|
+
exports.ManageableBreadcrumbsProvider = ManageableBreadcrumbsProvider;
|
|
53495
54228
|
exports.ManageableSidebar = ManageableSidebar;
|
|
53496
|
-
exports.
|
|
54229
|
+
exports.ManageableSidebarProvider = ManageableSidebarProvider;
|
|
53497
54230
|
exports.MarketPlace = MarketPlace;
|
|
53498
54231
|
exports.MarketplaceCard = MarketplaceCard;
|
|
53499
54232
|
exports.MinusIcon = MinusIcon;
|
|
@@ -53505,6 +54238,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53505
54238
|
exports.PodLogsMonaco = PodLogsMonaco;
|
|
53506
54239
|
exports.PodTerminal = PodTerminal;
|
|
53507
54240
|
exports.ProjectInfoCard = ProjectInfoCard;
|
|
54241
|
+
exports.ResourceLink = ResourceLink;
|
|
53508
54242
|
exports.ResumeCircleIcon = ResumeCircleIcon;
|
|
53509
54243
|
exports.Search = Search;
|
|
53510
54244
|
exports.Spacer = Spacer$1;
|
|
@@ -53531,7 +54265,6 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53531
54265
|
exports.getApiResourceTypes = getApiResourceTypes;
|
|
53532
54266
|
exports.getApiResourceTypesByApiGroup = getApiResourceTypesByApiGroup;
|
|
53533
54267
|
exports.getApiResources = getApiResources;
|
|
53534
|
-
exports.getBackLinkToTable = getBackLinkToTable;
|
|
53535
54268
|
exports.getBuiltinResourceSingle = getBuiltinResourceSingle;
|
|
53536
54269
|
exports.getBuiltinResourceTypes = getBuiltinResourceTypes;
|
|
53537
54270
|
exports.getBuiltinResources = getBuiltinResources;
|
|
@@ -53548,8 +54281,10 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53548
54281
|
exports.getLinkToApiForm = getLinkToApiForm;
|
|
53549
54282
|
exports.getLinkToBuiltinForm = getLinkToBuiltinForm;
|
|
53550
54283
|
exports.getLinkToForm = getLinkToForm;
|
|
54284
|
+
exports.getNamespaceLink = getNamespaceLink;
|
|
53551
54285
|
exports.getObjectFormItemsDraft = getObjectFormItemsDraft;
|
|
53552
54286
|
exports.getPrefixSubarrays = getPrefixSubarrays;
|
|
54287
|
+
exports.getResourceLink = getResourceLink;
|
|
53553
54288
|
exports.getSortedKinds = getSortedKinds;
|
|
53554
54289
|
exports.getSortedKindsAll = getSortedKindsAll;
|
|
53555
54290
|
exports.getStringByName = getStringByName;
|
|
@@ -53557,6 +54292,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53557
54292
|
exports.getUppercase = getUppercase;
|
|
53558
54293
|
exports.groupsToTreeData = groupsToTreeData;
|
|
53559
54294
|
exports.hslFromString = hslFromString;
|
|
54295
|
+
exports.includesArray = includesArray;
|
|
53560
54296
|
exports.isFlatObject = isFlatObject;
|
|
53561
54297
|
exports.isMultilineFromYaml = isMultilineFromYaml;
|
|
53562
54298
|
exports.isMultilineString = isMultilineString;
|
|
@@ -53585,6 +54321,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
53585
54321
|
exports.useCrdResources = useCrdResources;
|
|
53586
54322
|
exports.useDirectUnknownResource = useDirectUnknownResource;
|
|
53587
54323
|
exports.useInfiniteSentinel = useInfiniteSentinel;
|
|
54324
|
+
exports.useK8sSmartResource = useK8sSmartResource;
|
|
54325
|
+
exports.useK8sVerbs = useK8sVerbs;
|
|
53588
54326
|
exports.useListWatch = useListWatch;
|
|
53589
54327
|
exports.usePermissions = usePermissions;
|
|
53590
54328
|
|