@dovetail-v2/refine 0.4.3 → 0.4.4

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.
Files changed (33) hide show
  1. package/dist/{PodShell-43c7028e.cjs → PodShell-a335b2b2.cjs} +4 -2
  2. package/dist/{PodShell-76331418.js → PodShell-a6ed3498.js} +4 -2
  3. package/dist/components/CopyButton/index.d.ts +7 -0
  4. package/dist/components/FormWidgets/NameInputWidget.d.ts +0 -48
  5. package/dist/components/ServiceComponents/index.d.ts +10 -0
  6. package/dist/components/Shell/ShellToolbar.d.ts +1 -1
  7. package/dist/components/ShowContent/fields.d.ts +4 -0
  8. package/dist/components/index.d.ts +2 -3
  9. package/dist/contexts/component.d.ts +14 -5
  10. package/dist/contexts/index.d.ts +1 -0
  11. package/dist/hooks/useDeleteModal/index.d.ts +1 -0
  12. package/dist/hooks/useEagleTable/columns.d.ts +5 -4
  13. package/dist/hooks/useSubmitForm.d.ts +1 -1
  14. package/dist/hooks/useTableData.d.ts +1 -1
  15. package/dist/i18n.d.ts +25 -0
  16. package/dist/{index-31874f77.cjs → index-053ee180.cjs} +1 -1
  17. package/dist/{index-ab97826a.js → index-d7bc2ee6.js} +1 -1
  18. package/dist/index.d.ts +0 -1
  19. package/dist/locales/en-US/index.d.ts +12 -0
  20. package/dist/locales/zh-CN/index.d.ts +13 -0
  21. package/dist/models/daemonset-model.d.ts +0 -3
  22. package/dist/models/statefulset-model.d.ts +0 -3
  23. package/dist/models/workload-base-model.d.ts +3 -0
  24. package/dist/models/workload-model.d.ts +3 -0
  25. package/dist/pages/deployments/form/index.d.ts +2 -1
  26. package/dist/plugins/model-plugin.d.ts +1 -1
  27. package/dist/refine.cjs +1220 -1083
  28. package/dist/refine.js +1223 -1086
  29. package/dist/shell.cjs +1 -1
  30. package/dist/shell.js +1 -1
  31. package/dist/style.css +133 -4
  32. package/dist/types/resource.d.ts +9 -9
  33. package/package.json +17 -6
package/dist/refine.js CHANGED
@@ -7,17 +7,18 @@ var __publicField = (obj, key2, value2) => {
7
7
  import dayjs from "dayjs";
8
8
  import i18n from "i18next";
9
9
  import { w as warnOnce, g as getDefaults, a as warn, b as getI18n, s as setDefaults, d as setI18n, I as I18nContext, j as jsxRuntimeExports, u as useTranslation, c as cx_default, S as SocketStatus } from "./common-241b21f8.js";
10
- import { ResourceContext, matchResourceFromRoute, useResource, useDelete, useNavigation, useBreadcrumb, useList, CanAccess, useUpdate, useForm as useForm$2, pickNotDeprecated, useWarnAboutChange, useParsed, useGo, useCan, useTable, useDeleteMany, useShow, useRefineContext, useTranslate, flattenObjectKeys, useMenu, Refine } from "@refinedev/core";
10
+ import { ResourceContext, matchResourceFromRoute, useResource, useDeleteMany, useDelete, useNavigation, useBreadcrumb, useList, CanAccess, useUpdate, useForm as useForm$2, pickNotDeprecated, useWarnAboutChange, useParsed, useGo, useCan, useTable, useShow, useRefineContext, useTranslate, flattenObjectKeys, useMenu, Refine } from "@refinedev/core";
11
11
  import { parse, stringify } from "qs";
12
12
  import React, { createElement, isValidElement, cloneElement, Children, useContext, useCallback, createContext, useState, useEffect, useMemo, useRef, useImperativeHandle, forwardRef, Suspense, lazy, memo } from "react";
13
13
  import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Router } from "react-router-dom";
14
- import { usePushModal, usePopModal, DeleteDialog, Tag, RejectDialog, RejectDialogType, OverflowTooltip, Typo, Input, Select, AntdOption, Button, Form, Space, TextArea, kitContext, Loading, Table as Table$2, Pagination, Alert, ImmersiveDialog, SmallDialog, Fields, Units, Link as Link$1, Tooltip, Divider, Icon, Dropdown, Menu as Menu$1, LegacyModal, StatusCapsule, Popover, AntdTable, Upload, TableForm, ValidateTriggerType, AutoComplete, getOptions, DonutChart, SegmentControl, Checkbox, Tabs as Tabs$1, TabsTabPane, Col, Row, useMessage, SearchInput, Token, AntdSelectOptGroup, WizardDialog, MenuItemGroup, Layout as Layout$1, InputGroup, InputInteger, Time as Time$1, ModalStack, KitStoreProvider, ConfigProvider } from "@cloudtower/eagle";
15
- import { HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, Retry16GradientBlueIcon, EditPen16GradientGrayIcon, EditPen16GradientBlueIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, PlusAddCreateNew16BoldOntintIcon, ViewEye16GradientGrayIcon, EntityFilterIgnoreGradient16GrayIcon, InfoICircleFill16GrayIcon, InfoICircleFill16Gray70Icon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, OpenTerminal16GradientBlueIcon, ArrowChevronLeft16BoldBlueIcon, ExclamationErrorCircleFill16RedIcon, ArrowChevronDown16BlueIcon, ArrowChevronUp16BlueIcon, Pause16GradientBlueIcon, EditPen16BlueIcon } from "@cloudtower/icons-react";
14
+ import { usePushModal, usePopModal, DeleteDialog, Tag, RejectDialog, RejectDialogType, OverflowTooltip, Typo, Input, Select, AntdOption, Button, Form, Space, TextArea, kitContext, Loading, Table as Table$2, Pagination, Alert, ImmersiveDialog, SmallDialog, Fields, Units, Tooltip, Icon, Link as Link$1, Divider, Dropdown, Menu as Menu$1, LegacyModal, StatusCapsule, Popover, AntdTable, Upload, TableForm, ValidateTriggerType, AutoComplete, getOptions, DonutChart, SegmentControl, Checkbox, Tabs as Tabs$1, TabsTabPane, Col, Row, useMessage, SearchInput, Token, AntdSelectOptGroup, WizardDialog, MenuItemGroup, Layout as Layout$1, InputGroup, InputInteger, Time as Time$1, ModalStack, KitStoreProvider, ConfigProvider } from "@cloudtower/eagle";
15
+ import { ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, Retry16GradientGrayIcon, Retry16GradientBlueIcon, EditPen16GradientGrayIcon, EditPen16GradientBlueIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, PlusAddCreateNew16BoldOntintIcon, ViewEye16GradientGrayIcon, EntityFilterIgnoreGradient16GrayIcon, InfoICircleFill16GrayIcon, InfoICircleFill16Gray70Icon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, OpenTerminal16GradientBlueIcon, ArrowChevronLeft16BoldBlueIcon, ExclamationErrorCircleFill16RedIcon, ArrowChevronDown16BlueIcon, ArrowChevronUp16BlueIcon, Pause16GradientBlueIcon, EditPen16BlueIcon } from "@cloudtower/icons-react";
16
16
  import { first, get as get$2, cloneDeep, set, setWith, clone, debounce, isEqual as isEqual$1, omit as omit$1, isObject as isObject$4, uniq, merge, last, keyBy } from "lodash-es";
17
17
  import yaml$2 from "js-yaml";
18
18
  import { useForm as useForm$1 } from "sunflower-antd";
19
19
  import { useLocalStorage } from "usehooks-ts";
20
20
  import { paginateData, sortData, dataProvider, liveProvider } from "k8s-api-provider";
21
+ import copyToClipboard$1 from "copy-to-clipboard";
21
22
  import { LogViewer } from "@patternfly/react-log-viewer";
22
23
  import { Controller, useForm as useForm$3 } from "react-hook-form";
23
24
  import * as monaco from "monaco-editor";
@@ -437,6 +438,18 @@ function Trans(_ref) {
437
438
  ...additionalProps
438
439
  });
439
440
  }
441
+ const add_container$1 = "Add container";
442
+ const container_index$1 = "Container {{index}}";
443
+ const container_name$1 = "Container name";
444
+ const container_image$1 = "Container image";
445
+ const advanced_settings$1 = "Advanced settings";
446
+ const app$1 = {
447
+ add_container: add_container$1,
448
+ container_index: container_index$1,
449
+ container_name: container_name$1,
450
+ container_image: container_image$1,
451
+ advanced_settings: advanced_settings$1
452
+ };
440
453
  const copy$1 = "Copy";
441
454
  const reset_arguments$1 = "Reset";
442
455
  const view_changes$1 = "Show diff";
@@ -604,7 +617,7 @@ const available_state$1 = "Available";
604
617
  const bound_state$1 = "Bound";
605
618
  const released_state$1 = "Released";
606
619
  const failed_state$1 = "Failed";
607
- const exec_pod = "Execute shell";
620
+ const exec_pod$1 = "Execute shell";
608
621
  const search$1 = "Search";
609
622
  const edit_label$1 = "Edit label";
610
623
  const csi$1 = "CSI driver";
@@ -717,6 +730,11 @@ const pause_scheduling$1 = "Suspend scheduling";
717
730
  const port_name$1 = "Port name";
718
731
  const target_port_range_limit$1 = "Only integers between 1 and 65535, or strings, are supported.";
719
732
  const service_port_name_tip$1 = "When the port count is 1, this field is optional; when it is greater than 1, this field is mandatory.";
733
+ const network_error$1 = "Network error";
734
+ const retry_when_access_data_failed$1 = "Failed to load data. Click to retry.";
735
+ const service$1 = "Service";
736
+ const ingress$1 = "Ingress";
737
+ const fstype$1 = "Filesystem type";
720
738
  const dovetail$1 = {
721
739
  copy: copy$1,
722
740
  reset_arguments: reset_arguments$1,
@@ -888,7 +906,7 @@ const dovetail$1 = {
888
906
  bound_state: bound_state$1,
889
907
  released_state: released_state$1,
890
908
  failed_state: failed_state$1,
891
- exec_pod,
909
+ exec_pod: exec_pod$1,
892
910
  search: search$1,
893
911
  edit_label: edit_label$1,
894
912
  csi: csi$1,
@@ -1000,11 +1018,29 @@ const dovetail$1 = {
1000
1018
  pause_scheduling: pause_scheduling$1,
1001
1019
  port_name: port_name$1,
1002
1020
  target_port_range_limit: target_port_range_limit$1,
1003
- service_port_name_tip: service_port_name_tip$1
1021
+ service_port_name_tip: service_port_name_tip$1,
1022
+ network_error: network_error$1,
1023
+ retry_when_access_data_failed: retry_when_access_data_failed$1,
1024
+ service: service$1,
1025
+ ingress: ingress$1,
1026
+ fstype: fstype$1
1004
1027
  };
1005
1028
  const EN = {
1029
+ app: app$1,
1006
1030
  dovetail: dovetail$1
1007
1031
  };
1032
+ const add_container = "添加容器";
1033
+ const container_index = "容器 {{index}}";
1034
+ const container_name = "容器名称";
1035
+ const container_image = "容器镜像";
1036
+ const advanced_settings = "高级设置";
1037
+ const app = {
1038
+ add_container,
1039
+ container_index,
1040
+ container_name,
1041
+ container_image,
1042
+ advanced_settings
1043
+ };
1008
1044
  const copy = "复制";
1009
1045
  const reset_arguments = "重置";
1010
1046
  const view_changes = "查看改动";
@@ -1284,6 +1320,12 @@ const no_labels = "无标签";
1284
1320
  const no_annotations = "无注解";
1285
1321
  const pause_scheduling = "暂停调度";
1286
1322
  const service_port_name_tip = "端口数量为 1 时,名称为选填项;大于 1 时,名称为必填项。";
1323
+ const exec_pod = "执行 Shell";
1324
+ const network_error = "网络错误";
1325
+ const retry_when_access_data_failed = "数据加载失败,点击重试。";
1326
+ const service = "服务";
1327
+ const ingress = "Ingress";
1328
+ const fstype = "文件系统类型";
1287
1329
  const dovetail = {
1288
1330
  copy,
1289
1331
  reset_arguments,
@@ -1566,9 +1608,16 @@ const dovetail = {
1566
1608
  no_labels,
1567
1609
  no_annotations,
1568
1610
  pause_scheduling,
1569
- service_port_name_tip
1611
+ service_port_name_tip,
1612
+ exec_pod,
1613
+ network_error,
1614
+ retry_when_access_data_failed,
1615
+ service,
1616
+ ingress,
1617
+ fstype
1570
1618
  };
1571
1619
  const ZH = {
1620
+ app,
1572
1621
  dovetail
1573
1622
  };
1574
1623
  const resources = {
@@ -7300,9 +7349,7 @@ class K8sOpenAPI {
7300
7349
  return this.schemas;
7301
7350
  }
7302
7351
  try {
7303
- const response = await fetch(
7304
- `${this.pathPrefix}${this.resourceBasePath}`
7305
- );
7352
+ const response = await fetch(`${this.pathPrefix}${this.resourceBasePath}`);
7306
7353
  const result = await response.json();
7307
7354
  this.schemas = Object.values(result.components.schemas);
7308
7355
  if (this.schemas) {
@@ -7374,33 +7421,42 @@ function useApiGroupSchema() {
7374
7421
  loading: false,
7375
7422
  error: null
7376
7423
  });
7377
- const fetchSchema = useCallback(async (apiGroups, schemaUrlPrefix) => {
7378
- setState((prev) => ({ ...prev, loading: true, error: null }));
7379
- try {
7380
- const results = await Promise.all(
7381
- apiGroups.map(async (apiGroup) => {
7382
- if (state2.schemasMap[apiGroup]) {
7383
- return { apiGroup, schemas: state2.schemasMap[apiGroup] };
7384
- }
7385
- const groupSchemas = await schemaStore.fetchSchemas(apiGroup, schemaUrlPrefix);
7386
- return { apiGroup, schemas: groupSchemas || [] };
7387
- })
7388
- );
7389
- const newSchemasMap = results.reduce((acc, { apiGroup, schemas }) => {
7390
- acc[apiGroup] = schemas;
7391
- return acc;
7392
- }, {});
7393
- const allSchemas = results.flatMap(({ schemas }) => schemas);
7394
- setState({
7395
- schemas: allSchemas,
7396
- schemasMap: newSchemasMap,
7397
- loading: false,
7398
- error: null
7399
- });
7400
- } catch (e2) {
7401
- setState((prev) => ({ ...prev, loading: false, error: e2 }));
7402
- }
7403
- }, [state2.schemasMap]);
7424
+ const fetchSchema = useCallback(
7425
+ async (apiGroups, schemaUrlPrefix) => {
7426
+ setState((prev) => ({ ...prev, loading: true, error: null }));
7427
+ try {
7428
+ const results = await Promise.all(
7429
+ apiGroups.map(async (apiGroup) => {
7430
+ if (state2.schemasMap[apiGroup]) {
7431
+ return { apiGroup, schemas: state2.schemasMap[apiGroup] };
7432
+ }
7433
+ const groupSchemas = await schemaStore.fetchSchemas(
7434
+ apiGroup,
7435
+ schemaUrlPrefix
7436
+ );
7437
+ return { apiGroup, schemas: groupSchemas || [] };
7438
+ })
7439
+ );
7440
+ const newSchemasMap = results.reduce(
7441
+ (acc, { apiGroup, schemas }) => {
7442
+ acc[apiGroup] = schemas;
7443
+ return acc;
7444
+ },
7445
+ {}
7446
+ );
7447
+ const allSchemas = results.flatMap(({ schemas }) => schemas);
7448
+ setState({
7449
+ schemas: allSchemas,
7450
+ schemasMap: newSchemasMap,
7451
+ loading: false,
7452
+ error: null
7453
+ });
7454
+ } catch (e2) {
7455
+ setState((prev) => ({ ...prev, loading: false, error: e2 }));
7456
+ }
7457
+ },
7458
+ [state2.schemasMap]
7459
+ );
7404
7460
  return { ...state2, fetchSchema };
7405
7461
  }
7406
7462
  function useSchema(options) {
@@ -7416,7 +7472,11 @@ function useSchema(options) {
7416
7472
  setLoading(true);
7417
7473
  setError(null);
7418
7474
  try {
7419
- const schema2 = await schemaStore.fetchSchema((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.resourceBasePath, schemaUrlPrefix, (_b2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _b2.kind);
7475
+ const schema2 = await schemaStore.fetchSchema(
7476
+ (_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.resourceBasePath,
7477
+ schemaUrlPrefix,
7478
+ (_b2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _b2.kind
7479
+ );
7420
7480
  setSchema(schema2 || null);
7421
7481
  setError(null);
7422
7482
  } catch (e2) {
@@ -7437,6 +7497,34 @@ function useSchema(options) {
7437
7497
  fetchSchema
7438
7498
  };
7439
7499
  }
7500
+ const useDeleteManyModal = (resource, ids) => {
7501
+ const { mutate } = useDeleteMany();
7502
+ const [visible, setVisible] = useState(false);
7503
+ const { t: t2 } = useTranslation();
7504
+ const modalProps = {
7505
+ title: t2("dovetail.delete"),
7506
+ okText: t2("dovetail.delete"),
7507
+ okButtonProps: {
7508
+ danger: true
7509
+ },
7510
+ cancelText: t2("dovetail.cancel"),
7511
+ children: t2("dovetail.confirm_delete_text", {
7512
+ target: ids,
7513
+ interpolation: { escapeValue: false }
7514
+ }),
7515
+ onOk() {
7516
+ mutate({
7517
+ resource,
7518
+ ids
7519
+ });
7520
+ setVisible(false);
7521
+ },
7522
+ onCancel() {
7523
+ setVisible(false);
7524
+ }
7525
+ };
7526
+ return { modalProps, visible, setVisible };
7527
+ };
7440
7528
  const ConfigsContext = createContext({});
7441
7529
  function getCommonErrors(responseBody, i18n2) {
7442
7530
  var _a;
@@ -7480,12 +7568,16 @@ function getCommonErrors(responseBody, i18n2) {
7480
7568
  }
7481
7569
  return [
7482
7570
  i18n2.t(
7483
- [`error.${responseBody.code}`, `error.${responseBody.reason}`, responseBody.message || ""],
7571
+ [
7572
+ `error.${responseBody.code}`,
7573
+ `error.${responseBody.reason}`,
7574
+ responseBody.message || ""
7575
+ ],
7484
7576
  { fallbackLng: "" }
7485
7577
  )
7486
7578
  ];
7487
7579
  }
7488
- const tag_18x9v7m = "";
7580
+ const tag_19ts6m8 = "";
7489
7581
  const StateTagStyle = "s82411";
7490
7582
  const NameTagStyle = "n9ja9cs";
7491
7583
  function shortenedImage(image2) {
@@ -7885,48 +7977,6 @@ function NameInputWidget(props) {
7885
7977
  const { action } = useResource();
7886
7978
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Input, { ...props, disabled: action === "edit" });
7887
7979
  }
7888
- const dnsSubDomainRules = [
7889
- {
7890
- required: true,
7891
- message: "名称不能为空"
7892
- },
7893
- {
7894
- pattern: /^[a-z0-9]([-.a-z0-9]*[a-z0-9])?$/,
7895
- message: "名称只能包含小写字母、数字,以及 '-' 和 '.',且必须以字母或数字开头和结束"
7896
- },
7897
- {
7898
- max: 253,
7899
- message: "名称长度不能超过253个字符"
7900
- }
7901
- ];
7902
- const rfc1123LabelRules = [
7903
- {
7904
- required: true,
7905
- message: "名称不能为空"
7906
- },
7907
- {
7908
- pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/,
7909
- message: "名称只能包含小写字母、数字,以及 '-',且以字母或数字开头和结束"
7910
- },
7911
- {
7912
- max: 63,
7913
- message: "名称长度不能超过63个字符"
7914
- }
7915
- ];
7916
- const rfc1035LabelRules = [
7917
- {
7918
- required: true,
7919
- message: "名称不能为空"
7920
- },
7921
- {
7922
- pattern: /^[a-z]([-a-z0-9]*[a-z0-9])?$/,
7923
- message: "名称只能包含小写字母、数字,以及 '-',且以字母开头,字母或数字结束"
7924
- },
7925
- {
7926
- max: 63,
7927
- message: "名称长度不能超过63个字符"
7928
- }
7929
- ];
7930
7980
  function NamespaceSelectWidget(props) {
7931
7981
  const { action } = useResource();
7932
7982
  const { data: data2 } = useList({
@@ -7988,10 +8038,13 @@ function KeyValueListWidget(props) {
7988
8038
  const onChange = useCallback(
7989
8039
  (newItems) => {
7990
8040
  var _a;
7991
- const newValue = newItems.reduce((result, item) => {
7992
- result[item.key] = item.value;
7993
- return result;
7994
- }, {});
8041
+ const newValue = newItems.reduce(
8042
+ (result, item) => {
8043
+ result[item.key] = item.value;
8044
+ return result;
8045
+ },
8046
+ {}
8047
+ );
7995
8048
  (_a = props.onChange) == null ? void 0 : _a.call(props, newValue);
7996
8049
  },
7997
8050
  [props]
@@ -8037,7 +8090,7 @@ function KeyValueListWidget(props) {
8037
8090
  }
8038
8091
  function MetadataForm() {
8039
8092
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
8040
- /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { label: "Name", name: ["metadata", "name"], rules: rfc1123LabelRules, children: /* @__PURE__ */ jsxRuntimeExports.jsx(NameInputWidget, {}) }),
8093
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Form.Item, { label: "Name", name: ["metadata", "name"], children: /* @__PURE__ */ jsxRuntimeExports.jsx(NameInputWidget, {}) }),
8041
8094
  /* @__PURE__ */ jsxRuntimeExports.jsx(
8042
8095
  Form.Item,
8043
8096
  {
@@ -8052,6 +8105,12 @@ function MetadataForm() {
8052
8105
  ] });
8053
8106
  }
8054
8107
  const ComponentContext = createContext({});
8108
+ function ComponentContextProvider({
8109
+ value: value2,
8110
+ children
8111
+ }) {
8112
+ return React.createElement(ComponentContext.Provider, { value: value2 }, children);
8113
+ }
8055
8114
  const GlobalStoreContext = createContext({});
8056
8115
  const index_1s9fcl3 = "";
8057
8116
  const ErrorWrapper = /* @__PURE__ */ styled_default("div")({
@@ -8215,21 +8274,31 @@ function Table$1(props) {
8215
8274
  })]
8216
8275
  });
8217
8276
  }
8218
- function useTableData({ data: data2, columns, pageSize = 10, defaultSorters }) {
8277
+ function useTableData({
8278
+ data: data2,
8279
+ columns,
8280
+ pageSize = 10,
8281
+ defaultSorters
8282
+ }) {
8219
8283
  const [currentPage, setCurrentPage] = useState(1);
8220
8284
  const [sorters, setSorters] = useState(defaultSorters || []);
8221
- const onSorterChange = useCallback((order, key2) => {
8222
- var _a;
8223
- const ORDER_MAP = {
8224
- descend: "desc",
8225
- ascend: "asc"
8226
- };
8227
- const sorters2 = [{
8228
- field: (_a = columns.find((col) => col.key === key2)) == null ? void 0 : _a.dataIndex,
8229
- order: order ? ORDER_MAP[order] : order
8230
- }];
8231
- setSorters(sorters2);
8232
- }, [columns]);
8285
+ const onSorterChange = useCallback(
8286
+ (order, key2) => {
8287
+ var _a;
8288
+ const ORDER_MAP = {
8289
+ descend: "desc",
8290
+ ascend: "asc"
8291
+ };
8292
+ const sorters2 = [
8293
+ {
8294
+ field: (_a = columns.find((col) => col.key === key2)) == null ? void 0 : _a.dataIndex,
8295
+ order: order ? ORDER_MAP[order] : order
8296
+ }
8297
+ ];
8298
+ setSorters(sorters2);
8299
+ },
8300
+ [columns]
8301
+ );
8233
8302
  return {
8234
8303
  data: paginateData(
8235
8304
  {
@@ -8309,7 +8378,7 @@ const PodSelectorTable = ({ podSelectors = {} }) => {
8309
8378
  }
8310
8379
  );
8311
8380
  };
8312
- const PortsTable = ({ service }) => {
8381
+ const PortsTable = ({ service: service2 }) => {
8313
8382
  const { t: t2 } = useTranslation();
8314
8383
  const component = useContext(ComponentContext);
8315
8384
  const Table2 = component.Table || Table$1;
@@ -8356,7 +8425,7 @@ const PortsTable = ({ service }) => {
8356
8425
  width: 199
8357
8426
  }
8358
8427
  ];
8359
- const ports = (service._rawYaml.spec.ports || []).map((port2) => ({
8428
+ const ports = (service2._rawYaml.spec.ports || []).map((port2) => ({
8360
8429
  ...port2,
8361
8430
  id: port2.name || ""
8362
8431
  }));
@@ -8771,6 +8840,38 @@ function PVCDistributeStorage({
8771
8840
  )
8772
8841
  ] });
8773
8842
  }
8843
+ const index_1oorxg6 = "";
8844
+ const CopyIconStyle = "c1oll6q9";
8845
+ const CopyButton = ({
8846
+ value: value2,
8847
+ className
8848
+ }) => {
8849
+ const {
8850
+ i18n: i18n2
8851
+ } = useTranslation();
8852
+ const [tooltip, setTooltip] = useState(i18n2.t("dovetail.copy"));
8853
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
8854
+ title: tooltip,
8855
+ onVisibleChange: (visible) => {
8856
+ if (!visible) {
8857
+ setTimeout(() => {
8858
+ setTooltip(i18n2.t("dovetail.copy"));
8859
+ }, 80);
8860
+ }
8861
+ },
8862
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, {
8863
+ src: ClipboardCopy16GradientGrayIcon,
8864
+ hoverSrc: ClipboardCopy16GradientBlueIcon,
8865
+ className: cx_default(CopyIconStyle, className),
8866
+ iconWidth: 16,
8867
+ iconHeight: 16,
8868
+ onClick: () => {
8869
+ copyToClipboard$1(value2);
8870
+ setTooltip(i18n2.t("dovetail.copied"));
8871
+ }
8872
+ })
8873
+ });
8874
+ };
8774
8875
  class ResourceModel {
8775
8876
  constructor(_rawYaml, _globalStore) {
8776
8877
  __publicField(this, "id");
@@ -8888,74 +8989,70 @@ const BASE_INIT_VALUE = {
8888
8989
  }
8889
8990
  };
8890
8991
  const DEPLOYMENT_INIT_VALUE = {
8891
- "apiVersion": "apps/v1",
8892
- "kind": "Deployment",
8893
- "metadata": {
8894
- "name": "example",
8895
- "namespace": "default"
8992
+ apiVersion: "apps/v1",
8993
+ kind: "Deployment",
8994
+ metadata: {
8995
+ name: "example",
8996
+ namespace: "default"
8896
8997
  },
8897
- "spec": {
8898
- "selector": {
8899
- "matchLabels": {
8900
- "app": "deployment-example"
8998
+ spec: {
8999
+ selector: {
9000
+ matchLabels: {
9001
+ app: "deployment-example"
8901
9002
  }
8902
9003
  },
8903
- "replicas": 3,
8904
- "template": {
8905
- "metadata": {
8906
- "labels": {
8907
- "app": "deployment-example"
9004
+ replicas: 3,
9005
+ template: {
9006
+ metadata: {
9007
+ labels: {
9008
+ app: "deployment-example"
8908
9009
  }
8909
9010
  },
8910
- "spec": {
8911
- "containers": [
9011
+ spec: {
9012
+ containers: [
8912
9013
  {
8913
- "name": "deployment-example",
8914
- "image": "registry.smtx.io/kubesmart/bitnami/nginx:1.25.2-debian-11-r2",
8915
- "ports": [
9014
+ name: "deployment-example",
9015
+ image: "registry.smtx.io/kubesmart/bitnami/nginx:1.25.2-debian-11-r2",
9016
+ ports: [
8916
9017
  {
8917
- "containerPort": 8080,
8918
- "protocol": "TCP"
9018
+ containerPort: 8080,
9019
+ protocol: "TCP"
8919
9020
  }
8920
9021
  ]
8921
9022
  }
8922
9023
  ]
8923
9024
  }
8924
9025
  },
8925
- "strategy": {
8926
- "type": "RollingUpdate",
8927
- "rollingUpdate": {
8928
- "maxSurge": "25%",
8929
- "maxUnavailable": "25%"
9026
+ strategy: {
9027
+ type: "RollingUpdate",
9028
+ rollingUpdate: {
9029
+ maxSurge: "25%",
9030
+ maxUnavailable: "25%"
8930
9031
  }
8931
9032
  }
8932
9033
  }
8933
9034
  };
8934
9035
  const CRONJOB_INIT_VALUE = {
8935
- "apiVersion": "batch/v1",
8936
- "kind": "CronJob",
8937
- "metadata": {
8938
- "name": "example",
8939
- "namespace": "default"
9036
+ apiVersion: "batch/v1",
9037
+ kind: "CronJob",
9038
+ metadata: {
9039
+ name: "example",
9040
+ namespace: "default"
8940
9041
  },
8941
- "spec": {
8942
- "schedule": "@daily",
8943
- "jobTemplate": {
8944
- "spec": {
8945
- "template": {
8946
- "spec": {
8947
- "containers": [
9042
+ spec: {
9043
+ schedule: "@daily",
9044
+ jobTemplate: {
9045
+ spec: {
9046
+ template: {
9047
+ spec: {
9048
+ containers: [
8948
9049
  {
8949
- "name": "example",
8950
- "image": "registry.smtx.io/kubesmart/alpine:3",
8951
- "args": [
8952
- "/bin/sh",
8953
- "-c",
8954
- "date; echo Hello from the Kubernetes cluster"
8955
- ]
9050
+ name: "example",
9051
+ image: "registry.smtx.io/kubesmart/alpine:3",
9052
+ args: ["/bin/sh", "-c", "date; echo Hello from the Kubernetes cluster"]
8956
9053
  }
8957
9054
  ],
8958
- "restartPolicy": "OnFailure"
9055
+ restartPolicy: "OnFailure"
8959
9056
  }
8960
9057
  }
8961
9058
  }
@@ -8963,32 +9060,32 @@ const CRONJOB_INIT_VALUE = {
8963
9060
  }
8964
9061
  };
8965
9062
  const DAEMONSET_INIT_VALUE = {
8966
- "apiVersion": "apps/v1",
8967
- "kind": "DaemonSet",
8968
- "metadata": {
8969
- "name": "example",
8970
- "namespace": "default"
9063
+ apiVersion: "apps/v1",
9064
+ kind: "DaemonSet",
9065
+ metadata: {
9066
+ name: "example",
9067
+ namespace: "default"
8971
9068
  },
8972
- "spec": {
8973
- "selector": {
8974
- "matchLabels": {
8975
- "app": "daemonset-example"
9069
+ spec: {
9070
+ selector: {
9071
+ matchLabels: {
9072
+ app: "daemonset-example"
8976
9073
  }
8977
9074
  },
8978
- "template": {
8979
- "metadata": {
8980
- "labels": {
8981
- "app": "daemonset-example"
9075
+ template: {
9076
+ metadata: {
9077
+ labels: {
9078
+ app: "daemonset-example"
8982
9079
  }
8983
9080
  },
8984
- "spec": {
8985
- "containers": [
9081
+ spec: {
9082
+ containers: [
8986
9083
  {
8987
- "name": "daemonset-example",
8988
- "image": "registry.smtx.io/kubesmart/bitnami/nginx:1.25.2-debian-11-r2",
8989
- "ports": [
9084
+ name: "daemonset-example",
9085
+ image: "registry.smtx.io/kubesmart/bitnami/nginx:1.25.2-debian-11-r2",
9086
+ ports: [
8990
9087
  {
8991
- "containerPort": 8080
9088
+ containerPort: 8080
8992
9089
  }
8993
9090
  ]
8994
9091
  }
@@ -8998,98 +9095,86 @@ const DAEMONSET_INIT_VALUE = {
8998
9095
  }
8999
9096
  };
9000
9097
  const JOB_INIT_VALUE = {
9001
- "apiVersion": "batch/v1",
9002
- "kind": "Job",
9003
- "metadata": {
9004
- "name": "example",
9005
- "namespace": "default"
9098
+ apiVersion: "batch/v1",
9099
+ kind: "Job",
9100
+ metadata: {
9101
+ name: "example",
9102
+ namespace: "default"
9006
9103
  },
9007
- "spec": {
9008
- "selector": {},
9009
- "template": {
9010
- "metadata": {
9011
- "name": "job-example"
9104
+ spec: {
9105
+ selector: {},
9106
+ template: {
9107
+ metadata: {
9108
+ name: "job-example"
9012
9109
  },
9013
- "spec": {
9014
- "containers": [
9110
+ spec: {
9111
+ containers: [
9015
9112
  {
9016
- "name": "job-example",
9017
- "image": "registry.smtx.io/kubesmart/alpine:3",
9018
- "command": [
9019
- "/bin/sh",
9020
- "-c",
9021
- "date; echo Hello from the Kubernetes cluster"
9022
- ]
9113
+ name: "job-example",
9114
+ image: "registry.smtx.io/kubesmart/alpine:3",
9115
+ command: ["/bin/sh", "-c", "date; echo Hello from the Kubernetes cluster"]
9023
9116
  }
9024
9117
  ],
9025
- "restartPolicy": "Never"
9118
+ restartPolicy: "Never"
9026
9119
  }
9027
9120
  }
9028
9121
  }
9029
9122
  };
9030
9123
  const STATEFULSET_INIT_VALUE = {
9031
- "apiVersion": "apps/v1",
9032
- "kind": "StatefulSet",
9033
- "metadata": {
9034
- "name": "example",
9035
- "namespace": "default"
9124
+ apiVersion: "apps/v1",
9125
+ kind: "StatefulSet",
9126
+ metadata: {
9127
+ name: "example",
9128
+ namespace: "default"
9036
9129
  },
9037
- "spec": {
9038
- "serviceName": "statefulset-example",
9039
- "replicas": 3,
9040
- "selector": {
9041
- "matchLabels": {
9042
- "app": "statefulset-example"
9130
+ spec: {
9131
+ serviceName: "statefulset-example",
9132
+ replicas: 3,
9133
+ selector: {
9134
+ matchLabels: {
9135
+ app: "statefulset-example"
9043
9136
  }
9044
9137
  },
9045
- "template": {
9046
- "metadata": {
9047
- "labels": {
9048
- "app": "statefulset-example"
9138
+ template: {
9139
+ metadata: {
9140
+ labels: {
9141
+ app: "statefulset-example"
9049
9142
  }
9050
9143
  },
9051
- "spec": {
9052
- "terminationGracePeriodSeconds": 10,
9053
- "containers": [
9144
+ spec: {
9145
+ terminationGracePeriodSeconds: 10,
9146
+ containers: [
9054
9147
  {
9055
- "name": "statefulset-example",
9056
- "image": "registry.smtx.io/kubesmart/fileserver:v1.0.0",
9057
- "command": [
9058
- "dufs"
9059
- ],
9060
- "args": [
9061
- "-A",
9062
- "--render-try-index",
9063
- "/data"
9064
- ],
9065
- "ports": [
9148
+ name: "statefulset-example",
9149
+ image: "registry.smtx.io/kubesmart/fileserver:v1.0.0",
9150
+ command: ["dufs"],
9151
+ args: ["-A", "--render-try-index", "/data"],
9152
+ ports: [
9066
9153
  {
9067
- "containerPort": 5e3,
9068
- "name": "http"
9154
+ containerPort: 5e3,
9155
+ name: "http"
9069
9156
  }
9070
9157
  ],
9071
- "volumeMounts": [
9158
+ volumeMounts: [
9072
9159
  {
9073
- "name": "file",
9074
- "mountPath": "/data"
9160
+ name: "file",
9161
+ mountPath: "/data"
9075
9162
  }
9076
9163
  ]
9077
9164
  }
9078
9165
  ]
9079
9166
  }
9080
9167
  },
9081
- "volumeClaimTemplates": [
9168
+ volumeClaimTemplates: [
9082
9169
  {
9083
- "metadata": {
9084
- "name": "file"
9170
+ metadata: {
9171
+ name: "file"
9085
9172
  },
9086
- "spec": {
9087
- "accessModes": [
9088
- "ReadWriteOnce"
9089
- ],
9090
- "resources": {
9091
- "requests": {
9092
- "storage": "1Gi"
9173
+ spec: {
9174
+ accessModes: ["ReadWriteOnce"],
9175
+ resources: {
9176
+ requests: {
9177
+ storage: "1Gi"
9093
9178
  }
9094
9179
  }
9095
9180
  }
@@ -9098,37 +9183,35 @@ const STATEFULSET_INIT_VALUE = {
9098
9183
  }
9099
9184
  };
9100
9185
  const POD_INIT_VALUE = {
9101
- "apiVersion": "v1",
9102
- "kind": "Pod",
9103
- "metadata": {
9104
- "name": "example",
9105
- "namespace": "default",
9106
- "labels": {
9107
- "app": "example"
9186
+ apiVersion: "v1",
9187
+ kind: "Pod",
9188
+ metadata: {
9189
+ name: "example",
9190
+ namespace: "default",
9191
+ labels: {
9192
+ app: "example"
9108
9193
  }
9109
9194
  },
9110
- "spec": {
9111
- "securityContext": {
9112
- "runAsNonRoot": true,
9113
- "seccompProfile": {
9114
- "type": "RuntimeDefault"
9195
+ spec: {
9196
+ securityContext: {
9197
+ runAsNonRoot: true,
9198
+ seccompProfile: {
9199
+ type: "RuntimeDefault"
9115
9200
  }
9116
9201
  },
9117
- "containers": [
9202
+ containers: [
9118
9203
  {
9119
- "name": "example",
9120
- "image": "registry.smtx.io/kubesmart/bitnami/nginx:1.25.2-debian-11-r2",
9121
- "ports": [
9204
+ name: "example",
9205
+ image: "registry.smtx.io/kubesmart/bitnami/nginx:1.25.2-debian-11-r2",
9206
+ ports: [
9122
9207
  {
9123
- "containerPort": 8080
9208
+ containerPort: 8080
9124
9209
  }
9125
9210
  ],
9126
- "securityContext": {
9127
- "allowPrivilegeEscalation": false,
9128
- "capabilities": {
9129
- "drop": [
9130
- "ALL"
9131
- ]
9211
+ securityContext: {
9212
+ allowPrivilegeEscalation: false,
9213
+ capabilities: {
9214
+ drop: ["ALL"]
9132
9215
  }
9133
9216
  }
9134
9217
  }
@@ -9136,143 +9219,143 @@ const POD_INIT_VALUE = {
9136
9219
  }
9137
9220
  };
9138
9221
  const SERVICE_CLUSTER_IP_INIT_VALUE = {
9139
- "apiVersion": "v1",
9140
- "kind": "Service",
9141
- "metadata": {
9142
- "name": "example",
9143
- "namespace": "default"
9222
+ apiVersion: "v1",
9223
+ kind: "Service",
9224
+ metadata: {
9225
+ name: "example",
9226
+ namespace: "default"
9144
9227
  },
9145
- "spec": {
9146
- "selector": {
9147
- "app": "example"
9228
+ spec: {
9229
+ selector: {
9230
+ app: "example"
9148
9231
  },
9149
- "ports": [
9232
+ ports: [
9150
9233
  {
9151
- "name": "example",
9152
- "port": 8080,
9153
- "protocol": "TCP",
9154
- "targetPort": 8080
9234
+ name: "example",
9235
+ port: 8080,
9236
+ protocol: "TCP",
9237
+ targetPort: 8080
9155
9238
  }
9156
9239
  ],
9157
- "sessionAffinity": "None",
9158
- "type": "ClusterIP"
9240
+ sessionAffinity: "None",
9241
+ type: "ClusterIP"
9159
9242
  }
9160
9243
  };
9161
9244
  const SERVICE_NODE_PORT_INIT_VALUE = {
9162
- "apiVersion": "v1",
9163
- "kind": "Service",
9164
- "metadata": {
9165
- "name": "example",
9166
- "namespace": "default"
9245
+ apiVersion: "v1",
9246
+ kind: "Service",
9247
+ metadata: {
9248
+ name: "example",
9249
+ namespace: "default"
9167
9250
  },
9168
- "spec": {
9169
- "selector": {
9170
- "app": "example"
9251
+ spec: {
9252
+ selector: {
9253
+ app: "example"
9171
9254
  },
9172
- "ports": [
9255
+ ports: [
9173
9256
  {
9174
- "name": "example",
9175
- "port": 8080,
9176
- "protocol": "TCP",
9177
- "targetPort": 8080
9257
+ name: "example",
9258
+ port: 8080,
9259
+ protocol: "TCP",
9260
+ targetPort: 8080
9178
9261
  }
9179
9262
  ],
9180
- "sessionAffinity": "None",
9181
- "type": "NodePort"
9263
+ sessionAffinity: "None",
9264
+ type: "NodePort"
9182
9265
  }
9183
9266
  };
9184
9267
  const SERVICE_LOAD_BALANCER_INIT_VALUE = {
9185
- "apiVersion": "v1",
9186
- "kind": "Service",
9187
- "metadata": {
9188
- "name": "example",
9189
- "namespace": "default"
9268
+ apiVersion: "v1",
9269
+ kind: "Service",
9270
+ metadata: {
9271
+ name: "example",
9272
+ namespace: "default"
9190
9273
  },
9191
- "spec": {
9192
- "selector": {
9193
- "app": "example"
9274
+ spec: {
9275
+ selector: {
9276
+ app: "example"
9194
9277
  },
9195
- "ports": [
9278
+ ports: [
9196
9279
  {
9197
- "name": "example",
9198
- "port": 80,
9199
- "protocol": "TCP",
9200
- "targetPort": 8080
9280
+ name: "example",
9281
+ port: 80,
9282
+ protocol: "TCP",
9283
+ targetPort: 8080
9201
9284
  }
9202
9285
  ],
9203
- "sessionAffinity": "None",
9204
- "type": "LoadBalancer"
9286
+ sessionAffinity: "None",
9287
+ type: "LoadBalancer"
9205
9288
  }
9206
9289
  };
9207
9290
  const SERVICE_EXTERNAL_NAME_INIT_VALUE = {
9208
- "apiVersion": "v1",
9209
- "kind": "Service",
9210
- "metadata": {
9211
- "name": "example",
9212
- "namespace": "default"
9291
+ apiVersion: "v1",
9292
+ kind: "Service",
9293
+ metadata: {
9294
+ name: "example",
9295
+ namespace: "default"
9213
9296
  },
9214
- "spec": {
9215
- "selector": {
9216
- "app": "example"
9297
+ spec: {
9298
+ selector: {
9299
+ app: "example"
9217
9300
  },
9218
- "ports": [
9301
+ ports: [
9219
9302
  {
9220
- "name": "example",
9221
- "port": 8080,
9222
- "protocol": "TCP",
9223
- "targetPort": 8080
9303
+ name: "example",
9304
+ port: 8080,
9305
+ protocol: "TCP",
9306
+ targetPort: 8080
9224
9307
  }
9225
9308
  ],
9226
- "sessionAffinity": "None",
9227
- "type": "ExternalName",
9228
- "externalName": "app.example.com"
9309
+ sessionAffinity: "None",
9310
+ type: "ExternalName",
9311
+ externalName: "app.example.com"
9229
9312
  }
9230
9313
  };
9231
9314
  const SERVICE_HEADLESS_INIT_VALUE = {
9232
- "apiVersion": "v1",
9233
- "kind": "Service",
9234
- "metadata": {
9235
- "name": "example",
9236
- "namespace": "default"
9315
+ apiVersion: "v1",
9316
+ kind: "Service",
9317
+ metadata: {
9318
+ name: "example",
9319
+ namespace: "default"
9237
9320
  },
9238
- "spec": {
9239
- "selector": {
9240
- "app": "example"
9321
+ spec: {
9322
+ selector: {
9323
+ app: "example"
9241
9324
  },
9242
- "clusterIP": "None",
9243
- "ports": [
9325
+ clusterIP: "None",
9326
+ ports: [
9244
9327
  {
9245
- "name": "example",
9246
- "port": null,
9247
- "protocol": "TCP",
9248
- "targetPort": null
9328
+ name: "example",
9329
+ port: null,
9330
+ protocol: "TCP",
9331
+ targetPort: null
9249
9332
  }
9250
9333
  ],
9251
- "sessionAffinity": "None",
9252
- "type": "ClusterIP"
9334
+ sessionAffinity: "None",
9335
+ type: "ClusterIP"
9253
9336
  }
9254
9337
  };
9255
9338
  const INGRESS_INIT_VALUE = {
9256
- "apiVersion": "networking.k8s.io/v1",
9257
- "kind": "Ingress",
9258
- "metadata": {
9259
- "name": "example",
9260
- "namespace": "default"
9339
+ apiVersion: "networking.k8s.io/v1",
9340
+ kind: "Ingress",
9341
+ metadata: {
9342
+ name: "example",
9343
+ namespace: "default"
9261
9344
  },
9262
- "spec": {
9263
- "rules": [
9345
+ spec: {
9346
+ rules: [
9264
9347
  {
9265
- "host": "example.com",
9266
- "http": {
9267
- "paths": [
9348
+ host: "example.com",
9349
+ http: {
9350
+ paths: [
9268
9351
  {
9269
- "path": "/testpath",
9270
- "pathType": "Prefix",
9271
- "backend": {
9272
- "service": {
9273
- "name": "test",
9274
- "port": {
9275
- "number": 80
9352
+ path: "/testpath",
9353
+ pathType: "Prefix",
9354
+ backend: {
9355
+ service: {
9356
+ name: "test",
9357
+ port: {
9358
+ number: 80
9276
9359
  }
9277
9360
  }
9278
9361
  }
@@ -9284,28 +9367,28 @@ const INGRESS_INIT_VALUE = {
9284
9367
  }
9285
9368
  };
9286
9369
  const NETWORK_POLICY_INIT_VALUE = {
9287
- "apiVersion": "networking.k8s.io/v1",
9288
- "kind": "NetworkPolicy",
9289
- "metadata": {
9290
- "name": "example",
9291
- "namespace": "default"
9370
+ apiVersion: "networking.k8s.io/v1",
9371
+ kind: "NetworkPolicy",
9372
+ metadata: {
9373
+ name: "example",
9374
+ namespace: "default"
9292
9375
  },
9293
- "spec": {
9294
- "podSelector": {},
9295
- "policyTypes": []
9376
+ spec: {
9377
+ podSelector: {},
9378
+ policyTypes: []
9296
9379
  }
9297
9380
  };
9298
9381
  const CONFIG_MAP_INIT_VALUE = {
9299
- "apiVersion": "v1",
9300
- "kind": "ConfigMap",
9301
- "metadata": {
9302
- "name": "example",
9303
- "namespace": "default"
9382
+ apiVersion: "v1",
9383
+ kind: "ConfigMap",
9384
+ metadata: {
9385
+ name: "example",
9386
+ namespace: "default"
9304
9387
  },
9305
- "data": {
9306
- "key": "value"
9388
+ data: {
9389
+ key: "value"
9307
9390
  },
9308
- "immutable": false
9391
+ immutable: false
9309
9392
  };
9310
9393
  const SERVER_INSTANCE_INIT_VALUE = {
9311
9394
  apiVersion: "kubesmart.smtx.io/v1alpha1",
@@ -9327,138 +9410,136 @@ const SERVER_INSTANCE_INIT_VALUE = {
9327
9410
  };
9328
9411
  const REDEPLOY_TIMESTAMP_KEY = "kubectl.kubernetes.io/restartedAt";
9329
9412
  const SECRET_OPAQUE_INIT_VALUE = {
9330
- "apiVersion": "v1",
9331
- "kind": "Secret",
9332
- "metadata": {
9333
- "name": "example",
9334
- "namespace": "default"
9413
+ apiVersion: "v1",
9414
+ kind: "Secret",
9415
+ metadata: {
9416
+ name: "example",
9417
+ namespace: "default"
9335
9418
  },
9336
- "type": "Opaque",
9337
- "data": {
9338
- "key": "value"
9419
+ type: "Opaque",
9420
+ data: {
9421
+ key: "value"
9339
9422
  }
9340
9423
  };
9341
9424
  const SECRET_IMAGE_REPO_INIT_VALUE = {
9342
- "apiVersion": "v1",
9343
- "kind": "Secret",
9344
- "metadata": {
9345
- "name": "example",
9346
- "namespace": "default"
9425
+ apiVersion: "v1",
9426
+ kind: "Secret",
9427
+ metadata: {
9428
+ name: "example",
9429
+ namespace: "default"
9347
9430
  },
9348
- "type": "kubernetes.io/dockerconfigjson",
9349
- "data": {
9431
+ type: "kubernetes.io/dockerconfigjson",
9432
+ data: {
9350
9433
  ".dockerconfigjson": ""
9351
9434
  }
9352
9435
  };
9353
9436
  const SECRET_BASIC_AUTH_INIT_VALUE = {
9354
- "apiVersion": "v1",
9355
- "kind": "Secret",
9356
- "metadata": {
9357
- "name": "example",
9358
- "namespace": "default"
9437
+ apiVersion: "v1",
9438
+ kind: "Secret",
9439
+ metadata: {
9440
+ name: "example",
9441
+ namespace: "default"
9359
9442
  },
9360
- "type": "kubernetes.io/basic-auth",
9361
- "data": {
9362
- "username": "example",
9363
- "password": "example"
9443
+ type: "kubernetes.io/basic-auth",
9444
+ data: {
9445
+ username: "example",
9446
+ password: "example"
9364
9447
  }
9365
9448
  };
9366
9449
  const SECRET_SSH_AUTH_INIT_VALUE = {
9367
- "apiVersion": "v1",
9368
- "kind": "Secret",
9369
- "metadata": {
9370
- "name": "example",
9371
- "namespace": "default"
9450
+ apiVersion: "v1",
9451
+ kind: "Secret",
9452
+ metadata: {
9453
+ name: "example",
9454
+ namespace: "default"
9372
9455
  },
9373
- "type": "kubernetes.io/ssh-auth",
9374
- "data": {
9456
+ type: "kubernetes.io/ssh-auth",
9457
+ data: {
9375
9458
  "ssh-publickey": "",
9376
9459
  "ssh-privatekey": ""
9377
9460
  }
9378
9461
  };
9379
9462
  const SECRET_TLS_INIT_VALUE = {
9380
- "apiVersion": "v1",
9381
- "kind": "Secret",
9382
- "metadata": {
9383
- "name": "example",
9384
- "namespace": "default"
9463
+ apiVersion: "v1",
9464
+ kind: "Secret",
9465
+ metadata: {
9466
+ name: "example",
9467
+ namespace: "default"
9385
9468
  },
9386
- "type": "kubernetes.io/tls",
9387
- "data": {
9469
+ type: "kubernetes.io/tls",
9470
+ data: {
9388
9471
  "tls.crt": "",
9389
9472
  "tls.key": ""
9390
9473
  }
9391
9474
  };
9392
9475
  const SECRET_CUSTOM_INIT_VALUE = {
9393
- "apiVersion": "v1",
9394
- "kind": "Secret",
9395
- "metadata": {
9396
- "name": "example",
9397
- "namespace": "default"
9476
+ apiVersion: "v1",
9477
+ kind: "Secret",
9478
+ metadata: {
9479
+ name: "example",
9480
+ namespace: "default"
9398
9481
  },
9399
- "type": "",
9400
- "data": {}
9482
+ type: "",
9483
+ data: {}
9401
9484
  };
9402
9485
  const NODE_INIT_VALUE = {
9403
- "apiVersion": "v1",
9404
- "kind": "Node",
9405
- "metadata": {
9406
- "name": "example",
9407
- "namespace": "default"
9486
+ apiVersion: "v1",
9487
+ kind: "Node",
9488
+ metadata: {
9489
+ name: "example",
9490
+ namespace: "default"
9408
9491
  },
9409
- "spec": {}
9492
+ spec: {}
9410
9493
  };
9411
9494
  const STORAGE_CLASS_INIT_VALUE = {
9412
- "apiVersion": "storage.k8s.io/v1",
9413
- "kind": "StorageClass",
9414
- "metadata": {
9415
- "name": ""
9495
+ apiVersion: "storage.k8s.io/v1",
9496
+ kind: "StorageClass",
9497
+ metadata: {
9498
+ name: ""
9416
9499
  },
9417
- "parameters": {
9500
+ parameters: {
9418
9501
  "csi.storage.k8s.io/fstype": "ext4"
9419
9502
  },
9420
- "provisioner": "",
9421
- "reclaimPolicy": "Delete",
9422
- "allowVolumeExpansion": true,
9423
- "volumeBindingMode": "Immediate"
9503
+ provisioner: "",
9504
+ reclaimPolicy: "Delete",
9505
+ allowVolumeExpansion: true,
9506
+ volumeBindingMode: "Immediate"
9424
9507
  };
9425
9508
  const PV_INIT_VALUE = {
9426
- "apiVersion": "v1",
9427
- "kind": "PersistentVolume",
9428
- "metadata": {
9429
- "name": "pvc-hostpath"
9509
+ apiVersion: "v1",
9510
+ kind: "PersistentVolume",
9511
+ metadata: {
9512
+ name: "pvc-hostpath"
9430
9513
  },
9431
- "spec": {
9432
- "accessModes": [
9433
- "ReadWriteOnce"
9434
- ],
9435
- "capacity": {
9436
- "storage": "10Gi"
9514
+ spec: {
9515
+ accessModes: ["ReadWriteOnce"],
9516
+ capacity: {
9517
+ storage: "10Gi"
9437
9518
  },
9438
- "hostPath": {
9439
- "type": "DirectoryOrCreate",
9440
- "path": "/root/test"
9519
+ hostPath: {
9520
+ type: "DirectoryOrCreate",
9521
+ path: "/root/test"
9441
9522
  },
9442
- "persistentVolumeReclaimPolicy": "Delete",
9443
- "volumeMode": "Filesystem"
9523
+ persistentVolumeReclaimPolicy: "Delete",
9524
+ volumeMode: "Filesystem"
9444
9525
  }
9445
9526
  };
9446
9527
  const PVC_INIT_VALUE = {
9447
- "apiVersion": "v1",
9448
- "kind": "PersistentVolumeClaim",
9449
- "metadata": {
9450
- "name": "",
9451
- "namespace": "default"
9528
+ apiVersion: "v1",
9529
+ kind: "PersistentVolumeClaim",
9530
+ metadata: {
9531
+ name: "",
9532
+ namespace: "default"
9452
9533
  },
9453
- "spec": {
9454
- "accessModes": [],
9455
- "resources": {
9456
- "requests": {
9457
- "storage": "10Gi"
9534
+ spec: {
9535
+ accessModes: [],
9536
+ resources: {
9537
+ requests: {
9538
+ storage: "10Gi"
9458
9539
  }
9459
9540
  },
9460
- "storageClassName": "",
9461
- "volumeMode": "Filesystem"
9541
+ storageClassName: "",
9542
+ volumeMode: "Filesystem"
9462
9543
  }
9463
9544
  };
9464
9545
  var ResourceState = /* @__PURE__ */ ((ResourceState2) => {
@@ -9565,6 +9646,16 @@ class WorkloadBaseModel extends ResourceModel {
9565
9646
  );
9566
9647
  return (containers == null ? void 0 : containers.map((container2) => shortenedImage(container2.image || ""))) || [];
9567
9648
  }
9649
+ async fetchRestarts(selector, namespace2) {
9650
+ const pods = await this._globalStore.get("pods", {
9651
+ resourceBasePath: "/api/v1",
9652
+ kind: "Pod"
9653
+ });
9654
+ const myPods = pods.items.filter(
9655
+ (p) => matchSelector(p, selector, namespace2)
9656
+ );
9657
+ return lodashExports.sumBy(myPods, "restarts");
9658
+ }
9568
9659
  }
9569
9660
  class JobModel extends WorkloadBaseModel {
9570
9661
  constructor(_rawYaml, _globalStore) {
@@ -9576,18 +9667,11 @@ class JobModel extends WorkloadBaseModel {
9576
9667
  await this.getRestarts();
9577
9668
  }
9578
9669
  async getRestarts() {
9579
- const pods = await this._globalStore.get("pods", {
9580
- resourceBasePath: "/api/v1",
9581
- kind: "Pod"
9582
- });
9583
- const myPods = pods.items.filter(
9584
- (p) => {
9585
- var _a;
9586
- return matchSelector(p, (_a = this.spec) == null ? void 0 : _a.selector, this.metadata.namespace);
9587
- }
9670
+ var _a;
9671
+ this.restarts = await this.fetchRestarts(
9672
+ (_a = this.spec) == null ? void 0 : _a.selector,
9673
+ this.metadata.namespace
9588
9674
  );
9589
- const result = lodashExports.sumBy(myPods, "restarts");
9590
- this.restarts = result;
9591
9675
  }
9592
9676
  get duration() {
9593
9677
  var _a, _b;
@@ -9652,18 +9736,11 @@ class WorkloadModel extends WorkloadBaseModel {
9652
9736
  await this.getIngresses();
9653
9737
  }
9654
9738
  async getRestarts() {
9655
- const pods = await this._globalStore.get("pods", {
9656
- resourceBasePath: "/api/v1",
9657
- kind: "Pod"
9658
- });
9659
- const myPods = pods.items.filter(
9660
- (p) => {
9661
- var _a;
9662
- return matchSelector(p, (_a = this.spec) == null ? void 0 : _a.selector, this.metadata.namespace);
9663
- }
9739
+ var _a;
9740
+ this.restarts = await this.fetchRestarts(
9741
+ (_a = this.spec) == null ? void 0 : _a.selector,
9742
+ this.metadata.namespace
9664
9743
  );
9665
- const result = lodashExports.sumBy(myPods, "restarts");
9666
- this.restarts = result;
9667
9744
  }
9668
9745
  async getServices() {
9669
9746
  const services = await this._globalStore.get("services", {
@@ -9680,10 +9757,10 @@ class WorkloadModel extends WorkloadBaseModel {
9680
9757
  }
9681
9758
  async getIngresses() {
9682
9759
  const allIngresses = /* @__PURE__ */ new Map();
9683
- for (const service of this.services) {
9684
- for (const ingress of service.ingresses) {
9685
- const key2 = `${ingress.namespace}-${ingress.name}`;
9686
- allIngresses.set(key2, ingress);
9760
+ for (const service2 of this.services) {
9761
+ for (const ingress2 of service2.ingresses) {
9762
+ const key2 = `${ingress2.namespace}-${ingress2.name}`;
9763
+ allIngresses.set(key2, ingress2);
9687
9764
  }
9688
9765
  }
9689
9766
  this.ingresses = Array.from(allIngresses.values());
@@ -9716,6 +9793,23 @@ class WorkloadModel extends WorkloadBaseModel {
9716
9793
  }
9717
9794
  return newOne;
9718
9795
  }
9796
+ getControllerRevisions(controllerRevisions) {
9797
+ return controllerRevisions.filter(
9798
+ (cr) => {
9799
+ var _a, _b;
9800
+ return (_b = (_a = cr.metadata) == null ? void 0 : _a.ownerReferences) == null ? void 0 : _b.some(
9801
+ (ref) => ref.kind === this.kind && ref.uid === this.metadata.uid
9802
+ );
9803
+ }
9804
+ );
9805
+ }
9806
+ getRevision(controllerRevisions) {
9807
+ const myRevisions = this.getControllerRevisions(controllerRevisions);
9808
+ return myRevisions.reduce(
9809
+ (result, cr) => Math.max(result, Number(cr.revision || 0)),
9810
+ 0
9811
+ );
9812
+ }
9719
9813
  }
9720
9814
  class PodModel extends WorkloadBaseModel {
9721
9815
  constructor(_rawYaml, _globalStore) {
@@ -9992,22 +10086,6 @@ class DaemonSetModel extends WorkloadModel {
9992
10086
  super(_rawYaml, _globalStore);
9993
10087
  this._rawYaml = _rawYaml;
9994
10088
  }
9995
- getControllerRevisions(controllerVisions) {
9996
- return controllerVisions.filter(
9997
- (controllerRevision) => {
9998
- var _a, _b;
9999
- return (_b = (_a = controllerRevision.metadata) == null ? void 0 : _a.ownerReferences) == null ? void 0 : _b.some(
10000
- (ownerReference) => ownerReference.kind === "DaemonSet" && ownerReference.uid === this.metadata.uid
10001
- );
10002
- }
10003
- );
10004
- }
10005
- getRevision(controllerVisions) {
10006
- const myControllerVisions = this.getControllerRevisions(controllerVisions);
10007
- return myControllerVisions.reduce((result, controllerRevision) => {
10008
- return Math.max(result, Number(controllerRevision.revision || 0));
10009
- }, 0);
10010
- }
10011
10089
  get stateDisplay() {
10012
10090
  var _a, _b;
10013
10091
  if (((_a = this.status) == null ? void 0 : _a.desiredNumberScheduled) !== ((_b = this.status) == null ? void 0 : _b.numberReady)) {
@@ -10027,22 +10105,6 @@ class StatefulSetModel extends WorkloadModel {
10027
10105
  super(_rawYaml, _globalStore);
10028
10106
  this._rawYaml = _rawYaml;
10029
10107
  }
10030
- getControllerRevisions(controllerVisions) {
10031
- return controllerVisions.filter(
10032
- (controllerRevision) => {
10033
- var _a, _b;
10034
- return (_b = (_a = controllerRevision.metadata) == null ? void 0 : _a.ownerReferences) == null ? void 0 : _b.some(
10035
- (ownerReference) => ownerReference.kind === "StatefulSet" && ownerReference.uid === this.metadata.uid
10036
- );
10037
- }
10038
- );
10039
- }
10040
- getRevision(controllerVisions) {
10041
- const myControllerVisions = this.getControllerRevisions(controllerVisions);
10042
- return myControllerVisions.reduce((result, controllerRevision) => {
10043
- return Math.max(result, Number(controllerRevision.revision || 0));
10044
- }, 0);
10045
- }
10046
10108
  get stateDisplay() {
10047
10109
  var _a, _b, _c;
10048
10110
  if (((_a = this.spec) == null ? void 0 : _a.replicas) === 0) {
@@ -10075,11 +10137,9 @@ class ServiceModel extends ResourceModel {
10075
10137
  resourceBasePath: "/apis/networking.k8s.io/v1",
10076
10138
  kind: "Ingress"
10077
10139
  });
10078
- const myIngresses = ingresses.items.filter((ingress) => {
10079
- const rules = ingress.getFlattenedRules([]);
10080
- return rules.some(
10081
- (rule2) => rule2.serviceName === this.name
10082
- );
10140
+ const myIngresses = ingresses.items.filter((ingress2) => {
10141
+ const rules = ingress2.getFlattenedRules([]);
10142
+ return rules.some((rule2) => rule2.serviceName === this.name);
10083
10143
  });
10084
10144
  this.ingresses = myIngresses;
10085
10145
  }
@@ -10271,15 +10331,15 @@ class IngressClassModel extends ResourceModel {
10271
10331
  return (_a = this.spec) == null ? void 0 : _a.controller;
10272
10332
  }
10273
10333
  }
10274
- const index_1rec449 = "";
10334
+ const index_1ndmolf = "";
10275
10335
  const ServiceInClusterAccessComponent = ({
10276
- service
10336
+ service: service2
10277
10337
  }) => {
10278
- const spec = service._rawYaml.spec;
10279
- switch (service.displayType) {
10338
+ const spec = service2._rawYaml.spec;
10339
+ switch (service2.displayType) {
10280
10340
  case ServiceTypeEnum.ExternalName:
10281
10341
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
10282
- value: service.dnsRecord
10342
+ value: service2.dnsRecord
10283
10343
  });
10284
10344
  case ServiceTypeEnum.Headless:
10285
10345
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
@@ -10295,46 +10355,79 @@ const BreakLineStyle = "b1vtjd4k";
10295
10355
  const LinkStyle$2 = "luro4rx";
10296
10356
  const ShowLinkStyle = "s1gydjqf";
10297
10357
  const DashedUnderlineSpanStyle = "dvp1i89";
10358
+ const AccessAddressStyle = "azmggeh";
10359
+ const ServiceAccessAddress = ({
10360
+ children,
10361
+ copyValue
10362
+ }) => {
10363
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
10364
+ className: AccessAddressStyle,
10365
+ children: [children, /* @__PURE__ */ jsxRuntimeExports.jsx(CopyButton, {
10366
+ value: copyValue
10367
+ })]
10368
+ });
10369
+ };
10370
+ function renderAccessItems(items, separator) {
10371
+ if (!items.length) {
10372
+ return void 0;
10373
+ }
10374
+ const result = [];
10375
+ for (let i2 = 0; i2 < items.length; i2++) {
10376
+ result.push(/* @__PURE__ */ jsxRuntimeExports.jsx(React.Fragment, {
10377
+ children: items[i2]
10378
+ }, `item-${i2}`));
10379
+ if (i2 < items.length - 1) {
10380
+ result.push(/* @__PURE__ */ jsxRuntimeExports.jsx(React.Fragment, {
10381
+ children: separator
10382
+ }, `separator-${i2}`));
10383
+ }
10384
+ }
10385
+ return result;
10386
+ }
10298
10387
  const ServiceOutClusterAccessComponent = ({
10299
- service,
10388
+ service: service2,
10300
10389
  breakLine = true,
10301
10390
  clusterVip,
10302
- showDashedUnderline = true
10391
+ showDashedUnderline = true,
10392
+ showCopyButton = false
10303
10393
  }) => {
10304
- var _a, _b, _c, _d, _e;
10394
+ var _a, _b, _c, _d, _e, _f, _g, _h;
10305
10395
  const {
10306
10396
  i18n: i18n2
10307
10397
  } = useTranslation();
10308
- const spec = service._rawYaml.spec;
10309
- const status = service._rawYaml.status;
10398
+ const spec = service2._rawYaml.spec;
10399
+ const status = service2._rawYaml.status;
10310
10400
  let content = "-";
10311
10401
  switch (spec.type) {
10312
10402
  case ServiceTypeEnum.NodePort:
10313
10403
  if (!breakLine) {
10314
- content = (_a = spec.ports) == null ? void 0 : _a.filter((v) => !!v).map((p) => [/* @__PURE__ */ jsxRuntimeExports.jsx(Link$1, {
10315
- href: `http://${clusterVip}:${p.nodePort}`,
10316
- target: "_blank",
10317
- className: cx_default(ShowLinkStyle, Typo.Label.l4_regular_title),
10318
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
10319
- title: i18n2.t("dovetail.default_http_protocol_tooltip"),
10320
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
10321
- className: DashedUnderlineSpanStyle,
10322
- style: showDashedUnderline ? void 0 : {
10323
- borderBottom: "none"
10324
- },
10325
- children: `${clusterVip}:${p.nodePort}`
10404
+ content = (_a = spec.ports) == null ? void 0 : _a.filter((v) => !!v && v.nodePort).map((p) => {
10405
+ const address = `${clusterVip}:${p.nodePort}`;
10406
+ const link = /* @__PURE__ */ jsxRuntimeExports.jsx(Link$1, {
10407
+ href: `http://${address}`,
10408
+ target: "_blank",
10409
+ className: cx_default(ShowLinkStyle, Typo.Label.l4_regular_title),
10410
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
10411
+ title: i18n2.t("dovetail.default_http_protocol_tooltip"),
10412
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
10413
+ className: DashedUnderlineSpanStyle,
10414
+ style: showDashedUnderline ? void 0 : {
10415
+ borderBottom: "none"
10416
+ },
10417
+ children: address
10418
+ })
10326
10419
  })
10327
- })
10328
- }, p.name)]);
10329
- if (content && content instanceof Array) {
10330
- const result = [];
10331
- for (let i2 = 0; i2 < content.length; i2++) {
10332
- result.push(content[i2]);
10333
- if (i2 < content.length - 1) {
10334
- result.push(", ");
10335
- }
10420
+ }, p.name || p.nodePort);
10421
+ if (!showCopyButton) {
10422
+ return link;
10336
10423
  }
10337
- content = result;
10424
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceAccessAddress, {
10425
+ copyValue: address,
10426
+ children: link
10427
+ }, p.name || p.nodePort);
10428
+ });
10429
+ if (content && content instanceof Array) {
10430
+ content = renderAccessItems(content, ", ");
10338
10431
  }
10339
10432
  break;
10340
10433
  }
@@ -10357,15 +10450,31 @@ const ServiceOutClusterAccessComponent = ({
10357
10450
  children: content
10358
10451
  });
10359
10452
  case ServiceTypeEnum.ExternalName:
10453
+ if (showCopyButton) {
10454
+ content = renderAccessItems(((_c = spec.externalIPs) == null ? void 0 : _c.map((ip) => /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceAccessAddress, {
10455
+ copyValue: ip,
10456
+ children: ip
10457
+ }, ip))) || [], breakLine ? "\n" : ", ");
10458
+ break;
10459
+ }
10360
10460
  content = /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
10361
10461
  useOverflow: false,
10362
- value: (_c = spec.externalIPs) == null ? void 0 : _c.join(breakLine ? "\n" : ", ")
10462
+ value: (_d = spec.externalIPs) == null ? void 0 : _d.join(breakLine ? "\n" : ", ")
10363
10463
  });
10364
10464
  break;
10365
10465
  case ServiceTypeEnum.LoadBalancer:
10466
+ if (showCopyButton) {
10467
+ content = renderAccessItems(((_f = (_e = status.loadBalancer) == null ? void 0 : _e.ingress) == null ? void 0 : _f.map(({
10468
+ ip
10469
+ }) => ip).filter((ip) => !!ip).map((ip) => /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceAccessAddress, {
10470
+ copyValue: ip,
10471
+ children: ip
10472
+ }, ip))) || [], breakLine ? "\n" : ", ");
10473
+ break;
10474
+ }
10366
10475
  content = /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
10367
10476
  useOverflow: false,
10368
- value: (_e = (_d = status.loadBalancer) == null ? void 0 : _d.ingress) == null ? void 0 : _e.map(({
10477
+ value: (_h = (_g = status.loadBalancer) == null ? void 0 : _g.ingress) == null ? void 0 : _h.map(({
10369
10478
  ip
10370
10479
  }) => ip).join(breakLine ? "\n" : ", ")
10371
10480
  });
@@ -10392,7 +10501,7 @@ const ServiceOutClusterAccessComponent = ({
10392
10501
  children: content || "-"
10393
10502
  });
10394
10503
  };
10395
- const index_1es4s7t = "";
10504
+ const index_1l1kti4 = "";
10396
10505
  const TagWrapper = "t13a6vox";
10397
10506
  const TagStyle = "t12ikbmp";
10398
10507
  const Tags = (props) => {
@@ -10658,42 +10767,48 @@ function immutableSet(obj, path2, value2) {
10658
10767
  return setWith(clone(obj), path2, value2, clone);
10659
10768
  }
10660
10769
  function usePathMap(options) {
10661
- const { pathMap, transformInitValues: transformInitValuesFromOptions, transformApplyValues: transformApplyValuesFromOptions } = options;
10662
- const transformInitValues = useCallback((values) => {
10663
- const initValues = values._rawYaml || values;
10664
- let result = initValues;
10665
- for (const { from, to } of pathMap || []) {
10666
- result = immutableSet(initValues, to, get$2(initValues, from));
10667
- const fromPath = [...from];
10668
- const lastKey = fromPath.pop();
10669
- if (lastKey) {
10670
- const obj = get$2(result, fromPath);
10671
- if (obj && typeof obj === "object") {
10672
- delete obj[lastKey];
10673
- }
10674
- }
10675
- }
10676
- return (transformInitValuesFromOptions == null ? void 0 : transformInitValuesFromOptions(result)) || result;
10677
- }, [transformInitValuesFromOptions, pathMap]);
10678
- const transformApplyValues = useCallback((values) => {
10679
- let result = values;
10680
- for (const { from, to } of pathMap || []) {
10681
- result = immutableSet(
10682
- values,
10683
- from,
10684
- get$2(result, to)
10685
- );
10686
- const toPath = [...to];
10687
- const lastKey = toPath.pop();
10688
- if (lastKey) {
10689
- const obj = get$2(result, toPath);
10690
- if (obj && typeof obj === "object") {
10691
- delete obj[lastKey];
10770
+ const {
10771
+ pathMap,
10772
+ transformInitValues: transformInitValuesFromOptions,
10773
+ transformApplyValues: transformApplyValuesFromOptions
10774
+ } = options;
10775
+ const transformInitValues = useCallback(
10776
+ (values) => {
10777
+ const initValues = values._rawYaml || values;
10778
+ let result = initValues;
10779
+ for (const { from, to } of pathMap || []) {
10780
+ result = immutableSet(initValues, to, get$2(initValues, from));
10781
+ const fromPath = [...from];
10782
+ const lastKey = fromPath.pop();
10783
+ if (lastKey) {
10784
+ const obj = get$2(result, fromPath);
10785
+ if (obj && typeof obj === "object") {
10786
+ delete obj[lastKey];
10787
+ }
10692
10788
  }
10693
10789
  }
10694
- }
10695
- return (transformApplyValuesFromOptions == null ? void 0 : transformApplyValuesFromOptions(result)) || result;
10696
- }, [transformApplyValuesFromOptions, pathMap]);
10790
+ return (transformInitValuesFromOptions == null ? void 0 : transformInitValuesFromOptions(result)) || result;
10791
+ },
10792
+ [transformInitValuesFromOptions, pathMap]
10793
+ );
10794
+ const transformApplyValues = useCallback(
10795
+ (values) => {
10796
+ let result = values;
10797
+ for (const { from, to } of pathMap || []) {
10798
+ result = immutableSet(values, from, get$2(result, to));
10799
+ const toPath = [...to];
10800
+ const lastKey = toPath.pop();
10801
+ if (lastKey) {
10802
+ const obj = get$2(result, toPath);
10803
+ if (obj && typeof obj === "object") {
10804
+ delete obj[lastKey];
10805
+ }
10806
+ }
10807
+ }
10808
+ return (transformApplyValuesFromOptions == null ? void 0 : transformApplyValuesFromOptions(result)) || result;
10809
+ },
10810
+ [transformApplyValuesFromOptions, pathMap]
10811
+ );
10697
10812
  return {
10698
10813
  transformInitValues,
10699
10814
  transformApplyValues
@@ -10756,278 +10871,276 @@ const ErrorWrapperStyle = "e19q2bnp";
10756
10871
  const YamlEditorStyle = "y16u5v3w";
10757
10872
  const MonacoYamlEditor$3 = React.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$1));
10758
10873
  const MonacoYamlDiffEditor$2 = React.lazy(() => Promise.resolve().then(() => MonacoYamlDiffEditor$1));
10759
- const YamlEditorComponent = forwardRef(
10760
- function YamlEditorComponent2(props, ref) {
10761
- const {
10762
- title,
10763
- collapsable = true,
10764
- isDefaultCollapsed,
10765
- value: value2,
10766
- defaultValue = "",
10767
- height,
10768
- readOnly,
10769
- errorMsgs = [],
10770
- schemas,
10771
- eleRef,
10772
- className,
10773
- debounceTime,
10774
- isScrollOnFocus = true,
10775
- isHideActions = false
10776
- } = props;
10777
- const { t: t2 } = useTranslation();
10778
- const [isCollapsed, setIsCollapsed] = useState(
10779
- collapsable ? isDefaultCollapsed : false
10780
- );
10781
- const [isDiff, setIsDiff] = useState(false);
10782
- const [_value, _setValue] = useState(value2 || defaultValue);
10783
- const editorInstance = useRef();
10784
- const [copyTooltip, setCopyTooltip] = useState(t2("dovetail.copy"));
10785
- const [resetTooltip, setResetTooltip] = useState(t2("dovetail.reset_arguments"));
10786
- const defaultValueString = useMemo(() => {
10787
- if (typeof defaultValue === "string") {
10788
- return defaultValue;
10789
- }
10790
- return yaml$2.dump(defaultValue);
10791
- }, [defaultValue]);
10792
- const _valueString = useMemo(() => {
10793
- if (typeof _value === "string") {
10794
- return _value;
10795
- }
10796
- return yaml$2.dump(_value);
10797
- }, [_value]);
10798
- const onChange = useCallback(
10799
- (newVal) => {
10800
- var _a;
10801
- _setValue(newVal);
10802
- (_a = props.onChange) == null ? void 0 : _a.call(props, newVal);
10803
- },
10804
- [props.onChange]
10805
- );
10806
- const finalOnChange = useMemo(() => {
10807
- return debounceTime ? debounce(onChange, debounceTime) : onChange;
10808
- }, [onChange, debounceTime]);
10809
- const onValidate = useCallback(
10810
- (valid, schemaValid) => {
10811
- var _a;
10812
- (_a = props.onValidate) == null ? void 0 : _a.call(props, valid, schemaValid);
10813
- },
10814
- [props.onValidate]
10815
- );
10816
- const onEditorCreate = useCallback(
10817
- (editor) => {
10818
- var _a, _b, _c;
10819
- if (editor.getValue() !== _value) {
10820
- (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(_valueString);
10821
- }
10822
- (_c = props.onEditorCreate) == null ? void 0 : _c.call(props, editor);
10823
- },
10824
- [_value, props.onEditorCreate]
10825
- );
10826
- const getInstance = useCallback((ins) => {
10827
- editorInstance.current = ins;
10828
- }, []);
10829
- const getEditorValue = useCallback(() => {
10874
+ const YamlEditorComponent = forwardRef(function YamlEditorComponent2(props, ref) {
10875
+ const {
10876
+ title,
10877
+ collapsable = true,
10878
+ isDefaultCollapsed,
10879
+ value: value2,
10880
+ defaultValue = "",
10881
+ height,
10882
+ readOnly,
10883
+ errorMsgs = [],
10884
+ schemas,
10885
+ eleRef,
10886
+ className,
10887
+ debounceTime,
10888
+ isScrollOnFocus = true,
10889
+ isHideActions = false
10890
+ } = props;
10891
+ const { t: t2 } = useTranslation();
10892
+ const [isCollapsed, setIsCollapsed] = useState(
10893
+ collapsable ? isDefaultCollapsed : false
10894
+ );
10895
+ const [isDiff, setIsDiff] = useState(false);
10896
+ const [_value, _setValue] = useState(value2 || defaultValue);
10897
+ const editorInstance = useRef();
10898
+ const [copyTooltip, setCopyTooltip] = useState(t2("dovetail.copy"));
10899
+ const [resetTooltip, setResetTooltip] = useState(t2("dovetail.reset_arguments"));
10900
+ const defaultValueString = useMemo(() => {
10901
+ if (typeof defaultValue === "string") {
10902
+ return defaultValue;
10903
+ }
10904
+ return yaml$2.dump(defaultValue);
10905
+ }, [defaultValue]);
10906
+ const _valueString = useMemo(() => {
10907
+ if (typeof _value === "string") {
10908
+ return _value;
10909
+ }
10910
+ return yaml$2.dump(_value);
10911
+ }, [_value]);
10912
+ const onChange = useCallback(
10913
+ (newVal) => {
10830
10914
  var _a;
10831
- return ((_a = editorInstance.current) == null ? void 0 : _a.getValue()) ?? "";
10832
- }, []);
10833
- useEffect(() => {
10834
- var _a, _b;
10835
- if (value2 !== void 0 && !isEqual$1(value2, _value)) {
10836
- const valueString = typeof value2 === "string" ? value2 : yaml$2.dump(value2);
10837
- _setValue(value2);
10838
- (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(valueString);
10915
+ _setValue(newVal);
10916
+ (_a = props.onChange) == null ? void 0 : _a.call(props, newVal);
10917
+ },
10918
+ [props.onChange]
10919
+ );
10920
+ const finalOnChange = useMemo(() => {
10921
+ return debounceTime ? debounce(onChange, debounceTime) : onChange;
10922
+ }, [onChange, debounceTime]);
10923
+ const onValidate = useCallback(
10924
+ (valid, schemaValid) => {
10925
+ var _a;
10926
+ (_a = props.onValidate) == null ? void 0 : _a.call(props, valid, schemaValid);
10927
+ },
10928
+ [props.onValidate]
10929
+ );
10930
+ const onEditorCreate = useCallback(
10931
+ (editor) => {
10932
+ var _a, _b, _c;
10933
+ if (editor.getValue() !== _value) {
10934
+ (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(_valueString);
10839
10935
  }
10840
- }, [value2]);
10841
- useImperativeHandle(ref, () => {
10842
- return {
10843
- setValue: _setValue,
10844
- setEditorValue: (value22) => {
10845
- var _a, _b;
10846
- (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(value22);
10847
- },
10848
- getEditorValue,
10849
- getEditorInstance: () => editorInstance.current || null
10850
- };
10851
- });
10852
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
10853
- "div",
10854
- {
10855
- className: cx_default(WrapperStyle$4, className),
10856
- "data-is-error": !!errorMsgs.length,
10857
- ref: eleRef,
10858
- children: [
10859
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
10860
- Space,
10861
- {
10862
- className: cx_default(ToolBarStyle, isCollapsed ? "collapsed" : ""),
10863
- direction: "vertical",
10864
- size: 0,
10865
- children: [
10866
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, { className: ToolBarHeaderStyle, children: [
10867
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, { size: 8, children: [
10868
- collapsable && /* @__PURE__ */ jsxRuntimeExports.jsx(
10869
- Icon,
10870
- {
10871
- src: HierarchyTriangleRight16GrayIcon,
10872
- hoverSrc: HierarchyTriangleRight16BlueIcon,
10873
- className: cx_default(IconStyle, isCollapsed ? "" : "arrow-down"),
10874
- iconWidth: 16,
10875
- iconHeight: 16,
10876
- onClick: () => setIsCollapsed(!isCollapsed)
10877
- }
10878
- ),
10879
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cx_default(TitleStyle$1, "yaml-editor-title"), children: title || t2("dovetail.configure_file") })
10880
- ] }),
10881
- isHideActions ? null : /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, { size: 14, children: [
10882
- isDiff ? void 0 : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10883
- /* @__PURE__ */ jsxRuntimeExports.jsx(
10884
- Tooltip,
10885
- {
10886
- title: isCollapsed ? "" : copyTooltip,
10887
- onVisibleChange: (visible) => {
10888
- if (!visible) {
10889
- setTimeout(() => {
10890
- setCopyTooltip(t2("dovetail.copy"));
10891
- }, 80);
10892
- }
10893
- },
10894
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10895
- Icon,
10896
- {
10897
- "data-disabled": isCollapsed,
10898
- src: ClipboardCopy16GradientGrayIcon,
10899
- hoverSrc: isCollapsed ? void 0 : ClipboardCopy16GradientBlueIcon,
10900
- className: IconStyle,
10901
- iconWidth: 16,
10902
- iconHeight: 16,
10903
- onClick: () => {
10904
- if (!isCollapsed) {
10905
- copyToClipboard(getEditorValue());
10906
- setCopyTooltip(t2("dovetail.copied"));
10907
- }
10908
- }
10909
- }
10910
- )
10911
- }
10912
- ),
10913
- /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {}),
10914
- /* @__PURE__ */ jsxRuntimeExports.jsx(
10915
- Tooltip,
10916
- {
10917
- title: isCollapsed ? "" : resetTooltip,
10918
- onVisibleChange: (visible) => {
10919
- if (!visible) {
10920
- setTimeout(() => {
10921
- setResetTooltip(t2("dovetail.reset_arguments"));
10922
- }, 80);
10923
- }
10924
- },
10925
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10926
- Icon,
10927
- {
10928
- "data-disabled": isCollapsed,
10929
- src: Retry16GradientGrayIcon,
10930
- hoverSrc: isCollapsed ? void 0 : Retry16GradientBlueIcon,
10931
- className: IconStyle,
10932
- iconWidth: 16,
10933
- iconHeight: 16,
10934
- onClick: () => {
10935
- var _a;
10936
- if (!isCollapsed) {
10937
- (_a = editorInstance.current) == null ? void 0 : _a.setValue(defaultValueString);
10938
- setResetTooltip(t2("dovetail.already_reset"));
10939
- }
10940
- }
10941
- }
10942
- )
10943
- }
10944
- ),
10945
- /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {})
10946
- ] }),
10936
+ (_c = props.onEditorCreate) == null ? void 0 : _c.call(props, editor);
10937
+ },
10938
+ [_value, props.onEditorCreate]
10939
+ );
10940
+ const getInstance = useCallback((ins) => {
10941
+ editorInstance.current = ins;
10942
+ }, []);
10943
+ const getEditorValue = useCallback(() => {
10944
+ var _a;
10945
+ return ((_a = editorInstance.current) == null ? void 0 : _a.getValue()) ?? "";
10946
+ }, []);
10947
+ useEffect(() => {
10948
+ var _a, _b;
10949
+ if (value2 !== void 0 && !isEqual$1(value2, _value)) {
10950
+ const valueString = typeof value2 === "string" ? value2 : yaml$2.dump(value2);
10951
+ _setValue(value2);
10952
+ (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(valueString);
10953
+ }
10954
+ }, [value2]);
10955
+ useImperativeHandle(ref, () => {
10956
+ return {
10957
+ setValue: _setValue,
10958
+ setEditorValue: (value22) => {
10959
+ var _a, _b;
10960
+ (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(value22);
10961
+ },
10962
+ getEditorValue,
10963
+ getEditorInstance: () => editorInstance.current || null
10964
+ };
10965
+ });
10966
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
10967
+ "div",
10968
+ {
10969
+ className: cx_default(WrapperStyle$4, className),
10970
+ "data-is-error": !!errorMsgs.length,
10971
+ ref: eleRef,
10972
+ children: [
10973
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
10974
+ Space,
10975
+ {
10976
+ className: cx_default(ToolBarStyle, isCollapsed ? "collapsed" : ""),
10977
+ direction: "vertical",
10978
+ size: 0,
10979
+ children: [
10980
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, { className: ToolBarHeaderStyle, children: [
10981
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, { size: 8, children: [
10982
+ collapsable && /* @__PURE__ */ jsxRuntimeExports.jsx(
10983
+ Icon,
10984
+ {
10985
+ src: HierarchyTriangleRight16GrayIcon,
10986
+ hoverSrc: HierarchyTriangleRight16BlueIcon,
10987
+ className: cx_default(IconStyle, isCollapsed ? "" : "arrow-down"),
10988
+ iconWidth: 16,
10989
+ iconHeight: 16,
10990
+ onClick: () => setIsCollapsed(!isCollapsed)
10991
+ }
10992
+ ),
10993
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cx_default(TitleStyle$1, "yaml-editor-title"), children: title || t2("dovetail.configure_file") })
10994
+ ] }),
10995
+ isHideActions ? null : /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, { size: 14, children: [
10996
+ isDiff ? void 0 : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10947
10997
  /* @__PURE__ */ jsxRuntimeExports.jsx(
10948
10998
  Tooltip,
10949
10999
  {
10950
- title: isCollapsed ? "" : isDiff ? t2("dovetail.back_to_edit") : t2("dovetail.view_changes"),
10951
- children: isDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(
11000
+ title: isCollapsed ? "" : copyTooltip,
11001
+ onVisibleChange: (visible) => {
11002
+ if (!visible) {
11003
+ setTimeout(() => {
11004
+ setCopyTooltip(t2("dovetail.copy"));
11005
+ }, 80);
11006
+ }
11007
+ },
11008
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10952
11009
  Icon,
10953
11010
  {
10954
11011
  "data-disabled": isCollapsed,
10955
- src: EditPen16GradientGrayIcon,
10956
- hoverSrc: isCollapsed ? void 0 : EditPen16GradientBlueIcon,
11012
+ src: ClipboardCopy16GradientGrayIcon,
11013
+ hoverSrc: isCollapsed ? void 0 : ClipboardCopy16GradientBlueIcon,
10957
11014
  className: IconStyle,
10958
11015
  iconWidth: 16,
10959
11016
  iconHeight: 16,
10960
- onClick: () => isCollapsed ? void 0 : setIsDiff(false)
11017
+ onClick: () => {
11018
+ if (!isCollapsed) {
11019
+ copyToClipboard(getEditorValue());
11020
+ setCopyTooltip(t2("dovetail.copied"));
11021
+ }
11022
+ }
10961
11023
  }
10962
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
11024
+ )
11025
+ }
11026
+ ),
11027
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {}),
11028
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
11029
+ Tooltip,
11030
+ {
11031
+ title: isCollapsed ? "" : resetTooltip,
11032
+ onVisibleChange: (visible) => {
11033
+ if (!visible) {
11034
+ setTimeout(() => {
11035
+ setResetTooltip(t2("dovetail.reset_arguments"));
11036
+ }, 80);
11037
+ }
11038
+ },
11039
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10963
11040
  Icon,
10964
11041
  {
10965
11042
  "data-disabled": isCollapsed,
10966
- src: Showdiff16GradientGrayIcon,
10967
- hoverSrc: isCollapsed ? void 0 : Showdiff16GradientBlueIcon,
11043
+ src: Retry16GradientGrayIcon,
11044
+ hoverSrc: isCollapsed ? void 0 : Retry16GradientBlueIcon,
10968
11045
  className: IconStyle,
10969
11046
  iconWidth: 16,
10970
11047
  iconHeight: 16,
10971
- onClick: () => isCollapsed ? void 0 : setIsDiff(true)
11048
+ onClick: () => {
11049
+ var _a;
11050
+ if (!isCollapsed) {
11051
+ (_a = editorInstance.current) == null ? void 0 : _a.setValue(defaultValueString);
11052
+ setResetTooltip(t2("dovetail.already_reset"));
11053
+ }
11054
+ }
10972
11055
  }
10973
11056
  )
10974
11057
  }
10975
- )
10976
- ] })
10977
- ] }),
10978
- errorMsgs.length ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, { className: ErrorWrapperStyle, size: 8, align: "start", children: [
10979
- /* @__PURE__ */ jsxRuntimeExports.jsx(XmarkFailedSeriousWarningFill16RedIcon, { className: ErrorIconStyle$1 }),
10980
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: errorMsgs.map((errorMsg, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("pre", { className: ErrorMsgStyle, children: [
10981
- errorMsgs.length > 1 ? `${index2 + 1}. ` : "",
10982
- errorMsg
10983
- ] }, errorMsg)) })
10984
- ] }) : void 0
10985
- ]
10986
- }
10987
- ),
10988
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
10989
- "div",
10990
- {
10991
- style: {
10992
- display: isCollapsed ? "none" : "block",
10993
- width: "100%",
10994
- height: height || "500px",
10995
- zIndex: 1
10996
- },
10997
- children: [
10998
- /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: _valueString }), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: isDiff ? "none" : "block" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10999
- MonacoYamlEditor$3,
11000
- {
11001
- id: props.id,
11002
- getInstance,
11003
- defaultValue: _value,
11004
- height,
11005
- onChange: finalOnChange,
11006
- onValidate,
11007
- onEditorCreate,
11008
- onBlur: props.onBlur,
11009
- schemas,
11010
- readOnly,
11011
- isScrollOnFocus
11012
- }
11013
- ) }) }),
11014
- isDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: _valueString }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
11015
- MonacoYamlDiffEditor$2,
11016
- {
11017
- id: props.id,
11018
- origin: defaultValueString,
11019
- modified: _valueString,
11020
- height
11021
- }
11022
- ) }) : null
11023
- ]
11024
- }
11025
- )
11026
- ]
11027
- }
11028
- );
11029
- }
11030
- );
11058
+ ),
11059
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, {})
11060
+ ] }),
11061
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
11062
+ Tooltip,
11063
+ {
11064
+ title: isCollapsed ? "" : isDiff ? t2("dovetail.back_to_edit") : t2("dovetail.view_changes"),
11065
+ children: isDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(
11066
+ Icon,
11067
+ {
11068
+ "data-disabled": isCollapsed,
11069
+ src: EditPen16GradientGrayIcon,
11070
+ hoverSrc: isCollapsed ? void 0 : EditPen16GradientBlueIcon,
11071
+ className: IconStyle,
11072
+ iconWidth: 16,
11073
+ iconHeight: 16,
11074
+ onClick: () => isCollapsed ? void 0 : setIsDiff(false)
11075
+ }
11076
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
11077
+ Icon,
11078
+ {
11079
+ "data-disabled": isCollapsed,
11080
+ src: Showdiff16GradientGrayIcon,
11081
+ hoverSrc: isCollapsed ? void 0 : Showdiff16GradientBlueIcon,
11082
+ className: IconStyle,
11083
+ iconWidth: 16,
11084
+ iconHeight: 16,
11085
+ onClick: () => isCollapsed ? void 0 : setIsDiff(true)
11086
+ }
11087
+ )
11088
+ }
11089
+ )
11090
+ ] })
11091
+ ] }),
11092
+ errorMsgs.length ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, { className: ErrorWrapperStyle, size: 8, align: "start", children: [
11093
+ /* @__PURE__ */ jsxRuntimeExports.jsx(XmarkFailedSeriousWarningFill16RedIcon, { className: ErrorIconStyle$1 }),
11094
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: errorMsgs.map((errorMsg, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("pre", { className: ErrorMsgStyle, children: [
11095
+ errorMsgs.length > 1 ? `${index2 + 1}. ` : "",
11096
+ errorMsg
11097
+ ] }, errorMsg)) })
11098
+ ] }) : void 0
11099
+ ]
11100
+ }
11101
+ ),
11102
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
11103
+ "div",
11104
+ {
11105
+ style: {
11106
+ display: isCollapsed ? "none" : "block",
11107
+ width: "100%",
11108
+ height: height || "500px",
11109
+ zIndex: 1
11110
+ },
11111
+ children: [
11112
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: _valueString }), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: isDiff ? "none" : "block" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
11113
+ MonacoYamlEditor$3,
11114
+ {
11115
+ id: props.id,
11116
+ getInstance,
11117
+ defaultValue: _value,
11118
+ height,
11119
+ onChange: finalOnChange,
11120
+ onValidate,
11121
+ onEditorCreate,
11122
+ onBlur: props.onBlur,
11123
+ schemas,
11124
+ readOnly,
11125
+ isScrollOnFocus
11126
+ }
11127
+ ) }) }),
11128
+ isDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: _valueString }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
11129
+ MonacoYamlDiffEditor$2,
11130
+ {
11131
+ id: props.id,
11132
+ origin: defaultValueString,
11133
+ modified: _valueString,
11134
+ height
11135
+ }
11136
+ ) }) : null
11137
+ ]
11138
+ }
11139
+ )
11140
+ ]
11141
+ }
11142
+ );
11143
+ });
11031
11144
  function copyToClipboard(text) {
11032
11145
  const input = document.createElement("textarea");
11033
11146
  input.value = text;
@@ -11100,14 +11213,7 @@ function use409Retry({
11100
11213
  function useK8sYamlEditor() {
11101
11214
  const foldSymbol = useCallback(function(editor, symbol) {
11102
11215
  const model = editor.getModel();
11103
- const matchs = (model == null ? void 0 : model.findMatches(
11104
- symbol,
11105
- false,
11106
- false,
11107
- false,
11108
- "",
11109
- false
11110
- ).filter((match) => match.range.startColumn === 1)) || [];
11216
+ const matchs = (model == null ? void 0 : model.findMatches(symbol, false, false, false, "", false).filter((match) => match.range.startColumn === 1)) || [];
11111
11217
  return new Promise(async (resolve, reject) => {
11112
11218
  try {
11113
11219
  for (const match of matchs) {
@@ -11121,19 +11227,22 @@ function useK8sYamlEditor() {
11121
11227
  }
11122
11228
  });
11123
11229
  }, []);
11124
- const fold2 = useCallback(async function(editor) {
11125
- await editor.getAction("editor.unfoldAll").run();
11126
- const symbols = [
11127
- " annotations:",
11128
- " managedFields:",
11129
- "status:",
11130
- " kubectl.kubernetes.io/last-applied-configuration:"
11131
- ];
11132
- for (const symbol of symbols) {
11133
- await foldSymbol(editor, symbol);
11134
- }
11135
- editor.setScrollPosition({ scrollTop: 0 });
11136
- }, [foldSymbol]);
11230
+ const fold2 = useCallback(
11231
+ async function(editor) {
11232
+ await editor.getAction("editor.unfoldAll").run();
11233
+ const symbols = [
11234
+ " annotations:",
11235
+ " managedFields:",
11236
+ "status:",
11237
+ " kubectl.kubernetes.io/last-applied-configuration:"
11238
+ ];
11239
+ for (const symbol of symbols) {
11240
+ await foldSymbol(editor, symbol);
11241
+ }
11242
+ editor.setScrollPosition({ scrollTop: 0 });
11243
+ },
11244
+ [foldSymbol]
11245
+ );
11137
11246
  return {
11138
11247
  fold: fold2
11139
11248
  };
@@ -11330,7 +11439,14 @@ const useYamlForm = ({
11330
11439
  pruneBeforeEdit(initialValues2);
11331
11440
  }
11332
11441
  return (transformInitValues == null ? void 0 : transformInitValues(initialValues2)) || initialValues2;
11333
- }, [queryResult, globalStore, initialValuesForCreate, action, initialValuesForEdit, transformInitValues]);
11442
+ }, [
11443
+ queryResult,
11444
+ globalStore,
11445
+ initialValuesForCreate,
11446
+ action,
11447
+ initialValuesForEdit,
11448
+ transformInitValues
11449
+ ]);
11334
11450
  const finalErrors = useMemo(() => {
11335
11451
  return uniq([...editorErrors, ...rulesErrors]);
11336
11452
  }, [editorErrors, rulesErrors]);
@@ -11447,13 +11563,16 @@ const useYamlForm = ({
11447
11563
  try {
11448
11564
  let hasErrors = false;
11449
11565
  setIsBeforeSubmitLoading(true);
11450
- const result = await beforeSubmit(finalValues, (errors2) => {
11451
- if (errors2 && errors2.length > 0) {
11452
- setBeforeSubmitErrors(errors2);
11453
- onBeforeSubmitError == null ? void 0 : onBeforeSubmitError(errors2);
11454
- hasErrors = true;
11566
+ const result = await beforeSubmit(
11567
+ finalValues,
11568
+ (errors2) => {
11569
+ if (errors2 && errors2.length > 0) {
11570
+ setBeforeSubmitErrors(errors2);
11571
+ onBeforeSubmitError == null ? void 0 : onBeforeSubmitError(errors2);
11572
+ hasErrors = true;
11573
+ }
11455
11574
  }
11456
- });
11575
+ );
11457
11576
  if (hasErrors) {
11458
11577
  onSubmitAbort == null ? void 0 : onSubmitAbort();
11459
11578
  return;
@@ -11793,6 +11912,7 @@ function RawYamlFormModal(props) {
11793
11912
  },
11794
11913
  okText: ((_c = resourceConfig.formConfig) == null ? void 0 : _c.saveButtonText) || okText,
11795
11914
  destroyOnClose: true,
11915
+ isContentFull: true,
11796
11916
  children: [desc ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
11797
11917
  className: FormDescStyle$1,
11798
11918
  children: desc
@@ -11835,8 +11955,9 @@ function useOpenForm() {
11835
11955
  if (formType === void 0 || formType === FormContainerType.MODAL) {
11836
11956
  pushModal({
11837
11957
  component: () => {
11838
- var _a2;
11839
- if (options == null ? void 0 : options.useYamlEditor) {
11958
+ var _a2, _b2, _c;
11959
+ const isYamlOnlyForm = ((_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.formType) !== FormType.FORM && !((_b2 = resourceConfig.formConfig) == null ? void 0 : _b2.CustomFormModal);
11960
+ if ((options == null ? void 0 : options.useYamlEditor) || isYamlOnlyForm) {
11840
11961
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
11841
11962
  RawYamlFormModal,
11842
11963
  {
@@ -11849,7 +11970,7 @@ function useOpenForm() {
11849
11970
  }
11850
11971
  );
11851
11972
  }
11852
- const ModalComponent = ((_a2 = resourceConfig.formConfig) == null ? void 0 : _a2.CustomFormModal) || FormModal;
11973
+ const ModalComponent = ((_c = resourceConfig.formConfig) == null ? void 0 : _c.CustomFormModal) || FormModal;
11853
11974
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
11854
11975
  ModalComponent,
11855
11976
  {
@@ -12369,34 +12490,6 @@ function CreateButton(props) {
12369
12490
  }
12370
12491
  );
12371
12492
  }
12372
- const useDeleteManyModal = (resource, ids) => {
12373
- const { mutate } = useDeleteMany();
12374
- const [visible, setVisible] = useState(false);
12375
- const { t: t2 } = useTranslation();
12376
- const modalProps = {
12377
- title: t2("dovetail.delete"),
12378
- okText: t2("dovetail.delete"),
12379
- okButtonProps: {
12380
- danger: true
12381
- },
12382
- cancelText: t2("dovetail.cancel"),
12383
- children: t2("dovetail.confirm_delete_text", {
12384
- target: ids,
12385
- interpolation: { escapeValue: false }
12386
- }),
12387
- onOk() {
12388
- mutate({
12389
- resource,
12390
- ids
12391
- });
12392
- setVisible(false);
12393
- },
12394
- onCancel() {
12395
- setVisible(false);
12396
- }
12397
- };
12398
- return { modalProps, visible, setVisible };
12399
- };
12400
12493
  const DeleteManyButton = (props) => {
12401
12494
  const { resource } = useResource();
12402
12495
  const { t: t2 } = useTranslation();
@@ -12700,94 +12793,109 @@ const ResourceLink = (props) => {
12700
12793
  value: ""
12701
12794
  });
12702
12795
  };
12703
- const IngressRulesTable = ({ ingress }) => {
12704
- const { t: t2 } = useTranslation();
12705
- const { data: serviceData } = useList({
12796
+ const IngressRulesTable_1nylejt = "";
12797
+ const PathCellStyle = "pmi0ggi";
12798
+ const PathTextStyle = "p1gmjxeo";
12799
+ const PathCopyStyle = "p1379cb5";
12800
+ const IngressRulesTable = ({
12801
+ ingress: ingress2
12802
+ }) => {
12803
+ const {
12804
+ t: t2
12805
+ } = useTranslation();
12806
+ const {
12807
+ data: serviceData
12808
+ } = useList({
12706
12809
  resource: "services",
12707
12810
  meta: {
12708
12811
  kind: "Service",
12709
12812
  apiVersion: "v1"
12710
12813
  }
12711
12814
  });
12712
- const flattenedRules = useMemo(
12713
- () => (serviceData == null ? void 0 : serviceData.data) ? ingress.getFlattenedRules(serviceData == null ? void 0 : serviceData.data) : [],
12714
- [serviceData == null ? void 0 : serviceData.data, ingress]
12715
- );
12815
+ const flattenedRules = useMemo(() => (serviceData == null ? void 0 : serviceData.data) ? ingress2.getFlattenedRules(serviceData == null ? void 0 : serviceData.data) : [], [serviceData == null ? void 0 : serviceData.data, ingress2]);
12716
12816
  const rows = useMemo(() => {
12717
12817
  return addId(flattenedRules || [], "fullPath");
12718
12818
  }, [flattenedRules]);
12719
12819
  const component = useContext(ComponentContext);
12720
12820
  const Table2 = component.Table || Table$1;
12721
12821
  const currentSize = 10;
12722
- const columns = [
12723
- {
12724
- key: "pathType",
12725
- display: true,
12726
- dataIndex: "pathType",
12727
- title: t2("dovetail.path_type"),
12728
- width: 160,
12729
- sortable: true
12730
- },
12731
- {
12732
- key: "fullPath",
12733
- display: true,
12734
- dataIndex: "fullPath",
12735
- title: t2("dovetail.path"),
12736
- width: 478,
12737
- sortable: true,
12738
- render(value2) {
12739
- return /* @__PURE__ */ jsxRuntimeExports.jsx(LinkFallback, { fullPath: value2 });
12740
- }
12741
- },
12742
- {
12743
- key: "serviceName",
12744
- display: true,
12745
- dataIndex: "serviceName",
12746
- title: t2("dovetail.target_service"),
12747
- sortable: true,
12748
- width: 160,
12749
- render: (serviceName, record) => {
12750
- return record.serviceName ? /* @__PURE__ */ jsxRuntimeExports.jsx(
12751
- ResourceLink,
12752
- {
12753
- resourceName: "services",
12754
- namespace: ingress.metadata.namespace || "default",
12755
- name: serviceName
12756
- }
12757
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, { value: "" });
12822
+ const columns = [{
12823
+ key: "pathType",
12824
+ display: true,
12825
+ dataIndex: "pathType",
12826
+ title: t2("dovetail.path_type"),
12827
+ width: 160,
12828
+ sortable: true
12829
+ }, {
12830
+ key: "fullPath",
12831
+ display: true,
12832
+ dataIndex: "fullPath",
12833
+ title: t2("dovetail.path"),
12834
+ width: 478,
12835
+ sortable: true,
12836
+ render(value2) {
12837
+ if (!value2) {
12838
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
12839
+ value: ""
12840
+ });
12758
12841
  }
12759
- },
12760
- {
12761
- key: "servicePort",
12762
- display: true,
12763
- dataIndex: "servicePort",
12764
- title: t2("dovetail.target_service_port"),
12765
- width: 120,
12766
- sortable: true
12767
- },
12768
- {
12769
- key: "secret",
12770
- display: true,
12771
- dataIndex: "host",
12772
- title: t2("dovetail.cert"),
12773
- width: 160,
12774
- render(host2) {
12775
- var _a, _b;
12776
- const secretName = (_b = (_a = ingress._rawYaml.spec.tls) == null ? void 0 : _a.find(
12777
- ({ hosts }) => hosts == null ? void 0 : hosts.includes(host2)
12778
- )) == null ? void 0 : _b.secretName;
12779
- return secretName ? /* @__PURE__ */ jsxRuntimeExports.jsx(
12780
- ResourceLink,
12781
- {
12782
- resourceName: "secrets",
12783
- namespace: ingress.metadata.namespace || "default",
12784
- name: secretName
12785
- }
12786
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, { value: "" });
12787
- },
12788
- sortable: true
12842
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
12843
+ className: PathCellStyle,
12844
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
12845
+ className: PathTextStyle,
12846
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(LinkFallback, {
12847
+ fullPath: value2
12848
+ })
12849
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(CopyButton, {
12850
+ value: value2,
12851
+ className: PathCopyStyle
12852
+ })]
12853
+ });
12789
12854
  }
12790
- ];
12855
+ }, {
12856
+ key: "serviceName",
12857
+ display: true,
12858
+ dataIndex: "serviceName",
12859
+ title: t2("dovetail.target_service"),
12860
+ sortable: true,
12861
+ width: 160,
12862
+ render: (serviceName, record) => {
12863
+ return record.serviceName ? /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
12864
+ resourceName: "services",
12865
+ namespace: ingress2.metadata.namespace || "default",
12866
+ name: serviceName
12867
+ }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
12868
+ value: ""
12869
+ });
12870
+ }
12871
+ }, {
12872
+ key: "servicePort",
12873
+ display: true,
12874
+ dataIndex: "servicePort",
12875
+ title: t2("dovetail.target_service_port"),
12876
+ width: 120,
12877
+ sortable: true
12878
+ }, {
12879
+ key: "secret",
12880
+ display: true,
12881
+ dataIndex: "host",
12882
+ title: t2("dovetail.cert"),
12883
+ width: 160,
12884
+ render(host2) {
12885
+ var _a, _b;
12886
+ const secretName = (_b = (_a = ingress2._rawYaml.spec.tls) == null ? void 0 : _a.find(({
12887
+ hosts
12888
+ }) => hosts == null ? void 0 : hosts.includes(host2))) == null ? void 0 : _b.secretName;
12889
+ return secretName ? /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
12890
+ resourceName: "secrets",
12891
+ namespace: ingress2.metadata.namespace || "default",
12892
+ name: secretName
12893
+ }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
12894
+ value: ""
12895
+ });
12896
+ },
12897
+ sortable: true
12898
+ }];
12791
12899
  const {
12792
12900
  data: finalData,
12793
12901
  currentPage,
@@ -12798,31 +12906,27 @@ const IngressRulesTable = ({ ingress }) => {
12798
12906
  data: rows
12799
12907
  });
12800
12908
  if ((rows == null ? void 0 : rows.length) === 0) {
12801
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12802
- WidgetErrorContent,
12803
- {
12804
- errorText: t2("dovetail.no_resource", { kind: t2("dovetail.rule") }),
12805
- type: ErrorContentType.List
12806
- }
12807
- );
12909
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent, {
12910
+ errorText: t2("dovetail.no_resource", {
12911
+ kind: t2("dovetail.rule")
12912
+ }),
12913
+ type: ErrorContentType.List
12914
+ });
12808
12915
  }
12809
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12810
- Table2,
12811
- {
12812
- tableKey: "ingressRules",
12813
- loading: false,
12814
- data: finalData,
12815
- total: rows.length,
12816
- columns: addDefaultRenderToColumns(columns),
12817
- rowKey: "pathType",
12818
- empty: t2("dovetail.empty"),
12819
- defaultSize: currentSize,
12820
- currentPage,
12821
- onPageChange,
12822
- onSorterChange,
12823
- showMenuColumn: false
12824
- }
12825
- );
12916
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Table2, {
12917
+ tableKey: "ingressRules",
12918
+ loading: false,
12919
+ data: finalData,
12920
+ total: rows.length,
12921
+ columns: addDefaultRenderToColumns(columns),
12922
+ rowKey: "pathType",
12923
+ empty: t2("dovetail.empty"),
12924
+ defaultSize: currentSize,
12925
+ currentPage,
12926
+ onPageChange,
12927
+ onSorterChange,
12928
+ showMenuColumn: false
12929
+ });
12826
12930
  };
12827
12931
  const KeyValue_1qasuz9 = "";
12828
12932
  const ContentBlockStyle = "c8jy7dc";
@@ -12951,9 +13055,7 @@ function readFileAsBase64(file) {
12951
13055
  if (isUtf8(arrayBuffer)) {
12952
13056
  resolve(await file.text());
12953
13057
  } else {
12954
- const base64String = btoa(
12955
- String.fromCharCode(...new Uint8Array(arrayBuffer))
12956
- );
13058
+ const base64String = btoa(String.fromCharCode(...new Uint8Array(arrayBuffer)));
12957
13059
  resolve(base64String);
12958
13060
  }
12959
13061
  return;
@@ -13710,7 +13812,7 @@ const StateTag = (props) => {
13710
13812
  }
13711
13813
  );
13712
13814
  };
13713
- const WorkloadPodsTable_975j2t = "";
13815
+ const WorkloadPodsTable_a750q3 = "";
13714
13816
  const WorkloadPodsTable = ({
13715
13817
  namespace: namespace2,
13716
13818
  selector,
@@ -13746,14 +13848,16 @@ const WorkloadPodsTable = ({
13746
13848
  kind: "Pod"
13747
13849
  },
13748
13850
  filters: {
13749
- permanent: [{
13750
- field: "",
13751
- value: "",
13752
- fn(item) {
13753
- return filter ? filter(item) : matchSelector(item, selector, namespace2);
13851
+ permanent: [
13852
+ {
13853
+ field: "",
13854
+ value: "",
13855
+ fn(item) {
13856
+ return filter ? filter(item) : matchSelector(item, selector, namespace2);
13857
+ }
13754
13858
  }
13755
13859
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13756
- }]
13860
+ ]
13757
13861
  }
13758
13862
  }
13759
13863
  });
@@ -14229,7 +14333,8 @@ const ServiceOutClusterAccessField = (clusterVip) => ({
14229
14333
  service: record,
14230
14334
  breakLine: false,
14231
14335
  clusterVip,
14232
- showDashedUnderline: false
14336
+ showDashedUnderline: false,
14337
+ showCopyButton: true
14233
14338
  });
14234
14339
  }
14235
14340
  });
@@ -14247,14 +14352,14 @@ const PodSelectorField = () => ({
14247
14352
  const PortsTableField = () => ({
14248
14353
  key: "ports",
14249
14354
  path: [],
14250
- renderContent: (_, service) => {
14355
+ renderContent: (_, service2) => {
14251
14356
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
14252
14357
  style: {
14253
14358
  padding: "0 24px",
14254
14359
  height: "100%"
14255
14360
  },
14256
14361
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(PortsTable, {
14257
- service
14362
+ service: service2
14258
14363
  })
14259
14364
  });
14260
14365
  }
@@ -14951,11 +15056,11 @@ const NetworkPolicyIngressRulesTab = ({
14951
15056
  fields: [{
14952
15057
  key: "Ingress",
14953
15058
  path: ["spec", "ingress"],
14954
- render: (ingress) => {
15059
+ render: (ingress2) => {
14955
15060
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
14956
15061
  className: NetworkPolicyRulesViewerStyle,
14957
15062
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(NetworkPolicyRulesViewer, {
14958
- ingressOrEgress: ingress
15063
+ ingressOrEgress: ingress2
14959
15064
  })
14960
15065
  });
14961
15066
  }
@@ -15030,7 +15135,9 @@ const PodContainersTable = ({
15030
15135
  const isInit = initContainerStatuses.some(
15031
15136
  (c2) => c2.containerID === record.containerID
15032
15137
  );
15033
- return i18n2.t(isInit ? "dovetail.init_container" : "dovetail.regular_container");
15138
+ return i18n2.t(
15139
+ isInit ? "dovetail.init_container" : "dovetail.regular_container"
15140
+ );
15034
15141
  }
15035
15142
  },
15036
15143
  {
@@ -15060,10 +15167,12 @@ const PodContainersTable = ({
15060
15167
  [i18n2, initContainerStatuses]
15061
15168
  );
15062
15169
  const dataSource = useMemo(
15063
- () => addId(containerStatuses.concat(initContainerStatuses), "containerID").map((container2) => ({
15064
- ...container2,
15065
- startedAt: get$2(container2, ["state", "running", "startedAt"]) || get$2(container2, ["state", "terminated", "startedAt"])
15066
- })),
15170
+ () => addId(containerStatuses.concat(initContainerStatuses), "containerID").map(
15171
+ (container2) => ({
15172
+ ...container2,
15173
+ startedAt: get$2(container2, ["state", "running", "startedAt"]) || get$2(container2, ["state", "terminated", "startedAt"])
15174
+ })
15175
+ ),
15067
15176
  [containerStatuses, initContainerStatuses]
15068
15177
  );
15069
15178
  const {
@@ -15074,10 +15183,12 @@ const PodContainersTable = ({
15074
15183
  } = useTableData({
15075
15184
  data: dataSource,
15076
15185
  columns,
15077
- defaultSorters: [{
15078
- field: "startedAt",
15079
- order: "desc"
15080
- }]
15186
+ defaultSorters: [
15187
+ {
15188
+ field: "startedAt",
15189
+ order: "desc"
15190
+ }
15191
+ ]
15081
15192
  });
15082
15193
  if (dataSource.length === 0) {
15083
15194
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -15095,7 +15206,9 @@ const PodContainersTable = ({
15095
15206
  loading: false,
15096
15207
  data: finalData,
15097
15208
  total: dataSource.length,
15098
- columns: addDefaultRenderToColumns(columns),
15209
+ columns: addDefaultRenderToColumns(
15210
+ columns
15211
+ ),
15099
15212
  rowKey: "containerID",
15100
15213
  error: false,
15101
15214
  defaultSize: currentSize,
@@ -15218,11 +15331,11 @@ const NetworkPolicyIngressRulesGroup = (i18n2) => ({
15218
15331
  {
15219
15332
  key: "Ingress",
15220
15333
  path: ["spec", "ingress"],
15221
- renderContent: (ingress) => {
15334
+ renderContent: (ingress2) => {
15222
15335
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
15223
15336
  NetworkPolicyRulesViewer,
15224
15337
  {
15225
- ingressOrEgress: ingress,
15338
+ ingressOrEgress: ingress2,
15226
15339
  kind: ` ${i18n2.t("dovetail.ingress_rule")}`
15227
15340
  }
15228
15341
  );
@@ -15276,7 +15389,7 @@ function Tabs(props) {
15276
15389
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTabPane, { tab: tab.title, children: tab.children }, tab.title);
15277
15390
  }) });
15278
15391
  }
15279
- const ShowContentView_11vyp5a = "";
15392
+ const ShowContentView_szlndu = "";
15280
15393
  const ShowContentWrapperStyle = "soapvs9";
15281
15394
  const BackButton = "b13d603q";
15282
15395
  const ToolBarWrapper = "tm8eaia";
@@ -15720,7 +15833,7 @@ function ReplicasDropdown(props) {
15720
15833
  ] });
15721
15834
  }
15722
15835
  const PodShell = lazy(
15723
- () => import("./PodShell-76331418.js").then((module2) => ({ default: module2.PodShell }))
15836
+ () => import("./PodShell-a6ed3498.js").then((module2) => ({ default: module2.PodShell }))
15724
15837
  );
15725
15838
  function PodShellModal(props) {
15726
15839
  const { pod: pod2 } = props;
@@ -16067,9 +16180,9 @@ function ResourceShow(props) {
16067
16180
  }
16068
16181
  );
16069
16182
  }
16070
- const button_1v659kh = "";
16183
+ const button_a1727f = "";
16071
16184
  const WarningButtonStyle = "wwyz7ti";
16072
- const modal_1eijuvm = "";
16185
+ const modal_1muog24 = "";
16073
16186
  const SmallModalStyle = "s1nc293e";
16074
16187
  const ExtraSubmitFooter_15u4r8u = "";
16075
16188
  const FooterStyle = "f16wn4bu";
@@ -17034,6 +17147,7 @@ const useForm = ({
17034
17147
  const [transformedInitValues, setTransformedInitValues] = useState(useHookFormResult.getValues());
17035
17148
  const [beforeSubmitErrors, setBeforeSubmitErrors] = useState([]);
17036
17149
  const [isBeforeSubmitLoading, setIsBeforeSubmitLoading] = useState(false);
17150
+ const hasAppliedInitialDataRef = useRef(false);
17037
17151
  const {
17038
17152
  watch,
17039
17153
  setValue,
@@ -17086,7 +17200,7 @@ const useForm = ({
17086
17200
  }, [captureInitialResource, (_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data]);
17087
17201
  useEffect(() => {
17088
17202
  var _a2;
17089
- if (formState.isDirty)
17203
+ if (hasAppliedInitialDataRef.current || formState.isDirty)
17090
17204
  return;
17091
17205
  const data2 = (_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data;
17092
17206
  if (!data2)
@@ -17104,6 +17218,7 @@ const useForm = ({
17104
17218
  });
17105
17219
  }
17106
17220
  });
17221
+ hasAppliedInitialDataRef.current = true;
17107
17222
  setTransformedInitValues(getValues());
17108
17223
  }, [queryResult == null ? void 0 : queryResult.data, setValue, transformInitValues, formState.isDirty, getValues]);
17109
17224
  useEffect(() => {
@@ -17762,31 +17877,43 @@ function CronJobDropdown(props) {
17762
17877
  values: v,
17763
17878
  successNotification() {
17764
17879
  return {
17765
- message: t2(suspended ? "dovetail.resume_success_toast" : "dovetail.pause_success_toast", {
17766
- kind: record.kind,
17767
- name: id,
17768
- interpolation: {
17769
- escapeValue: false
17880
+ message: t2(
17881
+ suspended ? "dovetail.resume_success_toast" : "dovetail.pause_success_toast",
17882
+ {
17883
+ kind: record.kind,
17884
+ name: id,
17885
+ interpolation: {
17886
+ escapeValue: false
17887
+ }
17770
17888
  }
17771
- }),
17889
+ ),
17772
17890
  type: "success"
17773
17891
  };
17774
17892
  },
17775
17893
  errorNotification() {
17776
17894
  return {
17777
- message: t2(suspended ? "dovetail.resume_failed_toast" : "dovetail.pause_failed_toast", {
17778
- kind: record.kind,
17779
- name: id,
17780
- interpolation: {
17781
- escapeValue: false
17895
+ message: t2(
17896
+ suspended ? "dovetail.resume_failed_toast" : "dovetail.pause_failed_toast",
17897
+ {
17898
+ kind: record.kind,
17899
+ name: id,
17900
+ interpolation: {
17901
+ escapeValue: false
17902
+ }
17782
17903
  }
17783
- }),
17904
+ ),
17784
17905
  type: "error"
17785
17906
  };
17786
17907
  }
17787
17908
  });
17788
17909
  },
17789
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { src: suspended ? RecoverContinue16GradientBlueIcon : Pause16GradientBlueIcon, children: t2(suspended ? "dovetail.resume" : "dovetail.suspend") })
17910
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
17911
+ Icon,
17912
+ {
17913
+ src: suspended ? RecoverContinue16GradientBlueIcon : Pause16GradientBlueIcon,
17914
+ children: t2(suspended ? "dovetail.resume" : "dovetail.suspend")
17915
+ }
17916
+ )
17790
17917
  }
17791
17918
  ) : null });
17792
17919
  }
@@ -18303,7 +18430,9 @@ const DeleteButton = () => {
18303
18430
  const { resource } = useResource();
18304
18431
  const { id } = useParsed();
18305
18432
  const { t: t2 } = useTranslation();
18306
- const { openDeleteConfirmModal } = useDeleteModal({ resourceName: (resource == null ? void 0 : resource.name) || "" });
18433
+ const { openDeleteConfirmModal } = useDeleteModal({
18434
+ resourceName: (resource == null ? void 0 : resource.name) || ""
18435
+ });
18307
18436
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
18308
18437
  Button,
18309
18438
  {
@@ -18314,7 +18443,7 @@ const DeleteButton = () => {
18314
18443
  }
18315
18444
  ) });
18316
18445
  };
18317
- const index_1tehui8 = "";
18446
+ const index_e6cgji = "";
18318
18447
  const MenuStyle = "mdppgn0";
18319
18448
  const Menu = () => {
18320
18449
  const {
@@ -19451,9 +19580,9 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
19451
19580
  });
19452
19581
  const nodePortsFromOtherServices = useMemo(() => {
19453
19582
  var _a;
19454
- return ((_a = services == null ? void 0 : services.data) == null ? void 0 : _a.filter((service) => service.id !== serviceId).map((service) => {
19583
+ return ((_a = services == null ? void 0 : services.data) == null ? void 0 : _a.filter((service2) => service2.id !== serviceId).map((service2) => {
19455
19584
  var _a2, _b;
19456
- return (_b = (_a2 = service == null ? void 0 : service.spec) == null ? void 0 : _a2.ports) == null ? void 0 : _b.map((port2) => port2.nodePort);
19585
+ return (_b = (_a2 = service2 == null ? void 0 : service2.spec) == null ? void 0 : _a2.ports) == null ? void 0 : _b.map((port2) => port2.nodePort);
19457
19586
  }).flat().filter((port2) => port2 !== void 0)) || [];
19458
19587
  }, [services, serviceId]);
19459
19588
  const columns = useMemo(() => {
@@ -19646,7 +19775,7 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
19646
19775
  }
19647
19776
  );
19648
19777
  });
19649
- const IngressRulesComponent = ({ ingress, noLink }) => {
19778
+ const IngressRulesComponent = ({ ingress: ingress2, noLink }) => {
19650
19779
  const { data: serviceData } = useList({
19651
19780
  resource: "services",
19652
19781
  meta: {
@@ -19654,12 +19783,12 @@ const IngressRulesComponent = ({ ingress, noLink }) => {
19654
19783
  apiVersion: "v1"
19655
19784
  }
19656
19785
  });
19657
- const flattenedRules = (serviceData == null ? void 0 : serviceData.data) ? ingress.getFlattenedRules(serviceData == null ? void 0 : serviceData.data) : [];
19786
+ const flattenedRules = (serviceData == null ? void 0 : serviceData.data) ? ingress2.getFlattenedRules(serviceData == null ? void 0 : serviceData.data) : [];
19658
19787
  const result = flattenedRules.map((r2) => {
19659
19788
  var _a, _b;
19660
19789
  const arrow = " → ";
19661
19790
  const divider = " | ";
19662
- const secretName = (_b = (_a = ingress.spec.tls) == null ? void 0 : _a.find(
19791
+ const secretName = (_b = (_a = ingress2.spec.tls) == null ? void 0 : _a.find(
19663
19792
  ({ hosts }) => hosts == null ? void 0 : hosts.includes(r2.host || "")
19664
19793
  )) == null ? void 0 : _b.secretName;
19665
19794
  let tooltip = r2.fullPath;
@@ -19680,7 +19809,7 @@ const IngressRulesComponent = ({ ingress, noLink }) => {
19680
19809
  ResourceLink,
19681
19810
  {
19682
19811
  resourceName: "services",
19683
- namespace: ingress.metadata.namespace || "default",
19812
+ namespace: ingress2.metadata.namespace || "default",
19684
19813
  name: r2.serviceName
19685
19814
  }
19686
19815
  ),
@@ -19695,7 +19824,7 @@ const IngressRulesComponent = ({ ingress, noLink }) => {
19695
19824
  ResourceLink,
19696
19825
  {
19697
19826
  resourceName: "secrets",
19698
- namespace: ingress.metadata.namespace || "default",
19827
+ namespace: ingress2.metadata.namespace || "default",
19699
19828
  name: secretName
19700
19829
  }
19701
19830
  )
@@ -20064,7 +20193,10 @@ function ServiceOutClusterAccessTitle() {
20064
20193
  })
20065
20194
  });
20066
20195
  }
20067
- const ServiceOutClusterAccessColumnRenderer = (clusterVip) => {
20196
+ const ServiceOutClusterAccessColumnRenderer = (_i18n, options) => {
20197
+ const {
20198
+ clusterVip
20199
+ } = options;
20068
20200
  return {
20069
20201
  key: "outClusterAccess",
20070
20202
  title: /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessTitle, {}),
@@ -20104,10 +20236,8 @@ const PodWorkloadColumnRenderer = (i18n2) => {
20104
20236
  }
20105
20237
  };
20106
20238
  };
20107
- const IngressRulesColumnRenderer = ({
20108
- i18n: i18n2,
20109
- noLink
20110
- }) => {
20239
+ const IngressRulesColumnRenderer = (i18n2, options) => {
20240
+ const noLink = options == null ? void 0 : options.noLink;
20111
20241
  const dataIndex = ["spec", "rules"];
20112
20242
  return {
20113
20243
  key: "type",
@@ -20568,39 +20698,45 @@ const Dovetail = (props) => {
20568
20698
  antd4Configs: {
20569
20699
  getPopupContainer: antdGetPopupContainer || (() => document.body)
20570
20700
  },
20571
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalStoreContext.Provider, { value: globalStoreMap, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
20572
- Refine,
20701
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
20702
+ GlobalStoreContext.Provider,
20573
20703
  {
20574
- dataProvider: dataProvider(globalStoreMap.default),
20575
- liveProvider: liveProvider(globalStoreMap.default),
20576
- routerProvider,
20577
- notificationProvider,
20578
- options: {
20579
- warnWhenUnsavedChanges: true,
20580
- liveMode: "auto",
20581
- disableTelemetry: true
20582
- },
20583
- accessControlProvider,
20584
- resources: resourcesConfig.map((c2) => {
20585
- return {
20586
- name: c2.name,
20587
- meta: {
20588
- dataProviderName: c2.dataProviderName,
20589
- resourceBasePath: c2.basePath,
20590
- kind: c2.kind,
20591
- parent: c2.parent,
20592
- label: `${c2.kind}s`
20704
+ value: globalStoreMap,
20705
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
20706
+ Refine,
20707
+ {
20708
+ dataProvider: dataProvider(globalStoreMap.default),
20709
+ liveProvider: liveProvider(globalStoreMap.default),
20710
+ routerProvider,
20711
+ notificationProvider,
20712
+ options: {
20713
+ warnWhenUnsavedChanges: true,
20714
+ liveMode: "auto",
20715
+ disableTelemetry: true
20593
20716
  },
20594
- list: `${urlPrefix}/${c2.name}`,
20595
- show: `${urlPrefix}/${c2.name}/show`,
20596
- create: `${urlPrefix}/${c2.name}/create`,
20597
- edit: `${urlPrefix}/${c2.name}/edit`
20598
- };
20599
- }),
20600
- ...props,
20601
- children: content
20717
+ accessControlProvider,
20718
+ resources: resourcesConfig.map((c2) => {
20719
+ return {
20720
+ name: c2.name,
20721
+ meta: {
20722
+ dataProviderName: c2.dataProviderName,
20723
+ resourceBasePath: c2.basePath,
20724
+ kind: c2.kind,
20725
+ parent: c2.parent,
20726
+ label: `${c2.kind}s`
20727
+ },
20728
+ list: `${urlPrefix}/${c2.name}`,
20729
+ show: `${urlPrefix}/${c2.name}/show`,
20730
+ create: `${urlPrefix}/${c2.name}/create`,
20731
+ edit: `${urlPrefix}/${c2.name}/edit`
20732
+ };
20733
+ }),
20734
+ ...props,
20735
+ children: content
20736
+ }
20737
+ )
20602
20738
  }
20603
- ) })
20739
+ )
20604
20740
  }
20605
20741
  ) }) }) }) });
20606
20742
  };
@@ -20661,8 +20797,8 @@ class ModelPlugin {
20661
20797
  restoreItem(item) {
20662
20798
  return item._rawYaml;
20663
20799
  }
20664
- setModelMap(key2, model) {
20665
- this.ModelMap.set(key2, model);
20800
+ setModelMap(key2, ModelClass) {
20801
+ this.ModelMap.set(key2, ModelClass);
20666
20802
  }
20667
20803
  }
20668
20804
  const modelPlugin = new ModelPlugin();
@@ -20768,12 +20904,14 @@ export {
20768
20904
  ColumnKeys,
20769
20905
  CommonSorter,
20770
20906
  ComponentContext,
20907
+ ComponentContextProvider,
20771
20908
  ConditionsField,
20772
20909
  ConditionsGroup,
20773
20910
  ConditionsTab,
20774
20911
  ConditionsTable,
20775
20912
  ConfigsContext,
20776
20913
  ControllerRevisionModel,
20914
+ CopyButton,
20777
20915
  CreateButton,
20778
20916
  CronJobDropdown,
20779
20917
  CronJobModel,
@@ -20801,7 +20939,7 @@ export {
20801
20939
  EditLabelForm,
20802
20940
  EditNodeTaintDropdownMenuItem,
20803
20941
  EditNodeTaintForm,
20804
- WidgetErrorContent as ErrorContent,
20942
+ ErrorContent,
20805
20943
  ErrorContentType,
20806
20944
  ErrorWrapper,
20807
20945
  EventModel,
@@ -21010,6 +21148,7 @@ export {
21010
21148
  Time,
21011
21149
  ValidateRfc1035Name,
21012
21150
  index as ValueDisplay,
21151
+ WidgetErrorContent,
21013
21152
  WorkloadBaseModel,
21014
21153
  WorkloadDropdown,
21015
21154
  WorkloadImageColumnRenderer,
@@ -21020,7 +21159,6 @@ export {
21020
21159
  YamlEditorComponent,
21021
21160
  YamlForm,
21022
21161
  addDefaultRenderToColumns,
21023
- dnsSubDomainRules,
21024
21162
  dovetailRefineI18n,
21025
21163
  generateSchemaTypeValue,
21026
21164
  generateValueFromSchema,
@@ -21034,12 +21172,11 @@ export {
21034
21172
  relationPlugin,
21035
21173
  renderCommonFormFiled,
21036
21174
  resolveRef,
21037
- rfc1035LabelRules,
21038
- rfc1123LabelRules,
21039
21175
  routerProvider,
21040
21176
  shortenedImage,
21041
21177
  transformResourceKindInSentence,
21042
21178
  useApiGroupSchema,
21179
+ useDeleteManyModal,
21043
21180
  useDeleteModal,
21044
21181
  useDeleteModalOnly,
21045
21182
  useDownloadYAML,