@dovetail-v2/refine 0.0.25 → 0.0.26
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-09dd38a4.js → MonacoYamlDiffEditor-7505595f.js} +12 -6
- package/dist/{index-9ad8e030.js → index-d02782c8.js} +1380 -732
- package/dist/refine.js +2 -2
- package/dist/refine.umd.cjs +1439 -780
- package/dist/style.css +54 -54
- 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/index.js +4 -0
- 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.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/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.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.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 +18 -0
- package/lib/src/index.js +12 -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 +2 -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/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.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/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
package/dist/refine.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global2, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("i18next"), require("@refinedev/core"), require("qs"), require("react"), require("react-router-dom"), require("@cloudtower/eagle"), require("js-yaml"), require("lodash-es"), require("sunflower-antd"), require("@cloudtower/icons-react"), require("
|
|
3
|
-
})(this, function(exports2, i18n, core, qs, React, reactRouterDom, eagle, yaml, lodashEs, sunflowerAntd, iconsReact,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("i18next"), require("@refinedev/core"), require("qs"), require("react"), require("react-router-dom"), require("@cloudtower/eagle"), require("js-yaml"), require("lodash-es"), require("sunflower-antd"), require("@cloudtower/icons-react"), require("monaco-editor"), require("monaco-yaml"), require("react-dom"), require("antd"), require("k8s-api-provider")) : typeof define === "function" && define.amd ? define(["exports", "i18next", "@refinedev/core", "qs", "react", "react-router-dom", "@cloudtower/eagle", "js-yaml", "lodash-es", "sunflower-antd", "@cloudtower/icons-react", "monaco-editor", "monaco-yaml", "react-dom", "antd", "k8s-api-provider"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.dovetail = {}, global2.i18n, global2.core, global2.qs, global2.React, global2.reactRouterDom, global2.eagle, global2.yaml, global2.lodashEs, global2.sunflowerAntd, global2.iconsReact, global2.monaco, global2.monacoYaml, global2.ReactDOM, global2.antd, global2.k8sApiProvider));
|
|
3
|
+
})(this, function(exports2, i18n, core, qs, React, reactRouterDom, eagle, yaml, lodashEs, sunflowerAntd, iconsReact, monaco, monacoYaml, ReactDOM, antd, k8sApiProvider) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => {
|
|
@@ -1228,24 +1228,30 @@ var __publicField = (obj, key, value) => {
|
|
|
1228
1228
|
go: () => {
|
|
1229
1229
|
const { search: existingSearch, hash: existingHash } = reactRouterDom.useLocation();
|
|
1230
1230
|
const history = reactRouterDom.useHistory();
|
|
1231
|
-
const fn = React.useCallback(
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1231
|
+
const fn = React.useCallback(
|
|
1232
|
+
({ to, type: type2, query, hash, options: { keepQuery, keepHash } = {} }) => {
|
|
1233
|
+
const urlQuery = {
|
|
1234
|
+
...keepQuery && existingSearch && qs.parse(existingSearch, { ignoreQueryPrefix: true }),
|
|
1235
|
+
...query
|
|
1236
|
+
};
|
|
1237
|
+
if (urlQuery.to) {
|
|
1238
|
+
urlQuery.to = encodeURIComponent(`${urlQuery.to}`);
|
|
1239
|
+
}
|
|
1240
|
+
const hasUrlQuery = Object.keys(urlQuery).length > 0;
|
|
1241
|
+
const urlHash = `#${(hash || keepHash && existingHash || "").replace(
|
|
1242
|
+
/^#/,
|
|
1243
|
+
""
|
|
1244
|
+
)}`;
|
|
1245
|
+
const hasUrlHash = urlHash.length > 1;
|
|
1246
|
+
const urlTo = to || "";
|
|
1247
|
+
const fullPath = `${urlTo}${hasUrlQuery ? qs.stringify(urlQuery, stringifyConfig) : ""}${hasUrlHash ? urlHash : ""}`;
|
|
1248
|
+
if (type2 === "path") {
|
|
1249
|
+
return fullPath;
|
|
1250
|
+
}
|
|
1251
|
+
return history[type2 || "push"](fullPath);
|
|
1252
|
+
},
|
|
1253
|
+
[existingHash, existingSearch, history]
|
|
1254
|
+
);
|
|
1249
1255
|
return fn;
|
|
1250
1256
|
},
|
|
1251
1257
|
back: () => {
|
|
@@ -1290,13 +1296,20 @@ var __publicField = (obj, key, value) => {
|
|
|
1290
1296
|
return fn;
|
|
1291
1297
|
},
|
|
1292
1298
|
Link: React.forwardRef(function RefineLink(props, ref) {
|
|
1293
|
-
return jsxRuntimeExports.jsx(reactRouterDom.Link, { ...props, ref });
|
|
1299
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Link, { ...props, ref });
|
|
1294
1300
|
})
|
|
1295
1301
|
};
|
|
1296
1302
|
function useK8sYamlEditor() {
|
|
1297
1303
|
const foldSymbol = React.useCallback(function(editor, symbol) {
|
|
1298
1304
|
const model = editor.getModel();
|
|
1299
|
-
const matchs = (model == null ? void 0 : model.findMatches(
|
|
1305
|
+
const matchs = (model == null ? void 0 : model.findMatches(
|
|
1306
|
+
symbol,
|
|
1307
|
+
false,
|
|
1308
|
+
false,
|
|
1309
|
+
false,
|
|
1310
|
+
"",
|
|
1311
|
+
false
|
|
1312
|
+
).filter((match) => match.range.startColumn === 1)) || [];
|
|
1300
1313
|
return new Promise(async (resolve, reject) => {
|
|
1301
1314
|
try {
|
|
1302
1315
|
for (const match of matchs) {
|
|
@@ -6832,14 +6845,19 @@ var __publicField = (obj, key, value) => {
|
|
|
6832
6845
|
if (!schema.minItems || !schema.items || typeof schema.items === "boolean" || Array.isArray(schema.items)) {
|
|
6833
6846
|
return (generateValue == null ? void 0 : generateValue(schema)) || [];
|
|
6834
6847
|
}
|
|
6835
|
-
return new Array(schema.minItems).fill(
|
|
6848
|
+
return new Array(schema.minItems).fill(
|
|
6849
|
+
generateValueFromSchema(schema.items, options)
|
|
6850
|
+
);
|
|
6836
6851
|
case schema.type === "number":
|
|
6837
6852
|
case schema.type === "integer":
|
|
6838
6853
|
return (generateValue == null ? void 0 : generateValue(schema)) || 0;
|
|
6839
6854
|
case schema.type === "object": {
|
|
6840
6855
|
const obj = {};
|
|
6841
6856
|
for (const key in schema.properties) {
|
|
6842
|
-
obj[key] = generateValueFromSchema(
|
|
6857
|
+
obj[key] = generateValueFromSchema(
|
|
6858
|
+
schema.properties[key],
|
|
6859
|
+
options
|
|
6860
|
+
);
|
|
6843
6861
|
}
|
|
6844
6862
|
return obj;
|
|
6845
6863
|
}
|
|
@@ -6922,22 +6940,27 @@ var __publicField = (obj, key, value) => {
|
|
|
6922
6940
|
}
|
|
6923
6941
|
class K8sOpenAPI {
|
|
6924
6942
|
constructor(resourceBasePath) {
|
|
6925
|
-
__publicField(this, "resourceBasePath");
|
|
6926
6943
|
__publicField(this, "response", null);
|
|
6927
6944
|
__publicField(this, "apiVersion");
|
|
6928
6945
|
this.resourceBasePath = resourceBasePath;
|
|
6929
6946
|
this.apiVersion = getApiVersion(resourceBasePath);
|
|
6930
6947
|
}
|
|
6931
6948
|
async fetch() {
|
|
6932
|
-
const response = await fetch(
|
|
6949
|
+
const response = await fetch(
|
|
6950
|
+
`/api/sks/api/v1/clusters/sks-mgmt/proxy/openapi/v3${this.resourceBasePath}`
|
|
6951
|
+
);
|
|
6933
6952
|
return response.json();
|
|
6934
6953
|
}
|
|
6935
6954
|
async findSchema(kind) {
|
|
6936
6955
|
const result = this.response || await this.fetch();
|
|
6937
|
-
const schema = Object.values(result.components.schemas).find(
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6956
|
+
const schema = Object.values(result.components.schemas).find(
|
|
6957
|
+
(schema2) => {
|
|
6958
|
+
var _a;
|
|
6959
|
+
return (_a = schema2["x-kubernetes-group-version-kind"]) == null ? void 0 : _a.some(
|
|
6960
|
+
({ kind: schemaKind, version: schemaVersion, group: schemaGroup }) => kind === schemaKind && this.apiVersion === `${schemaGroup ? schemaGroup + "/" : ""}${schemaVersion}`
|
|
6961
|
+
);
|
|
6962
|
+
}
|
|
6963
|
+
);
|
|
6941
6964
|
if (schema) {
|
|
6942
6965
|
resolveRef(schema, result.components.schemas, {
|
|
6943
6966
|
prune: {
|
|
@@ -6959,10 +6982,13 @@ var __publicField = (obj, key, value) => {
|
|
|
6959
6982
|
const [error, setError] = React.useState(null);
|
|
6960
6983
|
const useResourceResult = core.useResource();
|
|
6961
6984
|
const resource = (options == null ? void 0 : options.resource) || useResourceResult.resource;
|
|
6962
|
-
const openapi = React.useMemo(
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6985
|
+
const openapi = React.useMemo(
|
|
6986
|
+
() => {
|
|
6987
|
+
var _a2;
|
|
6988
|
+
return new K8sOpenAPI((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.resourceBasePath);
|
|
6989
|
+
},
|
|
6990
|
+
[(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.resourceBasePath]
|
|
6991
|
+
);
|
|
6966
6992
|
const fetchSchema = React.useCallback(async () => {
|
|
6967
6993
|
var _a2;
|
|
6968
6994
|
setLoading(true);
|
|
@@ -7013,7 +7039,10 @@ var __publicField = (obj, key, value) => {
|
|
|
7013
7039
|
for (const key in obj2) {
|
|
7014
7040
|
if (key in obj1) {
|
|
7015
7041
|
if (lodashEs.isObject(obj2[key]) && lodashEs.isObject(obj1[key])) {
|
|
7016
|
-
merged2[key] = merge(
|
|
7042
|
+
merged2[key] = merge(
|
|
7043
|
+
obj1[key],
|
|
7044
|
+
obj2[key]
|
|
7045
|
+
);
|
|
7017
7046
|
}
|
|
7018
7047
|
} else {
|
|
7019
7048
|
merged2 = {
|
|
@@ -7032,7 +7061,35 @@ var __publicField = (obj, key, value) => {
|
|
|
7032
7061
|
const useGlobalStore = () => {
|
|
7033
7062
|
return React.useContext(GlobalStoreContext);
|
|
7034
7063
|
};
|
|
7035
|
-
const useEagleForm = ({
|
|
7064
|
+
const useEagleForm = ({
|
|
7065
|
+
action,
|
|
7066
|
+
resource,
|
|
7067
|
+
onMutationSuccess: onMutationSuccessProp,
|
|
7068
|
+
onMutationError,
|
|
7069
|
+
submitOnEnter = false,
|
|
7070
|
+
warnWhenUnsavedChanges: warnWhenUnsavedChangesProp,
|
|
7071
|
+
redirect,
|
|
7072
|
+
successNotification,
|
|
7073
|
+
errorNotification,
|
|
7074
|
+
meta,
|
|
7075
|
+
metaData,
|
|
7076
|
+
queryMeta,
|
|
7077
|
+
mutationMeta,
|
|
7078
|
+
liveMode,
|
|
7079
|
+
liveParams,
|
|
7080
|
+
mutationMode,
|
|
7081
|
+
dataProviderName,
|
|
7082
|
+
onLiveEvent,
|
|
7083
|
+
invalidates,
|
|
7084
|
+
undoableTimeout,
|
|
7085
|
+
queryOptions,
|
|
7086
|
+
createMutationOptions,
|
|
7087
|
+
updateMutationOptions,
|
|
7088
|
+
id: idFromProps,
|
|
7089
|
+
overtimeOptions,
|
|
7090
|
+
editorOptions,
|
|
7091
|
+
initialValuesForCreate
|
|
7092
|
+
} = {}) => {
|
|
7036
7093
|
var _a, _b, _c;
|
|
7037
7094
|
const editor = React.useRef(null);
|
|
7038
7095
|
const isFoldRef = React.useRef(false);
|
|
@@ -7045,7 +7102,12 @@ var __publicField = (obj, key, value) => {
|
|
|
7045
7102
|
const useResourceResult = core.useResource();
|
|
7046
7103
|
const { globalStore } = useGlobalStore();
|
|
7047
7104
|
const kit = eagle.useUIKit();
|
|
7048
|
-
const {
|
|
7105
|
+
const {
|
|
7106
|
+
schema,
|
|
7107
|
+
loading: isLoadingSchema,
|
|
7108
|
+
error: loadSchemaError,
|
|
7109
|
+
fetchSchema
|
|
7110
|
+
} = useSchema({
|
|
7049
7111
|
skip: editorOptions == null ? void 0 : editorOptions.isSkipSchema
|
|
7050
7112
|
});
|
|
7051
7113
|
const [formAnt] = kit.form.useForm();
|
|
@@ -7259,21 +7321,21 @@ var __publicField = (obj, key, value) => {
|
|
|
7259
7321
|
return result.join(" ");
|
|
7260
7322
|
};
|
|
7261
7323
|
var cx_default = cx;
|
|
7262
|
-
const
|
|
7263
|
-
const BreadcrumbStyle = "
|
|
7324
|
+
const index_hex8jv = "";
|
|
7325
|
+
const BreadcrumbStyle = "b142d7q8";
|
|
7264
7326
|
function Breadcrumb(props) {
|
|
7265
7327
|
const {
|
|
7266
7328
|
breadcrumbs
|
|
7267
7329
|
} = core.useBreadcrumb();
|
|
7268
|
-
return jsxRuntimeExports.jsx("ul", {
|
|
7330
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
|
|
7269
7331
|
className: cx_default(BreadcrumbStyle, props.className),
|
|
7270
7332
|
children: breadcrumbs.map((breadcrumb) => {
|
|
7271
|
-
return jsxRuntimeExports.jsx("li", {
|
|
7333
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
|
|
7272
7334
|
className: "breadcrumb-item",
|
|
7273
|
-
children: breadcrumb.href ? jsxRuntimeExports.jsx(reactRouterDom.Link, {
|
|
7335
|
+
children: breadcrumb.href ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Link, {
|
|
7274
7336
|
to: breadcrumb.href,
|
|
7275
7337
|
children: breadcrumb.label
|
|
7276
|
-
}) : jsxRuntimeExports.jsx("span", {
|
|
7338
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
7277
7339
|
children: breadcrumb.label
|
|
7278
7340
|
})
|
|
7279
7341
|
}, `breadcrumb-${breadcrumb.label}`);
|
|
@@ -7283,7 +7345,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7283
7345
|
function NameInputWidget(props) {
|
|
7284
7346
|
const kit = eagle.useUIKit();
|
|
7285
7347
|
const { action } = core.useResource();
|
|
7286
|
-
return jsxRuntimeExports.jsx(kit.input, { ...props, disabled: action === "edit" });
|
|
7348
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.input, { ...props, disabled: action === "edit" });
|
|
7287
7349
|
}
|
|
7288
7350
|
const dnsSubDomainRules = [
|
|
7289
7351
|
{
|
|
@@ -7337,7 +7399,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7337
7399
|
kind: "Namespace"
|
|
7338
7400
|
}
|
|
7339
7401
|
});
|
|
7340
|
-
return jsxRuntimeExports.jsx(kit.select, { input: props, disabled: action === "edit", children: data2 == null ? void 0 : data2.data.map((namespace2) => jsxRuntimeExports.jsx(kit.option, { value: namespace2.metadata.name, children: namespace2.metadata.name }, namespace2.metadata.name)) });
|
|
7402
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.select, { input: props, disabled: action === "edit", children: data2 == null ? void 0 : data2.data.map((namespace2) => /* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, { value: namespace2.metadata.name, children: namespace2.metadata.name }, namespace2.metadata.name)) });
|
|
7341
7403
|
}
|
|
7342
7404
|
const namespaceRules = [
|
|
7343
7405
|
{
|
|
@@ -7348,23 +7410,33 @@ var __publicField = (obj, key, value) => {
|
|
|
7348
7410
|
function KeyValueInput(props) {
|
|
7349
7411
|
const { children, item } = props;
|
|
7350
7412
|
const kit = eagle.useUIKit();
|
|
7351
|
-
const onKeyChange = React.useCallback(
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7413
|
+
const onKeyChange = React.useCallback(
|
|
7414
|
+
(event2) => {
|
|
7415
|
+
var _a;
|
|
7416
|
+
const key = event2.target.value;
|
|
7417
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
7418
|
+
...item,
|
|
7419
|
+
key
|
|
7420
|
+
});
|
|
7421
|
+
},
|
|
7422
|
+
[item, props]
|
|
7423
|
+
);
|
|
7424
|
+
const onValueChange = React.useCallback(
|
|
7425
|
+
(event2) => {
|
|
7426
|
+
var _a;
|
|
7427
|
+
const value = event2.target.value;
|
|
7428
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
7429
|
+
...item,
|
|
7430
|
+
value
|
|
7431
|
+
});
|
|
7432
|
+
},
|
|
7433
|
+
[item, props]
|
|
7434
|
+
);
|
|
7435
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { children: [
|
|
7436
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.input, { value: item.key, onChange: onKeyChange }),
|
|
7437
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.textArea, { value: item.value, onChange: onValueChange }),
|
|
7438
|
+
children
|
|
7439
|
+
] });
|
|
7368
7440
|
}
|
|
7369
7441
|
function KeyValueListWidget(props) {
|
|
7370
7442
|
const kit = eagle.useUIKit();
|
|
@@ -7375,35 +7447,72 @@ var __publicField = (obj, key, value) => {
|
|
|
7375
7447
|
value: value2
|
|
7376
7448
|
}));
|
|
7377
7449
|
}, [value]);
|
|
7378
|
-
const onChange = React.useCallback(
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
result
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7450
|
+
const onChange = React.useCallback(
|
|
7451
|
+
(newItems) => {
|
|
7452
|
+
var _a;
|
|
7453
|
+
const newValue = newItems.reduce((result, item) => {
|
|
7454
|
+
result[item.key] = item.value;
|
|
7455
|
+
return result;
|
|
7456
|
+
}, {});
|
|
7457
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, newValue);
|
|
7458
|
+
},
|
|
7459
|
+
[props]
|
|
7460
|
+
);
|
|
7461
|
+
const onRemove = React.useCallback(
|
|
7462
|
+
(index) => {
|
|
7463
|
+
const result = [...items];
|
|
7464
|
+
result.splice(index, 1);
|
|
7465
|
+
onChange(result);
|
|
7466
|
+
},
|
|
7467
|
+
[onChange, items]
|
|
7468
|
+
);
|
|
7391
7469
|
const onAdd = React.useCallback(() => {
|
|
7392
7470
|
onChange([...items, { key: "", value: "" }]);
|
|
7393
7471
|
}, [onChange, items]);
|
|
7394
|
-
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7472
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7473
|
+
items.map((item, index) => {
|
|
7474
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7475
|
+
KeyValueInput,
|
|
7476
|
+
{
|
|
7477
|
+
item,
|
|
7478
|
+
onChange: (newItem) => {
|
|
7479
|
+
const temp = [...items];
|
|
7480
|
+
temp.splice(index, 1, newItem);
|
|
7481
|
+
onChange(temp);
|
|
7482
|
+
},
|
|
7483
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7484
|
+
kit.button,
|
|
7485
|
+
{
|
|
7486
|
+
onClick: () => {
|
|
7487
|
+
onRemove(index);
|
|
7488
|
+
},
|
|
7489
|
+
danger: true,
|
|
7490
|
+
children: "Remove"
|
|
7491
|
+
}
|
|
7492
|
+
)
|
|
7493
|
+
},
|
|
7494
|
+
index
|
|
7495
|
+
);
|
|
7496
|
+
}),
|
|
7497
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", onClick: onAdd, children: "Add" }) })
|
|
7498
|
+
] });
|
|
7403
7499
|
}
|
|
7404
7500
|
function MetadataForm() {
|
|
7405
7501
|
const kit = eagle.useUIKit();
|
|
7406
|
-
return
|
|
7502
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7503
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { label: "Name", name: ["metadata", "name"], rules: rfc1123LabelRules, children: /* @__PURE__ */ jsxRuntimeExports.jsx(NameInputWidget, {}) }),
|
|
7504
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7505
|
+
kit.form.Item,
|
|
7506
|
+
{
|
|
7507
|
+
label: "Namespace",
|
|
7508
|
+
name: ["metadata", "namespace"],
|
|
7509
|
+
rules: namespaceRules,
|
|
7510
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(NamespaceSelectWidget, {})
|
|
7511
|
+
}
|
|
7512
|
+
),
|
|
7513
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { name: ["metadata", "labels"], label: "Labels", children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueListWidget, {}) }),
|
|
7514
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { name: ["metadata", "annotations"], label: "Annotations", children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueListWidget, {}) })
|
|
7515
|
+
] });
|
|
7407
7516
|
}
|
|
7408
7517
|
function addId(arr, idKey) {
|
|
7409
7518
|
return arr.map((e) => {
|
|
@@ -7413,9 +7522,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7413
7522
|
};
|
|
7414
7523
|
});
|
|
7415
7524
|
}
|
|
7416
|
-
const
|
|
7417
|
-
const ErrorWrapper$1 = "
|
|
7418
|
-
const ErrorContent$1 = "
|
|
7525
|
+
const ErrorContent_1t51xnx = "";
|
|
7526
|
+
const ErrorWrapper$1 = "eckm4od";
|
|
7527
|
+
const ErrorContent$1 = "e1hl982n";
|
|
7419
7528
|
const WidgetErrorContent$1 = (props) => {
|
|
7420
7529
|
const {
|
|
7421
7530
|
refetch
|
|
@@ -7424,15 +7533,15 @@ var __publicField = (obj, key, value) => {
|
|
|
7424
7533
|
const {
|
|
7425
7534
|
t
|
|
7426
7535
|
} = useTranslation();
|
|
7427
|
-
return jsxRuntimeExports.jsx("div", {
|
|
7536
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
7428
7537
|
className: ErrorWrapper$1,
|
|
7429
7538
|
style: props.style,
|
|
7430
|
-
children: jsxRuntimeExports.jsxs("div", {
|
|
7539
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
7431
7540
|
className: ErrorContent$1,
|
|
7432
|
-
children: [jsxRuntimeExports.jsx("p", {
|
|
7541
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("p", {
|
|
7433
7542
|
className: cx_default(eagle.Typo.Label.l1_regular_title, "title"),
|
|
7434
7543
|
children: props.errorText || t("dovetail.obtain_data_error")
|
|
7435
|
-
}), refetch ? jsxRuntimeExports.jsx(kit.button, {
|
|
7544
|
+
}), refetch ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
7436
7545
|
type: "ordinary",
|
|
7437
7546
|
onClick: (e) => {
|
|
7438
7547
|
e.stopPropagation();
|
|
@@ -7736,14 +7845,33 @@ var __publicField = (obj, key, value) => {
|
|
|
7736
7845
|
var dayjs_minExports = dayjs_min.exports;
|
|
7737
7846
|
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
7738
7847
|
const Time = (props) => {
|
|
7739
|
-
const {
|
|
7848
|
+
const {
|
|
7849
|
+
className,
|
|
7850
|
+
date,
|
|
7851
|
+
dateTemplate = "YYYY-MM-DD",
|
|
7852
|
+
timeTemplate = "HH:mm",
|
|
7853
|
+
plainText
|
|
7854
|
+
} = props;
|
|
7740
7855
|
if (!date)
|
|
7741
|
-
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "-" });
|
|
7856
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "-" });
|
|
7742
7857
|
const time = dayjs(date);
|
|
7743
7858
|
if (plainText) {
|
|
7744
|
-
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7859
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7860
|
+
dateTemplate !== null && time.format(dateTemplate),
|
|
7861
|
+
" ",
|
|
7862
|
+
timeTemplate !== null && time.format(timeTemplate)
|
|
7863
|
+
] });
|
|
7745
7864
|
}
|
|
7746
|
-
return jsxRuntimeExports.jsxs("span", { className: `time-wrapper ${className || ""}`, children: [
|
|
7865
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: `time-wrapper ${className || ""}`, children: [
|
|
7866
|
+
dateTemplate !== null && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "date", children: [
|
|
7867
|
+
" ",
|
|
7868
|
+
time.format(dateTemplate)
|
|
7869
|
+
] }),
|
|
7870
|
+
timeTemplate !== null && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "time", children: [
|
|
7871
|
+
" ",
|
|
7872
|
+
time.format(timeTemplate)
|
|
7873
|
+
] })
|
|
7874
|
+
] });
|
|
7747
7875
|
};
|
|
7748
7876
|
const ConditionsTable = ({ conditions = [] }) => {
|
|
7749
7877
|
const kit = eagle.useUIKit();
|
|
@@ -7779,7 +7907,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7779
7907
|
sortable: true,
|
|
7780
7908
|
render: (value, record) => {
|
|
7781
7909
|
const time = value || record.lastTransitionTime;
|
|
7782
|
-
return jsxRuntimeExports.jsx(Time, { date: new Date(time) });
|
|
7910
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: new Date(time) });
|
|
7783
7911
|
}
|
|
7784
7912
|
},
|
|
7785
7913
|
{
|
|
@@ -7791,9 +7919,18 @@ var __publicField = (obj, key, value) => {
|
|
|
7791
7919
|
}
|
|
7792
7920
|
];
|
|
7793
7921
|
if (conditionsWithId.length === 0) {
|
|
7794
|
-
return jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
7922
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
7795
7923
|
}
|
|
7796
|
-
return jsxRuntimeExports.jsx(
|
|
7924
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7925
|
+
kit.table,
|
|
7926
|
+
{
|
|
7927
|
+
loading: false,
|
|
7928
|
+
dataSource: conditionsWithId,
|
|
7929
|
+
columns,
|
|
7930
|
+
rowKey: "type",
|
|
7931
|
+
empty: t("dovetail.empty")
|
|
7932
|
+
}
|
|
7933
|
+
);
|
|
7797
7934
|
};
|
|
7798
7935
|
function memoize(fn) {
|
|
7799
7936
|
var cache = /* @__PURE__ */ Object.create(null);
|
|
@@ -7912,14 +8049,14 @@ var __publicField = (obj, key, value) => {
|
|
|
7912
8049
|
return o(prop);
|
|
7913
8050
|
}
|
|
7914
8051
|
}) : styled;
|
|
7915
|
-
const
|
|
8052
|
+
const TableWidgets_ny30pi = "";
|
|
7916
8053
|
const AuxiliaryLine = /* @__PURE__ */ styled_default("div")({
|
|
7917
8054
|
name: "AuxiliaryLine",
|
|
7918
|
-
class: "
|
|
8055
|
+
class: "ax1qopv",
|
|
7919
8056
|
propsAsIs: false
|
|
7920
8057
|
});
|
|
7921
|
-
const
|
|
7922
|
-
const TableContainerStyle = "
|
|
8058
|
+
const index_dmbxj3 = "";
|
|
8059
|
+
const TableContainerStyle = "t1upn1sz";
|
|
7923
8060
|
function Table(props) {
|
|
7924
8061
|
const kit = eagle.useUIKit();
|
|
7925
8062
|
const {
|
|
@@ -7955,7 +8092,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7955
8092
|
dataIndex: [],
|
|
7956
8093
|
title: "",
|
|
7957
8094
|
render: (_, record) => {
|
|
7958
|
-
return jsxRuntimeExports.jsx(RowMenu, {
|
|
8095
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RowMenu, {
|
|
7959
8096
|
record
|
|
7960
8097
|
});
|
|
7961
8098
|
}
|
|
@@ -7965,9 +8102,9 @@ var __publicField = (obj, key, value) => {
|
|
|
7965
8102
|
return columns;
|
|
7966
8103
|
}, [columns, RowMenu]);
|
|
7967
8104
|
if (loading) {
|
|
7968
|
-
return jsxRuntimeExports.jsx(kit.loading, {});
|
|
8105
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.loading, {});
|
|
7969
8106
|
} else if (error) {
|
|
7970
|
-
return jsxRuntimeExports.jsx(WidgetErrorContent$1, {
|
|
8107
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, {
|
|
7971
8108
|
errorText: t("dovetail.retry_when_access_data_failed"),
|
|
7972
8109
|
refetch,
|
|
7973
8110
|
style: {
|
|
@@ -7975,17 +8112,17 @@ var __publicField = (obj, key, value) => {
|
|
|
7975
8112
|
}
|
|
7976
8113
|
});
|
|
7977
8114
|
} else if (dataSource.length === 0) {
|
|
7978
|
-
return jsxRuntimeExports.jsx(WidgetErrorContent$1, {
|
|
8115
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, {
|
|
7979
8116
|
errorText: t("dovetail.empty"),
|
|
7980
8117
|
style: {
|
|
7981
8118
|
padding: "15px 0"
|
|
7982
8119
|
}
|
|
7983
8120
|
});
|
|
7984
8121
|
}
|
|
7985
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
8122
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
7986
8123
|
ref: wrapperRef,
|
|
7987
8124
|
className: cx_default(TableContainerStyle, props.className, "table-wrapper"),
|
|
7988
|
-
children: [jsxRuntimeExports.jsx(kit.table, {
|
|
8125
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.table, {
|
|
7989
8126
|
tableLayout: "fixed",
|
|
7990
8127
|
rowSelection: onSelect ? {
|
|
7991
8128
|
onChange: (keys, rows) => {
|
|
@@ -8000,9 +8137,9 @@ var __publicField = (obj, key, value) => {
|
|
|
8000
8137
|
rowKey,
|
|
8001
8138
|
wrapper: wrapperRef,
|
|
8002
8139
|
scroll
|
|
8003
|
-
}), jsxRuntimeExports.jsx(AuxiliaryLine, {
|
|
8140
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(AuxiliaryLine, {
|
|
8004
8141
|
ref: auxiliaryLineRef
|
|
8005
|
-
}), jsxRuntimeExports.jsx(kit.pagination, {
|
|
8142
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.pagination, {
|
|
8006
8143
|
current: currentPage,
|
|
8007
8144
|
size: currentSize,
|
|
8008
8145
|
count: dataSource.length,
|
|
@@ -9621,15 +9758,15 @@ var __publicField = (obj, key, value) => {
|
|
|
9621
9758
|
};
|
|
9622
9759
|
CloseCircleFilled.displayName = "CloseCircleFilled";
|
|
9623
9760
|
const CloseCircleFilled$1 = React__namespace.forwardRef(CloseCircleFilled);
|
|
9624
|
-
const
|
|
9761
|
+
const index_1kmu85y = "";
|
|
9625
9762
|
const ErrorWrapper = /* @__PURE__ */ styled_default("div")({
|
|
9626
9763
|
name: "ErrorWrapper",
|
|
9627
|
-
class: "
|
|
9764
|
+
class: "egn3dbn",
|
|
9628
9765
|
propsAsIs: false
|
|
9629
9766
|
});
|
|
9630
9767
|
const ErrorContent = /* @__PURE__ */ styled_default("div")({
|
|
9631
9768
|
name: "ErrorContent",
|
|
9632
|
-
class: "
|
|
9769
|
+
class: "e136jgy8",
|
|
9633
9770
|
propsAsIs: false
|
|
9634
9771
|
});
|
|
9635
9772
|
const WidgetErrorContent = (props) => {
|
|
@@ -9642,14 +9779,14 @@ var __publicField = (obj, key, value) => {
|
|
|
9642
9779
|
const {
|
|
9643
9780
|
t
|
|
9644
9781
|
} = useTranslation();
|
|
9645
|
-
return jsxRuntimeExports.jsx(ErrorWrapper, {
|
|
9782
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorWrapper, {
|
|
9646
9783
|
className: props.className,
|
|
9647
9784
|
style: props.style,
|
|
9648
|
-
children: jsxRuntimeExports.jsxs(ErrorContent, {
|
|
9649
|
-
children: [jsxRuntimeExports.jsx("p", {
|
|
9785
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ErrorContent, {
|
|
9786
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("p", {
|
|
9650
9787
|
className: cx_default(eagle.Typo.Label.l1_regular_title, "title"),
|
|
9651
9788
|
children: errorText || t("dovetail.obtain_data_error")
|
|
9652
|
-
}), hiddenRetry ? null : jsxRuntimeExports.jsx(kit.button, {
|
|
9789
|
+
}), hiddenRetry ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
9653
9790
|
size: "small",
|
|
9654
9791
|
type: "ordinary",
|
|
9655
9792
|
onClick: (e) => {
|
|
@@ -9664,11 +9801,23 @@ var __publicField = (obj, key, value) => {
|
|
|
9664
9801
|
function FormErrorAlert(props) {
|
|
9665
9802
|
const { errorMsgs, style, className } = props;
|
|
9666
9803
|
const kit = eagle.useUIKit();
|
|
9667
|
-
return errorMsgs.length ?
|
|
9804
|
+
return errorMsgs.length ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9805
|
+
kit.alert,
|
|
9806
|
+
{
|
|
9807
|
+
message: errorMsgs.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errorMsgs.map((errorMsg, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
|
|
9808
|
+
index + 1 + ". ",
|
|
9809
|
+
" ",
|
|
9810
|
+
errorMsg
|
|
9811
|
+
] }, errorMsg)) }) : lodashEs.first(errorMsgs),
|
|
9812
|
+
type: "error",
|
|
9813
|
+
style,
|
|
9814
|
+
className
|
|
9815
|
+
}
|
|
9816
|
+
) : null;
|
|
9668
9817
|
}
|
|
9669
|
-
const
|
|
9670
|
-
const WrapperStyle$3 = "
|
|
9671
|
-
const TitleStyle$1 = "
|
|
9818
|
+
const index_17v8shn = "";
|
|
9819
|
+
const WrapperStyle$3 = "w1akirqw";
|
|
9820
|
+
const TitleStyle$1 = "t30srnq";
|
|
9672
9821
|
function FormLayout(props) {
|
|
9673
9822
|
var _a;
|
|
9674
9823
|
const {
|
|
@@ -9682,13 +9831,13 @@ var __publicField = (obj, key, value) => {
|
|
|
9682
9831
|
const {
|
|
9683
9832
|
t
|
|
9684
9833
|
} = useTranslation();
|
|
9685
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
9834
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
9686
9835
|
className: WrapperStyle$3,
|
|
9687
|
-
children: [jsxRuntimeExports.jsxs("span", {
|
|
9836
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
9688
9837
|
className: cx_default(eagle.Typo.Display.d2_bold_title, TitleStyle$1),
|
|
9689
9838
|
children: [(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.kind, ":", " ", action === "create" ? t("dovetail.create") : t("dovetail.edit")]
|
|
9690
|
-
}), jsxRuntimeExports.jsx(kit.divider, {}), props.children, jsxRuntimeExports.jsx(kit.form.Item, {
|
|
9691
|
-
children: jsxRuntimeExports.jsx(kit.button, {
|
|
9839
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.divider, {}), props.children, /* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, {
|
|
9840
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
9692
9841
|
type: "primary",
|
|
9693
9842
|
...saveButtonProps,
|
|
9694
9843
|
children: t("dovetail.save")
|
|
@@ -9696,99 +9845,267 @@ var __publicField = (obj, key, value) => {
|
|
|
9696
9845
|
})]
|
|
9697
9846
|
});
|
|
9698
9847
|
}
|
|
9699
|
-
const
|
|
9700
|
-
const Style = "
|
|
9848
|
+
const index_12sfrn = "";
|
|
9849
|
+
const Style = "s1bsn3us";
|
|
9701
9850
|
const Separator = () => {
|
|
9702
|
-
return jsxRuntimeExports.jsx("div", {
|
|
9851
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
9703
9852
|
className: Style
|
|
9704
9853
|
});
|
|
9705
9854
|
};
|
|
9706
|
-
const
|
|
9707
|
-
const ToolBarStyle = "
|
|
9708
|
-
const ToolBarHeaderStyle = "
|
|
9709
|
-
const ErrorIconStyle = "
|
|
9710
|
-
const WrapperStyle$2 = "
|
|
9711
|
-
const TitleStyle = "
|
|
9712
|
-
const IconStyle = "
|
|
9713
|
-
const PlainCodeStyle = "
|
|
9714
|
-
const ErrorMsgStyle = "
|
|
9715
|
-
const ErrorWrapperStyle = "
|
|
9716
|
-
const YamlEditorStyle = "
|
|
9855
|
+
const style_inzxm5 = "";
|
|
9856
|
+
const ToolBarStyle = "t1joof7s";
|
|
9857
|
+
const ToolBarHeaderStyle = "tti58uh";
|
|
9858
|
+
const ErrorIconStyle = "e15yt16p";
|
|
9859
|
+
const WrapperStyle$2 = "w3ccqks";
|
|
9860
|
+
const TitleStyle = "t7zbd78";
|
|
9861
|
+
const IconStyle = "i1e4ouxy";
|
|
9862
|
+
const PlainCodeStyle = "pqch97v";
|
|
9863
|
+
const ErrorMsgStyle = "eh2qjnl";
|
|
9864
|
+
const ErrorWrapperStyle = "e19q2bnp";
|
|
9865
|
+
const YamlEditorStyle = "y16u5v3w";
|
|
9717
9866
|
const MonacoYamlEditor$2 = React.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$1));
|
|
9718
9867
|
const MonacoYamlDiffEditor$2 = React.lazy(() => Promise.resolve().then(() => MonacoYamlDiffEditor$1));
|
|
9719
|
-
const YamlEditorComponent = React.forwardRef(
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9868
|
+
const YamlEditorComponent = React.forwardRef(
|
|
9869
|
+
function YamlEditorComponent2(props, ref) {
|
|
9870
|
+
const {
|
|
9871
|
+
title,
|
|
9872
|
+
collapsable = true,
|
|
9873
|
+
isDefaultCollapsed,
|
|
9874
|
+
defaultValue = "",
|
|
9875
|
+
height,
|
|
9876
|
+
readOnly,
|
|
9877
|
+
errorMsgs = [],
|
|
9878
|
+
schema,
|
|
9879
|
+
eleRef,
|
|
9880
|
+
className
|
|
9881
|
+
} = props;
|
|
9882
|
+
const kit = eagle.useUIKit();
|
|
9883
|
+
const { t } = useTranslation();
|
|
9884
|
+
const [isCollapsed, setIsCollapsed] = React.useState(
|
|
9885
|
+
collapsable ? isDefaultCollapsed : false
|
|
9886
|
+
);
|
|
9887
|
+
const [isDiff, setIsDiff] = React.useState(false);
|
|
9888
|
+
const [value, setValue] = React.useState(defaultValue);
|
|
9889
|
+
const editorInstance = React.useRef();
|
|
9890
|
+
const [copyTooltip, setCopyTooltip] = React.useState(t("dovetail.copy"));
|
|
9891
|
+
const [resetTooltip, setResetTooltip] = React.useState(t("dovetail.reset_arguments"));
|
|
9892
|
+
React.useImperativeHandle(ref, () => {
|
|
9893
|
+
return {
|
|
9894
|
+
setValue,
|
|
9895
|
+
setEditorValue: (value2) => {
|
|
9896
|
+
var _a, _b;
|
|
9897
|
+
(_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(value2);
|
|
9898
|
+
},
|
|
9899
|
+
getEditorValue: () => {
|
|
9900
|
+
var _a;
|
|
9901
|
+
return ((_a = editorInstance.current) == null ? void 0 : _a.getValue()) ?? "";
|
|
9902
|
+
},
|
|
9903
|
+
getEditorInstance: () => editorInstance.current || null
|
|
9904
|
+
};
|
|
9905
|
+
});
|
|
9906
|
+
const onChange = React.useCallback(
|
|
9907
|
+
(newVal) => {
|
|
9908
|
+
var _a;
|
|
9909
|
+
setValue(newVal);
|
|
9910
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, newVal);
|
|
9735
9911
|
},
|
|
9736
|
-
|
|
9912
|
+
[props.onChange]
|
|
9913
|
+
);
|
|
9914
|
+
const onValidate = React.useCallback(
|
|
9915
|
+
(valid, schemaValid) => {
|
|
9737
9916
|
var _a;
|
|
9738
|
-
|
|
9917
|
+
(_a = props.onValidate) == null ? void 0 : _a.call(props, valid, schemaValid);
|
|
9739
9918
|
},
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9919
|
+
[props.onValidate]
|
|
9920
|
+
);
|
|
9921
|
+
const onEditorCreate = React.useCallback(
|
|
9922
|
+
(editor) => {
|
|
9923
|
+
var _a, _b, _c;
|
|
9924
|
+
if (editor.getValue() !== value) {
|
|
9925
|
+
(_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(value);
|
|
9926
|
+
}
|
|
9927
|
+
(_c = props.onEditorCreate) == null ? void 0 : _c.call(props, editor);
|
|
9928
|
+
},
|
|
9929
|
+
[value, props.onEditorCreate]
|
|
9930
|
+
);
|
|
9931
|
+
const getInstance = React.useCallback((ins) => {
|
|
9932
|
+
editorInstance.current = ins;
|
|
9933
|
+
}, []);
|
|
9934
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
9935
|
+
"div",
|
|
9936
|
+
{
|
|
9937
|
+
className: cx_default(WrapperStyle$2, className),
|
|
9938
|
+
"data-is-error": !!errorMsgs.length,
|
|
9939
|
+
ref: eleRef,
|
|
9940
|
+
children: [
|
|
9941
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
9942
|
+
kit.space,
|
|
9943
|
+
{
|
|
9944
|
+
className: cx_default(ToolBarStyle, isCollapsed ? "collapsed" : ""),
|
|
9945
|
+
direction: "vertical",
|
|
9946
|
+
size: 0,
|
|
9947
|
+
children: [
|
|
9948
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { className: ToolBarHeaderStyle, children: [
|
|
9949
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { size: 8, children: [
|
|
9950
|
+
collapsable && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9951
|
+
eagle.Icon,
|
|
9952
|
+
{
|
|
9953
|
+
src: iconsReact.HierarchyTriangleRight16GrayIcon,
|
|
9954
|
+
hoverSrc: iconsReact.HierarchyTriangleRight16BlueIcon,
|
|
9955
|
+
className: cx_default(IconStyle, isCollapsed ? "" : "arrow-down"),
|
|
9956
|
+
iconWidth: 16,
|
|
9957
|
+
iconHeight: 16,
|
|
9958
|
+
onClick: () => setIsCollapsed(!isCollapsed)
|
|
9959
|
+
}
|
|
9960
|
+
),
|
|
9961
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cx_default(TitleStyle, "yaml-editor-title"), children: title || t("dovetail.configure_file") })
|
|
9962
|
+
] }),
|
|
9963
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { size: 14, children: [
|
|
9964
|
+
isDiff ? void 0 : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
9965
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9966
|
+
kit.tooltip,
|
|
9967
|
+
{
|
|
9968
|
+
title: isCollapsed ? "" : copyTooltip,
|
|
9969
|
+
onVisibleChange: (visible) => {
|
|
9970
|
+
if (!visible) {
|
|
9971
|
+
setTimeout(() => {
|
|
9972
|
+
setCopyTooltip(t("dovetail.copy"));
|
|
9973
|
+
}, 80);
|
|
9974
|
+
}
|
|
9975
|
+
},
|
|
9976
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9977
|
+
eagle.Icon,
|
|
9978
|
+
{
|
|
9979
|
+
"data-disabled": isCollapsed,
|
|
9980
|
+
src: iconsReact.ClipboardCopy16GradientGrayIcon,
|
|
9981
|
+
hoverSrc: isCollapsed ? void 0 : iconsReact.ClipboardCopy16GradientBlueIcon,
|
|
9982
|
+
className: IconStyle,
|
|
9983
|
+
iconWidth: 16,
|
|
9984
|
+
iconHeight: 16,
|
|
9985
|
+
onClick: () => {
|
|
9986
|
+
if (!isCollapsed) {
|
|
9987
|
+
copyToClipboard(value);
|
|
9988
|
+
setCopyTooltip(t("dovetail.copied"));
|
|
9989
|
+
}
|
|
9990
|
+
}
|
|
9991
|
+
}
|
|
9992
|
+
)
|
|
9993
|
+
}
|
|
9994
|
+
),
|
|
9995
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {}),
|
|
9996
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9997
|
+
kit.tooltip,
|
|
9998
|
+
{
|
|
9999
|
+
title: isCollapsed ? "" : resetTooltip,
|
|
10000
|
+
onVisibleChange: (visible) => {
|
|
10001
|
+
if (!visible) {
|
|
10002
|
+
setTimeout(() => {
|
|
10003
|
+
setResetTooltip(t("dovetail.reset_arguments"));
|
|
10004
|
+
}, 80);
|
|
10005
|
+
}
|
|
10006
|
+
},
|
|
10007
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10008
|
+
eagle.Icon,
|
|
10009
|
+
{
|
|
10010
|
+
"data-disabled": isCollapsed,
|
|
10011
|
+
src: iconsReact.Retry16GradientGrayIcon,
|
|
10012
|
+
hoverSrc: isCollapsed ? void 0 : iconsReact.Retry16GradientBlueIcon,
|
|
10013
|
+
className: IconStyle,
|
|
10014
|
+
iconWidth: 16,
|
|
10015
|
+
iconHeight: 16,
|
|
10016
|
+
onClick: () => {
|
|
10017
|
+
var _a;
|
|
10018
|
+
if (!isCollapsed) {
|
|
10019
|
+
(_a = editorInstance.current) == null ? void 0 : _a.setValue(defaultValue);
|
|
10020
|
+
setResetTooltip(t("dovetail.already_reset"));
|
|
10021
|
+
}
|
|
10022
|
+
}
|
|
10023
|
+
}
|
|
10024
|
+
)
|
|
10025
|
+
}
|
|
10026
|
+
),
|
|
10027
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {})
|
|
10028
|
+
] }),
|
|
10029
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10030
|
+
kit.tooltip,
|
|
10031
|
+
{
|
|
10032
|
+
title: isCollapsed ? "" : isDiff ? t("dovetail.back_to_edit") : t("dovetail.view_changes"),
|
|
10033
|
+
children: isDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10034
|
+
eagle.Icon,
|
|
10035
|
+
{
|
|
10036
|
+
"data-disabled": isCollapsed,
|
|
10037
|
+
src: iconsReact.EditPen16GradientGrayIcon,
|
|
10038
|
+
hoverSrc: isCollapsed ? void 0 : iconsReact.EditPen16GradientBlueIcon,
|
|
10039
|
+
className: IconStyle,
|
|
10040
|
+
iconWidth: 16,
|
|
10041
|
+
iconHeight: 16,
|
|
10042
|
+
onClick: () => isCollapsed ? void 0 : setIsDiff(false)
|
|
10043
|
+
}
|
|
10044
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10045
|
+
eagle.Icon,
|
|
10046
|
+
{
|
|
10047
|
+
"data-disabled": isCollapsed,
|
|
10048
|
+
src: iconsReact.Showdiff16GradientGrayIcon,
|
|
10049
|
+
hoverSrc: isCollapsed ? void 0 : iconsReact.Showdiff16GradientBlueIcon,
|
|
10050
|
+
className: IconStyle,
|
|
10051
|
+
iconWidth: 16,
|
|
10052
|
+
iconHeight: 16,
|
|
10053
|
+
onClick: () => isCollapsed ? void 0 : setIsDiff(true)
|
|
10054
|
+
}
|
|
10055
|
+
)
|
|
10056
|
+
}
|
|
10057
|
+
)
|
|
10058
|
+
] })
|
|
10059
|
+
] }),
|
|
10060
|
+
errorMsgs.length ? /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { className: ErrorWrapperStyle, size: 8, align: "start", children: [
|
|
10061
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(iconsReact.XmarkFailedSeriousWarningFill16RedIcon, { className: ErrorIconStyle }),
|
|
10062
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: errorMsgs.map((errorMsg, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: ErrorMsgStyle, children: [
|
|
10063
|
+
errorMsgs.length > 1 ? `${index + 1}. ` : "",
|
|
10064
|
+
errorMsg
|
|
10065
|
+
] }, errorMsg)) })
|
|
10066
|
+
] }) : void 0
|
|
10067
|
+
]
|
|
10068
|
+
}
|
|
10069
|
+
),
|
|
10070
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10071
|
+
"div",
|
|
10072
|
+
{
|
|
10073
|
+
style: {
|
|
10074
|
+
display: isCollapsed ? "none" : "block",
|
|
10075
|
+
width: "100%",
|
|
10076
|
+
height: height || "500px",
|
|
10077
|
+
zIndex: 1
|
|
10078
|
+
},
|
|
10079
|
+
children: isDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: value }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10080
|
+
MonacoYamlDiffEditor$2,
|
|
10081
|
+
{
|
|
10082
|
+
id: props.id,
|
|
10083
|
+
origin: defaultValue,
|
|
10084
|
+
modified: value,
|
|
10085
|
+
height
|
|
10086
|
+
}
|
|
10087
|
+
) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: value }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10088
|
+
MonacoYamlEditor$2,
|
|
10089
|
+
{
|
|
10090
|
+
id: props.id,
|
|
10091
|
+
getInstance,
|
|
10092
|
+
defaultValue,
|
|
10093
|
+
height,
|
|
10094
|
+
onChange,
|
|
10095
|
+
onValidate,
|
|
10096
|
+
onEditorCreate,
|
|
10097
|
+
onBlur: props.onBlur,
|
|
10098
|
+
schema,
|
|
10099
|
+
readOnly
|
|
10100
|
+
}
|
|
10101
|
+
) })
|
|
10102
|
+
}
|
|
10103
|
+
)
|
|
10104
|
+
]
|
|
10105
|
+
}
|
|
10106
|
+
);
|
|
10107
|
+
}
|
|
10108
|
+
);
|
|
9792
10109
|
function copyToClipboard(text) {
|
|
9793
10110
|
const input = document.createElement("textarea");
|
|
9794
10111
|
input.value = text;
|
|
@@ -10015,42 +10332,51 @@ var __publicField = (obj, key, value) => {
|
|
|
10015
10332
|
params = info.params;
|
|
10016
10333
|
message2 = info.message;
|
|
10017
10334
|
} catch {
|
|
10018
|
-
return i18n2.t(
|
|
10335
|
+
return i18n2.t(
|
|
10336
|
+
[
|
|
10337
|
+
`error.${cause.reason}`,
|
|
10338
|
+
`error.${cause.code}`,
|
|
10339
|
+
`${message2}${cause.field ? `(${cause.field})` : ""}`
|
|
10340
|
+
],
|
|
10341
|
+
{
|
|
10342
|
+
...params,
|
|
10343
|
+
fallbackLng: ""
|
|
10344
|
+
}
|
|
10345
|
+
);
|
|
10346
|
+
}
|
|
10347
|
+
return i18n2.t(
|
|
10348
|
+
[
|
|
10019
10349
|
`error.${cause.reason}`,
|
|
10020
10350
|
`error.${cause.code}`,
|
|
10021
10351
|
`${message2}${cause.field ? `(${cause.field})` : ""}`
|
|
10022
|
-
],
|
|
10352
|
+
],
|
|
10353
|
+
{
|
|
10023
10354
|
...params,
|
|
10024
10355
|
fallbackLng: ""
|
|
10025
|
-
}
|
|
10026
|
-
|
|
10027
|
-
return i18n2.t([
|
|
10028
|
-
`error.${cause.reason}`,
|
|
10029
|
-
`error.${cause.code}`,
|
|
10030
|
-
`${message2}${cause.field ? `(${cause.field})` : ""}`
|
|
10031
|
-
], {
|
|
10032
|
-
...params,
|
|
10033
|
-
fallbackLng: ""
|
|
10034
|
-
});
|
|
10356
|
+
}
|
|
10357
|
+
);
|
|
10035
10358
|
});
|
|
10036
10359
|
}
|
|
10037
10360
|
return [
|
|
10038
|
-
i18n2.t(
|
|
10361
|
+
i18n2.t(
|
|
10362
|
+
[`error.${responseBody.code}`, `error.${responseBody.reason}`, responseBody.message || ""],
|
|
10363
|
+
{ fallbackLng: "" }
|
|
10364
|
+
)
|
|
10039
10365
|
];
|
|
10040
10366
|
}
|
|
10041
|
-
const
|
|
10042
|
-
const FormStyle = "
|
|
10043
|
-
const EditorStyle$1 = "
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
})(
|
|
10367
|
+
const index_1r3lc5t = "";
|
|
10368
|
+
const FormStyle = "f5ks0bl";
|
|
10369
|
+
const EditorStyle$1 = "e1tqaxpu";
|
|
10370
|
+
var SchemaStrategy = /* @__PURE__ */ ((SchemaStrategy2) => {
|
|
10371
|
+
SchemaStrategy2["Required"] = "Required";
|
|
10372
|
+
SchemaStrategy2["Optional"] = "Optional";
|
|
10373
|
+
SchemaStrategy2["None"] = "None";
|
|
10374
|
+
return SchemaStrategy2;
|
|
10375
|
+
})(SchemaStrategy || {});
|
|
10050
10376
|
function YamlForm(props) {
|
|
10051
10377
|
const {
|
|
10052
10378
|
id,
|
|
10053
|
-
schemaStrategy =
|
|
10379
|
+
schemaStrategy = "Optional",
|
|
10054
10380
|
isShowLayout = true,
|
|
10055
10381
|
onSaveButtonPropsChange
|
|
10056
10382
|
} = props;
|
|
@@ -10066,7 +10392,8 @@ var __publicField = (obj, key, value) => {
|
|
|
10066
10392
|
id,
|
|
10067
10393
|
action: id ? "edit" : "create",
|
|
10068
10394
|
editorOptions: {
|
|
10069
|
-
isSkipSchema: schemaStrategy ===
|
|
10395
|
+
isSkipSchema: schemaStrategy === "None"
|
|
10396
|
+
/* None */
|
|
10070
10397
|
},
|
|
10071
10398
|
liveMode: "off",
|
|
10072
10399
|
initialValuesForCreate: props.initialValues ?? BASE_INIT_VALUE
|
|
@@ -10089,9 +10416,9 @@ var __publicField = (obj, key, value) => {
|
|
|
10089
10416
|
React.useEffect(() => {
|
|
10090
10417
|
onSaveButtonPropsChange == null ? void 0 : onSaveButtonPropsChange(saveButtonProps);
|
|
10091
10418
|
}, [saveButtonProps, onSaveButtonPropsChange]);
|
|
10092
|
-
return jsxRuntimeExports.jsx(FormWrapper, {
|
|
10419
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormWrapper, {
|
|
10093
10420
|
saveButtonProps,
|
|
10094
|
-
children: jsxRuntimeExports.jsx(kit.form, {
|
|
10421
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.form, {
|
|
10095
10422
|
...formProps,
|
|
10096
10423
|
initialValues: formProps.initialValues,
|
|
10097
10424
|
layout: "horizontal",
|
|
@@ -10099,28 +10426,28 @@ var __publicField = (obj, key, value) => {
|
|
|
10099
10426
|
onFinish,
|
|
10100
10427
|
children: (() => {
|
|
10101
10428
|
if (isLoadingSchema) {
|
|
10102
|
-
return jsxRuntimeExports.jsx(kit.loading, {});
|
|
10429
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.loading, {});
|
|
10103
10430
|
}
|
|
10104
|
-
return editorProps.schema || schemaStrategy !==
|
|
10105
|
-
children: [jsxRuntimeExports.jsx(kit.form.Item, {
|
|
10431
|
+
return editorProps.schema || schemaStrategy !== "Required" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
10432
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, {
|
|
10106
10433
|
style: {
|
|
10107
10434
|
flex: 1
|
|
10108
10435
|
},
|
|
10109
|
-
children: jsxRuntimeExports.jsx(YamlEditorComponent, {
|
|
10436
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(YamlEditorComponent, {
|
|
10110
10437
|
...editorProps,
|
|
10111
10438
|
className: EditorStyle$1,
|
|
10112
10439
|
schema,
|
|
10113
10440
|
collapsable: false
|
|
10114
10441
|
})
|
|
10115
|
-
}), jsxRuntimeExports.jsx(kit.form.Item, {
|
|
10116
|
-
children: mutationResult.error && jsxRuntimeExports.jsx(FormErrorAlert, {
|
|
10442
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, {
|
|
10443
|
+
children: mutationResult.error && /* @__PURE__ */ jsxRuntimeExports.jsx(FormErrorAlert, {
|
|
10117
10444
|
errorMsgs: errorResponseBody ? responseErrors : [mutationResult.error.message],
|
|
10118
10445
|
style: {
|
|
10119
10446
|
marginBottom: 16
|
|
10120
10447
|
}
|
|
10121
10448
|
})
|
|
10122
10449
|
})]
|
|
10123
|
-
}) : jsxRuntimeExports.jsx(WidgetErrorContent, {
|
|
10450
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent, {
|
|
10124
10451
|
errorText: t("dovetail.fetch_schema_fail"),
|
|
10125
10452
|
refetch: fetchSchema
|
|
10126
10453
|
});
|
|
@@ -10129,8 +10456,8 @@ var __publicField = (obj, key, value) => {
|
|
|
10129
10456
|
});
|
|
10130
10457
|
}
|
|
10131
10458
|
const ConfigsContext = React.createContext({});
|
|
10132
|
-
const
|
|
10133
|
-
const FullscreenModalStyle = "
|
|
10459
|
+
const index_16ywf6g = "";
|
|
10460
|
+
const FullscreenModalStyle = "fbinl28";
|
|
10134
10461
|
function FormModal(props) {
|
|
10135
10462
|
const {
|
|
10136
10463
|
resource: resourceFromProps,
|
|
@@ -10161,12 +10488,12 @@ var __publicField = (obj, key, value) => {
|
|
|
10161
10488
|
const onFinish = React.useCallback(() => {
|
|
10162
10489
|
eagle.popModal();
|
|
10163
10490
|
}, []);
|
|
10164
|
-
return jsxRuntimeExports.jsx(kit.modal, {
|
|
10491
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.modal, {
|
|
10165
10492
|
className: FullscreenModalStyle,
|
|
10166
10493
|
width: "calc(100vw - 16px)",
|
|
10167
10494
|
title,
|
|
10168
10495
|
okButtonProps: saveButtonProps,
|
|
10169
|
-
closeIcon: jsxRuntimeExports.jsx(CloseCircleFilled$1, {}),
|
|
10496
|
+
closeIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(CloseCircleFilled$1, {}),
|
|
10170
10497
|
onOk,
|
|
10171
10498
|
onCancel,
|
|
10172
10499
|
destroyOnClose: true,
|
|
@@ -10177,7 +10504,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10177
10504
|
id,
|
|
10178
10505
|
onSaveButtonPropsChange: setSaveButtonProps,
|
|
10179
10506
|
onFinish
|
|
10180
|
-
}) : jsxRuntimeExports.jsx(YamlForm, {
|
|
10507
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(YamlForm, {
|
|
10181
10508
|
...formProps,
|
|
10182
10509
|
initialValues: (formProps == null ? void 0 : formProps.initialValues) || (config == null ? void 0 : config.initValue),
|
|
10183
10510
|
id,
|
|
@@ -10191,31 +10518,34 @@ var __publicField = (obj, key, value) => {
|
|
|
10191
10518
|
const { resource } = core.useParsed();
|
|
10192
10519
|
const go = core.useGo();
|
|
10193
10520
|
const navigation = core.useNavigation();
|
|
10194
|
-
const edit2 = React.useCallback(
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10521
|
+
const edit2 = React.useCallback(
|
|
10522
|
+
(id) => {
|
|
10523
|
+
go({
|
|
10524
|
+
to: navigation.editUrl((resource == null ? void 0 : resource.name) || "", id),
|
|
10525
|
+
query: {
|
|
10526
|
+
id
|
|
10527
|
+
},
|
|
10528
|
+
options: {
|
|
10529
|
+
keepQuery: true
|
|
10530
|
+
}
|
|
10531
|
+
});
|
|
10532
|
+
},
|
|
10533
|
+
[go, resource == null ? void 0 : resource.name]
|
|
10534
|
+
);
|
|
10205
10535
|
return { edit: edit2 };
|
|
10206
10536
|
}
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
})(
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
})(
|
|
10537
|
+
var RESOURCE_GROUP = /* @__PURE__ */ ((RESOURCE_GROUP2) => {
|
|
10538
|
+
RESOURCE_GROUP2["WORKLOAD"] = "WORKLOAD";
|
|
10539
|
+
RESOURCE_GROUP2["STORAGE"] = "STORAGE";
|
|
10540
|
+
RESOURCE_GROUP2["NETWORK"] = "NETWORK";
|
|
10541
|
+
RESOURCE_GROUP2["CLUSTER"] = "CLUSTER";
|
|
10542
|
+
return RESOURCE_GROUP2;
|
|
10543
|
+
})(RESOURCE_GROUP || {});
|
|
10544
|
+
var FormType = /* @__PURE__ */ ((FormType2) => {
|
|
10545
|
+
FormType2["PAGE"] = "PAGE";
|
|
10546
|
+
FormType2["MODAL"] = "MODAL";
|
|
10547
|
+
return FormType2;
|
|
10548
|
+
})(FormType || {});
|
|
10219
10549
|
function getInitialValues(config) {
|
|
10220
10550
|
return config.initValue || {
|
|
10221
10551
|
apiVersion: config.apiVersion,
|
|
@@ -10233,7 +10563,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10233
10563
|
return function openForm() {
|
|
10234
10564
|
if (resource == null ? void 0 : resource.name) {
|
|
10235
10565
|
const config = configs[resource.name];
|
|
10236
|
-
if (config.formType === void 0 || config.formType ===
|
|
10566
|
+
if (config.formType === void 0 || config.formType === FormType.MODAL) {
|
|
10237
10567
|
eagle.pushModal({
|
|
10238
10568
|
component: config.FormModal || FormModal,
|
|
10239
10569
|
props: {
|
|
@@ -10261,7 +10591,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10261
10591
|
const kit = eagle.useUIKit();
|
|
10262
10592
|
const { t } = useTranslation();
|
|
10263
10593
|
const openForm = useOpenForm();
|
|
10264
|
-
return jsxRuntimeExports.jsx(kit.button, { type: "primary", onClick: openForm, children: t("dovetail.create") });
|
|
10594
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", onClick: openForm, children: t("dovetail.create") });
|
|
10265
10595
|
}
|
|
10266
10596
|
const useDeleteManyModal = (resource, ids) => {
|
|
10267
10597
|
const { mutate } = core.useDeleteMany();
|
|
@@ -10295,33 +10625,39 @@ var __publicField = (obj, key, value) => {
|
|
|
10295
10625
|
const { resource } = core.useResource();
|
|
10296
10626
|
const kit = eagle.useUIKit();
|
|
10297
10627
|
const { t } = useTranslation();
|
|
10298
|
-
const { modalProps, visible, setVisible } = useDeleteManyModal(
|
|
10628
|
+
const { modalProps, visible, setVisible } = useDeleteManyModal(
|
|
10629
|
+
(resource == null ? void 0 : resource.name) || "",
|
|
10630
|
+
props.ids
|
|
10631
|
+
);
|
|
10299
10632
|
const onClick = React.useCallback(() => {
|
|
10300
10633
|
setVisible(true);
|
|
10301
10634
|
}, [setVisible]);
|
|
10302
|
-
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
10635
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
10636
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", danger: true, onClick, children: t("dovetail.delete") }),
|
|
10637
|
+
visible ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.modal, { ...modalProps }) : null
|
|
10638
|
+
] });
|
|
10303
10639
|
};
|
|
10304
|
-
const
|
|
10305
|
-
const ToolbarStyle$1 = "
|
|
10640
|
+
const TableToolBar_1a3t35p = "";
|
|
10641
|
+
const ToolbarStyle$1 = "t1v3ienx";
|
|
10306
10642
|
const TableToolBar = ({
|
|
10307
10643
|
title,
|
|
10308
10644
|
selectedKeys,
|
|
10309
10645
|
hideCreate
|
|
10310
10646
|
}) => {
|
|
10311
10647
|
const kit = eagle.useUIKit();
|
|
10312
|
-
return jsxRuntimeExports.jsxs(kit.space, {
|
|
10648
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
10313
10649
|
className: cx_default(ToolbarStyle$1, "table-toolbar"),
|
|
10314
|
-
children: [jsxRuntimeExports.jsx("span", {
|
|
10650
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
10315
10651
|
className: eagle.Typo.Display.d2_bold_title,
|
|
10316
10652
|
children: title
|
|
10317
|
-
}), jsxRuntimeExports.jsxs(kit.space, {
|
|
10318
|
-
children: [selectedKeys.length > 0 ? jsxRuntimeExports.jsx(DeleteManyButton, {
|
|
10653
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
10654
|
+
children: [selectedKeys.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteManyButton, {
|
|
10319
10655
|
ids: selectedKeys
|
|
10320
|
-
}) : void 0, !hideCreate ? jsxRuntimeExports.jsx(CreateButton, {}) : null]
|
|
10656
|
+
}) : void 0, !hideCreate ? /* @__PURE__ */ jsxRuntimeExports.jsx(CreateButton, {}) : null]
|
|
10321
10657
|
})]
|
|
10322
10658
|
});
|
|
10323
10659
|
};
|
|
10324
|
-
const
|
|
10660
|
+
const index_1hr2h38 = "";
|
|
10325
10661
|
function matchOwner(job, owner) {
|
|
10326
10662
|
var _a;
|
|
10327
10663
|
let match = false;
|
|
@@ -10356,14 +10692,14 @@ var __publicField = (obj, key, value) => {
|
|
|
10356
10692
|
});
|
|
10357
10693
|
}, [data2 == null ? void 0 : data2.data, owner]);
|
|
10358
10694
|
const columns = [NameColumnRenderer(i18n2, "jobs"), StateDisplayColumnRenderer(i18n2), NameSpaceColumnRenderer(i18n2), WorkloadImageColumnRenderer(i18n2), CompletionsCountColumnRenderer(i18n2), DurationColumnRenderer(i18n2), AgeColumnRenderer(i18n2)];
|
|
10359
|
-
return jsxRuntimeExports.jsxs(kit.space, {
|
|
10695
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
10360
10696
|
direction: "vertical",
|
|
10361
|
-
className: "
|
|
10362
|
-
children: [jsxRuntimeExports.jsx(TableToolBar, {
|
|
10697
|
+
className: "c16agr8o",
|
|
10698
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
|
|
10363
10699
|
title: "Jobs",
|
|
10364
10700
|
selectedKeys,
|
|
10365
10701
|
hideCreate: true
|
|
10366
|
-
}), jsxRuntimeExports.jsx(Table, {
|
|
10702
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Table, {
|
|
10367
10703
|
tableKey: "cronjobs",
|
|
10368
10704
|
loading: !dataSource,
|
|
10369
10705
|
data: dataSource || [],
|
|
@@ -10386,52 +10722,69 @@ var __publicField = (obj, key, value) => {
|
|
|
10386
10722
|
meta: { resourceBasePath: "/apis/events.k8s.io/v1", kind: "Event" }
|
|
10387
10723
|
});
|
|
10388
10724
|
const parsed = core.useParsed();
|
|
10389
|
-
const columns = React.useMemo(
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10725
|
+
const columns = React.useMemo(
|
|
10726
|
+
() => [
|
|
10727
|
+
NameSpaceColumnRenderer(i18n2),
|
|
10728
|
+
{
|
|
10729
|
+
key: "type",
|
|
10730
|
+
display: true,
|
|
10731
|
+
dataIndex: ["type"],
|
|
10732
|
+
title: i18n2.t("dovetail.type"),
|
|
10733
|
+
sortable: true,
|
|
10734
|
+
sorter: CommonSorter(["type"])
|
|
10735
|
+
},
|
|
10736
|
+
{
|
|
10737
|
+
key: "reason",
|
|
10738
|
+
display: true,
|
|
10739
|
+
dataIndex: ["reason"],
|
|
10740
|
+
title: i18n2.t("dovetail.reason"),
|
|
10741
|
+
sortable: true,
|
|
10742
|
+
sorter: CommonSorter(["reason"])
|
|
10743
|
+
},
|
|
10744
|
+
{
|
|
10745
|
+
key: "object",
|
|
10746
|
+
display: true,
|
|
10747
|
+
dataIndex: ["regarding", "name"],
|
|
10748
|
+
title: i18n2.t("dovetail.object"),
|
|
10749
|
+
sortable: true,
|
|
10750
|
+
sorter: CommonSorter(["regarding", "name"])
|
|
10751
|
+
},
|
|
10752
|
+
{
|
|
10753
|
+
key: "note",
|
|
10754
|
+
display: true,
|
|
10755
|
+
dataIndex: ["note"],
|
|
10756
|
+
title: i18n2.t("dovetail.note"),
|
|
10757
|
+
sortable: true,
|
|
10758
|
+
sorter: CommonSorter(["note"])
|
|
10759
|
+
},
|
|
10760
|
+
AgeColumnRenderer(i18n2)
|
|
10761
|
+
],
|
|
10762
|
+
[i18n2]
|
|
10763
|
+
);
|
|
10425
10764
|
const dataSource = React.useMemo(() => {
|
|
10426
10765
|
return data2 == null ? void 0 : data2.data.filter((d) => {
|
|
10427
10766
|
const objectId = `${d.regarding.namespace}/${d.regarding.name}`;
|
|
10428
10767
|
return objectId === parsed.id;
|
|
10429
10768
|
});
|
|
10430
10769
|
}, [data2 == null ? void 0 : data2.data, parsed]);
|
|
10431
|
-
return jsxRuntimeExports.jsx(
|
|
10770
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10771
|
+
Table,
|
|
10772
|
+
{
|
|
10773
|
+
tableKey: "events",
|
|
10774
|
+
loading: isLoading,
|
|
10775
|
+
data: dataSource || [],
|
|
10776
|
+
columns,
|
|
10777
|
+
rowKey: "id",
|
|
10778
|
+
error: false,
|
|
10779
|
+
currentPage,
|
|
10780
|
+
onPageChange: (p) => setCurrentPage(p),
|
|
10781
|
+
currentSize: 10,
|
|
10782
|
+
refetch: () => null
|
|
10783
|
+
}
|
|
10784
|
+
);
|
|
10432
10785
|
};
|
|
10433
|
-
const
|
|
10434
|
-
const MoreTriggerStyle = "
|
|
10786
|
+
const index_86mllf = "";
|
|
10787
|
+
const MoreTriggerStyle = "m1u1f5zp";
|
|
10435
10788
|
const ImageNames = ({
|
|
10436
10789
|
value
|
|
10437
10790
|
}) => {
|
|
@@ -10439,18 +10792,18 @@ var __publicField = (obj, key, value) => {
|
|
|
10439
10792
|
const {
|
|
10440
10793
|
t
|
|
10441
10794
|
} = useTranslation();
|
|
10442
|
-
return jsxRuntimeExports.jsxs("span", {
|
|
10443
|
-
children: [jsxRuntimeExports.jsx("span", {
|
|
10795
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
10796
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
10444
10797
|
children: value[0]
|
|
10445
|
-
}), value.length > 1 && jsxRuntimeExports.jsx(kit.tooltip, {
|
|
10446
|
-
title: jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
10798
|
+
}), value.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tooltip, {
|
|
10799
|
+
title: /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
10447
10800
|
children: value.slice(1).map((name2, index) => {
|
|
10448
|
-
return jsxRuntimeExports.jsx("div", {
|
|
10801
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
10449
10802
|
children: name2
|
|
10450
10803
|
}, index);
|
|
10451
10804
|
})
|
|
10452
10805
|
}),
|
|
10453
|
-
children: jsxRuntimeExports.jsxs("div", {
|
|
10806
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
10454
10807
|
className: cx_default(eagle.Typo.Label.l4_regular, MoreTriggerStyle),
|
|
10455
10808
|
children: ["+", value.length - 1, " ", t("dovetail.more")]
|
|
10456
10809
|
})
|
|
@@ -10473,7 +10826,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10473
10826
|
}
|
|
10474
10827
|
});
|
|
10475
10828
|
};
|
|
10476
|
-
return jsxRuntimeExports.jsx(kit.Link, { onClick, children: resourceId });
|
|
10829
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.Link, { onClick, children: resourceId });
|
|
10477
10830
|
};
|
|
10478
10831
|
const IngressRulesTable = ({ ingress }) => {
|
|
10479
10832
|
const kit = eagle.useUIKit();
|
|
@@ -10503,7 +10856,14 @@ var __publicField = (obj, key, value) => {
|
|
|
10503
10856
|
title: t("dovetail.service"),
|
|
10504
10857
|
sortable: true,
|
|
10505
10858
|
render: (serviceName) => {
|
|
10506
|
-
return jsxRuntimeExports.jsx(
|
|
10859
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10860
|
+
ResourceLink,
|
|
10861
|
+
{
|
|
10862
|
+
name: "services",
|
|
10863
|
+
namespace: ingress.metadata.namespace || "default",
|
|
10864
|
+
resourceId: serviceName
|
|
10865
|
+
}
|
|
10866
|
+
);
|
|
10507
10867
|
}
|
|
10508
10868
|
},
|
|
10509
10869
|
{
|
|
@@ -10515,14 +10875,23 @@ var __publicField = (obj, key, value) => {
|
|
|
10515
10875
|
}
|
|
10516
10876
|
];
|
|
10517
10877
|
if (rows.length === 0) {
|
|
10518
|
-
return jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
10878
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
10519
10879
|
}
|
|
10520
|
-
return jsxRuntimeExports.jsx(
|
|
10880
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10881
|
+
kit.table,
|
|
10882
|
+
{
|
|
10883
|
+
loading: false,
|
|
10884
|
+
dataSource: rows,
|
|
10885
|
+
columns,
|
|
10886
|
+
rowKey: "type",
|
|
10887
|
+
empty: t("dovetail.empty")
|
|
10888
|
+
}
|
|
10889
|
+
);
|
|
10521
10890
|
};
|
|
10522
10891
|
const KeyValue = ({ value }) => {
|
|
10523
10892
|
const kit = eagle.useUIKit();
|
|
10524
10893
|
if (!value || Object.keys.length === 0) {
|
|
10525
|
-
return jsxRuntimeExports.jsx("div", { children: "Empty" });
|
|
10894
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Empty" });
|
|
10526
10895
|
}
|
|
10527
10896
|
const data2 = Object.keys(value).map((key) => {
|
|
10528
10897
|
return {
|
|
@@ -10531,18 +10900,25 @@ var __publicField = (obj, key, value) => {
|
|
|
10531
10900
|
value: value[key]
|
|
10532
10901
|
};
|
|
10533
10902
|
});
|
|
10534
|
-
return jsxRuntimeExports.jsx(
|
|
10535
|
-
|
|
10536
|
-
key: "key",
|
|
10537
|
-
title: "Key",
|
|
10538
|
-
dataIndex: ["key"]
|
|
10539
|
-
},
|
|
10903
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10904
|
+
kit.table,
|
|
10540
10905
|
{
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10906
|
+
loading: false,
|
|
10907
|
+
columns: [
|
|
10908
|
+
{
|
|
10909
|
+
key: "key",
|
|
10910
|
+
title: "Key",
|
|
10911
|
+
dataIndex: ["key"]
|
|
10912
|
+
},
|
|
10913
|
+
{
|
|
10914
|
+
key: "value",
|
|
10915
|
+
title: "Value",
|
|
10916
|
+
dataIndex: ["value"]
|
|
10917
|
+
}
|
|
10918
|
+
],
|
|
10919
|
+
dataSource: data2
|
|
10544
10920
|
}
|
|
10545
|
-
|
|
10921
|
+
);
|
|
10546
10922
|
};
|
|
10547
10923
|
function matchSelector(pod, selector) {
|
|
10548
10924
|
var _a, _b, _c;
|
|
@@ -10554,7 +10930,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10554
10930
|
}
|
|
10555
10931
|
return match;
|
|
10556
10932
|
}
|
|
10557
|
-
const
|
|
10933
|
+
const WorkloadPodsTable_1giuese = "";
|
|
10558
10934
|
const WorkloadPodsTable = ({
|
|
10559
10935
|
selector,
|
|
10560
10936
|
hideToolbar
|
|
@@ -10583,14 +10959,14 @@ var __publicField = (obj, key, value) => {
|
|
|
10583
10959
|
});
|
|
10584
10960
|
}, [data2 == null ? void 0 : data2.data, selector]);
|
|
10585
10961
|
const columns = [StateDisplayColumnRenderer(i18n2), NameColumnRenderer(i18n2, "pods"), NodeNameColumnRenderer(i18n2), WorkloadImageColumnRenderer(i18n2), RestartCountColumnRenderer(i18n2)];
|
|
10586
|
-
return jsxRuntimeExports.jsxs(kit.space, {
|
|
10962
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
10587
10963
|
direction: "vertical",
|
|
10588
|
-
className: "
|
|
10589
|
-
children: [hideToolbar ? null : jsxRuntimeExports.jsx(TableToolBar, {
|
|
10964
|
+
className: "c1dicff8",
|
|
10965
|
+
children: [hideToolbar ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
|
|
10590
10966
|
title: "",
|
|
10591
10967
|
selectedKeys,
|
|
10592
10968
|
hideCreate: true
|
|
10593
|
-
}), jsxRuntimeExports.jsx(Table, {
|
|
10969
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Table, {
|
|
10594
10970
|
tableKey: "pods",
|
|
10595
10971
|
loading: !dataSource,
|
|
10596
10972
|
data: dataSource || [],
|
|
@@ -10642,9 +11018,9 @@ var __publicField = (obj, key, value) => {
|
|
|
10642
11018
|
onSubmit
|
|
10643
11019
|
};
|
|
10644
11020
|
}
|
|
10645
|
-
const
|
|
10646
|
-
const EditFieldModalStyle = "
|
|
10647
|
-
const EditButtonStyle = "
|
|
11021
|
+
const index_13sllsf = "";
|
|
11022
|
+
const EditFieldModalStyle = "esoz3jw";
|
|
11023
|
+
const EditButtonStyle = "e1m0bgls";
|
|
10648
11024
|
function EditFieldModal(props) {
|
|
10649
11025
|
const {
|
|
10650
11026
|
title,
|
|
@@ -10668,7 +11044,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10668
11044
|
eagle.popModal();
|
|
10669
11045
|
reset();
|
|
10670
11046
|
}, [reset]);
|
|
10671
|
-
return jsxRuntimeExports.jsxs(kit.modal, {
|
|
11047
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.modal, {
|
|
10672
11048
|
className: EditFieldModalStyle,
|
|
10673
11049
|
title: title || i18n2.t("dovetail.edit"),
|
|
10674
11050
|
confirmLoading: submitting,
|
|
@@ -10676,7 +11052,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10676
11052
|
onCancel: close,
|
|
10677
11053
|
normal: true,
|
|
10678
11054
|
destroyOnClose: true,
|
|
10679
|
-
children: [renderContent(), jsxRuntimeExports.jsx(FormErrorAlert, {
|
|
11055
|
+
children: [renderContent(), /* @__PURE__ */ jsxRuntimeExports.jsx(FormErrorAlert, {
|
|
10680
11056
|
style: {
|
|
10681
11057
|
marginTop: 16
|
|
10682
11058
|
},
|
|
@@ -10692,7 +11068,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10692
11068
|
const {
|
|
10693
11069
|
i18n: i18n2
|
|
10694
11070
|
} = useTranslation();
|
|
10695
|
-
return jsxRuntimeExports.jsx(kit.button, {
|
|
11071
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
10696
11072
|
className: EditButtonStyle,
|
|
10697
11073
|
type: "link",
|
|
10698
11074
|
onClick: () => {
|
|
@@ -10723,17 +11099,30 @@ var __publicField = (obj, key, value) => {
|
|
|
10723
11099
|
React.useImperativeHandle(ref, () => ({
|
|
10724
11100
|
submit
|
|
10725
11101
|
}), [submit]);
|
|
10726
|
-
return
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
11102
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11103
|
+
kit.form.Item,
|
|
11104
|
+
{
|
|
11105
|
+
label: label2,
|
|
11106
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11107
|
+
kit.fields.Integer,
|
|
11108
|
+
{
|
|
11109
|
+
input: {
|
|
11110
|
+
name: "replicas",
|
|
11111
|
+
value: replicas2,
|
|
11112
|
+
onChange: (value) => {
|
|
11113
|
+
setReplicas(Number(value));
|
|
11114
|
+
},
|
|
11115
|
+
onBlur: () => {
|
|
11116
|
+
},
|
|
11117
|
+
onFocus: () => {
|
|
11118
|
+
}
|
|
11119
|
+
},
|
|
11120
|
+
meta: {},
|
|
11121
|
+
controls: true
|
|
11122
|
+
}
|
|
11123
|
+
)
|
|
10735
11124
|
}
|
|
10736
|
-
|
|
11125
|
+
);
|
|
10737
11126
|
});
|
|
10738
11127
|
function WorkloadReplicas({ record, label: label2, editable }) {
|
|
10739
11128
|
const formRef = React.useRef(null);
|
|
@@ -10741,12 +11130,30 @@ var __publicField = (obj, key, value) => {
|
|
|
10741
11130
|
const replicas2 = record.spec && "replicas" in record.spec ? record.spec.replicas : 0;
|
|
10742
11131
|
const canScale = record.kind === "Deployment" || record.kind === "StatefulSet";
|
|
10743
11132
|
const currentReplicas = lodashEs.get(record, "spec.replicas", 0);
|
|
10744
|
-
return jsxRuntimeExports.jsxs("span", { children: [
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
|
|
10749
|
-
|
|
11133
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
11134
|
+
readyReplicas,
|
|
11135
|
+
"/",
|
|
11136
|
+
replicas2,
|
|
11137
|
+
editable && canScale && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11138
|
+
EditField,
|
|
11139
|
+
{
|
|
11140
|
+
modalProps: {
|
|
11141
|
+
formRef,
|
|
11142
|
+
renderContent() {
|
|
11143
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11144
|
+
WorkloadReplicasForm,
|
|
11145
|
+
{
|
|
11146
|
+
ref: formRef,
|
|
11147
|
+
defaultValue: currentReplicas,
|
|
11148
|
+
record,
|
|
11149
|
+
label: label2 || ""
|
|
11150
|
+
}
|
|
11151
|
+
);
|
|
11152
|
+
}
|
|
11153
|
+
}
|
|
11154
|
+
}
|
|
11155
|
+
)
|
|
11156
|
+
] });
|
|
10750
11157
|
}
|
|
10751
11158
|
const ImageField = (i18n2) => {
|
|
10752
11159
|
return {
|
|
@@ -10755,7 +11162,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10755
11162
|
path: ["imageNames"],
|
|
10756
11163
|
col: 12,
|
|
10757
11164
|
renderContent(value) {
|
|
10758
|
-
return jsxRuntimeExports.jsx(ImageNames, { value });
|
|
11165
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ImageNames, { value });
|
|
10759
11166
|
}
|
|
10760
11167
|
};
|
|
10761
11168
|
};
|
|
@@ -10765,7 +11172,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10765
11172
|
title: i18n2.t("dovetail.replicas"),
|
|
10766
11173
|
path: ["status", "replicas"],
|
|
10767
11174
|
renderContent: (_, record, field) => {
|
|
10768
|
-
return jsxRuntimeExports.jsx(WorkloadReplicas, { record, label: field.title, editable: true });
|
|
11175
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WorkloadReplicas, { record, label: field.title, editable: true });
|
|
10769
11176
|
}
|
|
10770
11177
|
};
|
|
10771
11178
|
};
|
|
@@ -10775,7 +11182,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10775
11182
|
title: i18n2.t("dovetail.condition"),
|
|
10776
11183
|
path: ["status", "conditions"],
|
|
10777
11184
|
renderContent: (value) => {
|
|
10778
|
-
return jsxRuntimeExports.jsx(ConditionsTable, { conditions: value });
|
|
11185
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ConditionsTable, { conditions: value });
|
|
10779
11186
|
}
|
|
10780
11187
|
};
|
|
10781
11188
|
};
|
|
@@ -10786,9 +11193,15 @@ var __publicField = (obj, key, value) => {
|
|
|
10786
11193
|
path: [],
|
|
10787
11194
|
renderContent: (_, record) => {
|
|
10788
11195
|
var _a, _b;
|
|
10789
|
-
return
|
|
10790
|
-
|
|
10791
|
-
|
|
11196
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11197
|
+
WorkloadPodsTable,
|
|
11198
|
+
{
|
|
11199
|
+
selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r) => {
|
|
11200
|
+
return r.kind === "Pod" && r.type === "creates";
|
|
11201
|
+
})) == null ? void 0 : _b.selector,
|
|
11202
|
+
hideToolbar: true
|
|
11203
|
+
}
|
|
11204
|
+
);
|
|
10792
11205
|
}
|
|
10793
11206
|
};
|
|
10794
11207
|
};
|
|
@@ -10799,13 +11212,18 @@ var __publicField = (obj, key, value) => {
|
|
|
10799
11212
|
path: [],
|
|
10800
11213
|
renderContent: (_, record) => {
|
|
10801
11214
|
var _a, _b, _c;
|
|
10802
|
-
return jsxRuntimeExports.jsx(
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
11215
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11216
|
+
CronjobJobsTable,
|
|
11217
|
+
{
|
|
11218
|
+
owner: {
|
|
11219
|
+
apiVersion: record.apiVersion || "",
|
|
11220
|
+
kind: record.kind || "",
|
|
11221
|
+
name: ((_a = record.metadata) == null ? void 0 : _a.name) || "",
|
|
11222
|
+
namespace: ((_b = record.metadata) == null ? void 0 : _b.namespace) || "",
|
|
11223
|
+
uid: ((_c = record.metadata) == null ? void 0 : _c.uid) || ""
|
|
11224
|
+
}
|
|
11225
|
+
}
|
|
11226
|
+
);
|
|
10809
11227
|
}
|
|
10810
11228
|
};
|
|
10811
11229
|
};
|
|
@@ -10815,7 +11233,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10815
11233
|
title: i18n2.t("dovetail.data"),
|
|
10816
11234
|
path: ["data"],
|
|
10817
11235
|
renderContent: (val) => {
|
|
10818
|
-
return jsxRuntimeExports.jsx(KeyValue, { value: val });
|
|
11236
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValue, { value: val });
|
|
10819
11237
|
}
|
|
10820
11238
|
};
|
|
10821
11239
|
};
|
|
@@ -10829,7 +11247,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10829
11247
|
for (const key in val) {
|
|
10830
11248
|
decodeVal[key] = atob(val[key]);
|
|
10831
11249
|
}
|
|
10832
|
-
return jsxRuntimeExports.jsx(KeyValue, { value: decodeVal });
|
|
11250
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValue, { value: decodeVal });
|
|
10833
11251
|
}
|
|
10834
11252
|
};
|
|
10835
11253
|
};
|
|
@@ -10840,7 +11258,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10840
11258
|
path: ["status", "startTime"],
|
|
10841
11259
|
col: 12,
|
|
10842
11260
|
renderContent(value) {
|
|
10843
|
-
return jsxRuntimeExports.jsx(Time, { date: value });
|
|
11261
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: value });
|
|
10844
11262
|
}
|
|
10845
11263
|
};
|
|
10846
11264
|
};
|
|
@@ -10872,9 +11290,14 @@ var __publicField = (obj, key, value) => {
|
|
|
10872
11290
|
path: [],
|
|
10873
11291
|
renderContent: (_, record) => {
|
|
10874
11292
|
var _a, _b;
|
|
10875
|
-
return
|
|
10876
|
-
|
|
10877
|
-
|
|
11293
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11294
|
+
WorkloadPodsTable,
|
|
11295
|
+
{
|
|
11296
|
+
selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r) => {
|
|
11297
|
+
return r.kind === "Pod" && r.type === "selects";
|
|
11298
|
+
})) == null ? void 0 : _b.selector
|
|
11299
|
+
}
|
|
11300
|
+
);
|
|
10878
11301
|
}
|
|
10879
11302
|
};
|
|
10880
11303
|
};
|
|
@@ -10884,7 +11307,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10884
11307
|
title: i18n2.t("dovetail.rule"),
|
|
10885
11308
|
path: ["spec", "rules"],
|
|
10886
11309
|
renderContent: (_, record) => {
|
|
10887
|
-
return jsxRuntimeExports.jsx(IngressRulesTable, { ingress: record });
|
|
11310
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IngressRulesTable, { ingress: record });
|
|
10888
11311
|
}
|
|
10889
11312
|
};
|
|
10890
11313
|
};
|
|
@@ -10894,13 +11317,16 @@ var __publicField = (obj, key, value) => {
|
|
|
10894
11317
|
title: i18n2.t("dovetail.event"),
|
|
10895
11318
|
path: [],
|
|
10896
11319
|
renderContent: () => {
|
|
10897
|
-
return jsxRuntimeExports.jsx(EventsTable, {});
|
|
11320
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(EventsTable, {});
|
|
10898
11321
|
}
|
|
10899
11322
|
};
|
|
10900
11323
|
};
|
|
10901
11324
|
function download(filename, content) {
|
|
10902
11325
|
const element = document.createElement("a");
|
|
10903
|
-
element.setAttribute(
|
|
11326
|
+
element.setAttribute(
|
|
11327
|
+
"href",
|
|
11328
|
+
"data:text/plain;charset=utf-8," + encodeURIComponent(content)
|
|
11329
|
+
);
|
|
10904
11330
|
element.setAttribute("download", filename);
|
|
10905
11331
|
element.style.display = "none";
|
|
10906
11332
|
document.body.appendChild(element);
|
|
@@ -10921,29 +11347,64 @@ var __publicField = (obj, key, value) => {
|
|
|
10921
11347
|
const { globalStore } = useGlobalStore();
|
|
10922
11348
|
const useResourceResult = core.useResource();
|
|
10923
11349
|
const resource = useResourceResult.resource;
|
|
10924
|
-
const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
|
|
11350
|
+
const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
|
|
11351
|
+
(resource == null ? void 0 : resource.name) || ""
|
|
11352
|
+
);
|
|
10925
11353
|
const download2 = useDownloadYAML();
|
|
10926
11354
|
const { t } = useTranslation();
|
|
10927
11355
|
const openForm = useOpenForm({ id: record.id });
|
|
10928
|
-
return
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
11356
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
11357
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11358
|
+
kit.dropdown,
|
|
11359
|
+
{
|
|
11360
|
+
overlay: /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.menu, { children: [
|
|
11361
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11362
|
+
kit.menuItem,
|
|
11363
|
+
{
|
|
11364
|
+
onClick: openForm,
|
|
11365
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.EditPen16PrimaryIcon, children: t("dovetail.edit") })
|
|
11366
|
+
}
|
|
11367
|
+
),
|
|
11368
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11369
|
+
kit.menuItem,
|
|
11370
|
+
{
|
|
11371
|
+
danger: true,
|
|
11372
|
+
onClick: () => {
|
|
11373
|
+
openDeleteConfirmModal(record.id);
|
|
11374
|
+
},
|
|
11375
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.TrashBinDelete16Icon, children: t("dovetail.delete") })
|
|
11376
|
+
}
|
|
11377
|
+
),
|
|
11378
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11379
|
+
kit.menu.Item,
|
|
11380
|
+
{
|
|
11381
|
+
onClick: () => {
|
|
11382
|
+
var _a;
|
|
11383
|
+
if (record.id) {
|
|
11384
|
+
download2({
|
|
11385
|
+
name: ((_a = record.metadata) == null ? void 0 : _a.name) || record.kind || "",
|
|
11386
|
+
item: (globalStore == null ? void 0 : globalStore.restoreItem(record)) || record
|
|
11387
|
+
});
|
|
11388
|
+
}
|
|
11389
|
+
},
|
|
11390
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.Download16GradientBlueIcon, children: t("dovetail.download_yaml") })
|
|
11391
|
+
}
|
|
11392
|
+
),
|
|
11393
|
+
props.children
|
|
11394
|
+
] }),
|
|
11395
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "tertiary", size: "small", children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.MoreEllipsis316BoldBlueIcon }) })
|
|
11396
|
+
}
|
|
11397
|
+
),
|
|
11398
|
+
visible ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.modal, { ...modalProps }) : null
|
|
11399
|
+
] });
|
|
10939
11400
|
}
|
|
10940
|
-
const
|
|
10941
|
-
const WrapperStyle$1 = "
|
|
10942
|
-
const HeaderStyle$1 = "
|
|
10943
|
-
const HeaderItemStyle = "
|
|
10944
|
-
const ExpandButtonStyle = "
|
|
10945
|
-
const ContentBlockStyle = "
|
|
10946
|
-
const KeyStyle = "
|
|
11401
|
+
const index_1j8sdg6 = "";
|
|
11402
|
+
const WrapperStyle$1 = "woio6qj";
|
|
11403
|
+
const HeaderStyle$1 = "h1pmxp8z";
|
|
11404
|
+
const HeaderItemStyle = "h1btthoz";
|
|
11405
|
+
const ExpandButtonStyle = "ewkumn1";
|
|
11406
|
+
const ContentBlockStyle = "c1in0x5n";
|
|
11407
|
+
const KeyStyle = "klhq5sj";
|
|
10947
11408
|
function KeyValueData(props) {
|
|
10948
11409
|
const {
|
|
10949
11410
|
datas,
|
|
@@ -10954,14 +11415,14 @@ var __publicField = (obj, key, value) => {
|
|
|
10954
11415
|
const {
|
|
10955
11416
|
t
|
|
10956
11417
|
} = useTranslation();
|
|
10957
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
11418
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
10958
11419
|
className: WrapperStyle$1,
|
|
10959
|
-
children: [jsxRuntimeExports.jsxs("div", {
|
|
11420
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
10960
11421
|
className: HeaderStyle$1,
|
|
10961
|
-
children: [jsxRuntimeExports.jsx("span", {
|
|
11422
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
10962
11423
|
className: HeaderItemStyle,
|
|
10963
11424
|
children: Object.keys(datas).length
|
|
10964
|
-
}), jsxRuntimeExports.jsx(kit.button, {
|
|
11425
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
10965
11426
|
type: "link",
|
|
10966
11427
|
className: ExpandButtonStyle,
|
|
10967
11428
|
onClick: () => {
|
|
@@ -10969,12 +11430,12 @@ var __publicField = (obj, key, value) => {
|
|
|
10969
11430
|
},
|
|
10970
11431
|
children: isExpand ? t("dovetail.fold") : t("dovetail.expand")
|
|
10971
11432
|
})]
|
|
10972
|
-
}), isExpand ? Object.keys(datas).map((key) => jsxRuntimeExports.jsxs("div", {
|
|
11433
|
+
}), isExpand ? Object.keys(datas).map((key) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
10973
11434
|
className: ContentBlockStyle,
|
|
10974
|
-
children: [jsxRuntimeExports.jsx("span", {
|
|
11435
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
10975
11436
|
className: cx_default(KeyStyle, eagle.Typo.Label.l4_regular),
|
|
10976
11437
|
children: key
|
|
10977
|
-
}), jsxRuntimeExports.jsx("span", {
|
|
11438
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
10978
11439
|
className: eagle.Typo.Label.l4_regular,
|
|
10979
11440
|
children: datas[key]
|
|
10980
11441
|
})]
|
|
@@ -10985,7 +11446,19 @@ var __publicField = (obj, key, value) => {
|
|
|
10985
11446
|
const MonacoYamlEditor = (props) => {
|
|
10986
11447
|
const ref = React.useRef(null);
|
|
10987
11448
|
const instanceRef = React.useRef({ editor: null });
|
|
10988
|
-
const {
|
|
11449
|
+
const {
|
|
11450
|
+
defaultValue,
|
|
11451
|
+
id,
|
|
11452
|
+
height,
|
|
11453
|
+
readOnly,
|
|
11454
|
+
schema,
|
|
11455
|
+
isScrollOnFocus,
|
|
11456
|
+
onChange,
|
|
11457
|
+
onValidate,
|
|
11458
|
+
getInstance,
|
|
11459
|
+
onEditorCreate,
|
|
11460
|
+
onBlur
|
|
11461
|
+
} = props;
|
|
10989
11462
|
const uri = id ? monaco__namespace.Uri.parse(`${id}.yaml`) : void 0;
|
|
10990
11463
|
React.useEffect(() => {
|
|
10991
11464
|
if (schema) {
|
|
@@ -11105,30 +11578,37 @@ var __publicField = (obj, key, value) => {
|
|
|
11105
11578
|
stops.forEach((stop) => stop.dispose());
|
|
11106
11579
|
};
|
|
11107
11580
|
}, [instanceRef.current.editor, isScrollOnFocus]);
|
|
11108
|
-
return jsxRuntimeExports.jsx(
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11581
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11582
|
+
"div",
|
|
11583
|
+
{
|
|
11584
|
+
ref,
|
|
11585
|
+
className: cx_default(YamlEditorStyle, props.className),
|
|
11586
|
+
style: {
|
|
11587
|
+
width: "100%",
|
|
11588
|
+
height: height || "500px"
|
|
11589
|
+
}
|
|
11590
|
+
}
|
|
11591
|
+
);
|
|
11112
11592
|
};
|
|
11113
11593
|
const MonacoYamlEditor$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11114
11594
|
__proto__: null,
|
|
11115
11595
|
default: MonacoYamlEditor
|
|
11116
11596
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
})(
|
|
11131
|
-
const StateTag = ({ state: state2 =
|
|
11597
|
+
var WorkloadState = /* @__PURE__ */ ((WorkloadState2) => {
|
|
11598
|
+
WorkloadState2["UPDATEING"] = "updating";
|
|
11599
|
+
WorkloadState2["READY"] = "ready";
|
|
11600
|
+
WorkloadState2["COMPLETED"] = "completed";
|
|
11601
|
+
WorkloadState2["FAILED"] = "failed";
|
|
11602
|
+
WorkloadState2["SUSPENDED"] = "suspended";
|
|
11603
|
+
WorkloadState2["RUNNING"] = "running";
|
|
11604
|
+
WorkloadState2["SUCCEEDED"] = "succeeded";
|
|
11605
|
+
WorkloadState2["UNKNOWN"] = "unknown";
|
|
11606
|
+
WorkloadState2["TERMINATING"] = "terminating";
|
|
11607
|
+
WorkloadState2["PENDING"] = "pending";
|
|
11608
|
+
WorkloadState2["WAITING"] = "waiting";
|
|
11609
|
+
return WorkloadState2;
|
|
11610
|
+
})(WorkloadState || {});
|
|
11611
|
+
const StateTag = ({ state: state2 = WorkloadState.UPDATEING, className }) => {
|
|
11132
11612
|
const kit = eagle.useUIKit();
|
|
11133
11613
|
const { t } = useTranslation();
|
|
11134
11614
|
const colorMap = {
|
|
@@ -11144,23 +11624,23 @@ var __publicField = (obj, key, value) => {
|
|
|
11144
11624
|
pending: "gray",
|
|
11145
11625
|
waiting: "gray"
|
|
11146
11626
|
};
|
|
11147
|
-
return jsxRuntimeExports.jsx(kit.tag, { className, color: colorMap[state2], children: t(`dovetail.${state2 || "updaing"}`) });
|
|
11627
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tag, { className, color: colorMap[state2], children: t(`dovetail.${state2 || "updaing"}`) });
|
|
11148
11628
|
};
|
|
11149
|
-
const
|
|
11150
|
-
const TagWrapper = "
|
|
11151
|
-
const TagStyle = "
|
|
11629
|
+
const index_1l7lkk4 = "";
|
|
11630
|
+
const TagWrapper = "t13a6vox";
|
|
11631
|
+
const TagStyle = "t12ikbmp";
|
|
11152
11632
|
const Tags = (props) => {
|
|
11153
11633
|
const {
|
|
11154
11634
|
value
|
|
11155
11635
|
} = props;
|
|
11156
11636
|
const kit = eagle.useUIKit();
|
|
11157
11637
|
if (!value) {
|
|
11158
|
-
return jsxRuntimeExports.jsx("span", {
|
|
11638
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11159
11639
|
children: "-"
|
|
11160
11640
|
});
|
|
11161
11641
|
}
|
|
11162
11642
|
const tags = Object.keys(value).map((key) => {
|
|
11163
|
-
return jsxRuntimeExports.jsx(kit.tag.SplitTag, {
|
|
11643
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tag.SplitTag, {
|
|
11164
11644
|
className: TagStyle,
|
|
11165
11645
|
primaryContent: key,
|
|
11166
11646
|
secondaryContent: value[key],
|
|
@@ -11168,25 +11648,20 @@ var __publicField = (obj, key, value) => {
|
|
|
11168
11648
|
color: "gray"
|
|
11169
11649
|
}, key);
|
|
11170
11650
|
});
|
|
11171
|
-
return jsxRuntimeExports.jsx(kit.space, {
|
|
11651
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.space, {
|
|
11172
11652
|
className: TagWrapper,
|
|
11173
11653
|
size: 8,
|
|
11174
11654
|
children: tags
|
|
11175
11655
|
});
|
|
11176
11656
|
};
|
|
11177
|
-
const
|
|
11178
|
-
const ShowContentWrapperStyle = "
|
|
11179
|
-
const TopBarStyle = "
|
|
11180
|
-
const ShowContentHeaderStyle = "
|
|
11181
|
-
const EditorStyle = "
|
|
11182
|
-
const FieldWrapperStyle = "
|
|
11183
|
-
const TabsStyle = "
|
|
11184
|
-
const StateTagStyle = "
|
|
11185
|
-
var Mode;
|
|
11186
|
-
(function(Mode2) {
|
|
11187
|
-
Mode2["Detail"] = "detail";
|
|
11188
|
-
Mode2["Yaml"] = "yaml";
|
|
11189
|
-
})(Mode || (Mode = {}));
|
|
11657
|
+
const ShowContent_rmo7c5 = "";
|
|
11658
|
+
const ShowContentWrapperStyle = "s9agep2";
|
|
11659
|
+
const TopBarStyle = "to89gfi";
|
|
11660
|
+
const ShowContentHeaderStyle = "s1ohe42f";
|
|
11661
|
+
const EditorStyle = "eqm4qz0";
|
|
11662
|
+
const FieldWrapperStyle = "ficl0qc";
|
|
11663
|
+
const TabsStyle = "to9uwk1";
|
|
11664
|
+
const StateTagStyle = "se26ou0";
|
|
11190
11665
|
const ShowContent = (props) => {
|
|
11191
11666
|
var _a, _b, _c;
|
|
11192
11667
|
const {
|
|
@@ -11202,12 +11677,15 @@ var __publicField = (obj, key, value) => {
|
|
|
11202
11677
|
const {
|
|
11203
11678
|
resource
|
|
11204
11679
|
} = core.useResource();
|
|
11205
|
-
const [mode, setMode] = React.useState(
|
|
11680
|
+
const [mode, setMode] = React.useState(
|
|
11681
|
+
"detail"
|
|
11682
|
+
/* Detail */
|
|
11683
|
+
);
|
|
11206
11684
|
const {
|
|
11207
11685
|
queryResult
|
|
11208
11686
|
} = core.useShow({
|
|
11209
11687
|
id: (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id,
|
|
11210
|
-
liveMode: mode ===
|
|
11688
|
+
liveMode: mode === "yaml" ? "off" : "auto"
|
|
11211
11689
|
});
|
|
11212
11690
|
const {
|
|
11213
11691
|
t
|
|
@@ -11237,15 +11715,15 @@ var __publicField = (obj, key, value) => {
|
|
|
11237
11715
|
if (field.renderContent) {
|
|
11238
11716
|
content = field.renderContent(value, record, field);
|
|
11239
11717
|
} else {
|
|
11240
|
-
content = jsxRuntimeExports.jsx("span", {
|
|
11718
|
+
content = /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11241
11719
|
children: lodashEs.get(record, field.path)
|
|
11242
11720
|
});
|
|
11243
11721
|
}
|
|
11244
|
-
return jsxRuntimeExports.jsx(kit.col, {
|
|
11722
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.col, {
|
|
11245
11723
|
span: field.col,
|
|
11246
|
-
children: field.render ? field.render(value, record, field) : jsxRuntimeExports.jsxs("div", {
|
|
11724
|
+
children: field.render ? field.render(value, record, field) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11247
11725
|
className: FieldWrapperStyle,
|
|
11248
|
-
children: [jsxRuntimeExports.jsxs("span", {
|
|
11726
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
11249
11727
|
className: eagle.Typo.Label.l3_regular,
|
|
11250
11728
|
style: {
|
|
11251
11729
|
width: field.labelWidth || "64px"
|
|
@@ -11265,7 +11743,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11265
11743
|
title: t("dovetail.created_time"),
|
|
11266
11744
|
path: ["metadata", "creationTimestamp"],
|
|
11267
11745
|
renderContent(value) {
|
|
11268
|
-
return jsxRuntimeExports.jsx(Time, {
|
|
11746
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, {
|
|
11269
11747
|
date: new Date(value)
|
|
11270
11748
|
});
|
|
11271
11749
|
}
|
|
@@ -11279,7 +11757,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11279
11757
|
if (!value) {
|
|
11280
11758
|
return void 0;
|
|
11281
11759
|
}
|
|
11282
|
-
return jsxRuntimeExports.jsx(Tags, {
|
|
11760
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tags, {
|
|
11283
11761
|
value
|
|
11284
11762
|
});
|
|
11285
11763
|
}
|
|
@@ -11292,74 +11770,80 @@ var __publicField = (obj, key, value) => {
|
|
|
11292
11770
|
if (!value) {
|
|
11293
11771
|
return void 0;
|
|
11294
11772
|
}
|
|
11295
|
-
return jsxRuntimeExports.jsx(KeyValueData, {
|
|
11773
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueData, {
|
|
11296
11774
|
datas: value,
|
|
11297
11775
|
expandable: true
|
|
11298
11776
|
});
|
|
11299
11777
|
}
|
|
11300
11778
|
}];
|
|
11301
11779
|
const stateDisplay = lodashEs.get(record, "stateDisplay");
|
|
11302
|
-
const topBar = jsxRuntimeExports.jsxs(kit.space, {
|
|
11780
|
+
const topBar = /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
11303
11781
|
className: TopBarStyle,
|
|
11304
|
-
children: [jsxRuntimeExports.jsxs("div", {
|
|
11305
|
-
children: [jsxRuntimeExports.jsxs("span", {
|
|
11782
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11783
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
11306
11784
|
className: eagle.Typo.Display.d2_bold_title,
|
|
11307
11785
|
children: [(_b = resource == null ? void 0 : resource.meta) == null ? void 0 : _b.kind, ": "]
|
|
11308
|
-
}), jsxRuntimeExports.jsx("span", {
|
|
11786
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11309
11787
|
className: eagle.Typo.Label.l1_regular,
|
|
11310
11788
|
children: (_c = record == null ? void 0 : record.metadata) == null ? void 0 : _c.name
|
|
11311
|
-
}), stateDisplay ? jsxRuntimeExports.jsx(StateTag, {
|
|
11789
|
+
}), stateDisplay ? /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, {
|
|
11312
11790
|
className: StateTagStyle,
|
|
11313
11791
|
state: stateDisplay
|
|
11314
11792
|
}) : void 0]
|
|
11315
|
-
}), jsxRuntimeExports.jsxs(kit.space, {
|
|
11316
|
-
children: [jsxRuntimeExports.jsxs(kit.radioGroup, {
|
|
11793
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
11794
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.radioGroup, {
|
|
11317
11795
|
value: mode,
|
|
11318
11796
|
onChange: (e) => setMode(e.target.value),
|
|
11319
|
-
children: [jsxRuntimeExports.jsx(kit.radioButton, {
|
|
11797
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.radioButton, {
|
|
11320
11798
|
value: "detail",
|
|
11321
11799
|
children: t("dovetail.detail")
|
|
11322
|
-
}), jsxRuntimeExports.jsx(kit.radioButton, {
|
|
11800
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.radioButton, {
|
|
11323
11801
|
value: "yaml",
|
|
11324
11802
|
children: "YAML"
|
|
11325
11803
|
})]
|
|
11326
|
-
}), jsxRuntimeExports.jsx(Dropdown, {
|
|
11804
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Dropdown, {
|
|
11327
11805
|
record
|
|
11328
11806
|
})]
|
|
11329
11807
|
})]
|
|
11330
11808
|
});
|
|
11331
|
-
const descriptions = jsxRuntimeExports.jsx(kit.row, {
|
|
11809
|
+
const descriptions = /* @__PURE__ */ jsxRuntimeExports.jsx(kit.row, {
|
|
11332
11810
|
gutter: 24,
|
|
11333
11811
|
children: renderFields([...DESCRIPTION_DEFAULT_FIELDS, ...showConfig.descriptions || []])
|
|
11334
11812
|
});
|
|
11335
11813
|
const groups = (showConfig.groups || []).concat([{
|
|
11336
11814
|
fields: LABELS_ANNOTATIONS_GROUP_FIELDS
|
|
11337
|
-
}]).map((group, index) => jsxRuntimeExports.jsx(kit.row, {
|
|
11815
|
+
}]).map((group, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(kit.row, {
|
|
11338
11816
|
gutter: [24, 16],
|
|
11339
11817
|
children: renderFields(group.fields)
|
|
11340
11818
|
}, index));
|
|
11341
|
-
const tabs = jsxRuntimeExports.jsx(kit.tabs, {
|
|
11819
|
+
const tabs = /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tabs, {
|
|
11342
11820
|
className: TabsStyle,
|
|
11343
11821
|
children: (showConfig.tabs || []).map((field) => {
|
|
11344
11822
|
let content;
|
|
11345
11823
|
if (field.renderContent) {
|
|
11346
11824
|
content = field.renderContent(lodashEs.get(record, field.path), record, field);
|
|
11347
11825
|
} else {
|
|
11348
|
-
content = jsxRuntimeExports.jsx("span", {
|
|
11826
|
+
content = /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11349
11827
|
children: lodashEs.get(record, field.path)
|
|
11350
11828
|
});
|
|
11351
11829
|
}
|
|
11352
|
-
return jsxRuntimeExports.jsx(kit.tabsTabPane, {
|
|
11830
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tabsTabPane, {
|
|
11353
11831
|
tab: field.title,
|
|
11354
11832
|
children: content
|
|
11355
11833
|
}, field.key);
|
|
11356
11834
|
})
|
|
11357
11835
|
});
|
|
11358
11836
|
const modeMap = {
|
|
11359
|
-
[
|
|
11360
|
-
|
|
11837
|
+
[
|
|
11838
|
+
"detail"
|
|
11839
|
+
/* Detail */
|
|
11840
|
+
]: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
11841
|
+
children: [groups, /* @__PURE__ */ jsxRuntimeExports.jsx(kit.divider, {}), tabs]
|
|
11361
11842
|
}),
|
|
11362
|
-
[
|
|
11843
|
+
[
|
|
11844
|
+
"yaml"
|
|
11845
|
+
/* Yaml */
|
|
11846
|
+
]: /* @__PURE__ */ jsxRuntimeExports.jsx(MonacoYamlEditor, {
|
|
11363
11847
|
className: EditorStyle,
|
|
11364
11848
|
defaultValue: defaultEditorValue,
|
|
11365
11849
|
schema,
|
|
@@ -11367,13 +11851,13 @@ var __publicField = (obj, key, value) => {
|
|
|
11367
11851
|
readOnly: true
|
|
11368
11852
|
})
|
|
11369
11853
|
};
|
|
11370
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
11854
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11371
11855
|
className: ShowContentWrapperStyle,
|
|
11372
|
-
children: [jsxRuntimeExports.jsxs(kit.space, {
|
|
11856
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
11373
11857
|
direction: "vertical",
|
|
11374
11858
|
className: ShowContentHeaderStyle,
|
|
11375
11859
|
children: [topBar, descriptions]
|
|
11376
|
-
}), jsxRuntimeExports.jsx(kit.divider, {}), modeMap[mode]]
|
|
11860
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.divider, {}), modeMap[mode]]
|
|
11377
11861
|
});
|
|
11378
11862
|
};
|
|
11379
11863
|
const PageShow = (props) => {
|
|
@@ -11382,76 +11866,101 @@ var __publicField = (obj, key, value) => {
|
|
|
11382
11866
|
const parsed = core.useParsed();
|
|
11383
11867
|
const { queryResult } = core.useShow({ id: (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id });
|
|
11384
11868
|
const { isLoading } = queryResult;
|
|
11385
|
-
return isLoading ? jsxRuntimeExports.jsx(kit.loading, {}) : jsxRuntimeExports.jsx(ShowContent, { ...props });
|
|
11869
|
+
return isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.loading, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(ShowContent, { ...props });
|
|
11386
11870
|
};
|
|
11387
|
-
const PodContainersTable = ({
|
|
11871
|
+
const PodContainersTable = ({
|
|
11872
|
+
containerStatuses,
|
|
11873
|
+
initContainerStatuses
|
|
11874
|
+
}) => {
|
|
11388
11875
|
const kit = eagle.useUIKit();
|
|
11389
11876
|
const { i18n: i18n2 } = useTranslation();
|
|
11390
|
-
const columns = React.useMemo(
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11877
|
+
const columns = React.useMemo(
|
|
11878
|
+
() => [
|
|
11879
|
+
{
|
|
11880
|
+
key: "state",
|
|
11881
|
+
dataIndex: ["state"],
|
|
11882
|
+
title: i18n2.t("dovetail.state"),
|
|
11883
|
+
sortable: true,
|
|
11884
|
+
sorter: CommonSorter(["state"]),
|
|
11885
|
+
render: (v) => /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, { state: Object.keys(v)[0] })
|
|
11886
|
+
},
|
|
11887
|
+
{
|
|
11888
|
+
key: "ready",
|
|
11889
|
+
dataIndex: ["ready"],
|
|
11890
|
+
title: i18n2.t("dovetail.ready"),
|
|
11891
|
+
sortable: true,
|
|
11892
|
+
sorter: CommonSorter(["ready"]),
|
|
11893
|
+
render: (v) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11894
|
+
eagle.Icon,
|
|
11895
|
+
{
|
|
11896
|
+
src: v ? iconsReact.CheckmarkDoneSuccessCorrect16BoldGreenIcon : iconsReact.XmarkFailed16BoldRedIcon
|
|
11897
|
+
}
|
|
11898
|
+
)
|
|
11899
|
+
},
|
|
11900
|
+
{
|
|
11901
|
+
key: "name",
|
|
11902
|
+
dataIndex: ["name"],
|
|
11903
|
+
title: i18n2.t("dovetail.name"),
|
|
11904
|
+
sortable: true,
|
|
11905
|
+
sorter: CommonSorter(["name"])
|
|
11906
|
+
},
|
|
11907
|
+
{
|
|
11908
|
+
key: "image",
|
|
11909
|
+
dataIndex: ["image"],
|
|
11910
|
+
title: i18n2.t("dovetail.image"),
|
|
11911
|
+
sortable: true,
|
|
11912
|
+
sorter: CommonSorter(["image"])
|
|
11913
|
+
},
|
|
11914
|
+
{
|
|
11915
|
+
key: "init",
|
|
11916
|
+
dataIndex: [],
|
|
11917
|
+
title: i18n2.t("dovetail.init_container"),
|
|
11918
|
+
render: (_, record) => {
|
|
11919
|
+
const isInit = initContainerStatuses.some(
|
|
11920
|
+
(c) => c.containerID === record.containerID
|
|
11921
|
+
);
|
|
11922
|
+
if (isInit) {
|
|
11923
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.CheckmarkDoneSuccessCorrect16BoldGreenIcon });
|
|
11924
|
+
}
|
|
11925
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "-" });
|
|
11926
|
+
}
|
|
11927
|
+
},
|
|
11928
|
+
{
|
|
11929
|
+
key: "restartCount",
|
|
11930
|
+
dataIndex: ["restartCount"],
|
|
11931
|
+
title: i18n2.t("dovetail.restarts"),
|
|
11932
|
+
sortable: true,
|
|
11933
|
+
sorter: CommonSorter(["restartCount"])
|
|
11934
|
+
},
|
|
11935
|
+
{
|
|
11936
|
+
key: "started",
|
|
11937
|
+
dataIndex: ["state", "running", "startedAt"],
|
|
11938
|
+
title: i18n2.t("dovetail.started"),
|
|
11939
|
+
sortable: true,
|
|
11940
|
+
sorter: CommonSorter(["state", "running", "startedAt"]),
|
|
11941
|
+
render: (value) => {
|
|
11942
|
+
if (value)
|
|
11943
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: new Date(value) });
|
|
11944
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "-" });
|
|
11429
11945
|
}
|
|
11430
|
-
return jsxRuntimeExports.jsx("span", { children: "-" });
|
|
11431
11946
|
}
|
|
11432
|
-
|
|
11433
|
-
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
|
|
11947
|
+
],
|
|
11948
|
+
[i18n2, initContainerStatuses]
|
|
11949
|
+
);
|
|
11950
|
+
const dataSource = React.useMemo(
|
|
11951
|
+
() => addId(containerStatuses.concat(initContainerStatuses), "containerID"),
|
|
11952
|
+
[containerStatuses, initContainerStatuses]
|
|
11953
|
+
);
|
|
11954
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11955
|
+
kit.table,
|
|
11440
11956
|
{
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
render: (value) => {
|
|
11447
|
-
if (value)
|
|
11448
|
-
return jsxRuntimeExports.jsx(Time, { date: new Date(value) });
|
|
11449
|
-
return jsxRuntimeExports.jsx("span", { children: "-" });
|
|
11450
|
-
}
|
|
11957
|
+
loading: false,
|
|
11958
|
+
dataSource,
|
|
11959
|
+
columns,
|
|
11960
|
+
rowKey: "containerID",
|
|
11961
|
+
error: false
|
|
11451
11962
|
}
|
|
11452
|
-
|
|
11453
|
-
const dataSource = React.useMemo(() => addId(containerStatuses.concat(initContainerStatuses), "containerID"), [containerStatuses, initContainerStatuses]);
|
|
11454
|
-
return jsxRuntimeExports.jsx(kit.table, { loading: false, dataSource, columns, rowKey: "containerID", error: false });
|
|
11963
|
+
);
|
|
11455
11964
|
};
|
|
11456
11965
|
function WorkloadDropdown(props) {
|
|
11457
11966
|
const { record } = props;
|
|
@@ -11459,21 +11968,27 @@ var __publicField = (obj, key, value) => {
|
|
|
11459
11968
|
const { resource } = core.useResource();
|
|
11460
11969
|
const { mutate } = core.useUpdate();
|
|
11461
11970
|
const { t } = useTranslation();
|
|
11462
|
-
return jsxRuntimeExports.jsx(K8sDropdown, { record, children: jsxRuntimeExports.jsx(
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11971
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(K8sDropdown, { record, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11972
|
+
kit.menu.Item,
|
|
11973
|
+
{
|
|
11974
|
+
onClick: () => {
|
|
11975
|
+
const v = record.redeploy();
|
|
11976
|
+
const id = v.id;
|
|
11977
|
+
pruneBeforeEdit(v);
|
|
11978
|
+
mutate({
|
|
11979
|
+
id,
|
|
11980
|
+
resource: (resource == null ? void 0 : resource.name) || "",
|
|
11981
|
+
values: v
|
|
11982
|
+
});
|
|
11983
|
+
},
|
|
11984
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.DynamicResourceSchedule16BlueIcon, children: t("dovetail.redeploy") })
|
|
11985
|
+
}
|
|
11986
|
+
) });
|
|
11472
11987
|
}
|
|
11473
11988
|
const ComponentContext = React.createContext({});
|
|
11474
|
-
const
|
|
11475
|
-
const ListPageStyle = "
|
|
11476
|
-
const TableStyle = "
|
|
11989
|
+
const index_3lw8k1 = "";
|
|
11990
|
+
const ListPageStyle = "laykzsq";
|
|
11991
|
+
const TableStyle = "t1ng0psc";
|
|
11477
11992
|
function ListPage(props) {
|
|
11478
11993
|
const {
|
|
11479
11994
|
title,
|
|
@@ -11484,12 +11999,12 @@ var __publicField = (obj, key, value) => {
|
|
|
11484
11999
|
Table: TableComponent
|
|
11485
12000
|
} = React.useContext(ComponentContext);
|
|
11486
12001
|
const Table$1 = TableComponent || Table;
|
|
11487
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
12002
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11488
12003
|
className: ListPageStyle,
|
|
11489
|
-
children: [jsxRuntimeExports.jsx(TableToolBar, {
|
|
12004
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
|
|
11490
12005
|
title,
|
|
11491
12006
|
selectedKeys
|
|
11492
|
-
}), jsxRuntimeExports.jsx(Table$1, {
|
|
12007
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Table$1, {
|
|
11493
12008
|
...tableProps,
|
|
11494
12009
|
className: cx_default(tableProps.className, TableStyle),
|
|
11495
12010
|
scroll: {
|
|
@@ -11510,11 +12025,18 @@ var __publicField = (obj, key, value) => {
|
|
|
11510
12025
|
formatter,
|
|
11511
12026
|
Dropdown
|
|
11512
12027
|
});
|
|
11513
|
-
return jsxRuntimeExports.jsx(ListPage, { title: name2 || "", selectedKeys, tableProps });
|
|
12028
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ListPage, { title: name2 || "", selectedKeys, tableProps });
|
|
11514
12029
|
}
|
|
11515
12030
|
function ResourceShow(props) {
|
|
11516
12031
|
const { formatter, showConfig, Dropdown } = props;
|
|
11517
|
-
return jsxRuntimeExports.jsx(
|
|
12032
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12033
|
+
PageShow,
|
|
12034
|
+
{
|
|
12035
|
+
showConfig,
|
|
12036
|
+
formatter,
|
|
12037
|
+
Dropdown
|
|
12038
|
+
}
|
|
12039
|
+
);
|
|
11518
12040
|
}
|
|
11519
12041
|
function ResourceForm(props) {
|
|
11520
12042
|
const { config } = props;
|
|
@@ -11523,17 +12045,40 @@ var __publicField = (obj, key, value) => {
|
|
|
11523
12045
|
initialValues: getInitialValues(config)
|
|
11524
12046
|
};
|
|
11525
12047
|
}, [config]);
|
|
11526
|
-
return jsxRuntimeExports.jsx(
|
|
12048
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12049
|
+
YamlForm,
|
|
12050
|
+
{
|
|
12051
|
+
...formProps
|
|
12052
|
+
}
|
|
12053
|
+
);
|
|
11527
12054
|
}
|
|
11528
12055
|
function ResourceCRUD(props) {
|
|
11529
12056
|
const { configs, urlPrefix } = props;
|
|
11530
|
-
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: configs.map((config) => {
|
|
12057
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: configs.map((config) => {
|
|
11531
12058
|
var _a, _b;
|
|
11532
|
-
return jsxRuntimeExports.jsxs(React.Fragment, { children: [
|
|
11533
|
-
jsxRuntimeExports.jsx(reactRouterDom.Route, { path: `${urlPrefix}/${config.name}`, exact: true, children:
|
|
11534
|
-
|
|
12059
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(React.Fragment, { children: [
|
|
12060
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Route, { path: `${urlPrefix}/${config.name}`, exact: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12061
|
+
ResourceList,
|
|
12062
|
+
{
|
|
12063
|
+
name: config.kind,
|
|
12064
|
+
formatter: config.formatter,
|
|
12065
|
+
columns: ((_a = config.columns) == null ? void 0 : _a.call(config)) || [],
|
|
12066
|
+
Dropdown: config.Dropdown
|
|
12067
|
+
}
|
|
12068
|
+
) }),
|
|
12069
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Route, { path: `${urlPrefix}/${config.name}/show`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12070
|
+
ResourceShow,
|
|
12071
|
+
{
|
|
12072
|
+
formatter: config.formatter,
|
|
12073
|
+
showConfig: ((_b = config.showConfig) == null ? void 0 : _b.call(config)) || {},
|
|
12074
|
+
Dropdown: config.Dropdown
|
|
12075
|
+
}
|
|
12076
|
+
) }),
|
|
11535
12077
|
// the modals would render in ModalStack
|
|
11536
|
-
config.formType ===
|
|
12078
|
+
config.formType === FormType.PAGE ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
12079
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Route, { path: `${urlPrefix}/${config.name}/create`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceForm, { config }) }),
|
|
12080
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Route, { path: `${urlPrefix}/${config.name}/edit`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceForm, { config }) })
|
|
12081
|
+
] }) : null
|
|
11537
12082
|
] }, config.name);
|
|
11538
12083
|
}) });
|
|
11539
12084
|
}
|
|
@@ -11545,21 +12090,35 @@ var __publicField = (obj, key, value) => {
|
|
|
11545
12090
|
const { mutate } = core.useUpdate();
|
|
11546
12091
|
const { t } = useTranslation();
|
|
11547
12092
|
const suspended2 = Boolean(spec == null ? void 0 : spec.suspend);
|
|
11548
|
-
return jsxRuntimeExports.jsx(K8sDropdown, { record, children: jsxRuntimeExports.jsx(
|
|
11549
|
-
|
|
11550
|
-
|
|
11551
|
-
|
|
11552
|
-
|
|
11553
|
-
|
|
11554
|
-
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
|
|
12093
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(K8sDropdown, { record, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12094
|
+
kit.menu.Item,
|
|
12095
|
+
{
|
|
12096
|
+
onClick: () => {
|
|
12097
|
+
const v = suspended2 ? record.resume() : record.suspend();
|
|
12098
|
+
const id = record.id;
|
|
12099
|
+
pruneBeforeEdit(v);
|
|
12100
|
+
mutate({
|
|
12101
|
+
id,
|
|
12102
|
+
resource: (resource == null ? void 0 : resource.name) || "",
|
|
12103
|
+
values: v
|
|
12104
|
+
});
|
|
12105
|
+
},
|
|
12106
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: suspended2 ? iconsReact.VmResume16Icon : iconsReact.SuspendedPause16GradientGrayIcon, children: t(suspended2 ? "dovetail.resume" : "dovetail.suspend") })
|
|
12107
|
+
}
|
|
12108
|
+
) });
|
|
11558
12109
|
}
|
|
11559
12110
|
const UNITS = ["", "K", "M", "G", "T", "P"];
|
|
11560
12111
|
const FRACTIONAL = ["", "m", "u", "n", "p", "f"];
|
|
11561
12112
|
function formatSi(inValue, options) {
|
|
11562
|
-
const {
|
|
12113
|
+
const {
|
|
12114
|
+
increment = 1e3,
|
|
12115
|
+
suffix = null,
|
|
12116
|
+
firstSuffix = null,
|
|
12117
|
+
startingExponent = 0,
|
|
12118
|
+
minExponent = 0,
|
|
12119
|
+
maxPrecision = 2,
|
|
12120
|
+
atLeastOne = true
|
|
12121
|
+
} = options || {};
|
|
11563
12122
|
let val = inValue;
|
|
11564
12123
|
let exp = startingExponent;
|
|
11565
12124
|
while (val >= increment && exp + 1 < UNITS.length || exp < minExponent) {
|
|
@@ -11617,8 +12176,8 @@ var __publicField = (obj, key, value) => {
|
|
|
11617
12176
|
}
|
|
11618
12177
|
return val;
|
|
11619
12178
|
}
|
|
11620
|
-
const
|
|
11621
|
-
const WrapperStyle = "
|
|
12179
|
+
const index_1wzdp7m = "";
|
|
12180
|
+
const WrapperStyle = "wfg6u6g";
|
|
11622
12181
|
const InnerBar = ({
|
|
11623
12182
|
usage: usage2,
|
|
11624
12183
|
requestNum,
|
|
@@ -11630,33 +12189,33 @@ var __publicField = (obj, key, value) => {
|
|
|
11630
12189
|
const usageInRequestPercent = 100 * Math.min(usageNum / requestNum, 1);
|
|
11631
12190
|
const usageInRequestToLimitPercent = 100 * Math.min(Math.max(usageNum - requestNum, 0) / (totalNum - requestNum), 1);
|
|
11632
12191
|
const noLimit = limitNum === 0;
|
|
11633
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
12192
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11634
12193
|
className: "usage-bar",
|
|
11635
12194
|
style: {
|
|
11636
12195
|
marginLeft: 4
|
|
11637
12196
|
},
|
|
11638
|
-
children: [jsxRuntimeExports.jsx("div", {
|
|
12197
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11639
12198
|
className: "request-anchor",
|
|
11640
12199
|
style: {
|
|
11641
12200
|
left: `${requestPercent}%`
|
|
11642
12201
|
}
|
|
11643
|
-
}), jsxRuntimeExports.jsx("div", {
|
|
12202
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11644
12203
|
className: "request-bar",
|
|
11645
12204
|
style: {
|
|
11646
12205
|
width: `${requestPercent}%`
|
|
11647
12206
|
},
|
|
11648
|
-
children: jsxRuntimeExports.jsx("div", {
|
|
12207
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11649
12208
|
className: "usage-fill-bar",
|
|
11650
12209
|
style: {
|
|
11651
12210
|
width: `${usageInRequestPercent}%`
|
|
11652
12211
|
}
|
|
11653
12212
|
})
|
|
11654
|
-
}), jsxRuntimeExports.jsx("div", {
|
|
12213
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11655
12214
|
className: cx_default("request-to-limit-bar", noLimit && "no-limit", usageInRequestToLimitPercent > 0 && "exceed-request"),
|
|
11656
12215
|
style: {
|
|
11657
12216
|
width: `${100 - requestPercent}%`
|
|
11658
12217
|
},
|
|
11659
|
-
children: !noLimit && jsxRuntimeExports.jsx("div", {
|
|
12218
|
+
children: !noLimit && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11660
12219
|
className: "usage-fill-bar",
|
|
11661
12220
|
style: {
|
|
11662
12221
|
width: `${usageInRequestToLimitPercent}%`
|
|
@@ -11670,12 +12229,12 @@ var __publicField = (obj, key, value) => {
|
|
|
11670
12229
|
usage: usage2,
|
|
11671
12230
|
requestNum
|
|
11672
12231
|
} = props;
|
|
11673
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
12232
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11674
12233
|
className: cx_default("usage-wrapper", WrapperStyle),
|
|
11675
|
-
children: [jsxRuntimeExports.jsx("div", {
|
|
12234
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11676
12235
|
className: "usage-text",
|
|
11677
12236
|
children: usage2
|
|
11678
|
-
}), requestNum > 0 && jsxRuntimeExports.jsx(InnerBar, {
|
|
12237
|
+
}), requestNum > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(InnerBar, {
|
|
11679
12238
|
...props
|
|
11680
12239
|
})]
|
|
11681
12240
|
});
|
|
@@ -11685,11 +12244,16 @@ var __publicField = (obj, key, value) => {
|
|
|
11685
12244
|
const { id } = core.useParsed();
|
|
11686
12245
|
const kit = eagle.useUIKit();
|
|
11687
12246
|
const { t } = useTranslation();
|
|
11688
|
-
const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
|
|
11689
|
-
|
|
12247
|
+
const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
|
|
12248
|
+
(resource == null ? void 0 : resource.name) || ""
|
|
12249
|
+
);
|
|
12250
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
12251
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", danger: true, onClick: () => openDeleteConfirmModal(id || ""), children: t("dovetail.delete") }),
|
|
12252
|
+
visible ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.modal, { ...modalProps }) : null
|
|
12253
|
+
] });
|
|
11690
12254
|
};
|
|
11691
|
-
const
|
|
11692
|
-
const MenuStyle = "
|
|
12255
|
+
const index_1wt5px2 = "";
|
|
12256
|
+
const MenuStyle = "mdppgn0";
|
|
11693
12257
|
const Menu = () => {
|
|
11694
12258
|
const kit = eagle.useUIKit();
|
|
11695
12259
|
const {
|
|
@@ -11697,17 +12261,17 @@ var __publicField = (obj, key, value) => {
|
|
|
11697
12261
|
selectedKey
|
|
11698
12262
|
} = core.useMenu();
|
|
11699
12263
|
function renderMenuItems(items) {
|
|
11700
|
-
return items.map((item) => item.list ? jsxRuntimeExports.jsx(kit.menuItem, {
|
|
11701
|
-
children: jsxRuntimeExports.jsx(reactRouterDom.NavLink, {
|
|
12264
|
+
return items.map((item) => item.list ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.menuItem, {
|
|
12265
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.NavLink, {
|
|
11702
12266
|
to: item.route || "",
|
|
11703
12267
|
children: item.label
|
|
11704
12268
|
})
|
|
11705
|
-
}, item.key) : jsxRuntimeExports.jsx(kit.menuItemGroup, {
|
|
12269
|
+
}, item.key) : /* @__PURE__ */ jsxRuntimeExports.jsx(kit.menuItemGroup, {
|
|
11706
12270
|
title: item.name,
|
|
11707
12271
|
children: renderMenuItems(item.children)
|
|
11708
12272
|
}, item.key));
|
|
11709
12273
|
}
|
|
11710
|
-
return jsxRuntimeExports.jsx(kit.menu, {
|
|
12274
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.menu, {
|
|
11711
12275
|
className: MenuStyle,
|
|
11712
12276
|
theme: "light",
|
|
11713
12277
|
selectedKeys: [selectedKey],
|
|
@@ -11862,21 +12426,30 @@ var __publicField = (obj, key, value) => {
|
|
|
11862
12426
|
}
|
|
11863
12427
|
});
|
|
11864
12428
|
const [value, setValue] = useLocalStorage(NS_STORE_KEY, ALL_NS);
|
|
11865
|
-
return jsxRuntimeExports.jsxs(
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
12429
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
12430
|
+
kit.select,
|
|
12431
|
+
{
|
|
12432
|
+
input: {
|
|
12433
|
+
value,
|
|
12434
|
+
onChange(value2) {
|
|
12435
|
+
setValue(value2);
|
|
12436
|
+
}
|
|
12437
|
+
},
|
|
12438
|
+
children: [
|
|
12439
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, { value: "_all", children: t("dovetail.all_namespaces") }, "_all"),
|
|
12440
|
+
data2 == null ? void 0 : data2.data.map((namespace2) => {
|
|
12441
|
+
const { name: name2 } = namespace2.metadata;
|
|
12442
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, { value: name2, children: name2 }, name2);
|
|
12443
|
+
})
|
|
12444
|
+
]
|
|
12445
|
+
}
|
|
12446
|
+
);
|
|
11874
12447
|
};
|
|
11875
|
-
const
|
|
11876
|
-
const HeaderStyle = "
|
|
11877
|
-
const ContentLayoutStyle = "
|
|
11878
|
-
const SiderStyle = "
|
|
11879
|
-
const ContentStyle = "
|
|
12448
|
+
const index_1q7s7td = "";
|
|
12449
|
+
const HeaderStyle = "h16z07g";
|
|
12450
|
+
const ContentLayoutStyle = "c1i80kj";
|
|
12451
|
+
const SiderStyle = "s18sezq1";
|
|
12452
|
+
const ContentStyle = "cyc9hl2";
|
|
11880
12453
|
const Layout = ({
|
|
11881
12454
|
children
|
|
11882
12455
|
}) => {
|
|
@@ -11887,28 +12460,28 @@ var __publicField = (obj, key, value) => {
|
|
|
11887
12460
|
Content,
|
|
11888
12461
|
Sider
|
|
11889
12462
|
} = kit.layout;
|
|
11890
|
-
return jsxRuntimeExports.jsxs(kit.layout, {
|
|
12463
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.layout, {
|
|
11891
12464
|
style: {
|
|
11892
12465
|
height: "100%"
|
|
11893
12466
|
},
|
|
11894
|
-
children: [jsxRuntimeExports.jsxs(Header, {
|
|
12467
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs(Header, {
|
|
11895
12468
|
className: cx_default(HeaderStyle, eagle.Typo.Heading.h1_bold_title),
|
|
11896
|
-
children: ["Dovetail 2", jsxRuntimeExports.jsx("div", {
|
|
12469
|
+
children: ["Dovetail 2", /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11897
12470
|
style: {
|
|
11898
12471
|
width: 300
|
|
11899
12472
|
},
|
|
11900
|
-
children: jsxRuntimeExports.jsx(NamespacesFilter, {})
|
|
12473
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(NamespacesFilter, {})
|
|
11901
12474
|
})]
|
|
11902
|
-
}), jsxRuntimeExports.jsxs(kit.layout, {
|
|
12475
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.layout, {
|
|
11903
12476
|
className: ContentLayoutStyle,
|
|
11904
|
-
children: [jsxRuntimeExports.jsx(Sider, {
|
|
12477
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Sider, {
|
|
11905
12478
|
width: 256,
|
|
11906
12479
|
className: SiderStyle,
|
|
11907
12480
|
theme: "light",
|
|
11908
12481
|
collapsed,
|
|
11909
12482
|
onCollapse: (value) => setCollapsed(value),
|
|
11910
|
-
children: jsxRuntimeExports.jsx(Menu, {})
|
|
11911
|
-
}), jsxRuntimeExports.jsx(Content, {
|
|
12483
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu, {})
|
|
12484
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Content, {
|
|
11912
12485
|
className: ContentStyle,
|
|
11913
12486
|
children
|
|
11914
12487
|
})]
|
|
@@ -11922,28 +12495,52 @@ var __publicField = (obj, key, value) => {
|
|
|
11922
12495
|
const nav = core.useNavigation();
|
|
11923
12496
|
const { queryResult } = core.useShow({ id: (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id });
|
|
11924
12497
|
const { isLoading } = queryResult;
|
|
11925
|
-
return
|
|
12498
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12499
|
+
antd.Drawer,
|
|
12500
|
+
{
|
|
12501
|
+
title: "Show Drawer",
|
|
12502
|
+
placement: "right",
|
|
12503
|
+
onClose: () => nav.goBack(),
|
|
12504
|
+
width: "50%",
|
|
12505
|
+
visible: !!((_b = parsed == null ? void 0 : parsed.params) == null ? void 0 : _b.id),
|
|
12506
|
+
children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.loading, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(ShowContent, { ...props })
|
|
12507
|
+
}
|
|
12508
|
+
);
|
|
11926
12509
|
};
|
|
11927
12510
|
const EditButton = () => {
|
|
11928
12511
|
const { id } = core.useParsed();
|
|
11929
12512
|
const kit = eagle.useUIKit();
|
|
11930
12513
|
const { edit: edit2 } = useEdit();
|
|
11931
|
-
return jsxRuntimeExports.jsx(
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
12514
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12515
|
+
kit.button,
|
|
12516
|
+
{
|
|
12517
|
+
type: "primary",
|
|
12518
|
+
onClick: () => {
|
|
12519
|
+
if (id)
|
|
12520
|
+
edit2(id);
|
|
12521
|
+
},
|
|
12522
|
+
children: "Edit"
|
|
12523
|
+
}
|
|
12524
|
+
);
|
|
11935
12525
|
};
|
|
11936
12526
|
const ReferenceLink = (props) => {
|
|
11937
12527
|
const { ownerReference, namespace: namespace2 } = props;
|
|
11938
12528
|
const configs = React.useContext(ConfigsContext);
|
|
11939
12529
|
if (ownerReference.kind === "ReplicaSet") {
|
|
11940
|
-
return jsxRuntimeExports.jsx("span", { children: ownerReference.name });
|
|
12530
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: ownerReference.name });
|
|
11941
12531
|
}
|
|
11942
12532
|
const resource = Object.values(configs).find((c) => c.kind === ownerReference.kind);
|
|
11943
12533
|
if (!resource) {
|
|
11944
|
-
return jsxRuntimeExports.jsx("span", { children: "-" });
|
|
12534
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "-" });
|
|
11945
12535
|
}
|
|
11946
|
-
return jsxRuntimeExports.jsx(
|
|
12536
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12537
|
+
ResourceLink,
|
|
12538
|
+
{
|
|
12539
|
+
resourceId: ownerReference.name,
|
|
12540
|
+
name: resource.name || "",
|
|
12541
|
+
namespace: namespace2
|
|
12542
|
+
}
|
|
12543
|
+
);
|
|
11947
12544
|
};
|
|
11948
12545
|
function __rest(s, e) {
|
|
11949
12546
|
var t = {};
|
|
@@ -17536,8 +18133,8 @@ var __publicField = (obj, key, value) => {
|
|
|
17536
18133
|
const LogViewer = React.forwardRef((props, ref) => React.createElement(LogViewerBase, Object.assign({ innerRef: ref }, props)));
|
|
17537
18134
|
LogViewer.displayName = "LogViewer";
|
|
17538
18135
|
const baseNoReset = "";
|
|
17539
|
-
const
|
|
17540
|
-
const ToolbarStyle = "
|
|
18136
|
+
const index_645izu = "";
|
|
18137
|
+
const ToolbarStyle = "tve7dfm";
|
|
17541
18138
|
const PodLog = ({
|
|
17542
18139
|
pod
|
|
17543
18140
|
}) => {
|
|
@@ -17645,10 +18242,10 @@ var __publicField = (obj, key, value) => {
|
|
|
17645
18242
|
stopFetchingLogs();
|
|
17646
18243
|
};
|
|
17647
18244
|
}, [fetchLogs, stopFetchingLogs]);
|
|
17648
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
17649
|
-
children: [jsxRuntimeExports.jsxs("div", {
|
|
18245
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
18246
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
17650
18247
|
className: ToolbarStyle,
|
|
17651
|
-
children: [jsxRuntimeExports.jsxs(kit.select, {
|
|
18248
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.select, {
|
|
17652
18249
|
input: {
|
|
17653
18250
|
onChange: (newValue) => {
|
|
17654
18251
|
stopFetchingLogs();
|
|
@@ -17659,31 +18256,31 @@ var __publicField = (obj, key, value) => {
|
|
|
17659
18256
|
},
|
|
17660
18257
|
value: selectedContainer
|
|
17661
18258
|
},
|
|
17662
|
-
children: [jsxRuntimeExports.jsx(kit.option, {
|
|
18259
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, {
|
|
17663
18260
|
value: "",
|
|
17664
18261
|
disabled: true,
|
|
17665
18262
|
children: t("dovetail.select_container")
|
|
17666
|
-
}), (((_e = pod.spec) == null ? void 0 : _e.containers) || []).map((container2) => jsxRuntimeExports.jsx(kit.option, {
|
|
18263
|
+
}), (((_e = pod.spec) == null ? void 0 : _e.containers) || []).map((container2) => /* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, {
|
|
17667
18264
|
value: container2.name,
|
|
17668
18265
|
children: container2.name
|
|
17669
18266
|
}, container2.name))]
|
|
17670
|
-
}), jsxRuntimeExports.jsx(kit.checkbox, {
|
|
18267
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.checkbox, {
|
|
17671
18268
|
checked: wrap2,
|
|
17672
18269
|
onChange: (e) => setWrap(e.target.checked),
|
|
17673
18270
|
children: t("dovetail.wrap")
|
|
17674
|
-
}), jsxRuntimeExports.jsx(kit.button, {
|
|
18271
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
17675
18272
|
onClick: () => setPaused((prev) => !prev),
|
|
17676
|
-
prefixIcon: paused ? jsxRuntimeExports.jsx(iconsReact.Resume24Icon, {}) : jsxRuntimeExports.jsx(iconsReact.SuspendedPause24GradientOrangeIcon, {}),
|
|
18273
|
+
prefixIcon: paused ? /* @__PURE__ */ jsxRuntimeExports.jsx(iconsReact.Resume24Icon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(iconsReact.SuspendedPause24GradientOrangeIcon, {}),
|
|
17677
18274
|
children: paused ? t("dovetail.resume_log") : t("dovetail.suspend")
|
|
17678
18275
|
})]
|
|
17679
|
-
}), jsxRuntimeExports.jsx(LogViewer, {
|
|
18276
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(LogViewer, {
|
|
17680
18277
|
innerRef: logViewerRef,
|
|
17681
18278
|
hasLineNumbers: true,
|
|
17682
18279
|
height: 300,
|
|
17683
18280
|
data: logs,
|
|
17684
18281
|
theme: "light",
|
|
17685
18282
|
isTextWrapped: wrap2,
|
|
17686
|
-
footer: paused && jsxRuntimeExports.jsxs(kit.button, {
|
|
18283
|
+
footer: paused && /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.button, {
|
|
17687
18284
|
type: "primary",
|
|
17688
18285
|
style: {
|
|
17689
18286
|
borderRadius: 0
|
|
@@ -17702,9 +18299,9 @@ var __publicField = (obj, key, value) => {
|
|
|
17702
18299
|
const peers = lodashEs.get(gress, "from") || lodashEs.get(gress, "to");
|
|
17703
18300
|
if (!peers)
|
|
17704
18301
|
return null;
|
|
17705
|
-
return jsxRuntimeExports.jsx(IngressRuleTable, { peers }, i);
|
|
18302
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IngressRuleTable, { peers }, i);
|
|
17706
18303
|
});
|
|
17707
|
-
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: result });
|
|
18304
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: result });
|
|
17708
18305
|
};
|
|
17709
18306
|
const IngressRuleTable = ({ peers }) => {
|
|
17710
18307
|
const kit = eagle.useUIKit();
|
|
@@ -17735,7 +18332,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17735
18332
|
title: "CIDR",
|
|
17736
18333
|
sortable: true,
|
|
17737
18334
|
render(v) {
|
|
17738
|
-
return jsxRuntimeExports.jsx("span", { children: v || "-" });
|
|
18335
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: v || "-" });
|
|
17739
18336
|
}
|
|
17740
18337
|
},
|
|
17741
18338
|
{
|
|
@@ -17747,7 +18344,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17747
18344
|
render: (except) => {
|
|
17748
18345
|
if (!except)
|
|
17749
18346
|
return "-";
|
|
17750
|
-
return except == null ? void 0 : except.map((str) => jsxRuntimeExports.jsx("div", { children: str }, str));
|
|
18347
|
+
return except == null ? void 0 : except.map((str) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: str }, str));
|
|
17751
18348
|
}
|
|
17752
18349
|
},
|
|
17753
18350
|
{
|
|
@@ -17757,22 +18354,42 @@ var __publicField = (obj, key, value) => {
|
|
|
17757
18354
|
title: "Match Labels",
|
|
17758
18355
|
sortable: true,
|
|
17759
18356
|
render(matchLabels) {
|
|
17760
|
-
return jsxRuntimeExports.jsx(Tags, { value: matchLabels });
|
|
18357
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tags, { value: matchLabels });
|
|
17761
18358
|
}
|
|
17762
18359
|
}
|
|
17763
18360
|
];
|
|
17764
18361
|
if (rows.length === 0) {
|
|
17765
|
-
return jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
18362
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
17766
18363
|
}
|
|
17767
|
-
return jsxRuntimeExports.jsx(
|
|
18364
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18365
|
+
kit.table,
|
|
18366
|
+
{
|
|
18367
|
+
loading: false,
|
|
18368
|
+
dataSource: rows,
|
|
18369
|
+
columns,
|
|
18370
|
+
rowKey: "type",
|
|
18371
|
+
empty: t("dovetail.empty")
|
|
18372
|
+
}
|
|
18373
|
+
);
|
|
17768
18374
|
};
|
|
17769
18375
|
const IngressRulesComponent = ({ ingress }) => {
|
|
17770
18376
|
const kit = eagle.useUIKit();
|
|
17771
18377
|
const result = ingress.flattenedRules.map((r) => {
|
|
17772
18378
|
const divider = " > ";
|
|
17773
|
-
return jsxRuntimeExports.jsxs("div", { children: [
|
|
18379
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
18380
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.Link, { disabled: !r.host, href: r.fullPath, children: r.fullPath }),
|
|
18381
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: divider }),
|
|
18382
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18383
|
+
ResourceLink,
|
|
18384
|
+
{
|
|
18385
|
+
name: "services",
|
|
18386
|
+
namespace: ingress.metadata.namespace || "default",
|
|
18387
|
+
resourceId: r.serviceName
|
|
18388
|
+
}
|
|
18389
|
+
)
|
|
18390
|
+
] }, r.fullPath);
|
|
17774
18391
|
});
|
|
17775
|
-
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: result });
|
|
18392
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: result });
|
|
17776
18393
|
};
|
|
17777
18394
|
function getSecondsDiff(startDate, endDate) {
|
|
17778
18395
|
return Math.round(Math.abs(Date.parse(endDate) - Date.parse(startDate)) / 1e3);
|
|
@@ -17828,17 +18445,24 @@ var __publicField = (obj, key, value) => {
|
|
|
17828
18445
|
const navigation = core.useNavigation();
|
|
17829
18446
|
const parsed = core.useParsed();
|
|
17830
18447
|
const resourceName = resource || ((_a = parsed.resource) == null ? void 0 : _a.name) || "";
|
|
17831
|
-
return jsxRuntimeExports.jsx(
|
|
17832
|
-
|
|
17833
|
-
|
|
17834
|
-
|
|
17835
|
-
|
|
18448
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18449
|
+
kit.button,
|
|
18450
|
+
{
|
|
18451
|
+
type: "link",
|
|
18452
|
+
onClick: () => {
|
|
18453
|
+
go({
|
|
18454
|
+
to: navigation.showUrl(resourceName, ""),
|
|
18455
|
+
query: {
|
|
18456
|
+
id
|
|
18457
|
+
},
|
|
18458
|
+
options: {
|
|
18459
|
+
keepQuery: true
|
|
18460
|
+
}
|
|
18461
|
+
});
|
|
17836
18462
|
},
|
|
17837
|
-
|
|
17838
|
-
|
|
17839
|
-
|
|
17840
|
-
});
|
|
17841
|
-
}, children: name2 });
|
|
18463
|
+
children: name2
|
|
18464
|
+
}
|
|
18465
|
+
);
|
|
17842
18466
|
};
|
|
17843
18467
|
const CommonSorter = (dataIndex) => (a, b) => {
|
|
17844
18468
|
const valA = lodashExports.get(a, dataIndex);
|
|
@@ -17859,7 +18483,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17859
18483
|
sortable: true,
|
|
17860
18484
|
sorter: CommonSorter(dataIndex),
|
|
17861
18485
|
render: (v, record) => {
|
|
17862
|
-
return jsxRuntimeExports.jsx(NameLink, { name: v, id: record.id, resource });
|
|
18486
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(NameLink, { name: v, id: record.id, resource });
|
|
17863
18487
|
}
|
|
17864
18488
|
};
|
|
17865
18489
|
};
|
|
@@ -17883,7 +18507,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17883
18507
|
title: i18n2.t("dovetail.state"),
|
|
17884
18508
|
sortable: true,
|
|
17885
18509
|
sorter: CommonSorter(dataIndex),
|
|
17886
|
-
render: (v) => jsxRuntimeExports.jsx(StateTag, { state: v })
|
|
18510
|
+
render: (v) => /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, { state: v })
|
|
17887
18511
|
};
|
|
17888
18512
|
};
|
|
17889
18513
|
const WorkloadImageColumnRenderer = (i18n2) => {
|
|
@@ -17896,7 +18520,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17896
18520
|
sortable: true,
|
|
17897
18521
|
sorter: CommonSorter(dataIndex),
|
|
17898
18522
|
render(value, record) {
|
|
17899
|
-
return jsxRuntimeExports.jsx(ImageNames, { value: record.imageNames });
|
|
18523
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ImageNames, { value: record.imageNames });
|
|
17900
18524
|
}
|
|
17901
18525
|
};
|
|
17902
18526
|
};
|
|
@@ -17920,7 +18544,11 @@ var __publicField = (obj, key, value) => {
|
|
|
17920
18544
|
sortable: true,
|
|
17921
18545
|
sorter: CommonSorter(dataIndex),
|
|
17922
18546
|
render: (_, record) => {
|
|
17923
|
-
return jsxRuntimeExports.jsxs("span", { children: [
|
|
18547
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
18548
|
+
record.readyReplicas,
|
|
18549
|
+
"/",
|
|
18550
|
+
record.replicas
|
|
18551
|
+
] });
|
|
17924
18552
|
}
|
|
17925
18553
|
};
|
|
17926
18554
|
};
|
|
@@ -17942,7 +18570,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17942
18570
|
return -1;
|
|
17943
18571
|
},
|
|
17944
18572
|
render: (value) => {
|
|
17945
|
-
return jsxRuntimeExports.jsx(Time, { date: new Date(value) });
|
|
18573
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: new Date(value) });
|
|
17946
18574
|
}
|
|
17947
18575
|
};
|
|
17948
18576
|
};
|
|
@@ -17996,7 +18624,7 @@ var __publicField = (obj, key, value) => {
|
|
|
17996
18624
|
min: i18n2.t("dovetail.min"),
|
|
17997
18625
|
hr: i18n2.t("dovetail.hr")
|
|
17998
18626
|
};
|
|
17999
|
-
return jsxRuntimeExports.jsx("span", { children: elapsedTime(v, i18nMap).label || "-" });
|
|
18627
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: elapsedTime(v, i18nMap).label || "-" });
|
|
18000
18628
|
}
|
|
18001
18629
|
};
|
|
18002
18630
|
};
|
|
@@ -18021,7 +18649,14 @@ var __publicField = (obj, key, value) => {
|
|
|
18021
18649
|
sortable: true,
|
|
18022
18650
|
sorter: CommonSorter(dataIndex),
|
|
18023
18651
|
render(value, record) {
|
|
18024
|
-
return value.map((o) => jsxRuntimeExports.jsx(
|
|
18652
|
+
return value.map((o) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18653
|
+
ReferenceLink,
|
|
18654
|
+
{
|
|
18655
|
+
ownerReference: o,
|
|
18656
|
+
namespace: record.metadata.namespace || "default"
|
|
18657
|
+
},
|
|
18658
|
+
o.name
|
|
18659
|
+
));
|
|
18025
18660
|
}
|
|
18026
18661
|
};
|
|
18027
18662
|
};
|
|
@@ -18035,7 +18670,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18035
18670
|
sortable: true,
|
|
18036
18671
|
sorter: CommonSorter(dataIndex),
|
|
18037
18672
|
render(_, record) {
|
|
18038
|
-
return jsxRuntimeExports.jsx(IngressRulesComponent, { ingress: record });
|
|
18673
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IngressRulesComponent, { ingress: record });
|
|
18039
18674
|
}
|
|
18040
18675
|
};
|
|
18041
18676
|
};
|
|
@@ -18051,22 +18686,32 @@ var __publicField = (obj, key, value) => {
|
|
|
18051
18686
|
render: (defaultBackend, record) => {
|
|
18052
18687
|
var _a, _b;
|
|
18053
18688
|
if (!((_a = defaultBackend == null ? void 0 : defaultBackend.service) == null ? void 0 : _a.name))
|
|
18054
|
-
return jsxRuntimeExports.jsx("span", { children: "-" });
|
|
18689
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "-" });
|
|
18055
18690
|
const divider = "Default > ";
|
|
18056
|
-
return jsxRuntimeExports.jsxs("span", { children: [
|
|
18691
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
18692
|
+
divider,
|
|
18693
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18694
|
+
ResourceLink,
|
|
18695
|
+
{
|
|
18696
|
+
name: "services",
|
|
18697
|
+
namespace: record.metadata.namespace || "default",
|
|
18698
|
+
resourceId: ((_b = defaultBackend.service) == null ? void 0 : _b.name) || ""
|
|
18699
|
+
}
|
|
18700
|
+
)
|
|
18701
|
+
] });
|
|
18057
18702
|
}
|
|
18058
18703
|
};
|
|
18059
18704
|
};
|
|
18060
|
-
|
|
18061
|
-
|
|
18062
|
-
|
|
18063
|
-
|
|
18064
|
-
|
|
18065
|
-
|
|
18066
|
-
|
|
18067
|
-
|
|
18068
|
-
|
|
18069
|
-
})(
|
|
18705
|
+
var ColumnKeys = /* @__PURE__ */ ((ColumnKeys2) => {
|
|
18706
|
+
ColumnKeys2["age"] = "age";
|
|
18707
|
+
ColumnKeys2["name"] = "name";
|
|
18708
|
+
ColumnKeys2["namespace"] = "namespace";
|
|
18709
|
+
ColumnKeys2["phase"] = "phase";
|
|
18710
|
+
ColumnKeys2["replicas"] = "replicas";
|
|
18711
|
+
ColumnKeys2["deploymentImage"] = "deploymentImage";
|
|
18712
|
+
ColumnKeys2["podImage"] = "podImage";
|
|
18713
|
+
return ColumnKeys2;
|
|
18714
|
+
})(ColumnKeys || {});
|
|
18070
18715
|
const useEagleTable = (params) => {
|
|
18071
18716
|
var _a;
|
|
18072
18717
|
const { columns, tableProps, formatter, Dropdown = K8sDropdown } = params;
|
|
@@ -18092,9 +18737,12 @@ var __publicField = (obj, key, value) => {
|
|
|
18092
18737
|
return mergedParams;
|
|
18093
18738
|
}, [params.useTableParams, nsFilter]);
|
|
18094
18739
|
const table = core.useTable(useTableParams);
|
|
18095
|
-
const onPageChange = React.useCallback(
|
|
18096
|
-
|
|
18097
|
-
|
|
18740
|
+
const onPageChange = React.useCallback(
|
|
18741
|
+
(page) => {
|
|
18742
|
+
setCurrentPage(page);
|
|
18743
|
+
},
|
|
18744
|
+
[setCurrentPage]
|
|
18745
|
+
);
|
|
18098
18746
|
const data2 = (_a = table.tableQueryResult.data) == null ? void 0 : _a.data;
|
|
18099
18747
|
const finalDataSource = formatter ? data2 == null ? void 0 : data2.map(formatter) : data2;
|
|
18100
18748
|
const finalProps = {
|
|
@@ -18122,37 +18770,49 @@ var __publicField = (obj, key, value) => {
|
|
|
18122
18770
|
return resourcesConfig.filter((c) => !c.isCustom);
|
|
18123
18771
|
}, [resourcesConfig]);
|
|
18124
18772
|
const content = React.useMemo(() => {
|
|
18125
|
-
const _content = jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
18773
|
+
const _content = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
18774
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(eagle.ModalStack, {}),
|
|
18775
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ResourceCRUD, { configs: notCustomResources, urlPrefix }),
|
|
18776
|
+
props.children
|
|
18777
|
+
] });
|
|
18126
18778
|
if (Layout2) {
|
|
18127
|
-
return jsxRuntimeExports.jsx(Layout2, { children: _content });
|
|
18779
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Layout2, { children: _content });
|
|
18128
18780
|
}
|
|
18129
18781
|
return _content;
|
|
18130
18782
|
}, [Layout2, notCustomResources, props.children, urlPrefix]);
|
|
18131
|
-
return jsxRuntimeExports.jsx(reactRouterDom.Router, { history, children: jsxRuntimeExports.jsx(eagle.KitStoreProvider, { children: jsxRuntimeExports.jsx(GlobalStoreContext.Provider, { value: { globalStore }, children: jsxRuntimeExports.jsx(ConfigsContext.Provider, { value: lodashEs.keyBy(resourcesConfig, "name"), children: jsxRuntimeExports.jsx(
|
|
18132
|
-
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
|
|
18136
|
-
}, resources: resourcesConfig.map((c) => {
|
|
18137
|
-
return {
|
|
18138
|
-
name: c.name,
|
|
18139
|
-
meta: {
|
|
18140
|
-
resourceBasePath: c.basePath,
|
|
18141
|
-
kind: c.kind,
|
|
18142
|
-
parent: c.parent,
|
|
18143
|
-
label: `${c.kind}s`
|
|
18783
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Router, { history, children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.KitStoreProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalStoreContext.Provider, { value: { globalStore }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConfigsContext.Provider, { value: lodashEs.keyBy(resourcesConfig, "name"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18784
|
+
core.Refine,
|
|
18785
|
+
{
|
|
18786
|
+
dataProvider: {
|
|
18787
|
+
default: k8sApiProvider.dataProvider(globalStore)
|
|
18144
18788
|
},
|
|
18145
|
-
|
|
18146
|
-
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18789
|
+
routerProvider,
|
|
18790
|
+
liveProvider: k8sApiProvider.liveProvider(globalStore),
|
|
18791
|
+
options: {
|
|
18792
|
+
warnWhenUnsavedChanges: true,
|
|
18793
|
+
liveMode: "auto"
|
|
18794
|
+
},
|
|
18795
|
+
resources: resourcesConfig.map((c) => {
|
|
18796
|
+
return {
|
|
18797
|
+
name: c.name,
|
|
18798
|
+
meta: {
|
|
18799
|
+
resourceBasePath: c.basePath,
|
|
18800
|
+
kind: c.kind,
|
|
18801
|
+
parent: c.parent,
|
|
18802
|
+
label: `${c.kind}s`
|
|
18803
|
+
},
|
|
18804
|
+
list: `${urlPrefix}/${c.name}`,
|
|
18805
|
+
show: `${urlPrefix}/${c.name}/show`,
|
|
18806
|
+
create: `${urlPrefix}/${c.name}/create`,
|
|
18807
|
+
edit: `${urlPrefix}/${c.name}/edit`
|
|
18808
|
+
};
|
|
18809
|
+
}),
|
|
18810
|
+
children: content
|
|
18811
|
+
}
|
|
18812
|
+
) }) }) }) });
|
|
18151
18813
|
};
|
|
18152
18814
|
class ResourceModel {
|
|
18153
18815
|
constructor(_rawYaml, _globalStore) {
|
|
18154
|
-
__publicField(this, "_rawYaml");
|
|
18155
|
-
__publicField(this, "_globalStore");
|
|
18156
18816
|
__publicField(this, "id");
|
|
18157
18817
|
__publicField(this, "apiVersion");
|
|
18158
18818
|
__publicField(this, "kind");
|
|
@@ -18192,8 +18852,6 @@ var __publicField = (obj, key, value) => {
|
|
|
18192
18852
|
constructor(_rawYaml, _globalStore) {
|
|
18193
18853
|
var _a;
|
|
18194
18854
|
super(_rawYaml, _globalStore);
|
|
18195
|
-
__publicField(this, "_rawYaml");
|
|
18196
|
-
__publicField(this, "_globalStore");
|
|
18197
18855
|
__publicField(this, "flattenedRules");
|
|
18198
18856
|
this._rawYaml = _rawYaml;
|
|
18199
18857
|
this._globalStore = _globalStore;
|
|
@@ -18216,8 +18874,6 @@ var __publicField = (obj, key, value) => {
|
|
|
18216
18874
|
class NetworkPolicyModel extends ResourceModel {
|
|
18217
18875
|
constructor(_rawYaml, _globalStore) {
|
|
18218
18876
|
super(_rawYaml, _globalStore);
|
|
18219
|
-
__publicField(this, "_rawYaml");
|
|
18220
|
-
__publicField(this, "_globalStore");
|
|
18221
18877
|
this._rawYaml = _rawYaml;
|
|
18222
18878
|
this._globalStore = _globalStore;
|
|
18223
18879
|
}
|
|
@@ -18228,8 +18884,6 @@ var __publicField = (obj, key, value) => {
|
|
|
18228
18884
|
class WorkloadBaseModel extends ResourceModel {
|
|
18229
18885
|
constructor(_rawYaml, _globalStore) {
|
|
18230
18886
|
super(_rawYaml, _globalStore);
|
|
18231
|
-
__publicField(this, "_rawYaml");
|
|
18232
|
-
__publicField(this, "_globalStore");
|
|
18233
18887
|
this._rawYaml = _rawYaml;
|
|
18234
18888
|
this._globalStore = _globalStore;
|
|
18235
18889
|
}
|
|
@@ -18248,8 +18902,6 @@ var __publicField = (obj, key, value) => {
|
|
|
18248
18902
|
class JobModel extends WorkloadBaseModel {
|
|
18249
18903
|
constructor(_rawYaml, _globalStore) {
|
|
18250
18904
|
super(_rawYaml, _globalStore);
|
|
18251
|
-
__publicField(this, "_rawYaml");
|
|
18252
|
-
__publicField(this, "_globalStore");
|
|
18253
18905
|
__publicField(this, "restarts", 0);
|
|
18254
18906
|
this._rawYaml = _rawYaml;
|
|
18255
18907
|
this._globalStore = _globalStore;
|
|
@@ -18262,10 +18914,12 @@ var __publicField = (obj, key, value) => {
|
|
|
18262
18914
|
resourceBasePath: "/api/v1",
|
|
18263
18915
|
kind: "Pod"
|
|
18264
18916
|
});
|
|
18265
|
-
const myPods = pods.items.filter(
|
|
18266
|
-
|
|
18267
|
-
|
|
18268
|
-
|
|
18917
|
+
const myPods = pods.items.filter(
|
|
18918
|
+
(p) => {
|
|
18919
|
+
var _a, _b;
|
|
18920
|
+
return ((_a = this.spec) == null ? void 0 : _a.selector) ? matchSelector(p, (_b = this.spec) == null ? void 0 : _b.selector) : false;
|
|
18921
|
+
}
|
|
18922
|
+
);
|
|
18269
18923
|
const result = lodashExports.sumBy(myPods, "restartCount");
|
|
18270
18924
|
this.restarts = result;
|
|
18271
18925
|
}
|
|
@@ -18288,25 +18942,23 @@ var __publicField = (obj, key, value) => {
|
|
|
18288
18942
|
get stateDisplay() {
|
|
18289
18943
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
18290
18944
|
if (!((_a = this.spec) == null ? void 0 : _a.completions) && !((_b = this.status) == null ? void 0 : _b.succeeded)) {
|
|
18291
|
-
return
|
|
18945
|
+
return WorkloadState.RUNNING;
|
|
18292
18946
|
}
|
|
18293
18947
|
if (((_c = this.spec) == null ? void 0 : _c.completions) === ((_d = this.status) == null ? void 0 : _d.succeeded)) {
|
|
18294
|
-
return
|
|
18948
|
+
return WorkloadState.COMPLETED;
|
|
18295
18949
|
}
|
|
18296
18950
|
if ((_f = (_e = this.status) == null ? void 0 : _e.conditions) == null ? void 0 : _f.some((c) => c.type === "Failed" && c.status === "True")) {
|
|
18297
|
-
return
|
|
18951
|
+
return WorkloadState.FAILED;
|
|
18298
18952
|
}
|
|
18299
18953
|
if ((_h = (_g = this.status) == null ? void 0 : _g.conditions) == null ? void 0 : _h.some((c) => c.type === "Suspended" && c.status === "True")) {
|
|
18300
|
-
return
|
|
18954
|
+
return WorkloadState.SUSPENDED;
|
|
18301
18955
|
}
|
|
18302
|
-
return
|
|
18956
|
+
return WorkloadState.RUNNING;
|
|
18303
18957
|
}
|
|
18304
18958
|
}
|
|
18305
18959
|
class WorkloadModel extends WorkloadBaseModel {
|
|
18306
18960
|
constructor(_rawYaml, _globalStore) {
|
|
18307
18961
|
super(_rawYaml, _globalStore);
|
|
18308
|
-
__publicField(this, "_rawYaml");
|
|
18309
|
-
__publicField(this, "_globalStore");
|
|
18310
18962
|
__publicField(this, "restarts", 0);
|
|
18311
18963
|
this._rawYaml = _rawYaml;
|
|
18312
18964
|
this._globalStore = _globalStore;
|
|
@@ -18319,10 +18971,12 @@ var __publicField = (obj, key, value) => {
|
|
|
18319
18971
|
resourceBasePath: "/api/v1",
|
|
18320
18972
|
kind: "Pod"
|
|
18321
18973
|
});
|
|
18322
|
-
const myPods = pods.items.filter(
|
|
18323
|
-
|
|
18324
|
-
|
|
18325
|
-
|
|
18974
|
+
const myPods = pods.items.filter(
|
|
18975
|
+
(p) => {
|
|
18976
|
+
var _a, _b;
|
|
18977
|
+
return ((_a = this.spec) == null ? void 0 : _a.selector) ? matchSelector(p, (_b = this.spec) == null ? void 0 : _b.selector) : false;
|
|
18978
|
+
}
|
|
18979
|
+
);
|
|
18326
18980
|
const result = lodashExports.sumBy(myPods, "restartCount");
|
|
18327
18981
|
this.restarts = result;
|
|
18328
18982
|
}
|
|
@@ -18356,8 +19010,6 @@ var __publicField = (obj, key, value) => {
|
|
|
18356
19010
|
constructor(_rawYaml, _globalStore) {
|
|
18357
19011
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
18358
19012
|
super(_rawYaml, _globalStore);
|
|
18359
|
-
__publicField(this, "_rawYaml");
|
|
18360
|
-
__publicField(this, "_globalStore");
|
|
18361
19013
|
__publicField(this, "request");
|
|
18362
19014
|
__publicField(this, "limit");
|
|
18363
19015
|
this._rawYaml = _rawYaml;
|
|
@@ -18403,7 +19055,9 @@ var __publicField = (obj, key, value) => {
|
|
|
18403
19055
|
}
|
|
18404
19056
|
get imageNames() {
|
|
18405
19057
|
var _a;
|
|
18406
|
-
return ((_a = this._rawYaml.spec) == null ? void 0 : _a.containers.map(
|
|
19058
|
+
return ((_a = this._rawYaml.spec) == null ? void 0 : _a.containers.map(
|
|
19059
|
+
(container2) => shortenedImage(container2.image || "")
|
|
19060
|
+
)) || [];
|
|
18407
19061
|
}
|
|
18408
19062
|
get restartCount() {
|
|
18409
19063
|
var _a, _b;
|
|
@@ -18427,16 +19081,14 @@ var __publicField = (obj, key, value) => {
|
|
|
18427
19081
|
get stateDisplay() {
|
|
18428
19082
|
var _a, _b;
|
|
18429
19083
|
if (this.metadata.deletionTimestamp) {
|
|
18430
|
-
return
|
|
19084
|
+
return WorkloadState.TERMINATING;
|
|
18431
19085
|
}
|
|
18432
|
-
return ((_b = (_a = this.status) == null ? void 0 : _a.phase) == null ? void 0 : _b.toLowerCase()) ||
|
|
19086
|
+
return ((_b = (_a = this.status) == null ? void 0 : _a.phase) == null ? void 0 : _b.toLowerCase()) || WorkloadState.UNKNOWN;
|
|
18433
19087
|
}
|
|
18434
19088
|
}
|
|
18435
19089
|
class PodMetricsModel extends ResourceModel {
|
|
18436
19090
|
constructor(_rawYaml, _globalStore) {
|
|
18437
19091
|
super(_rawYaml, _globalStore);
|
|
18438
|
-
__publicField(this, "_rawYaml");
|
|
18439
|
-
__publicField(this, "_globalStore");
|
|
18440
19092
|
__publicField(this, "usage");
|
|
18441
19093
|
this._rawYaml = _rawYaml;
|
|
18442
19094
|
this._globalStore = _globalStore;
|
|
@@ -18467,17 +19119,15 @@ var __publicField = (obj, key, value) => {
|
|
|
18467
19119
|
class CronJobModel extends WorkloadBaseModel {
|
|
18468
19120
|
constructor(_rawYaml, _globalStore) {
|
|
18469
19121
|
super(_rawYaml, _globalStore);
|
|
18470
|
-
__publicField(this, "_rawYaml");
|
|
18471
|
-
__publicField(this, "_globalStore");
|
|
18472
19122
|
this._rawYaml = _rawYaml;
|
|
18473
19123
|
this._globalStore = _globalStore;
|
|
18474
19124
|
}
|
|
18475
19125
|
get stateDisplay() {
|
|
18476
19126
|
var _a;
|
|
18477
19127
|
if (!((_a = this.spec) == null ? void 0 : _a.suspend)) {
|
|
18478
|
-
return
|
|
19128
|
+
return WorkloadState.SUSPENDED;
|
|
18479
19129
|
}
|
|
18480
|
-
return
|
|
19130
|
+
return WorkloadState.RUNNING;
|
|
18481
19131
|
}
|
|
18482
19132
|
suspend() {
|
|
18483
19133
|
const newOne = lodashExports.cloneDeep(this._rawYaml);
|
|
@@ -18497,8 +19147,6 @@ var __publicField = (obj, key, value) => {
|
|
|
18497
19147
|
class EventModel extends ResourceModel {
|
|
18498
19148
|
constructor(_rawYaml, _globalStore) {
|
|
18499
19149
|
super(_rawYaml, _globalStore);
|
|
18500
|
-
__publicField(this, "_rawYaml");
|
|
18501
|
-
__publicField(this, "_globalStore");
|
|
18502
19150
|
this._rawYaml = _rawYaml;
|
|
18503
19151
|
this._globalStore = _globalStore;
|
|
18504
19152
|
this.id = _rawYaml.metadata.uid || _rawYaml.id;
|
|
@@ -18507,49 +19155,43 @@ var __publicField = (obj, key, value) => {
|
|
|
18507
19155
|
class DeploymentModel extends WorkloadModel {
|
|
18508
19156
|
constructor(_rawYaml, _globalStore) {
|
|
18509
19157
|
super(_rawYaml, _globalStore);
|
|
18510
|
-
__publicField(this, "_rawYaml");
|
|
18511
|
-
__publicField(this, "_globalStore");
|
|
18512
19158
|
this._rawYaml = _rawYaml;
|
|
18513
19159
|
this._globalStore = _globalStore;
|
|
18514
19160
|
}
|
|
18515
19161
|
get stateDisplay() {
|
|
18516
19162
|
var _a, _b;
|
|
18517
19163
|
if (((_a = this.spec) == null ? void 0 : _a.replicas) !== ((_b = this.status) == null ? void 0 : _b.readyReplicas)) {
|
|
18518
|
-
return
|
|
19164
|
+
return WorkloadState.UPDATEING;
|
|
18519
19165
|
}
|
|
18520
|
-
return
|
|
19166
|
+
return WorkloadState.READY;
|
|
18521
19167
|
}
|
|
18522
19168
|
}
|
|
18523
19169
|
class DaemonSetModel extends WorkloadModel {
|
|
18524
19170
|
constructor(_rawYaml, _globalStore) {
|
|
18525
19171
|
super(_rawYaml, _globalStore);
|
|
18526
|
-
__publicField(this, "_rawYaml");
|
|
18527
|
-
__publicField(this, "_globalStore");
|
|
18528
19172
|
this._rawYaml = _rawYaml;
|
|
18529
19173
|
this._globalStore = _globalStore;
|
|
18530
19174
|
}
|
|
18531
19175
|
get stateDisplay() {
|
|
18532
19176
|
var _a, _b;
|
|
18533
19177
|
if (((_a = this.status) == null ? void 0 : _a.desiredNumberScheduled) !== ((_b = this.status) == null ? void 0 : _b.numberReady)) {
|
|
18534
|
-
return
|
|
19178
|
+
return WorkloadState.UPDATEING;
|
|
18535
19179
|
}
|
|
18536
|
-
return
|
|
19180
|
+
return WorkloadState.READY;
|
|
18537
19181
|
}
|
|
18538
19182
|
}
|
|
18539
19183
|
class StatefulSetModel extends WorkloadModel {
|
|
18540
19184
|
constructor(_rawYaml, _globalStore) {
|
|
18541
19185
|
super(_rawYaml, _globalStore);
|
|
18542
|
-
__publicField(this, "_rawYaml");
|
|
18543
|
-
__publicField(this, "_globalStore");
|
|
18544
19186
|
this._rawYaml = _rawYaml;
|
|
18545
19187
|
this._globalStore = _globalStore;
|
|
18546
19188
|
}
|
|
18547
19189
|
get stateDisplay() {
|
|
18548
19190
|
var _a, _b;
|
|
18549
19191
|
if (((_a = this.spec) == null ? void 0 : _a.replicas) !== ((_b = this.status) == null ? void 0 : _b.readyReplicas)) {
|
|
18550
|
-
return
|
|
19192
|
+
return WorkloadState.UPDATEING;
|
|
18551
19193
|
}
|
|
18552
|
-
return
|
|
19194
|
+
return WorkloadState.READY;
|
|
18553
19195
|
}
|
|
18554
19196
|
}
|
|
18555
19197
|
const ModelMap = {
|
|
@@ -18572,12 +19214,14 @@ var __publicField = (obj, key, value) => {
|
|
|
18572
19214
|
}
|
|
18573
19215
|
async processData(res) {
|
|
18574
19216
|
const { kind, apiVersion } = res;
|
|
18575
|
-
const items = await Promise.all(
|
|
18576
|
-
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
|
|
18580
|
-
|
|
19217
|
+
const items = await Promise.all(
|
|
19218
|
+
res.items.map((item) => {
|
|
19219
|
+
const newItem = { ...item };
|
|
19220
|
+
newItem.kind = kind.replace(/List$/g, "");
|
|
19221
|
+
newItem.apiVersion = apiVersion;
|
|
19222
|
+
return this.processItem(newItem);
|
|
19223
|
+
})
|
|
19224
|
+
);
|
|
18581
19225
|
return {
|
|
18582
19226
|
...res,
|
|
18583
19227
|
items
|
|
@@ -18608,12 +19252,16 @@ var __publicField = (obj, key, value) => {
|
|
|
18608
19252
|
}
|
|
18609
19253
|
async processData(res) {
|
|
18610
19254
|
const { kind, apiVersion } = res;
|
|
18611
|
-
const items = await Promise.all(
|
|
18612
|
-
|
|
18613
|
-
|
|
18614
|
-
|
|
18615
|
-
|
|
18616
|
-
|
|
19255
|
+
const items = await Promise.all(
|
|
19256
|
+
res.items.map(
|
|
19257
|
+
(item) => this.processItem({
|
|
19258
|
+
// TODO: unify this with data-provider getOne method
|
|
19259
|
+
kind: kind.replace(/List$/g, ""),
|
|
19260
|
+
apiVersion,
|
|
19261
|
+
...lodashExports.omit(item, ["apiVersion", "kind"])
|
|
19262
|
+
})
|
|
19263
|
+
)
|
|
19264
|
+
);
|
|
18617
19265
|
return {
|
|
18618
19266
|
...res,
|
|
18619
19267
|
items
|
|
@@ -18705,10 +19353,16 @@ var __publicField = (obj, key, value) => {
|
|
|
18705
19353
|
modifiedModel.dispose();
|
|
18706
19354
|
};
|
|
18707
19355
|
}, [modified, origin, id]);
|
|
18708
|
-
return jsxRuntimeExports.jsx(
|
|
18709
|
-
|
|
18710
|
-
|
|
18711
|
-
|
|
19356
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
19357
|
+
"div",
|
|
19358
|
+
{
|
|
19359
|
+
ref,
|
|
19360
|
+
style: {
|
|
19361
|
+
width: "100%",
|
|
19362
|
+
height: height || "500px"
|
|
19363
|
+
}
|
|
19364
|
+
}
|
|
19365
|
+
);
|
|
18712
19366
|
};
|
|
18713
19367
|
const MonacoYamlDiffEditor$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
18714
19368
|
__proto__: null,
|
|
@@ -18720,6 +19374,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18720
19374
|
exports2.Breadcrumb = Breadcrumb;
|
|
18721
19375
|
exports2.CRONJOB_INIT_VALUE = CRONJOB_INIT_VALUE;
|
|
18722
19376
|
exports2.ClusterIpField = ClusterIpField;
|
|
19377
|
+
exports2.ColumnKeys = ColumnKeys;
|
|
18723
19378
|
exports2.CommonSorter = CommonSorter;
|
|
18724
19379
|
exports2.CompletionsCountColumnRenderer = CompletionsCountColumnRenderer;
|
|
18725
19380
|
exports2.ComponentContext = ComponentContext;
|
|
@@ -18744,6 +19399,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18744
19399
|
exports2.EventModel = EventModel;
|
|
18745
19400
|
exports2.EventsTableTabField = EventsTableTabField;
|
|
18746
19401
|
exports2.FormModal = FormModal;
|
|
19402
|
+
exports2.FormType = FormType;
|
|
18747
19403
|
exports2.GlobalStoreContext = GlobalStoreContext;
|
|
18748
19404
|
exports2.INGRESS_INIT_VALUE = INGRESS_INIT_VALUE;
|
|
18749
19405
|
exports2.ImageField = ImageField;
|
|
@@ -18780,6 +19436,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18780
19436
|
exports2.PodWorkloadColumnRenderer = PodWorkloadColumnRenderer;
|
|
18781
19437
|
exports2.PodsField = PodsField;
|
|
18782
19438
|
exports2.ProviderPlugins = ProviderPlugins;
|
|
19439
|
+
exports2.RESOURCE_GROUP = RESOURCE_GROUP;
|
|
18783
19440
|
exports2.ReferenceLink = ReferenceLink;
|
|
18784
19441
|
exports2.ReplicaField = ReplicaField;
|
|
18785
19442
|
exports2.ReplicasColumnRenderer = ReplicasColumnRenderer;
|
|
@@ -18793,6 +19450,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18793
19450
|
exports2.RestartCountColumnRenderer = RestartCountColumnRenderer;
|
|
18794
19451
|
exports2.SERVICE_INIT_VALUE = SERVICE_INIT_VALUE;
|
|
18795
19452
|
exports2.STATEFULSET_INIT_VALUE = STATEFULSET_INIT_VALUE;
|
|
19453
|
+
exports2.SchemaStrategy = SchemaStrategy;
|
|
18796
19454
|
exports2.SecretDataField = SecretDataField;
|
|
18797
19455
|
exports2.Separator = Separator;
|
|
18798
19456
|
exports2.ServicePodsField = ServicePodsField;
|
|
@@ -18813,6 +19471,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18813
19471
|
exports2.WorkloadPodsTable = WorkloadPodsTable;
|
|
18814
19472
|
exports2.WorkloadReplicas = WorkloadReplicas;
|
|
18815
19473
|
exports2.WorkloadRestartsColumnRenderer = WorkloadRestartsColumnRenderer;
|
|
19474
|
+
exports2.WorkloadState = WorkloadState;
|
|
18816
19475
|
exports2.YamlEditorComponent = YamlEditorComponent;
|
|
18817
19476
|
exports2.dnsSubDomainRules = dnsSubDomainRules;
|
|
18818
19477
|
exports2.dovetailRefineI18n = dovetailRefineI18n;
|