@dovetail-v2/refine 0.0.43 → 0.0.45-bowen.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MonacoYamlDiffEditor-b2da37e8.js → MonacoYamlDiffEditor-5ce46809.js} +1 -1
- package/dist/{index-64df5871.js → index-c644b7e1.js} +188 -114
- package/dist/refine.js +1 -1
- package/dist/refine.umd.cjs +187 -113
- package/dist/style.css +4 -4
- package/lib/src/App.js +91 -0
- package/lib/src/Dovetail.js +45 -0
- package/lib/src/components/Breadcrumb/index.js +20 -0
- package/lib/src/components/ConditionsTable/ConditionsTable.js +56 -0
- package/lib/src/components/ConditionsTable/index.js +1 -0
- package/lib/src/components/CreateButton/index.js +10 -0
- package/lib/src/components/CronJobDropdown/index.js +26 -0
- package/lib/src/components/CronjobJobsTable/index.js +49 -0
- package/lib/src/components/DeleteButton/index.js +13 -0
- package/lib/src/components/DeleteManyButton/index.js +16 -0
- package/lib/src/components/DrawerShow/DrawerShow.js +13 -0
- package/lib/src/components/DrawerShow/index.js +1 -0
- package/lib/src/components/EditButton/index.js +13 -0
- package/lib/src/components/EditField/index.js +47 -0
- package/lib/src/components/ErrorContent/index.js +36 -0
- package/lib/src/components/EventsTable/EventsTable.js +59 -0
- package/lib/src/components/EventsTable/index.js +1 -0
- package/lib/src/components/Form/KeyValueListWidget.js +56 -0
- package/lib/src/components/Form/MetadataForm.js +9 -0
- package/lib/src/components/Form/NameInputWidget.js +50 -0
- package/lib/src/components/Form/NamespaceSelectWidget.js +21 -0
- package/lib/src/components/Form/RefineFormContent.d.ts +1 -1
- package/lib/src/components/Form/index.js +4 -0
- package/lib/src/components/Form/type.d.ts +2 -1
- package/lib/src/components/Form/useRefineForm.d.ts +2 -2
- package/lib/src/components/Form/widget.js +1 -0
- package/lib/src/components/FormErrorAlert/index.js +8 -0
- package/lib/src/components/FormLayout/index.js +21 -0
- package/lib/src/components/FormModal/index.js +51 -0
- package/lib/src/components/ImageNames/index.js +14 -0
- package/lib/src/components/IngressRulesComponent/index.js +11 -0
- package/lib/src/components/IngressRulesTable/IngressRulesTable.js +51 -0
- package/lib/src/components/IngressRulesTable/index.js +1 -0
- package/lib/src/components/K8sDropdown/index.js +31 -0
- package/lib/src/components/KeyValue/KeyValue.js +27 -0
- package/lib/src/components/KeyValue/index.js +1 -0
- package/lib/src/components/KeyValueData/index.js +50 -0
- package/lib/src/components/Layout/index.js +39 -0
- package/lib/src/components/ListPage/index.js +25 -0
- package/lib/src/components/Menu/index.js +36 -0
- package/lib/src/components/NamespacesFilter/index.js +34 -0
- package/lib/src/components/NetworkPolicyRulesTable/NetworkPolicyRulesTable.d.ts +1 -2
- package/lib/src/components/NetworkPolicyRulesTable/NetworkPolicyRulesTable.js +77 -0
- package/lib/src/components/NetworkPolicyRulesTable/index.js +1 -0
- package/lib/src/components/PageShow/PageShow.js +11 -0
- package/lib/src/components/PageShow/index.js +1 -0
- package/lib/src/components/PodContainersTable/PodContainersTable.js +78 -0
- package/lib/src/components/PodContainersTable/index.js +1 -0
- package/lib/src/components/PodLog/index.js +136 -0
- package/lib/src/components/ReferenceLink/index.js +17 -0
- package/lib/src/components/RefineForm/RefineFormContent.d.ts +10 -0
- package/lib/src/components/RefineForm/RefineFormModal.d.ts +8 -0
- package/lib/src/components/RefineForm/RefineFormPage.d.ts +7 -0
- package/lib/src/components/RefineForm/index.d.ts +3 -0
- package/lib/src/components/RefineForm/type.d.ts +20 -0
- package/lib/src/components/RefineForm/useRefineForm.d.ts +10 -0
- package/lib/src/components/ResourceCRUD/ResourceCRUD.js +15 -0
- package/lib/src/components/ResourceCRUD/create/index.js +13 -0
- package/lib/src/components/ResourceCRUD/index.js +4 -0
- package/lib/src/components/ResourceCRUD/list/index.js +19 -0
- package/lib/src/components/ResourceCRUD/show/index.js +6 -0
- package/lib/src/components/ResourceLink/index.js +21 -0
- package/lib/src/components/ResourceUsageBar/index.js +81 -0
- package/lib/src/components/Separator/index.js +11 -0
- package/lib/src/components/ShowContent/ShowContent.js +157 -0
- package/lib/src/components/ShowContent/fields.js +157 -0
- package/lib/src/components/ShowContent/index.js +2 -0
- package/lib/src/components/StateTag/StateTag.js +22 -0
- package/lib/src/components/StateTag/index.js +1 -0
- package/lib/src/components/Table/ErrorContent.js +36 -0
- package/lib/src/components/Table/TableToolBar.js +14 -0
- package/lib/src/components/Table/TableWidgets.js +28 -0
- package/lib/src/components/Table/index.js +69 -0
- package/lib/src/components/Tags/index.js +22 -0
- package/lib/src/components/Time/index.js +14 -0
- package/lib/src/components/WorkloadDropdown/index.js +24 -0
- package/lib/src/components/WorkloadPodsTable/WorkloadPodsTable.js +39 -0
- package/lib/src/components/WorkloadPodsTable/index.js +1 -0
- package/lib/src/components/WorkloadReplicas/index.js +50 -0
- package/lib/src/components/YamlEditor/MonacoYamlDiffEditor.js +34 -0
- package/lib/src/components/YamlEditor/MonacoYamlEditor.js +149 -0
- package/lib/src/components/YamlEditor/YamlEditorComponent.js +90 -0
- package/lib/src/components/YamlEditor/index.js +1 -0
- package/lib/src/components/YamlEditor/style.js +102 -0
- package/lib/src/components/YamlEditor/yaml.worker.js +1 -0
- package/lib/src/components/YamlForm/index.d.ts +0 -4
- package/lib/src/components/YamlForm/index.js +61 -0
- package/lib/src/components/index.js +38 -0
- package/lib/src/constants/index.js +2 -0
- package/lib/src/constants/k8s.js +203 -0
- package/lib/src/constants/state.js +15 -0
- package/lib/src/contexts/component.js +3 -0
- package/lib/src/contexts/configs.js +3 -0
- package/lib/src/contexts/global-store.js +3 -0
- package/lib/src/contexts/index.js +3 -0
- package/lib/src/hooks/index.js +7 -0
- package/lib/src/hooks/useDeleteModal/index.js +1 -0
- package/lib/src/hooks/useDeleteModal/useDeleteManyModal.js +31 -0
- package/lib/src/hooks/useDeleteModal/useDeleteModal.js +38 -0
- package/lib/src/hooks/useDownloadYAML.js +10 -0
- package/lib/src/hooks/useEagleForm.d.ts +1 -2
- package/lib/src/hooks/useEagleForm.js +177 -0
- package/lib/src/hooks/useEagleTable/columns.js +246 -0
- package/lib/src/hooks/useEagleTable/index.js +2 -0
- package/lib/src/hooks/useEagleTable/useEagleTable.js +63 -0
- package/lib/src/hooks/useEdit.js +19 -0
- package/lib/src/hooks/useGlobalStore.js +5 -0
- package/lib/src/hooks/useK8sYamlEditor.js +37 -0
- package/lib/src/hooks/useOpenForm.js +43 -0
- package/lib/src/hooks/useSchema.js +37 -0
- package/lib/src/hooks/useSubmitForm.js +42 -0
- package/lib/src/i18n.js +19 -0
- package/lib/src/index.js +13 -0
- package/lib/src/locales/en-US/dovetail.json +18 -0
- package/lib/src/locales/en-US/index.js +4 -0
- package/lib/src/locales/index.js +6 -0
- package/lib/src/locales/zh-CN/dovetail.json +91 -0
- package/lib/src/locales/zh-CN/index.js +4 -0
- package/lib/src/main.js +12 -0
- package/lib/src/models/cronjob-model.js +32 -0
- package/lib/src/models/daemonset-model.js +17 -0
- package/lib/src/models/deployment-model.js +17 -0
- package/lib/src/models/event-model.js +11 -0
- package/lib/src/models/index.js +14 -0
- package/lib/src/models/ingress-model.js +24 -0
- package/lib/src/models/job-model.js +56 -0
- package/lib/src/models/network-policy-model.js +10 -0
- package/lib/src/models/pod-metrics-model.js +34 -0
- package/lib/src/models/pod-model.js +78 -0
- package/lib/src/models/resource-model.js +34 -0
- package/lib/src/models/server-instance-model.d.ts +10 -0
- package/lib/src/models/service-model.js +17 -0
- package/lib/src/models/statefulset-model.js +17 -0
- package/lib/src/models/types/index.js +1 -0
- package/lib/src/models/types/metric.js +1 -0
- package/lib/src/models/workload-base-model.js +22 -0
- package/lib/src/models/workload-model.js +51 -0
- package/lib/src/pages/configmaps/index.js +15 -0
- package/lib/src/pages/cronjobs/create/index.js +6 -0
- package/lib/src/pages/cronjobs/index.js +3 -0
- package/lib/src/pages/cronjobs/list/index.js +42 -0
- package/lib/src/pages/cronjobs/show/index.js +16 -0
- package/lib/src/pages/daemonsets/create/index.js +6 -0
- package/lib/src/pages/daemonsets/index.js +3 -0
- package/lib/src/pages/daemonsets/list/index.js +32 -0
- package/lib/src/pages/daemonsets/show/index.js +16 -0
- package/lib/src/pages/deployments/create/index.js +7 -0
- package/lib/src/pages/deployments/index.js +3 -0
- package/lib/src/pages/deployments/list/index.js +26 -0
- package/lib/src/pages/deployments/show/index.js +16 -0
- package/lib/src/pages/ingresses/index.js +26 -0
- package/lib/src/pages/jobs/index.js +34 -0
- package/lib/src/pages/networkPolicies/index.js +67 -0
- package/lib/src/pages/pods/create/index.js +6 -0
- package/lib/src/pages/pods/index.js +3 -0
- package/lib/src/pages/pods/list/index.js +81 -0
- package/lib/src/pages/pods/show/index.js +54 -0
- package/lib/src/pages/secrets/index.js +15 -0
- package/lib/src/pages/services/index.js +26 -0
- package/lib/src/pages/statefulsets/create/index.js +6 -0
- package/lib/src/pages/statefulsets/index.js +3 -0
- package/lib/src/pages/statefulsets/list/index.js +26 -0
- package/lib/src/pages/statefulsets/show/index.js +16 -0
- package/lib/src/plugins/index.js +3 -0
- package/lib/src/plugins/model-plugin.js +46 -0
- package/lib/src/plugins/relation-plugin.js +81 -0
- package/lib/src/plugins/type.js +1 -0
- package/lib/src/providers/index.js +1 -0
- package/lib/src/providers/router-provider/index.js +100 -0
- package/lib/src/types/index.js +1 -0
- package/lib/src/types/resource.d.ts +2 -1
- package/lib/src/types/resource.js +12 -0
- package/lib/src/utils/addId.js +8 -0
- package/lib/src/utils/download.js +9 -0
- package/lib/src/utils/error.js +53 -0
- package/lib/src/utils/form.js +9 -0
- package/lib/src/utils/k8s.js +6 -0
- package/lib/src/utils/labels.js +15 -0
- package/lib/src/utils/match-selector.js +12 -0
- package/lib/src/utils/openapi.js +33 -0
- package/lib/src/utils/schema.js +117 -0
- package/lib/src/utils/selector.js +12 -0
- package/lib/src/utils/string.js +6 -0
- package/lib/src/utils/time.js +46 -0
- package/lib/src/utils/unit.js +69 -0
- package/lib/src/utils/yaml.js +44 -0
- package/lib/vite.config.js +60 -0
- package/package.json +1 -1
- package/lib/src/components/ModalContextProvider/index.d.ts +0 -12
- package/lib/src/hooks/useModal.d.ts +0 -0
- package/lib/src/model/cronjob-model.d.ts +0 -9
- package/lib/src/model/index.d.ts +0 -6
- package/lib/src/model/job-model.d.ts +0 -10
- package/lib/src/model/pod-metrics-model.d.ts +0 -7
- package/lib/src/model/pod-model.d.ts +0 -15
- package/lib/src/model/resource-model.d.ts +0 -17
- package/lib/src/model/workload-model.d.ts +0 -17
- package/lib/src/types/metric.d.ts +0 -25
|
@@ -9953,7 +9953,7 @@ const ServiceOutClusterAccessComponent = ({
|
|
|
9953
9953
|
children: content || "-"
|
|
9954
9954
|
});
|
|
9955
9955
|
};
|
|
9956
|
-
const
|
|
9956
|
+
const index_10ylmu3 = "";
|
|
9957
9957
|
const TagWrapper = "t13a6vox";
|
|
9958
9958
|
const TagStyle = "t12ikbmp";
|
|
9959
9959
|
const Tags = (props) => {
|
|
@@ -9992,23 +9992,24 @@ const StateTag = ({
|
|
|
9992
9992
|
const {
|
|
9993
9993
|
t: t2
|
|
9994
9994
|
} = useTranslation();
|
|
9995
|
-
const
|
|
9996
|
-
updating: "
|
|
9995
|
+
const statusMap = {
|
|
9996
|
+
updating: "loading",
|
|
9997
9997
|
ready: "green",
|
|
9998
9998
|
completed: "gray",
|
|
9999
9999
|
failed: "red",
|
|
10000
10000
|
suspended: "warning",
|
|
10001
|
-
running: "
|
|
10002
|
-
succeeded: "
|
|
10003
|
-
unknown: "
|
|
10004
|
-
terminating: "
|
|
10005
|
-
pending: "
|
|
10001
|
+
running: "green",
|
|
10002
|
+
succeeded: "blue",
|
|
10003
|
+
unknown: "gray",
|
|
10004
|
+
terminating: "loading",
|
|
10005
|
+
pending: "warning",
|
|
10006
10006
|
waiting: "warning",
|
|
10007
10007
|
terminated: "red"
|
|
10008
10008
|
};
|
|
10009
10009
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.statusCapsule, {
|
|
10010
10010
|
className: cx_default(className, StateTagStyle, hideBackground && "no-background"),
|
|
10011
|
-
color:
|
|
10011
|
+
color: statusMap[state2] !== "loading" ? statusMap[state2] : void 0,
|
|
10012
|
+
loading: statusMap[state2] === "loading",
|
|
10012
10013
|
children: t2(`dovetail.${state2 || "updating"}`)
|
|
10013
10014
|
});
|
|
10014
10015
|
};
|
|
@@ -10683,7 +10684,7 @@ const IngressRulesTable = ({ ingress }) => {
|
|
|
10683
10684
|
}
|
|
10684
10685
|
);
|
|
10685
10686
|
};
|
|
10686
|
-
const
|
|
10687
|
+
const KeyValue_q4vd5r = "";
|
|
10687
10688
|
const ContentBlockStyle = "c8jy7dc";
|
|
10688
10689
|
const KeyStyle = "k2sddxl";
|
|
10689
10690
|
const ValueStyle$2 = "v16vicsr";
|
|
@@ -18314,7 +18315,7 @@ function parseJSON(value2) {
|
|
|
18314
18315
|
}
|
|
18315
18316
|
}
|
|
18316
18317
|
const GlobalStoreContext = createContext({});
|
|
18317
|
-
const
|
|
18318
|
+
const index_1xad2h9 = "";
|
|
18318
18319
|
const SelectStyle = "sj0ggy";
|
|
18319
18320
|
const DropdownStyle = "d1eo8uqs";
|
|
18320
18321
|
const SearchInputStyle = "s64gojc";
|
|
@@ -18350,6 +18351,7 @@ const NamespacesFilter = ({
|
|
|
18350
18351
|
t: t2
|
|
18351
18352
|
} = useTranslation();
|
|
18352
18353
|
const [search, setSearch] = useState("");
|
|
18354
|
+
const [tagMaxWidth, setTagMaxWidth] = useState("");
|
|
18353
18355
|
const {
|
|
18354
18356
|
data: data2,
|
|
18355
18357
|
isLoading
|
|
@@ -18364,91 +18366,144 @@ const NamespacesFilter = ({
|
|
|
18364
18366
|
}
|
|
18365
18367
|
});
|
|
18366
18368
|
const [value2, setValue] = useLocalStorage(NS_STORE_KEY, [ALL_NS]);
|
|
18369
|
+
const [open, setOpen] = useState(false);
|
|
18367
18370
|
const debouncedSetSearch = debounce(setSearch, 100);
|
|
18368
|
-
|
|
18369
|
-
|
|
18370
|
-
|
|
18371
|
-
|
|
18372
|
-
|
|
18373
|
-
|
|
18374
|
-
|
|
18375
|
-
|
|
18376
|
-
|
|
18377
|
-
|
|
18378
|
-
|
|
18379
|
-
|
|
18380
|
-
|
|
18381
|
-
|
|
18382
|
-
|
|
18383
|
-
|
|
18371
|
+
const MAX_TAG_COUNT = 8;
|
|
18372
|
+
const COUNT_TAG_WIDTH = 22;
|
|
18373
|
+
const TAG_GAP = 4;
|
|
18374
|
+
const PADDING = 36;
|
|
18375
|
+
const hasCountTag = value2.length > MAX_TAG_COUNT;
|
|
18376
|
+
const WRAPPER_CLASS = "d2-namespace-select-wrapper";
|
|
18377
|
+
const SELECT_CLASS = "d2-namespace-select";
|
|
18378
|
+
const calcTagMaxWidth = useCallback(() => {
|
|
18379
|
+
const wrapper = document.querySelector(`.${WRAPPER_CLASS}`);
|
|
18380
|
+
const n2 = Math.min(value2.length, MAX_TAG_COUNT);
|
|
18381
|
+
const tagWidth = ((wrapper == null ? void 0 : wrapper.offsetWidth) || 0) / n2;
|
|
18382
|
+
const gapsWidth = (Math.min(value2.length, MAX_TAG_COUNT + 1) - 1) * TAG_GAP;
|
|
18383
|
+
const paddingAndCountTagWidth = PADDING + (hasCountTag ? COUNT_TAG_WIDTH : 0);
|
|
18384
|
+
const perTagMaxWidth = tagWidth - (paddingAndCountTagWidth + gapsWidth) / n2;
|
|
18385
|
+
setTagMaxWidth(`${perTagMaxWidth}px`);
|
|
18386
|
+
}, [value2, hasCountTag]);
|
|
18387
|
+
useEffect(() => {
|
|
18388
|
+
calcTagMaxWidth();
|
|
18389
|
+
}, [calcTagMaxWidth]);
|
|
18390
|
+
useEffect(() => {
|
|
18391
|
+
window.addEventListener("resize", calcTagMaxWidth);
|
|
18392
|
+
return () => {
|
|
18393
|
+
window.removeEventListener("resize", calcTagMaxWidth);
|
|
18394
|
+
};
|
|
18395
|
+
}, [calcTagMaxWidth]);
|
|
18396
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
18397
|
+
className: WRAPPER_CLASS,
|
|
18398
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.select, {
|
|
18399
|
+
loading: isLoading,
|
|
18400
|
+
className: cx_default(SelectStyle, SELECT_CLASS, className),
|
|
18401
|
+
style: {
|
|
18402
|
+
"--tag-max-width": tagMaxWidth
|
|
18403
|
+
},
|
|
18404
|
+
dropdownClassName: DropdownStyle,
|
|
18405
|
+
searchValue: search,
|
|
18406
|
+
virtual: false,
|
|
18407
|
+
input: {
|
|
18408
|
+
value: value2,
|
|
18409
|
+
onChange(value22) {
|
|
18410
|
+
if (last(value22) === ALL_NS || value22.length === 0) {
|
|
18411
|
+
setValue([ALL_NS]);
|
|
18412
|
+
} else {
|
|
18413
|
+
setValue(value22.filter((namespace2) => namespace2 !== ALL_NS));
|
|
18414
|
+
}
|
|
18384
18415
|
}
|
|
18385
|
-
}
|
|
18386
|
-
|
|
18387
|
-
|
|
18388
|
-
|
|
18389
|
-
|
|
18390
|
-
|
|
18391
|
-
|
|
18392
|
-
|
|
18393
|
-
|
|
18394
|
-
|
|
18395
|
-
|
|
18396
|
-
}),
|
|
18397
|
-
|
|
18398
|
-
|
|
18399
|
-
|
|
18400
|
-
value: value22,
|
|
18401
|
-
closable,
|
|
18402
|
-
onClose
|
|
18403
|
-
}) => {
|
|
18404
|
-
const isCountToken = label2 !== value22 && typeof label2 === "string";
|
|
18405
|
-
const isAll = value22 === ALL_NS;
|
|
18406
|
-
return isAll ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
18407
|
-
style: {
|
|
18408
|
-
marginLeft: 8
|
|
18409
|
-
},
|
|
18410
|
-
children: label2
|
|
18411
|
-
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(kit.token, {
|
|
18412
|
-
className: cx_default(isCountToken ? CountTokenStyle : TokenStyle, isCountToken ? "" : "closable-token"),
|
|
18416
|
+
},
|
|
18417
|
+
dropdownRender: (menu) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
18418
|
+
className: SelectContentStyle,
|
|
18419
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.searchInput, {
|
|
18420
|
+
style: {
|
|
18421
|
+
width: "100%"
|
|
18422
|
+
},
|
|
18423
|
+
className: SearchInputStyle,
|
|
18424
|
+
onChange: debouncedSetSearch,
|
|
18425
|
+
placeholder: t2("dovetail.please_input")
|
|
18426
|
+
}), menu, isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.loading, {}) : null]
|
|
18427
|
+
}),
|
|
18428
|
+
tagRender: ({
|
|
18429
|
+
label: label2,
|
|
18430
|
+
value: namespaceValue,
|
|
18413
18431
|
closable,
|
|
18414
|
-
|
|
18415
|
-
|
|
18432
|
+
onClose
|
|
18433
|
+
}) => {
|
|
18434
|
+
const isCountToken = label2 !== namespaceValue && typeof label2 === "string";
|
|
18435
|
+
const isAll = namespaceValue === ALL_NS;
|
|
18436
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
18437
|
+
onClick: () => {
|
|
18438
|
+
setOpen(!open);
|
|
18439
|
+
},
|
|
18440
|
+
children: isAll ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
18441
|
+
style: {
|
|
18442
|
+
marginLeft: 8
|
|
18443
|
+
},
|
|
18444
|
+
children: [label2, "..."]
|
|
18445
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(kit.token, {
|
|
18446
|
+
className: cx_default(isCountToken ? CountTokenStyle : TokenStyle, isCountToken ? "" : "closable-token"),
|
|
18447
|
+
closable,
|
|
18448
|
+
size: "medium",
|
|
18449
|
+
onClose,
|
|
18450
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.overflowTooltip, {
|
|
18451
|
+
content: isCountToken ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tooltip, {
|
|
18452
|
+
title: isCountToken ? value2.slice(MAX_TAG_COUNT).map((namespace2, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
18453
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
18454
|
+
children: namespace2
|
|
18455
|
+
}), index !== value2.length - 1 - MAX_TAG_COUNT ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.divider, {
|
|
18456
|
+
style: {
|
|
18457
|
+
margin: "6px 0",
|
|
18458
|
+
borderColor: "rgba(107, 128, 167, 0.60)"
|
|
18459
|
+
}
|
|
18460
|
+
}) : null]
|
|
18461
|
+
})) : null,
|
|
18462
|
+
trigger: ["hover"],
|
|
18463
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
18464
|
+
children: label2.replace(/[\s\.]/g, "")
|
|
18465
|
+
})
|
|
18466
|
+
}) : label2
|
|
18467
|
+
})
|
|
18468
|
+
})
|
|
18469
|
+
});
|
|
18470
|
+
},
|
|
18471
|
+
maxTagCount: MAX_TAG_COUNT,
|
|
18472
|
+
optionLabelProp: "label",
|
|
18473
|
+
showArrow: true,
|
|
18474
|
+
showSearch: false,
|
|
18475
|
+
open,
|
|
18476
|
+
onDropdownVisibleChange: (open2) => {
|
|
18477
|
+
setOpen(open2);
|
|
18478
|
+
},
|
|
18479
|
+
multiple: true,
|
|
18480
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, {
|
|
18481
|
+
value: "_all",
|
|
18482
|
+
label: t2("dovetail.all_namespaces"),
|
|
18483
|
+
className: AllNamespaceOptionStyle,
|
|
18416
18484
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.overflowTooltip, {
|
|
18417
|
-
content:
|
|
18485
|
+
content: t2("dovetail.all_namespaces"),
|
|
18486
|
+
className: LabelWrapperStyle
|
|
18418
18487
|
})
|
|
18419
|
-
})
|
|
18420
|
-
|
|
18421
|
-
|
|
18422
|
-
|
|
18423
|
-
|
|
18424
|
-
|
|
18425
|
-
|
|
18426
|
-
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
|
|
18430
|
-
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
|
|
18434
|
-
|
|
18435
|
-
|
|
18436
|
-
|
|
18437
|
-
|
|
18438
|
-
const {
|
|
18439
|
-
name: name2
|
|
18440
|
-
} = namespace2.metadata;
|
|
18441
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, {
|
|
18442
|
-
value: name2,
|
|
18443
|
-
label: name2,
|
|
18444
|
-
className: OptionStyle,
|
|
18445
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.overflowTooltip, {
|
|
18446
|
-
content: name2,
|
|
18447
|
-
className: LabelWrapperStyle
|
|
18448
|
-
})
|
|
18449
|
-
}, name2);
|
|
18450
|
-
})
|
|
18451
|
-
})]
|
|
18488
|
+
}, "_all"), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.selectOptGroup, {
|
|
18489
|
+
label: "",
|
|
18490
|
+
className: SelectOptionGroupStyle,
|
|
18491
|
+
children: data2 == null ? void 0 : data2.data.map((namespace2) => {
|
|
18492
|
+
const {
|
|
18493
|
+
name: name2
|
|
18494
|
+
} = namespace2.metadata;
|
|
18495
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, {
|
|
18496
|
+
value: name2,
|
|
18497
|
+
label: name2,
|
|
18498
|
+
className: OptionStyle,
|
|
18499
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.overflowTooltip, {
|
|
18500
|
+
content: name2,
|
|
18501
|
+
className: LabelWrapperStyle
|
|
18502
|
+
})
|
|
18503
|
+
}, name2);
|
|
18504
|
+
})
|
|
18505
|
+
})]
|
|
18506
|
+
})
|
|
18452
18507
|
});
|
|
18453
18508
|
};
|
|
18454
18509
|
const index_hp158y = "";
|
|
@@ -21791,13 +21846,13 @@ const RefineFormContent = (props) => {
|
|
|
21791
21846
|
meta: {}
|
|
21792
21847
|
});
|
|
21793
21848
|
}
|
|
21794
|
-
if (action === "edit" && c2.
|
|
21849
|
+
if (action === "edit" && c2.disabledWhenEdit) {
|
|
21795
21850
|
ele = /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
21796
21851
|
children: value2
|
|
21797
21852
|
});
|
|
21798
21853
|
}
|
|
21799
21854
|
if (c2 == null ? void 0 : c2.render) {
|
|
21800
|
-
ele = c2.render(value2, onChange, formValue, onBlur);
|
|
21855
|
+
ele = c2.render(value2, onChange, formValue, onBlur, action);
|
|
21801
21856
|
}
|
|
21802
21857
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, {
|
|
21803
21858
|
label: c2.label,
|
|
@@ -22453,7 +22508,6 @@ const useForm = ({
|
|
|
22453
22508
|
};
|
|
22454
22509
|
};
|
|
22455
22510
|
const useRefineForm = (props) => {
|
|
22456
|
-
var _a;
|
|
22457
22511
|
const { config, id, refineProps } = props;
|
|
22458
22512
|
const [responseErrorMsg, setResponseErrorMsg] = useState("");
|
|
22459
22513
|
const i18n2 = useTranslation();
|
|
@@ -22486,14 +22540,15 @@ const useRefineForm = (props) => {
|
|
|
22486
22540
|
defaultValues: config == null ? void 0 : config.initValue
|
|
22487
22541
|
});
|
|
22488
22542
|
useEffect(() => {
|
|
22489
|
-
var
|
|
22490
|
-
const response = (
|
|
22543
|
+
var _a, _b;
|
|
22544
|
+
const response = (_a = result.refineCore.mutationResult.error) == null ? void 0 : _a.response;
|
|
22491
22545
|
if (response && !(response == null ? void 0 : response.bodyUsed)) {
|
|
22492
22546
|
(_b = response.json) == null ? void 0 : _b.call(response).then((body) => {
|
|
22493
|
-
|
|
22547
|
+
var _a2, _b2;
|
|
22548
|
+
setResponseErrorMsg(((_b2 = (_a2 = config.formConfig) == null ? void 0 : _a2.formatError) == null ? void 0 : _b2.call(_a2, body)) || body.message);
|
|
22494
22549
|
});
|
|
22495
22550
|
}
|
|
22496
|
-
}, [
|
|
22551
|
+
}, [config.formConfig, result]);
|
|
22497
22552
|
return { formResult: result, responseErrorMsg };
|
|
22498
22553
|
};
|
|
22499
22554
|
const index_12sfrn = "";
|
|
@@ -22504,7 +22559,7 @@ const Separator = () => {
|
|
|
22504
22559
|
});
|
|
22505
22560
|
};
|
|
22506
22561
|
const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
|
|
22507
|
-
const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-
|
|
22562
|
+
const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-5ce46809.js"));
|
|
22508
22563
|
const YamlEditorComponent = forwardRef(
|
|
22509
22564
|
function YamlEditorComponent2(props, ref) {
|
|
22510
22565
|
const {
|
|
@@ -23019,9 +23074,18 @@ const useYamlForm = ({
|
|
|
23019
23074
|
setEditorErrors(errors);
|
|
23020
23075
|
return;
|
|
23021
23076
|
}
|
|
23022
|
-
|
|
23023
|
-
|
|
23024
|
-
|
|
23077
|
+
try {
|
|
23078
|
+
const objectValues = editor.current ? yaml.load(((_a2 = editor.current) == null ? void 0 : _a2.getEditorValue()) || "") : values;
|
|
23079
|
+
const finalValues = (transformApplyValues == null ? void 0 : transformApplyValues(objectValues)) || objectValues;
|
|
23080
|
+
return onFinish(finalValues);
|
|
23081
|
+
} catch (error) {
|
|
23082
|
+
if (error instanceof Error) {
|
|
23083
|
+
if (error.message === "expected a single document in the stream, but found more") {
|
|
23084
|
+
setEditorErrors([t2("dovetail.only_support_one_yaml")]);
|
|
23085
|
+
return;
|
|
23086
|
+
}
|
|
23087
|
+
}
|
|
23088
|
+
}
|
|
23025
23089
|
},
|
|
23026
23090
|
onKeyUp,
|
|
23027
23091
|
onValuesChange,
|
|
@@ -23181,7 +23245,7 @@ const FullscreenModalStyle = "f1nltbcu";
|
|
|
23181
23245
|
const FormDescStyle = "f1qgcca6";
|
|
23182
23246
|
const ErrorStyle = "e1tl3wq2";
|
|
23183
23247
|
function FormModal(props) {
|
|
23184
|
-
var _a, _b, _c, _d, _e;
|
|
23248
|
+
var _a, _b, _c, _d, _e, _f;
|
|
23185
23249
|
const {
|
|
23186
23250
|
resource: resourceFromProps,
|
|
23187
23251
|
id,
|
|
@@ -23197,10 +23261,8 @@ function FormModal(props) {
|
|
|
23197
23261
|
const [yamlSaveButtonProps, setYamlSaveButtonProps] = useState({});
|
|
23198
23262
|
const [isError, setIsError] = useState(false);
|
|
23199
23263
|
const config = configs[resourceFromProps || (resource == null ? void 0 : resource.name) || ""];
|
|
23200
|
-
const title = i18n2.t(id ? "dovetail.edit_resource" : "dovetail.create_resource", {
|
|
23201
|
-
resource: config == null ? void 0 : config.kind
|
|
23202
|
-
});
|
|
23203
23264
|
const okText = i18n2.t(id ? "dovetail.save" : "dovetail.create");
|
|
23265
|
+
const action = id ? "edit" : "create";
|
|
23204
23266
|
const yamlFormProps = useMemo(() => {
|
|
23205
23267
|
var _a2, _b2, _c2;
|
|
23206
23268
|
return {
|
|
@@ -23209,7 +23271,7 @@ function FormModal(props) {
|
|
|
23209
23271
|
transformApplyValues: (_b2 = config.formConfig) == null ? void 0 : _b2.transformApplyValues,
|
|
23210
23272
|
initialValues: ((_c2 = props.formProps) == null ? void 0 : _c2.initialValues) || (config == null ? void 0 : config.initValue),
|
|
23211
23273
|
id,
|
|
23212
|
-
action
|
|
23274
|
+
action,
|
|
23213
23275
|
isShowLayout: false,
|
|
23214
23276
|
useFormProps: {
|
|
23215
23277
|
redirect: false
|
|
@@ -23220,7 +23282,7 @@ function FormModal(props) {
|
|
|
23220
23282
|
},
|
|
23221
23283
|
onFinish: popModal
|
|
23222
23284
|
};
|
|
23223
|
-
}, [props.formProps,
|
|
23285
|
+
}, [props.formProps, (_a = config.formConfig) == null ? void 0 : _a.transformInitValues, (_b = config.formConfig) == null ? void 0 : _b.transformApplyValues, config == null ? void 0 : config.initValue, id, action]);
|
|
23224
23286
|
const refineFormResult = useRefineForm({
|
|
23225
23287
|
config,
|
|
23226
23288
|
id,
|
|
@@ -23229,10 +23291,10 @@ function FormModal(props) {
|
|
|
23229
23291
|
popModal();
|
|
23230
23292
|
},
|
|
23231
23293
|
redirect: false,
|
|
23232
|
-
...(
|
|
23294
|
+
...(_c = config.formConfig) == null ? void 0 : _c.refineCoreProps
|
|
23233
23295
|
}
|
|
23234
23296
|
});
|
|
23235
|
-
const isYamlForm = !((
|
|
23297
|
+
const isYamlForm = !((_d = config.formConfig) == null ? void 0 : _d.fields);
|
|
23236
23298
|
const formEle = (() => {
|
|
23237
23299
|
if (renderForm) {
|
|
23238
23300
|
return renderForm(yamlFormProps);
|
|
@@ -23261,10 +23323,21 @@ function FormModal(props) {
|
|
|
23261
23323
|
return i18n2.t(id ? "dovetail.save_failed" : "dovetail.create_failed");
|
|
23262
23324
|
}
|
|
23263
23325
|
})();
|
|
23326
|
+
const title = useMemo(() => {
|
|
23327
|
+
var _a2, _b2, _c2, _d2;
|
|
23328
|
+
if (typeof ((_a2 = config.formConfig) == null ? void 0 : _a2.formTitle) === "string")
|
|
23329
|
+
return (_b2 = config.formConfig) == null ? void 0 : _b2.formTitle;
|
|
23330
|
+
if (typeof ((_c2 = config.formConfig) == null ? void 0 : _c2.formTitle) === "function") {
|
|
23331
|
+
return (_d2 = config.formConfig) == null ? void 0 : _d2.formTitle(action);
|
|
23332
|
+
}
|
|
23333
|
+
return i18n2.t(id ? "dovetail.edit_resource" : "dovetail.create_resource", {
|
|
23334
|
+
resource: config == null ? void 0 : config.kind
|
|
23335
|
+
});
|
|
23336
|
+
}, [action, config.formConfig, config == null ? void 0 : config.kind, i18n2, id]);
|
|
23264
23337
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Modal, {
|
|
23265
23338
|
className: FullscreenModalStyle,
|
|
23266
23339
|
width: "calc(100vw - 16px)",
|
|
23267
|
-
title
|
|
23340
|
+
title,
|
|
23268
23341
|
error: errorText ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
23269
23342
|
className: ErrorStyle,
|
|
23270
23343
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(ExclamationErrorCircleFill16RedIcon, {}), " ", errorText]
|
|
@@ -23276,9 +23349,9 @@ function FormModal(props) {
|
|
|
23276
23349
|
onCancel,
|
|
23277
23350
|
destroyOnClose: true,
|
|
23278
23351
|
fullscreen: true,
|
|
23279
|
-
children: [((
|
|
23352
|
+
children: [((_e = config.formConfig) == null ? void 0 : _e.formDesc) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
23280
23353
|
className: FormDescStyle,
|
|
23281
|
-
children: (
|
|
23354
|
+
children: (_f = config.formConfig) == null ? void 0 : _f.formDesc
|
|
23282
23355
|
}) : void 0, formEle]
|
|
23283
23356
|
});
|
|
23284
23357
|
}
|
|
@@ -23316,7 +23389,8 @@ const RefineFormPage = (props) => {
|
|
|
23316
23389
|
className: "c1pvtlkp",
|
|
23317
23390
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(RefineFormContent, {
|
|
23318
23391
|
config,
|
|
23319
|
-
formResult
|
|
23392
|
+
formResult,
|
|
23393
|
+
action
|
|
23320
23394
|
}), ";", /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
23321
23395
|
...saveButtonProps,
|
|
23322
23396
|
onClick,
|
package/dist/refine.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b6, bK, A, az, aB, aj, bm, aJ, G, bA, bo, at, w, C, g, bO, am, aN, Y, bQ, a0, a7, bZ, ab, bp, bn, c0, ap, aT, t, ah, aY, b$, bL, b0, D, aG, b2, b_, aH, ax, b9, bN, bP, by, ak, a1, p, o, bR, I, aQ, aw, q, bq, bT, ao, aP, ac, ad, T, ae, aA, ai, aZ, b1, U, M, bz, b5, N, H, b, ay, O, b8, aV, aU, bS, bk, e, bs, V, P, aL, s, Z, bj, aI, bX, bW, aE, aR, n, an, aK, v, aS, aF, c4, bM, b3, ba, bb, al, R, $, a5, a4, b4, a2, bY, a3, a8, f, bF, bI, bE, bD, bG, bH, bB, bt, bw, bx, bv, bu, br, bc, aq, aO, af, k, bf, i, aC, c3, m, bg, aD, l, av, aM, h, c2, as, au, aX, aW, ar, S, a$, a_, c1, bC, bl, bh, bi, X, bV, _, W, bU, a6, aa, a9, c, bJ, ag, bd, x, J, d, Q, L, K, r, a, z, y, B, E, b7, F, be, u } from "./index-
|
|
1
|
+
import { b6, bK, A, az, aB, aj, bm, aJ, G, bA, bo, at, w, C, g, bO, am, aN, Y, bQ, a0, a7, bZ, ab, bp, bn, c0, ap, aT, t, ah, aY, b$, bL, b0, D, aG, b2, b_, aH, ax, b9, bN, bP, by, ak, a1, p, o, bR, I, aQ, aw, q, bq, bT, ao, aP, ac, ad, T, ae, aA, ai, aZ, b1, U, M, bz, b5, N, H, b, ay, O, b8, aV, aU, bS, bk, e, bs, V, P, aL, s, Z, bj, aI, bX, bW, aE, aR, n, an, aK, v, aS, aF, c4, bM, b3, ba, bb, al, R, $, a5, a4, b4, a2, bY, a3, a8, f, bF, bI, bE, bD, bG, bH, bB, bt, bw, bx, bv, bu, br, bc, aq, aO, af, k, bf, i, aC, c3, m, bg, aD, l, av, aM, h, c2, as, au, aX, aW, ar, S, a$, a_, c1, bC, bl, bh, bi, X, bV, _, W, bU, a6, aa, a9, c, bJ, ag, bd, x, J, d, Q, L, K, r, a, z, y, B, E, b7, F, be, u } from "./index-c644b7e1.js";
|
|
2
2
|
import "@cloudtower/eagle";
|
|
3
3
|
import "@refinedev/core";
|
|
4
4
|
import "@cloudtower/icons-react";
|