@dovetail-v2/refine 0.0.35-beta.4 → 0.0.36

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.
@@ -7,11 +7,11 @@ var __publicField = (obj, key2, value2) => {
7
7
  import i18n from "i18next";
8
8
  import * as React from "react";
9
9
  import React__default, { createElement, isValidElement, cloneElement, Children, createContext, useContext, useState, useRef, useEffect, useCallback, useMemo, useImperativeHandle, memo, PureComponent, useLayoutEffect, forwardRef, Suspense } from "react";
10
- import { ResourceContext, matchResourceFromRoute, useResource, useDelete, useNavigation, useBreadcrumb, useList, useParsed, useGo, useDeleteMany, useShow, useUpdate, useDataProvider, useRefineContext, useTranslate, useWarnAboutChange, useForm as useForm$1, flattenObjectKeys, useInvalidate, useUserFriendlyName, useModal, pickNotDeprecated, useMenu, useTable, Refine } from "@refinedev/core";
10
+ import { ResourceContext, matchResourceFromRoute, useResource, useDelete, useNavigation, useBreadcrumb, useList, useParsed, useGo, useDeleteMany, CanAccess, useCan, useShow, useUpdate, useDataProvider, useRefineContext, useTranslate, useWarnAboutChange, useForm as useForm$1, flattenObjectKeys, useInvalidate, useUserFriendlyName, useModal, pickNotDeprecated, useMenu, useTable, Refine } from "@refinedev/core";
11
11
  import { parse, stringify } from "qs";
12
12
  import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Router } from "react-router-dom";
13
13
  import { Typo, useUIKit, kitContext, Link as Link$1, OverflowTooltip, Tooltip, StatusCapsule, pushModal, Button, Icon as Icon$1, popModal, Loading, Divider, Fields, Form, Space, Modal, useMessage, ModalStack, KitStoreProvider } from "@cloudtower/eagle";
14
- import { PlusAddCreateNew16BoldOntintIcon, EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, EditPen16GradientBlueIcon, ViewEye16GrayIcon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, Retry16GradientBlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, EditPen16GradientGrayIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, ExclamationErrorCircleFill16RedIcon, Pause16GradientBlueIcon } from "@cloudtower/icons-react";
14
+ import { PlusAddCreateNew16BoldOntintIcon, EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, EditPen16GradientBlueIcon, ViewEye16GrayIcon, EntityFilterIgnoreGradient16GrayIcon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, Retry16GradientBlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, EditPen16GradientGrayIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, ExclamationErrorCircleFill16RedIcon, Pause16GradientBlueIcon } from "@cloudtower/icons-react";
15
15
  import { get as get$2, first, debounce, last, isObject as isObject$2, merge, keyBy } from "lodash-es";
16
16
  import yaml from "js-yaml";
17
17
  import * as monaco from "monaco-editor";
@@ -1385,11 +1385,11 @@ const no_resource = "无{{kind}}";
1385
1385
  const port_mapping_title_tooltip = "Service 端口与 Pod 端口的映射关系。";
1386
1386
  const in_cluster_desc = "ClusterIP、NodePort 和 LoadBalancer 类型的服务,展示 ClusterIP 字段,为虚拟 IP 地址,只能在集群内部使用。";
1387
1387
  const in_cluster_ip_desc = "ClusterIP 为无头服务时,内容为空。";
1388
- const in_cluster_external_name_desc = "ExternalName 类型展示的是 externalName 字段。";
1388
+ const in_cluster_external_name_desc = "ExternalName 类型展示的是 DNS 记录。";
1389
1389
  const out_cluster_ip_desc = "ClusterIP 不支持集群外部访问。";
1390
1390
  const out_cluster_node_port_desc = "NodePort 展示<strong>节点 IP:nodeport</strong>。";
1391
- const out_cluster_lb_desc = "LoadBalancer 展示 <strong>external-IP</strong>。";
1392
- const out_external_name_desc = "ExternalName 展示为空。";
1391
+ const out_cluster_lb_desc = "LoadBalancer 展示 <strong>ingress[*].ip</strong>。";
1392
+ const out_external_name_desc = "ExternalName 展示 <strong>external-ip</strong>。";
1393
1393
  const dovetail = {
1394
1394
  copy,
1395
1395
  reset_arguments,
@@ -7934,11 +7934,12 @@ class K8sOpenAPI {
7934
7934
  return response.json();
7935
7935
  }
7936
7936
  async findSchema(kind) {
7937
+ var _a;
7937
7938
  const result = this.response || await this.fetch();
7938
7939
  const schema = Object.values(result.components.schemas).find(
7939
7940
  (schema2) => {
7940
- var _a;
7941
- return (_a = schema2["x-kubernetes-group-version-kind"]) == null ? void 0 : _a.some(
7941
+ var _a2;
7942
+ return (_a2 = schema2["x-kubernetes-group-version-kind"]) == null ? void 0 : _a2.some(
7942
7943
  ({ kind: schemaKind, version: schemaVersion, group: schemaGroup }) => kind === schemaKind && this.apiVersion === `${schemaGroup ? schemaGroup + "/" : ""}${schemaVersion}`
7943
7944
  );
7944
7945
  }
@@ -7954,6 +7955,9 @@ class K8sOpenAPI {
7954
7955
  }
7955
7956
  });
7956
7957
  }
7958
+ if ((_a = schema == null ? void 0 : schema.properties) == null ? void 0 : _a.status) {
7959
+ schema == null ? true : delete schema.properties.status;
7960
+ }
7957
7961
  return schema;
7958
7962
  }
7959
7963
  }
@@ -8520,8 +8524,7 @@ const ErrorContent$1 = /* @__PURE__ */ styled_default("div")({
8520
8524
  const WidgetErrorContent$1 = (props) => {
8521
8525
  const {
8522
8526
  refetch,
8523
- errorText,
8524
- hiddenRetry
8527
+ errorText
8525
8528
  } = props;
8526
8529
  const kit = useContext(kitContext);
8527
8530
  const {
@@ -8534,7 +8537,7 @@ const WidgetErrorContent$1 = (props) => {
8534
8537
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("p", {
8535
8538
  className: cx_default(Typo.Label.l1_regular_title, "title"),
8536
8539
  children: errorText || t2("dovetail.obtain_data_error")
8537
- }), hiddenRetry ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
8540
+ }), !refetch ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
8538
8541
  size: "small",
8539
8542
  type: "ordinary",
8540
8543
  onClick: (e2) => {
@@ -8702,8 +8705,7 @@ const PodSelectorTable = ({ podSelectors = {} }) => {
8702
8705
  WidgetErrorContent$1,
8703
8706
  {
8704
8707
  errorText: t2("dovetail.no_resource", { kind: ` ${t2("dovetail.pod_selector")}` }),
8705
- style: { padding: "15px 0" },
8706
- hiddenRetry: true
8708
+ style: { padding: "15px 0" }
8707
8709
  }
8708
8710
  );
8709
8711
  }
@@ -8770,7 +8772,7 @@ const PortsTable = ({ service }) => {
8770
8772
  id: port2.name || ""
8771
8773
  }));
8772
8774
  if ((ports == null ? void 0 : ports.length) === 0) {
8773
- return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t2("dovetail.no_resource", { kind: t2("dovetail.port") }), style: { padding: "15px 0" }, hiddenRetry: true });
8775
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t2("dovetail.no_resource", { kind: t2("dovetail.port") }), style: { padding: "15px 0" } });
8774
8776
  }
8775
8777
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
8776
8778
  Table$1,
@@ -9399,6 +9401,12 @@ var WorkloadState = /* @__PURE__ */ ((WorkloadState2) => {
9399
9401
  WorkloadState2["WAITING"] = "waiting";
9400
9402
  return WorkloadState2;
9401
9403
  })(WorkloadState || {});
9404
+ var AccessControlAuth = /* @__PURE__ */ ((AccessControlAuth2) => {
9405
+ AccessControlAuth2["Edit"] = "Edit";
9406
+ AccessControlAuth2["Delete"] = "Delete";
9407
+ AccessControlAuth2["Create"] = "Create";
9408
+ return AccessControlAuth2;
9409
+ })(AccessControlAuth || {});
9402
9410
  function matchSelector(pod2, selector) {
9403
9411
  var _a, _b, _c;
9404
9412
  let match = true;
@@ -9823,8 +9831,9 @@ class ServiceModel extends ResourceModel {
9823
9831
  this._globalStore = _globalStore;
9824
9832
  }
9825
9833
  get displayType() {
9826
- const type2 = this._rawYaml.spec.type;
9827
- if (type2 === "ClusterIP" && !this._rawYaml.spec.clusterIP) {
9834
+ const spec = this._rawYaml.spec;
9835
+ const type2 = spec.type;
9836
+ if (type2 === "ClusterIP" && (!spec.clusterIP || spec.clusterIP === "None")) {
9828
9837
  return "Headless";
9829
9838
  }
9830
9839
  return type2;
@@ -9836,22 +9845,26 @@ class ServiceModel extends ResourceModel {
9836
9845
  var _a;
9837
9846
  return (_a = this._rawYaml.spec.ports) == null ? void 0 : _a.map((p) => {
9838
9847
  let servicePort = `${p.port}`;
9839
- if (this._rawYaml.spec.clusterIP) {
9848
+ if (this._rawYaml.spec.clusterIP && this._rawYaml.spec.clusterIP !== "None") {
9840
9849
  servicePort = `${this._rawYaml.spec.clusterIP}:${p.port}`;
9841
9850
  }
9842
- return `${servicePort} > ${p.targetPort}/${p.protocol}`;
9851
+ return {
9852
+ servicePort,
9853
+ targetPort: p.targetPort,
9854
+ protocol: p.protocol
9855
+ };
9843
9856
  });
9844
9857
  }
9845
9858
  }
9846
- const index_1lzkrja = "";
9859
+ const index_w8956m = "";
9847
9860
  const ServiceInClusterAccessComponent = ({
9848
9861
  service
9849
9862
  }) => {
9850
9863
  const spec = service._rawYaml.spec;
9851
9864
  switch (spec.type) {
9852
9865
  case ServiceTypeEnum.ExternalName:
9853
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
9854
- children: spec.externalName
9866
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
9867
+ value: service.dnsRecord
9855
9868
  });
9856
9869
  default:
9857
9870
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
@@ -9860,22 +9873,25 @@ const ServiceInClusterAccessComponent = ({
9860
9873
  }
9861
9874
  };
9862
9875
  const BreakLineStyle = "b1vtjd4k";
9876
+ const LinkStyle = "luro4rx";
9863
9877
  const ServiceOutClusterAccessComponent = ({
9864
9878
  service,
9865
9879
  clusterVip,
9866
9880
  breakLine = true
9867
9881
  }) => {
9868
- var _a, _b;
9882
+ var _a, _b, _c, _d;
9869
9883
  const spec = service._rawYaml.spec;
9884
+ const status = service._rawYaml.status;
9870
9885
  let content = "-";
9871
9886
  switch (spec.type) {
9872
9887
  case ServiceTypeEnum.NodePort:
9873
9888
  content = (_a = spec.ports) == null ? void 0 : _a.filter((v) => !!v).map((p, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(Link$1, {
9874
9889
  target: "_blank",
9875
9890
  href: `http://${clusterVip}:${p.nodePort}`,
9876
- className: breakLine ? BreakLineStyle : "",
9891
+ className: cx_default(breakLine ? BreakLineStyle : "", LinkStyle),
9877
9892
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(OverflowTooltip, {
9878
- content: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
9893
+ content: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
9894
+ className: Typo.Label.l4_regular_title,
9879
9895
  children: [clusterVip, ":", p.nodePort, !breakLine && index !== (spec.ports || []).length - 1 ? ", " : ""]
9880
9896
  }),
9881
9897
  tooltip: `${clusterVip}:${p.nodePort}`
@@ -9884,8 +9900,17 @@ const ServiceOutClusterAccessComponent = ({
9884
9900
  return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
9885
9901
  children: content
9886
9902
  });
9903
+ case ServiceTypeEnum.ExternalName:
9904
+ content = /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
9905
+ value: (_b = spec.externalIPs) == null ? void 0 : _b.join(breakLine ? "\n" : ", ")
9906
+ });
9907
+ break;
9887
9908
  case ServiceTypeEnum.LoadBalancer:
9888
- content = (_b = spec.externalIPs) == null ? void 0 : _b.join(breakLine ? "\n" : ", ");
9909
+ content = /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
9910
+ value: (_d = (_c = status.loadBalancer) == null ? void 0 : _c.ingress) == null ? void 0 : _d.map(({
9911
+ ip
9912
+ }) => ip).join(breakLine ? "\n" : ", ")
9913
+ });
9889
9914
  break;
9890
9915
  default:
9891
9916
  content = /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
@@ -10309,7 +10334,11 @@ const TableToolBar = ({
10309
10334
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
10310
10335
  children: [selectedKeys.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteManyButton, {
10311
10336
  ids: selectedKeys
10312
- }) : void 0, !hideCreate ? /* @__PURE__ */ jsxRuntimeExports.jsx(CreateButton, {}) : null]
10337
+ }) : void 0, /* @__PURE__ */ jsxRuntimeExports.jsx(CanAccess, {
10338
+ resource: resource == null ? void 0 : resource.name,
10339
+ action: AccessControlAuth.Create,
10340
+ children: !hideCreate ? /* @__PURE__ */ jsxRuntimeExports.jsx(CreateButton, {}) : null
10341
+ })]
10313
10342
  })]
10314
10343
  }), description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
10315
10344
  className: DescriptionStyle,
@@ -10434,8 +10463,7 @@ const EventsTable = ({}) => {
10434
10463
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
10435
10464
  WidgetErrorContent$1,
10436
10465
  {
10437
- errorText: i18n2.t("dovetail.no_resource", { kind: i18n2.t("dovetail.event") }),
10438
- hiddenRetry: true
10466
+ errorText: i18n2.t("dovetail.no_resource", { kind: i18n2.t("dovetail.event") })
10439
10467
  }
10440
10468
  );
10441
10469
  }
@@ -10556,7 +10584,7 @@ const IngressRulesTable = ({ ingress }) => {
10556
10584
  }
10557
10585
  ];
10558
10586
  if ((rows == null ? void 0 : rows.length) === 0) {
10559
- return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t2("dovetail.no_resource", { kind: t2("dovetail.rule") }), style: { padding: "15px 0" }, hiddenRetry: true });
10587
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: t2("dovetail.no_resource", { kind: t2("dovetail.rule") }), style: { padding: "15px 0" } });
10560
10588
  }
10561
10589
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
10562
10590
  Table$1,
@@ -10599,8 +10627,7 @@ const KeyValue = (props) => {
10599
10627
  }, key2));
10600
10628
  if (!result.length) {
10601
10629
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, {
10602
- errorText: empty2 || t2("dovetail.empty"),
10603
- hiddenRetry: true
10630
+ errorText: empty2 || t2("dovetail.empty")
10604
10631
  });
10605
10632
  }
10606
10633
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
@@ -10681,12 +10708,20 @@ function K8sDropdown(props) {
10681
10708
  const { t: t2 } = useTranslation();
10682
10709
  const openForm = useOpenForm({ id: record.id });
10683
10710
  const isInShowPage = useResourceResult.action === "show";
10711
+ const { data: canEditData } = useCan({
10712
+ resource: resource == null ? void 0 : resource.name,
10713
+ action: AccessControlAuth.Edit
10714
+ });
10715
+ const { data: canDeleteData } = useCan({
10716
+ resource: resource == null ? void 0 : resource.name,
10717
+ action: AccessControlAuth.Delete
10718
+ });
10684
10719
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10685
10720
  /* @__PURE__ */ jsxRuntimeExports.jsx(
10686
10721
  kit.dropdown,
10687
10722
  {
10688
10723
  overlay: /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.menu, { children: [
10689
- isInShowPage ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
10724
+ isInShowPage || (canEditData == null ? void 0 : canEditData.can) === false ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
10690
10725
  kit.menuItem,
10691
10726
  {
10692
10727
  onClick: openForm,
@@ -10709,8 +10744,8 @@ function K8sDropdown(props) {
10709
10744
  }
10710
10745
  ),
10711
10746
  props.children,
10712
- /* @__PURE__ */ jsxRuntimeExports.jsx(kit.divider, { style: { margin: 0 } }),
10713
- /* @__PURE__ */ jsxRuntimeExports.jsx(
10747
+ (canDeleteData == null ? void 0 : canDeleteData.can) !== false ? /* @__PURE__ */ jsxRuntimeExports.jsx(kit.divider, { style: { margin: 0 } }) : null,
10748
+ (canDeleteData == null ? void 0 : canDeleteData.can) !== false ? /* @__PURE__ */ jsxRuntimeExports.jsx(
10714
10749
  kit.menuItem,
10715
10750
  {
10716
10751
  danger: true,
@@ -10719,12 +10754,13 @@ function K8sDropdown(props) {
10719
10754
  },
10720
10755
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: TrashBinDelete16Icon, children: t2("dovetail.delete") })
10721
10756
  }
10722
- )
10757
+ ) : null
10723
10758
  ] }),
10759
+ trigger: ["click"],
10724
10760
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10725
10761
  kit.button,
10726
10762
  {
10727
- type: size === "large" ? "quiet" : "tertiary",
10763
+ type: "quiet",
10728
10764
  size: size === "large" ? "middle" : "small",
10729
10765
  prefixIcon: size === "large" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
10730
10766
  Icon$1,
@@ -10895,13 +10931,17 @@ const ShowContent = (props) => {
10895
10931
  state: stateDisplay
10896
10932
  }) : void 0]
10897
10933
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
10898
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
10899
- style: {
10900
- marginRight: 8
10901
- },
10902
- onClick: openForm,
10903
- prefixIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditPen16GradientBlueIcon, {}),
10904
- children: t2("dovetail.edit_yaml")
10934
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx(CanAccess, {
10935
+ resource: resource == null ? void 0 : resource.name,
10936
+ action: AccessControlAuth.Edit,
10937
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
10938
+ style: {
10939
+ marginRight: 8
10940
+ },
10941
+ onClick: openForm,
10942
+ prefixIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(EditPen16GradientBlueIcon, {}),
10943
+ children: t2("dovetail.edit_yaml")
10944
+ })
10905
10945
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(Dropdown, {
10906
10946
  record,
10907
10947
  size: "large"
@@ -10952,7 +10992,7 @@ function KeyValueSecret(props) {
10952
10992
  Button,
10953
10993
  {
10954
10994
  type: "quiet",
10955
- prefixIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: ViewEye16GrayIcon }),
10995
+ prefixIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: hideSecret ? ViewEye16GrayIcon : EntityFilterIgnoreGradient16GrayIcon }),
10956
10996
  onClick: () => setHideSecret((v) => !v),
10957
10997
  children: hideSecret ? i18n2.t("dovetail.show_data_value") : i18n2.t("dovetail.hide_data_value")
10958
10998
  }
@@ -11003,8 +11043,7 @@ const WorkloadPodsTable = ({
11003
11043
  }),
11004
11044
  style: {
11005
11045
  padding: "15px 0"
11006
- },
11007
- hiddenRetry: true
11046
+ }
11008
11047
  });
11009
11048
  }
11010
11049
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, {
@@ -11188,16 +11227,23 @@ function EditField(props) {
11188
11227
  const {
11189
11228
  i18n: i18n2
11190
11229
  } = useTranslation();
11191
- return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
11192
- className: EditButtonStyle,
11193
- type: "link",
11194
- onClick: () => {
11195
- pushModal({
11196
- component: EditFieldModal,
11197
- props: modalProps
11198
- });
11199
- },
11200
- children: i18n2.t("dovetail.edit")
11230
+ const {
11231
+ resource
11232
+ } = useResource();
11233
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(CanAccess, {
11234
+ resource: resource == null ? void 0 : resource.name,
11235
+ action: AccessControlAuth.Edit,
11236
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
11237
+ className: EditButtonStyle,
11238
+ type: "link",
11239
+ onClick: () => {
11240
+ pushModal({
11241
+ component: EditFieldModal,
11242
+ props: modalProps
11243
+ });
11244
+ },
11245
+ children: i18n2.t("dovetail.edit")
11246
+ })
11201
11247
  });
11202
11248
  }
11203
11249
  const index_c9frt4 = "";
@@ -11565,17 +11611,17 @@ const AnnotationsField = (i18n2) => ({
11565
11611
  return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueAnnotation, { data: value2, expandable: true });
11566
11612
  }
11567
11613
  });
11568
- const ServiceInnerClusterAccessField = (i18n2) => ({
11614
+ const ServiceInnerClusterAccessField = () => ({
11569
11615
  key: "innerClusterAccess",
11570
- title: i18n2.t("dovetail.in_cluster_access"),
11616
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceInClusterAccessTitle, {}),
11571
11617
  path: [],
11572
11618
  renderContent: (_, record) => {
11573
11619
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceInClusterAccessComponent, { service: record });
11574
11620
  }
11575
11621
  });
11576
- const ServiceOutClusterAccessField = (i18n2, clusterVip) => ({
11622
+ const ServiceOutClusterAccessField = (clusterVip) => ({
11577
11623
  key: "innerClusterAccess",
11578
- title: i18n2.t("dovetail.out_cluster_access"),
11624
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessTitle, {}),
11579
11625
  path: [],
11580
11626
  renderContent: (_, record) => {
11581
11627
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessComponent, { service: record, clusterVip, breakLine: false });
@@ -17266,6 +17312,10 @@ const PodLog = ({
17266
17312
  signal
17267
17313
  }).then((response) => {
17268
17314
  var _a3;
17315
+ if (response.status !== 200) {
17316
+ setLogs([]);
17317
+ return;
17318
+ }
17269
17319
  const reader = (_a3 = response.body) == null ? void 0 : _a3.getReader();
17270
17320
  if (!reader) {
17271
17321
  return;
@@ -17286,6 +17336,7 @@ const PodLog = ({
17286
17336
  }
17287
17337
  const total = buffer + chunk.slice(0, lastIndex);
17288
17338
  buffer = chunk.slice(lastIndex + 1);
17339
+ console.log(total);
17289
17340
  const formattedLogs = total.split("\n").filter(Boolean).map((line) => {
17290
17341
  const [timestamps, ...content] = line.split(" ");
17291
17342
  const t22 = new Date(timestamps).toLocaleString();
@@ -17375,8 +17426,7 @@ const PodLog = ({
17375
17426
  },
17376
17427
  errorText: t2("dovetail.no_resource", {
17377
17428
  kind: t2("dovetail.previous_log")
17378
- }),
17379
- hiddenRetry: true
17429
+ })
17380
17430
  }) : /* @__PURE__ */ jsxRuntimeExports.jsx(LogViewer, {
17381
17431
  innerRef: logViewerRef,
17382
17432
  height: "100%",
@@ -17493,7 +17543,7 @@ const MonacoYamlEditor$1 = (props) => {
17493
17543
  model.dispose();
17494
17544
  editor.dispose();
17495
17545
  };
17496
- }, [defaultValue, schema, id, readOnly, isScrollOnFocus, getInstance]);
17546
+ }, [schema, id, readOnly, isScrollOnFocus, getInstance]);
17497
17547
  useEffect(() => {
17498
17548
  const editor = instanceRef.current.editor;
17499
17549
  if (editor) {
@@ -17602,8 +17652,7 @@ const NetworkPolicyRulesViewer = ({
17602
17652
  }),
17603
17653
  style: {
17604
17654
  padding: "15px 0"
17605
- },
17606
- hiddenRetry: true
17655
+ }
17607
17656
  });
17608
17657
  }
17609
17658
  return /* @__PURE__ */ jsxRuntimeExports.jsx(MonacoYamlEditor$1, {
@@ -17684,7 +17733,7 @@ const PodContainersTable = ({
17684
17733
  [containerStatuses, initContainerStatuses]
17685
17734
  );
17686
17735
  if (dataSource.length === 0) {
17687
- return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: i18n2.t("dovetail.no_resource", { kind: i18n2.t("dovetail.container") }), style: { padding: "15px 0" }, hiddenRetry: true });
17736
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, { errorText: i18n2.t("dovetail.no_resource", { kind: i18n2.t("dovetail.container") }), style: { padding: "15px 0" } });
17688
17737
  }
17689
17738
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
17690
17739
  Table$1,
@@ -17922,8 +17971,12 @@ function WorkloadDropdown(props) {
17922
17971
  const { resource } = useResource();
17923
17972
  const { mutateAsync } = useUpdate();
17924
17973
  const { t: t2 } = useTranslation();
17974
+ const { data: canEditData } = useCan({
17975
+ resource: resource == null ? void 0 : resource.name,
17976
+ action: AccessControlAuth.Edit
17977
+ });
17925
17978
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(K8sDropdown, { record, size, children: [
17926
- /* @__PURE__ */ jsxRuntimeExports.jsx(
17979
+ (canEditData == null ? void 0 : canEditData.can) !== false ? /* @__PURE__ */ jsxRuntimeExports.jsx(
17927
17980
  kit.menu.Item,
17928
17981
  {
17929
17982
  onClick: async () => {
@@ -17962,7 +18015,7 @@ function WorkloadDropdown(props) {
17962
18015
  },
17963
18016
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: Retry16GradientBlueIcon, children: t2("dovetail.redeploy") })
17964
18017
  }
17965
- ),
18018
+ ) : null,
17966
18019
  children
17967
18020
  ] });
17968
18021
  }
@@ -17971,10 +18024,14 @@ function ReplicasDropdown(props) {
17971
18024
  const kit = useUIKit();
17972
18025
  const { t: t2 } = useTranslation();
17973
18026
  const formRef = useRef(null);
17974
- const { action } = useResource();
18027
+ const { action, resource } = useResource();
17975
18028
  const isInShowPage = action === "show";
18029
+ const { data: canEditData } = useCan({
18030
+ resource: resource == null ? void 0 : resource.name,
18031
+ action: AccessControlAuth.Edit
18032
+ });
17976
18033
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(WorkloadDropdown, { record, size, children: [
17977
- isInShowPage ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
18034
+ isInShowPage || (canEditData == null ? void 0 : canEditData.can) === false ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
17978
18035
  kit.menu.Item,
17979
18036
  {
17980
18037
  onClick: () => {
@@ -18133,7 +18190,7 @@ function parseJSON(value2) {
18133
18190
  return void 0;
18134
18191
  }
18135
18192
  }
18136
- const index_p3hly3 = "";
18193
+ const index_ccf0kl = "";
18137
18194
  const SelectStyle = "sj0ggy";
18138
18195
  const SearchInputStyle = "s1eo8uqs";
18139
18196
  const SelectContentStyle = "s64gojc";
@@ -18217,7 +18274,7 @@ const NamespacesFilter = ({
18217
18274
  },
18218
18275
  children: label2
18219
18276
  }) : /* @__PURE__ */ jsxRuntimeExports.jsx(kit.token, {
18220
- className: isCountToken ? CountTokenStyle : TokenStyle,
18277
+ className: cx_default(isCountToken ? CountTokenStyle : TokenStyle, isCountToken ? "" : "closable-token"),
18221
18278
  closable,
18222
18279
  onClose,
18223
18280
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.overflowTooltip, {
@@ -18227,6 +18284,8 @@ const NamespacesFilter = ({
18227
18284
  },
18228
18285
  maxTagCount: 1,
18229
18286
  optionLabelProp: "label",
18287
+ showArrow: true,
18288
+ showSearch: false,
18230
18289
  multiple: true,
18231
18290
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(kit.option, {
18232
18291
  value: "_all",
@@ -18297,8 +18356,7 @@ function ListPage(props) {
18297
18356
  children: !(tableProps.data.length || tableProps.loading) ? /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent$1, {
18298
18357
  errorText: tableProps.empty || t2("dovetail.no_resource", {
18299
18358
  kind: ` ${config.kind}`
18300
- }),
18301
- hiddenRetry: true
18359
+ })
18302
18360
  }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Table$1, {
18303
18361
  ...tableProps,
18304
18362
  empty: tableProps.empty || t2("dovetail.no_resource", {
@@ -18314,7 +18372,7 @@ function ListPage(props) {
18314
18372
  });
18315
18373
  }
18316
18374
  function ResourceList(props) {
18317
- const { formatter, name: name2, columns, Dropdown, noShow } = props.config;
18375
+ const { formatter, columns, Dropdown, noShow } = props.config;
18318
18376
  const { i18n: i18n2 } = useTranslation();
18319
18377
  const nameRenderer = noShow ? PlainTextNameColumnRenderer(i18n2) : NameColumnRenderer(i18n2);
18320
18378
  const { tableProps, selectedKeys } = useEagleTable({
@@ -22184,7 +22242,7 @@ const Separator = () => {
22184
22242
  });
22185
22243
  };
22186
22244
  const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
22187
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-68b40e77.js"));
22245
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-112df8f9.js"));
22188
22246
  const YamlEditorComponent = forwardRef(
22189
22247
  function YamlEditorComponent2(props, ref) {
22190
22248
  const {
@@ -22387,7 +22445,7 @@ const YamlEditorComponent = forwardRef(
22387
22445
  ]
22388
22446
  }
22389
22447
  ),
22390
- /* @__PURE__ */ jsxRuntimeExports.jsx(
22448
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
22391
22449
  "div",
22392
22450
  {
22393
22451
  style: {
@@ -22396,29 +22454,32 @@ const YamlEditorComponent = forwardRef(
22396
22454
  height: height || "500px",
22397
22455
  zIndex: 1
22398
22456
  },
22399
- children: isDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: value2 }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
22400
- MonacoYamlDiffEditor,
22401
- {
22402
- id: props.id,
22403
- origin: defaultValue,
22404
- modified: value2,
22405
- height
22406
- }
22407
- ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: value2 }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
22408
- MonacoYamlEditor,
22409
- {
22410
- id: props.id,
22411
- getInstance,
22412
- defaultValue,
22413
- height,
22414
- onChange,
22415
- onValidate,
22416
- onEditorCreate,
22417
- onBlur: props.onBlur,
22418
- schema,
22419
- readOnly
22420
- }
22421
- ) })
22457
+ children: [
22458
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: value2 }), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: isDiff ? "none" : "block" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
22459
+ MonacoYamlEditor,
22460
+ {
22461
+ id: props.id,
22462
+ getInstance,
22463
+ defaultValue: value2,
22464
+ height,
22465
+ onChange,
22466
+ onValidate,
22467
+ onEditorCreate,
22468
+ onBlur: props.onBlur,
22469
+ schema,
22470
+ readOnly
22471
+ }
22472
+ ) }) }),
22473
+ isDiff ? /* @__PURE__ */ jsxRuntimeExports.jsx(Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: value2 }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
22474
+ MonacoYamlDiffEditor,
22475
+ {
22476
+ id: props.id,
22477
+ origin: defaultValue,
22478
+ modified: value2,
22479
+ height
22480
+ }
22481
+ ) }) : null
22482
+ ]
22422
22483
  }
22423
22484
  )
22424
22485
  ]
@@ -23035,8 +23096,12 @@ function CronJobDropdown(props) {
23035
23096
  const { resource } = useResource();
23036
23097
  const { mutateAsync } = useUpdate();
23037
23098
  const { t: t2 } = useTranslation();
23099
+ const { data: canEditData } = useCan({
23100
+ resource: resource == null ? void 0 : resource.name,
23101
+ action: AccessControlAuth.Edit
23102
+ });
23038
23103
  const suspended2 = Boolean(spec == null ? void 0 : spec.suspend);
23039
- return /* @__PURE__ */ jsxRuntimeExports.jsx(K8sDropdown, { record, size, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
23104
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(K8sDropdown, { record, size, children: (canEditData == null ? void 0 : canEditData.can) !== false ? /* @__PURE__ */ jsxRuntimeExports.jsx(
23040
23105
  kit.menu.Item,
23041
23106
  {
23042
23107
  onClick: async () => {
@@ -23075,7 +23140,7 @@ function CronJobDropdown(props) {
23075
23140
  },
23076
23141
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { src: suspended2 ? RecoverContinue16GradientBlueIcon : Pause16GradientBlueIcon, children: t2(suspended2 ? "dovetail.resume" : "dovetail.suspend") })
23077
23142
  }
23078
- ) });
23143
+ ) : null });
23079
23144
  }
23080
23145
  const index_1wzdp7m = "";
23081
23146
  const WrapperStyle = "wfg6u6g";
@@ -23575,32 +23640,38 @@ const ServiceTypeColumnRenderer = (i18n2) => {
23575
23640
  sorter: CommonSorter(dataIndex)
23576
23641
  };
23577
23642
  };
23578
- const ServiceInClusterAccessColumnRenderer = (i18n2) => {
23579
- return {
23580
- key: "inClusterAccess",
23581
- title: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
23582
- overlayClassName: ServiceClusterTooltipStyle,
23583
- title: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
23643
+ function ServiceInClusterAccessTitle() {
23644
+ const {
23645
+ i18n: i18n2
23646
+ } = useTranslation();
23647
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
23648
+ overlayClassName: ServiceClusterTooltipStyle,
23649
+ title: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
23650
+ style: {
23651
+ lineHeight: "22px"
23652
+ },
23653
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23654
+ children: i18n2.t("dovetail.in_cluster_desc")
23655
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23656
+ children: i18n2.t("dovetail.in_cluster_ip_desc")
23657
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, {
23584
23658
  style: {
23585
- lineHeight: "22px"
23586
- },
23587
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23588
- children: i18n2.t("dovetail.in_cluster_desc")
23589
- }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23590
- children: i18n2.t("dovetail.in_cluster_ip_desc")
23591
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, {
23592
- style: {
23593
- margin: "6px 0"
23594
- }
23595
- }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23596
- children: i18n2.t("dovetail.in_cluster_external_name_desc")
23597
- })]
23598
- }),
23599
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
23600
- className: DashedTitleStyle,
23601
- children: i18n2.t("dovetail.in_cluster_access")
23602
- })
23659
+ margin: "6px 0"
23660
+ }
23661
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23662
+ children: i18n2.t("dovetail.in_cluster_external_name_desc")
23663
+ })]
23603
23664
  }),
23665
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
23666
+ className: DashedTitleStyle,
23667
+ children: i18n2.t("dovetail.in_cluster_access")
23668
+ })
23669
+ });
23670
+ }
23671
+ const ServiceInClusterAccessColumnRenderer = () => {
23672
+ return {
23673
+ key: "inClusterAccess",
23674
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceInClusterAccessTitle, {}),
23604
23675
  display: true,
23605
23676
  dataIndex: [],
23606
23677
  width: 160,
@@ -23611,34 +23682,42 @@ const ServiceInClusterAccessColumnRenderer = (i18n2) => {
23611
23682
  }
23612
23683
  };
23613
23684
  };
23614
- const ServiceOutClusterAccessColumnRenderer = (i18n2, clusterVip) => {
23685
+ function ServiceOutClusterAccessTitle() {
23686
+ const {
23687
+ i18n: i18n2
23688
+ } = useTranslation();
23689
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
23690
+ overlayClassName: ServiceClusterTooltipStyle,
23691
+ title: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
23692
+ style: {
23693
+ lineHeight: "22px"
23694
+ },
23695
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23696
+ children: i18n2.t("dovetail.out_cluster_ip_desc")
23697
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23698
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trans, {
23699
+ i18nKey: "dovetail.out_cluster_node_port_desc"
23700
+ })
23701
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23702
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trans, {
23703
+ i18nKey: "dovetail.out_cluster_lb_desc"
23704
+ })
23705
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23706
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trans, {
23707
+ i18nKey: "dovetail.out_external_name_desc"
23708
+ })
23709
+ })]
23710
+ }),
23711
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
23712
+ className: DashedTitleStyle,
23713
+ children: i18n2.t("dovetail.out_cluster_access")
23714
+ })
23715
+ });
23716
+ }
23717
+ const ServiceOutClusterAccessColumnRenderer = (clusterVip) => {
23615
23718
  return {
23616
23719
  key: "outClusterAccess",
23617
- title: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
23618
- overlayClassName: ServiceClusterTooltipStyle,
23619
- title: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
23620
- style: {
23621
- lineHeight: "22px"
23622
- },
23623
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23624
- children: i18n2.t("dovetail.out_cluster_ip_desc")
23625
- }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23626
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trans, {
23627
- i18nKey: "dovetail.out_cluster_node_port_desc"
23628
- })
23629
- }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23630
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trans, {
23631
- i18nKey: "dovetail.out_cluster_lb_desc"
23632
- })
23633
- }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
23634
- children: i18n2.t("dovetail.out_external_name_desc")
23635
- })]
23636
- }),
23637
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
23638
- className: DashedTitleStyle,
23639
- children: i18n2.t("dovetail.out_cluster_access")
23640
- })
23641
- }),
23720
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessTitle, {}),
23642
23721
  display: true,
23643
23722
  dataIndex: [],
23644
23723
  width: 160,
@@ -23661,6 +23740,11 @@ const PodWorkloadColumnRenderer = (i18n2) => {
23661
23740
  sorter: CommonSorter(dataIndex),
23662
23741
  width: 160,
23663
23742
  render(value2, record) {
23743
+ if (!(value2 == null ? void 0 : value2.length)) {
23744
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
23745
+ value: ""
23746
+ });
23747
+ }
23664
23748
  return value2.map((o) => /* @__PURE__ */ jsxRuntimeExports.jsx(ReferenceLink, {
23665
23749
  ownerReference: o,
23666
23750
  namespace: record.metadata.namespace || "default"
@@ -23795,10 +23879,21 @@ const PortMappingColumnRenderer = (i18n2) => {
23795
23879
  display: true,
23796
23880
  dataIndex: ["displayPortMapping"],
23797
23881
  width: 300,
23798
- render(value2) {
23799
- const content = value2.map((v) => /* @__PURE__ */ jsxRuntimeExports.jsx(OverflowTooltip, {
23800
- content: v
23801
- }, v));
23882
+ render(value2, record) {
23883
+ var _a;
23884
+ const content = (_a = record.displayPortMapping) == null ? void 0 : _a.map((v) => /* @__PURE__ */ jsxRuntimeExports.jsx(OverflowTooltip, {
23885
+ content: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
23886
+ style: {
23887
+ whiteSpace: "pre"
23888
+ },
23889
+ children: [record.displayType === "NodePort" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Link$1, {
23890
+ href: `//${v.servicePort}`,
23891
+ target: "_blank",
23892
+ children: v.servicePort
23893
+ }) : v.servicePort, " > ", v.targetPort, "/", v.protocol]
23894
+ }),
23895
+ tooltip: `${v.servicePort} > ${v.targetPort}/${v.protocol}`
23896
+ }, v.servicePort));
23802
23897
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
23803
23898
  children: content
23804
23899
  });
@@ -23888,7 +23983,7 @@ const useEagleTable = (params) => {
23888
23983
  };
23889
23984
  const styles = "";
23890
23985
  const Dovetail = (props) => {
23891
- const { resourcesConfig, urlPrefix = "", Layout: Layout2, history, globalStore } = props;
23986
+ const { resourcesConfig, urlPrefix = "", Layout: Layout2, history, globalStore, accessControlProvider } = props;
23892
23987
  const msg = useMessage();
23893
23988
  const notCustomResources = useMemo(() => {
23894
23989
  return resourcesConfig.filter((c2) => !c2.isCustom);
@@ -23932,6 +24027,7 @@ const Dovetail = (props) => {
23932
24027
  liveMode: "auto",
23933
24028
  disableTelemetry: true
23934
24029
  },
24030
+ accessControlProvider,
23935
24031
  resources: resourcesConfig.map((c2) => {
23936
24032
  return {
23937
24033
  name: c2.name,
@@ -24087,187 +24183,190 @@ const relationPlugin = new RelationPlugin();
24087
24183
  const ProviderPlugins = [relationPlugin, modelPlugin];
24088
24184
  const dovetailRefineI18n = i18n;
24089
24185
  export {
24090
- ResourceList as $,
24186
+ CreateButton as $,
24091
24187
  AgeColumnRenderer as A,
24092
- useOpenForm as B,
24188
+ useEdit as B,
24093
24189
  CommonSorter as C,
24094
24190
  DurationColumnRenderer as D,
24095
- Breadcrumb as E,
24096
- NameInputWidget as F,
24097
- dnsSubDomainRules as G,
24098
- rfc1123LabelRules as H,
24191
+ useGlobalStore as E,
24192
+ useOpenForm as F,
24193
+ Breadcrumb as G,
24194
+ NameInputWidget as H,
24099
24195
  IngressRulesColumnRenderer as I,
24100
- rfc1035LabelRules as J,
24101
- NamespaceSelectWidget as K,
24102
- namespaceRules as L,
24103
- KeyValueListWidget as M,
24196
+ dnsSubDomainRules as J,
24197
+ rfc1123LabelRules as K,
24198
+ rfc1035LabelRules as L,
24199
+ NamespaceSelectWidget as M,
24104
24200
  NameColumnRenderer as N,
24105
- MetadataForm as O,
24201
+ namespaceRules as O,
24106
24202
  PlainTextNameColumnRenderer as P,
24107
- PageShow as Q,
24203
+ KeyValueListWidget as Q,
24108
24204
  ReplicasColumnRenderer as R,
24109
24205
  StateDisplayColumnRenderer as S,
24110
- Time as T,
24111
- ConditionsTable as U,
24112
- PodContainersTable as V,
24206
+ MetadataForm as T,
24207
+ PageShow as U,
24208
+ Time as V,
24113
24209
  WorkloadImageColumnRenderer as W,
24114
- WorkloadDropdown as X,
24115
- ReplicasDropdown as Y,
24116
- CreateButton as Z,
24117
- ImageNames as _,
24210
+ ConditionsTable as X,
24211
+ PodContainersTable as Y,
24212
+ WorkloadDropdown as Z,
24213
+ ReplicasDropdown as _,
24118
24214
  useDeleteModal as a,
24119
- EditButton as a$,
24120
- ResourceShow as a0,
24121
- ResourceForm as a1,
24122
- ResourceCRUD as a2,
24123
- WorkloadPodsTable as a3,
24124
- CronJobDropdown as a4,
24125
- ResourceUsageBar as a5,
24126
- WorkloadReplicasForm as a6,
24127
- WorkloadReplicas as a7,
24128
- CronjobJobsTable as a8,
24129
- KeyValue as a9,
24130
- ServiceOutClusterAccessField as aA,
24131
- PodSelectorField as aB,
24132
- PortsTableField as aC,
24133
- DurationField as aD,
24134
- EventsTab as aE,
24135
- PodLogTab as aF,
24136
- BasicGroup as aG,
24137
- PodsGroup as aH,
24138
- PodContainersGroup as aI,
24139
- ServicePodsGroup as aJ,
24140
- ConditionsGroup as aK,
24141
- SecretDataGroup as aL,
24142
- JobsGroup as aM,
24143
- IngressRulesGroup as aN,
24144
- PodSelectorGroup as aO,
24145
- PortsGroup as aP,
24146
- DataGroup as aQ,
24147
- NetworkPolicyIngressRulesGroup as aR,
24148
- NetworkPolicyEgressRulesGroup as aS,
24149
- ShowGroupComponent as aT,
24150
- ShowContent as aU,
24151
- DeleteManyButton as aV,
24152
- ListPage as aW,
24153
- StateTagStyle as aX,
24154
- StateTag as aY,
24155
- DrawerShow as aZ,
24156
- Menu as a_,
24157
- KeyValueAnnotation as aa,
24158
- KeyValueSecret as ab,
24159
- Separator as ac,
24160
- YamlEditorComponent as ad,
24161
- DeleteButton as ae,
24162
- Layout as af,
24163
- AreaType as ag,
24164
- ImageField as ah,
24165
- ReplicaField as ai,
24166
- ConditionsField as aj,
24167
- PodsField as ak,
24168
- JobsField as al,
24169
- DataField as am,
24170
- SecretDataField as an,
24171
- StartTimeField as ao,
24172
- ServiceTypeField as ap,
24173
- ClusterIpField as aq,
24174
- SessionAffinityField as ar,
24175
- ServicePodsField as as,
24176
- IngressRulesTableTabField as at,
24177
- EventsTableTabField as au,
24178
- NamespaceField as av,
24179
- AgeField as aw,
24180
- LabelsField as ax,
24181
- AnnotationsField as ay,
24182
- ServiceInnerClusterAccessField as az,
24215
+ DrawerShow as a$,
24216
+ ImageNames as a0,
24217
+ ResourceList as a1,
24218
+ ResourceShow as a2,
24219
+ ResourceForm as a3,
24220
+ ResourceCRUD as a4,
24221
+ WorkloadPodsTable as a5,
24222
+ CronJobDropdown as a6,
24223
+ ResourceUsageBar as a7,
24224
+ WorkloadReplicasForm as a8,
24225
+ WorkloadReplicas as a9,
24226
+ AnnotationsField as aA,
24227
+ ServiceInnerClusterAccessField as aB,
24228
+ ServiceOutClusterAccessField as aC,
24229
+ PodSelectorField as aD,
24230
+ PortsTableField as aE,
24231
+ DurationField as aF,
24232
+ EventsTab as aG,
24233
+ PodLogTab as aH,
24234
+ BasicGroup as aI,
24235
+ PodsGroup as aJ,
24236
+ PodContainersGroup as aK,
24237
+ ServicePodsGroup as aL,
24238
+ ConditionsGroup as aM,
24239
+ SecretDataGroup as aN,
24240
+ JobsGroup as aO,
24241
+ IngressRulesGroup as aP,
24242
+ PodSelectorGroup as aQ,
24243
+ PortsGroup as aR,
24244
+ DataGroup as aS,
24245
+ NetworkPolicyIngressRulesGroup as aT,
24246
+ NetworkPolicyEgressRulesGroup as aU,
24247
+ ShowGroupComponent as aV,
24248
+ ShowContent as aW,
24249
+ DeleteManyButton as aX,
24250
+ ListPage as aY,
24251
+ StateTagStyle as aZ,
24252
+ StateTag as a_,
24253
+ CronjobJobsTable as aa,
24254
+ KeyValue as ab,
24255
+ KeyValueAnnotation as ac,
24256
+ KeyValueSecret as ad,
24257
+ Separator as ae,
24258
+ YamlEditorComponent as af,
24259
+ DeleteButton as ag,
24260
+ Layout as ah,
24261
+ AreaType as ai,
24262
+ ImageField as aj,
24263
+ ReplicaField as ak,
24264
+ ConditionsField as al,
24265
+ PodsField as am,
24266
+ JobsField as an,
24267
+ DataField as ao,
24268
+ SecretDataField as ap,
24269
+ StartTimeField as aq,
24270
+ ServiceTypeField as ar,
24271
+ ClusterIpField as as,
24272
+ SessionAffinityField as at,
24273
+ ServicePodsField as au,
24274
+ IngressRulesTableTabField as av,
24275
+ EventsTableTabField as aw,
24276
+ NamespaceField as ax,
24277
+ AgeField as ay,
24278
+ LabelsField as az,
24183
24279
  NameSpaceColumnRenderer as b,
24184
- ServiceModel as b$,
24185
- ReferenceLink as b0,
24186
- ResourceLink as b1,
24187
- NS_STORE_KEY as b2,
24188
- ALL_NS as b3,
24189
- useNamespacesFilter as b4,
24190
- NamespacesFilter as b5,
24191
- FormModal as b6,
24192
- RefineFormContent as b7,
24193
- RefineFormPage as b8,
24194
- SchemaStrategy as b9,
24195
- SECRET_OPAQUE_INIT_VALUE as bA,
24196
- SECRET_IMAGE_REPO_INIT_VALUE as bB,
24197
- SECRET_BASIC_AUTH_INIT_VALUE as bC,
24198
- SECRET_SSH_AUTH_INIT_VALUE as bD,
24199
- SECRET_TLS_INIT_VALUE as bE,
24200
- SECRET_CUSTOM_INIT_VALUE as bF,
24201
- WorkloadState as bG,
24202
- Dovetail as bH,
24203
- RESOURCE_GROUP as bI,
24204
- FormType as bJ,
24205
- ComponentContext as bK,
24206
- GlobalStoreContext as bL,
24207
- ConfigsContext as bM,
24208
- IngressModel as bN,
24209
- NetworkPolicyModel as bO,
24210
- JobModel as bP,
24211
- WorkloadModel as bQ,
24212
- WorkloadBaseModel as bR,
24213
- PodModel as bS,
24214
- PodMetricsModel as bT,
24215
- ResourceModel as bU,
24216
- CronJobModel as bV,
24217
- EventModel as bW,
24218
- DeploymentModel as bX,
24219
- DaemonSetModel as bY,
24220
- StatefulSetModel as bZ,
24221
- ServiceTypeEnum as b_,
24222
- YamlForm as ba,
24223
- useRefineForm as bb,
24224
- ServiceInClusterAccessComponent as bc,
24225
- ServiceOutClusterAccessComponent as bd,
24226
- Tags as be,
24227
- TextTags as bf,
24228
- PodLog as bg,
24229
- NetworkPolicyRulesViewer as bh,
24230
- Tabs as bi,
24231
- BASE_INIT_VALUE as bj,
24232
- DEPLOYMENT_INIT_VALUE as bk,
24233
- CRONJOB_INIT_VALUE as bl,
24234
- DAEMONSET_INIT_VALUE as bm,
24235
- JOB_INIT_VALUE as bn,
24236
- STATEFULSET_INIT_VALUE as bo,
24237
- POD_INIT_VALUE as bp,
24238
- SERVICE_CLUSTER_IP_INIT_VALUE as bq,
24239
- SERVICE_NODE_PORT_INIT_VALUE as br,
24240
- SERVICE_LOAD_BALANCER_INIT_VALUE as bs,
24241
- SERVICE_EXTERNAL_NAME_INIT_VALUE as bt,
24242
- SERVICE_HEADLESS_INIT_VALUE as bu,
24243
- INGRESS_INIT_VALUE as bv,
24244
- NETWORK_POLICY_INIT_VALUE as bw,
24245
- CONFIG_MAP_INIT_VALUE as bx,
24246
- SERVER_INSTANCE_INIT_VALUE as by,
24247
- TIMESTAMP_LABEL as bz,
24280
+ DaemonSetModel as b$,
24281
+ Menu as b0,
24282
+ EditButton as b1,
24283
+ ReferenceLink as b2,
24284
+ ResourceLink as b3,
24285
+ NS_STORE_KEY as b4,
24286
+ ALL_NS as b5,
24287
+ useNamespacesFilter as b6,
24288
+ NamespacesFilter as b7,
24289
+ FormModal as b8,
24290
+ RefineFormContent as b9,
24291
+ SERVER_INSTANCE_INIT_VALUE as bA,
24292
+ TIMESTAMP_LABEL as bB,
24293
+ SECRET_OPAQUE_INIT_VALUE as bC,
24294
+ SECRET_IMAGE_REPO_INIT_VALUE as bD,
24295
+ SECRET_BASIC_AUTH_INIT_VALUE as bE,
24296
+ SECRET_SSH_AUTH_INIT_VALUE as bF,
24297
+ SECRET_TLS_INIT_VALUE as bG,
24298
+ SECRET_CUSTOM_INIT_VALUE as bH,
24299
+ WorkloadState as bI,
24300
+ AccessControlAuth as bJ,
24301
+ Dovetail as bK,
24302
+ RESOURCE_GROUP as bL,
24303
+ FormType as bM,
24304
+ ComponentContext as bN,
24305
+ GlobalStoreContext as bO,
24306
+ ConfigsContext as bP,
24307
+ IngressModel as bQ,
24308
+ NetworkPolicyModel as bR,
24309
+ JobModel as bS,
24310
+ WorkloadModel as bT,
24311
+ WorkloadBaseModel as bU,
24312
+ PodModel as bV,
24313
+ PodMetricsModel as bW,
24314
+ ResourceModel as bX,
24315
+ CronJobModel as bY,
24316
+ EventModel as bZ,
24317
+ DeploymentModel as b_,
24318
+ RefineFormPage as ba,
24319
+ SchemaStrategy as bb,
24320
+ YamlForm as bc,
24321
+ useRefineForm as bd,
24322
+ ServiceInClusterAccessComponent as be,
24323
+ ServiceOutClusterAccessComponent as bf,
24324
+ Tags as bg,
24325
+ TextTags as bh,
24326
+ PodLog as bi,
24327
+ NetworkPolicyRulesViewer as bj,
24328
+ Tabs as bk,
24329
+ BASE_INIT_VALUE as bl,
24330
+ DEPLOYMENT_INIT_VALUE as bm,
24331
+ CRONJOB_INIT_VALUE as bn,
24332
+ DAEMONSET_INIT_VALUE as bo,
24333
+ JOB_INIT_VALUE as bp,
24334
+ STATEFULSET_INIT_VALUE as bq,
24335
+ POD_INIT_VALUE as br,
24336
+ SERVICE_CLUSTER_IP_INIT_VALUE as bs,
24337
+ SERVICE_NODE_PORT_INIT_VALUE as bt,
24338
+ SERVICE_LOAD_BALANCER_INIT_VALUE as bu,
24339
+ SERVICE_EXTERNAL_NAME_INIT_VALUE as bv,
24340
+ SERVICE_HEADLESS_INIT_VALUE as bw,
24341
+ INGRESS_INIT_VALUE as bx,
24342
+ NETWORK_POLICY_INIT_VALUE as by,
24343
+ CONFIG_MAP_INIT_VALUE as bz,
24248
24344
  WorkloadRestartsColumnRenderer as c,
24249
- ProviderPlugins as c0,
24345
+ StatefulSetModel as c0,
24346
+ ServiceTypeEnum as c1,
24347
+ ServiceModel as c2,
24348
+ ProviderPlugins as c3,
24250
24349
  dovetailRefineI18n as d,
24251
24350
  NodeNameColumnRenderer as e,
24252
24351
  RestartCountColumnRenderer as f,
24253
24352
  CompletionsCountColumnRenderer as g,
24254
24353
  ServiceTypeColumnRenderer as h,
24255
- ServiceInClusterAccessColumnRenderer as i,
24354
+ ServiceInClusterAccessTitle as i,
24256
24355
  jsxRuntimeExports as j,
24257
- ServiceOutClusterAccessColumnRenderer as k,
24258
- PodWorkloadColumnRenderer as l,
24259
- IngressDefaultBackendColumnRenderer as m,
24260
- IngressClassColumnRenderer as n,
24261
- IngressTlsColumnRenderer as o,
24262
- PodContainersNumColumnRenderer as p,
24263
- DataKeysColumnRenderer as q,
24356
+ ServiceInClusterAccessColumnRenderer as k,
24357
+ ServiceOutClusterAccessTitle as l,
24358
+ ServiceOutClusterAccessColumnRenderer as m,
24359
+ PodWorkloadColumnRenderer as n,
24360
+ IngressDefaultBackendColumnRenderer as o,
24361
+ IngressClassColumnRenderer as p,
24362
+ IngressTlsColumnRenderer as q,
24264
24363
  routerProvider as r,
24265
- PortMappingColumnRenderer as s,
24266
- ColumnKeys as t,
24364
+ PodContainersNumColumnRenderer as s,
24365
+ DataKeysColumnRenderer as t,
24267
24366
  useSchema as u,
24268
- addDefaultRenderToColumns as v,
24269
- useEagleTable as w,
24270
- useDownloadYAML as x,
24271
- useEdit as y,
24272
- useGlobalStore as z
24367
+ PortMappingColumnRenderer as v,
24368
+ ColumnKeys as w,
24369
+ addDefaultRenderToColumns as x,
24370
+ useEagleTable as y,
24371
+ useDownloadYAML as z
24273
24372
  };