@prorobotech/openapi-k8s-toolkit 1.1.0-alpha.1 → 1.1.0-alpha.11
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 +1324 -591
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +1328 -590
- 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 +16 -0
- package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/index.d.ts +3 -0
- package/dist/types/components/molecules/ManageableSidebar/{utils.d.ts → organisms/ManageableSidebarProvider/utils.d.ts} +2 -1
- 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
|
@@ -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,
|
|
@@ -9086,9 +9511,10 @@
|
|
|
9086
9511
|
replaceValues,
|
|
9087
9512
|
pathname,
|
|
9088
9513
|
idToCompare,
|
|
9514
|
+
fallbackIdToCompare,
|
|
9089
9515
|
currentTags
|
|
9090
9516
|
}) => {
|
|
9091
|
-
const foundData = data.find((el) => el.id === idToCompare);
|
|
9517
|
+
const foundData = data.find((el) => el.id === idToCompare) || (fallbackIdToCompare ? data.find((el) => el.id === fallbackIdToCompare) : void 0);
|
|
9092
9518
|
if (!foundData) {
|
|
9093
9519
|
return void 0;
|
|
9094
9520
|
}
|
|
@@ -9109,74 +9535,8 @@
|
|
|
9109
9535
|
return { ...result, selectedKeys: stringedOpenedKeys };
|
|
9110
9536
|
};
|
|
9111
9537
|
|
|
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,
|
|
9538
|
+
const ManageableSidebarProvider = ({
|
|
9539
|
+
cluster,
|
|
9180
9540
|
apiGroup,
|
|
9181
9541
|
apiVersion,
|
|
9182
9542
|
plural,
|
|
@@ -9184,32 +9544,22 @@
|
|
|
9184
9544
|
replaceValues,
|
|
9185
9545
|
pathname,
|
|
9186
9546
|
idToCompare,
|
|
9547
|
+
fallbackIdToCompare,
|
|
9187
9548
|
currentTags,
|
|
9188
9549
|
hidden,
|
|
9189
9550
|
noMarginTop
|
|
9190
9551
|
}) => {
|
|
9191
|
-
const {
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
plural
|
|
9201
|
-
},
|
|
9552
|
+
const {
|
|
9553
|
+
data: rawData,
|
|
9554
|
+
isError: rawDataError,
|
|
9555
|
+
isLoading: rawDataLoading
|
|
9556
|
+
} = useK8sSmartResource({
|
|
9557
|
+
cluster,
|
|
9558
|
+
group: apiGroup,
|
|
9559
|
+
version: apiVersion,
|
|
9560
|
+
plural,
|
|
9202
9561
|
isEnabled
|
|
9203
9562
|
});
|
|
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
9563
|
if (rawDataError) {
|
|
9214
9564
|
return null;
|
|
9215
9565
|
}
|
|
@@ -9231,6 +9581,7 @@
|
|
|
9231
9581
|
replaceValues,
|
|
9232
9582
|
pathname,
|
|
9233
9583
|
idToCompare,
|
|
9584
|
+
fallbackIdToCompare,
|
|
9234
9585
|
currentTags
|
|
9235
9586
|
});
|
|
9236
9587
|
if (!result) {
|
|
@@ -33468,49 +33819,97 @@
|
|
|
33468
33819
|
};
|
|
33469
33820
|
|
|
33470
33821
|
const MultiQueryContext = K.createContext(void 0);
|
|
33471
|
-
const
|
|
33472
|
-
|
|
33473
|
-
|
|
33474
|
-
|
|
33475
|
-
|
|
33476
|
-
|
|
33477
|
-
|
|
33822
|
+
const makeEmptyEntry = () => ({
|
|
33823
|
+
data: void 0,
|
|
33824
|
+
isLoading: false,
|
|
33825
|
+
isError: false,
|
|
33826
|
+
error: null
|
|
33827
|
+
});
|
|
33828
|
+
const aggReducer = (state, action) => {
|
|
33829
|
+
switch (action.type) {
|
|
33830
|
+
case "RESET":
|
|
33831
|
+
return { entries: Array.from({ length: action.total }, makeEmptyEntry) };
|
|
33832
|
+
case "SET_ENTRY": {
|
|
33833
|
+
const entries = state.entries.slice();
|
|
33834
|
+
entries[action.index] = action.entry;
|
|
33835
|
+
return { entries };
|
|
33836
|
+
}
|
|
33837
|
+
default:
|
|
33838
|
+
return state;
|
|
33839
|
+
}
|
|
33840
|
+
};
|
|
33841
|
+
const K8sFetcher = ({ index, params, dispatch }) => {
|
|
33842
|
+
const res = useK8sSmartResource(params);
|
|
33843
|
+
K.useEffect(() => {
|
|
33844
|
+
dispatch({
|
|
33845
|
+
type: "SET_ENTRY",
|
|
33846
|
+
index,
|
|
33847
|
+
entry: {
|
|
33848
|
+
data: res.data,
|
|
33849
|
+
isLoading: res.isLoading,
|
|
33850
|
+
isError: res.isError,
|
|
33851
|
+
error: res.error ?? null
|
|
33478
33852
|
}
|
|
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
33853
|
});
|
|
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)]
|
|
33854
|
+
}, [index, res.data, res.isLoading, res.isError, res.error, dispatch]);
|
|
33855
|
+
return null;
|
|
33856
|
+
};
|
|
33857
|
+
const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
|
|
33858
|
+
const k8sItems = K.useMemo(
|
|
33859
|
+
() => items.filter((x) => typeof x !== "string"),
|
|
33860
|
+
[items]
|
|
33505
33861
|
);
|
|
33506
|
-
|
|
33862
|
+
const urlItems = K.useMemo(() => items.filter((x) => typeof x === "string"), [items]);
|
|
33863
|
+
const k8sCount = k8sItems.length;
|
|
33864
|
+
const urlCount = urlItems.length;
|
|
33865
|
+
const [state, dispatch] = K.useReducer(aggReducer, { entries: Array.from({ length: k8sCount }, makeEmptyEntry) });
|
|
33866
|
+
K.useEffect(() => {
|
|
33867
|
+
dispatch({ type: "RESET", total: k8sCount });
|
|
33868
|
+
}, [k8sCount]);
|
|
33869
|
+
const urlQueries = reactQuery.useQueries({
|
|
33870
|
+
queries: urlItems.map((url, i) => ({
|
|
33871
|
+
queryKey: ["multi-url", i, url],
|
|
33872
|
+
queryFn: async () => {
|
|
33873
|
+
const res = await axios.get(url);
|
|
33874
|
+
return structuredClone(res.data);
|
|
33875
|
+
},
|
|
33876
|
+
structuralSharing: false,
|
|
33877
|
+
refetchInterval: 5e3
|
|
33878
|
+
}))
|
|
33879
|
+
});
|
|
33880
|
+
const value = (() => {
|
|
33881
|
+
if (typeof dataToApplyToContext !== "undefined") {
|
|
33882
|
+
return { data: { req0: dataToApplyToContext }, isLoading: false, isError: false, errors: [] };
|
|
33883
|
+
}
|
|
33884
|
+
const data = {};
|
|
33885
|
+
const errors = [];
|
|
33886
|
+
for (let i = 0; i < k8sCount; i++) {
|
|
33887
|
+
const e = state.entries[i] ?? makeEmptyEntry();
|
|
33888
|
+
data[`req${i}`] = e.data;
|
|
33889
|
+
errors[i] = e.isError ? e.error : null;
|
|
33890
|
+
}
|
|
33891
|
+
for (let i = 0; i < urlCount; i++) {
|
|
33892
|
+
const q = urlQueries[i];
|
|
33893
|
+
const idx = k8sCount + i;
|
|
33894
|
+
data[`req${idx}`] = q?.data;
|
|
33895
|
+
errors[idx] = q?.isError ? q.error ?? null : null;
|
|
33896
|
+
}
|
|
33897
|
+
const isLoading = state.entries.some((e) => e.isLoading) || urlQueries.some((q) => q.isLoading);
|
|
33898
|
+
const isError = state.entries.some((e) => e.isError) || urlQueries.some((q) => q.isError);
|
|
33899
|
+
return { data, isLoading, isError, errors };
|
|
33900
|
+
})();
|
|
33901
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(MultiQueryContext.Provider, { value, children: [
|
|
33902
|
+
k8sItems.map((params, i) => (
|
|
33903
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
33904
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(K8sFetcher, { index: i, params, dispatch }, i)
|
|
33905
|
+
)),
|
|
33906
|
+
children
|
|
33907
|
+
] });
|
|
33507
33908
|
};
|
|
33508
33909
|
const useMultiQuery = () => {
|
|
33509
|
-
const
|
|
33510
|
-
if (!
|
|
33511
|
-
|
|
33512
|
-
}
|
|
33513
|
-
return context;
|
|
33910
|
+
const ctx = K.useContext(MultiQueryContext);
|
|
33911
|
+
if (!ctx) throw new Error("useMultiQuery must be used within a MultiQueryProvider");
|
|
33912
|
+
return ctx;
|
|
33514
33913
|
};
|
|
33515
33914
|
|
|
33516
33915
|
const createContextFactory = () => {
|
|
@@ -33738,7 +34137,7 @@
|
|
|
33738
34137
|
if (isError) {
|
|
33739
34138
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
33740
34139
|
/* @__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)) })
|
|
34140
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
33742
34141
|
] });
|
|
33743
34142
|
}
|
|
33744
34143
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: preparedText });
|
|
@@ -33768,7 +34167,7 @@
|
|
|
33768
34167
|
if (isError) {
|
|
33769
34168
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
33770
34169
|
/* @__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)) })
|
|
34170
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
33772
34171
|
] });
|
|
33773
34172
|
}
|
|
33774
34173
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -33805,7 +34204,7 @@
|
|
|
33805
34204
|
if (isError) {
|
|
33806
34205
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
33807
34206
|
/* @__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)) })
|
|
34207
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
33809
34208
|
] });
|
|
33810
34209
|
}
|
|
33811
34210
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectInfoCard, { clusterName, namespace, accessGroups: parsedAccessGroups, ...props, children });
|
|
@@ -33922,7 +34321,7 @@
|
|
|
33922
34321
|
if (isError) {
|
|
33923
34322
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
33924
34323
|
/* @__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)) })
|
|
34324
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
33926
34325
|
] });
|
|
33927
34326
|
}
|
|
33928
34327
|
const { type, text } = getResult({
|
|
@@ -33954,7 +34353,7 @@
|
|
|
33954
34353
|
acc[index.toString()] = value;
|
|
33955
34354
|
return acc;
|
|
33956
34355
|
}, {});
|
|
33957
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
34356
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableSidebarProvider, { replaceValues, ...props });
|
|
33958
34357
|
};
|
|
33959
34358
|
|
|
33960
34359
|
const checkPermission = async ({
|
|
@@ -34008,33 +34407,6 @@
|
|
|
34008
34407
|
});
|
|
34009
34408
|
};
|
|
34010
34409
|
|
|
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
34410
|
const getBackLinkToTable = ({ fullPath }) => {
|
|
34039
34411
|
return encodeURIComponent(fullPath);
|
|
34040
34412
|
};
|
|
@@ -34115,6 +34487,7 @@
|
|
|
34115
34487
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
34116
34488
|
id,
|
|
34117
34489
|
fetchUrl,
|
|
34490
|
+
k8sResourceToFetch,
|
|
34118
34491
|
pathToItems,
|
|
34119
34492
|
clusterNamePartOfUrl,
|
|
34120
34493
|
labelSelector,
|
|
@@ -34158,7 +34531,13 @@
|
|
|
34158
34531
|
verb: "create",
|
|
34159
34532
|
refetchInterval: false
|
|
34160
34533
|
});
|
|
34161
|
-
const fetchUrlPrepared = parseAll({ text: fetchUrl, replaceValues, multiQueryData });
|
|
34534
|
+
const fetchUrlPrepared = fetchUrl ? parseAll({ text: fetchUrl, replaceValues, multiQueryData }) : void 0;
|
|
34535
|
+
const k8sResourceToFetchPrepared = k8sResourceToFetch ? {
|
|
34536
|
+
group: k8sResourceToFetch.group ? parseAll({ text: k8sResourceToFetch.group, replaceValues, multiQueryData }) : void 0,
|
|
34537
|
+
version: parseAll({ text: k8sResourceToFetch.version, replaceValues, multiQueryData }),
|
|
34538
|
+
plural: parseAll({ text: k8sResourceToFetch.plural, replaceValues, multiQueryData }),
|
|
34539
|
+
namespace: k8sResourceToFetch.namespace ? parseAll({ text: k8sResourceToFetch.namespace, replaceValues, multiQueryData }) : void 0
|
|
34540
|
+
} : void 0;
|
|
34162
34541
|
const sParams = new URLSearchParams();
|
|
34163
34542
|
if (labelSelector && Object.keys(labelSelector).length > 0) {
|
|
34164
34543
|
const parsedObject = Object.fromEntries(
|
|
@@ -34195,21 +34574,48 @@
|
|
|
34195
34574
|
} = useDirectUnknownResource({
|
|
34196
34575
|
uri: `${fetchUrlPrepared}${searchParams ? `?${searchParams}` : ""}`,
|
|
34197
34576
|
queryKey: [`${fetchUrlPrepared}${searchParams ? `?${searchParams}` : ""}`],
|
|
34198
|
-
isEnabled: !isMultiqueryLoading
|
|
34577
|
+
isEnabled: Boolean(!isMultiqueryLoading && fetchUrlPrepared)
|
|
34199
34578
|
});
|
|
34200
|
-
|
|
34579
|
+
const {
|
|
34580
|
+
data: fetchedDataSocket,
|
|
34581
|
+
isLoading: isFetchedDataSocketLoading,
|
|
34582
|
+
error: fetchedDataSocketError
|
|
34583
|
+
} = useK8sSmartResource({
|
|
34584
|
+
cluster: clusterName || "",
|
|
34585
|
+
namespace: k8sResourceToFetchPrepared?.namespace,
|
|
34586
|
+
group: k8sResourceToFetchPrepared?.group,
|
|
34587
|
+
version: k8sResourceToFetchPrepared?.version || "",
|
|
34588
|
+
plural: k8sResourceToFetchPrepared?.plural || "",
|
|
34589
|
+
fieldSelector: sParams.get("fieldSelector") || void 0,
|
|
34590
|
+
labelSelector: sParams.get("labelSelector") || void 0,
|
|
34591
|
+
isEnabled: Boolean(!isMultiqueryLoading && k8sResourceToFetchPrepared)
|
|
34592
|
+
});
|
|
34593
|
+
if (fetchUrlPrepared && isMultiqueryLoading) {
|
|
34201
34594
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34202
34595
|
}
|
|
34203
|
-
if (
|
|
34596
|
+
if (k8sResourceToFetchPrepared && isMultiqueryLoading) {
|
|
34597
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34598
|
+
}
|
|
34599
|
+
if (fetchUrlPrepared && isFetchedDataLoading) {
|
|
34204
34600
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
|
|
34205
34601
|
}
|
|
34206
|
-
if (
|
|
34602
|
+
if (k8sResourceToFetchPrepared && isFetchedDataSocketLoading) {
|
|
34603
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
|
|
34604
|
+
}
|
|
34605
|
+
if (fetchUrlPrepared && fetchedDataError) {
|
|
34207
34606
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34208
34607
|
"Error: ",
|
|
34209
34608
|
JSON.stringify(fetchedDataError)
|
|
34210
34609
|
] });
|
|
34211
34610
|
}
|
|
34212
|
-
|
|
34611
|
+
if (k8sResourceToFetchPrepared && fetchedDataSocketError) {
|
|
34612
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34613
|
+
"Error: ",
|
|
34614
|
+
JSON.stringify(fetchedDataError)
|
|
34615
|
+
] });
|
|
34616
|
+
}
|
|
34617
|
+
const dataFromOneOfHooks = fetchedData || fetchedDataSocket;
|
|
34618
|
+
const items = Array.isArray(pathToItems) ? _$1.get(dataFromOneOfHooks, pathToItems) : jp.query(dataFromOneOfHooks, `$${pathToItems}`)[0];
|
|
34213
34619
|
if (!items) {
|
|
34214
34620
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34215
34621
|
"No data on this path ",
|
|
@@ -34344,15 +34750,18 @@
|
|
|
34344
34750
|
const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
|
|
34345
34751
|
const podNamePrepared = parseAll({ text: podName, replaceValues, multiQueryData });
|
|
34346
34752
|
const {
|
|
34347
|
-
data:
|
|
34753
|
+
data: podInfoList,
|
|
34348
34754
|
isError: isPodInfoError,
|
|
34349
34755
|
isLoading: isLoadingPodInfo
|
|
34350
|
-
} =
|
|
34351
|
-
|
|
34352
|
-
|
|
34353
|
-
|
|
34756
|
+
} = useK8sSmartResource({
|
|
34757
|
+
cluster: clusterPrepared,
|
|
34758
|
+
namespace: namespacePrepared,
|
|
34759
|
+
version: "v1",
|
|
34760
|
+
plural: "pods",
|
|
34761
|
+
fieldSelector: `metadata.name=${podNamePrepared}`,
|
|
34354
34762
|
isEnabled: clusterPrepared !== void 0 && namespacePrepared !== void 0 && podNamePrepared !== void 0
|
|
34355
34763
|
});
|
|
34764
|
+
const podInfo = podInfoList?.items && podInfoList.items.length > 0 ? podInfoList.items[0] : void 0;
|
|
34356
34765
|
if (isMultiqueryLoading) {
|
|
34357
34766
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34358
34767
|
}
|
|
@@ -34460,15 +34869,18 @@
|
|
|
34460
34869
|
const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
|
|
34461
34870
|
const podNamePrepared = parseAll({ text: podName, replaceValues, multiQueryData });
|
|
34462
34871
|
const {
|
|
34463
|
-
data:
|
|
34872
|
+
data: podInfoList,
|
|
34464
34873
|
isError: isPodInfoError,
|
|
34465
34874
|
isLoading: isLoadingPodInfo
|
|
34466
|
-
} =
|
|
34467
|
-
|
|
34468
|
-
|
|
34469
|
-
|
|
34875
|
+
} = useK8sSmartResource({
|
|
34876
|
+
cluster: clusterPrepared,
|
|
34877
|
+
namespace: namespacePrepared,
|
|
34878
|
+
version: "v1",
|
|
34879
|
+
plural: "pods",
|
|
34880
|
+
fieldSelector: `metadata.name=${podNamePrepared}`,
|
|
34470
34881
|
isEnabled: clusterPrepared !== void 0 && namespacePrepared !== void 0 && podNamePrepared !== void 0
|
|
34471
34882
|
});
|
|
34883
|
+
const podInfo = podInfoList?.items && podInfoList.items.length > 0 ? podInfoList.items[0] : void 0;
|
|
34472
34884
|
if (isMultiqueryLoading) {
|
|
34473
34885
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34474
34886
|
}
|
|
@@ -34504,6 +34916,37 @@
|
|
|
34504
34916
|
] });
|
|
34505
34917
|
};
|
|
34506
34918
|
|
|
34919
|
+
const getDataByPath = ({
|
|
34920
|
+
prefillValuesRaw,
|
|
34921
|
+
pathToData
|
|
34922
|
+
}) => {
|
|
34923
|
+
return Array.isArray(pathToData) ? _$1.get(prefillValuesRaw, pathToData) : jp.query(prefillValuesRaw, `$${pathToData}`)[0];
|
|
34924
|
+
};
|
|
34925
|
+
const getPrefillValuesWithForces = ({
|
|
34926
|
+
prefillValues,
|
|
34927
|
+
forcedKind,
|
|
34928
|
+
apiGroup,
|
|
34929
|
+
apiVersion
|
|
34930
|
+
}) => {
|
|
34931
|
+
if (!forcedKind) {
|
|
34932
|
+
return prefillValues;
|
|
34933
|
+
}
|
|
34934
|
+
const newValues = { ...prefillValues };
|
|
34935
|
+
if (typeof newValues === "object" && newValues !== null) {
|
|
34936
|
+
if ("kind" in newValues) {
|
|
34937
|
+
delete newValues.kind;
|
|
34938
|
+
}
|
|
34939
|
+
if ("apiVersion" in newValues) {
|
|
34940
|
+
delete newValues.apiVersion;
|
|
34941
|
+
}
|
|
34942
|
+
}
|
|
34943
|
+
return {
|
|
34944
|
+
kind: forcedKind,
|
|
34945
|
+
apiVersion: `${apiGroup ? `${apiGroup}/` : ""}${apiVersion}`,
|
|
34946
|
+
...newValues
|
|
34947
|
+
};
|
|
34948
|
+
};
|
|
34949
|
+
|
|
34507
34950
|
const YamlEditorSingleton$1 = ({
|
|
34508
34951
|
data,
|
|
34509
34952
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -34519,7 +34962,9 @@
|
|
|
34519
34962
|
apiGroup,
|
|
34520
34963
|
apiVersion,
|
|
34521
34964
|
typeName,
|
|
34965
|
+
forcedKind,
|
|
34522
34966
|
prefillValuesRequestIndex,
|
|
34967
|
+
pathToData,
|
|
34523
34968
|
substractHeight,
|
|
34524
34969
|
...props
|
|
34525
34970
|
} = data;
|
|
@@ -34545,7 +34990,9 @@
|
|
|
34545
34990
|
const apiGroupPrepared = apiGroup ? parseAll({ text: apiGroup, replaceValues, multiQueryData }) : "no-api-group";
|
|
34546
34991
|
const apiVersionPrepared = apiVersion ? parseAll({ text: apiVersion, replaceValues, multiQueryData }) : "no-api-version";
|
|
34547
34992
|
const typeNamePrepared = parseAll({ text: typeName, replaceValues, multiQueryData });
|
|
34548
|
-
const
|
|
34993
|
+
const prefillValuesRaw = multiQueryData[`req${prefillValuesRequestIndex}`];
|
|
34994
|
+
const prefillValues = pathToData ? getDataByPath({ prefillValuesRaw, pathToData }) : prefillValuesRaw;
|
|
34995
|
+
const prefillValuesWithForces = getPrefillValuesWithForces({ prefillValues, forcedKind, apiGroup, apiVersion });
|
|
34549
34996
|
if (isMultiqueryLoading) {
|
|
34550
34997
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
34551
34998
|
}
|
|
@@ -34555,7 +35002,7 @@
|
|
|
34555
35002
|
{
|
|
34556
35003
|
cluster: clusterPrepared,
|
|
34557
35004
|
theme,
|
|
34558
|
-
prefillValuesSchema:
|
|
35005
|
+
prefillValuesSchema: prefillValuesWithForces,
|
|
34559
35006
|
isNameSpaced,
|
|
34560
35007
|
isCreate: false,
|
|
34561
35008
|
type,
|
|
@@ -34654,7 +35101,7 @@
|
|
|
34654
35101
|
if (isMultiQueryErrors) {
|
|
34655
35102
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34656
35103
|
/* @__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)) })
|
|
35104
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
34658
35105
|
] });
|
|
34659
35106
|
}
|
|
34660
35107
|
const jsonRoot = multiQueryData[`req${reqIndex}`];
|
|
@@ -34721,7 +35168,7 @@
|
|
|
34721
35168
|
if (isMultiQueryErrors) {
|
|
34722
35169
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34723
35170
|
/* @__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)) })
|
|
35171
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
34725
35172
|
] });
|
|
34726
35173
|
}
|
|
34727
35174
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -34778,7 +35225,7 @@
|
|
|
34778
35225
|
if (isMultiQueryErrors) {
|
|
34779
35226
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
34780
35227
|
/* @__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)) })
|
|
35228
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
34782
35229
|
] });
|
|
34783
35230
|
}
|
|
34784
35231
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -34956,11 +35403,7 @@
|
|
|
34956
35403
|
p === void 0 ? void 0 : Array.isArray(p) ? p : [p]
|
|
34957
35404
|
);
|
|
34958
35405
|
|
|
34959
|
-
const HiddenContainer = ({
|
|
34960
|
-
name,
|
|
34961
|
-
secondName,
|
|
34962
|
-
children
|
|
34963
|
-
}) => {
|
|
35406
|
+
const HiddenContainer = ({ name, secondName, children }) => {
|
|
34964
35407
|
const hiddenPaths = useHiddenPathsLayout();
|
|
34965
35408
|
const nameArr = toArray(name);
|
|
34966
35409
|
const secondArr = toArray(secondName);
|
|
@@ -35163,7 +35606,7 @@
|
|
|
35163
35606
|
if (isMultiQueryErrors) {
|
|
35164
35607
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
35165
35608
|
/* @__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)) })
|
|
35609
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
35167
35610
|
] });
|
|
35168
35611
|
}
|
|
35169
35612
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -35438,7 +35881,7 @@
|
|
|
35438
35881
|
if (isMultiQueryErrors) {
|
|
35439
35882
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
35440
35883
|
/* @__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)) })
|
|
35884
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
35442
35885
|
] });
|
|
35443
35886
|
}
|
|
35444
35887
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -35707,7 +36150,7 @@
|
|
|
35707
36150
|
if (isMultiQueryErrors) {
|
|
35708
36151
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
35709
36152
|
/* @__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)) })
|
|
36153
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
35711
36154
|
] });
|
|
35712
36155
|
}
|
|
35713
36156
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -35951,10 +36394,15 @@
|
|
|
35951
36394
|
...restField,
|
|
35952
36395
|
name: [name, "operator"],
|
|
35953
36396
|
rules: [
|
|
35954
|
-
{
|
|
35955
|
-
|
|
35956
|
-
|
|
35957
|
-
|
|
36397
|
+
({ getFieldValue }) => ({
|
|
36398
|
+
validator(_, v) {
|
|
36399
|
+
const nameV = getFieldValue(["tolerations", name, "key"]);
|
|
36400
|
+
if ((nameV === "nameV" || !nameV) && (!v || v !== "Exists")) {
|
|
36401
|
+
return Promise.reject(new Error("Operator must be Exists when `key` is empty"));
|
|
36402
|
+
}
|
|
36403
|
+
return Promise.resolve();
|
|
36404
|
+
}
|
|
36405
|
+
})
|
|
35958
36406
|
],
|
|
35959
36407
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
35960
36408
|
antd.Select,
|
|
@@ -36080,7 +36528,7 @@
|
|
|
36080
36528
|
if (isMultiQueryErrors) {
|
|
36081
36529
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
36082
36530
|
/* @__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)) })
|
|
36531
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
36084
36532
|
] });
|
|
36085
36533
|
}
|
|
36086
36534
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -36361,7 +36809,7 @@
|
|
|
36361
36809
|
if (isMultiQueryErrors) {
|
|
36362
36810
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
36363
36811
|
/* @__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)) })
|
|
36812
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
36365
36813
|
] });
|
|
36366
36814
|
}
|
|
36367
36815
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -36579,7 +37027,7 @@
|
|
|
36579
37027
|
if (isError) {
|
|
36580
37028
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
36581
37029
|
/* @__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)) })
|
|
37030
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
36583
37031
|
] });
|
|
36584
37032
|
}
|
|
36585
37033
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -37396,7 +37844,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37396
37844
|
if (isError) {
|
|
37397
37845
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
37398
37846
|
/* @__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)) })
|
|
37847
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
37400
37848
|
] });
|
|
37401
37849
|
}
|
|
37402
37850
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
@@ -37470,30 +37918,6 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37470
37918
|
] });
|
|
37471
37919
|
};
|
|
37472
37920
|
|
|
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
37921
|
const RoundSpan = styled.span`
|
|
37498
37922
|
background-color: ${({ $bgColor }) => $bgColor || "none"};
|
|
37499
37923
|
border-radius: 13px;
|
|
@@ -37528,7 +37952,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37528
37952
|
if (isError) {
|
|
37529
37953
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
37530
37954
|
/* @__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)) })
|
|
37955
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
|
|
37532
37956
|
] });
|
|
37533
37957
|
}
|
|
37534
37958
|
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value2, index) => {
|
|
@@ -37583,6 +38007,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37583
38007
|
baseFactoryNamespacedBuiltinKey,
|
|
37584
38008
|
baseFactoryClusterSceopedBuiltinKey,
|
|
37585
38009
|
baseNamespaceFactoryKey,
|
|
38010
|
+
baseNavigationPluralName,
|
|
38011
|
+
baseNavigationSpecificName,
|
|
37586
38012
|
...props
|
|
37587
38013
|
} = data;
|
|
37588
38014
|
const theme = useTheme();
|
|
@@ -37647,6 +38073,354 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37647
38073
|
baseFactoryNamespacedBuiltinKey,
|
|
37648
38074
|
baseFactoryClusterSceopedBuiltinKey,
|
|
37649
38075
|
baseNamespaceFactoryKey,
|
|
38076
|
+
baseNavigationPluralName,
|
|
38077
|
+
baseNavigationSpecificName,
|
|
38078
|
+
...props
|
|
38079
|
+
}
|
|
38080
|
+
),
|
|
38081
|
+
children
|
|
38082
|
+
] });
|
|
38083
|
+
};
|
|
38084
|
+
|
|
38085
|
+
const getKinds = async ({ clusterName }) => {
|
|
38086
|
+
const result = await axios.get(`/api/clusters/${clusterName}/openapi-bff/search/kinds/getKinds`);
|
|
38087
|
+
return result.data;
|
|
38088
|
+
};
|
|
38089
|
+
|
|
38090
|
+
const parseK8sVersion$1 = (raw) => {
|
|
38091
|
+
const m = /^v(?<major>\d+)(?:(?<stage>alpha|beta)(?<stageNum>\d+)?)?$/i.exec(raw ?? "");
|
|
38092
|
+
if (!m?.groups) return { rank: 0, major: -1, stageNum: -1 };
|
|
38093
|
+
const stage = (m.groups.stage ?? "").toLowerCase();
|
|
38094
|
+
const major = Number(m.groups.major);
|
|
38095
|
+
const stageNum = m.groups.stageNum ? Number(m.groups.stageNum) : 0;
|
|
38096
|
+
const rank = stage === "" ? 3 : stage === "beta" ? 2 : 1;
|
|
38097
|
+
return { rank, major, stageNum };
|
|
38098
|
+
};
|
|
38099
|
+
const versionToken$1 = (e) => e.version || (e.groupVersion?.split("/").pop() ?? "");
|
|
38100
|
+
const compareK8sVersionDesc$1 = (a, b) => {
|
|
38101
|
+
const pa = parseK8sVersion$1(versionToken$1(a));
|
|
38102
|
+
const pb = parseK8sVersion$1(versionToken$1(b));
|
|
38103
|
+
return pb.rank - pa.rank || pb.major - pa.major || pb.stageNum - pa.stageNum;
|
|
38104
|
+
};
|
|
38105
|
+
const orderVersions = (versions) => {
|
|
38106
|
+
const preferredIdx = versions.findIndex((v) => v.preferred === true);
|
|
38107
|
+
if (preferredIdx >= 0) {
|
|
38108
|
+
const preferred = versions[preferredIdx];
|
|
38109
|
+
const rest = versions.filter((_, i) => i !== preferredIdx).slice().sort(compareK8sVersionDesc$1);
|
|
38110
|
+
return [preferred, ...rest];
|
|
38111
|
+
}
|
|
38112
|
+
return versions.slice().sort(compareK8sVersionDesc$1);
|
|
38113
|
+
};
|
|
38114
|
+
const getSortedKindsAll = (index) => {
|
|
38115
|
+
const counts = index.items.reduce(
|
|
38116
|
+
(acc, item) => ({ ...acc, [item.kind]: (acc[item.kind] ?? 0) + 1 }),
|
|
38117
|
+
{}
|
|
38118
|
+
);
|
|
38119
|
+
const rows = index.items.flatMap((item) => {
|
|
38120
|
+
const ordered = orderVersions(item.versions);
|
|
38121
|
+
return ordered.map((v) => ({
|
|
38122
|
+
group: item.group,
|
|
38123
|
+
kind: item.kind,
|
|
38124
|
+
// clone to drop Readonly<> without changing fields (incl. preferred)
|
|
38125
|
+
version: { ...v },
|
|
38126
|
+
...counts[item.kind] > 1 ? { notUnique: true } : {}
|
|
38127
|
+
}));
|
|
38128
|
+
});
|
|
38129
|
+
return rows.sort(
|
|
38130
|
+
(a, b) => a.kind.localeCompare(b.kind, void 0, { sensitivity: "base" }) || a.group.localeCompare(b.group, void 0, { sensitivity: "base" })
|
|
38131
|
+
);
|
|
38132
|
+
};
|
|
38133
|
+
|
|
38134
|
+
const parseApiVersion = (apiVersion) => {
|
|
38135
|
+
const parts = apiVersion.trim().split("/");
|
|
38136
|
+
return parts.length === 1 ? { group: "", version: parts[0] } : { group: parts[0], version: parts[1] };
|
|
38137
|
+
};
|
|
38138
|
+
const pluralByKind = (entries) => (kind, apiVersion) => {
|
|
38139
|
+
const norm = (s) => s.trim();
|
|
38140
|
+
const kindNorm = norm(kind);
|
|
38141
|
+
const gv = apiVersion ? parseApiVersion(apiVersion) : void 0;
|
|
38142
|
+
const candidates = entries.filter((e) => norm(e.kind) === kindNorm);
|
|
38143
|
+
if (candidates.length === 0) return void 0;
|
|
38144
|
+
const filtered = gv ? candidates.filter((e) => norm(e.group) === norm(gv.group) && e.version.version === gv.version) : candidates;
|
|
38145
|
+
if (filtered.length === 0) return void 0;
|
|
38146
|
+
const preferredFirst = gv ? filtered : [...filtered.filter((e) => e.version.preferred), ...filtered.filter((e) => !e.version.preferred)];
|
|
38147
|
+
const resources = preferredFirst.map((e) => e.version.resource).filter(Boolean);
|
|
38148
|
+
const uniq = Array.from(new Set(resources));
|
|
38149
|
+
if (!gv && uniq.length > 1) {
|
|
38150
|
+
const first = preferredFirst[0]?.version.resource;
|
|
38151
|
+
return first ?? void 0;
|
|
38152
|
+
}
|
|
38153
|
+
return uniq.length === 1 ? uniq[0] : void 0;
|
|
38154
|
+
};
|
|
38155
|
+
|
|
38156
|
+
const findOwnerReferencePath = (rawObject, jsonPathToArrayOfRefs, reference) => {
|
|
38157
|
+
if (!rawObject || !jsonPathToArrayOfRefs) return void 0;
|
|
38158
|
+
let arrayJsonPath = jsonPathToArrayOfRefs.trim();
|
|
38159
|
+
if (arrayJsonPath.startsWith(".")) {
|
|
38160
|
+
arrayJsonPath = `$${arrayJsonPath}`;
|
|
38161
|
+
}
|
|
38162
|
+
if (!arrayJsonPath.startsWith("$")) {
|
|
38163
|
+
arrayJsonPath = `$${arrayJsonPath}`;
|
|
38164
|
+
}
|
|
38165
|
+
arrayJsonPath = arrayJsonPath.replace(/\[\*\]$/, "");
|
|
38166
|
+
const nodes = jp.nodes(rawObject, arrayJsonPath);
|
|
38167
|
+
if (!nodes.length) return void 0;
|
|
38168
|
+
const arrayNode = nodes[0];
|
|
38169
|
+
const arr = arrayNode.value;
|
|
38170
|
+
if (!Array.isArray(arr)) return void 0;
|
|
38171
|
+
const index = arr.findIndex((item) => {
|
|
38172
|
+
if (!item) return false;
|
|
38173
|
+
return item.name === reference.name && item.kind === reference.kind && item.apiVersion === reference.apiVersion;
|
|
38174
|
+
});
|
|
38175
|
+
if (index === -1) return void 0;
|
|
38176
|
+
const basePathSegs = arrayNode.path.slice(1);
|
|
38177
|
+
return [...basePathSegs, index];
|
|
38178
|
+
};
|
|
38179
|
+
const parseDotPath$1 = (dotPath) => dotPath.split(".").filter(Boolean).map((seg) => seg.match(/^\d+$/) ? Number(seg) : seg);
|
|
38180
|
+
const resolveFormPath$1 = (pathInput, basePathForRelative) => {
|
|
38181
|
+
if (!pathInput) return [];
|
|
38182
|
+
if (Array.isArray(pathInput)) return pathInput;
|
|
38183
|
+
const pathStr = String(pathInput);
|
|
38184
|
+
const isRelative = pathStr.startsWith("./") || pathStr.startsWith("../");
|
|
38185
|
+
if (!isRelative) {
|
|
38186
|
+
return parseDotPath$1(pathStr);
|
|
38187
|
+
}
|
|
38188
|
+
let resolved = [...basePathForRelative];
|
|
38189
|
+
const parts = pathStr.split("/").filter(Boolean);
|
|
38190
|
+
for (const part of parts) {
|
|
38191
|
+
if (part === ".") {
|
|
38192
|
+
continue;
|
|
38193
|
+
}
|
|
38194
|
+
if (part === "..") {
|
|
38195
|
+
resolved = resolved.slice(0, -1);
|
|
38196
|
+
continue;
|
|
38197
|
+
}
|
|
38198
|
+
resolved.push(...parseDotPath$1(part));
|
|
38199
|
+
}
|
|
38200
|
+
return resolved;
|
|
38201
|
+
};
|
|
38202
|
+
|
|
38203
|
+
const RefElement = ({
|
|
38204
|
+
reference,
|
|
38205
|
+
keysToForcedLabel,
|
|
38206
|
+
forcedRelatedValuePath,
|
|
38207
|
+
rawObjectToFindLabel,
|
|
38208
|
+
jsonPathToArrayOfRefs,
|
|
38209
|
+
forcedNamespace,
|
|
38210
|
+
theme,
|
|
38211
|
+
baseprefix,
|
|
38212
|
+
cluster,
|
|
38213
|
+
getPlural,
|
|
38214
|
+
baseFactoryNamespacedAPIKey,
|
|
38215
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38216
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38217
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38218
|
+
baseFactoriesMapping
|
|
38219
|
+
}) => {
|
|
38220
|
+
let forcedName;
|
|
38221
|
+
let objectNamespace;
|
|
38222
|
+
if (keysToForcedLabel && rawObjectToFindLabel) {
|
|
38223
|
+
forcedName = Array.isArray(keysToForcedLabel) ? _$1.get(rawObjectToFindLabel, keysToForcedLabel) : jp.query(rawObjectToFindLabel, `$${keysToForcedLabel}`)[0];
|
|
38224
|
+
}
|
|
38225
|
+
if (forcedRelatedValuePath && rawObjectToFindLabel) {
|
|
38226
|
+
try {
|
|
38227
|
+
const ownerRefPathSegs = findOwnerReferencePath(
|
|
38228
|
+
rawObjectToFindLabel,
|
|
38229
|
+
jsonPathToArrayOfRefs,
|
|
38230
|
+
// ".spec.customRef"
|
|
38231
|
+
reference
|
|
38232
|
+
);
|
|
38233
|
+
const relatedPath = forcedRelatedValuePath && ownerRefPathSegs ? resolveFormPath$1(forcedRelatedValuePath, ownerRefPathSegs) : void 0;
|
|
38234
|
+
if (relatedPath) {
|
|
38235
|
+
forcedName = _$1.get(rawObjectToFindLabel, relatedPath);
|
|
38236
|
+
}
|
|
38237
|
+
} catch {
|
|
38238
|
+
}
|
|
38239
|
+
}
|
|
38240
|
+
if (rawObjectToFindLabel) {
|
|
38241
|
+
try {
|
|
38242
|
+
const defaultFetched = _$1.get(rawObjectToFindLabel, ["metadata", "namespace"]);
|
|
38243
|
+
const socketFetched = _$1.get(rawObjectToFindLabel, ["items", 0, "metadata", "namespace"]);
|
|
38244
|
+
objectNamespace = socketFetched || defaultFetched;
|
|
38245
|
+
} catch {
|
|
38246
|
+
}
|
|
38247
|
+
}
|
|
38248
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38249
|
+
ResourceLink,
|
|
38250
|
+
{
|
|
38251
|
+
kind: reference.kind,
|
|
38252
|
+
apiVersion: reference.apiVersion,
|
|
38253
|
+
namespace: forcedNamespace || reference.namespace || objectNamespace,
|
|
38254
|
+
forcedName,
|
|
38255
|
+
name: reference.name,
|
|
38256
|
+
theme,
|
|
38257
|
+
baseprefix,
|
|
38258
|
+
cluster,
|
|
38259
|
+
getPlural,
|
|
38260
|
+
baseFactoryNamespacedAPIKey,
|
|
38261
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38262
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38263
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38264
|
+
baseFactoriesMapping
|
|
38265
|
+
}
|
|
38266
|
+
);
|
|
38267
|
+
};
|
|
38268
|
+
|
|
38269
|
+
const RefsList = ({
|
|
38270
|
+
theme,
|
|
38271
|
+
baseprefix,
|
|
38272
|
+
cluster,
|
|
38273
|
+
refsArr,
|
|
38274
|
+
keysToForcedLabel,
|
|
38275
|
+
forcedRelatedValuePath,
|
|
38276
|
+
rawObjectToFindLabel,
|
|
38277
|
+
jsonPathToArrayOfRefs,
|
|
38278
|
+
forcedNamespace,
|
|
38279
|
+
baseFactoryNamespacedAPIKey,
|
|
38280
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38281
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38282
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38283
|
+
baseNavigationPluralName,
|
|
38284
|
+
baseNavigationSpecificName,
|
|
38285
|
+
listFlexProps
|
|
38286
|
+
}) => {
|
|
38287
|
+
const [kindIndex, setKindIndex] = K.useState();
|
|
38288
|
+
const [kindsWithVersion, setKindWithVersion] = K.useState();
|
|
38289
|
+
K.useEffect(() => {
|
|
38290
|
+
getKinds({ clusterName: cluster }).then((data) => {
|
|
38291
|
+
setKindIndex(data);
|
|
38292
|
+
setKindWithVersion(getSortedKindsAll(data));
|
|
38293
|
+
}).catch((error) => {
|
|
38294
|
+
console.error(error);
|
|
38295
|
+
});
|
|
38296
|
+
}, [cluster]);
|
|
38297
|
+
const { data: navigationDataArr } = useK8sSmartResource({
|
|
38298
|
+
cluster,
|
|
38299
|
+
group: "front.in-cloud.io",
|
|
38300
|
+
version: "v1alpha1",
|
|
38301
|
+
plural: baseNavigationPluralName,
|
|
38302
|
+
fieldSelector: `metadata.name=${baseNavigationSpecificName}`
|
|
38303
|
+
});
|
|
38304
|
+
const getPlural = kindsWithVersion ? pluralByKind(kindsWithVersion) : void 0;
|
|
38305
|
+
const baseFactoriesMapping = navigationDataArr && navigationDataArr.items && navigationDataArr.items.length > 0 ? navigationDataArr.items[0].spec?.baseFactoriesMapping : void 0;
|
|
38306
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Flex, { vertical: true, gap: 8, ...listFlexProps, children: refsArr.map((ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38307
|
+
RefElement,
|
|
38308
|
+
{
|
|
38309
|
+
reference: ref,
|
|
38310
|
+
keysToForcedLabel,
|
|
38311
|
+
forcedRelatedValuePath,
|
|
38312
|
+
rawObjectToFindLabel,
|
|
38313
|
+
jsonPathToArrayOfRefs,
|
|
38314
|
+
forcedNamespace,
|
|
38315
|
+
theme,
|
|
38316
|
+
baseprefix,
|
|
38317
|
+
cluster,
|
|
38318
|
+
getPlural,
|
|
38319
|
+
baseFactoryNamespacedAPIKey,
|
|
38320
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38321
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38322
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38323
|
+
baseFactoriesMapping
|
|
38324
|
+
},
|
|
38325
|
+
JSON.stringify(ref)
|
|
38326
|
+
)) });
|
|
38327
|
+
};
|
|
38328
|
+
|
|
38329
|
+
const isOwnerReference = (value) => {
|
|
38330
|
+
if (!value || typeof value !== "object") {
|
|
38331
|
+
return false;
|
|
38332
|
+
}
|
|
38333
|
+
if (value === null) {
|
|
38334
|
+
return false;
|
|
38335
|
+
}
|
|
38336
|
+
if (!("apiVersion" in value) || typeof value.apiVersion !== "string" || !("kind" in value) || typeof value.kind !== "string" || !("name" in value) || typeof value.name !== "string") {
|
|
38337
|
+
return false;
|
|
38338
|
+
}
|
|
38339
|
+
return true;
|
|
38340
|
+
};
|
|
38341
|
+
|
|
38342
|
+
const OwnerRefs = ({
|
|
38343
|
+
data,
|
|
38344
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38345
|
+
children
|
|
38346
|
+
}) => {
|
|
38347
|
+
const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
|
|
38348
|
+
const {
|
|
38349
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38350
|
+
id,
|
|
38351
|
+
baseprefix,
|
|
38352
|
+
clusterNamePartOfUrl,
|
|
38353
|
+
reqIndex,
|
|
38354
|
+
errorText,
|
|
38355
|
+
notArrayErrorText,
|
|
38356
|
+
emptyArrayErrorText,
|
|
38357
|
+
isNotRefsArrayErrorText,
|
|
38358
|
+
containerStyle,
|
|
38359
|
+
listFlexProps,
|
|
38360
|
+
keysToForcedLabel,
|
|
38361
|
+
forcedRelatedValuePath,
|
|
38362
|
+
jsonPathToArrayOfRefs,
|
|
38363
|
+
forcedNamespace,
|
|
38364
|
+
baseFactoryNamespacedAPIKey,
|
|
38365
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38366
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38367
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38368
|
+
baseNavigationPluralName,
|
|
38369
|
+
baseNavigationSpecificName,
|
|
38370
|
+
...props
|
|
38371
|
+
} = data;
|
|
38372
|
+
const theme = useTheme();
|
|
38373
|
+
const partsOfUrl = usePartsOfUrl();
|
|
38374
|
+
const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
|
|
38375
|
+
acc[index.toString()] = value;
|
|
38376
|
+
return acc;
|
|
38377
|
+
}, {});
|
|
38378
|
+
const clusterName = prepareTemplate({
|
|
38379
|
+
template: clusterNamePartOfUrl,
|
|
38380
|
+
replaceValues
|
|
38381
|
+
});
|
|
38382
|
+
const preparedForcedNamespace = forcedNamespace ? prepareTemplate({
|
|
38383
|
+
template: forcedNamespace,
|
|
38384
|
+
replaceValues
|
|
38385
|
+
}) : void 0;
|
|
38386
|
+
const jsonRoot = multiQueryData[`req${reqIndex}`];
|
|
38387
|
+
if (jsonRoot === void 0) {
|
|
38388
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
|
|
38389
|
+
}
|
|
38390
|
+
const refsArr = jp.query(jsonRoot, `$${jsonPathToArrayOfRefs}`)[0];
|
|
38391
|
+
if (!Array.isArray(refsArr)) {
|
|
38392
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: notArrayErrorText });
|
|
38393
|
+
}
|
|
38394
|
+
if (refsArr.length === 0) {
|
|
38395
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: emptyArrayErrorText });
|
|
38396
|
+
}
|
|
38397
|
+
if (refsArr.some((el) => !isOwnerReference(el))) {
|
|
38398
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: isNotRefsArrayErrorText });
|
|
38399
|
+
}
|
|
38400
|
+
const guardedRefsArr = refsArr;
|
|
38401
|
+
if (isMultiqueryLoading) {
|
|
38402
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
38403
|
+
}
|
|
38404
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
|
|
38405
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38406
|
+
RefsList,
|
|
38407
|
+
{
|
|
38408
|
+
theme,
|
|
38409
|
+
baseprefix,
|
|
38410
|
+
cluster: clusterName,
|
|
38411
|
+
refsArr: guardedRefsArr,
|
|
38412
|
+
keysToForcedLabel,
|
|
38413
|
+
forcedRelatedValuePath,
|
|
38414
|
+
jsonPathToArrayOfRefs,
|
|
38415
|
+
forcedNamespace: preparedForcedNamespace,
|
|
38416
|
+
rawObjectToFindLabel: jsonRoot,
|
|
38417
|
+
baseFactoryNamespacedAPIKey,
|
|
38418
|
+
baseFactoryClusterSceopedAPIKey,
|
|
38419
|
+
baseFactoryNamespacedBuiltinKey,
|
|
38420
|
+
baseFactoryClusterSceopedBuiltinKey,
|
|
38421
|
+
baseNavigationPluralName,
|
|
38422
|
+
baseNavigationSpecificName,
|
|
38423
|
+
listFlexProps,
|
|
37650
38424
|
...props
|
|
37651
38425
|
}
|
|
37652
38426
|
),
|
|
@@ -37690,7 +38464,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37690
38464
|
ConverterBytes,
|
|
37691
38465
|
SecretBase64Plain,
|
|
37692
38466
|
ResourceBadge,
|
|
37693
|
-
Events: Events$1
|
|
38467
|
+
Events: Events$1,
|
|
38468
|
+
OwnerRefs
|
|
37694
38469
|
};
|
|
37695
38470
|
|
|
37696
38471
|
const prepareUrlsToFetchForDynamicRenderer = ({
|
|
@@ -37709,13 +38484,30 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37709
38484
|
);
|
|
37710
38485
|
};
|
|
37711
38486
|
|
|
38487
|
+
const STRING_KEYS = ["cluster", "group", "version", "plural", "namespace", "fieldSelector", "labelSelector"];
|
|
37712
38488
|
const DynamicRendererWithProviders = (props) => {
|
|
37713
38489
|
const location = reactRouterDom.useLocation();
|
|
37714
38490
|
const { urlsToFetch, dataToApplyToContext, theme, nodeTerminalDefaultProfile, disableEventBubbling } = props;
|
|
38491
|
+
const directUrls = urlsToFetch.filter((el) => typeof el === "string");
|
|
38492
|
+
const k8sResourcesUrls = urlsToFetch.filter((el) => typeof el !== "string");
|
|
37715
38493
|
const preparedUrlsToFetch = prepareUrlsToFetchForDynamicRenderer({
|
|
37716
|
-
urls:
|
|
38494
|
+
urls: directUrls,
|
|
37717
38495
|
locationPathname: location.pathname
|
|
37718
38496
|
});
|
|
38497
|
+
const preparedK8sResoucesUrls = k8sResourcesUrls.map((res) => {
|
|
38498
|
+
let next = { ...res };
|
|
38499
|
+
for (const key of STRING_KEYS) {
|
|
38500
|
+
const val = next[key];
|
|
38501
|
+
if (typeof val === "string" && val.length > 0) {
|
|
38502
|
+
const prepared = prepareUrlsToFetchForDynamicRenderer({
|
|
38503
|
+
urls: [val],
|
|
38504
|
+
locationPathname: location.pathname
|
|
38505
|
+
});
|
|
38506
|
+
next = { ...next, [key]: prepared[0] ?? val };
|
|
38507
|
+
}
|
|
38508
|
+
}
|
|
38509
|
+
return next;
|
|
38510
|
+
});
|
|
37719
38511
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37720
38512
|
CursorDefaultDiv,
|
|
37721
38513
|
{
|
|
@@ -37725,7 +38517,14 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
37725
38517
|
e.stopPropagation();
|
|
37726
38518
|
}
|
|
37727
38519
|
},
|
|
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(
|
|
38520
|
+
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(
|
|
38521
|
+
MultiQueryProvider,
|
|
38522
|
+
{
|
|
38523
|
+
items: [...preparedK8sResoucesUrls, ...preparedUrlsToFetch],
|
|
38524
|
+
dataToApplyToContext,
|
|
38525
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props })
|
|
38526
|
+
}
|
|
38527
|
+
) }) }) })
|
|
37729
38528
|
}
|
|
37730
38529
|
);
|
|
37731
38530
|
};
|
|
@@ -38334,6 +39133,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
38334
39133
|
setIsError(void 0);
|
|
38335
39134
|
setIsLoading(true);
|
|
38336
39135
|
const payload = {
|
|
39136
|
+
clusterName: cluster,
|
|
38337
39137
|
customizationId,
|
|
38338
39138
|
tableMappingsReplaceValues,
|
|
38339
39139
|
forceDefaultAdditionalPrinterColumns,
|
|
@@ -46630,6 +47430,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
46630
47430
|
BigText: BigText$1
|
|
46631
47431
|
};
|
|
46632
47432
|
|
|
47433
|
+
const NOTIFICATION_KEY = "yaml-data-changed";
|
|
46633
47434
|
const YamlEditorSingleton = ({
|
|
46634
47435
|
theme,
|
|
46635
47436
|
cluster,
|
|
@@ -46651,9 +47452,52 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
|
|
|
46651
47452
|
const [yamlData, setYamlData] = K.useState("");
|
|
46652
47453
|
const [isLoading, setIsLoading] = K.useState(false);
|
|
46653
47454
|
const [error, setError] = K.useState();
|
|
47455
|
+
const initialPrefillYamlRef = K.useRef(null);
|
|
47456
|
+
const latestPrefillYamlRef = K.useRef(null);
|
|
47457
|
+
const firstLoadRef = K.useRef(true);
|
|
47458
|
+
const handleReload = K.useCallback(() => {
|
|
47459
|
+
api.destroy(NOTIFICATION_KEY);
|
|
47460
|
+
const nextYaml = latestPrefillYamlRef.current ?? initialPrefillYamlRef.current;
|
|
47461
|
+
if (nextYaml !== null) {
|
|
47462
|
+
setYamlData(nextYaml);
|
|
47463
|
+
}
|
|
47464
|
+
}, [api]);
|
|
47465
|
+
const openNotificationYamlChanged = K.useCallback(() => {
|
|
47466
|
+
const btn = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47467
|
+
antd.Button,
|
|
47468
|
+
{
|
|
47469
|
+
type: "primary",
|
|
47470
|
+
size: "small",
|
|
47471
|
+
onClick: () => {
|
|
47472
|
+
handleReload();
|
|
47473
|
+
},
|
|
47474
|
+
children: "Reload"
|
|
47475
|
+
}
|
|
47476
|
+
);
|
|
47477
|
+
api.info({
|
|
47478
|
+
key: NOTIFICATION_KEY,
|
|
47479
|
+
message: "Data changed",
|
|
47480
|
+
description: "The source data has been updated. Reload to apply the latest changes (will discard your edits).",
|
|
47481
|
+
btn,
|
|
47482
|
+
placement: "bottomRight",
|
|
47483
|
+
duration: 30
|
|
47484
|
+
});
|
|
47485
|
+
}, [api, handleReload]);
|
|
46654
47486
|
K.useEffect(() => {
|
|
46655
|
-
|
|
46656
|
-
|
|
47487
|
+
if (prefillValuesSchema === void 0) return;
|
|
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
|
|