@dovetail-v2/refine 0.0.14 → 0.0.15
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.2bd18ff6.js → MonacoYamlDiffEditor.15656940.js} +3 -3
- package/dist/{index.8d29d388.js → index.82c82bb4.js} +797 -957
- package/dist/refine.js +72 -75
- package/dist/refine.umd.cjs +717 -877
- package/dist/style.css +4 -1
- package/lib/src/components/CronJobDropdown/index.d.ts +1 -1
- package/lib/src/components/DrawerShow/DrawerShow.d.ts +4 -5
- package/lib/src/components/ErrorContent/index.d.ts +12 -0
- package/lib/src/components/EventsTable/EventsTable.d.ts +1 -3
- package/lib/src/components/K8sDropdown/index.d.ts +1 -1
- package/lib/src/components/ListPage/index.d.ts +1 -1
- package/lib/src/components/PageShow/PageShow.d.ts +4 -5
- package/lib/src/components/PodLog/index.d.ts +1 -1
- package/lib/src/components/ResourceCRUD/create/index.d.ts +5 -5
- package/lib/src/components/ResourceCRUD/list/index.d.ts +3 -4
- package/lib/src/components/ResourceCRUD/show/index.d.ts +4 -5
- package/lib/src/components/ShowContent/ShowContent.d.ts +4 -5
- package/lib/src/components/ShowContent/fields.d.ts +13 -14
- package/lib/src/components/Table/index.d.ts +1 -1
- package/lib/src/components/WorkloadDropdown/index.d.ts +1 -1
- package/lib/src/components/WorkloadReplicas/index.d.ts +1 -1
- package/lib/src/components/YamlForm/index.d.ts +6 -0
- package/lib/src/constants/k8s.d.ts +22 -0
- package/lib/src/hooks/useDownloadYAML.d.ts +2 -2
- package/lib/src/hooks/useEagleForm.d.ts +5 -0
- package/lib/src/hooks/useEagleTable/columns.d.ts +13 -14
- package/lib/src/hooks/useEagleTable/useEagleTable.d.ts +6 -7
- package/lib/src/hooks/useSchema.d.ts +9 -2
- package/lib/src/i18n.d.ts +6 -0
- package/lib/src/index.d.ts +0 -1
- package/lib/src/locales/en-US/index.d.ts +3 -0
- package/lib/src/locales/zh-CN/index.d.ts +3 -0
- package/lib/src/pages/configmaps/index.d.ts +3 -3
- package/lib/src/pages/jobs/index.d.ts +3 -4
- package/lib/src/pages/secrets/index.d.ts +3 -3
- package/lib/src/pages/services/index.d.ts +3 -3
- package/lib/src/providers/router-provider/index.d.ts +1 -1
- package/lib/src/types/index.d.ts +0 -1
- package/lib/src/types/resource.d.ts +3 -16
- package/lib/src/utils/error.d.ts +2 -2
- package/lib/src/utils/selector.d.ts +1 -1
- package/package.json +4 -1
|
@@ -10,15 +10,15 @@ import { parse, stringify } from "qs";
|
|
|
10
10
|
import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Router } from "react-router-dom";
|
|
11
11
|
import { useUIKit, Typo, Icon, kitContext } from "@cloudtower/eagle";
|
|
12
12
|
import yaml from "js-yaml";
|
|
13
|
-
import {
|
|
14
|
-
import { isObject, get, merge, cloneDeep, set, omit as omit$1 } from "lodash-es";
|
|
13
|
+
import { isObject, get, merge } from "lodash-es";
|
|
15
14
|
import { useForm } from "sunflower-antd";
|
|
15
|
+
import i18n from "i18next";
|
|
16
16
|
import { EditPen16PrimaryIcon, TrashBinDelete16Icon, Download16GradientBlueIcon, MoreEllipsis316BoldBlueIcon, SettingsGear16GradientGrayIcon, CheckmarkDoneSuccessCorrect16BoldGreenIcon, XmarkFailed16BoldRedIcon, DynamicResourceSchedule16BlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, Retry16GradientBlueIcon, EditPen16GradientGrayIcon, EditPen16GradientBlueIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, VmResume16Icon, SuspendedPause16GradientGrayIcon, Resume24Icon, SuspendedPause24GradientOrangeIcon } from "@cloudtower/icons-react";
|
|
17
17
|
import * as monaco from "monaco-editor";
|
|
18
18
|
import { setDiagnosticsOptions } from "monaco-yaml";
|
|
19
19
|
import ReactDOM from "react-dom";
|
|
20
20
|
import { Drawer } from "antd";
|
|
21
|
-
import
|
|
21
|
+
import { GlobalStore, ProviderPlugins, dataProvider, liveProvider } from "k8s-api-provider";
|
|
22
22
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
23
23
|
function getDefaultExportFromCjs(x) {
|
|
24
24
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -1056,7 +1056,7 @@ function useTranslation(ns) {
|
|
|
1056
1056
|
});
|
|
1057
1057
|
}
|
|
1058
1058
|
function useK8sYamlEditor() {
|
|
1059
|
-
|
|
1059
|
+
const foldSymbol = useCallback(function(editor, symbol) {
|
|
1060
1060
|
const model = editor.getModel();
|
|
1061
1061
|
const matchs = (model == null ? void 0 : model.findMatches(
|
|
1062
1062
|
symbol,
|
|
@@ -1078,8 +1078,8 @@ function useK8sYamlEditor() {
|
|
|
1078
1078
|
reject(e);
|
|
1079
1079
|
}
|
|
1080
1080
|
});
|
|
1081
|
-
}
|
|
1082
|
-
async function
|
|
1081
|
+
}, []);
|
|
1082
|
+
const fold = useCallback(async function(editor) {
|
|
1083
1083
|
await editor.getAction("editor.unfoldAll").run();
|
|
1084
1084
|
const symbols = [
|
|
1085
1085
|
" annotations:",
|
|
@@ -1091,7 +1091,7 @@ function useK8sYamlEditor() {
|
|
|
1091
1091
|
await foldSymbol(editor, symbol);
|
|
1092
1092
|
}
|
|
1093
1093
|
editor.setScrollPosition({ scrollTop: 0 });
|
|
1094
|
-
}
|
|
1094
|
+
}, [foldSymbol]);
|
|
1095
1095
|
return {
|
|
1096
1096
|
fold
|
|
1097
1097
|
};
|
|
@@ -1738,16 +1738,16 @@ var lodash = { exports: {} };
|
|
|
1738
1738
|
}
|
|
1739
1739
|
return result;
|
|
1740
1740
|
}
|
|
1741
|
-
function setToArray(
|
|
1742
|
-
var index = -1, result = Array(
|
|
1743
|
-
|
|
1741
|
+
function setToArray(set) {
|
|
1742
|
+
var index = -1, result = Array(set.size);
|
|
1743
|
+
set.forEach(function(value) {
|
|
1744
1744
|
result[++index] = value;
|
|
1745
1745
|
});
|
|
1746
1746
|
return result;
|
|
1747
1747
|
}
|
|
1748
|
-
function setToPairs(
|
|
1749
|
-
var index = -1, result = Array(
|
|
1750
|
-
|
|
1748
|
+
function setToPairs(set) {
|
|
1749
|
+
var index = -1, result = Array(set.size);
|
|
1750
|
+
set.forEach(function(value) {
|
|
1751
1751
|
result[++index] = [value, value];
|
|
1752
1752
|
});
|
|
1753
1753
|
return result;
|
|
@@ -2964,9 +2964,9 @@ var lodash = { exports: {} };
|
|
|
2964
2964
|
isCommon = false;
|
|
2965
2965
|
includes2 = arrayIncludesWith;
|
|
2966
2966
|
} else if (length >= LARGE_ARRAY_SIZE) {
|
|
2967
|
-
var
|
|
2968
|
-
if (
|
|
2969
|
-
return setToArray(
|
|
2967
|
+
var set2 = iteratee2 ? null : createSet(array);
|
|
2968
|
+
if (set2) {
|
|
2969
|
+
return setToArray(set2);
|
|
2970
2970
|
}
|
|
2971
2971
|
isCommon = false;
|
|
2972
2972
|
includes2 = cacheHas;
|
|
@@ -5091,7 +5091,7 @@ var lodash = { exports: {} };
|
|
|
5091
5091
|
customizer = typeof customizer == "function" ? customizer : undefined$1;
|
|
5092
5092
|
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
|
|
5093
5093
|
}
|
|
5094
|
-
function
|
|
5094
|
+
function cloneDeep(value) {
|
|
5095
5095
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
5096
5096
|
}
|
|
5097
5097
|
function cloneDeepWith(value, customizer) {
|
|
@@ -5495,7 +5495,7 @@ var lodash = { exports: {} };
|
|
|
5495
5495
|
}
|
|
5496
5496
|
return object2;
|
|
5497
5497
|
}
|
|
5498
|
-
function
|
|
5498
|
+
function set(object2, path, value) {
|
|
5499
5499
|
return object2 == null ? object2 : baseSet(object2, path, value);
|
|
5500
5500
|
}
|
|
5501
5501
|
function setWith(object2, path, value, customizer) {
|
|
@@ -6158,7 +6158,7 @@ var lodash = { exports: {} };
|
|
|
6158
6158
|
lodash2.rest = rest;
|
|
6159
6159
|
lodash2.reverse = reverse;
|
|
6160
6160
|
lodash2.sampleSize = sampleSize;
|
|
6161
|
-
lodash2.set =
|
|
6161
|
+
lodash2.set = set;
|
|
6162
6162
|
lodash2.setWith = setWith;
|
|
6163
6163
|
lodash2.shuffle = shuffle;
|
|
6164
6164
|
lodash2.slice = slice;
|
|
@@ -6217,7 +6217,7 @@ var lodash = { exports: {} };
|
|
|
6217
6217
|
lodash2.ceil = ceil;
|
|
6218
6218
|
lodash2.clamp = clamp;
|
|
6219
6219
|
lodash2.clone = clone;
|
|
6220
|
-
lodash2.cloneDeep =
|
|
6220
|
+
lodash2.cloneDeep = cloneDeep;
|
|
6221
6221
|
lodash2.cloneDeepWith = cloneDeepWith;
|
|
6222
6222
|
lodash2.cloneWith = cloneWith;
|
|
6223
6223
|
lodash2.conformsTo = conformsTo;
|
|
@@ -6690,6 +6690,8 @@ class K8sOpenAPI {
|
|
|
6690
6690
|
function useSchema(options) {
|
|
6691
6691
|
var _a;
|
|
6692
6692
|
const [schema, setSchema] = useState(null);
|
|
6693
|
+
const [loading, setLoading] = useState(false);
|
|
6694
|
+
const [error, setError] = useState(null);
|
|
6693
6695
|
const useResourceResult = useResource();
|
|
6694
6696
|
const resource = (options == null ? void 0 : options.resource) || useResourceResult.resource;
|
|
6695
6697
|
const openapi = useMemo(
|
|
@@ -6699,14 +6701,31 @@ function useSchema(options) {
|
|
|
6699
6701
|
},
|
|
6700
6702
|
[(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.resourceBasePath]
|
|
6701
6703
|
);
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6704
|
+
const fetchSchema = useCallback(async () => {
|
|
6705
|
+
var _a2;
|
|
6706
|
+
setLoading(true);
|
|
6707
|
+
setError(null);
|
|
6708
|
+
try {
|
|
6705
6709
|
const schema2 = await openapi.findSchema((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.kind);
|
|
6706
6710
|
setSchema(schema2 || null);
|
|
6707
|
-
|
|
6711
|
+
setError(null);
|
|
6712
|
+
} catch (e) {
|
|
6713
|
+
setError(e);
|
|
6714
|
+
} finally {
|
|
6715
|
+
setLoading(false);
|
|
6716
|
+
}
|
|
6708
6717
|
}, [resource, openapi]);
|
|
6709
|
-
|
|
6718
|
+
useEffect(() => {
|
|
6719
|
+
if (options == null ? void 0 : options.skip)
|
|
6720
|
+
return;
|
|
6721
|
+
fetchSchema();
|
|
6722
|
+
}, [fetchSchema]);
|
|
6723
|
+
return {
|
|
6724
|
+
schema,
|
|
6725
|
+
loading,
|
|
6726
|
+
error,
|
|
6727
|
+
fetchSchema
|
|
6728
|
+
};
|
|
6710
6729
|
}
|
|
6711
6730
|
function generateYamlBySchema(defaultValue, schema) {
|
|
6712
6731
|
const typeObject = generateSchemaTypeValue(schema);
|
|
@@ -6789,7 +6808,14 @@ const useEagleForm = ({
|
|
|
6789
6808
|
const [errorResponseBody, setErrorResponseBody] = useState(null);
|
|
6790
6809
|
const useResourceResult = useResource();
|
|
6791
6810
|
const kit = useUIKit();
|
|
6792
|
-
const
|
|
6811
|
+
const {
|
|
6812
|
+
schema,
|
|
6813
|
+
loading: isLoadingSchema,
|
|
6814
|
+
error: loadSchemaError,
|
|
6815
|
+
fetchSchema
|
|
6816
|
+
} = useSchema({
|
|
6817
|
+
skip: editorOptions == null ? void 0 : editorOptions.isSkipSchema
|
|
6818
|
+
});
|
|
6793
6819
|
const [formAnt] = kit.form.useForm();
|
|
6794
6820
|
const formSF = useForm({
|
|
6795
6821
|
form: formAnt
|
|
@@ -6885,9 +6911,7 @@ const useEagleForm = ({
|
|
|
6885
6911
|
}
|
|
6886
6912
|
}
|
|
6887
6913
|
};
|
|
6888
|
-
const initialValues = ((_c = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _c.data) ?
|
|
6889
|
-
...relationPlugin.restoreItem(queryResult.data.data)
|
|
6890
|
-
} : void 0;
|
|
6914
|
+
const initialValues = ((_c = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _c.data) ? queryResult.data.data.restore() : void 0;
|
|
6891
6915
|
if (initialValues) {
|
|
6892
6916
|
pruneBeforeEdit(initialValues);
|
|
6893
6917
|
}
|
|
@@ -6917,6 +6941,10 @@ const useEagleForm = ({
|
|
|
6917
6941
|
editorProps,
|
|
6918
6942
|
enableEditor,
|
|
6919
6943
|
errorResponseBody,
|
|
6944
|
+
schema,
|
|
6945
|
+
isLoadingSchema,
|
|
6946
|
+
loadSchemaError,
|
|
6947
|
+
fetchSchema,
|
|
6920
6948
|
switchEditor() {
|
|
6921
6949
|
var _a2, _b2;
|
|
6922
6950
|
if (enableEditor && ((_a2 = editor.current) == null ? void 0 : _a2.getEditorValue())) {
|
|
@@ -6939,13 +6967,13 @@ const useDeleteModal = (resource) => {
|
|
|
6939
6967
|
const [id, setId] = useState("");
|
|
6940
6968
|
const { t } = useTranslation();
|
|
6941
6969
|
const modalProps = {
|
|
6942
|
-
title: t("delete"),
|
|
6943
|
-
okText: t("delete"),
|
|
6970
|
+
title: t("dovetail.delete"),
|
|
6971
|
+
okText: t("dovetail.delete"),
|
|
6944
6972
|
okButtonProps: {
|
|
6945
6973
|
danger: true
|
|
6946
6974
|
},
|
|
6947
|
-
cancelText: t("cancel"),
|
|
6948
|
-
children: t("confirm_delete_text", {
|
|
6975
|
+
cancelText: t("dovetail.cancel"),
|
|
6976
|
+
children: t("dovetail.confirm_delete_text", {
|
|
6949
6977
|
target: id,
|
|
6950
6978
|
interpolation: { escapeValue: false }
|
|
6951
6979
|
}),
|
|
@@ -7393,6 +7421,188 @@ const WorkloadReplicas = ({
|
|
|
7393
7421
|
})]
|
|
7394
7422
|
});
|
|
7395
7423
|
};
|
|
7424
|
+
const copy$1 = "Copy";
|
|
7425
|
+
const reset_arguments$1 = "Reset";
|
|
7426
|
+
const view_changes$1 = "Show Diff";
|
|
7427
|
+
const back_to_edit$1 = "Edit";
|
|
7428
|
+
const configure_file$1 = "Configuration";
|
|
7429
|
+
const yaml_format_wrong$1 = "Configuration is in an invalid YAML format.";
|
|
7430
|
+
const yaml_value_wrong$1 = "Configuration has invalid values.";
|
|
7431
|
+
const edit_yaml$1 = "Edit YAML";
|
|
7432
|
+
const copied$1 = "Copied";
|
|
7433
|
+
const already_reset$1 = "Already reset";
|
|
7434
|
+
const fetch_schema_fail$1 = "Failed to fetch schema.";
|
|
7435
|
+
const obtain_data_error$1 = "Having trouble getting data.";
|
|
7436
|
+
const retry$1 = "Retry";
|
|
7437
|
+
const dovetail$1 = {
|
|
7438
|
+
copy: copy$1,
|
|
7439
|
+
reset_arguments: reset_arguments$1,
|
|
7440
|
+
view_changes: view_changes$1,
|
|
7441
|
+
back_to_edit: back_to_edit$1,
|
|
7442
|
+
configure_file: configure_file$1,
|
|
7443
|
+
yaml_format_wrong: yaml_format_wrong$1,
|
|
7444
|
+
yaml_value_wrong: yaml_value_wrong$1,
|
|
7445
|
+
edit_yaml: edit_yaml$1,
|
|
7446
|
+
copied: copied$1,
|
|
7447
|
+
already_reset: already_reset$1,
|
|
7448
|
+
fetch_schema_fail: fetch_schema_fail$1,
|
|
7449
|
+
obtain_data_error: obtain_data_error$1,
|
|
7450
|
+
retry: retry$1
|
|
7451
|
+
};
|
|
7452
|
+
const EN = {
|
|
7453
|
+
dovetail: dovetail$1
|
|
7454
|
+
};
|
|
7455
|
+
const copy = "\u590D\u5236";
|
|
7456
|
+
const reset_arguments = "\u91CD\u7F6E";
|
|
7457
|
+
const view_changes = "\u67E5\u770B\u6539\u52A8";
|
|
7458
|
+
const back_to_edit = "\u7F16\u8F91";
|
|
7459
|
+
const configure_file = "\u914D\u7F6E\u5185\u5BB9";
|
|
7460
|
+
const yaml_format_wrong = "\u914D\u7F6E\u5185\u5BB9\u4E0D\u662F\u6709\u6548\u7684 yaml \u683C\u5F0F\u3002";
|
|
7461
|
+
const yaml_value_wrong = "\u914D\u7F6E\u5185\u5BB9\u4E2D\u5B58\u5728\u4E0D\u5408\u6CD5\u7684\u503C\u3002";
|
|
7462
|
+
const edit_yaml = "\u7F16\u8F91 YAML";
|
|
7463
|
+
const copied = "\u5DF2\u590D\u5236";
|
|
7464
|
+
const already_reset = "\u5DF2\u91CD\u7F6E";
|
|
7465
|
+
const cancel = "\u53D6\u6D88";
|
|
7466
|
+
const create = "\u521B\u5EFA";
|
|
7467
|
+
const confirm_delete_text = "\u786E\u5B9A\u8981\u5220\u9664 {{target}} \u5417\uFF1F";
|
|
7468
|
+
const edit = "\u7F16\u8F91";
|
|
7469
|
+
const namespace = "\u540D\u5B57\u7A7A\u95F4";
|
|
7470
|
+
const name = "\u540D\u79F0";
|
|
7471
|
+
const state = "\u72B6\u6001";
|
|
7472
|
+
const status = "\u72B6\u6001";
|
|
7473
|
+
const phase = "\u72B6\u6001";
|
|
7474
|
+
const image = "\u5BB9\u5668\u955C\u50CF";
|
|
7475
|
+
const replicas = "\u526F\u672C\u6570";
|
|
7476
|
+
const created_time = "\u521B\u5EFA\u65F6\u95F4";
|
|
7477
|
+
const label = "\u6807\u7B7E";
|
|
7478
|
+
const annotation = "\u6CE8\u91CA";
|
|
7479
|
+
const type = "\u7C7B\u578B";
|
|
7480
|
+
const event = "\u4E8B\u4EF6";
|
|
7481
|
+
const reason = "\u539F\u56E0";
|
|
7482
|
+
const object = "\u5BF9\u8C61";
|
|
7483
|
+
const note = "\u4E8B\u4EF6\u4FE1\u606F";
|
|
7484
|
+
const condition = "Condition";
|
|
7485
|
+
const download_yaml = "\u4E0B\u8F7D YAML";
|
|
7486
|
+
const detail = "\u8BE6\u60C5";
|
|
7487
|
+
const node_name = "\u4E3B\u673A\u540D\u79F0";
|
|
7488
|
+
const restarts = "\u91CD\u542F\u6B21\u6570";
|
|
7489
|
+
const updated_time = "\u66F4\u65B0\u65F6\u95F4";
|
|
7490
|
+
const message = "\u6D88\u606F";
|
|
7491
|
+
const save = "\u4FDD\u5B58";
|
|
7492
|
+
const more = "\u66F4\u591A";
|
|
7493
|
+
const workload = "\u5DE5\u4F5C\u8D1F\u8F7D";
|
|
7494
|
+
const all_namespaces = "\u6240\u6709\u540D\u5B57\u7A7A\u95F4";
|
|
7495
|
+
const empty = "\u65E0\u53EF\u663E\u793A\u7684\u6570\u636E";
|
|
7496
|
+
const schedule = "\u8C03\u5EA6\u65F6\u95F4\u8868";
|
|
7497
|
+
const lastScheduleTime = "\u4E0A\u6B21\u8C03\u5EA6\u65F6\u95F4";
|
|
7498
|
+
const duration = "\u6301\u7EED\u65F6\u95F4";
|
|
7499
|
+
const completions = "\u5B8C\u6210 Job \u5386\u53F2\u6570";
|
|
7500
|
+
const started = "\u5F00\u59CB\u65F6\u95F4";
|
|
7501
|
+
const ready = "\u5C31\u7EEA";
|
|
7502
|
+
const init_container = "\u521D\u59CB\u5316\u5BB9\u5668";
|
|
7503
|
+
const container = "\u5BB9\u5668";
|
|
7504
|
+
const redeploy = "\u91CD\u65B0\u90E8\u7F72";
|
|
7505
|
+
const data = "\u6570\u636E";
|
|
7506
|
+
const suspend = "\u6682\u505C";
|
|
7507
|
+
const resume = "\u91CD\u65B0\u5F00\u59CB";
|
|
7508
|
+
const cluster = "\u96C6\u7FA4";
|
|
7509
|
+
const storage = "\u5B58\u50A8";
|
|
7510
|
+
const network = "\u7F51\u7EDC";
|
|
7511
|
+
const clusterIp = "\u96C6\u7FA4 IP";
|
|
7512
|
+
const sessionAffinity = "\u4F1A\u8BDD\u4FDD\u6301";
|
|
7513
|
+
const log = "\u65E5\u5FD7";
|
|
7514
|
+
const select_container = "\u9009\u62E9\u5BB9\u5668";
|
|
7515
|
+
const wrap = "\u6298\u53E0";
|
|
7516
|
+
const resume_log = "\u7EE7\u7EED";
|
|
7517
|
+
const log_new_lines = "\uFF0C\u5E76\u5C55\u793A {{ count }} \u884C\u65B0\u65E5\u5FD7";
|
|
7518
|
+
const fetch_schema_fail = "\u83B7\u53D6 schema \u5931\u8D25\u3002";
|
|
7519
|
+
const obtain_data_error = "\u83B7\u53D6\u6570\u636E\u65F6\u9047\u5230\u95EE\u9898\u3002";
|
|
7520
|
+
const retry = "\u91CD\u8BD5";
|
|
7521
|
+
const dovetail = {
|
|
7522
|
+
copy,
|
|
7523
|
+
reset_arguments,
|
|
7524
|
+
view_changes,
|
|
7525
|
+
back_to_edit,
|
|
7526
|
+
configure_file,
|
|
7527
|
+
yaml_format_wrong,
|
|
7528
|
+
yaml_value_wrong,
|
|
7529
|
+
edit_yaml,
|
|
7530
|
+
copied,
|
|
7531
|
+
already_reset,
|
|
7532
|
+
cancel,
|
|
7533
|
+
"delete": "\u5220\u9664",
|
|
7534
|
+
create,
|
|
7535
|
+
confirm_delete_text,
|
|
7536
|
+
edit,
|
|
7537
|
+
namespace,
|
|
7538
|
+
name,
|
|
7539
|
+
state,
|
|
7540
|
+
status,
|
|
7541
|
+
phase,
|
|
7542
|
+
image,
|
|
7543
|
+
replicas,
|
|
7544
|
+
created_time,
|
|
7545
|
+
label,
|
|
7546
|
+
annotation,
|
|
7547
|
+
type,
|
|
7548
|
+
event,
|
|
7549
|
+
reason,
|
|
7550
|
+
object,
|
|
7551
|
+
note,
|
|
7552
|
+
condition,
|
|
7553
|
+
download_yaml,
|
|
7554
|
+
detail,
|
|
7555
|
+
node_name,
|
|
7556
|
+
restarts,
|
|
7557
|
+
updated_time,
|
|
7558
|
+
message,
|
|
7559
|
+
save,
|
|
7560
|
+
more,
|
|
7561
|
+
workload,
|
|
7562
|
+
all_namespaces,
|
|
7563
|
+
empty,
|
|
7564
|
+
schedule,
|
|
7565
|
+
lastScheduleTime,
|
|
7566
|
+
duration,
|
|
7567
|
+
completions,
|
|
7568
|
+
started,
|
|
7569
|
+
ready,
|
|
7570
|
+
init_container,
|
|
7571
|
+
container,
|
|
7572
|
+
redeploy,
|
|
7573
|
+
data,
|
|
7574
|
+
suspend,
|
|
7575
|
+
resume,
|
|
7576
|
+
cluster,
|
|
7577
|
+
storage,
|
|
7578
|
+
network,
|
|
7579
|
+
clusterIp,
|
|
7580
|
+
sessionAffinity,
|
|
7581
|
+
log,
|
|
7582
|
+
select_container,
|
|
7583
|
+
wrap,
|
|
7584
|
+
resume_log,
|
|
7585
|
+
log_new_lines,
|
|
7586
|
+
fetch_schema_fail,
|
|
7587
|
+
obtain_data_error,
|
|
7588
|
+
retry
|
|
7589
|
+
};
|
|
7590
|
+
const ZH = {
|
|
7591
|
+
dovetail
|
|
7592
|
+
};
|
|
7593
|
+
const resources = {
|
|
7594
|
+
"en-US": EN,
|
|
7595
|
+
"zh-CN": ZH
|
|
7596
|
+
};
|
|
7597
|
+
i18n.use(initReactI18next).init({
|
|
7598
|
+
supportedLngs: ["en-US", "zh-CN"],
|
|
7599
|
+
resources,
|
|
7600
|
+
ns: Object.keys(resources["zh-CN"]),
|
|
7601
|
+
defaultNS: "dovetail",
|
|
7602
|
+
fallbackLng: ["en-US", "zh-CN"],
|
|
7603
|
+
lng: "zh-CN",
|
|
7604
|
+
nsSeparator: "."
|
|
7605
|
+
});
|
|
7396
7606
|
const NameLink = (props) => {
|
|
7397
7607
|
var _a;
|
|
7398
7608
|
const { name: name2, id, resource } = props;
|
|
@@ -7429,13 +7639,13 @@ const CommonSorter = (dataIndex) => (a, b) => {
|
|
|
7429
7639
|
return 1;
|
|
7430
7640
|
return -1;
|
|
7431
7641
|
};
|
|
7432
|
-
const NameColumnRenderer = (
|
|
7642
|
+
const NameColumnRenderer = (resource = "") => {
|
|
7433
7643
|
const dataIndex = ["metadata", "name"];
|
|
7434
7644
|
return {
|
|
7435
7645
|
key: "name",
|
|
7436
7646
|
display: true,
|
|
7437
7647
|
dataIndex,
|
|
7438
|
-
title:
|
|
7648
|
+
title: i18n.t("dovetail.name"),
|
|
7439
7649
|
sortable: true,
|
|
7440
7650
|
sorter: CommonSorter(dataIndex),
|
|
7441
7651
|
render: (v, record) => {
|
|
@@ -7443,50 +7653,60 @@ const NameColumnRenderer = (i18n2, resource = "") => {
|
|
|
7443
7653
|
}
|
|
7444
7654
|
};
|
|
7445
7655
|
};
|
|
7446
|
-
const NameSpaceColumnRenderer = (
|
|
7656
|
+
const NameSpaceColumnRenderer = () => {
|
|
7447
7657
|
const dataIndex = ["metadata", "namespace"];
|
|
7448
7658
|
return {
|
|
7449
7659
|
key: "namespace",
|
|
7450
7660
|
display: true,
|
|
7451
7661
|
dataIndex,
|
|
7452
|
-
title:
|
|
7662
|
+
title: i18n.t("dovetail.namespace"),
|
|
7453
7663
|
sortable: true,
|
|
7454
7664
|
sorter: CommonSorter(dataIndex)
|
|
7455
7665
|
};
|
|
7456
7666
|
};
|
|
7457
|
-
const PhaseColumnRenderer = (
|
|
7667
|
+
const PhaseColumnRenderer = () => {
|
|
7458
7668
|
const dataIndex = ["status", "phase"];
|
|
7459
7669
|
return {
|
|
7460
7670
|
key: "phase",
|
|
7461
7671
|
display: true,
|
|
7462
7672
|
dataIndex,
|
|
7463
|
-
title:
|
|
7673
|
+
title: i18n.t("dovetail.phase"),
|
|
7464
7674
|
sortable: true,
|
|
7465
7675
|
sorter: CommonSorter(dataIndex),
|
|
7466
7676
|
render: (v) => /* @__PURE__ */ jsxRuntime.exports.jsx(StateTag, { state: v })
|
|
7467
7677
|
};
|
|
7468
7678
|
};
|
|
7469
|
-
const WorkloadImageColumnRenderer = (
|
|
7679
|
+
const WorkloadImageColumnRenderer = () => {
|
|
7470
7680
|
const dataIndex = ["imageNames"];
|
|
7471
7681
|
return {
|
|
7472
7682
|
key: "image",
|
|
7473
7683
|
display: true,
|
|
7474
7684
|
dataIndex,
|
|
7475
|
-
title:
|
|
7685
|
+
title: i18n.t("dovetail.image"),
|
|
7476
7686
|
sortable: true,
|
|
7477
7687
|
sorter: CommonSorter(dataIndex),
|
|
7478
|
-
render(value) {
|
|
7479
|
-
return /* @__PURE__ */ jsxRuntime.exports.jsx(ImageNames, { value });
|
|
7688
|
+
render(value, record) {
|
|
7689
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(ImageNames, { value: record.imageNames });
|
|
7480
7690
|
}
|
|
7481
7691
|
};
|
|
7482
7692
|
};
|
|
7483
|
-
const
|
|
7693
|
+
const WorkloadRestartsColumnRenderer = () => {
|
|
7694
|
+
const dataIndex = ["restarts"];
|
|
7695
|
+
return {
|
|
7696
|
+
key: "restarts",
|
|
7697
|
+
display: true,
|
|
7698
|
+
dataIndex,
|
|
7699
|
+
title: i18n.t("dovetail.restarts"),
|
|
7700
|
+
sortable: false
|
|
7701
|
+
};
|
|
7702
|
+
};
|
|
7703
|
+
const ReplicasColumnRenderer = () => {
|
|
7484
7704
|
const dataIndex = ["status", "replicas"];
|
|
7485
7705
|
return {
|
|
7486
7706
|
key: "replicas",
|
|
7487
7707
|
display: true,
|
|
7488
7708
|
dataIndex,
|
|
7489
|
-
title:
|
|
7709
|
+
title: i18n.t("dovetail.replicas"),
|
|
7490
7710
|
sortable: true,
|
|
7491
7711
|
sorter: CommonSorter(dataIndex),
|
|
7492
7712
|
render: (_, record) => {
|
|
@@ -7494,13 +7714,13 @@ const ReplicasColumnRenderer = (i18n2) => {
|
|
|
7494
7714
|
}
|
|
7495
7715
|
};
|
|
7496
7716
|
};
|
|
7497
|
-
const AgeColumnRenderer = (
|
|
7717
|
+
const AgeColumnRenderer = () => {
|
|
7498
7718
|
const dataIndex = ["metadata", "creationTimestamp"];
|
|
7499
7719
|
return {
|
|
7500
7720
|
key: "creationTimestamp",
|
|
7501
7721
|
display: true,
|
|
7502
7722
|
dataIndex,
|
|
7503
|
-
title:
|
|
7723
|
+
title: i18n.t("dovetail.created_time"),
|
|
7504
7724
|
sortable: true,
|
|
7505
7725
|
sorter: (a, b) => {
|
|
7506
7726
|
const valA = new Date(lodash.exports.get(a, dataIndex));
|
|
@@ -7516,55 +7736,56 @@ const AgeColumnRenderer = (i18n2) => {
|
|
|
7516
7736
|
}
|
|
7517
7737
|
};
|
|
7518
7738
|
};
|
|
7519
|
-
const NodeNameColumnRenderer = (
|
|
7739
|
+
const NodeNameColumnRenderer = (options) => {
|
|
7520
7740
|
const dataIndex = ["spec", "nodeName"];
|
|
7521
7741
|
return {
|
|
7522
7742
|
key: "node",
|
|
7523
7743
|
display: true,
|
|
7524
7744
|
dataIndex,
|
|
7525
|
-
title:
|
|
7745
|
+
title: i18n.t("dovetail.node_name"),
|
|
7526
7746
|
sortable: true,
|
|
7527
|
-
sorter: CommonSorter(dataIndex)
|
|
7747
|
+
sorter: CommonSorter(dataIndex),
|
|
7748
|
+
...options
|
|
7528
7749
|
};
|
|
7529
7750
|
};
|
|
7530
|
-
const RestartCountColumnRenderer = (
|
|
7751
|
+
const RestartCountColumnRenderer = () => {
|
|
7531
7752
|
const dataIndex = ["restartCount"];
|
|
7532
7753
|
return {
|
|
7533
7754
|
key: "restartCount",
|
|
7534
7755
|
display: true,
|
|
7535
7756
|
dataIndex,
|
|
7536
|
-
title:
|
|
7757
|
+
title: i18n.t("dovetail.restarts"),
|
|
7537
7758
|
sortable: true,
|
|
7538
7759
|
sorter: CommonSorter(dataIndex)
|
|
7539
7760
|
};
|
|
7540
7761
|
};
|
|
7541
|
-
const CompletionsCountColumnRenderer = (
|
|
7762
|
+
const CompletionsCountColumnRenderer = () => {
|
|
7542
7763
|
const dataIndex = ["completionsDisplay"];
|
|
7543
7764
|
return {
|
|
7544
7765
|
key: "completions",
|
|
7545
7766
|
display: true,
|
|
7546
7767
|
dataIndex,
|
|
7547
|
-
title:
|
|
7768
|
+
title: i18n.t("completions"),
|
|
7548
7769
|
sortable: true,
|
|
7549
7770
|
sorter: CommonSorter(dataIndex)
|
|
7550
7771
|
};
|
|
7551
7772
|
};
|
|
7552
|
-
const DurationColumnRenderer = (
|
|
7773
|
+
const DurationColumnRenderer = () => {
|
|
7553
7774
|
const dataIndex = ["durationDisplay"];
|
|
7554
7775
|
return {
|
|
7555
7776
|
key: "duration",
|
|
7556
7777
|
display: true,
|
|
7557
7778
|
dataIndex,
|
|
7558
|
-
title:
|
|
7779
|
+
title: i18n.t("dovetail.duration"),
|
|
7559
7780
|
sortable: true,
|
|
7560
7781
|
sorter: CommonSorter(dataIndex)
|
|
7561
7782
|
};
|
|
7562
7783
|
};
|
|
7563
|
-
const ServiceTypeColumnRenderer = (
|
|
7784
|
+
const ServiceTypeColumnRenderer = () => {
|
|
7564
7785
|
const dataIndex = ["rawYaml", "spec", "type"];
|
|
7565
7786
|
return {
|
|
7566
7787
|
key: "type",
|
|
7567
|
-
title:
|
|
7788
|
+
title: i18n.t("dovetail.type"),
|
|
7568
7789
|
display: true,
|
|
7569
7790
|
dataIndex,
|
|
7570
7791
|
sortable: true,
|
|
@@ -7586,6 +7807,7 @@ function download(filename, content) {
|
|
|
7586
7807
|
function useDownloadYAML() {
|
|
7587
7808
|
return function(options) {
|
|
7588
7809
|
const { name: name2, item } = options;
|
|
7810
|
+
console.log("download", item);
|
|
7589
7811
|
const content = yaml.dump(item);
|
|
7590
7812
|
download(`${name2}.yaml`, content);
|
|
7591
7813
|
};
|
|
@@ -7634,7 +7856,7 @@ function K8sDropdown(props) {
|
|
|
7634
7856
|
edit2(data2.id);
|
|
7635
7857
|
}
|
|
7636
7858
|
},
|
|
7637
|
-
children: /* @__PURE__ */ jsxRuntime.exports.jsx(Icon, { src: EditPen16PrimaryIcon, children: t("edit") })
|
|
7859
|
+
children: /* @__PURE__ */ jsxRuntime.exports.jsx(Icon, { src: EditPen16PrimaryIcon, children: t("dovetail.edit") })
|
|
7638
7860
|
}
|
|
7639
7861
|
),
|
|
7640
7862
|
/* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
@@ -7644,7 +7866,7 @@ function K8sDropdown(props) {
|
|
|
7644
7866
|
onClick: () => {
|
|
7645
7867
|
openDeleteConfirmModal(data2.id);
|
|
7646
7868
|
},
|
|
7647
|
-
children: /* @__PURE__ */ jsxRuntime.exports.jsx(Icon, { src: TrashBinDelete16Icon, children: t("delete") })
|
|
7869
|
+
children: /* @__PURE__ */ jsxRuntime.exports.jsx(Icon, { src: TrashBinDelete16Icon, children: t("dovetail.delete") })
|
|
7648
7870
|
}
|
|
7649
7871
|
),
|
|
7650
7872
|
/* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
@@ -7655,11 +7877,11 @@ function K8sDropdown(props) {
|
|
|
7655
7877
|
if (data2.id) {
|
|
7656
7878
|
download2({
|
|
7657
7879
|
name: ((_a = data2.metadata) == null ? void 0 : _a.name) || data2.kind || "",
|
|
7658
|
-
item: data2
|
|
7880
|
+
item: data2.restore()
|
|
7659
7881
|
});
|
|
7660
7882
|
}
|
|
7661
7883
|
},
|
|
7662
|
-
children: /* @__PURE__ */ jsxRuntime.exports.jsx(Icon, { src: Download16GradientBlueIcon, children: t("download_yaml") })
|
|
7884
|
+
children: /* @__PURE__ */ jsxRuntime.exports.jsx(Icon, { src: Download16GradientBlueIcon, children: t("dovetail.download_yaml") })
|
|
7663
7885
|
}
|
|
7664
7886
|
),
|
|
7665
7887
|
props.children
|
|
@@ -7855,6 +8077,9 @@ const useEagleTable = (params) => {
|
|
|
7855
8077
|
const { value: nsFilter } = useNamespacesFilter();
|
|
7856
8078
|
const useTableParams = useMemo(() => {
|
|
7857
8079
|
const mergedParams = merge(params.useTableParams, {
|
|
8080
|
+
pagination: {
|
|
8081
|
+
mode: "off"
|
|
8082
|
+
},
|
|
7858
8083
|
filters: {
|
|
7859
8084
|
permanent: [
|
|
7860
8085
|
{
|
|
@@ -7883,7 +8108,8 @@ const useEagleTable = (params) => {
|
|
|
7883
8108
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(Dropdown, { data: record });
|
|
7884
8109
|
}
|
|
7885
8110
|
};
|
|
7886
|
-
const
|
|
8111
|
+
const data2 = (_a = table.tableQueryResult.data) == null ? void 0 : _a.data;
|
|
8112
|
+
const finalDataSource = formatter ? data2 == null ? void 0 : data2.map(formatter) : data2;
|
|
7887
8113
|
const finalProps = {
|
|
7888
8114
|
loading: table.tableQueryResult.isLoading,
|
|
7889
8115
|
dataSource: finalDataSource || [],
|
|
@@ -8003,7 +8229,6 @@ function KeyValueInput(props) {
|
|
|
8003
8229
|
const onValueChange = useCallback(
|
|
8004
8230
|
(event2) => {
|
|
8005
8231
|
var _a;
|
|
8006
|
-
console.log(event2);
|
|
8007
8232
|
const value = event2.target.value;
|
|
8008
8233
|
(_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
8009
8234
|
...item,
|
|
@@ -8056,7 +8281,6 @@ function KeyValueListWidget(props) {
|
|
|
8056
8281
|
{
|
|
8057
8282
|
item,
|
|
8058
8283
|
onChange: (newItem) => {
|
|
8059
|
-
console.log(newItem);
|
|
8060
8284
|
const temp = [...items];
|
|
8061
8285
|
temp.splice(index, 1, newItem);
|
|
8062
8286
|
onChange(temp);
|
|
@@ -8104,9 +8328,9 @@ function addId(arr, idKey) {
|
|
|
8104
8328
|
});
|
|
8105
8329
|
}
|
|
8106
8330
|
const ErrorContent_1t51xnx = "";
|
|
8107
|
-
const ErrorWrapper = "eckm4od";
|
|
8108
|
-
const ErrorContent = "e1hl982n";
|
|
8109
|
-
const WidgetErrorContent = (props) => {
|
|
8331
|
+
const ErrorWrapper$1 = "eckm4od";
|
|
8332
|
+
const ErrorContent$1 = "e1hl982n";
|
|
8333
|
+
const WidgetErrorContent$1 = (props) => {
|
|
8110
8334
|
const {
|
|
8111
8335
|
refetch
|
|
8112
8336
|
} = props;
|
|
@@ -8115,10 +8339,10 @@ const WidgetErrorContent = (props) => {
|
|
|
8115
8339
|
t
|
|
8116
8340
|
} = useTranslation();
|
|
8117
8341
|
return /* @__PURE__ */ jsxRuntime.exports.jsx("div", {
|
|
8118
|
-
className: ErrorWrapper,
|
|
8342
|
+
className: ErrorWrapper$1,
|
|
8119
8343
|
style: props.style,
|
|
8120
8344
|
children: /* @__PURE__ */ jsxRuntime.exports.jsxs("div", {
|
|
8121
|
-
className: ErrorContent,
|
|
8345
|
+
className: ErrorContent$1,
|
|
8122
8346
|
children: [/* @__PURE__ */ jsxRuntime.exports.jsx("p", {
|
|
8123
8347
|
className: cx_default(Typo.Label.l1_regular_title, "title"),
|
|
8124
8348
|
children: props.errorText || t("dovetail.obtain_data_error")
|
|
@@ -8142,28 +8366,28 @@ const ConditionsTable = ({ conditions = [] }) => {
|
|
|
8142
8366
|
key: "type",
|
|
8143
8367
|
display: true,
|
|
8144
8368
|
dataIndex: "type",
|
|
8145
|
-
title: t("condition"),
|
|
8369
|
+
title: t("dovetail.condition"),
|
|
8146
8370
|
sortable: true
|
|
8147
8371
|
},
|
|
8148
8372
|
{
|
|
8149
8373
|
key: "status",
|
|
8150
8374
|
display: true,
|
|
8151
8375
|
dataIndex: "status",
|
|
8152
|
-
title: t("status"),
|
|
8376
|
+
title: t("dovetail.status"),
|
|
8153
8377
|
sortable: true
|
|
8154
8378
|
},
|
|
8155
8379
|
{
|
|
8156
8380
|
key: "reason",
|
|
8157
8381
|
display: true,
|
|
8158
8382
|
dataIndex: "reason",
|
|
8159
|
-
title: t("reason"),
|
|
8383
|
+
title: t("dovetail.reason"),
|
|
8160
8384
|
sortable: true
|
|
8161
8385
|
},
|
|
8162
8386
|
{
|
|
8163
8387
|
key: "lastUpdateTime",
|
|
8164
8388
|
display: true,
|
|
8165
8389
|
dataIndex: "lastUpdateTime",
|
|
8166
|
-
title: t("updated_time"),
|
|
8390
|
+
title: t("dovetail.updated_time"),
|
|
8167
8391
|
sortable: true,
|
|
8168
8392
|
render: (value, record) => {
|
|
8169
8393
|
const time = value || record.lastTransitionTime;
|
|
@@ -8174,12 +8398,12 @@ const ConditionsTable = ({ conditions = [] }) => {
|
|
|
8174
8398
|
key: "message",
|
|
8175
8399
|
display: true,
|
|
8176
8400
|
dataIndex: "message",
|
|
8177
|
-
title: t("message"),
|
|
8401
|
+
title: t("dovetail.message"),
|
|
8178
8402
|
sortable: true
|
|
8179
8403
|
}
|
|
8180
8404
|
];
|
|
8181
8405
|
if (conditionsWithId.length === 0) {
|
|
8182
|
-
return /* @__PURE__ */ jsxRuntime.exports.jsx(WidgetErrorContent, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
8406
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
8183
8407
|
}
|
|
8184
8408
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
8185
8409
|
kit.table,
|
|
@@ -8192,496 +8416,28 @@ const ConditionsTable = ({ conditions = [] }) => {
|
|
|
8192
8416
|
}
|
|
8193
8417
|
);
|
|
8194
8418
|
};
|
|
8195
|
-
function
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
return
|
|
8201
|
-
}
|
|
8202
|
-
if (seconds < 120) {
|
|
8203
|
-
return {
|
|
8204
|
-
diff: 1,
|
|
8205
|
-
label: `${seconds}s`
|
|
8206
|
-
};
|
|
8207
|
-
}
|
|
8208
|
-
const minutes = Math.floor(seconds / 60);
|
|
8209
|
-
if (minutes < 10) {
|
|
8210
|
-
return {
|
|
8211
|
-
diff: 1,
|
|
8212
|
-
label: `${minutes}m${seconds - minutes * 60}s`
|
|
8213
|
-
};
|
|
8214
|
-
}
|
|
8215
|
-
const hours = Math.floor(seconds / 3600);
|
|
8216
|
-
if (hours < 3) {
|
|
8217
|
-
return {
|
|
8218
|
-
diff: 60,
|
|
8219
|
-
label: `${minutes}m`
|
|
8220
|
-
};
|
|
8221
|
-
}
|
|
8222
|
-
const days = Math.floor(seconds / (3600 * 24));
|
|
8223
|
-
if (days > 1) {
|
|
8224
|
-
return {
|
|
8225
|
-
diff: 60,
|
|
8226
|
-
label: `${days}d${hours - days * 24}h`
|
|
8227
|
-
};
|
|
8228
|
-
}
|
|
8229
|
-
if (hours > 7) {
|
|
8230
|
-
return {
|
|
8231
|
-
diff: 60,
|
|
8232
|
-
label: `${hours}h`
|
|
8233
|
-
};
|
|
8234
|
-
}
|
|
8235
|
-
return {
|
|
8236
|
-
diff: 60,
|
|
8237
|
-
label: `${hours}h${minutes - hours * 60}m`
|
|
8419
|
+
function memoize(fn) {
|
|
8420
|
+
var cache = /* @__PURE__ */ Object.create(null);
|
|
8421
|
+
return function(arg) {
|
|
8422
|
+
if (cache[arg] === void 0)
|
|
8423
|
+
cache[arg] = fn(arg);
|
|
8424
|
+
return cache[arg];
|
|
8238
8425
|
};
|
|
8239
8426
|
}
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
annotations: {},
|
|
8245
|
-
labels: {}
|
|
8427
|
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
8428
|
+
var isPropValid = /* @__PURE__ */ memoize(
|
|
8429
|
+
function(prop) {
|
|
8430
|
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
8246
8431
|
}
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
imagePullSecrets: [],
|
|
8257
|
-
initContainers: [],
|
|
8258
|
-
volumes: []
|
|
8259
|
-
};
|
|
8260
|
-
const DEPLOYMENT_INIT_VALUE = {
|
|
8261
|
-
apiVersion: "apps/v1",
|
|
8262
|
-
kind: "Deployment",
|
|
8263
|
-
...BASE_INIT_VALUE,
|
|
8264
|
-
spec: {
|
|
8265
|
-
replicas: 1,
|
|
8266
|
-
selector: {
|
|
8267
|
-
matchLabels: {
|
|
8268
|
-
[DEFAULT_MATCH_LABEL]: ""
|
|
8269
|
-
}
|
|
8270
|
-
},
|
|
8271
|
-
template: {
|
|
8272
|
-
metadata: {
|
|
8273
|
-
labels: {
|
|
8274
|
-
[DEFAULT_MATCH_LABEL]: ""
|
|
8275
|
-
}
|
|
8276
|
-
},
|
|
8277
|
-
spec: {
|
|
8278
|
-
containers: [BASE_CONTAINER_INIT_VALUE],
|
|
8279
|
-
restartPolicy: "Always",
|
|
8280
|
-
...BASE_WORKLOAD_SPEC_INIT_VALUE
|
|
8281
|
-
}
|
|
8282
|
-
}
|
|
8283
|
-
}
|
|
8284
|
-
};
|
|
8285
|
-
const CRONJOB_INIT_VALUE = {
|
|
8286
|
-
apiVersion: "batch/v1beta1",
|
|
8287
|
-
kind: "CronJob",
|
|
8288
|
-
...BASE_INIT_VALUE,
|
|
8289
|
-
spec: {
|
|
8290
|
-
schedule: "",
|
|
8291
|
-
jobTemplate: {
|
|
8292
|
-
metadata: {
|
|
8293
|
-
labels: {}
|
|
8294
|
-
},
|
|
8295
|
-
spec: {
|
|
8296
|
-
template: {
|
|
8297
|
-
spec: {
|
|
8298
|
-
containers: [BASE_CONTAINER_INIT_VALUE],
|
|
8299
|
-
restartPolicy: "Never",
|
|
8300
|
-
...BASE_WORKLOAD_SPEC_INIT_VALUE
|
|
8301
|
-
}
|
|
8302
|
-
}
|
|
8303
|
-
}
|
|
8304
|
-
}
|
|
8305
|
-
}
|
|
8306
|
-
};
|
|
8307
|
-
const DAEMONSET_INIT_VALUE = {
|
|
8308
|
-
apiVersion: "apps/v1",
|
|
8309
|
-
kind: "DaemonSet",
|
|
8310
|
-
...BASE_INIT_VALUE,
|
|
8311
|
-
spec: {
|
|
8312
|
-
replicas: 1,
|
|
8313
|
-
selector: {
|
|
8314
|
-
matchLabels: {
|
|
8315
|
-
[DEFAULT_MATCH_LABEL]: ""
|
|
8316
|
-
}
|
|
8317
|
-
},
|
|
8318
|
-
template: {
|
|
8319
|
-
metadata: {
|
|
8320
|
-
labels: {
|
|
8321
|
-
[DEFAULT_MATCH_LABEL]: ""
|
|
8322
|
-
}
|
|
8323
|
-
},
|
|
8324
|
-
spec: {
|
|
8325
|
-
containers: [BASE_CONTAINER_INIT_VALUE],
|
|
8326
|
-
restartPolicy: "Always",
|
|
8327
|
-
...BASE_WORKLOAD_SPEC_INIT_VALUE
|
|
8328
|
-
}
|
|
8329
|
-
}
|
|
8330
|
-
}
|
|
8331
|
-
};
|
|
8332
|
-
const JOB_INIT_VALUE = {
|
|
8333
|
-
apiVersion: "batch/v1",
|
|
8334
|
-
kind: "Job",
|
|
8335
|
-
...BASE_INIT_VALUE,
|
|
8336
|
-
spec: {
|
|
8337
|
-
replicas: 1,
|
|
8338
|
-
selector: {
|
|
8339
|
-
matchLabels: {}
|
|
8340
|
-
},
|
|
8341
|
-
template: {
|
|
8342
|
-
metadata: {
|
|
8343
|
-
labels: {}
|
|
8344
|
-
},
|
|
8345
|
-
spec: {
|
|
8346
|
-
containers: [BASE_CONTAINER_INIT_VALUE],
|
|
8347
|
-
restartPolicy: "Never",
|
|
8348
|
-
...BASE_WORKLOAD_SPEC_INIT_VALUE
|
|
8349
|
-
}
|
|
8350
|
-
}
|
|
8351
|
-
}
|
|
8352
|
-
};
|
|
8353
|
-
const STATEFULSET_INIT_VALUE = {
|
|
8354
|
-
apiVersion: "apps/v1",
|
|
8355
|
-
kind: "StatefulSet",
|
|
8356
|
-
...BASE_INIT_VALUE,
|
|
8357
|
-
spec: {
|
|
8358
|
-
replicas: 1,
|
|
8359
|
-
selector: {
|
|
8360
|
-
matchLabels: {
|
|
8361
|
-
[DEFAULT_MATCH_LABEL]: ""
|
|
8362
|
-
}
|
|
8363
|
-
},
|
|
8364
|
-
template: {
|
|
8365
|
-
metadata: {
|
|
8366
|
-
labels: {
|
|
8367
|
-
[DEFAULT_MATCH_LABEL]: ""
|
|
8368
|
-
}
|
|
8369
|
-
},
|
|
8370
|
-
spec: {
|
|
8371
|
-
containers: [BASE_CONTAINER_INIT_VALUE],
|
|
8372
|
-
restartPolicy: "Always",
|
|
8373
|
-
...BASE_WORKLOAD_SPEC_INIT_VALUE
|
|
8374
|
-
}
|
|
8375
|
-
}
|
|
8376
|
-
}
|
|
8377
|
-
};
|
|
8378
|
-
const POD_INIT_VALUE = {
|
|
8379
|
-
apiVersion: "v1",
|
|
8380
|
-
kind: "Pod",
|
|
8381
|
-
...BASE_INIT_VALUE,
|
|
8382
|
-
spec: {
|
|
8383
|
-
containers: [BASE_CONTAINER_INIT_VALUE]
|
|
8384
|
-
}
|
|
8385
|
-
};
|
|
8386
|
-
const TIMESTAMP_LABEL = "sks.user.kubesmart.smtx.io/timestamp";
|
|
8387
|
-
function shortenedImage(image2) {
|
|
8388
|
-
return (image2 || "").replace(/^(index\.)?docker.io\/(library\/)?/, "").replace(/:latest$/, "").replace(/^(.*@sha256:)([0-9a-f]{8})[0-9a-f]+$/i, "$1$2\u2026");
|
|
8389
|
-
}
|
|
8390
|
-
class ResourceModel {
|
|
8391
|
-
constructor(rawYaml) {
|
|
8392
|
-
__publicField(this, "id");
|
|
8393
|
-
__publicField(this, "apiVersion");
|
|
8394
|
-
__publicField(this, "kind");
|
|
8395
|
-
__publicField(this, "metadata");
|
|
8396
|
-
this.rawYaml = rawYaml;
|
|
8397
|
-
this.id = rawYaml.id;
|
|
8398
|
-
this.apiVersion = rawYaml.apiVersion;
|
|
8399
|
-
this.kind = rawYaml.kind;
|
|
8400
|
-
this.metadata = rawYaml.metadata;
|
|
8401
|
-
}
|
|
8402
|
-
get name() {
|
|
8403
|
-
var _a;
|
|
8404
|
-
return (_a = this.rawYaml.metadata) == null ? void 0 : _a.name;
|
|
8405
|
-
}
|
|
8406
|
-
get namespace() {
|
|
8407
|
-
var _a;
|
|
8408
|
-
return (_a = this.rawYaml.metadata) == null ? void 0 : _a.namespace;
|
|
8409
|
-
}
|
|
8410
|
-
get labels() {
|
|
8411
|
-
var _a;
|
|
8412
|
-
return (_a = this.rawYaml.metadata) == null ? void 0 : _a.labels;
|
|
8413
|
-
}
|
|
8414
|
-
get annotations() {
|
|
8415
|
-
var _a;
|
|
8416
|
-
return (_a = this.rawYaml.metadata) == null ? void 0 : _a.annotations;
|
|
8417
|
-
}
|
|
8418
|
-
}
|
|
8419
|
-
class WorkloadModel extends ResourceModel {
|
|
8420
|
-
constructor(rawYaml) {
|
|
8421
|
-
super(rawYaml);
|
|
8422
|
-
this.rawYaml = rawYaml;
|
|
8423
|
-
}
|
|
8424
|
-
get status() {
|
|
8425
|
-
return this.rawYaml.status;
|
|
8426
|
-
}
|
|
8427
|
-
get spec() {
|
|
8428
|
-
return this.rawYaml.spec;
|
|
8429
|
-
}
|
|
8430
|
-
get imageNames() {
|
|
8431
|
-
var _a, _b, _c, _d;
|
|
8432
|
-
const containers = this.rawYaml.spec && "jobTemplate" in this.rawYaml.spec ? (_b = (_a = this.rawYaml.spec.jobTemplate.spec) == null ? void 0 : _a.template.spec) == null ? void 0 : _b.containers : this.rawYaml.spec && "template" in this.rawYaml.spec ? (_d = (_c = this.rawYaml.spec) == null ? void 0 : _c.template.spec) == null ? void 0 : _d.containers : [];
|
|
8433
|
-
return (containers == null ? void 0 : containers.map((container2) => shortenedImage(container2.image || ""))) || [];
|
|
8434
|
-
}
|
|
8435
|
-
get restartCount() {
|
|
8436
|
-
return 0;
|
|
8437
|
-
}
|
|
8438
|
-
redeploy() {
|
|
8439
|
-
const newOne = cloneDeep(this.rawYaml);
|
|
8440
|
-
const path = "spec.template.metadata.annotations";
|
|
8441
|
-
const annotations = get(newOne, path, {});
|
|
8442
|
-
set(newOne, path, {
|
|
8443
|
-
...annotations,
|
|
8444
|
-
[TIMESTAMP_LABEL]: new Date().toISOString().replace(/\.\d+Z$/, "Z")
|
|
8445
|
-
});
|
|
8446
|
-
return newOne;
|
|
8447
|
-
}
|
|
8448
|
-
scale(value) {
|
|
8449
|
-
const newOne = cloneDeep(this.rawYaml);
|
|
8450
|
-
if (newOne.kind === "Deployment" || newOne.kind === "StatefulSet") {
|
|
8451
|
-
set(newOne, "spec.replicas", value);
|
|
8452
|
-
}
|
|
8453
|
-
return newOne;
|
|
8454
|
-
}
|
|
8455
|
-
}
|
|
8456
|
-
class JobModel extends WorkloadModel {
|
|
8457
|
-
constructor(rawYaml) {
|
|
8458
|
-
super(rawYaml);
|
|
8459
|
-
this.rawYaml = rawYaml;
|
|
8460
|
-
}
|
|
8461
|
-
get duration() {
|
|
8462
|
-
var _a, _b;
|
|
8463
|
-
const completionTime = (_a = this.rawYaml.status) == null ? void 0 : _a.completionTime;
|
|
8464
|
-
const startTime = (_b = this.rawYaml.status) == null ? void 0 : _b.startTime;
|
|
8465
|
-
if (!completionTime && startTime) {
|
|
8466
|
-
return getSecondsDiff(startTime, Date.now().toString());
|
|
8467
|
-
}
|
|
8468
|
-
if (completionTime && startTime) {
|
|
8469
|
-
return getSecondsDiff(startTime, completionTime);
|
|
8470
|
-
}
|
|
8471
|
-
return 0;
|
|
8472
|
-
}
|
|
8473
|
-
get durationDisplay() {
|
|
8474
|
-
return elapsedTime(this.duration).label;
|
|
8475
|
-
}
|
|
8476
|
-
get completionsDisplay() {
|
|
8477
|
-
var _a, _b;
|
|
8478
|
-
return `${((_a = this.rawYaml.status) == null ? void 0 : _a.succeeded) || 0}/${(_b = this.rawYaml.spec) == null ? void 0 : _b.completions}`;
|
|
8479
|
-
}
|
|
8480
|
-
}
|
|
8481
|
-
const UNITS = ["", "K", "M", "G", "T", "P"];
|
|
8482
|
-
const FRACTIONAL = ["", "m", "u", "n", "p", "f"];
|
|
8483
|
-
function formatSi(inValue, options) {
|
|
8484
|
-
const {
|
|
8485
|
-
increment = 1e3,
|
|
8486
|
-
suffix = null,
|
|
8487
|
-
firstSuffix = null,
|
|
8488
|
-
startingExponent = 0,
|
|
8489
|
-
minExponent = 0,
|
|
8490
|
-
maxPrecision = 2,
|
|
8491
|
-
atLeastOne = true
|
|
8492
|
-
} = options || {};
|
|
8493
|
-
let val = inValue;
|
|
8494
|
-
let exp = startingExponent;
|
|
8495
|
-
while (val >= increment && exp + 1 < UNITS.length || exp < minExponent) {
|
|
8496
|
-
val = val / increment;
|
|
8497
|
-
exp++;
|
|
8498
|
-
}
|
|
8499
|
-
let out = 0;
|
|
8500
|
-
if (val < 10 && maxPrecision >= 2) {
|
|
8501
|
-
out = Math.round(val * 100) / 100;
|
|
8502
|
-
} else if (val < 100 && maxPrecision >= 1) {
|
|
8503
|
-
out = Math.round(val * 10) / 10;
|
|
8504
|
-
} else {
|
|
8505
|
-
out = Math.round(val);
|
|
8506
|
-
}
|
|
8507
|
-
if (atLeastOne && out === 0) {
|
|
8508
|
-
out = 1;
|
|
8509
|
-
}
|
|
8510
|
-
let outStr = String(out);
|
|
8511
|
-
if (exp === 0 && firstSuffix !== null) {
|
|
8512
|
-
outStr += `${firstSuffix}`;
|
|
8513
|
-
} else {
|
|
8514
|
-
outStr += `${UNITS[exp]}${suffix}` || "";
|
|
8515
|
-
}
|
|
8516
|
-
return outStr;
|
|
8517
|
-
}
|
|
8518
|
-
function parseSi(inValue, increment = null, allowFractional = true) {
|
|
8519
|
-
if (!inValue || typeof inValue !== "string" || !inValue.length) {
|
|
8520
|
-
return NaN;
|
|
8521
|
-
}
|
|
8522
|
-
inValue = inValue.replace(/,/g, "");
|
|
8523
|
-
let [, valStr, unit, incStr] = inValue.match(/^([0-9.-]+)\s*([^0-9.-]?)([^0-9.-]?)/) || [];
|
|
8524
|
-
const val = parseFloat(valStr);
|
|
8525
|
-
if (!unit) {
|
|
8526
|
-
return val;
|
|
8527
|
-
}
|
|
8528
|
-
if (unit.charCodeAt(0) === 181) {
|
|
8529
|
-
unit = "u";
|
|
8530
|
-
}
|
|
8531
|
-
const divide = FRACTIONAL.includes(unit);
|
|
8532
|
-
const multiply = UNITS.includes(unit.toUpperCase());
|
|
8533
|
-
if (increment === null) {
|
|
8534
|
-
if ((multiply || divide) && incStr === "i") {
|
|
8535
|
-
increment = 1024;
|
|
8536
|
-
} else {
|
|
8537
|
-
increment = 1e3;
|
|
8538
|
-
}
|
|
8539
|
-
}
|
|
8540
|
-
if (divide && allowFractional) {
|
|
8541
|
-
const exp = FRACTIONAL.indexOf(unit);
|
|
8542
|
-
return val / Math.pow(increment, exp);
|
|
8543
|
-
}
|
|
8544
|
-
if (multiply) {
|
|
8545
|
-
const exp = UNITS.indexOf(unit.toUpperCase());
|
|
8546
|
-
return val * Math.pow(increment, exp);
|
|
8547
|
-
}
|
|
8548
|
-
return val;
|
|
8549
|
-
}
|
|
8550
|
-
class PodModel extends WorkloadModel {
|
|
8551
|
-
constructor(rawYaml) {
|
|
8552
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
8553
|
-
super(rawYaml);
|
|
8554
|
-
__publicField(this, "request");
|
|
8555
|
-
__publicField(this, "limit");
|
|
8556
|
-
this.rawYaml = rawYaml;
|
|
8557
|
-
let cpuRequestNum = 0;
|
|
8558
|
-
let memoryRequestNum = 0;
|
|
8559
|
-
let cpuLimitNum = 0;
|
|
8560
|
-
let memoryLimitNum = 0;
|
|
8561
|
-
for (const container2 of ((_a = rawYaml.spec) == null ? void 0 : _a.containers) || []) {
|
|
8562
|
-
cpuRequestNum += parseSi(((_c = (_b = container2.resources) == null ? void 0 : _b.requests) == null ? void 0 : _c.cpu) || "0");
|
|
8563
|
-
memoryRequestNum += parseSi(((_e = (_d = container2.resources) == null ? void 0 : _d.requests) == null ? void 0 : _e.memory) || "0");
|
|
8564
|
-
cpuLimitNum += parseSi(((_g = (_f = container2.resources) == null ? void 0 : _f.limits) == null ? void 0 : _g.cpu) || "0");
|
|
8565
|
-
memoryLimitNum += parseSi(((_i = (_h = container2.resources) == null ? void 0 : _h.limits) == null ? void 0 : _i.memory) || "0");
|
|
8566
|
-
}
|
|
8567
|
-
this.request = {
|
|
8568
|
-
cpu: {
|
|
8569
|
-
value: cpuRequestNum,
|
|
8570
|
-
si: formatSi(cpuRequestNum, {
|
|
8571
|
-
suffix: "m"
|
|
8572
|
-
})
|
|
8573
|
-
},
|
|
8574
|
-
memory: {
|
|
8575
|
-
value: memoryRequestNum,
|
|
8576
|
-
si: formatSi(memoryRequestNum, {
|
|
8577
|
-
suffix: "i"
|
|
8578
|
-
})
|
|
8579
|
-
}
|
|
8580
|
-
};
|
|
8581
|
-
this.limit = {
|
|
8582
|
-
cpu: {
|
|
8583
|
-
value: cpuLimitNum,
|
|
8584
|
-
si: formatSi(cpuLimitNum, {
|
|
8585
|
-
suffix: "m"
|
|
8586
|
-
})
|
|
8587
|
-
},
|
|
8588
|
-
memory: {
|
|
8589
|
-
value: memoryLimitNum,
|
|
8590
|
-
si: formatSi(memoryLimitNum, {
|
|
8591
|
-
suffix: "i"
|
|
8592
|
-
})
|
|
8593
|
-
}
|
|
8594
|
-
};
|
|
8595
|
-
}
|
|
8596
|
-
get imageNames() {
|
|
8597
|
-
var _a;
|
|
8598
|
-
return ((_a = this.rawYaml.spec) == null ? void 0 : _a.containers.map(
|
|
8599
|
-
(container2) => shortenedImage(container2.image || "")
|
|
8600
|
-
)) || [];
|
|
8601
|
-
}
|
|
8602
|
-
get restartCount() {
|
|
8603
|
-
var _a, _b;
|
|
8604
|
-
if ((_a = this.rawYaml.status) == null ? void 0 : _a.containerStatuses) {
|
|
8605
|
-
return ((_b = this.rawYaml.status) == null ? void 0 : _b.containerStatuses[0].restartCount) || 0;
|
|
8606
|
-
}
|
|
8607
|
-
return 0;
|
|
8608
|
-
}
|
|
8609
|
-
get readyDisplay() {
|
|
8610
|
-
var _a, _b, _c;
|
|
8611
|
-
return `${(_b = (_a = this.rawYaml.status) == null ? void 0 : _a.containerStatuses) == null ? void 0 : _b.filter((c) => c.ready).length}/${(_c = this.rawYaml.spec) == null ? void 0 : _c.containers.length}`;
|
|
8612
|
-
}
|
|
8613
|
-
}
|
|
8614
|
-
class PodMetricsModel extends ResourceModel {
|
|
8615
|
-
constructor(data2) {
|
|
8616
|
-
super(data2);
|
|
8617
|
-
__publicField(this, "usage");
|
|
8618
|
-
this.data = data2;
|
|
8619
|
-
let cpuUsageNum = 0;
|
|
8620
|
-
let memoryUsageNum = 0;
|
|
8621
|
-
for (const container2 of data2.containers) {
|
|
8622
|
-
cpuUsageNum += parseSi(container2.usage.cpu || "0");
|
|
8623
|
-
memoryUsageNum += parseSi(container2.usage.memory || "0");
|
|
8624
|
-
}
|
|
8625
|
-
this.usage = {
|
|
8626
|
-
cpu: {
|
|
8627
|
-
value: cpuUsageNum,
|
|
8628
|
-
si: formatSi(1e3 * cpuUsageNum, {
|
|
8629
|
-
suffix: "m",
|
|
8630
|
-
maxPrecision: 0
|
|
8631
|
-
})
|
|
8632
|
-
},
|
|
8633
|
-
memory: {
|
|
8634
|
-
value: memoryUsageNum,
|
|
8635
|
-
si: formatSi(memoryUsageNum, {
|
|
8636
|
-
suffix: "i",
|
|
8637
|
-
maxPrecision: 0
|
|
8638
|
-
})
|
|
8639
|
-
}
|
|
8640
|
-
};
|
|
8641
|
-
}
|
|
8642
|
-
}
|
|
8643
|
-
class CronJobModel extends WorkloadModel {
|
|
8644
|
-
constructor(data2) {
|
|
8645
|
-
super(data2);
|
|
8646
|
-
this.data = data2;
|
|
8647
|
-
}
|
|
8648
|
-
suspend() {
|
|
8649
|
-
const newOne = cloneDeep(this.data);
|
|
8650
|
-
if (this.data.kind === "CronJob") {
|
|
8651
|
-
set(newOne, "spec.suspend", true);
|
|
8652
|
-
}
|
|
8653
|
-
return newOne;
|
|
8654
|
-
}
|
|
8655
|
-
resume() {
|
|
8656
|
-
const newOne = cloneDeep(this.data);
|
|
8657
|
-
if (this.data.kind === "CronJob") {
|
|
8658
|
-
set(newOne, "spec.suspend", false);
|
|
8659
|
-
}
|
|
8660
|
-
return newOne;
|
|
8661
|
-
}
|
|
8662
|
-
}
|
|
8663
|
-
function memoize(fn) {
|
|
8664
|
-
var cache = /* @__PURE__ */ Object.create(null);
|
|
8665
|
-
return function(arg) {
|
|
8666
|
-
if (cache[arg] === void 0)
|
|
8667
|
-
cache[arg] = fn(arg);
|
|
8668
|
-
return cache[arg];
|
|
8669
|
-
};
|
|
8670
|
-
}
|
|
8671
|
-
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
8672
|
-
var isPropValid = /* @__PURE__ */ memoize(
|
|
8673
|
-
function(prop) {
|
|
8674
|
-
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
8675
|
-
}
|
|
8676
|
-
);
|
|
8677
|
-
var isCapital = (ch) => ch.toUpperCase() === ch;
|
|
8678
|
-
var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
|
|
8679
|
-
var omit = (obj, keys) => {
|
|
8680
|
-
const res = {};
|
|
8681
|
-
Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
|
|
8682
|
-
res[key] = obj[key];
|
|
8683
|
-
});
|
|
8684
|
-
return res;
|
|
8432
|
+
);
|
|
8433
|
+
var isCapital = (ch) => ch.toUpperCase() === ch;
|
|
8434
|
+
var filterKey = (keys) => (key) => keys.indexOf(key) === -1;
|
|
8435
|
+
var omit = (obj, keys) => {
|
|
8436
|
+
const res = {};
|
|
8437
|
+
Object.keys(obj).filter(filterKey(keys)).forEach((key) => {
|
|
8438
|
+
res[key] = obj[key];
|
|
8439
|
+
});
|
|
8440
|
+
return res;
|
|
8685
8441
|
};
|
|
8686
8442
|
function filterProps(asIs, props, omitKeys) {
|
|
8687
8443
|
const filteredProps = omit(props, omitKeys);
|
|
@@ -8813,7 +8569,7 @@ function Table(props) {
|
|
|
8813
8569
|
if (loading) {
|
|
8814
8570
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(kit.loading, {});
|
|
8815
8571
|
} else if (error) {
|
|
8816
|
-
return /* @__PURE__ */ jsxRuntime.exports.jsx(WidgetErrorContent, {
|
|
8572
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(WidgetErrorContent$1, {
|
|
8817
8573
|
errorText: t("dovetail.retry_when_access_data_failed"),
|
|
8818
8574
|
refetch,
|
|
8819
8575
|
style: {
|
|
@@ -8821,7 +8577,7 @@ function Table(props) {
|
|
|
8821
8577
|
}
|
|
8822
8578
|
});
|
|
8823
8579
|
} else if (dataSource.length === 0) {
|
|
8824
|
-
return /* @__PURE__ */ jsxRuntime.exports.jsx(WidgetErrorContent, {
|
|
8580
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(WidgetErrorContent$1, {
|
|
8825
8581
|
errorText: t("dovetail.empty"),
|
|
8826
8582
|
style: {
|
|
8827
8583
|
padding: "15px 0"
|
|
@@ -8873,20 +8629,20 @@ function CreateButton() {
|
|
|
8873
8629
|
});
|
|
8874
8630
|
}
|
|
8875
8631
|
}, [resource == null ? void 0 : resource.name]);
|
|
8876
|
-
return /* @__PURE__ */ jsxRuntime.exports.jsx(kit.button, { type: "primary", onClick, children: t("create") });
|
|
8632
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(kit.button, { type: "primary", onClick, children: t("dovetail.create") });
|
|
8877
8633
|
}
|
|
8878
8634
|
const useDeleteManyModal = (resource, ids) => {
|
|
8879
8635
|
const { mutate } = useDeleteMany();
|
|
8880
8636
|
const [visible, setVisible] = useState(false);
|
|
8881
8637
|
const { t } = useTranslation();
|
|
8882
8638
|
const modalProps = {
|
|
8883
|
-
title: t("delete"),
|
|
8884
|
-
okText: t("delete"),
|
|
8639
|
+
title: t("dovetail.delete"),
|
|
8640
|
+
okText: t("dovetail.delete"),
|
|
8885
8641
|
okButtonProps: {
|
|
8886
8642
|
danger: true
|
|
8887
8643
|
},
|
|
8888
|
-
cancelText: t("cancel"),
|
|
8889
|
-
children: t("confirm_delete_text", {
|
|
8644
|
+
cancelText: t("dovetail.cancel"),
|
|
8645
|
+
children: t("dovetail.confirm_delete_text", {
|
|
8890
8646
|
target: ids,
|
|
8891
8647
|
interpolation: { escapeValue: false }
|
|
8892
8648
|
}),
|
|
@@ -8915,7 +8671,7 @@ const DeleteManyButton = (props) => {
|
|
|
8915
8671
|
setVisible(true);
|
|
8916
8672
|
}, [setVisible]);
|
|
8917
8673
|
return /* @__PURE__ */ jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, { children: [
|
|
8918
|
-
/* @__PURE__ */ jsxRuntime.exports.jsx(kit.button, { type: "primary", danger: true, onClick, children: t("delete") }),
|
|
8674
|
+
/* @__PURE__ */ jsxRuntime.exports.jsx(kit.button, { type: "primary", danger: true, onClick, children: t("dovetail.delete") }),
|
|
8919
8675
|
visible ? /* @__PURE__ */ jsxRuntime.exports.jsx(kit.modal, { ...modalProps }) : null
|
|
8920
8676
|
] });
|
|
8921
8677
|
};
|
|
@@ -8954,9 +8710,6 @@ const CronjobJobsTable = ({
|
|
|
8954
8710
|
owner
|
|
8955
8711
|
}) => {
|
|
8956
8712
|
const kit = useUIKit();
|
|
8957
|
-
const {
|
|
8958
|
-
i18n: i18n2
|
|
8959
|
-
} = useTranslation();
|
|
8960
8713
|
const [selectedKeys, setSelectedKeys] = useState([]);
|
|
8961
8714
|
const [currentPage, setCurrentPage] = useState(1);
|
|
8962
8715
|
const {
|
|
@@ -8969,11 +8722,11 @@ const CronjobJobsTable = ({
|
|
|
8969
8722
|
}
|
|
8970
8723
|
});
|
|
8971
8724
|
const dataSource = useMemo(() => {
|
|
8972
|
-
return data2 == null ? void 0 : data2.data.
|
|
8725
|
+
return data2 == null ? void 0 : data2.data.filter((p) => {
|
|
8973
8726
|
return owner ? matchOwner(p, owner) : true;
|
|
8974
8727
|
});
|
|
8975
8728
|
}, [data2 == null ? void 0 : data2.data, owner]);
|
|
8976
|
-
const columns = [PhaseColumnRenderer(
|
|
8729
|
+
const columns = [PhaseColumnRenderer(), NameColumnRenderer("jobs"), NameSpaceColumnRenderer(), WorkloadImageColumnRenderer(), CompletionsCountColumnRenderer(), DurationColumnRenderer(), AgeColumnRenderer()];
|
|
8977
8730
|
return /* @__PURE__ */ jsxRuntime.exports.jsxs(kit.space, {
|
|
8978
8731
|
direction: "vertical",
|
|
8979
8732
|
className: "c16agr8o",
|
|
@@ -9042,9 +8795,6 @@ const WorkloadPodsTable = ({
|
|
|
9042
8795
|
selector
|
|
9043
8796
|
}) => {
|
|
9044
8797
|
const kit = useUIKit();
|
|
9045
|
-
const {
|
|
9046
|
-
i18n: i18n2
|
|
9047
|
-
} = useTranslation();
|
|
9048
8798
|
const [selectedKeys, setSelectedKeys] = useState([]);
|
|
9049
8799
|
const [currentPage, setCurrentPage] = useState(1);
|
|
9050
8800
|
const {
|
|
@@ -9057,11 +8807,11 @@ const WorkloadPodsTable = ({
|
|
|
9057
8807
|
}
|
|
9058
8808
|
});
|
|
9059
8809
|
const dataSource = useMemo(() => {
|
|
9060
|
-
return data2 == null ? void 0 : data2.data.
|
|
8810
|
+
return data2 == null ? void 0 : data2.data.filter((p) => {
|
|
9061
8811
|
return selector ? matchSelector(p, selector) : true;
|
|
9062
8812
|
});
|
|
9063
8813
|
}, [data2 == null ? void 0 : data2.data, selector]);
|
|
9064
|
-
const columns = [PhaseColumnRenderer(
|
|
8814
|
+
const columns = [PhaseColumnRenderer(), NameColumnRenderer("pods"), NodeNameColumnRenderer(), WorkloadImageColumnRenderer(), RestartCountColumnRenderer()];
|
|
9065
8815
|
return /* @__PURE__ */ jsxRuntime.exports.jsxs(kit.space, {
|
|
9066
8816
|
direction: "vertical",
|
|
9067
8817
|
className: "c1dicff8",
|
|
@@ -9083,42 +8833,42 @@ const WorkloadPodsTable = ({
|
|
|
9083
8833
|
})]
|
|
9084
8834
|
});
|
|
9085
8835
|
};
|
|
9086
|
-
const ImageField = (
|
|
8836
|
+
const ImageField = () => {
|
|
9087
8837
|
return {
|
|
9088
8838
|
key: "Image",
|
|
9089
|
-
title:
|
|
8839
|
+
title: i18n.t("dovetail.image"),
|
|
9090
8840
|
path: ["imageNames"],
|
|
9091
8841
|
render(value) {
|
|
9092
8842
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(ImageNames, { value });
|
|
9093
8843
|
}
|
|
9094
8844
|
};
|
|
9095
8845
|
};
|
|
9096
|
-
const ReplicaField = (
|
|
8846
|
+
const ReplicaField = () => {
|
|
9097
8847
|
return {
|
|
9098
8848
|
key: "Replicas",
|
|
9099
|
-
title:
|
|
8849
|
+
title: i18n.t("dovetail.replicas"),
|
|
9100
8850
|
path: ["status", "replicas"],
|
|
9101
8851
|
render: (_, record) => {
|
|
9102
8852
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(WorkloadReplicas, { record });
|
|
9103
8853
|
}
|
|
9104
8854
|
};
|
|
9105
8855
|
};
|
|
9106
|
-
const ConditionsField = (
|
|
8856
|
+
const ConditionsField = () => {
|
|
9107
8857
|
return {
|
|
9108
8858
|
key: "Conditions",
|
|
9109
|
-
title:
|
|
8859
|
+
title: i18n.t("dovetail.condition"),
|
|
9110
8860
|
path: ["status", "conditions"],
|
|
9111
8861
|
render: (value) => {
|
|
9112
8862
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(ConditionsTable, { conditions: value });
|
|
9113
8863
|
}
|
|
9114
8864
|
};
|
|
9115
8865
|
};
|
|
9116
|
-
const PodsField = (
|
|
8866
|
+
const PodsField = () => {
|
|
9117
8867
|
return {
|
|
9118
8868
|
key: "pods",
|
|
9119
8869
|
title: "Pods",
|
|
9120
8870
|
path: [],
|
|
9121
|
-
render: (
|
|
8871
|
+
render: (_, record) => {
|
|
9122
8872
|
var _a, _b;
|
|
9123
8873
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9124
8874
|
WorkloadPodsTable,
|
|
@@ -9131,12 +8881,12 @@ const PodsField = (_) => {
|
|
|
9131
8881
|
}
|
|
9132
8882
|
};
|
|
9133
8883
|
};
|
|
9134
|
-
const JobsField = (
|
|
8884
|
+
const JobsField = () => {
|
|
9135
8885
|
return {
|
|
9136
8886
|
key: "jobs",
|
|
9137
8887
|
title: "Jobs",
|
|
9138
8888
|
path: [],
|
|
9139
|
-
render: (
|
|
8889
|
+
render: (_, record) => {
|
|
9140
8890
|
var _a, _b, _c;
|
|
9141
8891
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9142
8892
|
CronjobJobsTable,
|
|
@@ -9153,20 +8903,20 @@ const JobsField = (_) => {
|
|
|
9153
8903
|
}
|
|
9154
8904
|
};
|
|
9155
8905
|
};
|
|
9156
|
-
const DataField = (
|
|
8906
|
+
const DataField = () => {
|
|
9157
8907
|
return {
|
|
9158
8908
|
key: "data",
|
|
9159
|
-
title:
|
|
8909
|
+
title: i18n.t("dovetail.data"),
|
|
9160
8910
|
path: ["rawYaml", "data"],
|
|
9161
8911
|
render: (val) => {
|
|
9162
8912
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(KeyValue, { value: val });
|
|
9163
8913
|
}
|
|
9164
8914
|
};
|
|
9165
8915
|
};
|
|
9166
|
-
const SecretDataField = (
|
|
8916
|
+
const SecretDataField = () => {
|
|
9167
8917
|
return {
|
|
9168
8918
|
key: "data",
|
|
9169
|
-
title:
|
|
8919
|
+
title: i18n.t("dovetail.data"),
|
|
9170
8920
|
path: ["rawYaml", "data"],
|
|
9171
8921
|
render: (val) => {
|
|
9172
8922
|
const decodeVal = {};
|
|
@@ -9177,43 +8927,43 @@ const SecretDataField = (i18n2) => {
|
|
|
9177
8927
|
}
|
|
9178
8928
|
};
|
|
9179
8929
|
};
|
|
9180
|
-
const StartTimeField = (
|
|
8930
|
+
const StartTimeField = () => {
|
|
9181
8931
|
return {
|
|
9182
8932
|
key: "started",
|
|
9183
|
-
title:
|
|
8933
|
+
title: i18n.t("dovetail.started"),
|
|
9184
8934
|
path: ["status", "startTime"],
|
|
9185
8935
|
render(value) {
|
|
9186
8936
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(Time, { date: value });
|
|
9187
8937
|
}
|
|
9188
8938
|
};
|
|
9189
8939
|
};
|
|
9190
|
-
const ServiceTypeField = (
|
|
8940
|
+
const ServiceTypeField = () => {
|
|
9191
8941
|
return {
|
|
9192
8942
|
key: "type",
|
|
9193
|
-
title:
|
|
8943
|
+
title: i18n.t("dovetail.type"),
|
|
9194
8944
|
path: ["rawYaml", "spec", "type"]
|
|
9195
8945
|
};
|
|
9196
8946
|
};
|
|
9197
|
-
const ClusterIpField = (
|
|
8947
|
+
const ClusterIpField = () => {
|
|
9198
8948
|
return {
|
|
9199
8949
|
key: "clusterIp",
|
|
9200
|
-
title:
|
|
8950
|
+
title: i18n.t("dovetail.clusterIp"),
|
|
9201
8951
|
path: ["rawYaml", "spec", "clusterIP"]
|
|
9202
8952
|
};
|
|
9203
8953
|
};
|
|
9204
|
-
const SessionAffinityField = (
|
|
8954
|
+
const SessionAffinityField = () => {
|
|
9205
8955
|
return {
|
|
9206
8956
|
key: "clusterIp",
|
|
9207
|
-
title:
|
|
8957
|
+
title: i18n.t("dovetail.sessionAffinity"),
|
|
9208
8958
|
path: ["rawYaml", "spec", "sessionAffinity"]
|
|
9209
8959
|
};
|
|
9210
8960
|
};
|
|
9211
|
-
const ServicePodsField = (
|
|
8961
|
+
const ServicePodsField = () => {
|
|
9212
8962
|
return {
|
|
9213
8963
|
key: "pods",
|
|
9214
8964
|
title: "Pods",
|
|
9215
8965
|
path: [],
|
|
9216
|
-
render: (
|
|
8966
|
+
render: (_, record) => {
|
|
9217
8967
|
var _a, _b;
|
|
9218
8968
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9219
8969
|
WorkloadPodsTable,
|
|
@@ -9387,44 +9137,22 @@ const MonacoYamlEditor$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.
|
|
|
9387
9137
|
__proto__: null,
|
|
9388
9138
|
default: MonacoYamlEditor$1
|
|
9389
9139
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9390
|
-
const index_m52iq6 = "";
|
|
9391
|
-
const TagWrapper = "t13a6vox";
|
|
9392
|
-
const TagStyle = "t12ikbmp";
|
|
9393
|
-
const Tags = (props) => {
|
|
9394
|
-
const {
|
|
9395
|
-
value
|
|
9396
|
-
} = props;
|
|
9397
|
-
const kit = useUIKit();
|
|
9398
|
-
const tags = Object.keys(value).map((key) => {
|
|
9399
|
-
return /* @__PURE__ */ jsxRuntime.exports.jsxs(kit.tag, {
|
|
9400
|
-
className: TagStyle,
|
|
9401
|
-
title: `${key}:${value[key]}`,
|
|
9402
|
-
children: [key, ":", value[key]]
|
|
9403
|
-
}, key);
|
|
9404
|
-
});
|
|
9405
|
-
return /* @__PURE__ */ jsxRuntime.exports.jsx(kit.space, {
|
|
9406
|
-
className: TagWrapper,
|
|
9407
|
-
size: 8,
|
|
9408
|
-
children: tags
|
|
9409
|
-
});
|
|
9410
|
-
};
|
|
9411
9140
|
const EventsTable = ({}) => {
|
|
9412
|
-
useUIKit();
|
|
9413
9141
|
const { i18n: i18n2 } = useTranslation();
|
|
9414
9142
|
const [currentPage, setCurrentPage] = useState(1);
|
|
9415
|
-
const parsed = useParsed();
|
|
9416
9143
|
const { data: data2, isLoading } = useList({
|
|
9417
9144
|
resource: "events",
|
|
9418
9145
|
meta: { resourceBasePath: "/apis/events.k8s.io/v1", kind: "Event" }
|
|
9419
9146
|
});
|
|
9147
|
+
const parsed = useParsed();
|
|
9420
9148
|
const columns = useMemo(
|
|
9421
9149
|
() => [
|
|
9422
|
-
NameSpaceColumnRenderer(
|
|
9150
|
+
NameSpaceColumnRenderer(),
|
|
9423
9151
|
{
|
|
9424
9152
|
key: "type",
|
|
9425
9153
|
display: true,
|
|
9426
9154
|
dataIndex: ["rawYaml", "type"],
|
|
9427
|
-
title: i18n2.t("type"),
|
|
9155
|
+
title: i18n2.t("dovetail.type"),
|
|
9428
9156
|
sortable: true,
|
|
9429
9157
|
sorter: CommonSorter(["rawYaml", "type"])
|
|
9430
9158
|
},
|
|
@@ -9432,7 +9160,7 @@ const EventsTable = ({}) => {
|
|
|
9432
9160
|
key: "reason",
|
|
9433
9161
|
display: true,
|
|
9434
9162
|
dataIndex: ["rawYaml", "reason"],
|
|
9435
|
-
title: i18n2.t("reason"),
|
|
9163
|
+
title: i18n2.t("dovetail.reason"),
|
|
9436
9164
|
sortable: true,
|
|
9437
9165
|
sorter: CommonSorter(["rawYaml", "reason"])
|
|
9438
9166
|
},
|
|
@@ -9440,7 +9168,7 @@ const EventsTable = ({}) => {
|
|
|
9440
9168
|
key: "object",
|
|
9441
9169
|
display: true,
|
|
9442
9170
|
dataIndex: ["rawYaml", "regarding", "name"],
|
|
9443
|
-
title: i18n2.t("object"),
|
|
9171
|
+
title: i18n2.t("dovetail.object"),
|
|
9444
9172
|
sortable: true,
|
|
9445
9173
|
sorter: CommonSorter(["rawYaml", "regarding", "name"])
|
|
9446
9174
|
},
|
|
@@ -9448,11 +9176,11 @@ const EventsTable = ({}) => {
|
|
|
9448
9176
|
key: "note",
|
|
9449
9177
|
display: true,
|
|
9450
9178
|
dataIndex: ["rawYaml", "note"],
|
|
9451
|
-
title: i18n2.t("note"),
|
|
9179
|
+
title: i18n2.t("dovetail.note"),
|
|
9452
9180
|
sortable: true,
|
|
9453
9181
|
sorter: CommonSorter(["rawYaml", "note"])
|
|
9454
9182
|
},
|
|
9455
|
-
AgeColumnRenderer(
|
|
9183
|
+
AgeColumnRenderer()
|
|
9456
9184
|
],
|
|
9457
9185
|
[i18n2]
|
|
9458
9186
|
);
|
|
@@ -9460,7 +9188,7 @@ const EventsTable = ({}) => {
|
|
|
9460
9188
|
() => addId((data2 == null ? void 0 : data2.data) || [], "metadata.uid").filter((d) => {
|
|
9461
9189
|
const objectId = `${d.regarding.namespace}/${d.regarding.name}`;
|
|
9462
9190
|
return objectId === parsed.id;
|
|
9463
|
-
})
|
|
9191
|
+
}),
|
|
9464
9192
|
[data2 == null ? void 0 : data2.data, parsed]
|
|
9465
9193
|
);
|
|
9466
9194
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
@@ -9478,6 +9206,27 @@ const EventsTable = ({}) => {
|
|
|
9478
9206
|
}
|
|
9479
9207
|
);
|
|
9480
9208
|
};
|
|
9209
|
+
const index_m52iq6 = "";
|
|
9210
|
+
const TagWrapper = "t13a6vox";
|
|
9211
|
+
const TagStyle = "t12ikbmp";
|
|
9212
|
+
const Tags = (props) => {
|
|
9213
|
+
const {
|
|
9214
|
+
value
|
|
9215
|
+
} = props;
|
|
9216
|
+
const kit = useUIKit();
|
|
9217
|
+
const tags = Object.keys(value).map((key) => {
|
|
9218
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsxs(kit.tag, {
|
|
9219
|
+
className: TagStyle,
|
|
9220
|
+
title: `${key}:${value[key]}`,
|
|
9221
|
+
children: [key, ":", value[key]]
|
|
9222
|
+
}, key);
|
|
9223
|
+
});
|
|
9224
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(kit.space, {
|
|
9225
|
+
className: TagWrapper,
|
|
9226
|
+
size: 8,
|
|
9227
|
+
children: tags
|
|
9228
|
+
});
|
|
9229
|
+
};
|
|
9481
9230
|
const ShowContent_10jwllm = "";
|
|
9482
9231
|
const TopBarStyle = "t9agep2";
|
|
9483
9232
|
const ShowContentStyle = "so89gfi";
|
|
@@ -9512,14 +9261,15 @@ const ShowContent = (props) => {
|
|
|
9512
9261
|
if (!(data2 == null ? void 0 : data2.data)) {
|
|
9513
9262
|
return null;
|
|
9514
9263
|
}
|
|
9515
|
-
const
|
|
9264
|
+
const model = data2.data;
|
|
9265
|
+
const record = formatter ? formatter(model) : data2 == null ? void 0 : data2.data;
|
|
9516
9266
|
const FirstLineFields = [{
|
|
9517
9267
|
key: "NameSpace",
|
|
9518
|
-
title: t("namespace"),
|
|
9268
|
+
title: t("dovetail.namespace"),
|
|
9519
9269
|
path: ["metadata", "namespace"]
|
|
9520
9270
|
}, {
|
|
9521
9271
|
key: "Age",
|
|
9522
|
-
title: t("created_time"),
|
|
9272
|
+
title: t("dovetail.created_time"),
|
|
9523
9273
|
path: ["metadata", "creationTimestamp"],
|
|
9524
9274
|
render(value) {
|
|
9525
9275
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(Time, {
|
|
@@ -9529,7 +9279,7 @@ const ShowContent = (props) => {
|
|
|
9529
9279
|
}];
|
|
9530
9280
|
const SecondLineFields = [{
|
|
9531
9281
|
key: "Labels",
|
|
9532
|
-
title: t("label"),
|
|
9282
|
+
title: t("dovetail.label"),
|
|
9533
9283
|
path: ["metadata", "labels"],
|
|
9534
9284
|
render: (value) => {
|
|
9535
9285
|
if (!value) {
|
|
@@ -9541,7 +9291,7 @@ const ShowContent = (props) => {
|
|
|
9541
9291
|
}
|
|
9542
9292
|
}, {
|
|
9543
9293
|
key: "Annotations",
|
|
9544
|
-
title: t("annotation"),
|
|
9294
|
+
title: t("dovetail.annotation"),
|
|
9545
9295
|
path: ["metadata", "annotations"],
|
|
9546
9296
|
render: (value) => {
|
|
9547
9297
|
if (!value) {
|
|
@@ -9590,7 +9340,7 @@ const ShowContent = (props) => {
|
|
|
9590
9340
|
onChange: (e) => setMode(e.target.value),
|
|
9591
9341
|
children: [/* @__PURE__ */ jsxRuntime.exports.jsx(kit.radioButton, {
|
|
9592
9342
|
value: "detail",
|
|
9593
|
-
children: t("detail")
|
|
9343
|
+
children: t("dovetail.detail")
|
|
9594
9344
|
}), /* @__PURE__ */ jsxRuntime.exports.jsx(kit.radioButton, {
|
|
9595
9345
|
value: "yaml",
|
|
9596
9346
|
children: "YAML"
|
|
@@ -9627,7 +9377,7 @@ const ShowContent = (props) => {
|
|
|
9627
9377
|
children: content
|
|
9628
9378
|
}, field.key);
|
|
9629
9379
|
}), /* @__PURE__ */ jsxRuntime.exports.jsx(kit.tabsTabPane, {
|
|
9630
|
-
tab: t("event"),
|
|
9380
|
+
tab: t("dovetail.event"),
|
|
9631
9381
|
children: /* @__PURE__ */ jsxRuntime.exports.jsx(EventsTable, {})
|
|
9632
9382
|
}, "event")]
|
|
9633
9383
|
});
|
|
@@ -9637,7 +9387,7 @@ const ShowContent = (props) => {
|
|
|
9637
9387
|
}),
|
|
9638
9388
|
["yaml"]: /* @__PURE__ */ jsxRuntime.exports.jsx(MonacoYamlEditor$1, {
|
|
9639
9389
|
className: EditorStyle$1,
|
|
9640
|
-
defaultValue: yaml.dump(
|
|
9390
|
+
defaultValue: yaml.dump(model.restore()),
|
|
9641
9391
|
schema: {},
|
|
9642
9392
|
onEditorCreate: (editor) => {
|
|
9643
9393
|
fold(editor);
|
|
@@ -9691,7 +9441,7 @@ const PodContainersTable = ({
|
|
|
9691
9441
|
{
|
|
9692
9442
|
key: "state",
|
|
9693
9443
|
dataIndex: ["state"],
|
|
9694
|
-
title: i18n2.t("state"),
|
|
9444
|
+
title: i18n2.t("dovetail.state"),
|
|
9695
9445
|
sortable: true,
|
|
9696
9446
|
sorter: CommonSorter(["state"]),
|
|
9697
9447
|
render: (v) => /* @__PURE__ */ jsxRuntime.exports.jsx(StateTag, { state: Object.keys(v)[0] })
|
|
@@ -9699,7 +9449,7 @@ const PodContainersTable = ({
|
|
|
9699
9449
|
{
|
|
9700
9450
|
key: "ready",
|
|
9701
9451
|
dataIndex: ["ready"],
|
|
9702
|
-
title: i18n2.t("ready"),
|
|
9452
|
+
title: i18n2.t("dovetail.ready"),
|
|
9703
9453
|
sortable: true,
|
|
9704
9454
|
sorter: CommonSorter(["ready"]),
|
|
9705
9455
|
render: (v) => /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
@@ -9712,21 +9462,21 @@ const PodContainersTable = ({
|
|
|
9712
9462
|
{
|
|
9713
9463
|
key: "name",
|
|
9714
9464
|
dataIndex: ["name"],
|
|
9715
|
-
title: i18n2.t("name"),
|
|
9465
|
+
title: i18n2.t("dovetail.name"),
|
|
9716
9466
|
sortable: true,
|
|
9717
9467
|
sorter: CommonSorter(["name"])
|
|
9718
9468
|
},
|
|
9719
9469
|
{
|
|
9720
9470
|
key: "image",
|
|
9721
9471
|
dataIndex: ["image"],
|
|
9722
|
-
title: i18n2.t("image"),
|
|
9472
|
+
title: i18n2.t("dovetail.image"),
|
|
9723
9473
|
sortable: true,
|
|
9724
9474
|
sorter: CommonSorter(["image"])
|
|
9725
9475
|
},
|
|
9726
9476
|
{
|
|
9727
9477
|
key: "init",
|
|
9728
9478
|
dataIndex: [],
|
|
9729
|
-
title: i18n2.t("init_container"),
|
|
9479
|
+
title: i18n2.t("dovetail.init_container"),
|
|
9730
9480
|
render: (_, record) => {
|
|
9731
9481
|
const isInit = initContainerStatuses.some(
|
|
9732
9482
|
(c) => c.containerID === record.containerID
|
|
@@ -9740,14 +9490,14 @@ const PodContainersTable = ({
|
|
|
9740
9490
|
{
|
|
9741
9491
|
key: "restartCount",
|
|
9742
9492
|
dataIndex: ["restartCount"],
|
|
9743
|
-
title: i18n2.t("restarts"),
|
|
9493
|
+
title: i18n2.t("dovetail.restarts"),
|
|
9744
9494
|
sortable: true,
|
|
9745
9495
|
sorter: CommonSorter(["restartCount"])
|
|
9746
9496
|
},
|
|
9747
9497
|
{
|
|
9748
9498
|
key: "started",
|
|
9749
9499
|
dataIndex: ["state", "running", "startedAt"],
|
|
9750
|
-
title: i18n2.t("started"),
|
|
9500
|
+
title: i18n2.t("dovetail.started"),
|
|
9751
9501
|
sortable: true,
|
|
9752
9502
|
sorter: CommonSorter(["state", "running", "startedAt"]),
|
|
9753
9503
|
render: (value) => {
|
|
@@ -9822,13 +9572,13 @@ function ListPage(props) {
|
|
|
9822
9572
|
}
|
|
9823
9573
|
function ResourceList(props) {
|
|
9824
9574
|
const { formatter, name: name2, columns, Dropdown } = props;
|
|
9825
|
-
|
|
9575
|
+
useTranslation();
|
|
9826
9576
|
const { tableProps, selectedKeys } = useEagleTable({
|
|
9827
9577
|
useTableParams: {},
|
|
9828
9578
|
columns: [
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
NameSpaceColumnRenderer(
|
|
9579
|
+
NameColumnRenderer(),
|
|
9580
|
+
PhaseColumnRenderer(),
|
|
9581
|
+
NameSpaceColumnRenderer(),
|
|
9832
9582
|
...columns
|
|
9833
9583
|
],
|
|
9834
9584
|
tableProps: {
|
|
@@ -9850,6 +9600,46 @@ function ResourceShow(props) {
|
|
|
9850
9600
|
}
|
|
9851
9601
|
);
|
|
9852
9602
|
}
|
|
9603
|
+
const index_1kmu85y = "";
|
|
9604
|
+
const ErrorWrapper = /* @__PURE__ */ styled_default("div")({
|
|
9605
|
+
name: "ErrorWrapper",
|
|
9606
|
+
class: "egn3dbn",
|
|
9607
|
+
propsAsIs: false
|
|
9608
|
+
});
|
|
9609
|
+
const ErrorContent = /* @__PURE__ */ styled_default("div")({
|
|
9610
|
+
name: "ErrorContent",
|
|
9611
|
+
class: "e136jgy8",
|
|
9612
|
+
propsAsIs: false
|
|
9613
|
+
});
|
|
9614
|
+
const WidgetErrorContent = (props) => {
|
|
9615
|
+
const {
|
|
9616
|
+
refetch,
|
|
9617
|
+
errorText,
|
|
9618
|
+
hiddenRetry
|
|
9619
|
+
} = props;
|
|
9620
|
+
const kit = useContext(kitContext);
|
|
9621
|
+
const {
|
|
9622
|
+
t
|
|
9623
|
+
} = useTranslation();
|
|
9624
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(ErrorWrapper, {
|
|
9625
|
+
className: props.className,
|
|
9626
|
+
style: props.style,
|
|
9627
|
+
children: /* @__PURE__ */ jsxRuntime.exports.jsxs(ErrorContent, {
|
|
9628
|
+
children: [/* @__PURE__ */ jsxRuntime.exports.jsx("p", {
|
|
9629
|
+
className: cx_default(Typo.Label.l1_regular_title, "title"),
|
|
9630
|
+
children: errorText || t("dovetail.obtain_data_error")
|
|
9631
|
+
}), hiddenRetry ? null : /* @__PURE__ */ jsxRuntime.exports.jsx(kit.button, {
|
|
9632
|
+
size: "small",
|
|
9633
|
+
type: "ordinary",
|
|
9634
|
+
onClick: (e) => {
|
|
9635
|
+
e.stopPropagation();
|
|
9636
|
+
refetch == null ? void 0 : refetch();
|
|
9637
|
+
},
|
|
9638
|
+
children: t("dovetail.retry")
|
|
9639
|
+
})]
|
|
9640
|
+
})
|
|
9641
|
+
});
|
|
9642
|
+
};
|
|
9853
9643
|
const index_12sfrn = "";
|
|
9854
9644
|
const Style = "s1bsn3us";
|
|
9855
9645
|
const Separator = () => {
|
|
@@ -9858,7 +9648,7 @@ const Separator = () => {
|
|
|
9858
9648
|
});
|
|
9859
9649
|
};
|
|
9860
9650
|
const MonacoYamlEditor = React.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
|
|
9861
|
-
const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.
|
|
9651
|
+
const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.15656940.js"));
|
|
9862
9652
|
const YamlEditorComponent = forwardRef(
|
|
9863
9653
|
function YamlEditorComponent2(props, ref) {
|
|
9864
9654
|
const {
|
|
@@ -9891,8 +9681,8 @@ const YamlEditorComponent = forwardRef(
|
|
|
9891
9681
|
(_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(value2);
|
|
9892
9682
|
},
|
|
9893
9683
|
getEditorValue: () => {
|
|
9894
|
-
var _a;
|
|
9895
|
-
return ((_a = editorInstance.current) == null ? void 0 : _a.getValue())
|
|
9684
|
+
var _a, _b;
|
|
9685
|
+
return (_b = (_a = editorInstance.current) == null ? void 0 : _a.getValue()) != null ? _b : "";
|
|
9896
9686
|
},
|
|
9897
9687
|
getEditorInstance: () => editorInstance.current || null
|
|
9898
9688
|
};
|
|
@@ -10097,17 +9887,183 @@ const YamlEditorComponent = forwardRef(
|
|
|
10097
9887
|
)
|
|
10098
9888
|
]
|
|
10099
9889
|
}
|
|
10100
|
-
);
|
|
9890
|
+
);
|
|
9891
|
+
}
|
|
9892
|
+
);
|
|
9893
|
+
function copyToClipboard(text) {
|
|
9894
|
+
const input = document.createElement("textarea");
|
|
9895
|
+
input.value = text;
|
|
9896
|
+
document.body.appendChild(input);
|
|
9897
|
+
input.select();
|
|
9898
|
+
document.execCommand("copy");
|
|
9899
|
+
document.body.removeChild(input);
|
|
9900
|
+
}
|
|
9901
|
+
const BASE_INIT_VALUE = {
|
|
9902
|
+
metadata: {
|
|
9903
|
+
name: "",
|
|
9904
|
+
namespace: "default",
|
|
9905
|
+
annotations: {},
|
|
9906
|
+
labels: {}
|
|
9907
|
+
}
|
|
9908
|
+
};
|
|
9909
|
+
const DEFAULT_MATCH_LABEL = "sks.user.kubesmart.smtx.io/app";
|
|
9910
|
+
const BASE_CONTAINER_INIT_VALUE = {
|
|
9911
|
+
name: "container-0",
|
|
9912
|
+
imagePullPolicy: "Always",
|
|
9913
|
+
image: ""
|
|
9914
|
+
};
|
|
9915
|
+
const BASE_WORKLOAD_SPEC_INIT_VALUE = {
|
|
9916
|
+
affinity: {},
|
|
9917
|
+
imagePullSecrets: [],
|
|
9918
|
+
initContainers: [],
|
|
9919
|
+
volumes: []
|
|
9920
|
+
};
|
|
9921
|
+
const DEPLOYMENT_INIT_VALUE = {
|
|
9922
|
+
apiVersion: "apps/v1",
|
|
9923
|
+
kind: "Deployment",
|
|
9924
|
+
...BASE_INIT_VALUE,
|
|
9925
|
+
spec: {
|
|
9926
|
+
replicas: 1,
|
|
9927
|
+
selector: {
|
|
9928
|
+
matchLabels: {
|
|
9929
|
+
[DEFAULT_MATCH_LABEL]: ""
|
|
9930
|
+
}
|
|
9931
|
+
},
|
|
9932
|
+
template: {
|
|
9933
|
+
metadata: {
|
|
9934
|
+
labels: {
|
|
9935
|
+
[DEFAULT_MATCH_LABEL]: ""
|
|
9936
|
+
}
|
|
9937
|
+
},
|
|
9938
|
+
spec: {
|
|
9939
|
+
containers: [BASE_CONTAINER_INIT_VALUE],
|
|
9940
|
+
restartPolicy: "Always",
|
|
9941
|
+
...BASE_WORKLOAD_SPEC_INIT_VALUE
|
|
9942
|
+
}
|
|
9943
|
+
}
|
|
9944
|
+
}
|
|
9945
|
+
};
|
|
9946
|
+
const CRONJOB_INIT_VALUE = {
|
|
9947
|
+
apiVersion: "batch/v1",
|
|
9948
|
+
kind: "CronJob",
|
|
9949
|
+
...BASE_INIT_VALUE,
|
|
9950
|
+
spec: {
|
|
9951
|
+
schedule: "",
|
|
9952
|
+
jobTemplate: {
|
|
9953
|
+
metadata: {
|
|
9954
|
+
labels: {}
|
|
9955
|
+
},
|
|
9956
|
+
spec: {
|
|
9957
|
+
template: {
|
|
9958
|
+
spec: {
|
|
9959
|
+
containers: [BASE_CONTAINER_INIT_VALUE],
|
|
9960
|
+
restartPolicy: "Never",
|
|
9961
|
+
...BASE_WORKLOAD_SPEC_INIT_VALUE
|
|
9962
|
+
}
|
|
9963
|
+
}
|
|
9964
|
+
}
|
|
9965
|
+
}
|
|
9966
|
+
}
|
|
9967
|
+
};
|
|
9968
|
+
const DAEMONSET_INIT_VALUE = {
|
|
9969
|
+
apiVersion: "apps/v1",
|
|
9970
|
+
kind: "DaemonSet",
|
|
9971
|
+
...BASE_INIT_VALUE,
|
|
9972
|
+
spec: {
|
|
9973
|
+
replicas: 1,
|
|
9974
|
+
selector: {
|
|
9975
|
+
matchLabels: {
|
|
9976
|
+
[DEFAULT_MATCH_LABEL]: ""
|
|
9977
|
+
}
|
|
9978
|
+
},
|
|
9979
|
+
template: {
|
|
9980
|
+
metadata: {
|
|
9981
|
+
labels: {
|
|
9982
|
+
[DEFAULT_MATCH_LABEL]: ""
|
|
9983
|
+
}
|
|
9984
|
+
},
|
|
9985
|
+
spec: {
|
|
9986
|
+
containers: [BASE_CONTAINER_INIT_VALUE],
|
|
9987
|
+
restartPolicy: "Always",
|
|
9988
|
+
...BASE_WORKLOAD_SPEC_INIT_VALUE
|
|
9989
|
+
}
|
|
9990
|
+
}
|
|
9991
|
+
}
|
|
9992
|
+
};
|
|
9993
|
+
const JOB_INIT_VALUE = {
|
|
9994
|
+
apiVersion: "batch/v1",
|
|
9995
|
+
kind: "Job",
|
|
9996
|
+
...BASE_INIT_VALUE,
|
|
9997
|
+
spec: {
|
|
9998
|
+
replicas: 1,
|
|
9999
|
+
selector: {
|
|
10000
|
+
matchLabels: {}
|
|
10001
|
+
},
|
|
10002
|
+
template: {
|
|
10003
|
+
metadata: {
|
|
10004
|
+
labels: {}
|
|
10005
|
+
},
|
|
10006
|
+
spec: {
|
|
10007
|
+
containers: [BASE_CONTAINER_INIT_VALUE],
|
|
10008
|
+
restartPolicy: "Never",
|
|
10009
|
+
...BASE_WORKLOAD_SPEC_INIT_VALUE
|
|
10010
|
+
}
|
|
10011
|
+
}
|
|
10012
|
+
}
|
|
10013
|
+
};
|
|
10014
|
+
const STATEFULSET_INIT_VALUE = {
|
|
10015
|
+
apiVersion: "apps/v1",
|
|
10016
|
+
kind: "StatefulSet",
|
|
10017
|
+
...BASE_INIT_VALUE,
|
|
10018
|
+
spec: {
|
|
10019
|
+
replicas: 1,
|
|
10020
|
+
selector: {
|
|
10021
|
+
matchLabels: {
|
|
10022
|
+
[DEFAULT_MATCH_LABEL]: ""
|
|
10023
|
+
}
|
|
10024
|
+
},
|
|
10025
|
+
template: {
|
|
10026
|
+
metadata: {
|
|
10027
|
+
labels: {
|
|
10028
|
+
[DEFAULT_MATCH_LABEL]: ""
|
|
10029
|
+
}
|
|
10030
|
+
},
|
|
10031
|
+
spec: {
|
|
10032
|
+
containers: [BASE_CONTAINER_INIT_VALUE],
|
|
10033
|
+
restartPolicy: "Always",
|
|
10034
|
+
...BASE_WORKLOAD_SPEC_INIT_VALUE
|
|
10035
|
+
}
|
|
10036
|
+
}
|
|
10101
10037
|
}
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
}
|
|
10038
|
+
};
|
|
10039
|
+
const POD_INIT_VALUE = {
|
|
10040
|
+
apiVersion: "v1",
|
|
10041
|
+
kind: "Pod",
|
|
10042
|
+
...BASE_INIT_VALUE,
|
|
10043
|
+
spec: {
|
|
10044
|
+
containers: [BASE_CONTAINER_INIT_VALUE]
|
|
10045
|
+
}
|
|
10046
|
+
};
|
|
10047
|
+
const SERVICE_INIT_VALUE = {
|
|
10048
|
+
"apiVersion": "v1",
|
|
10049
|
+
"kind": "Service",
|
|
10050
|
+
...BASE_INIT_VALUE,
|
|
10051
|
+
"spec": {
|
|
10052
|
+
"selector": {},
|
|
10053
|
+
"clusterIP": null,
|
|
10054
|
+
"ports": [
|
|
10055
|
+
{
|
|
10056
|
+
"name": "",
|
|
10057
|
+
"port": null,
|
|
10058
|
+
"protocol": "TCP",
|
|
10059
|
+
"targetPort": null
|
|
10060
|
+
}
|
|
10061
|
+
],
|
|
10062
|
+
"sessionAffinity": "None",
|
|
10063
|
+
"type": "ClusterIP"
|
|
10064
|
+
}
|
|
10065
|
+
};
|
|
10066
|
+
const TIMESTAMP_LABEL = "sks.user.kubesmart.smtx.io/timestamp";
|
|
10111
10067
|
function getCommonErrors(response, i18n2) {
|
|
10112
10068
|
var _a;
|
|
10113
10069
|
if (!((response == null ? void 0 : response.message) || (response == null ? void 0 : response.code) || (response == null ? void 0 : response.reason) || (response == null ? void 0 : response.details) || (response == null ? void 0 : response.graphQLErrors))) {
|
|
@@ -10155,17 +10111,33 @@ function getCommonErrors(response, i18n2) {
|
|
|
10155
10111
|
)
|
|
10156
10112
|
];
|
|
10157
10113
|
}
|
|
10158
|
-
const
|
|
10159
|
-
const
|
|
10114
|
+
const index_1mpguu8 = "";
|
|
10115
|
+
const FormStyle = "f5ks0bl";
|
|
10116
|
+
const EditorStyle = "e1tqaxpu";
|
|
10117
|
+
var SchemaStrategy = /* @__PURE__ */ ((SchemaStrategy2) => {
|
|
10118
|
+
SchemaStrategy2["Required"] = "Required";
|
|
10119
|
+
SchemaStrategy2["Optional"] = "Optional";
|
|
10120
|
+
SchemaStrategy2["None"] = "None";
|
|
10121
|
+
return SchemaStrategy2;
|
|
10122
|
+
})(SchemaStrategy || {});
|
|
10160
10123
|
function YamlForm(props) {
|
|
10161
10124
|
var _a, _b;
|
|
10125
|
+
const {
|
|
10126
|
+
schemaStrategy = "Optional"
|
|
10127
|
+
} = props;
|
|
10162
10128
|
const {
|
|
10163
10129
|
formProps,
|
|
10164
10130
|
saveButtonProps,
|
|
10165
10131
|
editorProps,
|
|
10166
10132
|
errorResponseBody,
|
|
10167
|
-
mutationResult
|
|
10168
|
-
|
|
10133
|
+
mutationResult,
|
|
10134
|
+
isLoadingSchema,
|
|
10135
|
+
fetchSchema
|
|
10136
|
+
} = useEagleForm({
|
|
10137
|
+
editorOptions: {
|
|
10138
|
+
isSkipSchema: schemaStrategy === "None"
|
|
10139
|
+
}
|
|
10140
|
+
});
|
|
10169
10141
|
const kit = useUIKit();
|
|
10170
10142
|
const {
|
|
10171
10143
|
t,
|
|
@@ -10177,38 +10149,47 @@ function YamlForm(props) {
|
|
|
10177
10149
|
...formProps,
|
|
10178
10150
|
initialValues: (_b = (_a = formProps.initialValues) != null ? _a : props.initialValues) != null ? _b : BASE_INIT_VALUE,
|
|
10179
10151
|
layout: "horizontal",
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
className: EditorStyle,
|
|
10188
|
-
schema: editorProps.schema,
|
|
10189
|
-
collapsable: false
|
|
10190
|
-
})
|
|
10191
|
-
}), /* @__PURE__ */ jsxRuntime.exports.jsxs(kit.form.Item, {
|
|
10192
|
-
children: [mutationResult.error && /* @__PURE__ */ jsxRuntime.exports.jsx(kit.alert, {
|
|
10193
|
-
message: errorResponseBody ? /* @__PURE__ */ jsxRuntime.exports.jsx("ul", {
|
|
10194
|
-
children: responseErrors.map((error, index) => /* @__PURE__ */ jsxRuntime.exports.jsxs("li", {
|
|
10195
|
-
children: [responseErrors.length > 1 ? index + 1 + ". " : "", error]
|
|
10196
|
-
}, error))
|
|
10197
|
-
}) : mutationResult.error.message,
|
|
10198
|
-
type: "error",
|
|
10199
|
-
style: {
|
|
10200
|
-
marginTop: 16
|
|
10201
|
-
}
|
|
10202
|
-
}), /* @__PURE__ */ jsxRuntime.exports.jsx(kit.button, {
|
|
10203
|
-
...saveButtonProps,
|
|
10204
|
-
type: "primary",
|
|
10152
|
+
className: FormStyle,
|
|
10153
|
+
children: (() => {
|
|
10154
|
+
if (isLoadingSchema) {
|
|
10155
|
+
return /* @__PURE__ */ jsxRuntime.exports.jsx(kit.loading, {});
|
|
10156
|
+
}
|
|
10157
|
+
return editorProps.schema || schemaStrategy !== "Required" ? /* @__PURE__ */ jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, {
|
|
10158
|
+
children: [/* @__PURE__ */ jsxRuntime.exports.jsx(kit.form.Item, {
|
|
10205
10159
|
style: {
|
|
10206
|
-
|
|
10160
|
+
flex: 1
|
|
10207
10161
|
},
|
|
10208
|
-
children:
|
|
10162
|
+
children: /* @__PURE__ */ jsxRuntime.exports.jsx(YamlEditorComponent, {
|
|
10163
|
+
...editorProps,
|
|
10164
|
+
className: EditorStyle,
|
|
10165
|
+
schema: editorProps.schema || {},
|
|
10166
|
+
collapsable: false
|
|
10167
|
+
})
|
|
10168
|
+
}), /* @__PURE__ */ jsxRuntime.exports.jsxs(kit.form.Item, {
|
|
10169
|
+
children: [mutationResult.error && /* @__PURE__ */ jsxRuntime.exports.jsx(kit.alert, {
|
|
10170
|
+
message: errorResponseBody ? /* @__PURE__ */ jsxRuntime.exports.jsx("ul", {
|
|
10171
|
+
children: responseErrors.map((error, index) => /* @__PURE__ */ jsxRuntime.exports.jsxs("li", {
|
|
10172
|
+
children: [responseErrors.length > 1 ? index + 1 + ". " : "", error]
|
|
10173
|
+
}, error))
|
|
10174
|
+
}) : mutationResult.error.message,
|
|
10175
|
+
type: "error",
|
|
10176
|
+
style: {
|
|
10177
|
+
marginTop: 16
|
|
10178
|
+
}
|
|
10179
|
+
}), /* @__PURE__ */ jsxRuntime.exports.jsx(kit.button, {
|
|
10180
|
+
...saveButtonProps,
|
|
10181
|
+
type: "primary",
|
|
10182
|
+
style: {
|
|
10183
|
+
marginTop: 16
|
|
10184
|
+
},
|
|
10185
|
+
children: t("dovetail.save")
|
|
10186
|
+
})]
|
|
10209
10187
|
})]
|
|
10210
|
-
})
|
|
10211
|
-
|
|
10188
|
+
}) : /* @__PURE__ */ jsxRuntime.exports.jsx(WidgetErrorContent, {
|
|
10189
|
+
errorText: t("dovetail.fetch_schema_fail"),
|
|
10190
|
+
refetch: fetchSchema
|
|
10191
|
+
});
|
|
10192
|
+
})()
|
|
10212
10193
|
})
|
|
10213
10194
|
});
|
|
10214
10195
|
}
|
|
@@ -10231,13 +10212,12 @@ const ResourceCRUD = (props) => {
|
|
|
10231
10212
|
const { i18n: i18n2 } = useTranslation();
|
|
10232
10213
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment, { children: configs.map((config) => {
|
|
10233
10214
|
var _a, _b;
|
|
10234
|
-
const formatter = config.formatter || ((v) => new ResourceModel(v));
|
|
10235
10215
|
return /* @__PURE__ */ jsxRuntime.exports.jsxs(React.Fragment, { children: [
|
|
10236
10216
|
/* @__PURE__ */ jsxRuntime.exports.jsx(Route, { path: `${urlPrefix}/${config.name}`, exact: true, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
10237
10217
|
ResourceList,
|
|
10238
10218
|
{
|
|
10239
10219
|
name: config.kind,
|
|
10240
|
-
formatter,
|
|
10220
|
+
formatter: config.formatter,
|
|
10241
10221
|
columns: ((_a = config.columns) == null ? void 0 : _a.call(config, i18n2)) || [],
|
|
10242
10222
|
Dropdown: config.Dropdown
|
|
10243
10223
|
}
|
|
@@ -10245,7 +10225,7 @@ const ResourceCRUD = (props) => {
|
|
|
10245
10225
|
/* @__PURE__ */ jsxRuntime.exports.jsx(Route, { path: `${urlPrefix}/${config.name}/show`, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
10246
10226
|
ResourceShow,
|
|
10247
10227
|
{
|
|
10248
|
-
formatter,
|
|
10228
|
+
formatter: config.formatter,
|
|
10249
10229
|
filedGroups: ((_b = config.showFields) == null ? void 0 : _b.call(config, i18n2)) || [],
|
|
10250
10230
|
Dropdown: config.Dropdown
|
|
10251
10231
|
}
|
|
@@ -10256,19 +10236,19 @@ const ResourceCRUD = (props) => {
|
|
|
10256
10236
|
}) });
|
|
10257
10237
|
};
|
|
10258
10238
|
function CronJobDropdown(props) {
|
|
10259
|
-
var _a;
|
|
10260
10239
|
const { data: data2 } = props;
|
|
10240
|
+
const { spec } = data2;
|
|
10261
10241
|
const kit = useUIKit();
|
|
10262
10242
|
const { resource } = useResource();
|
|
10263
10243
|
const { mutate } = useUpdate();
|
|
10264
10244
|
const { t } = useTranslation();
|
|
10265
|
-
const suspended = Boolean(
|
|
10245
|
+
const suspended = Boolean(spec == null ? void 0 : spec.suspend);
|
|
10266
10246
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(K8sDropdown, { data: data2, children: /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
10267
10247
|
kit.menu.Item,
|
|
10268
10248
|
{
|
|
10269
10249
|
onClick: () => {
|
|
10270
10250
|
const v = suspended ? data2.resume() : data2.suspend();
|
|
10271
|
-
const id =
|
|
10251
|
+
const id = data2.id;
|
|
10272
10252
|
pruneBeforeEdit(v);
|
|
10273
10253
|
mutate({
|
|
10274
10254
|
id,
|
|
@@ -10280,6 +10260,40 @@ function CronJobDropdown(props) {
|
|
|
10280
10260
|
}
|
|
10281
10261
|
) });
|
|
10282
10262
|
}
|
|
10263
|
+
const UNITS = ["", "K", "M", "G", "T", "P"];
|
|
10264
|
+
const FRACTIONAL = ["", "m", "u", "n", "p", "f"];
|
|
10265
|
+
function parseSi(inValue, increment = null, allowFractional = true) {
|
|
10266
|
+
if (!inValue || typeof inValue !== "string" || !inValue.length) {
|
|
10267
|
+
return NaN;
|
|
10268
|
+
}
|
|
10269
|
+
inValue = inValue.replace(/,/g, "");
|
|
10270
|
+
let [, valStr, unit, incStr] = inValue.match(/^([0-9.-]+)\s*([^0-9.-]?)([^0-9.-]?)/) || [];
|
|
10271
|
+
const val = parseFloat(valStr);
|
|
10272
|
+
if (!unit) {
|
|
10273
|
+
return val;
|
|
10274
|
+
}
|
|
10275
|
+
if (unit.charCodeAt(0) === 181) {
|
|
10276
|
+
unit = "u";
|
|
10277
|
+
}
|
|
10278
|
+
const divide = FRACTIONAL.includes(unit);
|
|
10279
|
+
const multiply = UNITS.includes(unit.toUpperCase());
|
|
10280
|
+
if (increment === null) {
|
|
10281
|
+
if ((multiply || divide) && incStr === "i") {
|
|
10282
|
+
increment = 1024;
|
|
10283
|
+
} else {
|
|
10284
|
+
increment = 1e3;
|
|
10285
|
+
}
|
|
10286
|
+
}
|
|
10287
|
+
if (divide && allowFractional) {
|
|
10288
|
+
const exp = FRACTIONAL.indexOf(unit);
|
|
10289
|
+
return val / Math.pow(increment, exp);
|
|
10290
|
+
}
|
|
10291
|
+
if (multiply) {
|
|
10292
|
+
const exp = UNITS.indexOf(unit.toUpperCase());
|
|
10293
|
+
return val * Math.pow(increment, exp);
|
|
10294
|
+
}
|
|
10295
|
+
return val;
|
|
10296
|
+
}
|
|
10283
10297
|
const index_1wzdp7m = "";
|
|
10284
10298
|
const WrapperStyle = "wfg6u6g";
|
|
10285
10299
|
const InnerBar = ({
|
|
@@ -10352,7 +10366,7 @@ const DeleteButton = () => {
|
|
|
10352
10366
|
(resource == null ? void 0 : resource.name) || ""
|
|
10353
10367
|
);
|
|
10354
10368
|
return /* @__PURE__ */ jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, { children: [
|
|
10355
|
-
/* @__PURE__ */ jsxRuntime.exports.jsx(kit.button, { type: "primary", danger: true, onClick: () => openDeleteConfirmModal(id || ""), children: t("delete") }),
|
|
10369
|
+
/* @__PURE__ */ jsxRuntime.exports.jsx(kit.button, { type: "primary", danger: true, onClick: () => openDeleteConfirmModal(id || ""), children: t("dovetail.delete") }),
|
|
10356
10370
|
visible ? /* @__PURE__ */ jsxRuntime.exports.jsx(kit.modal, { ...modalProps }) : null
|
|
10357
10371
|
] });
|
|
10358
10372
|
};
|
|
@@ -15964,7 +15978,7 @@ const PodLog = ({
|
|
|
15964
15978
|
var _a, _b, _c, _d, _e;
|
|
15965
15979
|
const kit = useUIKit();
|
|
15966
15980
|
const [selectedContainer, setSelectedContainer] = useState(((_b = (_a = pod.spec) == null ? void 0 : _a.containers[0]) == null ? void 0 : _b.name) || "");
|
|
15967
|
-
const
|
|
15981
|
+
const follow = true;
|
|
15968
15982
|
const [logs, setLogs] = useState([]);
|
|
15969
15983
|
const [currentItemCount, setCurrentItemCount] = useState(0);
|
|
15970
15984
|
const [paused, setPaused] = useState(false);
|
|
@@ -16012,7 +16026,7 @@ const PodLog = ({
|
|
|
16012
16026
|
signal
|
|
16013
16027
|
} = abortControllerRef.current;
|
|
16014
16028
|
let url = `${apiUrl}/api/v1/namespaces/${(_a2 = pod.metadata) == null ? void 0 : _a2.namespace}/pods/${(_b2 = pod.metadata) == null ? void 0 : _b2.name}/log?container=${selectedContainer}&tailLines=100×tamps=true`;
|
|
16015
|
-
|
|
16029
|
+
{
|
|
16016
16030
|
url += "&follow=true";
|
|
16017
16031
|
}
|
|
16018
16032
|
fetch(url, {
|
|
@@ -16082,7 +16096,7 @@ const PodLog = ({
|
|
|
16082
16096
|
children: [/* @__PURE__ */ jsxRuntime.exports.jsx(kit.option, {
|
|
16083
16097
|
value: "",
|
|
16084
16098
|
disabled: true,
|
|
16085
|
-
children: t("select_container")
|
|
16099
|
+
children: t("dovetail.select_container")
|
|
16086
16100
|
}), (((_e = pod.spec) == null ? void 0 : _e.containers) || []).map((container2) => /* @__PURE__ */ jsxRuntime.exports.jsx(kit.option, {
|
|
16087
16101
|
value: container2.name,
|
|
16088
16102
|
children: container2.name
|
|
@@ -16090,11 +16104,11 @@ const PodLog = ({
|
|
|
16090
16104
|
}), /* @__PURE__ */ jsxRuntime.exports.jsx(kit.checkbox, {
|
|
16091
16105
|
checked: wrap2,
|
|
16092
16106
|
onChange: (e) => setWrap(e.target.checked),
|
|
16093
|
-
children: t("wrap")
|
|
16107
|
+
children: t("dovetail.wrap")
|
|
16094
16108
|
}), /* @__PURE__ */ jsxRuntime.exports.jsx(kit.button, {
|
|
16095
16109
|
onClick: () => setPaused((prev) => !prev),
|
|
16096
16110
|
prefixIcon: paused ? /* @__PURE__ */ jsxRuntime.exports.jsx(Resume24Icon, {}) : /* @__PURE__ */ jsxRuntime.exports.jsx(SuspendedPause24GradientOrangeIcon, {}),
|
|
16097
|
-
children: paused ? t("resume_log") : t("suspend")
|
|
16111
|
+
children: paused ? t("dovetail.resume_log") : t("dovetail.suspend")
|
|
16098
16112
|
})]
|
|
16099
16113
|
}), /* @__PURE__ */ jsxRuntime.exports.jsx(LogViewer, {
|
|
16100
16114
|
innerRef: logViewerRef,
|
|
@@ -16109,7 +16123,7 @@ const PodLog = ({
|
|
|
16109
16123
|
borderRadius: 0
|
|
16110
16124
|
},
|
|
16111
16125
|
onClick: () => setPaused(false),
|
|
16112
|
-
children: [t("resume_log"), linesBehind === 0 ? null : t("log_new_lines", {
|
|
16126
|
+
children: [t("dovetail.resume_log"), linesBehind === 0 ? null : t("dovetail.log_new_lines", {
|
|
16113
16127
|
count: linesBehind
|
|
16114
16128
|
})]
|
|
16115
16129
|
}),
|
|
@@ -16117,176 +16131,6 @@ const PodLog = ({
|
|
|
16117
16131
|
})]
|
|
16118
16132
|
});
|
|
16119
16133
|
};
|
|
16120
|
-
const copy$1 = "Copy";
|
|
16121
|
-
const reset_arguments$1 = "Reset";
|
|
16122
|
-
const view_changes$1 = "Show Diff";
|
|
16123
|
-
const back_to_edit$1 = "Edit";
|
|
16124
|
-
const configure_file$1 = "Configuration";
|
|
16125
|
-
const yaml_format_wrong$1 = "Configuration is in an invalid YAML format.";
|
|
16126
|
-
const yaml_value_wrong$1 = "Configuration has invalid values.";
|
|
16127
|
-
const edit_yaml$1 = "Edit YAML";
|
|
16128
|
-
const copied$1 = "Copied";
|
|
16129
|
-
const already_reset$1 = "Already reset";
|
|
16130
|
-
const dovetail$1 = {
|
|
16131
|
-
copy: copy$1,
|
|
16132
|
-
reset_arguments: reset_arguments$1,
|
|
16133
|
-
view_changes: view_changes$1,
|
|
16134
|
-
back_to_edit: back_to_edit$1,
|
|
16135
|
-
configure_file: configure_file$1,
|
|
16136
|
-
yaml_format_wrong: yaml_format_wrong$1,
|
|
16137
|
-
yaml_value_wrong: yaml_value_wrong$1,
|
|
16138
|
-
edit_yaml: edit_yaml$1,
|
|
16139
|
-
copied: copied$1,
|
|
16140
|
-
already_reset: already_reset$1
|
|
16141
|
-
};
|
|
16142
|
-
const EN = {
|
|
16143
|
-
dovetail: dovetail$1
|
|
16144
|
-
};
|
|
16145
|
-
const copy = "\u590D\u5236";
|
|
16146
|
-
const reset_arguments = "\u91CD\u7F6E";
|
|
16147
|
-
const view_changes = "\u67E5\u770B\u6539\u52A8";
|
|
16148
|
-
const back_to_edit = "\u7F16\u8F91";
|
|
16149
|
-
const configure_file = "\u914D\u7F6E\u5185\u5BB9";
|
|
16150
|
-
const yaml_format_wrong = "\u914D\u7F6E\u5185\u5BB9\u4E0D\u662F\u6709\u6548\u7684 yaml \u683C\u5F0F\u3002";
|
|
16151
|
-
const yaml_value_wrong = "\u914D\u7F6E\u5185\u5BB9\u4E2D\u5B58\u5728\u4E0D\u5408\u6CD5\u7684\u503C\u3002";
|
|
16152
|
-
const edit_yaml = "\u7F16\u8F91 YAML";
|
|
16153
|
-
const copied = "\u5DF2\u590D\u5236";
|
|
16154
|
-
const already_reset = "\u5DF2\u91CD\u7F6E";
|
|
16155
|
-
const cancel = "\u53D6\u6D88";
|
|
16156
|
-
const create = "\u521B\u5EFA";
|
|
16157
|
-
const confirm_delete_text = "\u786E\u5B9A\u8981\u5220\u9664 {{target}} \u5417\uFF1F";
|
|
16158
|
-
const edit = "\u7F16\u8F91";
|
|
16159
|
-
const namespace = "\u540D\u5B57\u7A7A\u95F4";
|
|
16160
|
-
const name = "\u540D\u5B57";
|
|
16161
|
-
const state = "\u72B6\u6001";
|
|
16162
|
-
const status = "\u72B6\u6001";
|
|
16163
|
-
const phase = "\u72B6\u6001";
|
|
16164
|
-
const image = "\u955C\u50CF";
|
|
16165
|
-
const replicas = "\u526F\u672C\u6570";
|
|
16166
|
-
const created_time = "\u521B\u5EFA\u65F6\u95F4";
|
|
16167
|
-
const label = "\u6807\u7B7E";
|
|
16168
|
-
const annotation = "\u6CE8\u91CA";
|
|
16169
|
-
const type = "\u7C7B\u578B";
|
|
16170
|
-
const event = "\u4E8B\u4EF6";
|
|
16171
|
-
const reason = "\u539F\u56E0";
|
|
16172
|
-
const object = "\u5BF9\u8C61";
|
|
16173
|
-
const note = "\u4E8B\u4EF6\u4FE1\u606F";
|
|
16174
|
-
const condition = "Condition";
|
|
16175
|
-
const download_yaml = "\u4E0B\u8F7D YAML";
|
|
16176
|
-
const detail = "\u8BE6\u60C5";
|
|
16177
|
-
const node_name = "\u4E3B\u673A\u540D\u79F0";
|
|
16178
|
-
const restarts = "\u91CD\u542F\u6B21\u6570";
|
|
16179
|
-
const updated_time = "\u66F4\u65B0\u65F6\u95F4";
|
|
16180
|
-
const message = "\u6D88\u606F";
|
|
16181
|
-
const save = "\u4FDD\u5B58";
|
|
16182
|
-
const more = "\u66F4\u591A";
|
|
16183
|
-
const workload = "\u5DE5\u4F5C\u8D1F\u8F7D";
|
|
16184
|
-
const all_namespaces = "\u6240\u6709\u540D\u5B57\u7A7A\u95F4";
|
|
16185
|
-
const empty = "\u65E0\u53EF\u663E\u793A\u7684\u6570\u636E";
|
|
16186
|
-
const schedule = "\u8C03\u5EA6";
|
|
16187
|
-
const lastScheduleTime = "\u4E0A\u6B21\u8C03\u5EA6";
|
|
16188
|
-
const duration = "\u6301\u7EED\u65F6\u95F4";
|
|
16189
|
-
const completions = "\u5B8C\u6210 Job \u5386\u53F2\u6570";
|
|
16190
|
-
const started = "\u5F00\u59CB\u65F6\u95F4";
|
|
16191
|
-
const ready = "\u5C31\u7EEA";
|
|
16192
|
-
const init_container = "\u521D\u59CB\u5316\u5BB9\u5668";
|
|
16193
|
-
const container = "\u5BB9\u5668";
|
|
16194
|
-
const redeploy = "\u91CD\u65B0\u90E8\u7F72";
|
|
16195
|
-
const data = "\u6570\u636E";
|
|
16196
|
-
const suspend = "\u6682\u505C";
|
|
16197
|
-
const resume = "\u91CD\u65B0\u5F00\u59CB";
|
|
16198
|
-
const cluster = "\u96C6\u7FA4";
|
|
16199
|
-
const storage = "\u5B58\u50A8";
|
|
16200
|
-
const network = "\u7F51\u7EDC";
|
|
16201
|
-
const clusterIp = "\u96C6\u7FA4 IP";
|
|
16202
|
-
const sessionAffinity = "\u4F1A\u8BDD\u4FDD\u6301";
|
|
16203
|
-
const log = "\u65E5\u5FD7";
|
|
16204
|
-
const select_container = "\u9009\u62E9\u5BB9\u5668";
|
|
16205
|
-
const wrap = "\u6298\u53E0";
|
|
16206
|
-
const resume_log = "\u7EE7\u7EED";
|
|
16207
|
-
const log_new_lines = "\uFF0C\u5E76\u5C55\u793A {{ count }} \u884C\u65B0\u65E5\u5FD7";
|
|
16208
|
-
const dovetail = {
|
|
16209
|
-
copy,
|
|
16210
|
-
reset_arguments,
|
|
16211
|
-
view_changes,
|
|
16212
|
-
back_to_edit,
|
|
16213
|
-
configure_file,
|
|
16214
|
-
yaml_format_wrong,
|
|
16215
|
-
yaml_value_wrong,
|
|
16216
|
-
edit_yaml,
|
|
16217
|
-
copied,
|
|
16218
|
-
already_reset,
|
|
16219
|
-
cancel,
|
|
16220
|
-
"delete": "\u5220\u9664",
|
|
16221
|
-
create,
|
|
16222
|
-
confirm_delete_text,
|
|
16223
|
-
edit,
|
|
16224
|
-
namespace,
|
|
16225
|
-
name,
|
|
16226
|
-
state,
|
|
16227
|
-
status,
|
|
16228
|
-
phase,
|
|
16229
|
-
image,
|
|
16230
|
-
replicas,
|
|
16231
|
-
created_time,
|
|
16232
|
-
label,
|
|
16233
|
-
annotation,
|
|
16234
|
-
type,
|
|
16235
|
-
event,
|
|
16236
|
-
reason,
|
|
16237
|
-
object,
|
|
16238
|
-
note,
|
|
16239
|
-
condition,
|
|
16240
|
-
download_yaml,
|
|
16241
|
-
detail,
|
|
16242
|
-
node_name,
|
|
16243
|
-
restarts,
|
|
16244
|
-
updated_time,
|
|
16245
|
-
message,
|
|
16246
|
-
save,
|
|
16247
|
-
more,
|
|
16248
|
-
workload,
|
|
16249
|
-
all_namespaces,
|
|
16250
|
-
empty,
|
|
16251
|
-
schedule,
|
|
16252
|
-
lastScheduleTime,
|
|
16253
|
-
duration,
|
|
16254
|
-
completions,
|
|
16255
|
-
started,
|
|
16256
|
-
ready,
|
|
16257
|
-
init_container,
|
|
16258
|
-
container,
|
|
16259
|
-
redeploy,
|
|
16260
|
-
data,
|
|
16261
|
-
suspend,
|
|
16262
|
-
resume,
|
|
16263
|
-
cluster,
|
|
16264
|
-
storage,
|
|
16265
|
-
network,
|
|
16266
|
-
clusterIp,
|
|
16267
|
-
sessionAffinity,
|
|
16268
|
-
log,
|
|
16269
|
-
select_container,
|
|
16270
|
-
wrap,
|
|
16271
|
-
resume_log,
|
|
16272
|
-
log_new_lines
|
|
16273
|
-
};
|
|
16274
|
-
const ZH = {
|
|
16275
|
-
dovetail
|
|
16276
|
-
};
|
|
16277
|
-
const resources = {
|
|
16278
|
-
"en-US": EN,
|
|
16279
|
-
"zh-CN": ZH
|
|
16280
|
-
};
|
|
16281
|
-
i18n.use(initReactI18next).init({
|
|
16282
|
-
supportedLngs: ["en-US", "zh-CN"],
|
|
16283
|
-
resources,
|
|
16284
|
-
ns: Object.keys(resources["zh-CN"]),
|
|
16285
|
-
defaultNS: "dovetail",
|
|
16286
|
-
fallbackLng: ["en-US", "zh-CN"],
|
|
16287
|
-
lng: "zh-CN",
|
|
16288
|
-
nsSeparator: "."
|
|
16289
|
-
});
|
|
16290
16134
|
const styles = "";
|
|
16291
16135
|
const antd = "";
|
|
16292
16136
|
const style = "";
|
|
@@ -16294,13 +16138,12 @@ const Dovetail = (props) => {
|
|
|
16294
16138
|
const {
|
|
16295
16139
|
resourcesConfig,
|
|
16296
16140
|
urlPrefix = "",
|
|
16297
|
-
useHashUrl,
|
|
16298
16141
|
Layout: Layout2,
|
|
16299
16142
|
history,
|
|
16300
16143
|
globalStoreParams
|
|
16301
16144
|
} = props;
|
|
16302
16145
|
const globalStore = useMemo(() => {
|
|
16303
|
-
return new GlobalStore(globalStoreParams);
|
|
16146
|
+
return new GlobalStore(globalStoreParams, ProviderPlugins);
|
|
16304
16147
|
}, [globalStoreParams]);
|
|
16305
16148
|
const notCustomResources = useMemo(() => {
|
|
16306
16149
|
return resourcesConfig.filter((c) => !c.isCustom);
|
|
@@ -16354,94 +16197,91 @@ var RESOURCE_GROUP = /* @__PURE__ */ ((RESOURCE_GROUP2) => {
|
|
|
16354
16197
|
return RESOURCE_GROUP2;
|
|
16355
16198
|
})(RESOURCE_GROUP || {});
|
|
16356
16199
|
export {
|
|
16357
|
-
|
|
16200
|
+
PodsField as $,
|
|
16358
16201
|
AgeColumnRenderer as A,
|
|
16359
16202
|
Breadcrumb as B,
|
|
16360
16203
|
CommonSorter as C,
|
|
16361
16204
|
DurationColumnRenderer as D,
|
|
16362
|
-
|
|
16363
|
-
|
|
16364
|
-
|
|
16365
|
-
|
|
16205
|
+
ResourceForm as E,
|
|
16206
|
+
ResourceCRUD as F,
|
|
16207
|
+
WorkloadPodsTable as G,
|
|
16208
|
+
CronJobDropdown as H,
|
|
16366
16209
|
ImageNames as I,
|
|
16367
|
-
|
|
16210
|
+
ResourceUsageBar as J,
|
|
16368
16211
|
KeyValueListWidget as K,
|
|
16369
|
-
|
|
16212
|
+
WorkloadReplicas as L,
|
|
16370
16213
|
MetadataForm as M,
|
|
16371
16214
|
NameColumnRenderer as N,
|
|
16372
|
-
|
|
16215
|
+
CronjobJobsTable as O,
|
|
16373
16216
|
PhaseColumnRenderer as P,
|
|
16374
|
-
|
|
16217
|
+
KeyValue as Q,
|
|
16375
16218
|
ReplicasColumnRenderer as R,
|
|
16376
16219
|
ServiceTypeColumnRenderer as S,
|
|
16377
|
-
|
|
16378
|
-
|
|
16379
|
-
|
|
16220
|
+
Separator as T,
|
|
16221
|
+
DeleteButton as U,
|
|
16222
|
+
Layout as V,
|
|
16380
16223
|
WorkloadImageColumnRenderer as W,
|
|
16381
|
-
|
|
16224
|
+
ImageField as X,
|
|
16382
16225
|
YamlEditorComponent as Y,
|
|
16383
|
-
|
|
16384
|
-
|
|
16226
|
+
ReplicaField as Z,
|
|
16227
|
+
ConditionsField as _,
|
|
16385
16228
|
useDeleteModal as a,
|
|
16386
|
-
|
|
16387
|
-
|
|
16388
|
-
|
|
16389
|
-
|
|
16390
|
-
|
|
16391
|
-
|
|
16392
|
-
|
|
16393
|
-
|
|
16394
|
-
|
|
16395
|
-
|
|
16396
|
-
|
|
16397
|
-
|
|
16398
|
-
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
|
|
16404
|
-
|
|
16405
|
-
|
|
16406
|
-
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
|
|
16410
|
-
|
|
16411
|
-
|
|
16412
|
-
|
|
16413
|
-
|
|
16414
|
-
|
|
16415
|
-
|
|
16416
|
-
|
|
16417
|
-
|
|
16418
|
-
|
|
16419
|
-
CronJobModel as ax,
|
|
16420
|
-
Dovetail as ay,
|
|
16421
|
-
RESOURCE_GROUP as az,
|
|
16229
|
+
JobsField as a0,
|
|
16230
|
+
DataField as a1,
|
|
16231
|
+
SecretDataField as a2,
|
|
16232
|
+
StartTimeField as a3,
|
|
16233
|
+
ServiceTypeField as a4,
|
|
16234
|
+
ClusterIpField as a5,
|
|
16235
|
+
SessionAffinityField as a6,
|
|
16236
|
+
ServicePodsField as a7,
|
|
16237
|
+
ShowContent as a8,
|
|
16238
|
+
SchemaStrategy as a9,
|
|
16239
|
+
DeleteManyButton as aa,
|
|
16240
|
+
ListPage as ab,
|
|
16241
|
+
StateTag as ac,
|
|
16242
|
+
DrawerShow as ad,
|
|
16243
|
+
Menu as ae,
|
|
16244
|
+
EditButton as af,
|
|
16245
|
+
NS_STORE_KEY as ag,
|
|
16246
|
+
ALL_NS as ah,
|
|
16247
|
+
useNamespacesFilter as ai,
|
|
16248
|
+
NamespacesFilter as aj,
|
|
16249
|
+
Tags as ak,
|
|
16250
|
+
PodLog as al,
|
|
16251
|
+
BASE_INIT_VALUE as am,
|
|
16252
|
+
DEPLOYMENT_INIT_VALUE as an,
|
|
16253
|
+
CRONJOB_INIT_VALUE as ao,
|
|
16254
|
+
DAEMONSET_INIT_VALUE as ap,
|
|
16255
|
+
JOB_INIT_VALUE as aq,
|
|
16256
|
+
STATEFULSET_INIT_VALUE as ar,
|
|
16257
|
+
POD_INIT_VALUE as as,
|
|
16258
|
+
SERVICE_INIT_VALUE as at,
|
|
16259
|
+
TIMESTAMP_LABEL as au,
|
|
16260
|
+
Dovetail as av,
|
|
16261
|
+
RESOURCE_GROUP as aw,
|
|
16422
16262
|
NameSpaceColumnRenderer as b,
|
|
16423
|
-
|
|
16424
|
-
|
|
16425
|
-
|
|
16426
|
-
|
|
16427
|
-
|
|
16428
|
-
|
|
16429
|
-
|
|
16263
|
+
WorkloadRestartsColumnRenderer as c,
|
|
16264
|
+
NodeNameColumnRenderer as d,
|
|
16265
|
+
RestartCountColumnRenderer as e,
|
|
16266
|
+
CompletionsCountColumnRenderer as f,
|
|
16267
|
+
ColumnKeys as g,
|
|
16268
|
+
useEagleTable as h,
|
|
16269
|
+
useDownloadYAML as i,
|
|
16430
16270
|
jsxRuntime as j,
|
|
16431
|
-
|
|
16432
|
-
|
|
16433
|
-
|
|
16434
|
-
|
|
16435
|
-
|
|
16436
|
-
|
|
16437
|
-
|
|
16271
|
+
useEdit as k,
|
|
16272
|
+
NameInputWidget as l,
|
|
16273
|
+
dnsSubDomainRules as m,
|
|
16274
|
+
rfc1123LabelRules as n,
|
|
16275
|
+
rfc1035LabelRules as o,
|
|
16276
|
+
NamespaceSelectWidget as p,
|
|
16277
|
+
namespaceRules as q,
|
|
16438
16278
|
routerProvider as r,
|
|
16439
|
-
|
|
16440
|
-
|
|
16279
|
+
PageShow as s,
|
|
16280
|
+
ConditionsTable as t,
|
|
16441
16281
|
useSchema as u,
|
|
16442
|
-
|
|
16443
|
-
|
|
16444
|
-
|
|
16445
|
-
|
|
16446
|
-
|
|
16282
|
+
PodContainersTable as v,
|
|
16283
|
+
WorkloadDropdown as w,
|
|
16284
|
+
CreateButton as x,
|
|
16285
|
+
ResourceList as y,
|
|
16286
|
+
ResourceShow as z
|
|
16447
16287
|
};
|