@dovetail-v2/refine 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MonacoYamlDiffEditor-09dd38a4.js → MonacoYamlDiffEditor-7505595f.js} +12 -6
- package/dist/{index-9ad8e030.js → index-d02782c8.js} +1380 -732
- package/dist/refine.js +2 -2
- package/dist/refine.umd.cjs +1439 -780
- package/dist/style.css +54 -54
- package/lib/src/App.js +91 -0
- package/lib/src/Dovetail.js +45 -0
- package/lib/src/components/Breadcrumb/index.js +20 -0
- package/lib/src/components/ConditionsTable/ConditionsTable.js +56 -0
- package/lib/src/components/ConditionsTable/index.js +1 -0
- package/lib/src/components/CreateButton/index.js +10 -0
- package/lib/src/components/CronJobDropdown/index.js +26 -0
- package/lib/src/components/CronjobJobsTable/index.js +49 -0
- package/lib/src/components/DeleteButton/index.js +13 -0
- package/lib/src/components/DeleteManyButton/index.js +16 -0
- package/lib/src/components/DrawerShow/DrawerShow.js +13 -0
- package/lib/src/components/DrawerShow/index.js +1 -0
- package/lib/src/components/EditButton/index.js +13 -0
- package/lib/src/components/EditField/index.js +47 -0
- package/lib/src/components/ErrorContent/index.js +36 -0
- package/lib/src/components/EventsTable/EventsTable.js +59 -0
- package/lib/src/components/EventsTable/index.js +1 -0
- package/lib/src/components/Form/KeyValueListWidget.js +56 -0
- package/lib/src/components/Form/MetadataForm.js +9 -0
- package/lib/src/components/Form/NameInputWidget.js +50 -0
- package/lib/src/components/Form/NamespaceSelectWidget.js +21 -0
- package/lib/src/components/Form/index.js +4 -0
- package/lib/src/components/Form/widget.js +1 -0
- package/lib/src/components/FormErrorAlert/index.js +8 -0
- package/lib/src/components/FormLayout/index.js +21 -0
- package/lib/src/components/FormModal/index.js +51 -0
- package/lib/src/components/ImageNames/index.js +14 -0
- package/lib/src/components/IngressRulesComponent/index.js +11 -0
- package/lib/src/components/IngressRulesTable/IngressRulesTable.js +51 -0
- package/lib/src/components/IngressRulesTable/index.js +1 -0
- package/lib/src/components/K8sDropdown/index.js +31 -0
- package/lib/src/components/KeyValue/KeyValue.js +27 -0
- package/lib/src/components/KeyValue/index.js +1 -0
- package/lib/src/components/KeyValueData/index.js +50 -0
- package/lib/src/components/Layout/index.js +39 -0
- package/lib/src/components/ListPage/index.js +25 -0
- package/lib/src/components/Menu/index.js +36 -0
- package/lib/src/components/NamespacesFilter/index.js +34 -0
- package/lib/src/components/NetworkPolicyRulesTable/NetworkPolicyRulesTable.js +77 -0
- package/lib/src/components/NetworkPolicyRulesTable/index.js +1 -0
- package/lib/src/components/PageShow/PageShow.js +11 -0
- package/lib/src/components/PageShow/index.js +1 -0
- package/lib/src/components/PodContainersTable/PodContainersTable.js +78 -0
- package/lib/src/components/PodContainersTable/index.js +1 -0
- package/lib/src/components/PodLog/index.js +136 -0
- package/lib/src/components/ReferenceLink/index.js +17 -0
- package/lib/src/components/ResourceCRUD/ResourceCRUD.js +15 -0
- package/lib/src/components/ResourceCRUD/create/index.js +13 -0
- package/lib/src/components/ResourceCRUD/index.js +4 -0
- package/lib/src/components/ResourceCRUD/list/index.js +19 -0
- package/lib/src/components/ResourceCRUD/show/index.js +6 -0
- package/lib/src/components/ResourceLink/index.js +21 -0
- package/lib/src/components/ResourceUsageBar/index.js +81 -0
- package/lib/src/components/Separator/index.js +11 -0
- package/lib/src/components/ShowContent/ShowContent.js +157 -0
- package/lib/src/components/ShowContent/fields.js +157 -0
- package/lib/src/components/ShowContent/index.js +2 -0
- package/lib/src/components/StateTag/StateTag.js +22 -0
- package/lib/src/components/StateTag/index.js +1 -0
- package/lib/src/components/Table/ErrorContent.js +36 -0
- package/lib/src/components/Table/TableToolBar.js +14 -0
- package/lib/src/components/Table/TableWidgets.js +28 -0
- package/lib/src/components/Table/index.js +69 -0
- package/lib/src/components/Tags/index.js +22 -0
- package/lib/src/components/Time/index.js +14 -0
- package/lib/src/components/WorkloadDropdown/index.js +24 -0
- package/lib/src/components/WorkloadPodsTable/WorkloadPodsTable.js +39 -0
- package/lib/src/components/WorkloadPodsTable/index.js +1 -0
- package/lib/src/components/WorkloadReplicas/index.js +50 -0
- package/lib/src/components/YamlEditor/MonacoYamlDiffEditor.js +34 -0
- package/lib/src/components/YamlEditor/MonacoYamlEditor.js +149 -0
- package/lib/src/components/YamlEditor/YamlEditorComponent.js +90 -0
- package/lib/src/components/YamlEditor/index.js +1 -0
- package/lib/src/components/YamlEditor/style.js +102 -0
- package/lib/src/components/YamlEditor/yaml.worker.js +1 -0
- package/lib/src/components/YamlForm/index.js +61 -0
- package/lib/src/components/index.js +38 -0
- package/lib/src/constants/index.js +2 -0
- package/lib/src/constants/k8s.js +203 -0
- package/lib/src/constants/state.js +15 -0
- package/lib/src/contexts/component.js +3 -0
- package/lib/src/contexts/configs.js +3 -0
- package/lib/src/contexts/global-store.js +3 -0
- package/lib/src/contexts/index.js +3 -0
- package/lib/src/hooks/index.js +7 -0
- package/lib/src/hooks/useDeleteModal/index.js +1 -0
- package/lib/src/hooks/useDeleteModal/useDeleteManyModal.js +31 -0
- package/lib/src/hooks/useDeleteModal/useDeleteModal.js +38 -0
- package/lib/src/hooks/useDownloadYAML.js +10 -0
- package/lib/src/hooks/useEagleForm.js +177 -0
- package/lib/src/hooks/useEagleTable/columns.js +246 -0
- package/lib/src/hooks/useEagleTable/index.js +2 -0
- package/lib/src/hooks/useEagleTable/useEagleTable.js +63 -0
- package/lib/src/hooks/useEdit.js +19 -0
- package/lib/src/hooks/useGlobalStore.js +5 -0
- package/lib/src/hooks/useK8sYamlEditor.js +37 -0
- package/lib/src/hooks/useOpenForm.js +43 -0
- package/lib/src/hooks/useSchema.js +37 -0
- package/lib/src/hooks/useSubmitForm.js +42 -0
- package/lib/src/i18n.js +18 -0
- package/lib/src/index.js +12 -0
- package/lib/src/locales/en-US/dovetail.json +18 -0
- package/lib/src/locales/en-US/index.js +4 -0
- package/lib/src/locales/index.js +2 -0
- package/lib/src/locales/zh-CN/dovetail.json +91 -0
- package/lib/src/locales/zh-CN/index.js +4 -0
- package/lib/src/main.js +12 -0
- package/lib/src/models/cronjob-model.js +32 -0
- package/lib/src/models/daemonset-model.js +17 -0
- package/lib/src/models/deployment-model.js +17 -0
- package/lib/src/models/event-model.js +11 -0
- package/lib/src/models/index.js +14 -0
- package/lib/src/models/ingress-model.js +24 -0
- package/lib/src/models/job-model.js +56 -0
- package/lib/src/models/network-policy-model.js +10 -0
- package/lib/src/models/pod-metrics-model.js +34 -0
- package/lib/src/models/pod-model.js +78 -0
- package/lib/src/models/resource-model.js +34 -0
- package/lib/src/models/service-model.js +17 -0
- package/lib/src/models/statefulset-model.js +17 -0
- package/lib/src/models/types/index.js +1 -0
- package/lib/src/models/types/metric.js +1 -0
- package/lib/src/models/workload-base-model.js +22 -0
- package/lib/src/models/workload-model.js +51 -0
- package/lib/src/pages/configmaps/index.js +15 -0
- package/lib/src/pages/cronjobs/create/index.js +6 -0
- package/lib/src/pages/cronjobs/index.js +3 -0
- package/lib/src/pages/cronjobs/list/index.js +42 -0
- package/lib/src/pages/cronjobs/show/index.js +16 -0
- package/lib/src/pages/daemonsets/create/index.js +6 -0
- package/lib/src/pages/daemonsets/index.js +3 -0
- package/lib/src/pages/daemonsets/list/index.js +32 -0
- package/lib/src/pages/daemonsets/show/index.js +16 -0
- package/lib/src/pages/deployments/create/index.js +7 -0
- package/lib/src/pages/deployments/index.js +3 -0
- package/lib/src/pages/deployments/list/index.js +26 -0
- package/lib/src/pages/deployments/show/index.js +16 -0
- package/lib/src/pages/ingresses/index.js +26 -0
- package/lib/src/pages/jobs/index.js +34 -0
- package/lib/src/pages/networkPolicies/index.js +67 -0
- package/lib/src/pages/pods/create/index.js +6 -0
- package/lib/src/pages/pods/index.js +3 -0
- package/lib/src/pages/pods/list/index.js +81 -0
- package/lib/src/pages/pods/show/index.js +54 -0
- package/lib/src/pages/secrets/index.js +15 -0
- package/lib/src/pages/services/index.js +26 -0
- package/lib/src/pages/statefulsets/create/index.js +6 -0
- package/lib/src/pages/statefulsets/index.js +3 -0
- package/lib/src/pages/statefulsets/list/index.js +26 -0
- package/lib/src/pages/statefulsets/show/index.js +16 -0
- package/lib/src/plugins/index.js +3 -0
- package/lib/src/plugins/model-plugin.js +46 -0
- package/lib/src/plugins/relation-plugin.js +81 -0
- package/lib/src/plugins/type.js +1 -0
- package/lib/src/providers/index.js +1 -0
- package/lib/src/providers/router-provider/index.js +100 -0
- package/lib/src/types/index.js +1 -0
- package/lib/src/types/resource.js +12 -0
- package/lib/src/utils/addId.js +8 -0
- package/lib/src/utils/download.js +9 -0
- package/lib/src/utils/error.js +53 -0
- package/lib/src/utils/form.js +9 -0
- package/lib/src/utils/k8s.js +6 -0
- package/lib/src/utils/labels.js +15 -0
- package/lib/src/utils/match-selector.js +12 -0
- package/lib/src/utils/openapi.js +33 -0
- package/lib/src/utils/schema.js +117 -0
- package/lib/src/utils/selector.js +12 -0
- package/lib/src/utils/string.js +6 -0
- package/lib/src/utils/time.js +46 -0
- package/lib/src/utils/unit.js +69 -0
- package/lib/src/utils/yaml.js +44 -0
- package/lib/vite.config.js +60 -0
- package/package.json +1 -1
- package/lib/src/model/cronjob-model.d.ts +0 -9
- package/lib/src/model/index.d.ts +0 -6
- package/lib/src/model/job-model.d.ts +0 -10
- package/lib/src/model/pod-metrics-model.d.ts +0 -7
- package/lib/src/model/pod-model.d.ts +0 -15
- package/lib/src/model/resource-model.d.ts +0 -17
- package/lib/src/model/workload-model.d.ts +0 -17
- package/lib/src/types/metric.d.ts +0 -25
|
@@ -15,10 +15,10 @@ import yaml from "js-yaml";
|
|
|
15
15
|
import { isObject, first, get, omit as omit$1, flatten, merge, keyBy } from "lodash-es";
|
|
16
16
|
import { useForm } from "sunflower-antd";
|
|
17
17
|
import { HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, Retry16GradientBlueIcon, EditPen16GradientGrayIcon, EditPen16GradientBlueIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, EditPen16PrimaryIcon, TrashBinDelete16Icon, Download16GradientBlueIcon, MoreEllipsis316BoldBlueIcon, CheckmarkDoneSuccessCorrect16BoldGreenIcon, XmarkFailed16BoldRedIcon, DynamicResourceSchedule16BlueIcon, VmResume16Icon, SuspendedPause16GradientGrayIcon, Resume24Icon, SuspendedPause24GradientOrangeIcon } from "@cloudtower/icons-react";
|
|
18
|
-
import { Drawer } from "antd";
|
|
19
18
|
import * as monaco from "monaco-editor";
|
|
20
19
|
import { setDiagnosticsOptions } from "monaco-yaml";
|
|
21
20
|
import ReactDOM from "react-dom";
|
|
21
|
+
import { Drawer } from "antd";
|
|
22
22
|
import { dataProvider, liveProvider } from "k8s-api-provider";
|
|
23
23
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
24
24
|
function getDefaultExportFromCjs(x) {
|
|
@@ -1222,24 +1222,30 @@ const routerProvider = {
|
|
|
1222
1222
|
go: () => {
|
|
1223
1223
|
const { search: existingSearch, hash: existingHash } = useLocation();
|
|
1224
1224
|
const history = useHistory();
|
|
1225
|
-
const fn = useCallback(
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1225
|
+
const fn = useCallback(
|
|
1226
|
+
({ to, type: type2, query, hash, options: { keepQuery, keepHash } = {} }) => {
|
|
1227
|
+
const urlQuery = {
|
|
1228
|
+
...keepQuery && existingSearch && parse(existingSearch, { ignoreQueryPrefix: true }),
|
|
1229
|
+
...query
|
|
1230
|
+
};
|
|
1231
|
+
if (urlQuery.to) {
|
|
1232
|
+
urlQuery.to = encodeURIComponent(`${urlQuery.to}`);
|
|
1233
|
+
}
|
|
1234
|
+
const hasUrlQuery = Object.keys(urlQuery).length > 0;
|
|
1235
|
+
const urlHash = `#${(hash || keepHash && existingHash || "").replace(
|
|
1236
|
+
/^#/,
|
|
1237
|
+
""
|
|
1238
|
+
)}`;
|
|
1239
|
+
const hasUrlHash = urlHash.length > 1;
|
|
1240
|
+
const urlTo = to || "";
|
|
1241
|
+
const fullPath = `${urlTo}${hasUrlQuery ? stringify(urlQuery, stringifyConfig) : ""}${hasUrlHash ? urlHash : ""}`;
|
|
1242
|
+
if (type2 === "path") {
|
|
1243
|
+
return fullPath;
|
|
1244
|
+
}
|
|
1245
|
+
return history[type2 || "push"](fullPath);
|
|
1246
|
+
},
|
|
1247
|
+
[existingHash, existingSearch, history]
|
|
1248
|
+
);
|
|
1243
1249
|
return fn;
|
|
1244
1250
|
},
|
|
1245
1251
|
back: () => {
|
|
@@ -1284,13 +1290,20 @@ const routerProvider = {
|
|
|
1284
1290
|
return fn;
|
|
1285
1291
|
},
|
|
1286
1292
|
Link: React__default.forwardRef(function RefineLink(props, ref) {
|
|
1287
|
-
return jsxRuntimeExports.jsx(Link, { ...props, ref });
|
|
1293
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { ...props, ref });
|
|
1288
1294
|
})
|
|
1289
1295
|
};
|
|
1290
1296
|
function useK8sYamlEditor() {
|
|
1291
1297
|
const foldSymbol = useCallback(function(editor, symbol) {
|
|
1292
1298
|
const model = editor.getModel();
|
|
1293
|
-
const matchs = (model == null ? void 0 : model.findMatches(
|
|
1299
|
+
const matchs = (model == null ? void 0 : model.findMatches(
|
|
1300
|
+
symbol,
|
|
1301
|
+
false,
|
|
1302
|
+
false,
|
|
1303
|
+
false,
|
|
1304
|
+
"",
|
|
1305
|
+
false
|
|
1306
|
+
).filter((match) => match.range.startColumn === 1)) || [];
|
|
1294
1307
|
return new Promise(async (resolve, reject) => {
|
|
1295
1308
|
try {
|
|
1296
1309
|
for (const match of matchs) {
|
|
@@ -6826,14 +6839,19 @@ function generateValueFromSchema(schema, options) {
|
|
|
6826
6839
|
if (!schema.minItems || !schema.items || typeof schema.items === "boolean" || Array.isArray(schema.items)) {
|
|
6827
6840
|
return (generateValue == null ? void 0 : generateValue(schema)) || [];
|
|
6828
6841
|
}
|
|
6829
|
-
return new Array(schema.minItems).fill(
|
|
6842
|
+
return new Array(schema.minItems).fill(
|
|
6843
|
+
generateValueFromSchema(schema.items, options)
|
|
6844
|
+
);
|
|
6830
6845
|
case schema.type === "number":
|
|
6831
6846
|
case schema.type === "integer":
|
|
6832
6847
|
return (generateValue == null ? void 0 : generateValue(schema)) || 0;
|
|
6833
6848
|
case schema.type === "object": {
|
|
6834
6849
|
const obj = {};
|
|
6835
6850
|
for (const key in schema.properties) {
|
|
6836
|
-
obj[key] = generateValueFromSchema(
|
|
6851
|
+
obj[key] = generateValueFromSchema(
|
|
6852
|
+
schema.properties[key],
|
|
6853
|
+
options
|
|
6854
|
+
);
|
|
6837
6855
|
}
|
|
6838
6856
|
return obj;
|
|
6839
6857
|
}
|
|
@@ -6916,22 +6934,27 @@ function resolveRef(schema, schemas, options) {
|
|
|
6916
6934
|
}
|
|
6917
6935
|
class K8sOpenAPI {
|
|
6918
6936
|
constructor(resourceBasePath) {
|
|
6919
|
-
__publicField(this, "resourceBasePath");
|
|
6920
6937
|
__publicField(this, "response", null);
|
|
6921
6938
|
__publicField(this, "apiVersion");
|
|
6922
6939
|
this.resourceBasePath = resourceBasePath;
|
|
6923
6940
|
this.apiVersion = getApiVersion(resourceBasePath);
|
|
6924
6941
|
}
|
|
6925
6942
|
async fetch() {
|
|
6926
|
-
const response = await fetch(
|
|
6943
|
+
const response = await fetch(
|
|
6944
|
+
`/api/sks/api/v1/clusters/sks-mgmt/proxy/openapi/v3${this.resourceBasePath}`
|
|
6945
|
+
);
|
|
6927
6946
|
return response.json();
|
|
6928
6947
|
}
|
|
6929
6948
|
async findSchema(kind) {
|
|
6930
6949
|
const result = this.response || await this.fetch();
|
|
6931
|
-
const schema = Object.values(result.components.schemas).find(
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6950
|
+
const schema = Object.values(result.components.schemas).find(
|
|
6951
|
+
(schema2) => {
|
|
6952
|
+
var _a;
|
|
6953
|
+
return (_a = schema2["x-kubernetes-group-version-kind"]) == null ? void 0 : _a.some(
|
|
6954
|
+
({ kind: schemaKind, version: schemaVersion, group: schemaGroup }) => kind === schemaKind && this.apiVersion === `${schemaGroup ? schemaGroup + "/" : ""}${schemaVersion}`
|
|
6955
|
+
);
|
|
6956
|
+
}
|
|
6957
|
+
);
|
|
6935
6958
|
if (schema) {
|
|
6936
6959
|
resolveRef(schema, result.components.schemas, {
|
|
6937
6960
|
prune: {
|
|
@@ -6953,10 +6976,13 @@ function useSchema(options) {
|
|
|
6953
6976
|
const [error, setError] = useState(null);
|
|
6954
6977
|
const useResourceResult = useResource();
|
|
6955
6978
|
const resource = (options == null ? void 0 : options.resource) || useResourceResult.resource;
|
|
6956
|
-
const openapi = useMemo(
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6979
|
+
const openapi = useMemo(
|
|
6980
|
+
() => {
|
|
6981
|
+
var _a2;
|
|
6982
|
+
return new K8sOpenAPI((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.resourceBasePath);
|
|
6983
|
+
},
|
|
6984
|
+
[(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.resourceBasePath]
|
|
6985
|
+
);
|
|
6960
6986
|
const fetchSchema = useCallback(async () => {
|
|
6961
6987
|
var _a2;
|
|
6962
6988
|
setLoading(true);
|
|
@@ -7007,7 +7033,10 @@ function generateYamlBySchema(defaultValue, schema) {
|
|
|
7007
7033
|
for (const key in obj2) {
|
|
7008
7034
|
if (key in obj1) {
|
|
7009
7035
|
if (isObject(obj2[key]) && isObject(obj1[key])) {
|
|
7010
|
-
merged2[key] = merge2(
|
|
7036
|
+
merged2[key] = merge2(
|
|
7037
|
+
obj1[key],
|
|
7038
|
+
obj2[key]
|
|
7039
|
+
);
|
|
7011
7040
|
}
|
|
7012
7041
|
} else {
|
|
7013
7042
|
merged2 = {
|
|
@@ -7026,7 +7055,35 @@ const GlobalStoreContext = createContext({});
|
|
|
7026
7055
|
const useGlobalStore = () => {
|
|
7027
7056
|
return useContext(GlobalStoreContext);
|
|
7028
7057
|
};
|
|
7029
|
-
const useEagleForm = ({
|
|
7058
|
+
const useEagleForm = ({
|
|
7059
|
+
action,
|
|
7060
|
+
resource,
|
|
7061
|
+
onMutationSuccess: onMutationSuccessProp,
|
|
7062
|
+
onMutationError,
|
|
7063
|
+
submitOnEnter = false,
|
|
7064
|
+
warnWhenUnsavedChanges: warnWhenUnsavedChangesProp,
|
|
7065
|
+
redirect,
|
|
7066
|
+
successNotification,
|
|
7067
|
+
errorNotification,
|
|
7068
|
+
meta,
|
|
7069
|
+
metaData,
|
|
7070
|
+
queryMeta,
|
|
7071
|
+
mutationMeta,
|
|
7072
|
+
liveMode,
|
|
7073
|
+
liveParams,
|
|
7074
|
+
mutationMode,
|
|
7075
|
+
dataProviderName,
|
|
7076
|
+
onLiveEvent,
|
|
7077
|
+
invalidates,
|
|
7078
|
+
undoableTimeout,
|
|
7079
|
+
queryOptions,
|
|
7080
|
+
createMutationOptions,
|
|
7081
|
+
updateMutationOptions,
|
|
7082
|
+
id: idFromProps,
|
|
7083
|
+
overtimeOptions,
|
|
7084
|
+
editorOptions,
|
|
7085
|
+
initialValuesForCreate
|
|
7086
|
+
} = {}) => {
|
|
7030
7087
|
var _a, _b, _c;
|
|
7031
7088
|
const editor = useRef(null);
|
|
7032
7089
|
const isFoldRef = useRef(false);
|
|
@@ -7039,7 +7096,12 @@ const useEagleForm = ({ action, resource, onMutationSuccess: onMutationSuccessPr
|
|
|
7039
7096
|
const useResourceResult = useResource();
|
|
7040
7097
|
const { globalStore } = useGlobalStore();
|
|
7041
7098
|
const kit = useUIKit();
|
|
7042
|
-
const {
|
|
7099
|
+
const {
|
|
7100
|
+
schema,
|
|
7101
|
+
loading: isLoadingSchema,
|
|
7102
|
+
error: loadSchemaError,
|
|
7103
|
+
fetchSchema
|
|
7104
|
+
} = useSchema({
|
|
7043
7105
|
skip: editorOptions == null ? void 0 : editorOptions.isSkipSchema
|
|
7044
7106
|
});
|
|
7045
7107
|
const [formAnt] = kit.form.useForm();
|
|
@@ -7253,21 +7315,21 @@ var cx = function cx2() {
|
|
|
7253
7315
|
return result.join(" ");
|
|
7254
7316
|
};
|
|
7255
7317
|
var cx_default = cx;
|
|
7256
|
-
const
|
|
7257
|
-
const BreadcrumbStyle = "
|
|
7318
|
+
const index_hex8jv = "";
|
|
7319
|
+
const BreadcrumbStyle = "b142d7q8";
|
|
7258
7320
|
function Breadcrumb(props) {
|
|
7259
7321
|
const {
|
|
7260
7322
|
breadcrumbs
|
|
7261
7323
|
} = useBreadcrumb();
|
|
7262
|
-
return jsxRuntimeExports.jsx("ul", {
|
|
7324
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
|
|
7263
7325
|
className: cx_default(BreadcrumbStyle, props.className),
|
|
7264
7326
|
children: breadcrumbs.map((breadcrumb) => {
|
|
7265
|
-
return jsxRuntimeExports.jsx("li", {
|
|
7327
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
|
|
7266
7328
|
className: "breadcrumb-item",
|
|
7267
|
-
children: breadcrumb.href ? jsxRuntimeExports.jsx(Link, {
|
|
7329
|
+
children: breadcrumb.href ? /* @__PURE__ */ jsxRuntimeExports.jsx(Link, {
|
|
7268
7330
|
to: breadcrumb.href,
|
|
7269
7331
|
children: breadcrumb.label
|
|
7270
|
-
}) : jsxRuntimeExports.jsx("span", {
|
|
7332
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
7271
7333
|
children: breadcrumb.label
|
|
7272
7334
|
})
|
|
7273
7335
|
}, `breadcrumb-${breadcrumb.label}`);
|
|
@@ -7277,7 +7339,7 @@ function Breadcrumb(props) {
|
|
|
7277
7339
|
function NameInputWidget(props) {
|
|
7278
7340
|
const kit = useUIKit();
|
|
7279
7341
|
const { action } = useResource();
|
|
7280
|
-
return jsxRuntimeExports.jsx(kit.input, { ...props, disabled: action === "edit" });
|
|
7342
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.input, { ...props, disabled: action === "edit" });
|
|
7281
7343
|
}
|
|
7282
7344
|
const dnsSubDomainRules = [
|
|
7283
7345
|
{
|
|
@@ -7331,7 +7393,7 @@ function NamespaceSelectWidget(props) {
|
|
|
7331
7393
|
kind: "Namespace"
|
|
7332
7394
|
}
|
|
7333
7395
|
});
|
|
7334
|
-
return jsxRuntimeExports.jsx(kit.select, { input: props, disabled: action === "edit", children: data2 == null ? void 0 : data2.data.map((namespace2) => jsxRuntimeExports.jsx(kit.option, { value: namespace2.metadata.name, children: namespace2.metadata.name }, namespace2.metadata.name)) });
|
|
7396
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.select, { input: props, disabled: action === "edit", children: data2 == null ? void 0 : data2.data.map((namespace2) => /* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, { value: namespace2.metadata.name, children: namespace2.metadata.name }, namespace2.metadata.name)) });
|
|
7335
7397
|
}
|
|
7336
7398
|
const namespaceRules = [
|
|
7337
7399
|
{
|
|
@@ -7342,23 +7404,33 @@ const namespaceRules = [
|
|
|
7342
7404
|
function KeyValueInput(props) {
|
|
7343
7405
|
const { children, item } = props;
|
|
7344
7406
|
const kit = useUIKit();
|
|
7345
|
-
const onKeyChange = useCallback(
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7407
|
+
const onKeyChange = useCallback(
|
|
7408
|
+
(event2) => {
|
|
7409
|
+
var _a;
|
|
7410
|
+
const key = event2.target.value;
|
|
7411
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
7412
|
+
...item,
|
|
7413
|
+
key
|
|
7414
|
+
});
|
|
7415
|
+
},
|
|
7416
|
+
[item, props]
|
|
7417
|
+
);
|
|
7418
|
+
const onValueChange = useCallback(
|
|
7419
|
+
(event2) => {
|
|
7420
|
+
var _a;
|
|
7421
|
+
const value = event2.target.value;
|
|
7422
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
7423
|
+
...item,
|
|
7424
|
+
value
|
|
7425
|
+
});
|
|
7426
|
+
},
|
|
7427
|
+
[item, props]
|
|
7428
|
+
);
|
|
7429
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { children: [
|
|
7430
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.input, { value: item.key, onChange: onKeyChange }),
|
|
7431
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.textArea, { value: item.value, onChange: onValueChange }),
|
|
7432
|
+
children
|
|
7433
|
+
] });
|
|
7362
7434
|
}
|
|
7363
7435
|
function KeyValueListWidget(props) {
|
|
7364
7436
|
const kit = useUIKit();
|
|
@@ -7369,35 +7441,72 @@ function KeyValueListWidget(props) {
|
|
|
7369
7441
|
value: value2
|
|
7370
7442
|
}));
|
|
7371
7443
|
}, [value]);
|
|
7372
|
-
const onChange = useCallback(
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
result
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7444
|
+
const onChange = useCallback(
|
|
7445
|
+
(newItems) => {
|
|
7446
|
+
var _a;
|
|
7447
|
+
const newValue = newItems.reduce((result, item) => {
|
|
7448
|
+
result[item.key] = item.value;
|
|
7449
|
+
return result;
|
|
7450
|
+
}, {});
|
|
7451
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, newValue);
|
|
7452
|
+
},
|
|
7453
|
+
[props]
|
|
7454
|
+
);
|
|
7455
|
+
const onRemove = useCallback(
|
|
7456
|
+
(index) => {
|
|
7457
|
+
const result = [...items];
|
|
7458
|
+
result.splice(index, 1);
|
|
7459
|
+
onChange(result);
|
|
7460
|
+
},
|
|
7461
|
+
[onChange, items]
|
|
7462
|
+
);
|
|
7385
7463
|
const onAdd = useCallback(() => {
|
|
7386
7464
|
onChange([...items, { key: "", value: "" }]);
|
|
7387
7465
|
}, [onChange, items]);
|
|
7388
|
-
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7466
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7467
|
+
items.map((item, index) => {
|
|
7468
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7469
|
+
KeyValueInput,
|
|
7470
|
+
{
|
|
7471
|
+
item,
|
|
7472
|
+
onChange: (newItem) => {
|
|
7473
|
+
const temp = [...items];
|
|
7474
|
+
temp.splice(index, 1, newItem);
|
|
7475
|
+
onChange(temp);
|
|
7476
|
+
},
|
|
7477
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7478
|
+
kit.button,
|
|
7479
|
+
{
|
|
7480
|
+
onClick: () => {
|
|
7481
|
+
onRemove(index);
|
|
7482
|
+
},
|
|
7483
|
+
danger: true,
|
|
7484
|
+
children: "Remove"
|
|
7485
|
+
}
|
|
7486
|
+
)
|
|
7487
|
+
},
|
|
7488
|
+
index
|
|
7489
|
+
);
|
|
7490
|
+
}),
|
|
7491
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", onClick: onAdd, children: "Add" }) })
|
|
7492
|
+
] });
|
|
7397
7493
|
}
|
|
7398
7494
|
function MetadataForm() {
|
|
7399
7495
|
const kit = useUIKit();
|
|
7400
|
-
return
|
|
7496
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7497
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { label: "Name", name: ["metadata", "name"], rules: rfc1123LabelRules, children: /* @__PURE__ */ jsxRuntimeExports.jsx(NameInputWidget, {}) }),
|
|
7498
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7499
|
+
kit.form.Item,
|
|
7500
|
+
{
|
|
7501
|
+
label: "Namespace",
|
|
7502
|
+
name: ["metadata", "namespace"],
|
|
7503
|
+
rules: namespaceRules,
|
|
7504
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(NamespaceSelectWidget, {})
|
|
7505
|
+
}
|
|
7506
|
+
),
|
|
7507
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { name: ["metadata", "labels"], label: "Labels", children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueListWidget, {}) }),
|
|
7508
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, { name: ["metadata", "annotations"], label: "Annotations", children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueListWidget, {}) })
|
|
7509
|
+
] });
|
|
7401
7510
|
}
|
|
7402
7511
|
function addId(arr, idKey) {
|
|
7403
7512
|
return arr.map((e) => {
|
|
@@ -7407,9 +7516,9 @@ function addId(arr, idKey) {
|
|
|
7407
7516
|
};
|
|
7408
7517
|
});
|
|
7409
7518
|
}
|
|
7410
|
-
const
|
|
7411
|
-
const ErrorWrapper$1 = "
|
|
7412
|
-
const ErrorContent$1 = "
|
|
7519
|
+
const ErrorContent_1t51xnx = "";
|
|
7520
|
+
const ErrorWrapper$1 = "eckm4od";
|
|
7521
|
+
const ErrorContent$1 = "e1hl982n";
|
|
7413
7522
|
const WidgetErrorContent$1 = (props) => {
|
|
7414
7523
|
const {
|
|
7415
7524
|
refetch
|
|
@@ -7418,15 +7527,15 @@ const WidgetErrorContent$1 = (props) => {
|
|
|
7418
7527
|
const {
|
|
7419
7528
|
t
|
|
7420
7529
|
} = useTranslation();
|
|
7421
|
-
return jsxRuntimeExports.jsx("div", {
|
|
7530
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
7422
7531
|
className: ErrorWrapper$1,
|
|
7423
7532
|
style: props.style,
|
|
7424
|
-
children: jsxRuntimeExports.jsxs("div", {
|
|
7533
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
7425
7534
|
className: ErrorContent$1,
|
|
7426
|
-
children: [jsxRuntimeExports.jsx("p", {
|
|
7535
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("p", {
|
|
7427
7536
|
className: cx_default(Typo.Label.l1_regular_title, "title"),
|
|
7428
7537
|
children: props.errorText || t("dovetail.obtain_data_error")
|
|
7429
|
-
}), refetch ? jsxRuntimeExports.jsx(kit.button, {
|
|
7538
|
+
}), refetch ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
7430
7539
|
type: "ordinary",
|
|
7431
7540
|
onClick: (e) => {
|
|
7432
7541
|
e.stopPropagation();
|
|
@@ -7730,14 +7839,33 @@ var dayjs_min = { exports: {} };
|
|
|
7730
7839
|
var dayjs_minExports = dayjs_min.exports;
|
|
7731
7840
|
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
7732
7841
|
const Time = (props) => {
|
|
7733
|
-
const {
|
|
7842
|
+
const {
|
|
7843
|
+
className,
|
|
7844
|
+
date,
|
|
7845
|
+
dateTemplate = "YYYY-MM-DD",
|
|
7846
|
+
timeTemplate = "HH:mm",
|
|
7847
|
+
plainText
|
|
7848
|
+
} = props;
|
|
7734
7849
|
if (!date)
|
|
7735
|
-
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "-" });
|
|
7850
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "-" });
|
|
7736
7851
|
const time = dayjs(date);
|
|
7737
7852
|
if (plainText) {
|
|
7738
|
-
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7853
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
7854
|
+
dateTemplate !== null && time.format(dateTemplate),
|
|
7855
|
+
" ",
|
|
7856
|
+
timeTemplate !== null && time.format(timeTemplate)
|
|
7857
|
+
] });
|
|
7739
7858
|
}
|
|
7740
|
-
return jsxRuntimeExports.jsxs("span", { className: `time-wrapper ${className || ""}`, children: [
|
|
7859
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: `time-wrapper ${className || ""}`, children: [
|
|
7860
|
+
dateTemplate !== null && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "date", children: [
|
|
7861
|
+
" ",
|
|
7862
|
+
time.format(dateTemplate)
|
|
7863
|
+
] }),
|
|
7864
|
+
timeTemplate !== null && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "time", children: [
|
|
7865
|
+
" ",
|
|
7866
|
+
time.format(timeTemplate)
|
|
7867
|
+
] })
|
|
7868
|
+
] });
|
|
7741
7869
|
};
|
|
7742
7870
|
const ConditionsTable = ({ conditions = [] }) => {
|
|
7743
7871
|
const kit = useUIKit();
|
|
@@ -7773,7 +7901,7 @@ const ConditionsTable = ({ conditions = [] }) => {
|
|
|
7773
7901
|
sortable: true,
|
|
7774
7902
|
render: (value, record) => {
|
|
7775
7903
|
const time = value || record.lastTransitionTime;
|
|
7776
|
-
return jsxRuntimeExports.jsx(Time, { date: new Date(time) });
|
|
7904
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: new Date(time) });
|
|
7777
7905
|
}
|
|
7778
7906
|
},
|
|
7779
7907
|
{
|
|
@@ -7785,9 +7913,18 @@ const ConditionsTable = ({ conditions = [] }) => {
|
|
|
7785
7913
|
}
|
|
7786
7914
|
];
|
|
7787
7915
|
if (conditionsWithId.length === 0) {
|
|
7788
|
-
return jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
7916
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
7789
7917
|
}
|
|
7790
|
-
return jsxRuntimeExports.jsx(
|
|
7918
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
7919
|
+
kit.table,
|
|
7920
|
+
{
|
|
7921
|
+
loading: false,
|
|
7922
|
+
dataSource: conditionsWithId,
|
|
7923
|
+
columns,
|
|
7924
|
+
rowKey: "type",
|
|
7925
|
+
empty: t("dovetail.empty")
|
|
7926
|
+
}
|
|
7927
|
+
);
|
|
7791
7928
|
};
|
|
7792
7929
|
function memoize(fn) {
|
|
7793
7930
|
var cache = /* @__PURE__ */ Object.create(null);
|
|
@@ -7906,14 +8043,14 @@ var styled_default = process.env.NODE_ENV !== "production" ? new Proxy(styled, {
|
|
|
7906
8043
|
return o(prop);
|
|
7907
8044
|
}
|
|
7908
8045
|
}) : styled;
|
|
7909
|
-
const
|
|
8046
|
+
const TableWidgets_ny30pi = "";
|
|
7910
8047
|
const AuxiliaryLine = /* @__PURE__ */ styled_default("div")({
|
|
7911
8048
|
name: "AuxiliaryLine",
|
|
7912
|
-
class: "
|
|
8049
|
+
class: "ax1qopv",
|
|
7913
8050
|
propsAsIs: false
|
|
7914
8051
|
});
|
|
7915
|
-
const
|
|
7916
|
-
const TableContainerStyle = "
|
|
8052
|
+
const index_dmbxj3 = "";
|
|
8053
|
+
const TableContainerStyle = "t1upn1sz";
|
|
7917
8054
|
function Table(props) {
|
|
7918
8055
|
const kit = useUIKit();
|
|
7919
8056
|
const {
|
|
@@ -7949,7 +8086,7 @@ function Table(props) {
|
|
|
7949
8086
|
dataIndex: [],
|
|
7950
8087
|
title: "",
|
|
7951
8088
|
render: (_, record) => {
|
|
7952
|
-
return jsxRuntimeExports.jsx(RowMenu, {
|
|
8089
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RowMenu, {
|
|
7953
8090
|
record
|
|
7954
8091
|
});
|
|
7955
8092
|
}
|
|
@@ -7959,9 +8096,9 @@ function Table(props) {
|
|
|
7959
8096
|
return columns;
|
|
7960
8097
|
}, [columns, RowMenu]);
|
|
7961
8098
|
if (loading) {
|
|
7962
|
-
return jsxRuntimeExports.jsx(kit.loading, {});
|
|
8099
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.loading, {});
|
|
7963
8100
|
} else if (error) {
|
|
7964
|
-
return jsxRuntimeExports.jsx(WidgetErrorContent$1, {
|
|
8101
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, {
|
|
7965
8102
|
errorText: t("dovetail.retry_when_access_data_failed"),
|
|
7966
8103
|
refetch,
|
|
7967
8104
|
style: {
|
|
@@ -7969,17 +8106,17 @@ function Table(props) {
|
|
|
7969
8106
|
}
|
|
7970
8107
|
});
|
|
7971
8108
|
} else if (dataSource.length === 0) {
|
|
7972
|
-
return jsxRuntimeExports.jsx(WidgetErrorContent$1, {
|
|
8109
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, {
|
|
7973
8110
|
errorText: t("dovetail.empty"),
|
|
7974
8111
|
style: {
|
|
7975
8112
|
padding: "15px 0"
|
|
7976
8113
|
}
|
|
7977
8114
|
});
|
|
7978
8115
|
}
|
|
7979
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
8116
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
7980
8117
|
ref: wrapperRef,
|
|
7981
8118
|
className: cx_default(TableContainerStyle, props.className, "table-wrapper"),
|
|
7982
|
-
children: [jsxRuntimeExports.jsx(kit.table, {
|
|
8119
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.table, {
|
|
7983
8120
|
tableLayout: "fixed",
|
|
7984
8121
|
rowSelection: onSelect ? {
|
|
7985
8122
|
onChange: (keys, rows) => {
|
|
@@ -7994,9 +8131,9 @@ function Table(props) {
|
|
|
7994
8131
|
rowKey,
|
|
7995
8132
|
wrapper: wrapperRef,
|
|
7996
8133
|
scroll
|
|
7997
|
-
}), jsxRuntimeExports.jsx(AuxiliaryLine, {
|
|
8134
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(AuxiliaryLine, {
|
|
7998
8135
|
ref: auxiliaryLineRef
|
|
7999
|
-
}), jsxRuntimeExports.jsx(kit.pagination, {
|
|
8136
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.pagination, {
|
|
8000
8137
|
current: currentPage,
|
|
8001
8138
|
size: currentSize,
|
|
8002
8139
|
count: dataSource.length,
|
|
@@ -9615,15 +9752,15 @@ var CloseCircleFilled = function CloseCircleFilled2(props, ref) {
|
|
|
9615
9752
|
};
|
|
9616
9753
|
CloseCircleFilled.displayName = "CloseCircleFilled";
|
|
9617
9754
|
const CloseCircleFilled$1 = React.forwardRef(CloseCircleFilled);
|
|
9618
|
-
const
|
|
9755
|
+
const index_1kmu85y = "";
|
|
9619
9756
|
const ErrorWrapper = /* @__PURE__ */ styled_default("div")({
|
|
9620
9757
|
name: "ErrorWrapper",
|
|
9621
|
-
class: "
|
|
9758
|
+
class: "egn3dbn",
|
|
9622
9759
|
propsAsIs: false
|
|
9623
9760
|
});
|
|
9624
9761
|
const ErrorContent = /* @__PURE__ */ styled_default("div")({
|
|
9625
9762
|
name: "ErrorContent",
|
|
9626
|
-
class: "
|
|
9763
|
+
class: "e136jgy8",
|
|
9627
9764
|
propsAsIs: false
|
|
9628
9765
|
});
|
|
9629
9766
|
const WidgetErrorContent = (props) => {
|
|
@@ -9636,14 +9773,14 @@ const WidgetErrorContent = (props) => {
|
|
|
9636
9773
|
const {
|
|
9637
9774
|
t
|
|
9638
9775
|
} = useTranslation();
|
|
9639
|
-
return jsxRuntimeExports.jsx(ErrorWrapper, {
|
|
9776
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorWrapper, {
|
|
9640
9777
|
className: props.className,
|
|
9641
9778
|
style: props.style,
|
|
9642
|
-
children: jsxRuntimeExports.jsxs(ErrorContent, {
|
|
9643
|
-
children: [jsxRuntimeExports.jsx("p", {
|
|
9779
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ErrorContent, {
|
|
9780
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("p", {
|
|
9644
9781
|
className: cx_default(Typo.Label.l1_regular_title, "title"),
|
|
9645
9782
|
children: errorText || t("dovetail.obtain_data_error")
|
|
9646
|
-
}), hiddenRetry ? null : jsxRuntimeExports.jsx(kit.button, {
|
|
9783
|
+
}), hiddenRetry ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
9647
9784
|
size: "small",
|
|
9648
9785
|
type: "ordinary",
|
|
9649
9786
|
onClick: (e) => {
|
|
@@ -9658,11 +9795,23 @@ const WidgetErrorContent = (props) => {
|
|
|
9658
9795
|
function FormErrorAlert(props) {
|
|
9659
9796
|
const { errorMsgs, style, className } = props;
|
|
9660
9797
|
const kit = useUIKit();
|
|
9661
|
-
return errorMsgs.length ?
|
|
9798
|
+
return errorMsgs.length ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9799
|
+
kit.alert,
|
|
9800
|
+
{
|
|
9801
|
+
message: errorMsgs.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errorMsgs.map((errorMsg, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
|
|
9802
|
+
index + 1 + ". ",
|
|
9803
|
+
" ",
|
|
9804
|
+
errorMsg
|
|
9805
|
+
] }, errorMsg)) }) : first(errorMsgs),
|
|
9806
|
+
type: "error",
|
|
9807
|
+
style,
|
|
9808
|
+
className
|
|
9809
|
+
}
|
|
9810
|
+
) : null;
|
|
9662
9811
|
}
|
|
9663
|
-
const
|
|
9664
|
-
const WrapperStyle$3 = "
|
|
9665
|
-
const TitleStyle$1 = "
|
|
9812
|
+
const index_17v8shn = "";
|
|
9813
|
+
const WrapperStyle$3 = "w1akirqw";
|
|
9814
|
+
const TitleStyle$1 = "t30srnq";
|
|
9666
9815
|
function FormLayout(props) {
|
|
9667
9816
|
var _a;
|
|
9668
9817
|
const {
|
|
@@ -9676,13 +9825,13 @@ function FormLayout(props) {
|
|
|
9676
9825
|
const {
|
|
9677
9826
|
t
|
|
9678
9827
|
} = useTranslation();
|
|
9679
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
9828
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
9680
9829
|
className: WrapperStyle$3,
|
|
9681
|
-
children: [jsxRuntimeExports.jsxs("span", {
|
|
9830
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
9682
9831
|
className: cx_default(Typo.Display.d2_bold_title, TitleStyle$1),
|
|
9683
9832
|
children: [(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.kind, ":", " ", action === "create" ? t("dovetail.create") : t("dovetail.edit")]
|
|
9684
|
-
}), jsxRuntimeExports.jsx(kit.divider, {}), props.children, jsxRuntimeExports.jsx(kit.form.Item, {
|
|
9685
|
-
children: jsxRuntimeExports.jsx(kit.button, {
|
|
9833
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.divider, {}), props.children, /* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, {
|
|
9834
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
9686
9835
|
type: "primary",
|
|
9687
9836
|
...saveButtonProps,
|
|
9688
9837
|
children: t("dovetail.save")
|
|
@@ -9690,99 +9839,267 @@ function FormLayout(props) {
|
|
|
9690
9839
|
})]
|
|
9691
9840
|
});
|
|
9692
9841
|
}
|
|
9693
|
-
const
|
|
9694
|
-
const Style = "
|
|
9842
|
+
const index_12sfrn = "";
|
|
9843
|
+
const Style = "s1bsn3us";
|
|
9695
9844
|
const Separator = () => {
|
|
9696
|
-
return jsxRuntimeExports.jsx("div", {
|
|
9845
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
9697
9846
|
className: Style
|
|
9698
9847
|
});
|
|
9699
9848
|
};
|
|
9700
|
-
const
|
|
9701
|
-
const ToolBarStyle = "
|
|
9702
|
-
const ToolBarHeaderStyle = "
|
|
9703
|
-
const ErrorIconStyle = "
|
|
9704
|
-
const WrapperStyle$2 = "
|
|
9705
|
-
const TitleStyle = "
|
|
9706
|
-
const IconStyle = "
|
|
9707
|
-
const PlainCodeStyle = "
|
|
9708
|
-
const ErrorMsgStyle = "
|
|
9709
|
-
const ErrorWrapperStyle = "
|
|
9710
|
-
const YamlEditorStyle = "
|
|
9849
|
+
const style_inzxm5 = "";
|
|
9850
|
+
const ToolBarStyle = "t1joof7s";
|
|
9851
|
+
const ToolBarHeaderStyle = "tti58uh";
|
|
9852
|
+
const ErrorIconStyle = "e15yt16p";
|
|
9853
|
+
const WrapperStyle$2 = "w3ccqks";
|
|
9854
|
+
const TitleStyle = "t7zbd78";
|
|
9855
|
+
const IconStyle = "i1e4ouxy";
|
|
9856
|
+
const PlainCodeStyle = "pqch97v";
|
|
9857
|
+
const ErrorMsgStyle = "eh2qjnl";
|
|
9858
|
+
const ErrorWrapperStyle = "e19q2bnp";
|
|
9859
|
+
const YamlEditorStyle = "y16u5v3w";
|
|
9711
9860
|
const MonacoYamlEditor$2 = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$1));
|
|
9712
|
-
const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-
|
|
9713
|
-
const YamlEditorComponent = forwardRef(
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9727
|
-
|
|
9728
|
-
|
|
9861
|
+
const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-7505595f.js"));
|
|
9862
|
+
const YamlEditorComponent = forwardRef(
|
|
9863
|
+
function YamlEditorComponent2(props, ref) {
|
|
9864
|
+
const {
|
|
9865
|
+
title,
|
|
9866
|
+
collapsable = true,
|
|
9867
|
+
isDefaultCollapsed,
|
|
9868
|
+
defaultValue = "",
|
|
9869
|
+
height,
|
|
9870
|
+
readOnly,
|
|
9871
|
+
errorMsgs = [],
|
|
9872
|
+
schema,
|
|
9873
|
+
eleRef,
|
|
9874
|
+
className
|
|
9875
|
+
} = props;
|
|
9876
|
+
const kit = useUIKit();
|
|
9877
|
+
const { t } = useTranslation();
|
|
9878
|
+
const [isCollapsed, setIsCollapsed] = useState(
|
|
9879
|
+
collapsable ? isDefaultCollapsed : false
|
|
9880
|
+
);
|
|
9881
|
+
const [isDiff, setIsDiff] = useState(false);
|
|
9882
|
+
const [value, setValue] = useState(defaultValue);
|
|
9883
|
+
const editorInstance = useRef();
|
|
9884
|
+
const [copyTooltip, setCopyTooltip] = useState(t("dovetail.copy"));
|
|
9885
|
+
const [resetTooltip, setResetTooltip] = useState(t("dovetail.reset_arguments"));
|
|
9886
|
+
useImperativeHandle(ref, () => {
|
|
9887
|
+
return {
|
|
9888
|
+
setValue,
|
|
9889
|
+
setEditorValue: (value2) => {
|
|
9890
|
+
var _a, _b;
|
|
9891
|
+
(_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(value2);
|
|
9892
|
+
},
|
|
9893
|
+
getEditorValue: () => {
|
|
9894
|
+
var _a;
|
|
9895
|
+
return ((_a = editorInstance.current) == null ? void 0 : _a.getValue()) ?? "";
|
|
9896
|
+
},
|
|
9897
|
+
getEditorInstance: () => editorInstance.current || null
|
|
9898
|
+
};
|
|
9899
|
+
});
|
|
9900
|
+
const onChange = useCallback(
|
|
9901
|
+
(newVal) => {
|
|
9902
|
+
var _a;
|
|
9903
|
+
setValue(newVal);
|
|
9904
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, newVal);
|
|
9729
9905
|
},
|
|
9730
|
-
|
|
9906
|
+
[props.onChange]
|
|
9907
|
+
);
|
|
9908
|
+
const onValidate = useCallback(
|
|
9909
|
+
(valid, schemaValid) => {
|
|
9731
9910
|
var _a;
|
|
9732
|
-
|
|
9911
|
+
(_a = props.onValidate) == null ? void 0 : _a.call(props, valid, schemaValid);
|
|
9733
9912
|
},
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9913
|
+
[props.onValidate]
|
|
9914
|
+
);
|
|
9915
|
+
const onEditorCreate = useCallback(
|
|
9916
|
+
(editor) => {
|
|
9917
|
+
var _a, _b, _c;
|
|
9918
|
+
if (editor.getValue() !== value) {
|
|
9919
|
+
(_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(value);
|
|
9920
|
+
}
|
|
9921
|
+
(_c = props.onEditorCreate) == null ? void 0 : _c.call(props, editor);
|
|
9922
|
+
},
|
|
9923
|
+
[value, props.onEditorCreate]
|
|
9924
|
+
);
|
|
9925
|
+
const getInstance = useCallback((ins) => {
|
|
9926
|
+
editorInstance.current = ins;
|
|
9927
|
+
}, []);
|
|
9928
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
9929
|
+
"div",
|
|
9930
|
+
{
|
|
9931
|
+
className: cx_default(WrapperStyle$2, className),
|
|
9932
|
+
"data-is-error": !!errorMsgs.length,
|
|
9933
|
+
ref: eleRef,
|
|
9934
|
+
children: [
|
|
9935
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
9936
|
+
kit.space,
|
|
9937
|
+
{
|
|
9938
|
+
className: cx_default(ToolBarStyle, isCollapsed ? "collapsed" : ""),
|
|
9939
|
+
direction: "vertical",
|
|
9940
|
+
size: 0,
|
|
9941
|
+
children: [
|
|
9942
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { className: ToolBarHeaderStyle, children: [
|
|
9943
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { size: 8, children: [
|
|
9944
|
+
collapsable && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9945
|
+
Icon$1,
|
|
9946
|
+
{
|
|
9947
|
+
src: HierarchyTriangleRight16GrayIcon,
|
|
9948
|
+
hoverSrc: HierarchyTriangleRight16BlueIcon,
|
|
9949
|
+
className: cx_default(IconStyle, isCollapsed ? "" : "arrow-down"),
|
|
9950
|
+
iconWidth: 16,
|
|
9951
|
+
iconHeight: 16,
|
|
9952
|
+
onClick: () => setIsCollapsed(!isCollapsed)
|
|
9953
|
+
}
|
|
9954
|
+
),
|
|
9955
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cx_default(TitleStyle, "yaml-editor-title"), children: title || t("dovetail.configure_file") })
|
|
9956
|
+
] }),
|
|
9957
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { size: 14, children: [
|
|
9958
|
+
isDiff ? void 0 : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
9959
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9960
|
+
kit.tooltip,
|
|
9961
|
+
{
|
|
9962
|
+
title: isCollapsed ? "" : copyTooltip,
|
|
9963
|
+
onVisibleChange: (visible) => {
|
|
9964
|
+
if (!visible) {
|
|
9965
|
+
setTimeout(() => {
|
|
9966
|
+
setCopyTooltip(t("dovetail.copy"));
|
|
9967
|
+
}, 80);
|
|
9968
|
+
}
|
|
9969
|
+
},
|
|
9970
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9971
|
+
Icon$1,
|
|
9972
|
+
{
|
|
9973
|
+
"data-disabled": isCollapsed,
|
|
9974
|
+
src: ClipboardCopy16GradientGrayIcon,
|
|
9975
|
+
hoverSrc: isCollapsed ? void 0 : ClipboardCopy16GradientBlueIcon,
|
|
9976
|
+
className: IconStyle,
|
|
9977
|
+
iconWidth: 16,
|
|
9978
|
+
iconHeight: 16,
|
|
9979
|
+
onClick: () => {
|
|
9980
|
+
if (!isCollapsed) {
|
|
9981
|
+
copyToClipboard(value);
|
|
9982
|
+
setCopyTooltip(t("dovetail.copied"));
|
|
9983
|
+
}
|
|
9984
|
+
}
|
|
9985
|
+
}
|
|
9986
|
+
)
|
|
9987
|
+
}
|
|
9988
|
+
),
|
|
9989
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {}),
|
|
9990
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
9991
|
+
kit.tooltip,
|
|
9992
|
+
{
|
|
9993
|
+
title: isCollapsed ? "" : resetTooltip,
|
|
9994
|
+
onVisibleChange: (visible) => {
|
|
9995
|
+
if (!visible) {
|
|
9996
|
+
setTimeout(() => {
|
|
9997
|
+
setResetTooltip(t("dovetail.reset_arguments"));
|
|
9998
|
+
}, 80);
|
|
9999
|
+
}
|
|
10000
|
+
},
|
|
10001
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10002
|
+
Icon$1,
|
|
10003
|
+
{
|
|
10004
|
+
"data-disabled": isCollapsed,
|
|
10005
|
+
src: Retry16GradientGrayIcon,
|
|
10006
|
+
hoverSrc: isCollapsed ? void 0 : Retry16GradientBlueIcon,
|
|
10007
|
+
className: IconStyle,
|
|
10008
|
+
iconWidth: 16,
|
|
10009
|
+
iconHeight: 16,
|
|
10010
|
+
onClick: () => {
|
|
10011
|
+
var _a;
|
|
10012
|
+
if (!isCollapsed) {
|
|
10013
|
+
(_a = editorInstance.current) == null ? void 0 : _a.setValue(defaultValue);
|
|
10014
|
+
setResetTooltip(t("dovetail.already_reset"));
|
|
10015
|
+
}
|
|
10016
|
+
}
|
|
10017
|
+
}
|
|
10018
|
+
)
|
|
10019
|
+
}
|
|
10020
|
+
),
|
|
10021
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {})
|
|
10022
|
+
] }),
|
|
10023
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10024
|
+
kit.tooltip,
|
|
10025
|
+
{
|
|
10026
|
+
title: isCollapsed ? "" : isDiff ? t("dovetail.back_to_edit") : t("dovetail.view_changes"),
|
|
10027
|
+
children: isDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10028
|
+
Icon$1,
|
|
10029
|
+
{
|
|
10030
|
+
"data-disabled": isCollapsed,
|
|
10031
|
+
src: EditPen16GradientGrayIcon,
|
|
10032
|
+
hoverSrc: isCollapsed ? void 0 : EditPen16GradientBlueIcon,
|
|
10033
|
+
className: IconStyle,
|
|
10034
|
+
iconWidth: 16,
|
|
10035
|
+
iconHeight: 16,
|
|
10036
|
+
onClick: () => isCollapsed ? void 0 : setIsDiff(false)
|
|
10037
|
+
}
|
|
10038
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10039
|
+
Icon$1,
|
|
10040
|
+
{
|
|
10041
|
+
"data-disabled": isCollapsed,
|
|
10042
|
+
src: Showdiff16GradientGrayIcon,
|
|
10043
|
+
hoverSrc: isCollapsed ? void 0 : Showdiff16GradientBlueIcon,
|
|
10044
|
+
className: IconStyle,
|
|
10045
|
+
iconWidth: 16,
|
|
10046
|
+
iconHeight: 16,
|
|
10047
|
+
onClick: () => isCollapsed ? void 0 : setIsDiff(true)
|
|
10048
|
+
}
|
|
10049
|
+
)
|
|
10050
|
+
}
|
|
10051
|
+
)
|
|
10052
|
+
] })
|
|
10053
|
+
] }),
|
|
10054
|
+
errorMsgs.length ? /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { className: ErrorWrapperStyle, size: 8, align: "start", children: [
|
|
10055
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(XmarkFailedSeriousWarningFill16RedIcon, { className: ErrorIconStyle }),
|
|
10056
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: errorMsgs.map((errorMsg, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: ErrorMsgStyle, children: [
|
|
10057
|
+
errorMsgs.length > 1 ? `${index + 1}. ` : "",
|
|
10058
|
+
errorMsg
|
|
10059
|
+
] }, errorMsg)) })
|
|
10060
|
+
] }) : void 0
|
|
10061
|
+
]
|
|
10062
|
+
}
|
|
10063
|
+
),
|
|
10064
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10065
|
+
"div",
|
|
10066
|
+
{
|
|
10067
|
+
style: {
|
|
10068
|
+
display: isCollapsed ? "none" : "block",
|
|
10069
|
+
width: "100%",
|
|
10070
|
+
height: height || "500px",
|
|
10071
|
+
zIndex: 1
|
|
10072
|
+
},
|
|
10073
|
+
children: isDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: value }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10074
|
+
MonacoYamlDiffEditor,
|
|
10075
|
+
{
|
|
10076
|
+
id: props.id,
|
|
10077
|
+
origin: defaultValue,
|
|
10078
|
+
modified: value,
|
|
10079
|
+
height
|
|
10080
|
+
}
|
|
10081
|
+
) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: value }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10082
|
+
MonacoYamlEditor$2,
|
|
10083
|
+
{
|
|
10084
|
+
id: props.id,
|
|
10085
|
+
getInstance,
|
|
10086
|
+
defaultValue,
|
|
10087
|
+
height,
|
|
10088
|
+
onChange,
|
|
10089
|
+
onValidate,
|
|
10090
|
+
onEditorCreate,
|
|
10091
|
+
onBlur: props.onBlur,
|
|
10092
|
+
schema,
|
|
10093
|
+
readOnly
|
|
10094
|
+
}
|
|
10095
|
+
) })
|
|
10096
|
+
}
|
|
10097
|
+
)
|
|
10098
|
+
]
|
|
10099
|
+
}
|
|
10100
|
+
);
|
|
10101
|
+
}
|
|
10102
|
+
);
|
|
9786
10103
|
function copyToClipboard(text) {
|
|
9787
10104
|
const input = document.createElement("textarea");
|
|
9788
10105
|
input.value = text;
|
|
@@ -10009,42 +10326,51 @@ function getCommonErrors(responseBody, i18n2) {
|
|
|
10009
10326
|
params = info.params;
|
|
10010
10327
|
message2 = info.message;
|
|
10011
10328
|
} catch {
|
|
10012
|
-
return i18n2.t(
|
|
10329
|
+
return i18n2.t(
|
|
10330
|
+
[
|
|
10331
|
+
`error.${cause.reason}`,
|
|
10332
|
+
`error.${cause.code}`,
|
|
10333
|
+
`${message2}${cause.field ? `(${cause.field})` : ""}`
|
|
10334
|
+
],
|
|
10335
|
+
{
|
|
10336
|
+
...params,
|
|
10337
|
+
fallbackLng: ""
|
|
10338
|
+
}
|
|
10339
|
+
);
|
|
10340
|
+
}
|
|
10341
|
+
return i18n2.t(
|
|
10342
|
+
[
|
|
10013
10343
|
`error.${cause.reason}`,
|
|
10014
10344
|
`error.${cause.code}`,
|
|
10015
10345
|
`${message2}${cause.field ? `(${cause.field})` : ""}`
|
|
10016
|
-
],
|
|
10346
|
+
],
|
|
10347
|
+
{
|
|
10017
10348
|
...params,
|
|
10018
10349
|
fallbackLng: ""
|
|
10019
|
-
}
|
|
10020
|
-
|
|
10021
|
-
return i18n2.t([
|
|
10022
|
-
`error.${cause.reason}`,
|
|
10023
|
-
`error.${cause.code}`,
|
|
10024
|
-
`${message2}${cause.field ? `(${cause.field})` : ""}`
|
|
10025
|
-
], {
|
|
10026
|
-
...params,
|
|
10027
|
-
fallbackLng: ""
|
|
10028
|
-
});
|
|
10350
|
+
}
|
|
10351
|
+
);
|
|
10029
10352
|
});
|
|
10030
10353
|
}
|
|
10031
10354
|
return [
|
|
10032
|
-
i18n2.t(
|
|
10355
|
+
i18n2.t(
|
|
10356
|
+
[`error.${responseBody.code}`, `error.${responseBody.reason}`, responseBody.message || ""],
|
|
10357
|
+
{ fallbackLng: "" }
|
|
10358
|
+
)
|
|
10033
10359
|
];
|
|
10034
10360
|
}
|
|
10035
|
-
const
|
|
10036
|
-
const FormStyle = "
|
|
10037
|
-
const EditorStyle$1 = "
|
|
10038
|
-
var SchemaStrategy
|
|
10039
|
-
(function(SchemaStrategy2) {
|
|
10361
|
+
const index_1r3lc5t = "";
|
|
10362
|
+
const FormStyle = "f5ks0bl";
|
|
10363
|
+
const EditorStyle$1 = "e1tqaxpu";
|
|
10364
|
+
var SchemaStrategy = /* @__PURE__ */ ((SchemaStrategy2) => {
|
|
10040
10365
|
SchemaStrategy2["Required"] = "Required";
|
|
10041
10366
|
SchemaStrategy2["Optional"] = "Optional";
|
|
10042
10367
|
SchemaStrategy2["None"] = "None";
|
|
10043
|
-
|
|
10368
|
+
return SchemaStrategy2;
|
|
10369
|
+
})(SchemaStrategy || {});
|
|
10044
10370
|
function YamlForm(props) {
|
|
10045
10371
|
const {
|
|
10046
10372
|
id,
|
|
10047
|
-
schemaStrategy =
|
|
10373
|
+
schemaStrategy = "Optional",
|
|
10048
10374
|
isShowLayout = true,
|
|
10049
10375
|
onSaveButtonPropsChange
|
|
10050
10376
|
} = props;
|
|
@@ -10060,7 +10386,8 @@ function YamlForm(props) {
|
|
|
10060
10386
|
id,
|
|
10061
10387
|
action: id ? "edit" : "create",
|
|
10062
10388
|
editorOptions: {
|
|
10063
|
-
isSkipSchema: schemaStrategy ===
|
|
10389
|
+
isSkipSchema: schemaStrategy === "None"
|
|
10390
|
+
/* None */
|
|
10064
10391
|
},
|
|
10065
10392
|
liveMode: "off",
|
|
10066
10393
|
initialValuesForCreate: props.initialValues ?? BASE_INIT_VALUE
|
|
@@ -10083,9 +10410,9 @@ function YamlForm(props) {
|
|
|
10083
10410
|
useEffect(() => {
|
|
10084
10411
|
onSaveButtonPropsChange == null ? void 0 : onSaveButtonPropsChange(saveButtonProps);
|
|
10085
10412
|
}, [saveButtonProps, onSaveButtonPropsChange]);
|
|
10086
|
-
return jsxRuntimeExports.jsx(FormWrapper, {
|
|
10413
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormWrapper, {
|
|
10087
10414
|
saveButtonProps,
|
|
10088
|
-
children: jsxRuntimeExports.jsx(kit.form, {
|
|
10415
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.form, {
|
|
10089
10416
|
...formProps,
|
|
10090
10417
|
initialValues: formProps.initialValues,
|
|
10091
10418
|
layout: "horizontal",
|
|
@@ -10093,28 +10420,28 @@ function YamlForm(props) {
|
|
|
10093
10420
|
onFinish,
|
|
10094
10421
|
children: (() => {
|
|
10095
10422
|
if (isLoadingSchema) {
|
|
10096
|
-
return jsxRuntimeExports.jsx(kit.loading, {});
|
|
10423
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.loading, {});
|
|
10097
10424
|
}
|
|
10098
|
-
return editorProps.schema || schemaStrategy !==
|
|
10099
|
-
children: [jsxRuntimeExports.jsx(kit.form.Item, {
|
|
10425
|
+
return editorProps.schema || schemaStrategy !== "Required" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
10426
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, {
|
|
10100
10427
|
style: {
|
|
10101
10428
|
flex: 1
|
|
10102
10429
|
},
|
|
10103
|
-
children: jsxRuntimeExports.jsx(YamlEditorComponent, {
|
|
10430
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(YamlEditorComponent, {
|
|
10104
10431
|
...editorProps,
|
|
10105
10432
|
className: EditorStyle$1,
|
|
10106
10433
|
schema,
|
|
10107
10434
|
collapsable: false
|
|
10108
10435
|
})
|
|
10109
|
-
}), jsxRuntimeExports.jsx(kit.form.Item, {
|
|
10110
|
-
children: mutationResult.error && jsxRuntimeExports.jsx(FormErrorAlert, {
|
|
10436
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.form.Item, {
|
|
10437
|
+
children: mutationResult.error && /* @__PURE__ */ jsxRuntimeExports.jsx(FormErrorAlert, {
|
|
10111
10438
|
errorMsgs: errorResponseBody ? responseErrors : [mutationResult.error.message],
|
|
10112
10439
|
style: {
|
|
10113
10440
|
marginBottom: 16
|
|
10114
10441
|
}
|
|
10115
10442
|
})
|
|
10116
10443
|
})]
|
|
10117
|
-
}) : jsxRuntimeExports.jsx(WidgetErrorContent, {
|
|
10444
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent, {
|
|
10118
10445
|
errorText: t("dovetail.fetch_schema_fail"),
|
|
10119
10446
|
refetch: fetchSchema
|
|
10120
10447
|
});
|
|
@@ -10123,8 +10450,8 @@ function YamlForm(props) {
|
|
|
10123
10450
|
});
|
|
10124
10451
|
}
|
|
10125
10452
|
const ConfigsContext = createContext({});
|
|
10126
|
-
const
|
|
10127
|
-
const FullscreenModalStyle = "
|
|
10453
|
+
const index_16ywf6g = "";
|
|
10454
|
+
const FullscreenModalStyle = "fbinl28";
|
|
10128
10455
|
function FormModal(props) {
|
|
10129
10456
|
const {
|
|
10130
10457
|
resource: resourceFromProps,
|
|
@@ -10155,12 +10482,12 @@ function FormModal(props) {
|
|
|
10155
10482
|
const onFinish = useCallback(() => {
|
|
10156
10483
|
popModal();
|
|
10157
10484
|
}, []);
|
|
10158
|
-
return jsxRuntimeExports.jsx(kit.modal, {
|
|
10485
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.modal, {
|
|
10159
10486
|
className: FullscreenModalStyle,
|
|
10160
10487
|
width: "calc(100vw - 16px)",
|
|
10161
10488
|
title,
|
|
10162
10489
|
okButtonProps: saveButtonProps,
|
|
10163
|
-
closeIcon: jsxRuntimeExports.jsx(CloseCircleFilled$1, {}),
|
|
10490
|
+
closeIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(CloseCircleFilled$1, {}),
|
|
10164
10491
|
onOk,
|
|
10165
10492
|
onCancel,
|
|
10166
10493
|
destroyOnClose: true,
|
|
@@ -10171,7 +10498,7 @@ function FormModal(props) {
|
|
|
10171
10498
|
id,
|
|
10172
10499
|
onSaveButtonPropsChange: setSaveButtonProps,
|
|
10173
10500
|
onFinish
|
|
10174
|
-
}) : jsxRuntimeExports.jsx(YamlForm, {
|
|
10501
|
+
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(YamlForm, {
|
|
10175
10502
|
...formProps,
|
|
10176
10503
|
initialValues: (formProps == null ? void 0 : formProps.initialValues) || (config == null ? void 0 : config.initValue),
|
|
10177
10504
|
id,
|
|
@@ -10185,31 +10512,34 @@ function useEdit() {
|
|
|
10185
10512
|
const { resource } = useParsed();
|
|
10186
10513
|
const go = useGo();
|
|
10187
10514
|
const navigation = useNavigation();
|
|
10188
|
-
const edit2 = useCallback(
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10515
|
+
const edit2 = useCallback(
|
|
10516
|
+
(id) => {
|
|
10517
|
+
go({
|
|
10518
|
+
to: navigation.editUrl((resource == null ? void 0 : resource.name) || "", id),
|
|
10519
|
+
query: {
|
|
10520
|
+
id
|
|
10521
|
+
},
|
|
10522
|
+
options: {
|
|
10523
|
+
keepQuery: true
|
|
10524
|
+
}
|
|
10525
|
+
});
|
|
10526
|
+
},
|
|
10527
|
+
[go, resource == null ? void 0 : resource.name]
|
|
10528
|
+
);
|
|
10199
10529
|
return { edit: edit2 };
|
|
10200
10530
|
}
|
|
10201
|
-
var RESOURCE_GROUP
|
|
10202
|
-
(function(RESOURCE_GROUP2) {
|
|
10531
|
+
var RESOURCE_GROUP = /* @__PURE__ */ ((RESOURCE_GROUP2) => {
|
|
10203
10532
|
RESOURCE_GROUP2["WORKLOAD"] = "WORKLOAD";
|
|
10204
10533
|
RESOURCE_GROUP2["STORAGE"] = "STORAGE";
|
|
10205
10534
|
RESOURCE_GROUP2["NETWORK"] = "NETWORK";
|
|
10206
10535
|
RESOURCE_GROUP2["CLUSTER"] = "CLUSTER";
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
(
|
|
10536
|
+
return RESOURCE_GROUP2;
|
|
10537
|
+
})(RESOURCE_GROUP || {});
|
|
10538
|
+
var FormType = /* @__PURE__ */ ((FormType2) => {
|
|
10210
10539
|
FormType2["PAGE"] = "PAGE";
|
|
10211
10540
|
FormType2["MODAL"] = "MODAL";
|
|
10212
|
-
|
|
10541
|
+
return FormType2;
|
|
10542
|
+
})(FormType || {});
|
|
10213
10543
|
function getInitialValues(config) {
|
|
10214
10544
|
return config.initValue || {
|
|
10215
10545
|
apiVersion: config.apiVersion,
|
|
@@ -10255,7 +10585,7 @@ function CreateButton() {
|
|
|
10255
10585
|
const kit = useUIKit();
|
|
10256
10586
|
const { t } = useTranslation();
|
|
10257
10587
|
const openForm = useOpenForm();
|
|
10258
|
-
return jsxRuntimeExports.jsx(kit.button, { type: "primary", onClick: openForm, children: t("dovetail.create") });
|
|
10588
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", onClick: openForm, children: t("dovetail.create") });
|
|
10259
10589
|
}
|
|
10260
10590
|
const useDeleteManyModal = (resource, ids) => {
|
|
10261
10591
|
const { mutate } = useDeleteMany();
|
|
@@ -10289,33 +10619,39 @@ const DeleteManyButton = (props) => {
|
|
|
10289
10619
|
const { resource } = useResource();
|
|
10290
10620
|
const kit = useUIKit();
|
|
10291
10621
|
const { t } = useTranslation();
|
|
10292
|
-
const { modalProps, visible, setVisible } = useDeleteManyModal(
|
|
10622
|
+
const { modalProps, visible, setVisible } = useDeleteManyModal(
|
|
10623
|
+
(resource == null ? void 0 : resource.name) || "",
|
|
10624
|
+
props.ids
|
|
10625
|
+
);
|
|
10293
10626
|
const onClick = useCallback(() => {
|
|
10294
10627
|
setVisible(true);
|
|
10295
10628
|
}, [setVisible]);
|
|
10296
|
-
return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
10629
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
10630
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", danger: true, onClick, children: t("dovetail.delete") }),
|
|
10631
|
+
visible ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.modal, { ...modalProps }) : null
|
|
10632
|
+
] });
|
|
10297
10633
|
};
|
|
10298
|
-
const
|
|
10299
|
-
const ToolbarStyle$1 = "
|
|
10634
|
+
const TableToolBar_1a3t35p = "";
|
|
10635
|
+
const ToolbarStyle$1 = "t1v3ienx";
|
|
10300
10636
|
const TableToolBar = ({
|
|
10301
10637
|
title,
|
|
10302
10638
|
selectedKeys,
|
|
10303
10639
|
hideCreate
|
|
10304
10640
|
}) => {
|
|
10305
10641
|
const kit = useUIKit();
|
|
10306
|
-
return jsxRuntimeExports.jsxs(kit.space, {
|
|
10642
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
10307
10643
|
className: cx_default(ToolbarStyle$1, "table-toolbar"),
|
|
10308
|
-
children: [jsxRuntimeExports.jsx("span", {
|
|
10644
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
10309
10645
|
className: Typo.Display.d2_bold_title,
|
|
10310
10646
|
children: title
|
|
10311
|
-
}), jsxRuntimeExports.jsxs(kit.space, {
|
|
10312
|
-
children: [selectedKeys.length > 0 ? jsxRuntimeExports.jsx(DeleteManyButton, {
|
|
10647
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
10648
|
+
children: [selectedKeys.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteManyButton, {
|
|
10313
10649
|
ids: selectedKeys
|
|
10314
|
-
}) : void 0, !hideCreate ? jsxRuntimeExports.jsx(CreateButton, {}) : null]
|
|
10650
|
+
}) : void 0, !hideCreate ? /* @__PURE__ */ jsxRuntimeExports.jsx(CreateButton, {}) : null]
|
|
10315
10651
|
})]
|
|
10316
10652
|
});
|
|
10317
10653
|
};
|
|
10318
|
-
const
|
|
10654
|
+
const index_1hr2h38 = "";
|
|
10319
10655
|
function matchOwner(job, owner) {
|
|
10320
10656
|
var _a;
|
|
10321
10657
|
let match = false;
|
|
@@ -10350,14 +10686,14 @@ const CronjobJobsTable = ({
|
|
|
10350
10686
|
});
|
|
10351
10687
|
}, [data2 == null ? void 0 : data2.data, owner]);
|
|
10352
10688
|
const columns = [NameColumnRenderer(i18n2, "jobs"), StateDisplayColumnRenderer(i18n2), NameSpaceColumnRenderer(i18n2), WorkloadImageColumnRenderer(i18n2), CompletionsCountColumnRenderer(i18n2), DurationColumnRenderer(i18n2), AgeColumnRenderer(i18n2)];
|
|
10353
|
-
return jsxRuntimeExports.jsxs(kit.space, {
|
|
10689
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
10354
10690
|
direction: "vertical",
|
|
10355
|
-
className: "
|
|
10356
|
-
children: [jsxRuntimeExports.jsx(TableToolBar, {
|
|
10691
|
+
className: "c16agr8o",
|
|
10692
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
|
|
10357
10693
|
title: "Jobs",
|
|
10358
10694
|
selectedKeys,
|
|
10359
10695
|
hideCreate: true
|
|
10360
|
-
}), jsxRuntimeExports.jsx(Table, {
|
|
10696
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Table, {
|
|
10361
10697
|
tableKey: "cronjobs",
|
|
10362
10698
|
loading: !dataSource,
|
|
10363
10699
|
data: dataSource || [],
|
|
@@ -10380,52 +10716,69 @@ const EventsTable = ({}) => {
|
|
|
10380
10716
|
meta: { resourceBasePath: "/apis/events.k8s.io/v1", kind: "Event" }
|
|
10381
10717
|
});
|
|
10382
10718
|
const parsed = useParsed();
|
|
10383
|
-
const columns = useMemo(
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10719
|
+
const columns = useMemo(
|
|
10720
|
+
() => [
|
|
10721
|
+
NameSpaceColumnRenderer(i18n2),
|
|
10722
|
+
{
|
|
10723
|
+
key: "type",
|
|
10724
|
+
display: true,
|
|
10725
|
+
dataIndex: ["type"],
|
|
10726
|
+
title: i18n2.t("dovetail.type"),
|
|
10727
|
+
sortable: true,
|
|
10728
|
+
sorter: CommonSorter(["type"])
|
|
10729
|
+
},
|
|
10730
|
+
{
|
|
10731
|
+
key: "reason",
|
|
10732
|
+
display: true,
|
|
10733
|
+
dataIndex: ["reason"],
|
|
10734
|
+
title: i18n2.t("dovetail.reason"),
|
|
10735
|
+
sortable: true,
|
|
10736
|
+
sorter: CommonSorter(["reason"])
|
|
10737
|
+
},
|
|
10738
|
+
{
|
|
10739
|
+
key: "object",
|
|
10740
|
+
display: true,
|
|
10741
|
+
dataIndex: ["regarding", "name"],
|
|
10742
|
+
title: i18n2.t("dovetail.object"),
|
|
10743
|
+
sortable: true,
|
|
10744
|
+
sorter: CommonSorter(["regarding", "name"])
|
|
10745
|
+
},
|
|
10746
|
+
{
|
|
10747
|
+
key: "note",
|
|
10748
|
+
display: true,
|
|
10749
|
+
dataIndex: ["note"],
|
|
10750
|
+
title: i18n2.t("dovetail.note"),
|
|
10751
|
+
sortable: true,
|
|
10752
|
+
sorter: CommonSorter(["note"])
|
|
10753
|
+
},
|
|
10754
|
+
AgeColumnRenderer(i18n2)
|
|
10755
|
+
],
|
|
10756
|
+
[i18n2]
|
|
10757
|
+
);
|
|
10419
10758
|
const dataSource = useMemo(() => {
|
|
10420
10759
|
return data2 == null ? void 0 : data2.data.filter((d) => {
|
|
10421
10760
|
const objectId = `${d.regarding.namespace}/${d.regarding.name}`;
|
|
10422
10761
|
return objectId === parsed.id;
|
|
10423
10762
|
});
|
|
10424
10763
|
}, [data2 == null ? void 0 : data2.data, parsed]);
|
|
10425
|
-
return jsxRuntimeExports.jsx(
|
|
10764
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10765
|
+
Table,
|
|
10766
|
+
{
|
|
10767
|
+
tableKey: "events",
|
|
10768
|
+
loading: isLoading,
|
|
10769
|
+
data: dataSource || [],
|
|
10770
|
+
columns,
|
|
10771
|
+
rowKey: "id",
|
|
10772
|
+
error: false,
|
|
10773
|
+
currentPage,
|
|
10774
|
+
onPageChange: (p) => setCurrentPage(p),
|
|
10775
|
+
currentSize: 10,
|
|
10776
|
+
refetch: () => null
|
|
10777
|
+
}
|
|
10778
|
+
);
|
|
10426
10779
|
};
|
|
10427
|
-
const
|
|
10428
|
-
const MoreTriggerStyle = "
|
|
10780
|
+
const index_86mllf = "";
|
|
10781
|
+
const MoreTriggerStyle = "m1u1f5zp";
|
|
10429
10782
|
const ImageNames = ({
|
|
10430
10783
|
value
|
|
10431
10784
|
}) => {
|
|
@@ -10433,18 +10786,18 @@ const ImageNames = ({
|
|
|
10433
10786
|
const {
|
|
10434
10787
|
t
|
|
10435
10788
|
} = useTranslation();
|
|
10436
|
-
return jsxRuntimeExports.jsxs("span", {
|
|
10437
|
-
children: [jsxRuntimeExports.jsx("span", {
|
|
10789
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
10790
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
10438
10791
|
children: value[0]
|
|
10439
|
-
}), value.length > 1 && jsxRuntimeExports.jsx(kit.tooltip, {
|
|
10440
|
-
title: jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
10792
|
+
}), value.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tooltip, {
|
|
10793
|
+
title: /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
10441
10794
|
children: value.slice(1).map((name2, index) => {
|
|
10442
|
-
return jsxRuntimeExports.jsx("div", {
|
|
10795
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
10443
10796
|
children: name2
|
|
10444
10797
|
}, index);
|
|
10445
10798
|
})
|
|
10446
10799
|
}),
|
|
10447
|
-
children: jsxRuntimeExports.jsxs("div", {
|
|
10800
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
10448
10801
|
className: cx_default(Typo.Label.l4_regular, MoreTriggerStyle),
|
|
10449
10802
|
children: ["+", value.length - 1, " ", t("dovetail.more")]
|
|
10450
10803
|
})
|
|
@@ -10467,7 +10820,7 @@ const ResourceLink = (props) => {
|
|
|
10467
10820
|
}
|
|
10468
10821
|
});
|
|
10469
10822
|
};
|
|
10470
|
-
return jsxRuntimeExports.jsx(kit.Link, { onClick, children: resourceId });
|
|
10823
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.Link, { onClick, children: resourceId });
|
|
10471
10824
|
};
|
|
10472
10825
|
const IngressRulesTable = ({ ingress }) => {
|
|
10473
10826
|
const kit = useUIKit();
|
|
@@ -10497,7 +10850,14 @@ const IngressRulesTable = ({ ingress }) => {
|
|
|
10497
10850
|
title: t("dovetail.service"),
|
|
10498
10851
|
sortable: true,
|
|
10499
10852
|
render: (serviceName) => {
|
|
10500
|
-
return jsxRuntimeExports.jsx(
|
|
10853
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10854
|
+
ResourceLink,
|
|
10855
|
+
{
|
|
10856
|
+
name: "services",
|
|
10857
|
+
namespace: ingress.metadata.namespace || "default",
|
|
10858
|
+
resourceId: serviceName
|
|
10859
|
+
}
|
|
10860
|
+
);
|
|
10501
10861
|
}
|
|
10502
10862
|
},
|
|
10503
10863
|
{
|
|
@@ -10509,14 +10869,23 @@ const IngressRulesTable = ({ ingress }) => {
|
|
|
10509
10869
|
}
|
|
10510
10870
|
];
|
|
10511
10871
|
if (rows.length === 0) {
|
|
10512
|
-
return jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
10872
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
10513
10873
|
}
|
|
10514
|
-
return jsxRuntimeExports.jsx(
|
|
10874
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10875
|
+
kit.table,
|
|
10876
|
+
{
|
|
10877
|
+
loading: false,
|
|
10878
|
+
dataSource: rows,
|
|
10879
|
+
columns,
|
|
10880
|
+
rowKey: "type",
|
|
10881
|
+
empty: t("dovetail.empty")
|
|
10882
|
+
}
|
|
10883
|
+
);
|
|
10515
10884
|
};
|
|
10516
10885
|
const KeyValue = ({ value }) => {
|
|
10517
10886
|
const kit = useUIKit();
|
|
10518
10887
|
if (!value || Object.keys.length === 0) {
|
|
10519
|
-
return jsxRuntimeExports.jsx("div", { children: "Empty" });
|
|
10888
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Empty" });
|
|
10520
10889
|
}
|
|
10521
10890
|
const data2 = Object.keys(value).map((key) => {
|
|
10522
10891
|
return {
|
|
@@ -10525,18 +10894,25 @@ const KeyValue = ({ value }) => {
|
|
|
10525
10894
|
value: value[key]
|
|
10526
10895
|
};
|
|
10527
10896
|
});
|
|
10528
|
-
return jsxRuntimeExports.jsx(
|
|
10897
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10898
|
+
kit.table,
|
|
10529
10899
|
{
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10900
|
+
loading: false,
|
|
10901
|
+
columns: [
|
|
10902
|
+
{
|
|
10903
|
+
key: "key",
|
|
10904
|
+
title: "Key",
|
|
10905
|
+
dataIndex: ["key"]
|
|
10906
|
+
},
|
|
10907
|
+
{
|
|
10908
|
+
key: "value",
|
|
10909
|
+
title: "Value",
|
|
10910
|
+
dataIndex: ["value"]
|
|
10911
|
+
}
|
|
10912
|
+
],
|
|
10913
|
+
dataSource: data2
|
|
10538
10914
|
}
|
|
10539
|
-
|
|
10915
|
+
);
|
|
10540
10916
|
};
|
|
10541
10917
|
function matchSelector(pod, selector) {
|
|
10542
10918
|
var _a, _b, _c;
|
|
@@ -10548,7 +10924,7 @@ function matchSelector(pod, selector) {
|
|
|
10548
10924
|
}
|
|
10549
10925
|
return match;
|
|
10550
10926
|
}
|
|
10551
|
-
const
|
|
10927
|
+
const WorkloadPodsTable_1giuese = "";
|
|
10552
10928
|
const WorkloadPodsTable = ({
|
|
10553
10929
|
selector,
|
|
10554
10930
|
hideToolbar
|
|
@@ -10577,14 +10953,14 @@ const WorkloadPodsTable = ({
|
|
|
10577
10953
|
});
|
|
10578
10954
|
}, [data2 == null ? void 0 : data2.data, selector]);
|
|
10579
10955
|
const columns = [StateDisplayColumnRenderer(i18n2), NameColumnRenderer(i18n2, "pods"), NodeNameColumnRenderer(i18n2), WorkloadImageColumnRenderer(i18n2), RestartCountColumnRenderer(i18n2)];
|
|
10580
|
-
return jsxRuntimeExports.jsxs(kit.space, {
|
|
10956
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
10581
10957
|
direction: "vertical",
|
|
10582
|
-
className: "
|
|
10583
|
-
children: [hideToolbar ? null : jsxRuntimeExports.jsx(TableToolBar, {
|
|
10958
|
+
className: "c1dicff8",
|
|
10959
|
+
children: [hideToolbar ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
|
|
10584
10960
|
title: "",
|
|
10585
10961
|
selectedKeys,
|
|
10586
10962
|
hideCreate: true
|
|
10587
|
-
}), jsxRuntimeExports.jsx(Table, {
|
|
10963
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Table, {
|
|
10588
10964
|
tableKey: "pods",
|
|
10589
10965
|
loading: !dataSource,
|
|
10590
10966
|
data: dataSource || [],
|
|
@@ -10636,9 +11012,9 @@ function useSubmitForm(options) {
|
|
|
10636
11012
|
onSubmit
|
|
10637
11013
|
};
|
|
10638
11014
|
}
|
|
10639
|
-
const
|
|
10640
|
-
const EditFieldModalStyle = "
|
|
10641
|
-
const EditButtonStyle = "
|
|
11015
|
+
const index_13sllsf = "";
|
|
11016
|
+
const EditFieldModalStyle = "esoz3jw";
|
|
11017
|
+
const EditButtonStyle = "e1m0bgls";
|
|
10642
11018
|
function EditFieldModal(props) {
|
|
10643
11019
|
const {
|
|
10644
11020
|
title,
|
|
@@ -10662,7 +11038,7 @@ function EditFieldModal(props) {
|
|
|
10662
11038
|
popModal();
|
|
10663
11039
|
reset();
|
|
10664
11040
|
}, [reset]);
|
|
10665
|
-
return jsxRuntimeExports.jsxs(kit.modal, {
|
|
11041
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.modal, {
|
|
10666
11042
|
className: EditFieldModalStyle,
|
|
10667
11043
|
title: title || i18n2.t("dovetail.edit"),
|
|
10668
11044
|
confirmLoading: submitting,
|
|
@@ -10670,7 +11046,7 @@ function EditFieldModal(props) {
|
|
|
10670
11046
|
onCancel: close,
|
|
10671
11047
|
normal: true,
|
|
10672
11048
|
destroyOnClose: true,
|
|
10673
|
-
children: [renderContent(), jsxRuntimeExports.jsx(FormErrorAlert, {
|
|
11049
|
+
children: [renderContent(), /* @__PURE__ */ jsxRuntimeExports.jsx(FormErrorAlert, {
|
|
10674
11050
|
style: {
|
|
10675
11051
|
marginTop: 16
|
|
10676
11052
|
},
|
|
@@ -10686,7 +11062,7 @@ function EditField(props) {
|
|
|
10686
11062
|
const {
|
|
10687
11063
|
i18n: i18n2
|
|
10688
11064
|
} = useTranslation();
|
|
10689
|
-
return jsxRuntimeExports.jsx(kit.button, {
|
|
11065
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
10690
11066
|
className: EditButtonStyle,
|
|
10691
11067
|
type: "link",
|
|
10692
11068
|
onClick: () => {
|
|
@@ -10717,17 +11093,30 @@ const WorkloadReplicasForm = React__default.forwardRef(function WorkloadReplicas
|
|
|
10717
11093
|
useImperativeHandle(ref, () => ({
|
|
10718
11094
|
submit
|
|
10719
11095
|
}), [submit]);
|
|
10720
|
-
return
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
11096
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11097
|
+
kit.form.Item,
|
|
11098
|
+
{
|
|
11099
|
+
label: label2,
|
|
11100
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11101
|
+
kit.fields.Integer,
|
|
11102
|
+
{
|
|
11103
|
+
input: {
|
|
11104
|
+
name: "replicas",
|
|
11105
|
+
value: replicas2,
|
|
11106
|
+
onChange: (value) => {
|
|
11107
|
+
setReplicas(Number(value));
|
|
11108
|
+
},
|
|
11109
|
+
onBlur: () => {
|
|
11110
|
+
},
|
|
11111
|
+
onFocus: () => {
|
|
11112
|
+
}
|
|
11113
|
+
},
|
|
11114
|
+
meta: {},
|
|
11115
|
+
controls: true
|
|
11116
|
+
}
|
|
11117
|
+
)
|
|
10729
11118
|
}
|
|
10730
|
-
|
|
11119
|
+
);
|
|
10731
11120
|
});
|
|
10732
11121
|
function WorkloadReplicas({ record, label: label2, editable }) {
|
|
10733
11122
|
const formRef = useRef(null);
|
|
@@ -10735,12 +11124,30 @@ function WorkloadReplicas({ record, label: label2, editable }) {
|
|
|
10735
11124
|
const replicas2 = record.spec && "replicas" in record.spec ? record.spec.replicas : 0;
|
|
10736
11125
|
const canScale = record.kind === "Deployment" || record.kind === "StatefulSet";
|
|
10737
11126
|
const currentReplicas = get(record, "spec.replicas", 0);
|
|
10738
|
-
return jsxRuntimeExports.jsxs("span", { children: [
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
11127
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
11128
|
+
readyReplicas,
|
|
11129
|
+
"/",
|
|
11130
|
+
replicas2,
|
|
11131
|
+
editable && canScale && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11132
|
+
EditField,
|
|
11133
|
+
{
|
|
11134
|
+
modalProps: {
|
|
11135
|
+
formRef,
|
|
11136
|
+
renderContent() {
|
|
11137
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11138
|
+
WorkloadReplicasForm,
|
|
11139
|
+
{
|
|
11140
|
+
ref: formRef,
|
|
11141
|
+
defaultValue: currentReplicas,
|
|
11142
|
+
record,
|
|
11143
|
+
label: label2 || ""
|
|
11144
|
+
}
|
|
11145
|
+
);
|
|
11146
|
+
}
|
|
11147
|
+
}
|
|
11148
|
+
}
|
|
11149
|
+
)
|
|
11150
|
+
] });
|
|
10744
11151
|
}
|
|
10745
11152
|
const ImageField = (i18n2) => {
|
|
10746
11153
|
return {
|
|
@@ -10749,7 +11156,7 @@ const ImageField = (i18n2) => {
|
|
|
10749
11156
|
path: ["imageNames"],
|
|
10750
11157
|
col: 12,
|
|
10751
11158
|
renderContent(value) {
|
|
10752
|
-
return jsxRuntimeExports.jsx(ImageNames, { value });
|
|
11159
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ImageNames, { value });
|
|
10753
11160
|
}
|
|
10754
11161
|
};
|
|
10755
11162
|
};
|
|
@@ -10759,7 +11166,7 @@ const ReplicaField = (i18n2) => {
|
|
|
10759
11166
|
title: i18n2.t("dovetail.replicas"),
|
|
10760
11167
|
path: ["status", "replicas"],
|
|
10761
11168
|
renderContent: (_, record, field) => {
|
|
10762
|
-
return jsxRuntimeExports.jsx(WorkloadReplicas, { record, label: field.title, editable: true });
|
|
11169
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WorkloadReplicas, { record, label: field.title, editable: true });
|
|
10763
11170
|
}
|
|
10764
11171
|
};
|
|
10765
11172
|
};
|
|
@@ -10769,7 +11176,7 @@ const ConditionsField = (i18n2) => {
|
|
|
10769
11176
|
title: i18n2.t("dovetail.condition"),
|
|
10770
11177
|
path: ["status", "conditions"],
|
|
10771
11178
|
renderContent: (value) => {
|
|
10772
|
-
return jsxRuntimeExports.jsx(ConditionsTable, { conditions: value });
|
|
11179
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ConditionsTable, { conditions: value });
|
|
10773
11180
|
}
|
|
10774
11181
|
};
|
|
10775
11182
|
};
|
|
@@ -10780,9 +11187,15 @@ const PodsField = () => {
|
|
|
10780
11187
|
path: [],
|
|
10781
11188
|
renderContent: (_, record) => {
|
|
10782
11189
|
var _a, _b;
|
|
10783
|
-
return
|
|
10784
|
-
|
|
10785
|
-
|
|
11190
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11191
|
+
WorkloadPodsTable,
|
|
11192
|
+
{
|
|
11193
|
+
selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r) => {
|
|
11194
|
+
return r.kind === "Pod" && r.type === "creates";
|
|
11195
|
+
})) == null ? void 0 : _b.selector,
|
|
11196
|
+
hideToolbar: true
|
|
11197
|
+
}
|
|
11198
|
+
);
|
|
10786
11199
|
}
|
|
10787
11200
|
};
|
|
10788
11201
|
};
|
|
@@ -10793,13 +11206,18 @@ const JobsField = () => {
|
|
|
10793
11206
|
path: [],
|
|
10794
11207
|
renderContent: (_, record) => {
|
|
10795
11208
|
var _a, _b, _c;
|
|
10796
|
-
return jsxRuntimeExports.jsx(
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
11209
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11210
|
+
CronjobJobsTable,
|
|
11211
|
+
{
|
|
11212
|
+
owner: {
|
|
11213
|
+
apiVersion: record.apiVersion || "",
|
|
11214
|
+
kind: record.kind || "",
|
|
11215
|
+
name: ((_a = record.metadata) == null ? void 0 : _a.name) || "",
|
|
11216
|
+
namespace: ((_b = record.metadata) == null ? void 0 : _b.namespace) || "",
|
|
11217
|
+
uid: ((_c = record.metadata) == null ? void 0 : _c.uid) || ""
|
|
11218
|
+
}
|
|
11219
|
+
}
|
|
11220
|
+
);
|
|
10803
11221
|
}
|
|
10804
11222
|
};
|
|
10805
11223
|
};
|
|
@@ -10809,7 +11227,7 @@ const DataField = (i18n2) => {
|
|
|
10809
11227
|
title: i18n2.t("dovetail.data"),
|
|
10810
11228
|
path: ["data"],
|
|
10811
11229
|
renderContent: (val) => {
|
|
10812
|
-
return jsxRuntimeExports.jsx(KeyValue, { value: val });
|
|
11230
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValue, { value: val });
|
|
10813
11231
|
}
|
|
10814
11232
|
};
|
|
10815
11233
|
};
|
|
@@ -10823,7 +11241,7 @@ const SecretDataField = (i18n2) => {
|
|
|
10823
11241
|
for (const key in val) {
|
|
10824
11242
|
decodeVal[key] = atob(val[key]);
|
|
10825
11243
|
}
|
|
10826
|
-
return jsxRuntimeExports.jsx(KeyValue, { value: decodeVal });
|
|
11244
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValue, { value: decodeVal });
|
|
10827
11245
|
}
|
|
10828
11246
|
};
|
|
10829
11247
|
};
|
|
@@ -10834,7 +11252,7 @@ const StartTimeField = (i18n2) => {
|
|
|
10834
11252
|
path: ["status", "startTime"],
|
|
10835
11253
|
col: 12,
|
|
10836
11254
|
renderContent(value) {
|
|
10837
|
-
return jsxRuntimeExports.jsx(Time, { date: value });
|
|
11255
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: value });
|
|
10838
11256
|
}
|
|
10839
11257
|
};
|
|
10840
11258
|
};
|
|
@@ -10866,9 +11284,14 @@ const ServicePodsField = () => {
|
|
|
10866
11284
|
path: [],
|
|
10867
11285
|
renderContent: (_, record) => {
|
|
10868
11286
|
var _a, _b;
|
|
10869
|
-
return
|
|
10870
|
-
|
|
10871
|
-
|
|
11287
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11288
|
+
WorkloadPodsTable,
|
|
11289
|
+
{
|
|
11290
|
+
selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r) => {
|
|
11291
|
+
return r.kind === "Pod" && r.type === "selects";
|
|
11292
|
+
})) == null ? void 0 : _b.selector
|
|
11293
|
+
}
|
|
11294
|
+
);
|
|
10872
11295
|
}
|
|
10873
11296
|
};
|
|
10874
11297
|
};
|
|
@@ -10878,7 +11301,7 @@ const IngressRulesTableTabField = (i18n2) => {
|
|
|
10878
11301
|
title: i18n2.t("dovetail.rule"),
|
|
10879
11302
|
path: ["spec", "rules"],
|
|
10880
11303
|
renderContent: (_, record) => {
|
|
10881
|
-
return jsxRuntimeExports.jsx(IngressRulesTable, { ingress: record });
|
|
11304
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IngressRulesTable, { ingress: record });
|
|
10882
11305
|
}
|
|
10883
11306
|
};
|
|
10884
11307
|
};
|
|
@@ -10888,13 +11311,16 @@ const EventsTableTabField = (i18n2) => {
|
|
|
10888
11311
|
title: i18n2.t("dovetail.event"),
|
|
10889
11312
|
path: [],
|
|
10890
11313
|
renderContent: () => {
|
|
10891
|
-
return jsxRuntimeExports.jsx(EventsTable, {});
|
|
11314
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(EventsTable, {});
|
|
10892
11315
|
}
|
|
10893
11316
|
};
|
|
10894
11317
|
};
|
|
10895
11318
|
function download(filename, content) {
|
|
10896
11319
|
const element = document.createElement("a");
|
|
10897
|
-
element.setAttribute(
|
|
11320
|
+
element.setAttribute(
|
|
11321
|
+
"href",
|
|
11322
|
+
"data:text/plain;charset=utf-8," + encodeURIComponent(content)
|
|
11323
|
+
);
|
|
10898
11324
|
element.setAttribute("download", filename);
|
|
10899
11325
|
element.style.display = "none";
|
|
10900
11326
|
document.body.appendChild(element);
|
|
@@ -10915,29 +11341,64 @@ function K8sDropdown(props) {
|
|
|
10915
11341
|
const { globalStore } = useGlobalStore();
|
|
10916
11342
|
const useResourceResult = useResource();
|
|
10917
11343
|
const resource = useResourceResult.resource;
|
|
10918
|
-
const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
|
|
11344
|
+
const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
|
|
11345
|
+
(resource == null ? void 0 : resource.name) || ""
|
|
11346
|
+
);
|
|
10919
11347
|
const download2 = useDownloadYAML();
|
|
10920
11348
|
const { t } = useTranslation();
|
|
10921
11349
|
const openForm = useOpenForm({ id: record.id });
|
|
10922
|
-
return
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
11350
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
11351
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11352
|
+
kit.dropdown,
|
|
11353
|
+
{
|
|
11354
|
+
overlay: /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.menu, { children: [
|
|
11355
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11356
|
+
kit.menuItem,
|
|
11357
|
+
{
|
|
11358
|
+
onClick: openForm,
|
|
11359
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: EditPen16PrimaryIcon, children: t("dovetail.edit") })
|
|
11360
|
+
}
|
|
11361
|
+
),
|
|
11362
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11363
|
+
kit.menuItem,
|
|
11364
|
+
{
|
|
11365
|
+
danger: true,
|
|
11366
|
+
onClick: () => {
|
|
11367
|
+
openDeleteConfirmModal(record.id);
|
|
11368
|
+
},
|
|
11369
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: TrashBinDelete16Icon, children: t("dovetail.delete") })
|
|
11370
|
+
}
|
|
11371
|
+
),
|
|
11372
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11373
|
+
kit.menu.Item,
|
|
11374
|
+
{
|
|
11375
|
+
onClick: () => {
|
|
11376
|
+
var _a;
|
|
11377
|
+
if (record.id) {
|
|
11378
|
+
download2({
|
|
11379
|
+
name: ((_a = record.metadata) == null ? void 0 : _a.name) || record.kind || "",
|
|
11380
|
+
item: (globalStore == null ? void 0 : globalStore.restoreItem(record)) || record
|
|
11381
|
+
});
|
|
11382
|
+
}
|
|
11383
|
+
},
|
|
11384
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: Download16GradientBlueIcon, children: t("dovetail.download_yaml") })
|
|
11385
|
+
}
|
|
11386
|
+
),
|
|
11387
|
+
props.children
|
|
11388
|
+
] }),
|
|
11389
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "tertiary", size: "small", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: MoreEllipsis316BoldBlueIcon }) })
|
|
11390
|
+
}
|
|
11391
|
+
),
|
|
11392
|
+
visible ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.modal, { ...modalProps }) : null
|
|
11393
|
+
] });
|
|
10933
11394
|
}
|
|
10934
|
-
const
|
|
10935
|
-
const WrapperStyle$1 = "
|
|
10936
|
-
const HeaderStyle$1 = "
|
|
10937
|
-
const HeaderItemStyle = "
|
|
10938
|
-
const ExpandButtonStyle = "
|
|
10939
|
-
const ContentBlockStyle = "
|
|
10940
|
-
const KeyStyle = "
|
|
11395
|
+
const index_1j8sdg6 = "";
|
|
11396
|
+
const WrapperStyle$1 = "woio6qj";
|
|
11397
|
+
const HeaderStyle$1 = "h1pmxp8z";
|
|
11398
|
+
const HeaderItemStyle = "h1btthoz";
|
|
11399
|
+
const ExpandButtonStyle = "ewkumn1";
|
|
11400
|
+
const ContentBlockStyle = "c1in0x5n";
|
|
11401
|
+
const KeyStyle = "klhq5sj";
|
|
10941
11402
|
function KeyValueData(props) {
|
|
10942
11403
|
const {
|
|
10943
11404
|
datas,
|
|
@@ -10948,14 +11409,14 @@ function KeyValueData(props) {
|
|
|
10948
11409
|
const {
|
|
10949
11410
|
t
|
|
10950
11411
|
} = useTranslation();
|
|
10951
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
11412
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
10952
11413
|
className: WrapperStyle$1,
|
|
10953
|
-
children: [jsxRuntimeExports.jsxs("div", {
|
|
11414
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
10954
11415
|
className: HeaderStyle$1,
|
|
10955
|
-
children: [jsxRuntimeExports.jsx("span", {
|
|
11416
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
10956
11417
|
className: HeaderItemStyle,
|
|
10957
11418
|
children: Object.keys(datas).length
|
|
10958
|
-
}), jsxRuntimeExports.jsx(kit.button, {
|
|
11419
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
10959
11420
|
type: "link",
|
|
10960
11421
|
className: ExpandButtonStyle,
|
|
10961
11422
|
onClick: () => {
|
|
@@ -10963,12 +11424,12 @@ function KeyValueData(props) {
|
|
|
10963
11424
|
},
|
|
10964
11425
|
children: isExpand ? t("dovetail.fold") : t("dovetail.expand")
|
|
10965
11426
|
})]
|
|
10966
|
-
}), isExpand ? Object.keys(datas).map((key) => jsxRuntimeExports.jsxs("div", {
|
|
11427
|
+
}), isExpand ? Object.keys(datas).map((key) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
10967
11428
|
className: ContentBlockStyle,
|
|
10968
|
-
children: [jsxRuntimeExports.jsx("span", {
|
|
11429
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
10969
11430
|
className: cx_default(KeyStyle, Typo.Label.l4_regular),
|
|
10970
11431
|
children: key
|
|
10971
|
-
}), jsxRuntimeExports.jsx("span", {
|
|
11432
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
10972
11433
|
className: Typo.Label.l4_regular,
|
|
10973
11434
|
children: datas[key]
|
|
10974
11435
|
})]
|
|
@@ -10979,7 +11440,19 @@ const schemaMap = /* @__PURE__ */ new Map();
|
|
|
10979
11440
|
const MonacoYamlEditor = (props) => {
|
|
10980
11441
|
const ref = useRef(null);
|
|
10981
11442
|
const instanceRef = useRef({ editor: null });
|
|
10982
|
-
const {
|
|
11443
|
+
const {
|
|
11444
|
+
defaultValue,
|
|
11445
|
+
id,
|
|
11446
|
+
height,
|
|
11447
|
+
readOnly,
|
|
11448
|
+
schema,
|
|
11449
|
+
isScrollOnFocus,
|
|
11450
|
+
onChange,
|
|
11451
|
+
onValidate,
|
|
11452
|
+
getInstance,
|
|
11453
|
+
onEditorCreate,
|
|
11454
|
+
onBlur
|
|
11455
|
+
} = props;
|
|
10983
11456
|
const uri = id ? monaco.Uri.parse(`${id}.yaml`) : void 0;
|
|
10984
11457
|
useEffect(() => {
|
|
10985
11458
|
if (schema) {
|
|
@@ -11099,17 +11572,23 @@ const MonacoYamlEditor = (props) => {
|
|
|
11099
11572
|
stops.forEach((stop) => stop.dispose());
|
|
11100
11573
|
};
|
|
11101
11574
|
}, [instanceRef.current.editor, isScrollOnFocus]);
|
|
11102
|
-
return jsxRuntimeExports.jsx(
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11575
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11576
|
+
"div",
|
|
11577
|
+
{
|
|
11578
|
+
ref,
|
|
11579
|
+
className: cx_default(YamlEditorStyle, props.className),
|
|
11580
|
+
style: {
|
|
11581
|
+
width: "100%",
|
|
11582
|
+
height: height || "500px"
|
|
11583
|
+
}
|
|
11584
|
+
}
|
|
11585
|
+
);
|
|
11106
11586
|
};
|
|
11107
11587
|
const MonacoYamlEditor$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11108
11588
|
__proto__: null,
|
|
11109
11589
|
default: MonacoYamlEditor
|
|
11110
11590
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11111
|
-
var WorkloadState
|
|
11112
|
-
(function(WorkloadState2) {
|
|
11591
|
+
var WorkloadState = /* @__PURE__ */ ((WorkloadState2) => {
|
|
11113
11592
|
WorkloadState2["UPDATEING"] = "updating";
|
|
11114
11593
|
WorkloadState2["READY"] = "ready";
|
|
11115
11594
|
WorkloadState2["COMPLETED"] = "completed";
|
|
@@ -11121,7 +11600,8 @@ var WorkloadState;
|
|
|
11121
11600
|
WorkloadState2["TERMINATING"] = "terminating";
|
|
11122
11601
|
WorkloadState2["PENDING"] = "pending";
|
|
11123
11602
|
WorkloadState2["WAITING"] = "waiting";
|
|
11124
|
-
|
|
11603
|
+
return WorkloadState2;
|
|
11604
|
+
})(WorkloadState || {});
|
|
11125
11605
|
const StateTag = ({ state: state2 = WorkloadState.UPDATEING, className }) => {
|
|
11126
11606
|
const kit = useUIKit();
|
|
11127
11607
|
const { t } = useTranslation();
|
|
@@ -11138,23 +11618,23 @@ const StateTag = ({ state: state2 = WorkloadState.UPDATEING, className }) => {
|
|
|
11138
11618
|
pending: "gray",
|
|
11139
11619
|
waiting: "gray"
|
|
11140
11620
|
};
|
|
11141
|
-
return jsxRuntimeExports.jsx(kit.tag, { className, color: colorMap[state2], children: t(`dovetail.${state2 || "updaing"}`) });
|
|
11621
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tag, { className, color: colorMap[state2], children: t(`dovetail.${state2 || "updaing"}`) });
|
|
11142
11622
|
};
|
|
11143
|
-
const
|
|
11144
|
-
const TagWrapper = "
|
|
11145
|
-
const TagStyle = "
|
|
11623
|
+
const index_1l7lkk4 = "";
|
|
11624
|
+
const TagWrapper = "t13a6vox";
|
|
11625
|
+
const TagStyle = "t12ikbmp";
|
|
11146
11626
|
const Tags = (props) => {
|
|
11147
11627
|
const {
|
|
11148
11628
|
value
|
|
11149
11629
|
} = props;
|
|
11150
11630
|
const kit = useUIKit();
|
|
11151
11631
|
if (!value) {
|
|
11152
|
-
return jsxRuntimeExports.jsx("span", {
|
|
11632
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11153
11633
|
children: "-"
|
|
11154
11634
|
});
|
|
11155
11635
|
}
|
|
11156
11636
|
const tags = Object.keys(value).map((key) => {
|
|
11157
|
-
return jsxRuntimeExports.jsx(kit.tag.SplitTag, {
|
|
11637
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tag.SplitTag, {
|
|
11158
11638
|
className: TagStyle,
|
|
11159
11639
|
primaryContent: key,
|
|
11160
11640
|
secondaryContent: value[key],
|
|
@@ -11162,25 +11642,20 @@ const Tags = (props) => {
|
|
|
11162
11642
|
color: "gray"
|
|
11163
11643
|
}, key);
|
|
11164
11644
|
});
|
|
11165
|
-
return jsxRuntimeExports.jsx(kit.space, {
|
|
11645
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.space, {
|
|
11166
11646
|
className: TagWrapper,
|
|
11167
11647
|
size: 8,
|
|
11168
11648
|
children: tags
|
|
11169
11649
|
});
|
|
11170
11650
|
};
|
|
11171
|
-
const
|
|
11172
|
-
const ShowContentWrapperStyle = "
|
|
11173
|
-
const TopBarStyle = "
|
|
11174
|
-
const ShowContentHeaderStyle = "
|
|
11175
|
-
const EditorStyle = "
|
|
11176
|
-
const FieldWrapperStyle = "
|
|
11177
|
-
const TabsStyle = "
|
|
11178
|
-
const StateTagStyle = "
|
|
11179
|
-
var Mode;
|
|
11180
|
-
(function(Mode2) {
|
|
11181
|
-
Mode2["Detail"] = "detail";
|
|
11182
|
-
Mode2["Yaml"] = "yaml";
|
|
11183
|
-
})(Mode || (Mode = {}));
|
|
11651
|
+
const ShowContent_rmo7c5 = "";
|
|
11652
|
+
const ShowContentWrapperStyle = "s9agep2";
|
|
11653
|
+
const TopBarStyle = "to89gfi";
|
|
11654
|
+
const ShowContentHeaderStyle = "s1ohe42f";
|
|
11655
|
+
const EditorStyle = "eqm4qz0";
|
|
11656
|
+
const FieldWrapperStyle = "ficl0qc";
|
|
11657
|
+
const TabsStyle = "to9uwk1";
|
|
11658
|
+
const StateTagStyle = "se26ou0";
|
|
11184
11659
|
const ShowContent = (props) => {
|
|
11185
11660
|
var _a, _b, _c;
|
|
11186
11661
|
const {
|
|
@@ -11196,12 +11671,15 @@ const ShowContent = (props) => {
|
|
|
11196
11671
|
const {
|
|
11197
11672
|
resource
|
|
11198
11673
|
} = useResource();
|
|
11199
|
-
const [mode, setMode] = useState(
|
|
11674
|
+
const [mode, setMode] = useState(
|
|
11675
|
+
"detail"
|
|
11676
|
+
/* Detail */
|
|
11677
|
+
);
|
|
11200
11678
|
const {
|
|
11201
11679
|
queryResult
|
|
11202
11680
|
} = useShow({
|
|
11203
11681
|
id: (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id,
|
|
11204
|
-
liveMode: mode ===
|
|
11682
|
+
liveMode: mode === "yaml" ? "off" : "auto"
|
|
11205
11683
|
});
|
|
11206
11684
|
const {
|
|
11207
11685
|
t
|
|
@@ -11231,15 +11709,15 @@ const ShowContent = (props) => {
|
|
|
11231
11709
|
if (field.renderContent) {
|
|
11232
11710
|
content = field.renderContent(value, record, field);
|
|
11233
11711
|
} else {
|
|
11234
|
-
content = jsxRuntimeExports.jsx("span", {
|
|
11712
|
+
content = /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11235
11713
|
children: get(record, field.path)
|
|
11236
11714
|
});
|
|
11237
11715
|
}
|
|
11238
|
-
return jsxRuntimeExports.jsx(kit.col, {
|
|
11716
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.col, {
|
|
11239
11717
|
span: field.col,
|
|
11240
|
-
children: field.render ? field.render(value, record, field) : jsxRuntimeExports.jsxs("div", {
|
|
11718
|
+
children: field.render ? field.render(value, record, field) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11241
11719
|
className: FieldWrapperStyle,
|
|
11242
|
-
children: [jsxRuntimeExports.jsxs("span", {
|
|
11720
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
11243
11721
|
className: Typo.Label.l3_regular,
|
|
11244
11722
|
style: {
|
|
11245
11723
|
width: field.labelWidth || "64px"
|
|
@@ -11259,7 +11737,7 @@ const ShowContent = (props) => {
|
|
|
11259
11737
|
title: t("dovetail.created_time"),
|
|
11260
11738
|
path: ["metadata", "creationTimestamp"],
|
|
11261
11739
|
renderContent(value) {
|
|
11262
|
-
return jsxRuntimeExports.jsx(Time, {
|
|
11740
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, {
|
|
11263
11741
|
date: new Date(value)
|
|
11264
11742
|
});
|
|
11265
11743
|
}
|
|
@@ -11273,7 +11751,7 @@ const ShowContent = (props) => {
|
|
|
11273
11751
|
if (!value) {
|
|
11274
11752
|
return void 0;
|
|
11275
11753
|
}
|
|
11276
|
-
return jsxRuntimeExports.jsx(Tags, {
|
|
11754
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tags, {
|
|
11277
11755
|
value
|
|
11278
11756
|
});
|
|
11279
11757
|
}
|
|
@@ -11286,74 +11764,80 @@ const ShowContent = (props) => {
|
|
|
11286
11764
|
if (!value) {
|
|
11287
11765
|
return void 0;
|
|
11288
11766
|
}
|
|
11289
|
-
return jsxRuntimeExports.jsx(KeyValueData, {
|
|
11767
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueData, {
|
|
11290
11768
|
datas: value,
|
|
11291
11769
|
expandable: true
|
|
11292
11770
|
});
|
|
11293
11771
|
}
|
|
11294
11772
|
}];
|
|
11295
11773
|
const stateDisplay = get(record, "stateDisplay");
|
|
11296
|
-
const topBar = jsxRuntimeExports.jsxs(kit.space, {
|
|
11774
|
+
const topBar = /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
11297
11775
|
className: TopBarStyle,
|
|
11298
|
-
children: [jsxRuntimeExports.jsxs("div", {
|
|
11299
|
-
children: [jsxRuntimeExports.jsxs("span", {
|
|
11776
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11777
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
11300
11778
|
className: Typo.Display.d2_bold_title,
|
|
11301
11779
|
children: [(_b = resource == null ? void 0 : resource.meta) == null ? void 0 : _b.kind, ": "]
|
|
11302
|
-
}), jsxRuntimeExports.jsx("span", {
|
|
11780
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11303
11781
|
className: Typo.Label.l1_regular,
|
|
11304
11782
|
children: (_c = record == null ? void 0 : record.metadata) == null ? void 0 : _c.name
|
|
11305
|
-
}), stateDisplay ? jsxRuntimeExports.jsx(StateTag, {
|
|
11783
|
+
}), stateDisplay ? /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, {
|
|
11306
11784
|
className: StateTagStyle,
|
|
11307
11785
|
state: stateDisplay
|
|
11308
11786
|
}) : void 0]
|
|
11309
|
-
}), jsxRuntimeExports.jsxs(kit.space, {
|
|
11310
|
-
children: [jsxRuntimeExports.jsxs(kit.radioGroup, {
|
|
11787
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
11788
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.radioGroup, {
|
|
11311
11789
|
value: mode,
|
|
11312
11790
|
onChange: (e) => setMode(e.target.value),
|
|
11313
|
-
children: [jsxRuntimeExports.jsx(kit.radioButton, {
|
|
11791
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.radioButton, {
|
|
11314
11792
|
value: "detail",
|
|
11315
11793
|
children: t("dovetail.detail")
|
|
11316
|
-
}), jsxRuntimeExports.jsx(kit.radioButton, {
|
|
11794
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.radioButton, {
|
|
11317
11795
|
value: "yaml",
|
|
11318
11796
|
children: "YAML"
|
|
11319
11797
|
})]
|
|
11320
|
-
}), jsxRuntimeExports.jsx(Dropdown, {
|
|
11798
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Dropdown, {
|
|
11321
11799
|
record
|
|
11322
11800
|
})]
|
|
11323
11801
|
})]
|
|
11324
11802
|
});
|
|
11325
|
-
const descriptions = jsxRuntimeExports.jsx(kit.row, {
|
|
11803
|
+
const descriptions = /* @__PURE__ */ jsxRuntimeExports.jsx(kit.row, {
|
|
11326
11804
|
gutter: 24,
|
|
11327
11805
|
children: renderFields([...DESCRIPTION_DEFAULT_FIELDS, ...showConfig.descriptions || []])
|
|
11328
11806
|
});
|
|
11329
11807
|
const groups = (showConfig.groups || []).concat([{
|
|
11330
11808
|
fields: LABELS_ANNOTATIONS_GROUP_FIELDS
|
|
11331
|
-
}]).map((group, index) => jsxRuntimeExports.jsx(kit.row, {
|
|
11809
|
+
}]).map((group, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(kit.row, {
|
|
11332
11810
|
gutter: [24, 16],
|
|
11333
11811
|
children: renderFields(group.fields)
|
|
11334
11812
|
}, index));
|
|
11335
|
-
const tabs = jsxRuntimeExports.jsx(kit.tabs, {
|
|
11813
|
+
const tabs = /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tabs, {
|
|
11336
11814
|
className: TabsStyle,
|
|
11337
11815
|
children: (showConfig.tabs || []).map((field) => {
|
|
11338
11816
|
let content;
|
|
11339
11817
|
if (field.renderContent) {
|
|
11340
11818
|
content = field.renderContent(get(record, field.path), record, field);
|
|
11341
11819
|
} else {
|
|
11342
|
-
content = jsxRuntimeExports.jsx("span", {
|
|
11820
|
+
content = /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11343
11821
|
children: get(record, field.path)
|
|
11344
11822
|
});
|
|
11345
11823
|
}
|
|
11346
|
-
return jsxRuntimeExports.jsx(kit.tabsTabPane, {
|
|
11824
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.tabsTabPane, {
|
|
11347
11825
|
tab: field.title,
|
|
11348
11826
|
children: content
|
|
11349
11827
|
}, field.key);
|
|
11350
11828
|
})
|
|
11351
11829
|
});
|
|
11352
11830
|
const modeMap = {
|
|
11353
|
-
[
|
|
11354
|
-
|
|
11831
|
+
[
|
|
11832
|
+
"detail"
|
|
11833
|
+
/* Detail */
|
|
11834
|
+
]: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
11835
|
+
children: [groups, /* @__PURE__ */ jsxRuntimeExports.jsx(kit.divider, {}), tabs]
|
|
11355
11836
|
}),
|
|
11356
|
-
[
|
|
11837
|
+
[
|
|
11838
|
+
"yaml"
|
|
11839
|
+
/* Yaml */
|
|
11840
|
+
]: /* @__PURE__ */ jsxRuntimeExports.jsx(MonacoYamlEditor, {
|
|
11357
11841
|
className: EditorStyle,
|
|
11358
11842
|
defaultValue: defaultEditorValue,
|
|
11359
11843
|
schema,
|
|
@@ -11361,13 +11845,13 @@ const ShowContent = (props) => {
|
|
|
11361
11845
|
readOnly: true
|
|
11362
11846
|
})
|
|
11363
11847
|
};
|
|
11364
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
11848
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11365
11849
|
className: ShowContentWrapperStyle,
|
|
11366
|
-
children: [jsxRuntimeExports.jsxs(kit.space, {
|
|
11850
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
|
|
11367
11851
|
direction: "vertical",
|
|
11368
11852
|
className: ShowContentHeaderStyle,
|
|
11369
11853
|
children: [topBar, descriptions]
|
|
11370
|
-
}), jsxRuntimeExports.jsx(kit.divider, {}), modeMap[mode]]
|
|
11854
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.divider, {}), modeMap[mode]]
|
|
11371
11855
|
});
|
|
11372
11856
|
};
|
|
11373
11857
|
const PageShow = (props) => {
|
|
@@ -11376,76 +11860,101 @@ const PageShow = (props) => {
|
|
|
11376
11860
|
const parsed = useParsed();
|
|
11377
11861
|
const { queryResult } = useShow({ id: (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id });
|
|
11378
11862
|
const { isLoading } = queryResult;
|
|
11379
|
-
return isLoading ? jsxRuntimeExports.jsx(kit.loading, {}) : jsxRuntimeExports.jsx(ShowContent, { ...props });
|
|
11863
|
+
return isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.loading, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(ShowContent, { ...props });
|
|
11380
11864
|
};
|
|
11381
|
-
const PodContainersTable = ({
|
|
11865
|
+
const PodContainersTable = ({
|
|
11866
|
+
containerStatuses,
|
|
11867
|
+
initContainerStatuses
|
|
11868
|
+
}) => {
|
|
11382
11869
|
const kit = useUIKit();
|
|
11383
11870
|
const { i18n: i18n2 } = useTranslation();
|
|
11384
|
-
const columns = useMemo(
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11871
|
+
const columns = useMemo(
|
|
11872
|
+
() => [
|
|
11873
|
+
{
|
|
11874
|
+
key: "state",
|
|
11875
|
+
dataIndex: ["state"],
|
|
11876
|
+
title: i18n2.t("dovetail.state"),
|
|
11877
|
+
sortable: true,
|
|
11878
|
+
sorter: CommonSorter(["state"]),
|
|
11879
|
+
render: (v) => /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, { state: Object.keys(v)[0] })
|
|
11880
|
+
},
|
|
11881
|
+
{
|
|
11882
|
+
key: "ready",
|
|
11883
|
+
dataIndex: ["ready"],
|
|
11884
|
+
title: i18n2.t("dovetail.ready"),
|
|
11885
|
+
sortable: true,
|
|
11886
|
+
sorter: CommonSorter(["ready"]),
|
|
11887
|
+
render: (v) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11888
|
+
Icon$1,
|
|
11889
|
+
{
|
|
11890
|
+
src: v ? CheckmarkDoneSuccessCorrect16BoldGreenIcon : XmarkFailed16BoldRedIcon
|
|
11891
|
+
}
|
|
11892
|
+
)
|
|
11893
|
+
},
|
|
11894
|
+
{
|
|
11895
|
+
key: "name",
|
|
11896
|
+
dataIndex: ["name"],
|
|
11897
|
+
title: i18n2.t("dovetail.name"),
|
|
11898
|
+
sortable: true,
|
|
11899
|
+
sorter: CommonSorter(["name"])
|
|
11900
|
+
},
|
|
11901
|
+
{
|
|
11902
|
+
key: "image",
|
|
11903
|
+
dataIndex: ["image"],
|
|
11904
|
+
title: i18n2.t("dovetail.image"),
|
|
11905
|
+
sortable: true,
|
|
11906
|
+
sorter: CommonSorter(["image"])
|
|
11907
|
+
},
|
|
11908
|
+
{
|
|
11909
|
+
key: "init",
|
|
11910
|
+
dataIndex: [],
|
|
11911
|
+
title: i18n2.t("dovetail.init_container"),
|
|
11912
|
+
render: (_, record) => {
|
|
11913
|
+
const isInit = initContainerStatuses.some(
|
|
11914
|
+
(c) => c.containerID === record.containerID
|
|
11915
|
+
);
|
|
11916
|
+
if (isInit) {
|
|
11917
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: CheckmarkDoneSuccessCorrect16BoldGreenIcon });
|
|
11918
|
+
}
|
|
11919
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "-" });
|
|
11920
|
+
}
|
|
11921
|
+
},
|
|
11922
|
+
{
|
|
11923
|
+
key: "restartCount",
|
|
11924
|
+
dataIndex: ["restartCount"],
|
|
11925
|
+
title: i18n2.t("dovetail.restarts"),
|
|
11926
|
+
sortable: true,
|
|
11927
|
+
sorter: CommonSorter(["restartCount"])
|
|
11928
|
+
},
|
|
11929
|
+
{
|
|
11930
|
+
key: "started",
|
|
11931
|
+
dataIndex: ["state", "running", "startedAt"],
|
|
11932
|
+
title: i18n2.t("dovetail.started"),
|
|
11933
|
+
sortable: true,
|
|
11934
|
+
sorter: CommonSorter(["state", "running", "startedAt"]),
|
|
11935
|
+
render: (value) => {
|
|
11936
|
+
if (value)
|
|
11937
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: new Date(value) });
|
|
11938
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "-" });
|
|
11423
11939
|
}
|
|
11424
|
-
return jsxRuntimeExports.jsx("span", { children: "-" });
|
|
11425
11940
|
}
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
|
|
11941
|
+
],
|
|
11942
|
+
[i18n2, initContainerStatuses]
|
|
11943
|
+
);
|
|
11944
|
+
const dataSource = useMemo(
|
|
11945
|
+
() => addId(containerStatuses.concat(initContainerStatuses), "containerID"),
|
|
11946
|
+
[containerStatuses, initContainerStatuses]
|
|
11947
|
+
);
|
|
11948
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11949
|
+
kit.table,
|
|
11434
11950
|
{
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
render: (value) => {
|
|
11441
|
-
if (value)
|
|
11442
|
-
return jsxRuntimeExports.jsx(Time, { date: new Date(value) });
|
|
11443
|
-
return jsxRuntimeExports.jsx("span", { children: "-" });
|
|
11444
|
-
}
|
|
11951
|
+
loading: false,
|
|
11952
|
+
dataSource,
|
|
11953
|
+
columns,
|
|
11954
|
+
rowKey: "containerID",
|
|
11955
|
+
error: false
|
|
11445
11956
|
}
|
|
11446
|
-
|
|
11447
|
-
const dataSource = useMemo(() => addId(containerStatuses.concat(initContainerStatuses), "containerID"), [containerStatuses, initContainerStatuses]);
|
|
11448
|
-
return jsxRuntimeExports.jsx(kit.table, { loading: false, dataSource, columns, rowKey: "containerID", error: false });
|
|
11957
|
+
);
|
|
11449
11958
|
};
|
|
11450
11959
|
function WorkloadDropdown(props) {
|
|
11451
11960
|
const { record } = props;
|
|
@@ -11453,21 +11962,27 @@ function WorkloadDropdown(props) {
|
|
|
11453
11962
|
const { resource } = useResource();
|
|
11454
11963
|
const { mutate } = useUpdate();
|
|
11455
11964
|
const { t } = useTranslation();
|
|
11456
|
-
return jsxRuntimeExports.jsx(K8sDropdown, { record, children: jsxRuntimeExports.jsx(
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11965
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(K8sDropdown, { record, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11966
|
+
kit.menu.Item,
|
|
11967
|
+
{
|
|
11968
|
+
onClick: () => {
|
|
11969
|
+
const v = record.redeploy();
|
|
11970
|
+
const id = v.id;
|
|
11971
|
+
pruneBeforeEdit(v);
|
|
11972
|
+
mutate({
|
|
11973
|
+
id,
|
|
11974
|
+
resource: (resource == null ? void 0 : resource.name) || "",
|
|
11975
|
+
values: v
|
|
11976
|
+
});
|
|
11977
|
+
},
|
|
11978
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: DynamicResourceSchedule16BlueIcon, children: t("dovetail.redeploy") })
|
|
11979
|
+
}
|
|
11980
|
+
) });
|
|
11466
11981
|
}
|
|
11467
11982
|
const ComponentContext = createContext({});
|
|
11468
|
-
const
|
|
11469
|
-
const ListPageStyle = "
|
|
11470
|
-
const TableStyle = "
|
|
11983
|
+
const index_3lw8k1 = "";
|
|
11984
|
+
const ListPageStyle = "laykzsq";
|
|
11985
|
+
const TableStyle = "t1ng0psc";
|
|
11471
11986
|
function ListPage(props) {
|
|
11472
11987
|
const {
|
|
11473
11988
|
title,
|
|
@@ -11478,12 +11993,12 @@ function ListPage(props) {
|
|
|
11478
11993
|
Table: TableComponent
|
|
11479
11994
|
} = useContext(ComponentContext);
|
|
11480
11995
|
const Table$1 = TableComponent || Table;
|
|
11481
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
11996
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11482
11997
|
className: ListPageStyle,
|
|
11483
|
-
children: [jsxRuntimeExports.jsx(TableToolBar, {
|
|
11998
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
|
|
11484
11999
|
title,
|
|
11485
12000
|
selectedKeys
|
|
11486
|
-
}), jsxRuntimeExports.jsx(Table$1, {
|
|
12001
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Table$1, {
|
|
11487
12002
|
...tableProps,
|
|
11488
12003
|
className: cx_default(tableProps.className, TableStyle),
|
|
11489
12004
|
scroll: {
|
|
@@ -11504,11 +12019,18 @@ function ResourceList(props) {
|
|
|
11504
12019
|
formatter,
|
|
11505
12020
|
Dropdown
|
|
11506
12021
|
});
|
|
11507
|
-
return jsxRuntimeExports.jsx(ListPage, { title: name2 || "", selectedKeys, tableProps });
|
|
12022
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ListPage, { title: name2 || "", selectedKeys, tableProps });
|
|
11508
12023
|
}
|
|
11509
12024
|
function ResourceShow(props) {
|
|
11510
12025
|
const { formatter, showConfig, Dropdown } = props;
|
|
11511
|
-
return jsxRuntimeExports.jsx(
|
|
12026
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12027
|
+
PageShow,
|
|
12028
|
+
{
|
|
12029
|
+
showConfig,
|
|
12030
|
+
formatter,
|
|
12031
|
+
Dropdown
|
|
12032
|
+
}
|
|
12033
|
+
);
|
|
11512
12034
|
}
|
|
11513
12035
|
function ResourceForm(props) {
|
|
11514
12036
|
const { config } = props;
|
|
@@ -11517,17 +12039,40 @@ function ResourceForm(props) {
|
|
|
11517
12039
|
initialValues: getInitialValues(config)
|
|
11518
12040
|
};
|
|
11519
12041
|
}, [config]);
|
|
11520
|
-
return jsxRuntimeExports.jsx(
|
|
12042
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12043
|
+
YamlForm,
|
|
12044
|
+
{
|
|
12045
|
+
...formProps
|
|
12046
|
+
}
|
|
12047
|
+
);
|
|
11521
12048
|
}
|
|
11522
12049
|
function ResourceCRUD(props) {
|
|
11523
12050
|
const { configs, urlPrefix } = props;
|
|
11524
|
-
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: configs.map((config) => {
|
|
12051
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: configs.map((config) => {
|
|
11525
12052
|
var _a, _b;
|
|
11526
|
-
return jsxRuntimeExports.jsxs(React__default.Fragment, { children: [
|
|
11527
|
-
jsxRuntimeExports.jsx(Route, { path: `${urlPrefix}/${config.name}`, exact: true, children:
|
|
11528
|
-
|
|
12053
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(React__default.Fragment, { children: [
|
|
12054
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: `${urlPrefix}/${config.name}`, exact: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12055
|
+
ResourceList,
|
|
12056
|
+
{
|
|
12057
|
+
name: config.kind,
|
|
12058
|
+
formatter: config.formatter,
|
|
12059
|
+
columns: ((_a = config.columns) == null ? void 0 : _a.call(config)) || [],
|
|
12060
|
+
Dropdown: config.Dropdown
|
|
12061
|
+
}
|
|
12062
|
+
) }),
|
|
12063
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: `${urlPrefix}/${config.name}/show`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12064
|
+
ResourceShow,
|
|
12065
|
+
{
|
|
12066
|
+
formatter: config.formatter,
|
|
12067
|
+
showConfig: ((_b = config.showConfig) == null ? void 0 : _b.call(config)) || {},
|
|
12068
|
+
Dropdown: config.Dropdown
|
|
12069
|
+
}
|
|
12070
|
+
) }),
|
|
11529
12071
|
// the modals would render in ModalStack
|
|
11530
|
-
config.formType === FormType.PAGE ? jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
12072
|
+
config.formType === FormType.PAGE ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
12073
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: `${urlPrefix}/${config.name}/create`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceForm, { config }) }),
|
|
12074
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: `${urlPrefix}/${config.name}/edit`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceForm, { config }) })
|
|
12075
|
+
] }) : null
|
|
11531
12076
|
] }, config.name);
|
|
11532
12077
|
}) });
|
|
11533
12078
|
}
|
|
@@ -11539,21 +12084,35 @@ function CronJobDropdown(props) {
|
|
|
11539
12084
|
const { mutate } = useUpdate();
|
|
11540
12085
|
const { t } = useTranslation();
|
|
11541
12086
|
const suspended2 = Boolean(spec == null ? void 0 : spec.suspend);
|
|
11542
|
-
return jsxRuntimeExports.jsx(K8sDropdown, { record, children: jsxRuntimeExports.jsx(
|
|
11543
|
-
|
|
11544
|
-
|
|
11545
|
-
|
|
11546
|
-
|
|
11547
|
-
|
|
11548
|
-
|
|
11549
|
-
|
|
11550
|
-
|
|
11551
|
-
|
|
12087
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(K8sDropdown, { record, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12088
|
+
kit.menu.Item,
|
|
12089
|
+
{
|
|
12090
|
+
onClick: () => {
|
|
12091
|
+
const v = suspended2 ? record.resume() : record.suspend();
|
|
12092
|
+
const id = record.id;
|
|
12093
|
+
pruneBeforeEdit(v);
|
|
12094
|
+
mutate({
|
|
12095
|
+
id,
|
|
12096
|
+
resource: (resource == null ? void 0 : resource.name) || "",
|
|
12097
|
+
values: v
|
|
12098
|
+
});
|
|
12099
|
+
},
|
|
12100
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: suspended2 ? VmResume16Icon : SuspendedPause16GradientGrayIcon, children: t(suspended2 ? "dovetail.resume" : "dovetail.suspend") })
|
|
12101
|
+
}
|
|
12102
|
+
) });
|
|
11552
12103
|
}
|
|
11553
12104
|
const UNITS = ["", "K", "M", "G", "T", "P"];
|
|
11554
12105
|
const FRACTIONAL = ["", "m", "u", "n", "p", "f"];
|
|
11555
12106
|
function formatSi(inValue, options) {
|
|
11556
|
-
const {
|
|
12107
|
+
const {
|
|
12108
|
+
increment = 1e3,
|
|
12109
|
+
suffix = null,
|
|
12110
|
+
firstSuffix = null,
|
|
12111
|
+
startingExponent = 0,
|
|
12112
|
+
minExponent = 0,
|
|
12113
|
+
maxPrecision = 2,
|
|
12114
|
+
atLeastOne = true
|
|
12115
|
+
} = options || {};
|
|
11557
12116
|
let val = inValue;
|
|
11558
12117
|
let exp = startingExponent;
|
|
11559
12118
|
while (val >= increment && exp + 1 < UNITS.length || exp < minExponent) {
|
|
@@ -11611,8 +12170,8 @@ function parseSi(inValue, increment = null, allowFractional = true) {
|
|
|
11611
12170
|
}
|
|
11612
12171
|
return val;
|
|
11613
12172
|
}
|
|
11614
|
-
const
|
|
11615
|
-
const WrapperStyle = "
|
|
12173
|
+
const index_1wzdp7m = "";
|
|
12174
|
+
const WrapperStyle = "wfg6u6g";
|
|
11616
12175
|
const InnerBar = ({
|
|
11617
12176
|
usage: usage2,
|
|
11618
12177
|
requestNum,
|
|
@@ -11624,33 +12183,33 @@ const InnerBar = ({
|
|
|
11624
12183
|
const usageInRequestPercent = 100 * Math.min(usageNum / requestNum, 1);
|
|
11625
12184
|
const usageInRequestToLimitPercent = 100 * Math.min(Math.max(usageNum - requestNum, 0) / (totalNum - requestNum), 1);
|
|
11626
12185
|
const noLimit = limitNum === 0;
|
|
11627
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
12186
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11628
12187
|
className: "usage-bar",
|
|
11629
12188
|
style: {
|
|
11630
12189
|
marginLeft: 4
|
|
11631
12190
|
},
|
|
11632
|
-
children: [jsxRuntimeExports.jsx("div", {
|
|
12191
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11633
12192
|
className: "request-anchor",
|
|
11634
12193
|
style: {
|
|
11635
12194
|
left: `${requestPercent}%`
|
|
11636
12195
|
}
|
|
11637
|
-
}), jsxRuntimeExports.jsx("div", {
|
|
12196
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11638
12197
|
className: "request-bar",
|
|
11639
12198
|
style: {
|
|
11640
12199
|
width: `${requestPercent}%`
|
|
11641
12200
|
},
|
|
11642
|
-
children: jsxRuntimeExports.jsx("div", {
|
|
12201
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11643
12202
|
className: "usage-fill-bar",
|
|
11644
12203
|
style: {
|
|
11645
12204
|
width: `${usageInRequestPercent}%`
|
|
11646
12205
|
}
|
|
11647
12206
|
})
|
|
11648
|
-
}), jsxRuntimeExports.jsx("div", {
|
|
12207
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11649
12208
|
className: cx_default("request-to-limit-bar", noLimit && "no-limit", usageInRequestToLimitPercent > 0 && "exceed-request"),
|
|
11650
12209
|
style: {
|
|
11651
12210
|
width: `${100 - requestPercent}%`
|
|
11652
12211
|
},
|
|
11653
|
-
children: !noLimit && jsxRuntimeExports.jsx("div", {
|
|
12212
|
+
children: !noLimit && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11654
12213
|
className: "usage-fill-bar",
|
|
11655
12214
|
style: {
|
|
11656
12215
|
width: `${usageInRequestToLimitPercent}%`
|
|
@@ -11664,12 +12223,12 @@ const ResourceUsageBar = (props) => {
|
|
|
11664
12223
|
usage: usage2,
|
|
11665
12224
|
requestNum
|
|
11666
12225
|
} = props;
|
|
11667
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
12226
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11668
12227
|
className: cx_default("usage-wrapper", WrapperStyle),
|
|
11669
|
-
children: [jsxRuntimeExports.jsx("div", {
|
|
12228
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11670
12229
|
className: "usage-text",
|
|
11671
12230
|
children: usage2
|
|
11672
|
-
}), requestNum > 0 && jsxRuntimeExports.jsx(InnerBar, {
|
|
12231
|
+
}), requestNum > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(InnerBar, {
|
|
11673
12232
|
...props
|
|
11674
12233
|
})]
|
|
11675
12234
|
});
|
|
@@ -11679,11 +12238,16 @@ const DeleteButton = () => {
|
|
|
11679
12238
|
const { id } = useParsed();
|
|
11680
12239
|
const kit = useUIKit();
|
|
11681
12240
|
const { t } = useTranslation();
|
|
11682
|
-
const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
|
|
11683
|
-
|
|
12241
|
+
const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
|
|
12242
|
+
(resource == null ? void 0 : resource.name) || ""
|
|
12243
|
+
);
|
|
12244
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
12245
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", danger: true, onClick: () => openDeleteConfirmModal(id || ""), children: t("dovetail.delete") }),
|
|
12246
|
+
visible ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.modal, { ...modalProps }) : null
|
|
12247
|
+
] });
|
|
11684
12248
|
};
|
|
11685
|
-
const
|
|
11686
|
-
const MenuStyle = "
|
|
12249
|
+
const index_1wt5px2 = "";
|
|
12250
|
+
const MenuStyle = "mdppgn0";
|
|
11687
12251
|
const Menu = () => {
|
|
11688
12252
|
const kit = useUIKit();
|
|
11689
12253
|
const {
|
|
@@ -11691,17 +12255,17 @@ const Menu = () => {
|
|
|
11691
12255
|
selectedKey
|
|
11692
12256
|
} = useMenu();
|
|
11693
12257
|
function renderMenuItems(items) {
|
|
11694
|
-
return items.map((item) => item.list ? jsxRuntimeExports.jsx(kit.menuItem, {
|
|
11695
|
-
children: jsxRuntimeExports.jsx(NavLink, {
|
|
12258
|
+
return items.map((item) => item.list ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.menuItem, {
|
|
12259
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(NavLink, {
|
|
11696
12260
|
to: item.route || "",
|
|
11697
12261
|
children: item.label
|
|
11698
12262
|
})
|
|
11699
|
-
}, item.key) : jsxRuntimeExports.jsx(kit.menuItemGroup, {
|
|
12263
|
+
}, item.key) : /* @__PURE__ */ jsxRuntimeExports.jsx(kit.menuItemGroup, {
|
|
11700
12264
|
title: item.name,
|
|
11701
12265
|
children: renderMenuItems(item.children)
|
|
11702
12266
|
}, item.key));
|
|
11703
12267
|
}
|
|
11704
|
-
return jsxRuntimeExports.jsx(kit.menu, {
|
|
12268
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.menu, {
|
|
11705
12269
|
className: MenuStyle,
|
|
11706
12270
|
theme: "light",
|
|
11707
12271
|
selectedKeys: [selectedKey],
|
|
@@ -11856,21 +12420,30 @@ const NamespacesFilter = () => {
|
|
|
11856
12420
|
}
|
|
11857
12421
|
});
|
|
11858
12422
|
const [value, setValue] = useLocalStorage(NS_STORE_KEY, ALL_NS);
|
|
11859
|
-
return jsxRuntimeExports.jsxs(
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
12423
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
12424
|
+
kit.select,
|
|
12425
|
+
{
|
|
12426
|
+
input: {
|
|
12427
|
+
value,
|
|
12428
|
+
onChange(value2) {
|
|
12429
|
+
setValue(value2);
|
|
12430
|
+
}
|
|
12431
|
+
},
|
|
12432
|
+
children: [
|
|
12433
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, { value: "_all", children: t("dovetail.all_namespaces") }, "_all"),
|
|
12434
|
+
data2 == null ? void 0 : data2.data.map((namespace2) => {
|
|
12435
|
+
const { name: name2 } = namespace2.metadata;
|
|
12436
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, { value: name2, children: name2 }, name2);
|
|
12437
|
+
})
|
|
12438
|
+
]
|
|
12439
|
+
}
|
|
12440
|
+
);
|
|
11868
12441
|
};
|
|
11869
|
-
const
|
|
11870
|
-
const HeaderStyle = "
|
|
11871
|
-
const ContentLayoutStyle = "
|
|
11872
|
-
const SiderStyle = "
|
|
11873
|
-
const ContentStyle = "
|
|
12442
|
+
const index_1q7s7td = "";
|
|
12443
|
+
const HeaderStyle = "h16z07g";
|
|
12444
|
+
const ContentLayoutStyle = "c1i80kj";
|
|
12445
|
+
const SiderStyle = "s18sezq1";
|
|
12446
|
+
const ContentStyle = "cyc9hl2";
|
|
11874
12447
|
const Layout = ({
|
|
11875
12448
|
children
|
|
11876
12449
|
}) => {
|
|
@@ -11881,28 +12454,28 @@ const Layout = ({
|
|
|
11881
12454
|
Content,
|
|
11882
12455
|
Sider
|
|
11883
12456
|
} = kit.layout;
|
|
11884
|
-
return jsxRuntimeExports.jsxs(kit.layout, {
|
|
12457
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.layout, {
|
|
11885
12458
|
style: {
|
|
11886
12459
|
height: "100%"
|
|
11887
12460
|
},
|
|
11888
|
-
children: [jsxRuntimeExports.jsxs(Header, {
|
|
12461
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs(Header, {
|
|
11889
12462
|
className: cx_default(HeaderStyle, Typo.Heading.h1_bold_title),
|
|
11890
|
-
children: ["Dovetail 2", jsxRuntimeExports.jsx("div", {
|
|
12463
|
+
children: ["Dovetail 2", /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
11891
12464
|
style: {
|
|
11892
12465
|
width: 300
|
|
11893
12466
|
},
|
|
11894
|
-
children: jsxRuntimeExports.jsx(NamespacesFilter, {})
|
|
12467
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(NamespacesFilter, {})
|
|
11895
12468
|
})]
|
|
11896
|
-
}), jsxRuntimeExports.jsxs(kit.layout, {
|
|
12469
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.layout, {
|
|
11897
12470
|
className: ContentLayoutStyle,
|
|
11898
|
-
children: [jsxRuntimeExports.jsx(Sider, {
|
|
12471
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Sider, {
|
|
11899
12472
|
width: 256,
|
|
11900
12473
|
className: SiderStyle,
|
|
11901
12474
|
theme: "light",
|
|
11902
12475
|
collapsed,
|
|
11903
12476
|
onCollapse: (value) => setCollapsed(value),
|
|
11904
|
-
children: jsxRuntimeExports.jsx(Menu, {})
|
|
11905
|
-
}), jsxRuntimeExports.jsx(Content, {
|
|
12477
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Menu, {})
|
|
12478
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Content, {
|
|
11906
12479
|
className: ContentStyle,
|
|
11907
12480
|
children
|
|
11908
12481
|
})]
|
|
@@ -11916,28 +12489,52 @@ const DrawerShow = (props) => {
|
|
|
11916
12489
|
const nav = useNavigation();
|
|
11917
12490
|
const { queryResult } = useShow({ id: (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id });
|
|
11918
12491
|
const { isLoading } = queryResult;
|
|
11919
|
-
return
|
|
12492
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12493
|
+
Drawer,
|
|
12494
|
+
{
|
|
12495
|
+
title: "Show Drawer",
|
|
12496
|
+
placement: "right",
|
|
12497
|
+
onClose: () => nav.goBack(),
|
|
12498
|
+
width: "50%",
|
|
12499
|
+
visible: !!((_b = parsed == null ? void 0 : parsed.params) == null ? void 0 : _b.id),
|
|
12500
|
+
children: isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.loading, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(ShowContent, { ...props })
|
|
12501
|
+
}
|
|
12502
|
+
);
|
|
11920
12503
|
};
|
|
11921
12504
|
const EditButton = () => {
|
|
11922
12505
|
const { id } = useParsed();
|
|
11923
12506
|
const kit = useUIKit();
|
|
11924
12507
|
const { edit: edit2 } = useEdit();
|
|
11925
|
-
return jsxRuntimeExports.jsx(
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
|
|
12508
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12509
|
+
kit.button,
|
|
12510
|
+
{
|
|
12511
|
+
type: "primary",
|
|
12512
|
+
onClick: () => {
|
|
12513
|
+
if (id)
|
|
12514
|
+
edit2(id);
|
|
12515
|
+
},
|
|
12516
|
+
children: "Edit"
|
|
12517
|
+
}
|
|
12518
|
+
);
|
|
11929
12519
|
};
|
|
11930
12520
|
const ReferenceLink = (props) => {
|
|
11931
12521
|
const { ownerReference, namespace: namespace2 } = props;
|
|
11932
12522
|
const configs = useContext(ConfigsContext);
|
|
11933
12523
|
if (ownerReference.kind === "ReplicaSet") {
|
|
11934
|
-
return jsxRuntimeExports.jsx("span", { children: ownerReference.name });
|
|
12524
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: ownerReference.name });
|
|
11935
12525
|
}
|
|
11936
12526
|
const resource = Object.values(configs).find((c) => c.kind === ownerReference.kind);
|
|
11937
12527
|
if (!resource) {
|
|
11938
|
-
return jsxRuntimeExports.jsx("span", { children: "-" });
|
|
12528
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "-" });
|
|
11939
12529
|
}
|
|
11940
|
-
return jsxRuntimeExports.jsx(
|
|
12530
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12531
|
+
ResourceLink,
|
|
12532
|
+
{
|
|
12533
|
+
resourceId: ownerReference.name,
|
|
12534
|
+
name: resource.name || "",
|
|
12535
|
+
namespace: namespace2
|
|
12536
|
+
}
|
|
12537
|
+
);
|
|
11941
12538
|
};
|
|
11942
12539
|
function __rest(s, e) {
|
|
11943
12540
|
var t = {};
|
|
@@ -17530,8 +18127,8 @@ const LogViewerBase = memo((_a) => {
|
|
|
17530
18127
|
const LogViewer = React__default.forwardRef((props, ref) => React__default.createElement(LogViewerBase, Object.assign({ innerRef: ref }, props)));
|
|
17531
18128
|
LogViewer.displayName = "LogViewer";
|
|
17532
18129
|
const baseNoReset = "";
|
|
17533
|
-
const
|
|
17534
|
-
const ToolbarStyle = "
|
|
18130
|
+
const index_645izu = "";
|
|
18131
|
+
const ToolbarStyle = "tve7dfm";
|
|
17535
18132
|
const PodLog = ({
|
|
17536
18133
|
pod
|
|
17537
18134
|
}) => {
|
|
@@ -17639,10 +18236,10 @@ const PodLog = ({
|
|
|
17639
18236
|
stopFetchingLogs();
|
|
17640
18237
|
};
|
|
17641
18238
|
}, [fetchLogs, stopFetchingLogs]);
|
|
17642
|
-
return jsxRuntimeExports.jsxs("div", {
|
|
17643
|
-
children: [jsxRuntimeExports.jsxs("div", {
|
|
18239
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
18240
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
17644
18241
|
className: ToolbarStyle,
|
|
17645
|
-
children: [jsxRuntimeExports.jsxs(kit.select, {
|
|
18242
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs(kit.select, {
|
|
17646
18243
|
input: {
|
|
17647
18244
|
onChange: (newValue) => {
|
|
17648
18245
|
stopFetchingLogs();
|
|
@@ -17653,31 +18250,31 @@ const PodLog = ({
|
|
|
17653
18250
|
},
|
|
17654
18251
|
value: selectedContainer
|
|
17655
18252
|
},
|
|
17656
|
-
children: [jsxRuntimeExports.jsx(kit.option, {
|
|
18253
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, {
|
|
17657
18254
|
value: "",
|
|
17658
18255
|
disabled: true,
|
|
17659
18256
|
children: t("dovetail.select_container")
|
|
17660
|
-
}), (((_e = pod.spec) == null ? void 0 : _e.containers) || []).map((container2) => jsxRuntimeExports.jsx(kit.option, {
|
|
18257
|
+
}), (((_e = pod.spec) == null ? void 0 : _e.containers) || []).map((container2) => /* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, {
|
|
17661
18258
|
value: container2.name,
|
|
17662
18259
|
children: container2.name
|
|
17663
18260
|
}, container2.name))]
|
|
17664
|
-
}), jsxRuntimeExports.jsx(kit.checkbox, {
|
|
18261
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.checkbox, {
|
|
17665
18262
|
checked: wrap2,
|
|
17666
18263
|
onChange: (e) => setWrap(e.target.checked),
|
|
17667
18264
|
children: t("dovetail.wrap")
|
|
17668
|
-
}), jsxRuntimeExports.jsx(kit.button, {
|
|
18265
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
|
|
17669
18266
|
onClick: () => setPaused((prev) => !prev),
|
|
17670
|
-
prefixIcon: paused ? jsxRuntimeExports.jsx(Resume24Icon, {}) : jsxRuntimeExports.jsx(SuspendedPause24GradientOrangeIcon, {}),
|
|
18267
|
+
prefixIcon: paused ? /* @__PURE__ */ jsxRuntimeExports.jsx(Resume24Icon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(SuspendedPause24GradientOrangeIcon, {}),
|
|
17671
18268
|
children: paused ? t("dovetail.resume_log") : t("dovetail.suspend")
|
|
17672
18269
|
})]
|
|
17673
|
-
}), jsxRuntimeExports.jsx(LogViewer, {
|
|
18270
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(LogViewer, {
|
|
17674
18271
|
innerRef: logViewerRef,
|
|
17675
18272
|
hasLineNumbers: true,
|
|
17676
18273
|
height: 300,
|
|
17677
18274
|
data: logs,
|
|
17678
18275
|
theme: "light",
|
|
17679
18276
|
isTextWrapped: wrap2,
|
|
17680
|
-
footer: paused && jsxRuntimeExports.jsxs(kit.button, {
|
|
18277
|
+
footer: paused && /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.button, {
|
|
17681
18278
|
type: "primary",
|
|
17682
18279
|
style: {
|
|
17683
18280
|
borderRadius: 0
|
|
@@ -17696,9 +18293,9 @@ const NetworkPolicyRulesTable = ({ ingressOrEgress }) => {
|
|
|
17696
18293
|
const peers = get(gress, "from") || get(gress, "to");
|
|
17697
18294
|
if (!peers)
|
|
17698
18295
|
return null;
|
|
17699
|
-
return jsxRuntimeExports.jsx(IngressRuleTable, { peers }, i);
|
|
18296
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IngressRuleTable, { peers }, i);
|
|
17700
18297
|
});
|
|
17701
|
-
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: result });
|
|
18298
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: result });
|
|
17702
18299
|
};
|
|
17703
18300
|
const IngressRuleTable = ({ peers }) => {
|
|
17704
18301
|
const kit = useUIKit();
|
|
@@ -17729,7 +18326,7 @@ const IngressRuleTable = ({ peers }) => {
|
|
|
17729
18326
|
title: "CIDR",
|
|
17730
18327
|
sortable: true,
|
|
17731
18328
|
render(v) {
|
|
17732
|
-
return jsxRuntimeExports.jsx("span", { children: v || "-" });
|
|
18329
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: v || "-" });
|
|
17733
18330
|
}
|
|
17734
18331
|
},
|
|
17735
18332
|
{
|
|
@@ -17741,7 +18338,7 @@ const IngressRuleTable = ({ peers }) => {
|
|
|
17741
18338
|
render: (except) => {
|
|
17742
18339
|
if (!except)
|
|
17743
18340
|
return "-";
|
|
17744
|
-
return except == null ? void 0 : except.map((str) => jsxRuntimeExports.jsx("div", { children: str }, str));
|
|
18341
|
+
return except == null ? void 0 : except.map((str) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: str }, str));
|
|
17745
18342
|
}
|
|
17746
18343
|
},
|
|
17747
18344
|
{
|
|
@@ -17751,22 +18348,42 @@ const IngressRuleTable = ({ peers }) => {
|
|
|
17751
18348
|
title: "Match Labels",
|
|
17752
18349
|
sortable: true,
|
|
17753
18350
|
render(matchLabels) {
|
|
17754
|
-
return jsxRuntimeExports.jsx(Tags, { value: matchLabels });
|
|
18351
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tags, { value: matchLabels });
|
|
17755
18352
|
}
|
|
17756
18353
|
}
|
|
17757
18354
|
];
|
|
17758
18355
|
if (rows.length === 0) {
|
|
17759
|
-
return jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
18356
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t("dovetail.empty"), style: { padding: "15px 0" } });
|
|
17760
18357
|
}
|
|
17761
|
-
return jsxRuntimeExports.jsx(
|
|
18358
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18359
|
+
kit.table,
|
|
18360
|
+
{
|
|
18361
|
+
loading: false,
|
|
18362
|
+
dataSource: rows,
|
|
18363
|
+
columns,
|
|
18364
|
+
rowKey: "type",
|
|
18365
|
+
empty: t("dovetail.empty")
|
|
18366
|
+
}
|
|
18367
|
+
);
|
|
17762
18368
|
};
|
|
17763
18369
|
const IngressRulesComponent = ({ ingress }) => {
|
|
17764
18370
|
const kit = useUIKit();
|
|
17765
18371
|
const result = ingress.flattenedRules.map((r) => {
|
|
17766
18372
|
const divider = " > ";
|
|
17767
|
-
return jsxRuntimeExports.jsxs("div", { children: [
|
|
18373
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
18374
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(kit.Link, { disabled: !r.host, href: r.fullPath, children: r.fullPath }),
|
|
18375
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: divider }),
|
|
18376
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18377
|
+
ResourceLink,
|
|
18378
|
+
{
|
|
18379
|
+
name: "services",
|
|
18380
|
+
namespace: ingress.metadata.namespace || "default",
|
|
18381
|
+
resourceId: r.serviceName
|
|
18382
|
+
}
|
|
18383
|
+
)
|
|
18384
|
+
] }, r.fullPath);
|
|
17768
18385
|
});
|
|
17769
|
-
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: result });
|
|
18386
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: result });
|
|
17770
18387
|
};
|
|
17771
18388
|
function getSecondsDiff(startDate, endDate) {
|
|
17772
18389
|
return Math.round(Math.abs(Date.parse(endDate) - Date.parse(startDate)) / 1e3);
|
|
@@ -17822,17 +18439,24 @@ const NameLink = (props) => {
|
|
|
17822
18439
|
const navigation = useNavigation();
|
|
17823
18440
|
const parsed = useParsed();
|
|
17824
18441
|
const resourceName = resource || ((_a = parsed.resource) == null ? void 0 : _a.name) || "";
|
|
17825
|
-
return jsxRuntimeExports.jsx(
|
|
17826
|
-
|
|
17827
|
-
|
|
17828
|
-
|
|
17829
|
-
|
|
18442
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18443
|
+
kit.button,
|
|
18444
|
+
{
|
|
18445
|
+
type: "link",
|
|
18446
|
+
onClick: () => {
|
|
18447
|
+
go({
|
|
18448
|
+
to: navigation.showUrl(resourceName, ""),
|
|
18449
|
+
query: {
|
|
18450
|
+
id
|
|
18451
|
+
},
|
|
18452
|
+
options: {
|
|
18453
|
+
keepQuery: true
|
|
18454
|
+
}
|
|
18455
|
+
});
|
|
17830
18456
|
},
|
|
17831
|
-
|
|
17832
|
-
|
|
17833
|
-
|
|
17834
|
-
});
|
|
17835
|
-
}, children: name2 });
|
|
18457
|
+
children: name2
|
|
18458
|
+
}
|
|
18459
|
+
);
|
|
17836
18460
|
};
|
|
17837
18461
|
const CommonSorter = (dataIndex) => (a, b) => {
|
|
17838
18462
|
const valA = lodashExports.get(a, dataIndex);
|
|
@@ -17853,7 +18477,7 @@ const NameColumnRenderer = (i18n2, resource = "") => {
|
|
|
17853
18477
|
sortable: true,
|
|
17854
18478
|
sorter: CommonSorter(dataIndex),
|
|
17855
18479
|
render: (v, record) => {
|
|
17856
|
-
return jsxRuntimeExports.jsx(NameLink, { name: v, id: record.id, resource });
|
|
18480
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(NameLink, { name: v, id: record.id, resource });
|
|
17857
18481
|
}
|
|
17858
18482
|
};
|
|
17859
18483
|
};
|
|
@@ -17877,7 +18501,7 @@ const StateDisplayColumnRenderer = (i18n2) => {
|
|
|
17877
18501
|
title: i18n2.t("dovetail.state"),
|
|
17878
18502
|
sortable: true,
|
|
17879
18503
|
sorter: CommonSorter(dataIndex),
|
|
17880
|
-
render: (v) => jsxRuntimeExports.jsx(StateTag, { state: v })
|
|
18504
|
+
render: (v) => /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, { state: v })
|
|
17881
18505
|
};
|
|
17882
18506
|
};
|
|
17883
18507
|
const WorkloadImageColumnRenderer = (i18n2) => {
|
|
@@ -17890,7 +18514,7 @@ const WorkloadImageColumnRenderer = (i18n2) => {
|
|
|
17890
18514
|
sortable: true,
|
|
17891
18515
|
sorter: CommonSorter(dataIndex),
|
|
17892
18516
|
render(value, record) {
|
|
17893
|
-
return jsxRuntimeExports.jsx(ImageNames, { value: record.imageNames });
|
|
18517
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ImageNames, { value: record.imageNames });
|
|
17894
18518
|
}
|
|
17895
18519
|
};
|
|
17896
18520
|
};
|
|
@@ -17914,7 +18538,11 @@ const ReplicasColumnRenderer = (i18n2) => {
|
|
|
17914
18538
|
sortable: true,
|
|
17915
18539
|
sorter: CommonSorter(dataIndex),
|
|
17916
18540
|
render: (_, record) => {
|
|
17917
|
-
return jsxRuntimeExports.jsxs("span", { children: [
|
|
18541
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
18542
|
+
record.readyReplicas,
|
|
18543
|
+
"/",
|
|
18544
|
+
record.replicas
|
|
18545
|
+
] });
|
|
17918
18546
|
}
|
|
17919
18547
|
};
|
|
17920
18548
|
};
|
|
@@ -17936,7 +18564,7 @@ const AgeColumnRenderer = (i18n2) => {
|
|
|
17936
18564
|
return -1;
|
|
17937
18565
|
},
|
|
17938
18566
|
render: (value) => {
|
|
17939
|
-
return jsxRuntimeExports.jsx(Time, { date: new Date(value) });
|
|
18567
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: new Date(value) });
|
|
17940
18568
|
}
|
|
17941
18569
|
};
|
|
17942
18570
|
};
|
|
@@ -17990,7 +18618,7 @@ const DurationColumnRenderer = (i18n2) => {
|
|
|
17990
18618
|
min: i18n2.t("dovetail.min"),
|
|
17991
18619
|
hr: i18n2.t("dovetail.hr")
|
|
17992
18620
|
};
|
|
17993
|
-
return jsxRuntimeExports.jsx("span", { children: elapsedTime(v, i18nMap).label || "-" });
|
|
18621
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: elapsedTime(v, i18nMap).label || "-" });
|
|
17994
18622
|
}
|
|
17995
18623
|
};
|
|
17996
18624
|
};
|
|
@@ -18015,7 +18643,14 @@ const PodWorkloadColumnRenderer = (i18n2) => {
|
|
|
18015
18643
|
sortable: true,
|
|
18016
18644
|
sorter: CommonSorter(dataIndex),
|
|
18017
18645
|
render(value, record) {
|
|
18018
|
-
return value.map((o) => jsxRuntimeExports.jsx(
|
|
18646
|
+
return value.map((o) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18647
|
+
ReferenceLink,
|
|
18648
|
+
{
|
|
18649
|
+
ownerReference: o,
|
|
18650
|
+
namespace: record.metadata.namespace || "default"
|
|
18651
|
+
},
|
|
18652
|
+
o.name
|
|
18653
|
+
));
|
|
18019
18654
|
}
|
|
18020
18655
|
};
|
|
18021
18656
|
};
|
|
@@ -18029,7 +18664,7 @@ const IngressRulesColumnRenderer = (i18n2) => {
|
|
|
18029
18664
|
sortable: true,
|
|
18030
18665
|
sorter: CommonSorter(dataIndex),
|
|
18031
18666
|
render(_, record) {
|
|
18032
|
-
return jsxRuntimeExports.jsx(IngressRulesComponent, { ingress: record });
|
|
18667
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IngressRulesComponent, { ingress: record });
|
|
18033
18668
|
}
|
|
18034
18669
|
};
|
|
18035
18670
|
};
|
|
@@ -18045,14 +18680,23 @@ const IngressDefaultBackendColumnRenderer = (i18n2) => {
|
|
|
18045
18680
|
render: (defaultBackend, record) => {
|
|
18046
18681
|
var _a, _b;
|
|
18047
18682
|
if (!((_a = defaultBackend == null ? void 0 : defaultBackend.service) == null ? void 0 : _a.name))
|
|
18048
|
-
return jsxRuntimeExports.jsx("span", { children: "-" });
|
|
18683
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "-" });
|
|
18049
18684
|
const divider = "Default > ";
|
|
18050
|
-
return jsxRuntimeExports.jsxs("span", { children: [
|
|
18685
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
18686
|
+
divider,
|
|
18687
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18688
|
+
ResourceLink,
|
|
18689
|
+
{
|
|
18690
|
+
name: "services",
|
|
18691
|
+
namespace: record.metadata.namespace || "default",
|
|
18692
|
+
resourceId: ((_b = defaultBackend.service) == null ? void 0 : _b.name) || ""
|
|
18693
|
+
}
|
|
18694
|
+
)
|
|
18695
|
+
] });
|
|
18051
18696
|
}
|
|
18052
18697
|
};
|
|
18053
18698
|
};
|
|
18054
|
-
var ColumnKeys
|
|
18055
|
-
(function(ColumnKeys2) {
|
|
18699
|
+
var ColumnKeys = /* @__PURE__ */ ((ColumnKeys2) => {
|
|
18056
18700
|
ColumnKeys2["age"] = "age";
|
|
18057
18701
|
ColumnKeys2["name"] = "name";
|
|
18058
18702
|
ColumnKeys2["namespace"] = "namespace";
|
|
@@ -18060,7 +18704,8 @@ var ColumnKeys;
|
|
|
18060
18704
|
ColumnKeys2["replicas"] = "replicas";
|
|
18061
18705
|
ColumnKeys2["deploymentImage"] = "deploymentImage";
|
|
18062
18706
|
ColumnKeys2["podImage"] = "podImage";
|
|
18063
|
-
|
|
18707
|
+
return ColumnKeys2;
|
|
18708
|
+
})(ColumnKeys || {});
|
|
18064
18709
|
const useEagleTable = (params) => {
|
|
18065
18710
|
var _a;
|
|
18066
18711
|
const { columns, tableProps, formatter, Dropdown = K8sDropdown } = params;
|
|
@@ -18086,9 +18731,12 @@ const useEagleTable = (params) => {
|
|
|
18086
18731
|
return mergedParams;
|
|
18087
18732
|
}, [params.useTableParams, nsFilter]);
|
|
18088
18733
|
const table = useTable(useTableParams);
|
|
18089
|
-
const onPageChange = useCallback(
|
|
18090
|
-
|
|
18091
|
-
|
|
18734
|
+
const onPageChange = useCallback(
|
|
18735
|
+
(page) => {
|
|
18736
|
+
setCurrentPage(page);
|
|
18737
|
+
},
|
|
18738
|
+
[setCurrentPage]
|
|
18739
|
+
);
|
|
18092
18740
|
const data2 = (_a = table.tableQueryResult.data) == null ? void 0 : _a.data;
|
|
18093
18741
|
const finalDataSource = formatter ? data2 == null ? void 0 : data2.map(formatter) : data2;
|
|
18094
18742
|
const finalProps = {
|
|
@@ -18116,37 +18764,49 @@ const Dovetail = (props) => {
|
|
|
18116
18764
|
return resourcesConfig.filter((c) => !c.isCustom);
|
|
18117
18765
|
}, [resourcesConfig]);
|
|
18118
18766
|
const content = useMemo(() => {
|
|
18119
|
-
const _content = jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
18767
|
+
const _content = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
18768
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ModalStack, {}),
|
|
18769
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ResourceCRUD, { configs: notCustomResources, urlPrefix }),
|
|
18770
|
+
props.children
|
|
18771
|
+
] });
|
|
18120
18772
|
if (Layout2) {
|
|
18121
|
-
return jsxRuntimeExports.jsx(Layout2, { children: _content });
|
|
18773
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Layout2, { children: _content });
|
|
18122
18774
|
}
|
|
18123
18775
|
return _content;
|
|
18124
18776
|
}, [Layout2, notCustomResources, props.children, urlPrefix]);
|
|
18125
|
-
return jsxRuntimeExports.jsx(Router, { history, children: jsxRuntimeExports.jsx(KitStoreProvider, { children: jsxRuntimeExports.jsx(GlobalStoreContext.Provider, { value: { globalStore }, children: jsxRuntimeExports.jsx(ConfigsContext.Provider, { value: keyBy(resourcesConfig, "name"), children: jsxRuntimeExports.jsx(
|
|
18126
|
-
|
|
18127
|
-
|
|
18128
|
-
|
|
18129
|
-
|
|
18130
|
-
}, resources: resourcesConfig.map((c) => {
|
|
18131
|
-
return {
|
|
18132
|
-
name: c.name,
|
|
18133
|
-
meta: {
|
|
18134
|
-
resourceBasePath: c.basePath,
|
|
18135
|
-
kind: c.kind,
|
|
18136
|
-
parent: c.parent,
|
|
18137
|
-
label: `${c.kind}s`
|
|
18777
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Router, { history, children: /* @__PURE__ */ jsxRuntimeExports.jsx(KitStoreProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalStoreContext.Provider, { value: { globalStore }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConfigsContext.Provider, { value: keyBy(resourcesConfig, "name"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18778
|
+
Refine,
|
|
18779
|
+
{
|
|
18780
|
+
dataProvider: {
|
|
18781
|
+
default: dataProvider(globalStore)
|
|
18138
18782
|
},
|
|
18139
|
-
|
|
18140
|
-
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
|
|
18144
|
-
|
|
18783
|
+
routerProvider,
|
|
18784
|
+
liveProvider: liveProvider(globalStore),
|
|
18785
|
+
options: {
|
|
18786
|
+
warnWhenUnsavedChanges: true,
|
|
18787
|
+
liveMode: "auto"
|
|
18788
|
+
},
|
|
18789
|
+
resources: resourcesConfig.map((c) => {
|
|
18790
|
+
return {
|
|
18791
|
+
name: c.name,
|
|
18792
|
+
meta: {
|
|
18793
|
+
resourceBasePath: c.basePath,
|
|
18794
|
+
kind: c.kind,
|
|
18795
|
+
parent: c.parent,
|
|
18796
|
+
label: `${c.kind}s`
|
|
18797
|
+
},
|
|
18798
|
+
list: `${urlPrefix}/${c.name}`,
|
|
18799
|
+
show: `${urlPrefix}/${c.name}/show`,
|
|
18800
|
+
create: `${urlPrefix}/${c.name}/create`,
|
|
18801
|
+
edit: `${urlPrefix}/${c.name}/edit`
|
|
18802
|
+
};
|
|
18803
|
+
}),
|
|
18804
|
+
children: content
|
|
18805
|
+
}
|
|
18806
|
+
) }) }) }) });
|
|
18145
18807
|
};
|
|
18146
18808
|
class ResourceModel {
|
|
18147
18809
|
constructor(_rawYaml, _globalStore) {
|
|
18148
|
-
__publicField(this, "_rawYaml");
|
|
18149
|
-
__publicField(this, "_globalStore");
|
|
18150
18810
|
__publicField(this, "id");
|
|
18151
18811
|
__publicField(this, "apiVersion");
|
|
18152
18812
|
__publicField(this, "kind");
|
|
@@ -18186,8 +18846,6 @@ class IngressModel extends ResourceModel {
|
|
|
18186
18846
|
constructor(_rawYaml, _globalStore) {
|
|
18187
18847
|
var _a;
|
|
18188
18848
|
super(_rawYaml, _globalStore);
|
|
18189
|
-
__publicField(this, "_rawYaml");
|
|
18190
|
-
__publicField(this, "_globalStore");
|
|
18191
18849
|
__publicField(this, "flattenedRules");
|
|
18192
18850
|
this._rawYaml = _rawYaml;
|
|
18193
18851
|
this._globalStore = _globalStore;
|
|
@@ -18210,8 +18868,6 @@ class IngressModel extends ResourceModel {
|
|
|
18210
18868
|
class NetworkPolicyModel extends ResourceModel {
|
|
18211
18869
|
constructor(_rawYaml, _globalStore) {
|
|
18212
18870
|
super(_rawYaml, _globalStore);
|
|
18213
|
-
__publicField(this, "_rawYaml");
|
|
18214
|
-
__publicField(this, "_globalStore");
|
|
18215
18871
|
this._rawYaml = _rawYaml;
|
|
18216
18872
|
this._globalStore = _globalStore;
|
|
18217
18873
|
}
|
|
@@ -18222,8 +18878,6 @@ function shortenedImage(image2) {
|
|
|
18222
18878
|
class WorkloadBaseModel extends ResourceModel {
|
|
18223
18879
|
constructor(_rawYaml, _globalStore) {
|
|
18224
18880
|
super(_rawYaml, _globalStore);
|
|
18225
|
-
__publicField(this, "_rawYaml");
|
|
18226
|
-
__publicField(this, "_globalStore");
|
|
18227
18881
|
this._rawYaml = _rawYaml;
|
|
18228
18882
|
this._globalStore = _globalStore;
|
|
18229
18883
|
}
|
|
@@ -18242,8 +18896,6 @@ class WorkloadBaseModel extends ResourceModel {
|
|
|
18242
18896
|
class JobModel extends WorkloadBaseModel {
|
|
18243
18897
|
constructor(_rawYaml, _globalStore) {
|
|
18244
18898
|
super(_rawYaml, _globalStore);
|
|
18245
|
-
__publicField(this, "_rawYaml");
|
|
18246
|
-
__publicField(this, "_globalStore");
|
|
18247
18899
|
__publicField(this, "restarts", 0);
|
|
18248
18900
|
this._rawYaml = _rawYaml;
|
|
18249
18901
|
this._globalStore = _globalStore;
|
|
@@ -18256,10 +18908,12 @@ class JobModel extends WorkloadBaseModel {
|
|
|
18256
18908
|
resourceBasePath: "/api/v1",
|
|
18257
18909
|
kind: "Pod"
|
|
18258
18910
|
});
|
|
18259
|
-
const myPods = pods.items.filter(
|
|
18260
|
-
|
|
18261
|
-
|
|
18262
|
-
|
|
18911
|
+
const myPods = pods.items.filter(
|
|
18912
|
+
(p) => {
|
|
18913
|
+
var _a, _b;
|
|
18914
|
+
return ((_a = this.spec) == null ? void 0 : _a.selector) ? matchSelector(p, (_b = this.spec) == null ? void 0 : _b.selector) : false;
|
|
18915
|
+
}
|
|
18916
|
+
);
|
|
18263
18917
|
const result = lodashExports.sumBy(myPods, "restartCount");
|
|
18264
18918
|
this.restarts = result;
|
|
18265
18919
|
}
|
|
@@ -18299,8 +18953,6 @@ class JobModel extends WorkloadBaseModel {
|
|
|
18299
18953
|
class WorkloadModel extends WorkloadBaseModel {
|
|
18300
18954
|
constructor(_rawYaml, _globalStore) {
|
|
18301
18955
|
super(_rawYaml, _globalStore);
|
|
18302
|
-
__publicField(this, "_rawYaml");
|
|
18303
|
-
__publicField(this, "_globalStore");
|
|
18304
18956
|
__publicField(this, "restarts", 0);
|
|
18305
18957
|
this._rawYaml = _rawYaml;
|
|
18306
18958
|
this._globalStore = _globalStore;
|
|
@@ -18313,10 +18965,12 @@ class WorkloadModel extends WorkloadBaseModel {
|
|
|
18313
18965
|
resourceBasePath: "/api/v1",
|
|
18314
18966
|
kind: "Pod"
|
|
18315
18967
|
});
|
|
18316
|
-
const myPods = pods.items.filter(
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
|
|
18968
|
+
const myPods = pods.items.filter(
|
|
18969
|
+
(p) => {
|
|
18970
|
+
var _a, _b;
|
|
18971
|
+
return ((_a = this.spec) == null ? void 0 : _a.selector) ? matchSelector(p, (_b = this.spec) == null ? void 0 : _b.selector) : false;
|
|
18972
|
+
}
|
|
18973
|
+
);
|
|
18320
18974
|
const result = lodashExports.sumBy(myPods, "restartCount");
|
|
18321
18975
|
this.restarts = result;
|
|
18322
18976
|
}
|
|
@@ -18350,8 +19004,6 @@ class PodModel extends WorkloadBaseModel {
|
|
|
18350
19004
|
constructor(_rawYaml, _globalStore) {
|
|
18351
19005
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
18352
19006
|
super(_rawYaml, _globalStore);
|
|
18353
|
-
__publicField(this, "_rawYaml");
|
|
18354
|
-
__publicField(this, "_globalStore");
|
|
18355
19007
|
__publicField(this, "request");
|
|
18356
19008
|
__publicField(this, "limit");
|
|
18357
19009
|
this._rawYaml = _rawYaml;
|
|
@@ -18397,7 +19049,9 @@ class PodModel extends WorkloadBaseModel {
|
|
|
18397
19049
|
}
|
|
18398
19050
|
get imageNames() {
|
|
18399
19051
|
var _a;
|
|
18400
|
-
return ((_a = this._rawYaml.spec) == null ? void 0 : _a.containers.map(
|
|
19052
|
+
return ((_a = this._rawYaml.spec) == null ? void 0 : _a.containers.map(
|
|
19053
|
+
(container2) => shortenedImage(container2.image || "")
|
|
19054
|
+
)) || [];
|
|
18401
19055
|
}
|
|
18402
19056
|
get restartCount() {
|
|
18403
19057
|
var _a, _b;
|
|
@@ -18429,8 +19083,6 @@ class PodModel extends WorkloadBaseModel {
|
|
|
18429
19083
|
class PodMetricsModel extends ResourceModel {
|
|
18430
19084
|
constructor(_rawYaml, _globalStore) {
|
|
18431
19085
|
super(_rawYaml, _globalStore);
|
|
18432
|
-
__publicField(this, "_rawYaml");
|
|
18433
|
-
__publicField(this, "_globalStore");
|
|
18434
19086
|
__publicField(this, "usage");
|
|
18435
19087
|
this._rawYaml = _rawYaml;
|
|
18436
19088
|
this._globalStore = _globalStore;
|
|
@@ -18461,8 +19113,6 @@ class PodMetricsModel extends ResourceModel {
|
|
|
18461
19113
|
class CronJobModel extends WorkloadBaseModel {
|
|
18462
19114
|
constructor(_rawYaml, _globalStore) {
|
|
18463
19115
|
super(_rawYaml, _globalStore);
|
|
18464
|
-
__publicField(this, "_rawYaml");
|
|
18465
|
-
__publicField(this, "_globalStore");
|
|
18466
19116
|
this._rawYaml = _rawYaml;
|
|
18467
19117
|
this._globalStore = _globalStore;
|
|
18468
19118
|
}
|
|
@@ -18491,8 +19141,6 @@ class CronJobModel extends WorkloadBaseModel {
|
|
|
18491
19141
|
class EventModel extends ResourceModel {
|
|
18492
19142
|
constructor(_rawYaml, _globalStore) {
|
|
18493
19143
|
super(_rawYaml, _globalStore);
|
|
18494
|
-
__publicField(this, "_rawYaml");
|
|
18495
|
-
__publicField(this, "_globalStore");
|
|
18496
19144
|
this._rawYaml = _rawYaml;
|
|
18497
19145
|
this._globalStore = _globalStore;
|
|
18498
19146
|
this.id = _rawYaml.metadata.uid || _rawYaml.id;
|
|
@@ -18501,8 +19149,6 @@ class EventModel extends ResourceModel {
|
|
|
18501
19149
|
class DeploymentModel extends WorkloadModel {
|
|
18502
19150
|
constructor(_rawYaml, _globalStore) {
|
|
18503
19151
|
super(_rawYaml, _globalStore);
|
|
18504
|
-
__publicField(this, "_rawYaml");
|
|
18505
|
-
__publicField(this, "_globalStore");
|
|
18506
19152
|
this._rawYaml = _rawYaml;
|
|
18507
19153
|
this._globalStore = _globalStore;
|
|
18508
19154
|
}
|
|
@@ -18517,8 +19163,6 @@ class DeploymentModel extends WorkloadModel {
|
|
|
18517
19163
|
class DaemonSetModel extends WorkloadModel {
|
|
18518
19164
|
constructor(_rawYaml, _globalStore) {
|
|
18519
19165
|
super(_rawYaml, _globalStore);
|
|
18520
|
-
__publicField(this, "_rawYaml");
|
|
18521
|
-
__publicField(this, "_globalStore");
|
|
18522
19166
|
this._rawYaml = _rawYaml;
|
|
18523
19167
|
this._globalStore = _globalStore;
|
|
18524
19168
|
}
|
|
@@ -18533,8 +19177,6 @@ class DaemonSetModel extends WorkloadModel {
|
|
|
18533
19177
|
class StatefulSetModel extends WorkloadModel {
|
|
18534
19178
|
constructor(_rawYaml, _globalStore) {
|
|
18535
19179
|
super(_rawYaml, _globalStore);
|
|
18536
|
-
__publicField(this, "_rawYaml");
|
|
18537
|
-
__publicField(this, "_globalStore");
|
|
18538
19180
|
this._rawYaml = _rawYaml;
|
|
18539
19181
|
this._globalStore = _globalStore;
|
|
18540
19182
|
}
|
|
@@ -18566,12 +19208,14 @@ class ModelPlugin {
|
|
|
18566
19208
|
}
|
|
18567
19209
|
async processData(res) {
|
|
18568
19210
|
const { kind, apiVersion } = res;
|
|
18569
|
-
const items = await Promise.all(
|
|
18570
|
-
|
|
18571
|
-
|
|
18572
|
-
|
|
18573
|
-
|
|
18574
|
-
|
|
19211
|
+
const items = await Promise.all(
|
|
19212
|
+
res.items.map((item) => {
|
|
19213
|
+
const newItem = { ...item };
|
|
19214
|
+
newItem.kind = kind.replace(/List$/g, "");
|
|
19215
|
+
newItem.apiVersion = apiVersion;
|
|
19216
|
+
return this.processItem(newItem);
|
|
19217
|
+
})
|
|
19218
|
+
);
|
|
18575
19219
|
return {
|
|
18576
19220
|
...res,
|
|
18577
19221
|
items
|
|
@@ -18602,12 +19246,16 @@ class RelationPlugin {
|
|
|
18602
19246
|
}
|
|
18603
19247
|
async processData(res) {
|
|
18604
19248
|
const { kind, apiVersion } = res;
|
|
18605
|
-
const items = await Promise.all(
|
|
18606
|
-
|
|
18607
|
-
|
|
18608
|
-
|
|
18609
|
-
|
|
18610
|
-
|
|
19249
|
+
const items = await Promise.all(
|
|
19250
|
+
res.items.map(
|
|
19251
|
+
(item) => this.processItem({
|
|
19252
|
+
// TODO: unify this with data-provider getOne method
|
|
19253
|
+
kind: kind.replace(/List$/g, ""),
|
|
19254
|
+
apiVersion,
|
|
19255
|
+
...lodashExports.omit(item, ["apiVersion", "kind"])
|
|
19256
|
+
})
|
|
19257
|
+
)
|
|
19258
|
+
);
|
|
18611
19259
|
return {
|
|
18612
19260
|
...res,
|
|
18613
19261
|
items
|