@dovetail-v2/refine 0.3.1 → 0.3.2

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.
@@ -9271,7 +9271,7 @@ var ResourceState = /* @__PURE__ */ ((ResourceState2) => {
9271
9271
  return ResourceState2;
9272
9272
  })(ResourceState || {});
9273
9273
  function matchSelector(pod2, selector, namespace2 = "default") {
9274
- var _a, _b, _c;
9274
+ var _a, _b, _c, _d;
9275
9275
  let match = true;
9276
9276
  if (selector) {
9277
9277
  for (const key2 in selector.matchLabels) {
@@ -9280,7 +9280,7 @@ function matchSelector(pod2, selector, namespace2 = "default") {
9280
9280
  }
9281
9281
  }
9282
9282
  }
9283
- return match && pod2.metadata.namespace === namespace2;
9283
+ return match && ((_d = pod2.metadata) == null ? void 0 : _d.namespace) === namespace2;
9284
9284
  }
9285
9285
  class WorkloadBaseModel extends ResourceModel {
9286
9286
  constructor(_rawYaml, _globalStore) {
@@ -9370,10 +9370,14 @@ class WorkloadModel extends WorkloadBaseModel {
9370
9370
  constructor(_rawYaml, _globalStore) {
9371
9371
  super(_rawYaml, _globalStore);
9372
9372
  __publicField(this, "restarts", 0);
9373
+ __publicField(this, "services", []);
9374
+ __publicField(this, "ingresses", []);
9373
9375
  this._rawYaml = _rawYaml;
9374
9376
  }
9375
9377
  async init() {
9376
9378
  await this.getRestarts();
9379
+ await this.getServices();
9380
+ await this.getIngresses();
9377
9381
  }
9378
9382
  async getRestarts() {
9379
9383
  const pods = await this._globalStore.get("pods", {
@@ -9389,6 +9393,29 @@ class WorkloadModel extends WorkloadBaseModel {
9389
9393
  const result = lodashExports.sumBy(myPods, "restarts");
9390
9394
  this.restarts = result;
9391
9395
  }
9396
+ async getServices() {
9397
+ const services = await this._globalStore.get("services", {
9398
+ resourceBasePath: "/api/v1",
9399
+ kind: "Service"
9400
+ });
9401
+ const myServices = services.items.filter(
9402
+ (p) => {
9403
+ var _a;
9404
+ return matchSelector(p, (_a = this.spec) == null ? void 0 : _a.selector, this.metadata.namespace);
9405
+ }
9406
+ );
9407
+ this.services = myServices;
9408
+ }
9409
+ async getIngresses() {
9410
+ const allIngresses = /* @__PURE__ */ new Map();
9411
+ for (const service of this.services) {
9412
+ for (const ingress of service.ingresses) {
9413
+ const key2 = `${ingress.namespace}-${ingress.name}`;
9414
+ allIngresses.set(key2, ingress);
9415
+ }
9416
+ }
9417
+ this.ingresses = Array.from(allIngresses.values());
9418
+ }
9392
9419
  get replicas() {
9393
9420
  return this.spec && "replicas" in this.spec ? this.spec.replicas : 0;
9394
9421
  }
@@ -9529,6 +9556,38 @@ class PodMetricsModel extends ResourceModel {
9529
9556
  };
9530
9557
  }
9531
9558
  }
9559
+ class ReplicaSetModel extends ResourceModel {
9560
+ constructor(_rawYaml, _globalStore) {
9561
+ super(_rawYaml, _globalStore);
9562
+ __publicField(this, "pods", []);
9563
+ __publicField(this, "restarts", 0);
9564
+ this._rawYaml = _rawYaml;
9565
+ }
9566
+ async init() {
9567
+ await this.getPods();
9568
+ }
9569
+ async getPods() {
9570
+ const pods = await this._globalStore.get("pods", {
9571
+ resourceBasePath: "/api/v1",
9572
+ kind: "Pod"
9573
+ });
9574
+ const myPods = pods.items.filter(
9575
+ (pod2) => {
9576
+ var _a;
9577
+ return matchSelector(pod2, (_a = this.spec) == null ? void 0 : _a.selector, this.metadata.namespace);
9578
+ }
9579
+ );
9580
+ this.pods = myPods;
9581
+ this.restarts = lodashExports.sumBy(this.pods, (pod2) => pod2.restarts || 0);
9582
+ }
9583
+ get ownerDeploymentName() {
9584
+ var _a;
9585
+ const ownerRef = (_a = this.metadata.ownerReferences) == null ? void 0 : _a.find(
9586
+ (ref) => ref.kind === "Deployment" && ref.apiVersion === "apps/v1"
9587
+ );
9588
+ return ownerRef == null ? void 0 : ownerRef.name;
9589
+ }
9590
+ }
9532
9591
  class CronJobModel extends WorkloadBaseModel {
9533
9592
  constructor(_rawYaml, _globalStore) {
9534
9593
  super(_rawYaml, _globalStore);
@@ -9571,8 +9630,27 @@ class EventModel extends ResourceModel {
9571
9630
  class DeploymentModel extends WorkloadModel {
9572
9631
  constructor(_rawYaml, _globalStore) {
9573
9632
  super(_rawYaml, _globalStore);
9633
+ __publicField(this, "replicaSets", []);
9574
9634
  this._rawYaml = _rawYaml;
9575
9635
  }
9636
+ async init() {
9637
+ await super.init();
9638
+ await this.getReplicaSets();
9639
+ }
9640
+ async getReplicaSets() {
9641
+ const replicaSets = await this._globalStore.get("replicasets", {
9642
+ resourceBasePath: "/apis/apps/v1",
9643
+ kind: "ReplicaSet"
9644
+ });
9645
+ const myReplicaSets = replicaSets.items.filter((rs) => {
9646
+ var _a, _b, _c;
9647
+ const ownerRef = (_b = (_a = rs.metadata) == null ? void 0 : _a.ownerReferences) == null ? void 0 : _b.find(
9648
+ (ref) => ref.kind === "Deployment" && ref.apiVersion === "apps/v1" && ref.name === this.name && ref.uid === this.metadata.uid
9649
+ );
9650
+ return !!ownerRef && ((_c = rs.metadata) == null ? void 0 : _c.namespace) === this.metadata.namespace;
9651
+ });
9652
+ this.replicaSets = myReplicaSets;
9653
+ }
9576
9654
  get stateDisplay() {
9577
9655
  var _a, _b, _c;
9578
9656
  if (((_a = this.spec) == null ? void 0 : _a.replicas) === 0) {
@@ -9628,8 +9706,25 @@ var ServiceTypeEnum = /* @__PURE__ */ ((ServiceTypeEnum2) => {
9628
9706
  class ServiceModel extends ResourceModel {
9629
9707
  constructor(_rawYaml, _globalStore) {
9630
9708
  super(_rawYaml, _globalStore);
9709
+ __publicField(this, "ingresses", []);
9631
9710
  this._rawYaml = _rawYaml;
9632
9711
  }
9712
+ async init() {
9713
+ await this.getIngresses();
9714
+ }
9715
+ async getIngresses() {
9716
+ const ingresses = await this._globalStore.get("ingresses", {
9717
+ resourceBasePath: "/apis/networking.k8s.io/v1",
9718
+ kind: "Ingress"
9719
+ });
9720
+ const myIngresses = ingresses.items.filter((ingress) => {
9721
+ const rules = ingress.getFlattenedRules([]);
9722
+ return rules.some(
9723
+ (rule2) => rule2.serviceName === this.name
9724
+ );
9725
+ });
9726
+ this.ingresses = myIngresses;
9727
+ }
9633
9728
  get displayType() {
9634
9729
  const spec = this._rawYaml.spec;
9635
9730
  const type2 = spec.type;
@@ -10992,278 +11087,14 @@ function KeyValueAnnotation(props) {
10992
11087
  }) : /* @__PURE__ */ common.jsxRuntimeExports.jsx(ValueDisplay, {
10993
11088
  value: ""
10994
11089
  })
10995
- }), isExpand ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(KeyValue, {
10996
- data: data2
10997
- }) : null]
10998
- });
10999
- }
11000
- function Tabs(props) {
11001
- const { tabs, className } = props;
11002
- return /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Tabs, { className, children: tabs.map((tab) => {
11003
- return /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.TabsTabPane, { tab: tab.title, children: tab.children }, tab.title);
11004
- }) });
11005
- }
11006
- const StateTag = (props) => {
11007
- const {
11008
- state: state2 = ResourceState.UPDATING,
11009
- hideBackground,
11010
- className,
11011
- customResourceStateMap
11012
- } = props;
11013
- const { t: t2 } = common.useTranslation();
11014
- const defaultStateMap = {
11015
- [ResourceState.UPDATING]: "loading",
11016
- [ResourceState.READY]: "green",
11017
- [ResourceState.COMPLETED]: "gray",
11018
- [ResourceState.FAILED]: "red",
11019
- [ResourceState.SUSPENDED]: "warning",
11020
- [ResourceState.RUNNING]: "green",
11021
- [ResourceState.SUCCEEDED]: "blue",
11022
- [ResourceState.UNKNOWN]: "gray",
11023
- [ResourceState.TERMINATING]: "loading",
11024
- [ResourceState.PENDING]: "warning",
11025
- [ResourceState.WAITING]: "warning",
11026
- [ResourceState.TERMINATED]: "gray",
11027
- [ResourceState.STOPPED]: "gray",
11028
- [ResourceState.AVAILABLE]: "blue",
11029
- [ResourceState.BOUND]: "green",
11030
- [ResourceState.RELEASED]: "gray",
11031
- [ResourceState.LOST]: "red",
11032
- [ResourceState.ACTIVE]: "green",
11033
- [ResourceState.DELETING]: "loading"
11034
- };
11035
- const finalColorMap = (customResourceStateMap == null ? void 0 : customResourceStateMap.color) || defaultStateMap;
11036
- const finalTextMap = customResourceStateMap == null ? void 0 : customResourceStateMap.text;
11037
- return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
11038
- eagle.StatusCapsule,
11039
- {
11040
- className: common.cx_default(className, StateTagStyle, hideBackground && "no-background"),
11041
- color: finalColorMap[state2] !== "loading" ? finalColorMap[state2] : void 0,
11042
- loading: finalColorMap[state2] === "loading",
11043
- children: finalTextMap ? finalTextMap[state2] : t2(`dovetail.${state2 || "updating"}_state`)
11044
- }
11045
- );
11046
- };
11047
- const ShowContent_1g0ejph = "";
11048
- const ShowContentWrapperStyle = "s9agep2";
11049
- const BackButton = "bo89gfi";
11050
- const ToolBarWrapper = "t1ohe42f";
11051
- const NameStyle = "nqm4qz0";
11052
- const TopBarStyle = "ticl0qc";
11053
- const ShowContentHeaderStyle = "so9uwk1";
11054
- const GroupStyle$1 = "ge26ou0";
11055
- const GroupTitleStyle = "g17f8vl9";
11056
- const FullTabContentStyle = "fykgn2i";
11057
- const FieldWrapperStyle = "fngr745";
11058
- const TabContentStyle = "t11wg61l";
11059
- const ValueStyle$1 = "v1x3rivf";
11060
- const TabsStyle = "tf5s6s";
11061
- function ShowGroupComponent(props) {
11062
- const {
11063
- title,
11064
- className,
11065
- children,
11066
- operationEle
11067
- } = props;
11068
- return /* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
11069
- className: common.cx_default(GroupStyle$1, className),
11070
- children: [/* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
11071
- className: common.cx_default(eagle.Typo.Heading.h2_bold_title, GroupTitleStyle),
11072
- children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx("div", {
11073
- children: title
11074
- }), operationEle]
11075
- }), children]
11076
- });
11077
- }
11078
- const ShowContent = (props) => {
11079
- var _a, _b, _c, _d, _e, _f;
11080
- const {
11081
- showConfig,
11082
- formatter,
11083
- Dropdown = K8sDropdown
11084
- } = props;
11085
- const parsed = core.useParsed();
11086
- const {
11087
- resource
11088
- } = core.useResource();
11089
- const id = (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id;
11090
- const {
11091
- queryResult
11092
- } = core.useShow({
11093
- id,
11094
- errorNotification: false
11095
- });
11096
- const {
11097
- t: t2
11098
- } = common.useTranslation();
11099
- const {
11100
- data: data2
11101
- } = queryResult;
11102
- const navigation = core.useNavigation();
11103
- const go = core.useGo();
11104
- const openForm = useOpenForm();
11105
- const Component = React.useContext(ComponentContext);
11106
- const configs = React.useContext(ConfigsContext);
11107
- const config = configs[(resource == null ? void 0 : resource.name) || ""];
11108
- const Tabs$1 = Component.Tabs || Tabs;
11109
- if (!(data2 == null ? void 0 : data2.data)) {
11110
- return null;
11111
- }
11112
- const model = data2.data;
11113
- const record = formatter ? formatter(model) : data2 == null ? void 0 : data2.data;
11114
- function renderFields(fields, areaType, hasCol = true) {
11115
- if (!record)
11116
- return null;
11117
- return fields.map((field) => {
11118
- if (field.hidden)
11119
- return null;
11120
- let content;
11121
- const value2 = lodashEs.get(record, field.path);
11122
- if (field.renderContent) {
11123
- content = field.renderContent(value2, record, field);
11124
- } else {
11125
- content = lodashEs.get(record, field.path);
11126
- }
11127
- return hasCol ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Col, {
11128
- flex: areaType === AreaType.Inline ? "none" : "",
11129
- span: field.col || 24,
11130
- children: field.render ? field.render(value2, record, field) : /* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
11131
- className: FieldWrapperStyle,
11132
- children: [field.title && /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
11133
- className: eagle.Typo.Label.l4_regular_title,
11134
- style: {
11135
- width: field.labelWidth || "165px",
11136
- marginRight: 8,
11137
- flexShrink: 0,
11138
- color: "#2C385299"
11139
- },
11140
- children: field.title
11141
- }), /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
11142
- style: {
11143
- flex: 1,
11144
- minWidth: 0
11145
- },
11146
- children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(ValueDisplay, {
11147
- className: common.cx_default(eagle.Typo.Label.l4_regular_title, ValueStyle$1),
11148
- value: content,
11149
- useOverflow: false
11150
- })
11151
- })]
11152
- })
11153
- }, field.key) : /* @__PURE__ */ common.jsxRuntimeExports.jsx(ValueDisplay, {
11154
- style: {
11155
- height: "100%"
11156
- },
11157
- value: content,
11158
- useOverflow: false
11159
- });
11160
- });
11161
- }
11162
- const stateDisplay = lodashEs.get(record, "stateDisplay");
11163
- const topBar = /* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
11164
- className: ToolBarWrapper,
11165
- children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
11166
- className: common.cx_default(eagle.Typo.Label.l4_bold, BackButton),
11167
- onClick: () => {
11168
- go({
11169
- to: navigation.listUrl((resource == null ? void 0 : resource.name) || "")
11170
- });
11171
- },
11172
- children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Icon, {
11173
- src: iconsReact.ArrowChevronLeft16BoldTertiaryIcon,
11174
- hoverSrc: iconsReact.ArrowChevronLeftSmall16BoldBlueIcon,
11175
- style: {
11176
- marginRight: 4
11177
- },
11178
- children: /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
11179
- className: "button-text",
11180
- children: (config == null ? void 0 : config.displayName) || ((_b = resource == null ? void 0 : resource.meta) == null ? void 0 : _b.kind)
11181
- })
11182
- })
11183
- }), /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Space, {
11184
- className: TopBarStyle,
11185
- children: [/* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
11186
- style: {
11187
- display: "flex"
11188
- },
11189
- children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
11190
- className: common.cx_default(eagle.Typo.Display.d2_regular_title, NameStyle),
11191
- children: ((_c = showConfig.displayName) == null ? void 0 : _c.call(showConfig, record)) || ((_d = record == null ? void 0 : record.metadata) == null ? void 0 : _d.name)
11192
- }), stateDisplay ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(StateTag, {
11193
- state: stateDisplay,
11194
- customResourceStateMap: showConfig.resourceStateMap
11195
- }) : void 0]
11196
- }), /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Space, {
11197
- children: [(_e = showConfig.renderExtraButton) == null ? void 0 : _e.call(showConfig, record), !config.hideEdit ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(core.CanAccess, {
11198
- resource: resource == null ? void 0 : resource.name,
11199
- action: AccessControlAuth.Edit,
11200
- params: {
11201
- namespace: record.namespace
11202
- },
11203
- children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Button, {
11204
- style: {
11205
- marginRight: 8
11206
- },
11207
- onClick: () => openForm({
11208
- id
11209
- }),
11210
- children: ((_f = config.formConfig) == null ? void 0 : _f.formType) === FormType.FORM ? t2("dovetail.edit") : t2("dovetail.edit_yaml")
11211
- })
11212
- }) : null, /* @__PURE__ */ common.jsxRuntimeExports.jsx(Dropdown, {
11213
- record,
11214
- size: "large"
11215
- })]
11216
- })]
11217
- })]
11218
- });
11219
- const tabs = /* @__PURE__ */ common.jsxRuntimeExports.jsx(Tabs$1, {
11220
- tabs: (showConfig.tabs || []).map((tab, tabIndex) => {
11221
- var _a2;
11222
- return {
11223
- title: tab.title,
11224
- key: tab.key,
11225
- children: /* @__PURE__ */ common.jsxRuntimeExports.jsx("div", {
11226
- className: common.cx_default(TabContentStyle, tab.groups.length <= 1 && tabIndex !== 0 && FullTabContentStyle),
11227
- children: (_a2 = tab.groups) == null ? void 0 : _a2.map((group) => {
11228
- const GroupContainer = group.title ? ShowGroupComponent : React.Fragment;
11229
- const FieldContainer = group.title ? eagle.Row : React.Fragment;
11230
- const groupContainerProps = group.title ? {
11231
- title: group.title || ""
11232
- } : {};
11233
- const fieldContainerProps = group.title ? {
11234
- gutter: [24, 8]
11235
- } : {};
11236
- return /* @__PURE__ */ common.jsxRuntimeExports.jsx(GroupContainer, {
11237
- ...groupContainerProps,
11238
- children: group.areas.map((area, index2) => /* @__PURE__ */ common.jsxRuntimeExports.jsxs(common.jsxRuntimeExports.Fragment, {
11239
- children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx(FieldContainer, {
11240
- ...fieldContainerProps,
11241
- children: renderFields(area.fields, area.type, !!group.title)
11242
- }, index2), index2 !== group.areas.length - 1 ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Divider, {
11243
- style: {
11244
- margin: "8px 0 12px 0"
11245
- }
11246
- }) : null]
11247
- }))
11248
- }, group.title);
11249
- })
11250
- })
11251
- };
11252
- }),
11253
- className: TabsStyle
11254
- });
11255
- return /* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
11256
- className: ShowContentWrapperStyle,
11257
- children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Space, {
11258
- direction: "vertical",
11259
- className: ShowContentHeaderStyle,
11260
- children: topBar
11261
- }), tabs]
11090
+ }), isExpand ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(KeyValue, {
11091
+ data: data2
11092
+ }) : null]
11262
11093
  });
11263
- };
11094
+ }
11264
11095
  const KeyValueSecret_c3ji18 = "";
11265
11096
  const ButtonStyle = "b11tbgf7";
11266
- const GroupStyle = "gtbyh5g";
11097
+ const GroupStyle$1 = "gtbyh5g";
11267
11098
  function KeyValueSecret(props) {
11268
11099
  const {
11269
11100
  data: data2 = {}
@@ -11285,7 +11116,7 @@ function KeyValueSecret(props) {
11285
11116
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ShowGroupComponent, {
11286
11117
  title: i18n2.t("dovetail.data"),
11287
11118
  operationEle: toggleButton,
11288
- className: GroupStyle,
11119
+ className: GroupStyle$1,
11289
11120
  children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(KeyValue, {
11290
11121
  data: data2,
11291
11122
  hideSecret,
@@ -11876,6 +11707,47 @@ function ResourceTable(props) {
11876
11707
  }
11877
11708
  );
11878
11709
  }
11710
+ const StateTag = (props) => {
11711
+ const {
11712
+ state: state2 = ResourceState.UPDATING,
11713
+ hideBackground,
11714
+ className,
11715
+ customResourceStateMap
11716
+ } = props;
11717
+ const { t: t2 } = common.useTranslation();
11718
+ const defaultStateMap = {
11719
+ [ResourceState.UPDATING]: "loading",
11720
+ [ResourceState.READY]: "green",
11721
+ [ResourceState.COMPLETED]: "gray",
11722
+ [ResourceState.FAILED]: "red",
11723
+ [ResourceState.SUSPENDED]: "warning",
11724
+ [ResourceState.RUNNING]: "green",
11725
+ [ResourceState.SUCCEEDED]: "blue",
11726
+ [ResourceState.UNKNOWN]: "gray",
11727
+ [ResourceState.TERMINATING]: "loading",
11728
+ [ResourceState.PENDING]: "warning",
11729
+ [ResourceState.WAITING]: "warning",
11730
+ [ResourceState.TERMINATED]: "gray",
11731
+ [ResourceState.STOPPED]: "gray",
11732
+ [ResourceState.AVAILABLE]: "blue",
11733
+ [ResourceState.BOUND]: "green",
11734
+ [ResourceState.RELEASED]: "gray",
11735
+ [ResourceState.LOST]: "red",
11736
+ [ResourceState.ACTIVE]: "green",
11737
+ [ResourceState.DELETING]: "loading"
11738
+ };
11739
+ const finalColorMap = (customResourceStateMap == null ? void 0 : customResourceStateMap.color) || defaultStateMap;
11740
+ const finalTextMap = customResourceStateMap == null ? void 0 : customResourceStateMap.text;
11741
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
11742
+ eagle.StatusCapsule,
11743
+ {
11744
+ className: common.cx_default(className, StateTagStyle, hideBackground && "no-background"),
11745
+ color: finalColorMap[state2] !== "loading" ? finalColorMap[state2] : void 0,
11746
+ loading: finalColorMap[state2] === "loading",
11747
+ children: finalTextMap ? finalTextMap[state2] : t2(`dovetail.${state2 || "updating"}_state`)
11748
+ }
11749
+ );
11750
+ };
11879
11751
  const WorkloadPodsTable_975j2t = "";
11880
11752
  const WorkloadPodsTable = ({
11881
11753
  namespace: namespace2,
@@ -11957,7 +11829,7 @@ const ReadyValueStyle = "r1bm8olw";
11957
11829
  const ReplicasValueStyle = "r1oqudbh";
11958
11830
  const ContentWrapperStyle = "c18i6jtg";
11959
11831
  const LabelStyle = "lpm22il";
11960
- const ValueStyle = "v1ixr1me";
11832
+ const ValueStyle$1 = "v1ixr1me";
11961
11833
  const WorkloadReplicasForm = React.forwardRef(function WorkloadReplicasForm2(props, ref) {
11962
11834
  const {
11963
11835
  defaultValue,
@@ -12087,7 +11959,7 @@ function WorkloadReplicas({
12087
11959
  className: common.cx_default(LabelStyle, eagle.Typo.Label.l3_regular),
12088
11960
  children: record.kind === "Job" ? t2("dovetail.pod_complete_num") : t2("dovetail.pod_ready_num")
12089
11961
  }), /* @__PURE__ */ common.jsxRuntimeExports.jsx("td", {
12090
- className: common.cx_default(ValueStyle, eagle.Typo.Label.l3_regular),
11962
+ className: common.cx_default(ValueStyle$1, eagle.Typo.Label.l3_regular),
12091
11963
  children: readyReplicas
12092
11964
  })]
12093
11965
  }), /* @__PURE__ */ common.jsxRuntimeExports.jsxs("tr", {
@@ -12095,7 +11967,7 @@ function WorkloadReplicas({
12095
11967
  className: common.cx_default(LabelStyle, eagle.Typo.Label.l3_regular),
12096
11968
  children: t2("dovetail.pod_replicas_num")
12097
11969
  }), /* @__PURE__ */ common.jsxRuntimeExports.jsx("td", {
12098
- className: common.cx_default(ValueStyle, eagle.Typo.Label.l3_regular),
11970
+ className: common.cx_default(ValueStyle$1, eagle.Typo.Label.l3_regular),
12099
11971
  children: replicas
12100
11972
  }), /* @__PURE__ */ common.jsxRuntimeExports.jsx("td", {
12101
11973
  children: editable && canScale && /* @__PURE__ */ common.jsxRuntimeExports.jsx(EditField, {
@@ -12126,6 +11998,7 @@ var AreaType = /* @__PURE__ */ ((AreaType2) => {
12126
11998
  const ImageField = (i18n2) => {
12127
11999
  return {
12128
12000
  key: "Image",
12001
+ col: 12,
12129
12002
  title: i18n2.t("dovetail.image"),
12130
12003
  path: ["imageNames"],
12131
12004
  renderContent(value2) {
@@ -12232,6 +12105,7 @@ const SecretDataField = () => {
12232
12105
  const StartTimeField = (i18n2) => {
12233
12106
  return {
12234
12107
  key: "started",
12108
+ col: 12,
12235
12109
  title: i18n2.t("dovetail.started"),
12236
12110
  path: ["status", "startTime"],
12237
12111
  renderContent(value2) {
@@ -12242,6 +12116,7 @@ const StartTimeField = (i18n2) => {
12242
12116
  const ServiceTypeField = (i18n2) => {
12243
12117
  return {
12244
12118
  key: "type",
12119
+ col: 12,
12245
12120
  title: i18n2.t("dovetail.type"),
12246
12121
  path: ["displayType"]
12247
12122
  };
@@ -12249,6 +12124,7 @@ const ServiceTypeField = (i18n2) => {
12249
12124
  const ClusterIpField = (i18n2) => {
12250
12125
  return {
12251
12126
  key: "clusterIp",
12127
+ col: 12,
12252
12128
  title: i18n2.t("dovetail.clusterIp"),
12253
12129
  path: ["spec", "clusterIP"]
12254
12130
  };
@@ -12256,6 +12132,7 @@ const ClusterIpField = (i18n2) => {
12256
12132
  const SessionAffinityField = (i18n2) => {
12257
12133
  return {
12258
12134
  key: "clusterIp",
12135
+ col: 12,
12259
12136
  title: i18n2.t("dovetail.sessionAffinity"),
12260
12137
  path: ["spec", "sessionAffinity"]
12261
12138
  };
@@ -12300,11 +12177,13 @@ const EventsTableTabField = () => {
12300
12177
  };
12301
12178
  const NamespaceField = (i18n2) => ({
12302
12179
  key: "NameSpace",
12180
+ col: 12,
12303
12181
  title: i18n2.t("dovetail.namespace"),
12304
12182
  path: ["metadata", "namespace"]
12305
12183
  });
12306
12184
  const AgeField = (i18n2) => ({
12307
12185
  key: "Age",
12186
+ col: 12,
12308
12187
  title: i18n2.t("dovetail.created_time"),
12309
12188
  path: ["metadata", "creationTimestamp"],
12310
12189
  renderContent(value2) {
@@ -12332,6 +12211,7 @@ const AnnotationsField = (i18n2) => ({
12332
12211
  });
12333
12212
  const ServiceInnerClusterAccessField = () => ({
12334
12213
  key: "innerClusterAccess",
12214
+ col: 12,
12335
12215
  title: /* @__PURE__ */ common.jsxRuntimeExports.jsx(ServiceInClusterAccessTitle, {}),
12336
12216
  path: [],
12337
12217
  renderContent: (_, record) => {
@@ -12340,6 +12220,7 @@ const ServiceInnerClusterAccessField = () => ({
12340
12220
  });
12341
12221
  const ServiceOutClusterAccessField = (clusterVip) => ({
12342
12222
  key: "innerClusterAccess",
12223
+ col: 12,
12343
12224
  title: /* @__PURE__ */ common.jsxRuntimeExports.jsx(ServiceOutClusterAccessTitle, {}),
12344
12225
  path: [],
12345
12226
  renderContent: (_, record) => {
@@ -12372,6 +12253,7 @@ const PortsTableField = () => ({
12372
12253
  const DurationField = (i18n2) => {
12373
12254
  return {
12374
12255
  key: "duration",
12256
+ col: 12,
12375
12257
  path: ["duration"],
12376
12258
  title: i18n2.t("dovetail.duration"),
12377
12259
  renderContent: (v) => {
@@ -12382,6 +12264,7 @@ const DurationField = (i18n2) => {
12382
12264
  const StorageClassProvisionerField = (i18n2) => {
12383
12265
  return {
12384
12266
  key: "provisioner",
12267
+ col: 12,
12385
12268
  path: ["provisioner"],
12386
12269
  title: i18n2.t("dovetail.provisioner")
12387
12270
  };
@@ -12417,6 +12300,7 @@ const StorageClassPvField = () => {
12417
12300
  const PVCapacityField = (i18n2) => {
12418
12301
  return {
12419
12302
  key: "capacity",
12303
+ col: 12,
12420
12304
  path: ["spec", "capacity", "storage"],
12421
12305
  title: i18n2.t("dovetail.capacity"),
12422
12306
  renderContent(value2) {
@@ -12427,6 +12311,7 @@ const PVCapacityField = (i18n2) => {
12427
12311
  const PVCStorageField = (i18n2) => {
12428
12312
  return {
12429
12313
  key: "storage",
12314
+ col: 12,
12430
12315
  path: ["spec", "resources", "requests", "storage"],
12431
12316
  title: i18n2.t("dovetail.distributed"),
12432
12317
  renderContent(value2, pvc2) {
@@ -12437,6 +12322,7 @@ const PVCStorageField = (i18n2) => {
12437
12322
  const PVRefField = (i18n2) => {
12438
12323
  return {
12439
12324
  key: "pv",
12325
+ col: 12,
12440
12326
  path: ["pv"],
12441
12327
  title: i18n2.t("dovetail.pv"),
12442
12328
  renderContent(value2) {
@@ -12454,6 +12340,7 @@ const PVRefField = (i18n2) => {
12454
12340
  const PVStorageClassField = (i18n2) => {
12455
12341
  return {
12456
12342
  key: "storageClass",
12343
+ col: 12,
12457
12344
  path: ["spec", "storageClassName"],
12458
12345
  title: i18n2.t("dovetail.storage_class"),
12459
12346
  renderContent(value2) {
@@ -12464,6 +12351,7 @@ const PVStorageClassField = (i18n2) => {
12464
12351
  const PVPhaseField = (i18n2) => {
12465
12352
  return {
12466
12353
  key: "phase",
12354
+ col: 12,
12467
12355
  path: ["stateDisplay"],
12468
12356
  title: i18n2.t("dovetail.state"),
12469
12357
  renderContent(value2) {
@@ -12474,6 +12362,7 @@ const PVPhaseField = (i18n2) => {
12474
12362
  const PVVolumeModeField = (i18n2) => {
12475
12363
  return {
12476
12364
  key: "mode",
12365
+ col: 12,
12477
12366
  path: ["spec", "volumeMode"],
12478
12367
  title: i18n2.t("dovetail.volume_mode"),
12479
12368
  renderContent(value2) {
@@ -12484,6 +12373,7 @@ const PVVolumeModeField = (i18n2) => {
12484
12373
  const PVAccessModeField = (i18n2) => {
12485
12374
  return {
12486
12375
  key: "accessMode",
12376
+ col: 12,
12487
12377
  path: ["spec", "accessModes"],
12488
12378
  title: i18n2.t("dovetail.access_mode"),
12489
12379
  renderContent(value2) {
@@ -12519,6 +12409,7 @@ const PVCPodsField = () => {
12519
12409
  const PVCRefField = (i18n2) => {
12520
12410
  return {
12521
12411
  key: "pvc",
12412
+ col: 12,
12522
12413
  path: ["pvc"],
12523
12414
  title: i18n2.t("dovetail.pvc"),
12524
12415
  renderContent(value2, pv2) {
@@ -12537,6 +12428,7 @@ const PVCRefField = (i18n2) => {
12537
12428
  const PVCSIRefField = (i18n2) => {
12538
12429
  return {
12539
12430
  key: "csi",
12431
+ col: 12,
12540
12432
  path: ["csi"],
12541
12433
  title: i18n2.t("dovetail.csi")
12542
12434
  };
@@ -12544,6 +12436,7 @@ const PVCSIRefField = (i18n2) => {
12544
12436
  const IsDefaultSCField = (i18n2) => {
12545
12437
  return {
12546
12438
  key: "isDefaultSC",
12439
+ col: 12,
12547
12440
  path: ["isDefaultSC"],
12548
12441
  title: i18n2.t("dovetail.default_sc"),
12549
12442
  renderContent(val) {
@@ -12554,6 +12447,7 @@ const IsDefaultSCField = (i18n2) => {
12554
12447
  const SCReclaimPolicyField = (i18n2) => {
12555
12448
  return {
12556
12449
  key: "reclaimPolicy",
12450
+ col: 12,
12557
12451
  path: ["reclaimPolicy"],
12558
12452
  title: i18n2.t("dovetail.reclaim_policy"),
12559
12453
  renderContent(val) {
@@ -12568,6 +12462,7 @@ const SCReclaimPolicyField = (i18n2) => {
12568
12462
  const IsSCAllowVolumeExpansionField = (i18n2) => {
12569
12463
  return {
12570
12464
  key: "allowVolumeExpansion",
12465
+ col: 12,
12571
12466
  path: ["allowVolumeExpansion"],
12572
12467
  title: i18n2.t("dovetail.allow_expand"),
12573
12468
  renderContent(val) {
@@ -12815,7 +12710,7 @@ const PodLogTab = (i18n2) => ({
12815
12710
  ]
12816
12711
  });
12817
12712
  const NetworkPolicyRulesViewer_r6jity = "";
12818
- const MonacoYamlEditor$1 = React.lazy(() => Promise.resolve().then(() => require("./MonacoYamlEditor-9b8b7cef.cjs")));
12713
+ const MonacoYamlEditor$1 = React.lazy(() => Promise.resolve().then(() => require("./MonacoYamlEditor-bdd52136.cjs")));
12819
12714
  const EditorStyle$1 = "e1cjl2b8";
12820
12715
  const NetworkPolicyRulesViewer = ({
12821
12716
  ingressOrEgress,
@@ -13153,6 +13048,248 @@ const ResourceTableGroup = (resource, title) => ({
13153
13048
  }
13154
13049
  ]
13155
13050
  });
13051
+ function Tabs(props) {
13052
+ const { tabs, className } = props;
13053
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Tabs, { className, children: tabs.map((tab) => {
13054
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.TabsTabPane, { tab: tab.title, children: tab.children }, tab.title);
13055
+ }) });
13056
+ }
13057
+ const ShowContentView_1mvcyif = "";
13058
+ const ShowContentWrapperStyle = "soapvs9";
13059
+ const BackButton = "b13d603q";
13060
+ const ToolBarWrapper = "tm8eaia";
13061
+ const NameStyle = "nhnus27";
13062
+ const TopBarStyle = "t16t20f5";
13063
+ const ShowContentHeaderStyle = "s97y2wr";
13064
+ const GroupStyle = "g1rhnxqx";
13065
+ const GroupTitleStyle = "g1f1s2pc";
13066
+ const FullTabContentStyle = "f1qw3bxx";
13067
+ const FieldWrapperStyle = "flfewds";
13068
+ const TabContentStyle = "t1c7cta8";
13069
+ const ValueStyle = "v1pt61xk";
13070
+ const TabsStyle = "t1to6fie";
13071
+ function ShowGroupComponent(props) {
13072
+ const {
13073
+ title,
13074
+ className,
13075
+ children,
13076
+ operationEle
13077
+ } = props;
13078
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
13079
+ className: common.cx_default(GroupStyle, className),
13080
+ children: [/* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
13081
+ className: common.cx_default(eagle.Typo.Heading.h2_bold_title, GroupTitleStyle),
13082
+ children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx("div", {
13083
+ children: title
13084
+ }), operationEle]
13085
+ }), children]
13086
+ });
13087
+ }
13088
+ const ShowContentView = (props) => {
13089
+ var _a, _b, _c, _d;
13090
+ const {
13091
+ id,
13092
+ resourceName,
13093
+ showConfig,
13094
+ formatter,
13095
+ Dropdown = K8sDropdown,
13096
+ hideBackButton = false
13097
+ } = props;
13098
+ const {
13099
+ queryResult
13100
+ } = core.useShow({
13101
+ id,
13102
+ resource: resourceName,
13103
+ errorNotification: false
13104
+ });
13105
+ const {
13106
+ t: t2
13107
+ } = common.useTranslation();
13108
+ const {
13109
+ data: data2
13110
+ } = queryResult;
13111
+ const navigation = core.useNavigation();
13112
+ const go = core.useGo();
13113
+ const openForm = useOpenForm();
13114
+ const Component = React.useContext(ComponentContext);
13115
+ const configs = React.useContext(ConfigsContext);
13116
+ const config = configs[resourceName];
13117
+ const Tabs$1 = Component.Tabs || Tabs;
13118
+ if (!(data2 == null ? void 0 : data2.data)) {
13119
+ return null;
13120
+ }
13121
+ const model = data2.data;
13122
+ const record = formatter ? formatter(model) : data2 == null ? void 0 : data2.data;
13123
+ function renderFields(fields, areaType, hasCol = true) {
13124
+ if (!record)
13125
+ return null;
13126
+ return fields.map((field) => {
13127
+ if (field.hidden)
13128
+ return null;
13129
+ let content;
13130
+ const value2 = lodashEs.get(record, field.path);
13131
+ if (field.renderContent) {
13132
+ content = field.renderContent(value2, record, field);
13133
+ } else {
13134
+ content = lodashEs.get(record, field.path);
13135
+ }
13136
+ return hasCol ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Col, {
13137
+ flex: areaType === AreaType.Inline ? "none" : "",
13138
+ span: field.col || 24,
13139
+ className: "cca5959",
13140
+ children: field.render ? field.render(value2, record, field) : /* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
13141
+ className: FieldWrapperStyle,
13142
+ children: [field.title && /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
13143
+ className: eagle.Typo.Label.l4_regular_title,
13144
+ style: {
13145
+ width: field.labelWidth || "165px",
13146
+ marginRight: 8,
13147
+ flexShrink: 0,
13148
+ color: "#2C385299"
13149
+ },
13150
+ children: field.title
13151
+ }), /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
13152
+ style: {
13153
+ flex: 1,
13154
+ minWidth: 0
13155
+ },
13156
+ children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(ValueDisplay, {
13157
+ className: common.cx_default(eagle.Typo.Label.l4_regular_title, ValueStyle),
13158
+ value: content,
13159
+ useOverflow: false
13160
+ })
13161
+ })]
13162
+ })
13163
+ }, field.key) : /* @__PURE__ */ common.jsxRuntimeExports.jsx(ValueDisplay, {
13164
+ style: {
13165
+ height: "100%"
13166
+ },
13167
+ value: content,
13168
+ useOverflow: false
13169
+ });
13170
+ });
13171
+ }
13172
+ function renderGroup(group) {
13173
+ const GroupContainer = group.title ? ShowGroupComponent : React.Fragment;
13174
+ const FieldContainer = group.title ? eagle.Row : React.Fragment;
13175
+ const groupContainerProps = group.title ? {
13176
+ title: group.title || ""
13177
+ } : {};
13178
+ const fieldContainerProps = group.title ? {
13179
+ gutter: [24, 8]
13180
+ } : {};
13181
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(GroupContainer, {
13182
+ ...groupContainerProps,
13183
+ children: group.areas.map((area, index2) => /* @__PURE__ */ common.jsxRuntimeExports.jsxs(common.jsxRuntimeExports.Fragment, {
13184
+ children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx(FieldContainer, {
13185
+ ...fieldContainerProps,
13186
+ children: renderFields(area.fields, area.type, !!group.title)
13187
+ }, index2), index2 !== group.areas.length - 1 ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Divider, {
13188
+ style: {
13189
+ margin: "8px 0 12px 0"
13190
+ }
13191
+ }) : null]
13192
+ }))
13193
+ }, group.title);
13194
+ }
13195
+ const stateDisplay = lodashEs.get(record, "stateDisplay");
13196
+ const topBar = /* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
13197
+ className: ToolBarWrapper,
13198
+ children: [!hideBackButton && /* @__PURE__ */ common.jsxRuntimeExports.jsx("div", {
13199
+ className: common.cx_default(eagle.Typo.Label.l4_bold, BackButton),
13200
+ onClick: () => {
13201
+ go({
13202
+ to: navigation.listUrl(resourceName)
13203
+ });
13204
+ },
13205
+ children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Icon, {
13206
+ src: iconsReact.ArrowChevronLeft16BoldTertiaryIcon,
13207
+ hoverSrc: iconsReact.ArrowChevronLeftSmall16BoldBlueIcon,
13208
+ style: {
13209
+ marginRight: 4
13210
+ },
13211
+ children: /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
13212
+ className: "button-text",
13213
+ children: (config == null ? void 0 : config.displayName) || resourceName
13214
+ })
13215
+ })
13216
+ }), /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Space, {
13217
+ className: TopBarStyle,
13218
+ children: [/* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
13219
+ style: {
13220
+ display: "flex"
13221
+ },
13222
+ children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
13223
+ className: common.cx_default(eagle.Typo.Display.d2_regular_title, NameStyle),
13224
+ children: ((_a = showConfig.displayName) == null ? void 0 : _a.call(showConfig, record)) || ((_b = record == null ? void 0 : record.metadata) == null ? void 0 : _b.name)
13225
+ }), stateDisplay ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(StateTag, {
13226
+ state: stateDisplay,
13227
+ customResourceStateMap: showConfig.resourceStateMap
13228
+ }) : void 0]
13229
+ }), /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Space, {
13230
+ children: [(_c = showConfig.renderExtraButton) == null ? void 0 : _c.call(showConfig, record), !config.hideEdit ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(core.CanAccess, {
13231
+ resource: resourceName,
13232
+ action: AccessControlAuth.Edit,
13233
+ params: {
13234
+ namespace: record.namespace
13235
+ },
13236
+ children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Button, {
13237
+ style: {
13238
+ marginRight: 8
13239
+ },
13240
+ onClick: () => openForm({
13241
+ id
13242
+ }),
13243
+ children: ((_d = config.formConfig) == null ? void 0 : _d.formType) === FormType.FORM ? t2("dovetail.edit") : t2("dovetail.edit_yaml")
13244
+ })
13245
+ }) : null, /* @__PURE__ */ common.jsxRuntimeExports.jsx(Dropdown, {
13246
+ record,
13247
+ size: "large"
13248
+ })]
13249
+ })]
13250
+ })]
13251
+ });
13252
+ const tabs = /* @__PURE__ */ common.jsxRuntimeExports.jsx(Tabs$1, {
13253
+ tabs: (showConfig.tabs || []).map((tab, tabIndex) => {
13254
+ var _a2;
13255
+ return {
13256
+ title: tab.title,
13257
+ key: tab.key,
13258
+ children: /* @__PURE__ */ common.jsxRuntimeExports.jsx("div", {
13259
+ className: common.cx_default(TabContentStyle, tab.groups.length <= 1 && tabIndex !== 0 && FullTabContentStyle),
13260
+ children: (_a2 = tab.groups) == null ? void 0 : _a2.map(renderGroup)
13261
+ })
13262
+ };
13263
+ }),
13264
+ className: TabsStyle
13265
+ });
13266
+ const basicInfo = showConfig.basicGroup ? renderGroup(showConfig.basicGroup) : null;
13267
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
13268
+ className: ShowContentWrapperStyle,
13269
+ children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Space, {
13270
+ direction: "vertical",
13271
+ className: ShowContentHeaderStyle,
13272
+ children: topBar
13273
+ }), basicInfo, tabs]
13274
+ });
13275
+ };
13276
+ const ShowContent = (props) => {
13277
+ var _a;
13278
+ const { showConfig, formatter, Dropdown = K8sDropdown } = props;
13279
+ const parsed = core.useParsed();
13280
+ const { resource } = core.useResource();
13281
+ const id = (_a = parsed == null ? void 0 : parsed.params) == null ? void 0 : _a.id;
13282
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
13283
+ ShowContentView,
13284
+ {
13285
+ id,
13286
+ resourceName: (resource == null ? void 0 : resource.name) || "",
13287
+ showConfig,
13288
+ formatter,
13289
+ Dropdown
13290
+ }
13291
+ );
13292
+ };
13156
13293
  const PageShow = (props) => {
13157
13294
  var _a;
13158
13295
  const parsed = core.useParsed();
@@ -16254,7 +16391,7 @@ const PlainCodeStyle = "pqch97v";
16254
16391
  const ErrorMsgStyle = "eh2qjnl";
16255
16392
  const ErrorWrapperStyle = "e19q2bnp";
16256
16393
  const YamlEditorStyle = "y16u5v3w";
16257
- const MonacoYamlEditor = React.lazy(() => Promise.resolve().then(() => require("./MonacoYamlEditor-9b8b7cef.cjs")));
16394
+ const MonacoYamlEditor = React.lazy(() => Promise.resolve().then(() => require("./MonacoYamlEditor-bdd52136.cjs")));
16258
16395
  const MonacoYamlDiffEditor = React.lazy(() => Promise.resolve().then(() => require("./MonacoYamlDiffEditor-7a07db88.cjs")));
16259
16396
  const YamlEditorComponent = React.forwardRef(
16260
16397
  function YamlEditorComponent2(props, ref) {
@@ -16282,20 +16419,18 @@ const YamlEditorComponent = React.forwardRef(
16282
16419
  const editorInstance = React.useRef();
16283
16420
  const [copyTooltip, setCopyTooltip] = React.useState(t2("dovetail.copy"));
16284
16421
  const [resetTooltip, setResetTooltip] = React.useState(t2("dovetail.reset_arguments"));
16285
- React.useImperativeHandle(ref, () => {
16286
- return {
16287
- setValue: _setValue,
16288
- setEditorValue: (value22) => {
16289
- var _a, _b;
16290
- (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(value22);
16291
- },
16292
- getEditorValue: () => {
16293
- var _a;
16294
- return ((_a = editorInstance.current) == null ? void 0 : _a.getValue()) ?? "";
16295
- },
16296
- getEditorInstance: () => editorInstance.current || null
16297
- };
16298
- });
16422
+ const defaultValueString = React.useMemo(() => {
16423
+ if (typeof defaultValue === "string") {
16424
+ return defaultValue;
16425
+ }
16426
+ return yaml$2.dump(defaultValue);
16427
+ }, [defaultValue]);
16428
+ const _valueString = React.useMemo(() => {
16429
+ if (typeof _value === "string") {
16430
+ return _value;
16431
+ }
16432
+ return yaml$2.dump(_value);
16433
+ }, [_value]);
16299
16434
  const onChange = React.useCallback(
16300
16435
  (newVal) => {
16301
16436
  var _a;
@@ -16318,7 +16453,7 @@ const YamlEditorComponent = React.forwardRef(
16318
16453
  (editor) => {
16319
16454
  var _a, _b, _c;
16320
16455
  if (editor.getValue() !== _value) {
16321
- (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(_value);
16456
+ (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(_valueString);
16322
16457
  }
16323
16458
  (_c = props.onEditorCreate) == null ? void 0 : _c.call(props, editor);
16324
16459
  },
@@ -16327,13 +16462,29 @@ const YamlEditorComponent = React.forwardRef(
16327
16462
  const getInstance = React.useCallback((ins) => {
16328
16463
  editorInstance.current = ins;
16329
16464
  }, []);
16465
+ const getEditorValue = React.useCallback(() => {
16466
+ var _a;
16467
+ return ((_a = editorInstance.current) == null ? void 0 : _a.getValue()) ?? "";
16468
+ }, []);
16330
16469
  React.useEffect(() => {
16331
16470
  var _a, _b;
16332
- if (value2 !== void 0 && value2 !== _value) {
16471
+ if (value2 !== void 0 && !lodashEs.isEqual(value2, _value)) {
16472
+ const valueString = typeof value2 === "string" ? value2 : yaml$2.dump(value2);
16333
16473
  _setValue(value2);
16334
- (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(value2);
16474
+ (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(valueString);
16335
16475
  }
16336
16476
  }, [value2]);
16477
+ React.useImperativeHandle(ref, () => {
16478
+ return {
16479
+ setValue: _setValue,
16480
+ setEditorValue: (value22) => {
16481
+ var _a, _b;
16482
+ (_b = (_a = editorInstance.current) == null ? void 0 : _a.getModel()) == null ? void 0 : _b.setValue(value22);
16483
+ },
16484
+ getEditorValue,
16485
+ getEditorInstance: () => editorInstance.current || null
16486
+ };
16487
+ });
16337
16488
  return /* @__PURE__ */ common.jsxRuntimeExports.jsxs(
16338
16489
  "div",
16339
16490
  {
@@ -16387,7 +16538,7 @@ const YamlEditorComponent = React.forwardRef(
16387
16538
  iconHeight: 16,
16388
16539
  onClick: () => {
16389
16540
  if (!isCollapsed) {
16390
- copyToClipboard(_value);
16541
+ copyToClipboard(getEditorValue());
16391
16542
  setCopyTooltip(t2("dovetail.copied"));
16392
16543
  }
16393
16544
  }
@@ -16419,7 +16570,7 @@ const YamlEditorComponent = React.forwardRef(
16419
16570
  onClick: () => {
16420
16571
  var _a;
16421
16572
  if (!isCollapsed) {
16422
- (_a = editorInstance.current) == null ? void 0 : _a.setValue(defaultValue);
16573
+ (_a = editorInstance.current) == null ? void 0 : _a.setValue(defaultValueString);
16423
16574
  setResetTooltip(t2("dovetail.already_reset"));
16424
16575
  }
16425
16576
  }
@@ -16480,7 +16631,7 @@ const YamlEditorComponent = React.forwardRef(
16480
16631
  zIndex: 1
16481
16632
  },
16482
16633
  children: [
16483
- /* @__PURE__ */ common.jsxRuntimeExports.jsx(React.Suspense, { fallback: /* @__PURE__ */ common.jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: _value }), children: /* @__PURE__ */ common.jsxRuntimeExports.jsx("div", { style: { display: isDiff ? "none" : "block" }, children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(
16634
+ /* @__PURE__ */ common.jsxRuntimeExports.jsx(React.Suspense, { fallback: /* @__PURE__ */ common.jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: _valueString }), children: /* @__PURE__ */ common.jsxRuntimeExports.jsx("div", { style: { display: isDiff ? "none" : "block" }, children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(
16484
16635
  MonacoYamlEditor,
16485
16636
  {
16486
16637
  id: props.id,
@@ -16496,12 +16647,12 @@ const YamlEditorComponent = React.forwardRef(
16496
16647
  isScrollOnFocus
16497
16648
  }
16498
16649
  ) }) }),
16499
- isDiff ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(React.Suspense, { fallback: /* @__PURE__ */ common.jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: _value }), children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(
16650
+ isDiff ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(React.Suspense, { fallback: /* @__PURE__ */ common.jsxRuntimeExports.jsx("pre", { className: PlainCodeStyle, children: _valueString }), children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(
16500
16651
  MonacoYamlDiffEditor,
16501
16652
  {
16502
16653
  id: props.id,
16503
- origin: defaultValue,
16504
- modified: _value,
16654
+ origin: defaultValueString,
16655
+ modified: _valueString,
16505
16656
  height
16506
16657
  }
16507
16658
  ) }) : null
@@ -18778,7 +18929,8 @@ class ModelPlugin {
18778
18929
  Node: NodeModel,
18779
18930
  StorageClass: StorageClassModel,
18780
18931
  PersistentVolume: PersistentVolumeModel,
18781
- PersistentVolumeClaim: PersistentVolumeClaimModel
18932
+ PersistentVolumeClaim: PersistentVolumeClaimModel,
18933
+ ReplicaSet: ReplicaSetModel
18782
18934
  })
18783
18935
  ));
18784
18936
  }
@@ -19059,6 +19211,7 @@ exports.RefineFormContent = RefineFormContent;
19059
19211
  exports.RefineFormPage = RefineFormPage;
19060
19212
  exports.RelationPlugin = RelationPlugin;
19061
19213
  exports.ReplicaField = ReplicaField;
19214
+ exports.ReplicaSetModel = ReplicaSetModel;
19062
19215
  exports.ReplicasColumnRenderer = ReplicasColumnRenderer;
19063
19216
  exports.ReplicasDropdown = ReplicasDropdown;
19064
19217
  exports.ResourceCRUD = ResourceCRUD;
@@ -19111,6 +19264,7 @@ exports.ServiceTypeEnum = ServiceTypeEnum;
19111
19264
  exports.ServiceTypeField = ServiceTypeField;
19112
19265
  exports.SessionAffinityField = SessionAffinityField;
19113
19266
  exports.ShowContent = ShowContent;
19267
+ exports.ShowContentView = ShowContentView;
19114
19268
  exports.ShowGroupComponent = ShowGroupComponent;
19115
19269
  exports.StartTimeField = StartTimeField;
19116
19270
  exports.StateDisplayColumnRenderer = StateDisplayColumnRenderer;