@dovetail-v2/refine 0.3.12-alpha.2 → 0.3.13-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/refine.js CHANGED
@@ -11,7 +11,7 @@ import { ResourceContext, matchResourceFromRoute, useResource, useDelete, useNav
11
11
  import { parse, stringify } from "qs";
12
12
  import React, { createElement, isValidElement, cloneElement, Children, useContext, useCallback, createContext, useState, useEffect, useMemo, useRef, useImperativeHandle, lazy, Suspense, memo, forwardRef } 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, Typo, Input, Select, AntdOption, Button, Form, Space, TextArea, kitContext, Loading, Table as Table$2, Pagination, Alert, ImmersiveDialog, SmallDialog, Fields, Units, Link as Link$1, OverflowTooltip, Tooltip, Dropdown, Menu as Menu$1, Icon, Divider, Modal, StatusCapsule, Popover, AntdTable, TableForm, Upload, 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";
14
+ import { usePushModal, usePopModal, DeleteDialog, Tag, RejectDialog, RejectDialogType, Typo, Input, Select, AntdOption, Button, Form, Space, TextArea, kitContext, Loading, Table as Table$2, Pagination, Alert, ImmersiveDialog, SmallDialog, Fields, Units, Link as Link$1, OverflowTooltip, Tooltip, Dropdown, Menu as Menu$1, Icon, Divider, Modal, StatusCapsule, Popover, AntdTable, Upload, TableForm, 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
15
  import { EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, PlusAddCreateNew16BoldOntintIcon, ViewEye16GradientGrayIcon, EntityFilterIgnoreGradient16GrayIcon, InfoICircleFill16GrayIcon, InfoICircleFill16Gray70Icon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, ArrowChevronDownSmall16BlueIcon, ArrowChevronUpSmall16BlueIcon, Retry16GradientBlueIcon, OpenTerminal16GradientBlueIcon, ArrowChevronDown16BlueIcon, ArrowChevronUp16BlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, EditPen16GradientGrayIcon, EditPen16GradientBlueIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, Pause16GradientBlueIcon, EditPen16BlueIcon } from "@cloudtower/icons-react";
16
16
  import { first, get as get$2, cloneDeep, set, omit as omit$1, merge, isEqual as isEqual$1, debounce, last, setWith, clone, isObject as isObject$4, uniq, keyBy } from "lodash-es";
17
17
  import yaml$2 from "js-yaml";
@@ -549,7 +549,7 @@ const realtime_log$1 = "Real-time logs";
549
549
  const previous_log$1 = "Last startup logs";
550
550
  const auto_wrap$1 = "Auto wrap";
551
551
  const container_num$1 = "Containers";
552
- const edit_resource_success$1 = "{{resource}} {{name}} was edited successfully";
552
+ const edit_resource_success$1 = "{{kind}} {{name}} was edited successfully";
553
553
  const redeploy_success_toast$1 = "{{kind}} {{name}} was redeployed successfully";
554
554
  const redeploy_failed_toast$1 = "Failed to redeploy {{kind}} {{name}}";
555
555
  const pause_success_toast$1 = "Successfully suspended";
@@ -1021,7 +1021,7 @@ const expand = "展开";
1021
1021
  const fold = "收起";
1022
1022
  const rule = "规则";
1023
1023
  const default_backend = "默认后端";
1024
- const ingress_class = "Ingress 类";
1024
+ const ingress_class = "IngressClass";
1025
1025
  const port = "端口";
1026
1026
  const pod_ready_num = "Pod 就绪数量";
1027
1027
  const pod_complete_num = "Pod 完成数量";
@@ -1203,6 +1203,9 @@ const node_port_duplicated = "端口已被占用。";
1203
1203
  const all = "全部";
1204
1204
  const optional_with_bracket = "(选填)";
1205
1205
  const label_annotations = "标签与注解";
1206
+ const target_service = "目标服务";
1207
+ const target_service_port = "目标服务端口";
1208
+ const select_workload = "选择工作负载";
1206
1209
  const dovetail = {
1207
1210
  copy,
1208
1211
  reset_arguments,
@@ -1468,7 +1471,10 @@ const dovetail = {
1468
1471
  node_port_duplicated,
1469
1472
  all,
1470
1473
  optional_with_bracket,
1471
- label_annotations
1474
+ label_annotations,
1475
+ target_service,
1476
+ target_service_port,
1477
+ select_workload
1472
1478
  };
1473
1479
  const ZH = {
1474
1480
  dovetail
@@ -8684,7 +8690,7 @@ class IngressModel extends ResourceModel {
8684
8690
  getFlattenedRules(services) {
8685
8691
  var _a, _b, _c, _d;
8686
8692
  const protocal = !!this._rawYaml.spec.tls ? "https" : "http";
8687
- const servicePort = (_c = (_b = (_a = services.find((s2) => {
8693
+ const servicePort = (_c = (_b = (_a = services == null ? void 0 : services.find((s2) => {
8688
8694
  var _a2, _b2;
8689
8695
  return ((_a2 = s2.metadata) == null ? void 0 : _a2.name) === "contour-envoy" && ((_b2 = s2.spec) == null ? void 0 : _b2.type) === "NodePort";
8690
8696
  })) == null ? void 0 : _a.spec) == null ? void 0 : _b.ports) == null ? void 0 : _c.find((p) => p.name === protocal);
@@ -9316,17 +9322,70 @@ var ResourceState = /* @__PURE__ */ ((ResourceState2) => {
9316
9322
  ResourceState2["DELETING"] = "deleting";
9317
9323
  return ResourceState2;
9318
9324
  })(ResourceState || {});
9325
+ function isLabelSelector(selector) {
9326
+ if (!selector || typeof selector !== "object") {
9327
+ return false;
9328
+ }
9329
+ const s2 = selector;
9330
+ if ("matchExpressions" in s2) {
9331
+ return true;
9332
+ }
9333
+ if ("matchLabels" in s2) {
9334
+ const ml = s2.matchLabels;
9335
+ return typeof ml === "object" && ml !== null;
9336
+ }
9337
+ return false;
9338
+ }
9319
9339
  function matchSelector(pod2, selector, namespace2 = "default") {
9320
- var _a, _b, _c, _d;
9321
- let match = true;
9322
- if (selector) {
9323
- for (const key2 in selector.matchLabels) {
9324
- if (!((_b = (_a = pod2.metadata) == null ? void 0 : _a.labels) == null ? void 0 : _b[key2]) || ((_c = pod2.metadata.labels) == null ? void 0 : _c[key2]) !== selector.matchLabels[key2]) {
9325
- match = false;
9340
+ var _a, _b;
9341
+ if (((_a = pod2.metadata) == null ? void 0 : _a.namespace) !== namespace2) {
9342
+ return false;
9343
+ }
9344
+ if (!selector || Object.keys(selector).length === 0) {
9345
+ return true;
9346
+ }
9347
+ const podLabels = ((_b = pod2.metadata) == null ? void 0 : _b.labels) || {};
9348
+ let matchLabels;
9349
+ let matchExpressions;
9350
+ if (isLabelSelector(selector)) {
9351
+ matchLabels = selector.matchLabels;
9352
+ matchExpressions = selector.matchExpressions;
9353
+ } else {
9354
+ matchLabels = selector;
9355
+ }
9356
+ if (matchLabels) {
9357
+ for (const key2 in matchLabels) {
9358
+ if (podLabels[key2] !== matchLabels[key2]) {
9359
+ return false;
9326
9360
  }
9327
9361
  }
9328
9362
  }
9329
- return match && ((_d = pod2.metadata) == null ? void 0 : _d.namespace) === namespace2;
9363
+ if (matchExpressions) {
9364
+ for (const req of matchExpressions) {
9365
+ const { key: key2, operator, values } = req;
9366
+ const labelValue = podLabels[key2];
9367
+ const hasLabel = Object.prototype.hasOwnProperty.call(podLabels, key2);
9368
+ switch (operator) {
9369
+ case "In":
9370
+ if (!hasLabel || !(values == null ? void 0 : values.includes(labelValue)))
9371
+ return false;
9372
+ break;
9373
+ case "NotIn":
9374
+ if (hasLabel && (values == null ? void 0 : values.includes(labelValue)))
9375
+ return false;
9376
+ break;
9377
+ case "Exists":
9378
+ if (!hasLabel)
9379
+ return false;
9380
+ break;
9381
+ case "DoesNotExist":
9382
+ if (hasLabel)
9383
+ return false;
9384
+ break;
9385
+ }
9386
+ }
9387
+ }
9388
+ return true;
9330
9389
  }
9331
9390
  class WorkloadBaseModel extends ResourceModel {
9332
9391
  constructor(_rawYaml, _globalStore) {
@@ -10287,13 +10346,20 @@ const ConditionsTable = ({ conditions = [] }) => {
10287
10346
  width: 403
10288
10347
  }
10289
10348
  ];
10290
- const { data: finalData, currentPage, onPageChange, onSorterChange } = useTableData({
10349
+ const {
10350
+ data: finalData,
10351
+ currentPage,
10352
+ onPageChange,
10353
+ onSorterChange
10354
+ } = useTableData({
10291
10355
  data: conditionsWithId,
10292
10356
  columns,
10293
- defaultSorters: [{
10294
- field: "lastUpdateTime",
10295
- order: "desc"
10296
- }]
10357
+ defaultSorters: [
10358
+ {
10359
+ field: "lastUpdateTime",
10360
+ order: "desc"
10361
+ }
10362
+ ]
10297
10363
  });
10298
10364
  const currentSize = 10;
10299
10365
  if (conditionsWithId.length === 0) {
@@ -10301,7 +10367,7 @@ const ConditionsTable = ({ conditions = [] }) => {
10301
10367
  WidgetErrorContent,
10302
10368
  {
10303
10369
  errorText: t2("dovetail.no_resource", { kind: t2("dovetail.condition") }),
10304
- type: ErrorContentType.Card
10370
+ type: ErrorContentType.List
10305
10371
  }
10306
10372
  );
10307
10373
  }
@@ -10646,7 +10712,7 @@ function K8sDropdown(props) {
10646
10712
  const configs = useContext(ConfigsContext);
10647
10713
  const resourceName = getResourceNameByKind(record.kind || "", configs);
10648
10714
  const config = configs[resourceName || ""];
10649
- const { t: t2 } = useTranslation();
10715
+ const { t: t2, i18n: i18n2 } = useTranslation();
10650
10716
  const { openDeleteConfirmModal } = useDeleteModal({ resourceName: resourceName || "" });
10651
10717
  const download2 = useDownloadYAML();
10652
10718
  const openForm = useOpenForm();
@@ -10670,7 +10736,10 @@ function K8sDropdown(props) {
10670
10736
  Dropdown,
10671
10737
  {
10672
10738
  overlay: /* @__PURE__ */ jsxRuntimeExports.jsxs(Menu$1, { children: [
10673
- isInShowPage || (canEditData == null ? void 0 : canEditData.can) === false || config.hideEdit ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Menu$1.Item, { onClick: () => openForm({ id: record.id, resourceName }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { src: EditPen16PrimaryIcon, children: formType === FormType.FORM ? t2("dovetail.edit") : t2("dovetail.edit_yaml") }) }),
10739
+ isInShowPage || (canEditData == null ? void 0 : canEditData.can) === false || config.hideEdit ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Menu$1.Item, { onClick: () => openForm({ id: record.id, resourceName }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { src: EditPen16PrimaryIcon, children: formType === FormType.FORM ? `${t2("dovetail.edit")}${transformResourceKindInSentence(
10740
+ (config == null ? void 0 : config.displayName) || record.kind || "",
10741
+ i18n2.language
10742
+ )}` : t2("dovetail.edit_yaml") }) }),
10674
10743
  /* @__PURE__ */ jsxRuntimeExports.jsx(
10675
10744
  Menu$1.Item,
10676
10745
  {
@@ -11001,10 +11070,17 @@ const EventsTable = ({ uid }) => {
11001
11070
  width: 120,
11002
11071
  render(value2) {
11003
11072
  const colorMap = {
11004
- "Warning": "warning",
11005
- "Normal": "green"
11073
+ Warning: "warning",
11074
+ Normal: "green"
11006
11075
  };
11007
- return /* @__PURE__ */ jsxRuntimeExports.jsx(StatusCapsule, { color: colorMap[value2], className: cx_default(StateTagStyle, "no-background"), children: i18n2.t(`dovetail.${value2.toLowerCase()}`) });
11076
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
11077
+ StatusCapsule,
11078
+ {
11079
+ color: colorMap[value2],
11080
+ className: cx_default(StateTagStyle, "no-background"),
11081
+ children: i18n2.t(`dovetail.${value2.toLowerCase()}`)
11082
+ }
11083
+ );
11008
11084
  },
11009
11085
  sorter: CommonSorter(["type"])
11010
11086
  },
@@ -11026,32 +11102,41 @@ const EventsTable = ({ uid }) => {
11026
11102
  width: 723,
11027
11103
  sorter: CommonSorter(["note"])
11028
11104
  },
11029
- AgeColumnRenderer(i18n2, { title: i18n2.t("dovetail.last_seen"), width: 160 }, { isRelativeTime: false })
11105
+ AgeColumnRenderer(
11106
+ i18n2,
11107
+ { title: i18n2.t("dovetail.last_seen"), width: 160 },
11108
+ { isRelativeTime: false }
11109
+ )
11030
11110
  ],
11031
11111
  [i18n2]
11032
11112
  );
11033
- const params = useMemo(() => ({
11034
- columns,
11035
- tableProps: {
11036
- defaultSize: 50
11037
- },
11038
- useTableParams: {
11039
- resource: "events",
11040
- meta: { resourceBasePath: "/apis/events.k8s.io/v1", kind: "Event" },
11041
- filters: {
11042
- permanent: [{
11043
- operator: "and",
11044
- value: [
11113
+ const params = useMemo(
11114
+ () => ({
11115
+ columns,
11116
+ tableProps: {
11117
+ defaultSize: 50
11118
+ },
11119
+ useTableParams: {
11120
+ resource: "events",
11121
+ meta: { resourceBasePath: "/apis/events.k8s.io/v1", kind: "Event" },
11122
+ filters: {
11123
+ permanent: [
11045
11124
  {
11046
- field: "regarding.uid",
11047
- operator: "eq",
11048
- value: uid
11125
+ operator: "and",
11126
+ value: [
11127
+ {
11128
+ field: "regarding.uid",
11129
+ operator: "eq",
11130
+ value: uid
11131
+ }
11132
+ ]
11049
11133
  }
11050
11134
  ]
11051
- }]
11135
+ }
11052
11136
  }
11053
- }
11054
- }), [columns, uid]);
11137
+ }),
11138
+ [columns, uid]
11139
+ );
11055
11140
  const { tableProps } = useEagleTable(params);
11056
11141
  const component = useContext(ComponentContext);
11057
11142
  const Table2 = component.Table || Table$1;
@@ -11059,18 +11144,12 @@ const EventsTable = ({ uid }) => {
11059
11144
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
11060
11145
  WidgetErrorContent,
11061
11146
  {
11062
- errorText: i18n2.t("dovetail.no_resource", { kind: i18n2.t("dovetail.event") })
11147
+ errorText: i18n2.t("dovetail.no_resource", { kind: i18n2.t("dovetail.event") }),
11148
+ type: ErrorContentType.List
11063
11149
  }
11064
11150
  );
11065
11151
  }
11066
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
11067
- Table2,
11068
- {
11069
- ...tableProps,
11070
- tableKey: "events",
11071
- showMenuColumn: false
11072
- }
11073
- );
11152
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Table2, { ...tableProps, tableKey: "events", showMenuColumn: false });
11074
11153
  };
11075
11154
  const index_mvy4dx = "";
11076
11155
  const ImageWrapperStyle = "i1u1f5zp";
@@ -11162,7 +11241,10 @@ const IngressRulesTable = ({ ingress }) => {
11162
11241
  apiVersion: "v1"
11163
11242
  }
11164
11243
  });
11165
- const flattenedRules = useMemo(() => (serviceData == null ? void 0 : serviceData.data) ? ingress.getFlattenedRules(serviceData == null ? void 0 : serviceData.data) : [], [serviceData == null ? void 0 : serviceData.data, ingress]);
11244
+ const flattenedRules = useMemo(
11245
+ () => (serviceData == null ? void 0 : serviceData.data) ? ingress.getFlattenedRules(serviceData == null ? void 0 : serviceData.data) : [],
11246
+ [serviceData == null ? void 0 : serviceData.data, ingress]
11247
+ );
11166
11248
  const rows = useMemo(() => {
11167
11249
  return addId(flattenedRules || [], "fullPath");
11168
11250
  }, [flattenedRules]);
@@ -11193,7 +11275,7 @@ const IngressRulesTable = ({ ingress }) => {
11193
11275
  key: "serviceName",
11194
11276
  display: true,
11195
11277
  dataIndex: "serviceName",
11196
- title: t2("dovetail.backend"),
11278
+ title: t2("dovetail.target_service"),
11197
11279
  sortable: true,
11198
11280
  width: 160,
11199
11281
  render: (serviceName, record) => {
@@ -11204,14 +11286,14 @@ const IngressRulesTable = ({ ingress }) => {
11204
11286
  namespace: ingress.metadata.namespace || "default",
11205
11287
  name: serviceName
11206
11288
  }
11207
- ) : record.resourceName;
11289
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, { value: "" });
11208
11290
  }
11209
11291
  },
11210
11292
  {
11211
11293
  key: "servicePort",
11212
11294
  display: true,
11213
11295
  dataIndex: "servicePort",
11214
- title: t2("dovetail.port"),
11296
+ title: t2("dovetail.target_service_port"),
11215
11297
  width: 120,
11216
11298
  sortable: true
11217
11299
  },
@@ -11219,11 +11301,13 @@ const IngressRulesTable = ({ ingress }) => {
11219
11301
  key: "secret",
11220
11302
  display: true,
11221
11303
  dataIndex: "host",
11222
- title: "Secret",
11304
+ title: t2("dovetail.cert"),
11223
11305
  width: 160,
11224
11306
  render(host2) {
11225
11307
  var _a, _b;
11226
- const secretName = (_b = (_a = ingress._rawYaml.spec.tls) == null ? void 0 : _a.find(({ hosts }) => hosts == null ? void 0 : hosts.includes(host2))) == null ? void 0 : _b.secretName;
11308
+ const secretName = (_b = (_a = ingress._rawYaml.spec.tls) == null ? void 0 : _a.find(
11309
+ ({ hosts }) => hosts == null ? void 0 : hosts.includes(host2)
11310
+ )) == null ? void 0 : _b.secretName;
11227
11311
  return secretName ? /* @__PURE__ */ jsxRuntimeExports.jsx(
11228
11312
  ResourceLink,
11229
11313
  {
@@ -11250,7 +11334,7 @@ const IngressRulesTable = ({ ingress }) => {
11250
11334
  WidgetErrorContent,
11251
11335
  {
11252
11336
  errorText: t2("dovetail.no_resource", { kind: t2("dovetail.rule") }),
11253
- type: ErrorContentType.Card
11337
+ type: ErrorContentType.List
11254
11338
  }
11255
11339
  );
11256
11340
  }
@@ -11280,7 +11364,8 @@ const KeyValue = (props) => {
11280
11364
  const {
11281
11365
  data: data2 = {},
11282
11366
  hideSecret,
11283
- empty: empty2
11367
+ empty: empty2,
11368
+ errorContent = ErrorContentType.List
11284
11369
  } = props;
11285
11370
  const {
11286
11371
  t: t2
@@ -11298,7 +11383,7 @@ const KeyValue = (props) => {
11298
11383
  if (!result.length) {
11299
11384
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent, {
11300
11385
  errorText: empty2 || t2("dovetail.empty"),
11301
- type: ErrorContentType.Card
11386
+ type: errorContent
11302
11387
  });
11303
11388
  }
11304
11389
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
@@ -11346,9 +11431,7 @@ function KeyValueAnnotation(props) {
11346
11431
  }) : null]
11347
11432
  });
11348
11433
  }
11349
- const KeyValueSecret_c3ji18 = "";
11350
- const ButtonStyle$1 = "b11tbgf7";
11351
- const GroupStyle$1 = "gtbyh5g";
11434
+ const KeyValueSecret_ltbqs = "";
11352
11435
  function KeyValueSecret(props) {
11353
11436
  const {
11354
11437
  data: data2 = {}
@@ -11358,26 +11441,23 @@ function KeyValueSecret(props) {
11358
11441
  } = useTranslation();
11359
11442
  const [hideSecret, setHideSecret] = useState(true);
11360
11443
  const toggleButton = Object.keys(data2).length ? /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
11361
- type: "quiet",
11362
11444
  prefixIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, {
11363
11445
  src: hideSecret ? ViewEye16GradientGrayIcon : EntityFilterIgnoreGradient16GrayIcon
11364
11446
  }),
11365
11447
  onClick: () => setHideSecret((v) => !v),
11366
- className: ButtonStyle$1,
11367
11448
  size: "small",
11449
+ className: "c11tbgf7",
11368
11450
  children: hideSecret ? i18n2.t("dovetail.show_data_value") : i18n2.t("dovetail.hide_data_value")
11369
11451
  }) : null;
11370
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ShowGroupWithTitleComponent, {
11371
- title: i18n2.t("dovetail.data"),
11372
- operationEle: toggleButton,
11373
- className: GroupStyle$1,
11374
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValue, {
11452
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
11453
+ className: "ctbyh5g",
11454
+ children: [toggleButton, /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValue, {
11375
11455
  data: data2,
11376
11456
  hideSecret,
11377
11457
  empty: i18n2.t("dovetail.no_resource", {
11378
11458
  kind: i18n2.t("dovetail.data")
11379
11459
  })
11380
- })
11460
+ })]
11381
11461
  });
11382
11462
  }
11383
11463
  function isUtf8(buffer) {
@@ -11524,6 +11604,37 @@ function _KeyValueTableForm(props, ref) {
11524
11604
  const tableFormRef = useRef(null);
11525
11605
  const [_value, _setValue] = useState(value2 || defaultValue);
11526
11606
  const [forceUpdateCount, setForceUpdateCount] = useState(0);
11607
+ const finalExtraAction = useMemo(() => {
11608
+ if (extraAction) {
11609
+ return extraAction;
11610
+ }
11611
+ if (canImportFromFile) {
11612
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Upload, {
11613
+ multiple: true,
11614
+ showUploadList: false,
11615
+ onChange: async (e2) => {
11616
+ var _a;
11617
+ const fileValue = {
11618
+ key: e2.file.name,
11619
+ value: await readFileAsBase64(e2.file.originFileObj)
11620
+ };
11621
+ let newValue = [..._value, fileValue];
11622
+ if (_value.some((v) => v.key === fileValue.key)) {
11623
+ newValue = _value.map((v) => v.key === fileValue.key ? fileValue : v);
11624
+ }
11625
+ _setValue(newValue);
11626
+ (_a = tableFormRef.current) == null ? void 0 : _a.setData(newValue);
11627
+ onChange == null ? void 0 : onChange(newValue);
11628
+ },
11629
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
11630
+ type: "link",
11631
+ size: "small",
11632
+ children: t2("dovetail.import_from_file")
11633
+ })
11634
+ });
11635
+ }
11636
+ return null;
11637
+ }, [canImportFromFile, t2, _value, onChange, extraAction]);
11527
11638
  const validate = useCallback(() => {
11528
11639
  return new Promise((resolve) => {
11529
11640
  var _a;
@@ -11644,7 +11755,7 @@ function _KeyValueTableForm(props, ref) {
11644
11755
  rowAddConfig: {
11645
11756
  addible: true,
11646
11757
  text: () => addButtonText,
11647
- extraAction
11758
+ extraAction: finalExtraAction
11648
11759
  },
11649
11760
  defaultData: _value,
11650
11761
  row: {
@@ -11659,29 +11770,7 @@ function _KeyValueTableForm(props, ref) {
11659
11770
  hideEmptyTable: true
11660
11771
  }), isHideLabelFormatPopover ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {
11661
11772
  noValueValidation
11662
- }), canImportFromFile ? /* @__PURE__ */ jsxRuntimeExports.jsx(Upload, {
11663
- multiple: false,
11664
- showUploadList: false,
11665
- onChange: async (e2) => {
11666
- var _a;
11667
- const fileValue = {
11668
- key: e2.file.name,
11669
- value: await readFileAsBase64(e2.file.originFileObj)
11670
- };
11671
- let newValue = [..._value, fileValue];
11672
- if (_value.some((v) => v.key === fileValue.key)) {
11673
- newValue = _value.map((v) => v.key === fileValue.key ? fileValue : v);
11674
- }
11675
- _setValue(newValue);
11676
- (_a = tableFormRef.current) == null ? void 0 : _a.setData(newValue);
11677
- onChange == null ? void 0 : onChange(newValue);
11678
- },
11679
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
11680
- type: "link",
11681
- size: "small",
11682
- children: t2("dovetail.import_from_file")
11683
- })
11684
- }) : null]
11773
+ })]
11685
11774
  });
11686
11775
  }
11687
11776
  const KeyValueTableForm = React.forwardRef(_KeyValueTableForm);
@@ -12301,6 +12390,7 @@ function WorkloadReplicas({
12301
12390
  })]
12302
12391
  });
12303
12392
  }
12393
+ const fields_1lap7d5 = "";
12304
12394
  var AreaType = /* @__PURE__ */ ((AreaType2) => {
12305
12395
  AreaType2["Inline"] = "Inline";
12306
12396
  AreaType2["Grid"] = "Grid";
@@ -12313,7 +12403,10 @@ const ImageField = (i18n2) => {
12313
12403
  title: i18n2.t("dovetail.image"),
12314
12404
  path: ["imageNames"],
12315
12405
  renderContent(value2) {
12316
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ImageNames, { value: value2, breakLine: false });
12406
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ImageNames, {
12407
+ value: value2,
12408
+ breakLine: false
12409
+ });
12317
12410
  }
12318
12411
  };
12319
12412
  };
@@ -12322,7 +12415,10 @@ const ReplicaField = () => {
12322
12415
  key: "Replicas",
12323
12416
  path: [],
12324
12417
  renderContent: (_, record) => {
12325
- return /* @__PURE__ */ jsxRuntimeExports.jsx(WorkloadReplicas, { record, editable: true });
12418
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WorkloadReplicas, {
12419
+ record,
12420
+ editable: true
12421
+ });
12326
12422
  }
12327
12423
  };
12328
12424
  };
@@ -12331,7 +12427,9 @@ const ConditionsField = () => {
12331
12427
  key: "Conditions",
12332
12428
  path: ["status", "conditions"],
12333
12429
  renderContent: (value2) => {
12334
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ConditionsTable, { conditions: value2 });
12430
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ConditionsTable, {
12431
+ conditions: value2
12432
+ });
12335
12433
  }
12336
12434
  };
12337
12435
  };
@@ -12340,7 +12438,9 @@ const NodeTaintsField = () => {
12340
12438
  key: "NodeTaints",
12341
12439
  path: ["spec", "taints"],
12342
12440
  renderContent: (value2) => {
12343
- return /* @__PURE__ */ jsxRuntimeExports.jsx(NodeTaintsTable, { taints: value2 });
12441
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(NodeTaintsTable, {
12442
+ taints: value2
12443
+ });
12344
12444
  }
12345
12445
  };
12346
12446
  };
@@ -12350,16 +12450,13 @@ const PodsField = () => {
12350
12450
  path: [],
12351
12451
  renderContent: (_, record) => {
12352
12452
  var _a, _b;
12353
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12354
- WorkloadPodsTable,
12355
- {
12356
- selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r2) => {
12357
- return r2.kind === "Pod" && r2.type === "creates";
12358
- })) == null ? void 0 : _b.selector,
12359
- namespace: record.metadata.namespace,
12360
- hideToolbar: true
12361
- }
12362
- );
12453
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WorkloadPodsTable, {
12454
+ selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r2) => {
12455
+ return r2.kind === "Pod" && r2.type === "creates";
12456
+ })) == null ? void 0 : _b.selector,
12457
+ namespace: record.metadata.namespace,
12458
+ hideToolbar: true
12459
+ });
12363
12460
  }
12364
12461
  };
12365
12462
  };
@@ -12369,19 +12466,16 @@ const JobsField = () => {
12369
12466
  path: [],
12370
12467
  renderContent: (_, record) => {
12371
12468
  var _a, _b, _c;
12372
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12373
- CronjobJobsTable,
12374
- {
12375
- owner: {
12376
- apiVersion: record.apiVersion || "",
12377
- kind: record.kind || "",
12378
- name: ((_a = record.metadata) == null ? void 0 : _a.name) || "",
12379
- namespace: ((_b = record.metadata) == null ? void 0 : _b.namespace) || "",
12380
- uid: ((_c = record.metadata) == null ? void 0 : _c.uid) || ""
12381
- },
12382
- hideToolBar: true
12383
- }
12384
- );
12469
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(CronjobJobsTable, {
12470
+ owner: {
12471
+ apiVersion: record.apiVersion || "",
12472
+ kind: record.kind || "",
12473
+ name: ((_a = record.metadata) == null ? void 0 : _a.name) || "",
12474
+ namespace: ((_b = record.metadata) == null ? void 0 : _b.namespace) || "",
12475
+ uid: ((_c = record.metadata) == null ? void 0 : _c.uid) || ""
12476
+ },
12477
+ hideToolBar: true
12478
+ });
12385
12479
  }
12386
12480
  };
12387
12481
  };
@@ -12390,13 +12484,15 @@ const DataField = (i18n2) => {
12390
12484
  key: "data",
12391
12485
  path: ["data"],
12392
12486
  renderContent: (val) => {
12393
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12394
- KeyValue,
12395
- {
12487
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
12488
+ className: "c91cpym",
12489
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValue, {
12396
12490
  data: val,
12397
- empty: i18n2.t("dovetail.no_resource", { kind: i18n2.t("dovetail.data") })
12398
- }
12399
- );
12491
+ empty: i18n2.t("dovetail.no_resource", {
12492
+ kind: i18n2.t("dovetail.data")
12493
+ })
12494
+ })
12495
+ });
12400
12496
  }
12401
12497
  };
12402
12498
  };
@@ -12409,7 +12505,12 @@ const SecretDataField = () => {
12409
12505
  for (const key2 in val) {
12410
12506
  decodeVal[key2] = atob(val[key2]);
12411
12507
  }
12412
- return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueSecret, { data: decodeVal });
12508
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
12509
+ className: "ca9k82k",
12510
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueSecret, {
12511
+ data: decodeVal
12512
+ })
12513
+ });
12413
12514
  }
12414
12515
  };
12415
12516
  };
@@ -12420,7 +12521,9 @@ const StartTimeField = (i18n2) => {
12420
12521
  title: i18n2.t("dovetail.started"),
12421
12522
  path: ["status", "startTime"],
12422
12523
  renderContent(value2) {
12423
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: value2 });
12524
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, {
12525
+ date: value2
12526
+ });
12424
12527
  }
12425
12528
  };
12426
12529
  };
@@ -12454,16 +12557,13 @@ const ServicePodsField = () => {
12454
12557
  path: [],
12455
12558
  renderContent: (_, record) => {
12456
12559
  var _a, _b, _c;
12457
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12458
- WorkloadPodsTable,
12459
- {
12460
- selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r2) => {
12461
- return r2.kind === "Pod" && r2.type === "selects";
12462
- })) == null ? void 0 : _b.selector,
12463
- namespace: (_c = record.metadata) == null ? void 0 : _c.namespace,
12464
- hideToolbar: true
12465
- }
12466
- );
12560
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WorkloadPodsTable, {
12561
+ selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r2) => {
12562
+ return r2.kind === "Pod" && r2.type === "selects";
12563
+ })) == null ? void 0 : _b.selector,
12564
+ namespace: (_c = record.metadata) == null ? void 0 : _c.namespace,
12565
+ hideToolbar: true
12566
+ });
12467
12567
  }
12468
12568
  };
12469
12569
  };
@@ -12472,7 +12572,12 @@ const IngressRulesTableTabField = () => {
12472
12572
  key: "rules",
12473
12573
  path: ["spec", "rules"],
12474
12574
  renderContent: (_, record) => {
12475
- return /* @__PURE__ */ jsxRuntimeExports.jsx(IngressRulesTable, { ingress: record });
12575
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
12576
+ className: "c1k4htrr",
12577
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(IngressRulesTable, {
12578
+ ingress: record
12579
+ })
12580
+ });
12476
12581
  }
12477
12582
  };
12478
12583
  };
@@ -12484,7 +12589,15 @@ const EventsTableTabField = ({
12484
12589
  path: [],
12485
12590
  renderContent: (_, record) => {
12486
12591
  var _a;
12487
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { padding: size === "small" ? "0 12px" : "0 24px", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(EventsTable, { uid: (_a = record.metadata) == null ? void 0 : _a.uid }) });
12592
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
12593
+ style: {
12594
+ padding: size === "small" ? "0 12px" : "0 24px",
12595
+ height: "100%"
12596
+ },
12597
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(EventsTable, {
12598
+ uid: (_a = record.metadata) == null ? void 0 : _a.uid
12599
+ })
12600
+ });
12488
12601
  }
12489
12602
  };
12490
12603
  };
@@ -12500,7 +12613,9 @@ const AgeField = (i18n2) => ({
12500
12613
  title: i18n2.t("dovetail.created_time"),
12501
12614
  path: ["metadata", "creationTimestamp"],
12502
12615
  renderContent(value2) {
12503
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, { date: new Date(value2) });
12616
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Time, {
12617
+ date: new Date(value2)
12618
+ });
12504
12619
  }
12505
12620
  });
12506
12621
  const LabelsField = (i18n2) => ({
@@ -12511,7 +12626,9 @@ const LabelsField = (i18n2) => ({
12511
12626
  if (!value2) {
12512
12627
  return "-";
12513
12628
  }
12514
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Tags, { value: value2 });
12629
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Tags, {
12630
+ value: value2
12631
+ });
12515
12632
  }
12516
12633
  });
12517
12634
  const AnnotationsField = (i18n2) => ({
@@ -12519,7 +12636,10 @@ const AnnotationsField = (i18n2) => ({
12519
12636
  title: i18n2.t("dovetail.annotation"),
12520
12637
  path: ["metadata", "annotations"],
12521
12638
  renderContent: (value2) => {
12522
- return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueAnnotation, { data: value2, expandable: true });
12639
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueAnnotation, {
12640
+ data: value2,
12641
+ expandable: true
12642
+ });
12523
12643
  }
12524
12644
  });
12525
12645
  const ServiceInnerClusterAccessField = () => ({
@@ -12528,23 +12648,22 @@ const ServiceInnerClusterAccessField = () => ({
12528
12648
  title: /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceInClusterAccessTitle, {}),
12529
12649
  path: [],
12530
12650
  renderContent: (_, record) => {
12531
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceInClusterAccessComponent, { service: record });
12651
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceInClusterAccessComponent, {
12652
+ service: record
12653
+ });
12532
12654
  }
12533
12655
  });
12534
12656
  const ServiceOutClusterAccessField = (clusterVip) => ({
12535
- key: "innerClusterAccess",
12657
+ key: "outClusterAccess",
12536
12658
  col: 12,
12537
12659
  title: /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessTitle, {}),
12538
12660
  path: [],
12539
12661
  renderContent: (_, record) => {
12540
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12541
- ServiceOutClusterAccessComponent,
12542
- {
12543
- service: record,
12544
- breakLine: false,
12545
- clusterVip
12546
- }
12547
- );
12662
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessComponent, {
12663
+ service: record,
12664
+ breakLine: false,
12665
+ clusterVip
12666
+ });
12548
12667
  }
12549
12668
  });
12550
12669
  const PodSelectorField = () => ({
@@ -12553,14 +12672,24 @@ const PodSelectorField = () => ({
12553
12672
  renderContent: (_, resource) => {
12554
12673
  const spec = resource._rawYaml.spec;
12555
12674
  const selector = spec && ("selector" in spec && spec.selector || "podSelector" in spec && spec.podSelector.matchLabels);
12556
- return /* @__PURE__ */ jsxRuntimeExports.jsx(PodSelectorTable, { podSelectors: selector || {} });
12675
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PodSelectorTable, {
12676
+ podSelectors: selector || {}
12677
+ });
12557
12678
  }
12558
12679
  });
12559
12680
  const PortsTableField = () => ({
12560
12681
  key: "ports",
12561
12682
  path: [],
12562
12683
  renderContent: (_, service) => {
12563
- return /* @__PURE__ */ jsxRuntimeExports.jsx(PortsTable, { service });
12684
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
12685
+ style: {
12686
+ padding: "0 24px",
12687
+ height: "100%"
12688
+ },
12689
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(PortsTable, {
12690
+ service
12691
+ })
12692
+ });
12564
12693
  }
12565
12694
  });
12566
12695
  const DurationField = (i18n2) => {
@@ -12570,7 +12699,9 @@ const DurationField = (i18n2) => {
12570
12699
  path: ["duration"],
12571
12700
  title: i18n2.t("dovetail.duration"),
12572
12701
  renderContent: (v) => {
12573
- return /* @__PURE__ */ jsxRuntimeExports.jsx(DurationTime, { value: v });
12702
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(DurationTime, {
12703
+ value: v
12704
+ });
12574
12705
  }
12575
12706
  };
12576
12707
  };
@@ -12587,26 +12718,21 @@ const StorageClassPvField = () => {
12587
12718
  key: "pvs",
12588
12719
  path: ["pvs"],
12589
12720
  renderContent: (_, sc) => {
12590
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12591
- ResourceTable,
12592
- {
12593
- resource: "persistentvolumes",
12594
- useTableParams: {
12595
- filters: {
12596
- permanent: [
12597
- {
12598
- field: "",
12599
- value: "",
12600
- fn(pv2) {
12601
- var _a;
12602
- return sc.filterPV(pv2, (_a = sc.metadata) == null ? void 0 : _a.name);
12603
- }
12604
- }
12605
- ]
12606
- }
12721
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceTable, {
12722
+ resource: "persistentvolumes",
12723
+ useTableParams: {
12724
+ filters: {
12725
+ permanent: [{
12726
+ field: "",
12727
+ value: "",
12728
+ fn(pv2) {
12729
+ var _a;
12730
+ return sc.filterPV(pv2, (_a = sc.metadata) == null ? void 0 : _a.name);
12731
+ }
12732
+ }]
12607
12733
  }
12608
12734
  }
12609
- );
12735
+ });
12610
12736
  }
12611
12737
  };
12612
12738
  };
@@ -12617,7 +12743,10 @@ const PVCapacityField = (i18n2) => {
12617
12743
  path: ["spec", "capacity", "storage"],
12618
12744
  title: i18n2.t("dovetail.capacity"),
12619
12745
  renderContent(value2) {
12620
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Units.Byte, { rawValue: parseSi(value2), decimals: 2 });
12746
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Units.Byte, {
12747
+ rawValue: parseSi(value2),
12748
+ decimals: 2
12749
+ });
12621
12750
  }
12622
12751
  };
12623
12752
  };
@@ -12628,7 +12757,10 @@ const PVCStorageField = (i18n2) => {
12628
12757
  path: ["spec", "resources", "requests", "storage"],
12629
12758
  title: i18n2.t("dovetail.distributed"),
12630
12759
  renderContent(value2, pvc2) {
12631
- return /* @__PURE__ */ jsxRuntimeExports.jsx(PVCDistributeStorage, { pvc: pvc2, editable: true });
12760
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PVCDistributeStorage, {
12761
+ pvc: pvc2,
12762
+ editable: true
12763
+ });
12632
12764
  }
12633
12765
  };
12634
12766
  };
@@ -12639,14 +12771,11 @@ const PVRefField = (i18n2) => {
12639
12771
  path: ["pv"],
12640
12772
  title: i18n2.t("dovetail.pv"),
12641
12773
  renderContent(value2) {
12642
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12643
- ResourceLink,
12644
- {
12645
- resourceName: "persistentvolumes",
12646
- namespace: "",
12647
- name: value2
12648
- }
12649
- );
12774
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
12775
+ resourceName: "persistentvolumes",
12776
+ namespace: "",
12777
+ name: value2
12778
+ });
12650
12779
  }
12651
12780
  };
12652
12781
  };
@@ -12657,7 +12786,11 @@ const PVStorageClassField = (i18n2) => {
12657
12786
  path: ["spec", "storageClassName"],
12658
12787
  title: i18n2.t("dovetail.storage_class"),
12659
12788
  renderContent(value2) {
12660
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, { resourceName: "storageclasses", namespace: "", name: value2 });
12789
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
12790
+ resourceName: "storageclasses",
12791
+ namespace: "",
12792
+ name: value2
12793
+ });
12661
12794
  }
12662
12795
  };
12663
12796
  };
@@ -12668,7 +12801,10 @@ const PVPhaseField = (i18n2) => {
12668
12801
  path: ["stateDisplay"],
12669
12802
  title: i18n2.t("dovetail.state"),
12670
12803
  renderContent(value2) {
12671
- return /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, { state: value2, hideBackground: true });
12804
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, {
12805
+ state: value2,
12806
+ hideBackground: true
12807
+ });
12672
12808
  }
12673
12809
  };
12674
12810
  };
@@ -12679,7 +12815,9 @@ const PVVolumeModeField = (i18n2) => {
12679
12815
  path: ["spec", "volumeMode"],
12680
12816
  title: i18n2.t("dovetail.volume_mode"),
12681
12817
  renderContent(value2) {
12682
- return /* @__PURE__ */ jsxRuntimeExports.jsx(PVVolumeModeDisplay, { value: value2 });
12818
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PVVolumeModeDisplay, {
12819
+ value: value2
12820
+ });
12683
12821
  }
12684
12822
  };
12685
12823
  };
@@ -12700,22 +12838,17 @@ const PVCPodsField = () => {
12700
12838
  path: [],
12701
12839
  renderContent: (_, record) => {
12702
12840
  var _a;
12703
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12704
- WorkloadPodsTable,
12705
- {
12706
- filter: (item) => {
12707
- var _a2, _b;
12708
- return !!((_b = (_a2 = item.spec) == null ? void 0 : _a2.volumes) == null ? void 0 : _b.some(
12709
- (v) => {
12710
- var _a3, _b2;
12711
- return ((_a3 = v.persistentVolumeClaim) == null ? void 0 : _a3.claimName) === ((_b2 = record.metadata) == null ? void 0 : _b2.name);
12712
- }
12713
- ));
12714
- },
12715
- namespace: (_a = record.metadata) == null ? void 0 : _a.namespace,
12716
- hideToolbar: true
12717
- }
12718
- );
12841
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WorkloadPodsTable, {
12842
+ filter: (item) => {
12843
+ var _a2, _b;
12844
+ return !!((_b = (_a2 = item.spec) == null ? void 0 : _a2.volumes) == null ? void 0 : _b.some((v) => {
12845
+ var _a3, _b2;
12846
+ return ((_a3 = v.persistentVolumeClaim) == null ? void 0 : _a3.claimName) === ((_b2 = record.metadata) == null ? void 0 : _b2.name);
12847
+ }));
12848
+ },
12849
+ namespace: (_a = record.metadata) == null ? void 0 : _a.namespace,
12850
+ hideToolbar: true
12851
+ });
12719
12852
  }
12720
12853
  };
12721
12854
  };
@@ -12726,15 +12859,14 @@ const PVCRefField = (i18n2) => {
12726
12859
  path: ["pvc"],
12727
12860
  title: i18n2.t("dovetail.pvc"),
12728
12861
  renderContent(value2, pv2) {
12729
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12730
- ResourceLink,
12731
- {
12732
- resourceName: "persistentvolumeclaims",
12733
- namespace: pv2.pvcNamespace || "default",
12734
- name: value2,
12735
- query: { uid: pv2.pvcUid }
12862
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
12863
+ resourceName: "persistentvolumeclaims",
12864
+ namespace: pv2.pvcNamespace || "default",
12865
+ name: value2,
12866
+ query: {
12867
+ uid: pv2.pvcUid
12736
12868
  }
12737
- );
12869
+ });
12738
12870
  }
12739
12871
  };
12740
12872
  };
@@ -12788,7 +12920,10 @@ const ResourceTableField = (resource, useTableParams) => {
12788
12920
  key: resource,
12789
12921
  path: [],
12790
12922
  renderContent() {
12791
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceTable, { resource, useTableParams });
12923
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceTable, {
12924
+ resource,
12925
+ useTableParams
12926
+ });
12792
12927
  }
12793
12928
  };
12794
12929
  };
@@ -12797,9 +12932,17 @@ const PodCountOfJobField = (i18n2) => {
12797
12932
  key: "podCount",
12798
12933
  path: [],
12799
12934
  col: 12,
12800
- title: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: i18n2.t("dovetail.job_pod_count_tooltip"), children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: DashedTitleStyle, children: i18n2.t("dovetail.pod_num") }) }),
12935
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
12936
+ title: i18n2.t("dovetail.job_pod_count_tooltip"),
12937
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
12938
+ className: DashedTitleStyle,
12939
+ children: i18n2.t("dovetail.pod_num")
12940
+ })
12941
+ }),
12801
12942
  renderContent: (_, record) => {
12802
- return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: record.podCountDisplay });
12943
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
12944
+ children: record.podCountDisplay
12945
+ });
12803
12946
  }
12804
12947
  };
12805
12948
  };
@@ -12824,8 +12967,11 @@ const LabelsAndAnnotationsShow = ({
12824
12967
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
12825
12968
  className: SmallSectionTitleStyle,
12826
12969
  children: sksI18n.t("dovetail.label")
12827
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Tags, {
12970
+ }), Object.keys(labels || {}).length ? /* @__PURE__ */ jsxRuntimeExports.jsx(Tags, {
12828
12971
  value: labels
12972
+ }) : /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent, {
12973
+ errorText: sksI18n.t("dovetail.empty"),
12974
+ type: ErrorContentType.Card
12829
12975
  })]
12830
12976
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
12831
12977
  className: ItemWrapperStyle,
@@ -12833,7 +12979,8 @@ const LabelsAndAnnotationsShow = ({
12833
12979
  className: SmallSectionTitleStyle,
12834
12980
  children: sksI18n.t("dovetail.annotation")
12835
12981
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValue, {
12836
- data: annotations
12982
+ data: annotations,
12983
+ errorContent: ErrorContentType.Card
12837
12984
  })]
12838
12985
  })]
12839
12986
  });
@@ -13139,6 +13286,58 @@ const PodLogTab = (i18n2, apiUrl) => ({
13139
13286
  }
13140
13287
  ]
13141
13288
  });
13289
+ const PortsTab = ({
13290
+ i18n: i18n2
13291
+ }) => ({
13292
+ title: i18n2.t("dovetail.port"),
13293
+ key: "ports",
13294
+ background: "white",
13295
+ groups: [
13296
+ {
13297
+ areas: [
13298
+ {
13299
+ fields: [PortsTableField()]
13300
+ }
13301
+ ]
13302
+ }
13303
+ ]
13304
+ });
13305
+ const IngressRulesTab = ({
13306
+ i18n: i18n2
13307
+ }) => ({
13308
+ title: i18n2.t("dovetail.rule"),
13309
+ key: "ingress-rules",
13310
+ background: "white",
13311
+ groups: [
13312
+ {
13313
+ areas: [{ fields: [IngressRulesTableTabField()] }]
13314
+ }
13315
+ ]
13316
+ });
13317
+ const DataTab = ({
13318
+ i18n: i18n2
13319
+ }) => ({
13320
+ title: i18n2.t("dovetail.data"),
13321
+ key: "data",
13322
+ background: "white",
13323
+ groups: [
13324
+ {
13325
+ areas: [{ fields: [DataField(i18n2)] }]
13326
+ }
13327
+ ]
13328
+ });
13329
+ const SecretDataTab = ({
13330
+ i18n: i18n2
13331
+ }) => ({
13332
+ title: i18n2.t("dovetail.data"),
13333
+ key: "secret-data",
13334
+ background: "white",
13335
+ groups: [
13336
+ {
13337
+ areas: [{ fields: [SecretDataField()] }]
13338
+ }
13339
+ ]
13340
+ });
13142
13341
  const NetworkPolicyRulesViewer_r6jity = "";
13143
13342
  const MonacoYamlEditor$3 = lazy(() => Promise.resolve().then(() => MonacoYamlEditor$1));
13144
13343
  const EditorStyle$1 = "e1cjl2b8";
@@ -13369,13 +13568,6 @@ const NodeTaintsGroup = (i18n2) => ({
13369
13568
  }
13370
13569
  ]
13371
13570
  });
13372
- const SecretDataGroup = () => ({
13373
- areas: [
13374
- {
13375
- fields: [SecretDataField()]
13376
- }
13377
- ]
13378
- });
13379
13571
  const JobsGroup = () => ({
13380
13572
  title: "Job",
13381
13573
  areas: [
@@ -13384,14 +13576,6 @@ const JobsGroup = () => ({
13384
13576
  }
13385
13577
  ]
13386
13578
  });
13387
- const IngressRulesGroup = (i18n2) => ({
13388
- title: i18n2.t("dovetail.rule"),
13389
- areas: [
13390
- {
13391
- fields: [IngressRulesTableTabField()]
13392
- }
13393
- ]
13394
- });
13395
13579
  const PodSelectorGroup = (i18n2) => ({
13396
13580
  title: i18n2.t("dovetail.pod_selector"),
13397
13581
  areas: [
@@ -13408,14 +13592,6 @@ const PortsGroup = (i18n2) => ({
13408
13592
  }
13409
13593
  ]
13410
13594
  });
13411
- const DataGroup = (i18n2) => ({
13412
- title: i18n2.t("dovetail.data"),
13413
- areas: [
13414
- {
13415
- fields: [DataField(i18n2)]
13416
- }
13417
- ]
13418
- });
13419
13595
  const NetworkPolicyIngressRulesGroup = (i18n2) => ({
13420
13596
  title: i18n2.t("dovetail.ingress_rule"),
13421
13597
  areas: [
@@ -13574,7 +13750,8 @@ const ShowContentView = (props) => {
13574
13750
  if (!record)
13575
13751
  return null;
13576
13752
  return fields.map((field) => {
13577
- if (field.hidden)
13753
+ const shouldHide = typeof field.hidden === "function" ? field.hidden(record) : field.hidden;
13754
+ if (shouldHide)
13578
13755
  return null;
13579
13756
  let content;
13580
13757
  const value2 = get$2(record, field.path);
@@ -14560,10 +14737,9 @@ const MemoizedFormField = memo(function FormField({
14560
14737
  control,
14561
14738
  name: fieldConfig.path.join("."),
14562
14739
  rules: {
14563
- async validate(value2) {
14740
+ async validate(value2, formValue) {
14564
14741
  if (fieldConfig.disabledWhenEdit && action === "edit")
14565
14742
  return true;
14566
- const formValue = watchedFormValues || getValues();
14567
14743
  if (!fieldConfig.validators || fieldConfig.validators.length === 0)
14568
14744
  return true;
14569
14745
  for (const func of fieldConfig.validators) {
@@ -14575,7 +14751,7 @@ const MemoizedFormField = memo(function FormField({
14575
14751
  }
14576
14752
  },
14577
14753
  render: ({ field, fieldState }) => {
14578
- var _a;
14754
+ var _a, _b;
14579
14755
  const currentFormValue = watchedFormValues || getValues();
14580
14756
  const renderProps = {
14581
14757
  field,
@@ -14598,7 +14774,7 @@ const MemoizedFormField = memo(function FormField({
14598
14774
  colon: false,
14599
14775
  labelCol: fieldConfig.layout === FormItemLayout.VERTICAL ? {} : { flex: `0 0 ${(formConfig == null ? void 0 : formConfig.labelWidth) || "216px"}` },
14600
14776
  help: fieldConfig.isHideErrorStatus ? "" : (_a = fieldState.error) == null ? void 0 : _a.message,
14601
- extra: fieldConfig.helperText,
14777
+ extra: ((_b = fieldState.error) == null ? void 0 : _b.message) === fieldConfig.helperText ? "" : fieldConfig.helperText,
14602
14778
  validateStatus: fieldState.invalid && !fieldConfig.isHideErrorStatus ? "error" : void 0,
14603
14779
  "data-test-id": fieldConfig.key,
14604
14780
  className: fieldConfig.layout === FormItemLayout.VERTICAL ? VerticalFormItemStyle : "",
@@ -17363,7 +17539,8 @@ function ResourceSelect(props) {
17363
17539
  namespace: namespace2,
17364
17540
  selectProps,
17365
17541
  value: value2,
17366
- onChange
17542
+ onChange,
17543
+ placeholder
17367
17544
  } = props;
17368
17545
  const { data: data2, isLoading, isError } = useList({
17369
17546
  resource,
@@ -17379,6 +17556,7 @@ function ResourceSelect(props) {
17379
17556
  Select,
17380
17557
  {
17381
17558
  className,
17559
+ placeholder,
17382
17560
  input: {
17383
17561
  value: value2,
17384
17562
  onChange
@@ -17390,7 +17568,7 @@ function ResourceSelect(props) {
17390
17568
  }
17391
17569
  );
17392
17570
  }
17393
- const SelectMatchLabelButton_1rnabop = "";
17571
+ const SelectMatchLabelButton_1uc76rw = "";
17394
17572
  const PopoverOverlayStyle = "p19yct45";
17395
17573
  const PopoverContentStyle = "p2255z4";
17396
17574
  const PopoverTitleStyle = "p16qejqa";
@@ -17406,12 +17584,16 @@ function ResourceMatchLabelSelector({
17406
17584
  value: value2,
17407
17585
  onChange
17408
17586
  }) {
17587
+ const {
17588
+ t: t2
17589
+ } = useTranslation();
17409
17590
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceSelect, {
17410
17591
  namespace: namespace2,
17411
17592
  resource,
17412
17593
  resourceBasePath,
17413
17594
  kind,
17414
17595
  value: value2,
17596
+ placeholder: t2("dovetail.select_workload"),
17415
17597
  onChange: (newValue, object2) => {
17416
17598
  var _a, _b;
17417
17599
  const resourceItem = object2.object;
@@ -17459,7 +17641,7 @@ function SelectMatchLabelButton(props) {
17459
17641
  children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
17460
17642
  className: PopoverContentBodyStyle,
17461
17643
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
17462
- className: cx_default(Typo.Display.d3_bold_title, PopoverTitleStyle),
17644
+ className: cx_default(Typo.Heading.h2_bold_title, PopoverTitleStyle),
17463
17645
  children: t2("dovetail.specify_workload")
17464
17646
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
17465
17647
  className: FormWrapperStyle,
@@ -17516,9 +17698,12 @@ function SelectMatchLabelButton(props) {
17516
17698
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
17517
17699
  onClick: () => setPopoverVisible(false),
17518
17700
  type: "quiet",
17701
+ size: "small",
17519
17702
  children: t2("dovetail.cancel")
17520
17703
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
17521
17704
  type: "primary",
17705
+ size: "small",
17706
+ disabled: !selectedResource,
17522
17707
  onClick: () => {
17523
17708
  onChange == null ? void 0 : onChange(selector);
17524
17709
  setPopoverVisible(false);
@@ -17576,8 +17761,7 @@ const MatchLabelSelector = React.forwardRef(function MatchLabelSelector2(props,
17576
17761
  onChange,
17577
17762
  isValueOptional: false,
17578
17763
  minSize: 1,
17579
- disabledChagneDefaultValues,
17580
- isHideLabelFormatPopover: true
17764
+ disabledChagneDefaultValues
17581
17765
  }
17582
17766
  );
17583
17767
  });
@@ -18414,7 +18598,7 @@ const PortsConfigForm = React.forwardRef(function PortsConfigForm2({ value: valu
18414
18598
  },
18415
18599
  {
18416
18600
  key: "name",
18417
- title: `${i18n2.t("dovetail.name")}${i18n2.t("dovetail.optional_with_bracket")}`,
18601
+ title: i18n2.t("dovetail.port_name"),
18418
18602
  type: "input",
18419
18603
  validator: ({ value: portName, rowIndex }) => {
18420
18604
  const { errorMessage } = validateRfc1123Name({
@@ -19601,8 +19785,8 @@ export {
19601
19785
  DEPLOYMENT_INIT_VALUE,
19602
19786
  DaemonSetModel,
19603
19787
  DataField,
19604
- DataGroup,
19605
19788
  DataKeysColumnRenderer,
19789
+ DataTab,
19606
19790
  DeleteButton,
19607
19791
  DeleteManyButton,
19608
19792
  DeploymentModel,
@@ -19639,7 +19823,7 @@ export {
19639
19823
  IngressDefaultBackendColumnRenderer,
19640
19824
  IngressModel,
19641
19825
  IngressRulesColumnRenderer,
19642
- IngressRulesGroup,
19826
+ IngressRulesTab,
19643
19827
  IngressRulesTableTabField,
19644
19828
  IngressTlsColumnRenderer,
19645
19829
  IsDefaultSCColumnRenderer,
@@ -19735,6 +19919,7 @@ export {
19735
19919
  PortMappingColumnRenderer,
19736
19920
  PortsConfigForm,
19737
19921
  PortsGroup,
19922
+ PortsTab,
19738
19923
  PortsTableField,
19739
19924
  ProviderPlugins,
19740
19925
  ProvisionerColumnRenderer,
@@ -19780,7 +19965,7 @@ export {
19780
19965
  STORAGE_CLASS_INIT_VALUE,
19781
19966
  SchemaStrategy,
19782
19967
  SecretDataField,
19783
- SecretDataGroup,
19968
+ SecretDataTab,
19784
19969
  SectionTitle,
19785
19970
  Separator,
19786
19971
  ServiceInClusterAccessColumnRenderer,