@dovetail-v2/refine 0.2.12 → 0.3.1

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.
@@ -1180,6 +1180,7 @@ const confirm = "确认";
1180
1180
  const cant_delete_resource = "无法删除{{resource}}";
1181
1181
  const cant_delete_resource_with_name = "无法删除{{resource}} <0>{{name}}</0> 。";
1182
1182
  const close = "关闭";
1183
+ const import_from_file = "从文件读取";
1183
1184
  const dovetail = {
1184
1185
  copy,
1185
1186
  reset_arguments,
@@ -1421,7 +1422,8 @@ const dovetail = {
1421
1422
  confirm,
1422
1423
  cant_delete_resource,
1423
1424
  cant_delete_resource_with_name,
1424
- close
1425
+ close,
1426
+ import_from_file
1425
1427
  };
1426
1428
  const ZH = {
1427
1429
  dovetail
@@ -9317,7 +9319,7 @@ class JobModel extends WorkloadBaseModel {
9317
9319
  return matchSelector(p, (_a = this.spec) == null ? void 0 : _a.selector, this.metadata.namespace);
9318
9320
  }
9319
9321
  );
9320
- const result = lodashExports.sumBy(myPods, "restartCount");
9322
+ const result = lodashExports.sumBy(myPods, "restarts");
9321
9323
  this.restarts = result;
9322
9324
  }
9323
9325
  get duration() {
@@ -9384,7 +9386,7 @@ class WorkloadModel extends WorkloadBaseModel {
9384
9386
  return matchSelector(p, (_a = this.spec) == null ? void 0 : _a.selector, this.metadata.namespace);
9385
9387
  }
9386
9388
  );
9387
- const result = lodashExports.sumBy(myPods, "restartCount");
9389
+ const result = lodashExports.sumBy(myPods, "restarts");
9388
9390
  this.restarts = result;
9389
9391
  }
9390
9392
  get replicas() {
@@ -9393,6 +9395,9 @@ class WorkloadModel extends WorkloadBaseModel {
9393
9395
  get readyReplicas() {
9394
9396
  return this.status && "readyReplicas" in this.status ? this.status.readyReplicas : 0;
9395
9397
  }
9398
+ get appKey() {
9399
+ return `${this.kind}-${this.name}-${this.namespace}`;
9400
+ }
9396
9401
  redeploy() {
9397
9402
  const rawYaml = this._globalStore.restoreItem(this);
9398
9403
  const newOne = lodashExports.cloneDeep(rawYaml);
@@ -9465,7 +9470,7 @@ class PodModel extends WorkloadBaseModel {
9465
9470
  (container2) => shortenedImage(container2.image || "")
9466
9471
  )) || [];
9467
9472
  }
9468
- get restartCount() {
9473
+ get restarts() {
9469
9474
  var _a, _b;
9470
9475
  if ((_a = this._rawYaml.status) == null ? void 0 : _a.containerStatuses) {
9471
9476
  return ((_b = this._rawYaml.status) == null ? void 0 : _b.containerStatuses.reduce((count, container2) => {
@@ -10190,34 +10195,44 @@ function getInitialValues(config) {
10190
10195
  spec: {}
10191
10196
  };
10192
10197
  }
10193
- function useOpenForm(options) {
10198
+ function useOpenForm() {
10194
10199
  const { resource } = core.useResource();
10195
10200
  const configs = React.useContext(ConfigsContext);
10196
10201
  const { edit: edit2 } = useEdit();
10197
10202
  const navigation = core.useNavigation();
10198
10203
  const pushModal = eagle.usePushModal();
10199
10204
  const go = core.useGo();
10200
- return function openForm() {
10201
- var _a, _b;
10202
- if (resource == null ? void 0 : resource.name) {
10203
- const config = configs[resource.name];
10205
+ return function openForm(options) {
10206
+ var _a;
10207
+ const finalResourceName = (options == null ? void 0 : options.resourceName) || (resource == null ? void 0 : resource.name);
10208
+ if (finalResourceName) {
10209
+ const config = configs[finalResourceName];
10204
10210
  const formType = (_a = config.formConfig) == null ? void 0 : _a.formContainerType;
10205
10211
  if (formType === void 0 || formType === FormContainerType.MODAL) {
10206
10212
  pushModal({
10207
- component: ((_b = config.formConfig) == null ? void 0 : _b.CustomFormModal) || FormModal,
10208
- props: {
10209
- resource: resource.name,
10210
- id: options == null ? void 0 : options.id,
10211
- formProps: {
10212
- initialValues: getInitialValues(config)
10213
- }
10214
- }
10213
+ component: () => {
10214
+ var _a2;
10215
+ const ModalComponent = ((_a2 = config.formConfig) == null ? void 0 : _a2.CustomFormModal) || FormModal;
10216
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
10217
+ ModalComponent,
10218
+ {
10219
+ resource: finalResourceName,
10220
+ id: options == null ? void 0 : options.id,
10221
+ yamlFormProps: {
10222
+ config,
10223
+ initialValuesForCreate: getInitialValues(config)
10224
+ },
10225
+ onSuccess: options == null ? void 0 : options.onSuccess
10226
+ }
10227
+ );
10228
+ },
10229
+ props: {}
10215
10230
  });
10216
10231
  } else if (options == null ? void 0 : options.id) {
10217
10232
  edit2(options.id);
10218
10233
  } else {
10219
10234
  go({
10220
- to: navigation.createUrl(resource.name),
10235
+ to: navigation.createUrl(finalResourceName),
10221
10236
  options: {
10222
10237
  keepQuery: true
10223
10238
  }
@@ -10226,28 +10241,78 @@ function useOpenForm(options) {
10226
10241
  }
10227
10242
  };
10228
10243
  }
10244
+ function getResourceNameByKind(kind, configs) {
10245
+ var _a;
10246
+ return (_a = Object.values(configs).find((config) => config.kind === kind)) == null ? void 0 : _a.name;
10247
+ }
10248
+ function validateDnsSubdomain(subdomain) {
10249
+ const regex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
10250
+ if (!regex.test(subdomain)) {
10251
+ return { isValid: false };
10252
+ }
10253
+ if (subdomain && subdomain.length > 63) {
10254
+ return { isValid: false };
10255
+ }
10256
+ return { isValid: true };
10257
+ }
10258
+ function validateLabelKey(key2) {
10259
+ const labelRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
10260
+ let prefix2, name2;
10261
+ const splitResult = key2.split("/");
10262
+ if (splitResult.length === 1) {
10263
+ name2 = splitResult[0];
10264
+ } else {
10265
+ prefix2 = splitResult[0];
10266
+ name2 = splitResult[1];
10267
+ }
10268
+ if (prefix2 === "") {
10269
+ return { isValid: false };
10270
+ }
10271
+ if (prefix2 && !labelRegex.test(prefix2)) {
10272
+ return { isValid: false };
10273
+ }
10274
+ if (prefix2 && prefix2.length > 253) {
10275
+ return { isValid: false };
10276
+ }
10277
+ return validateDnsSubdomain(name2);
10278
+ }
10279
+ function validateLabelValue(value2, isOptional) {
10280
+ const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
10281
+ if (isOptional && value2 === "") {
10282
+ return { isValid: true };
10283
+ } else if (value2 === "") {
10284
+ return { isValid: false };
10285
+ }
10286
+ if (value2.length > 63) {
10287
+ return { isValid: false };
10288
+ }
10289
+ if (!labelValueRegex.test(value2)) {
10290
+ return { isValid: false };
10291
+ }
10292
+ return { isValid: true };
10293
+ }
10229
10294
  function K8sDropdown(props) {
10230
10295
  var _a;
10231
10296
  const { record, size = "normal" } = props;
10232
10297
  const globalStore = useGlobalStore();
10233
10298
  const useResourceResult = core.useResource();
10234
- const resource = useResourceResult.resource;
10235
10299
  const configs = React.useContext(ConfigsContext);
10236
- const config = configs[(resource == null ? void 0 : resource.name) || ""];
10300
+ const resourceName = getResourceNameByKind(record.kind || "", configs);
10301
+ const config = configs[resourceName || ""];
10237
10302
  const { t: t2 } = common.useTranslation();
10238
- const { openDeleteConfirmModal } = useDeleteModal({ resourceName: (resource == null ? void 0 : resource.name) || "" });
10303
+ const { openDeleteConfirmModal } = useDeleteModal({ resourceName: resourceName || "" });
10239
10304
  const download2 = useDownloadYAML();
10240
- const openForm = useOpenForm({ id: record.id });
10305
+ const openForm = useOpenForm();
10241
10306
  const isInShowPage = useResourceResult.action === "show";
10242
10307
  const { data: canEditData } = core.useCan({
10243
- resource: resource == null ? void 0 : resource.name,
10308
+ resource: resourceName,
10244
10309
  action: AccessControlAuth.Edit,
10245
10310
  params: {
10246
10311
  namespace: record.namespace
10247
10312
  }
10248
10313
  });
10249
10314
  const { data: canDeleteData } = core.useCan({
10250
- resource: resource == null ? void 0 : resource.name,
10315
+ resource: resourceName,
10251
10316
  action: AccessControlAuth.Delete,
10252
10317
  params: {
10253
10318
  namespace: record.namespace
@@ -10258,7 +10323,7 @@ function K8sDropdown(props) {
10258
10323
  eagle.Dropdown,
10259
10324
  {
10260
10325
  overlay: /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Menu, { children: [
10261
- isInShowPage || (canEditData == null ? void 0 : canEditData.can) === false || config.hideEdit ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Menu.Item, { onClick: openForm, children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.EditPen16PrimaryIcon, children: formType === FormType.FORM ? t2("dovetail.edit") : t2("dovetail.edit_yaml") }) }),
10326
+ isInShowPage || (canEditData == null ? void 0 : canEditData.can) === false || config.hideEdit ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Menu.Item, { onClick: () => openForm({ id: record.id }), children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.EditPen16PrimaryIcon, children: formType === FormType.FORM ? t2("dovetail.edit") : t2("dovetail.edit_yaml") }) }),
10262
10327
  /* @__PURE__ */ common.jsxRuntimeExports.jsx(
10263
10328
  eagle.Menu.Item,
10264
10329
  {
@@ -10416,7 +10481,7 @@ function CreateButton(props) {
10416
10481
  {
10417
10482
  prefixIcon: /* @__PURE__ */ common.jsxRuntimeExports.jsx(iconsReact.PlusAddCreateNew16BoldOntintIcon, {}),
10418
10483
  type: "primary",
10419
- onClick: openForm,
10484
+ onClick: () => openForm(),
10420
10485
  children: createButtonText || t2("dovetail.create_resource", {
10421
10486
  resource: transformResourceKindInSentence(label2, i18n2.language)
10422
10487
  })
@@ -10695,7 +10760,7 @@ const index_x36tts = "";
10695
10760
  const LinkStyle = "l1vnw9x0";
10696
10761
  const ResourceLink = (props) => {
10697
10762
  const {
10698
- resourceKind: resourceName,
10763
+ resourceName,
10699
10764
  namespace: namespace2,
10700
10765
  name: name2,
10701
10766
  uid,
@@ -10786,7 +10851,7 @@ const IngressRulesTable = ({ ingress }) => {
10786
10851
  return record.serviceName ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(
10787
10852
  ResourceLink,
10788
10853
  {
10789
- resourceKind: "services",
10854
+ resourceName: "services",
10790
10855
  namespace: ingress.metadata.namespace || "default",
10791
10856
  name: serviceName
10792
10857
  }
@@ -10813,7 +10878,7 @@ const IngressRulesTable = ({ ingress }) => {
10813
10878
  return secretName ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(
10814
10879
  ResourceLink,
10815
10880
  {
10816
- resourceKind: "secrets",
10881
+ resourceName: "secrets",
10817
10882
  namespace: ingress.metadata.namespace || "default",
10818
10883
  name: secretName
10819
10884
  }
@@ -11036,9 +11101,7 @@ const ShowContent = (props) => {
11036
11101
  } = queryResult;
11037
11102
  const navigation = core.useNavigation();
11038
11103
  const go = core.useGo();
11039
- const openForm = useOpenForm({
11040
- id
11041
- });
11104
+ const openForm = useOpenForm();
11042
11105
  const Component = React.useContext(ComponentContext);
11043
11106
  const configs = React.useContext(ConfigsContext);
11044
11107
  const config = configs[(resource == null ? void 0 : resource.name) || ""];
@@ -11141,7 +11204,9 @@ const ShowContent = (props) => {
11141
11204
  style: {
11142
11205
  marginRight: 8
11143
11206
  },
11144
- onClick: openForm,
11207
+ onClick: () => openForm({
11208
+ id
11209
+ }),
11145
11210
  children: ((_f = config.formConfig) == null ? void 0 : _f.formType) === FormType.FORM ? t2("dovetail.edit") : t2("dovetail.edit_yaml")
11146
11211
  })
11147
11212
  }) : null, /* @__PURE__ */ common.jsxRuntimeExports.jsx(Dropdown, {
@@ -11230,45 +11295,36 @@ function KeyValueSecret(props) {
11230
11295
  })
11231
11296
  });
11232
11297
  }
11233
- function validateLabelKey(key2) {
11234
- const labelRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
11235
- let prefix2, name2;
11236
- const splitResult = key2.split("/");
11237
- if (splitResult.length === 1) {
11238
- name2 = splitResult[0];
11239
- } else {
11240
- prefix2 = splitResult[0];
11241
- name2 = splitResult[1];
11242
- }
11243
- if (prefix2 === "") {
11244
- return { isValid: false, errorMessage: "EMPTY_PREFIX" };
11245
- }
11246
- if (prefix2 && !labelRegex.test(prefix2)) {
11247
- return { isValid: false, errorMessage: "INVALID_PREFIX" };
11248
- }
11249
- if (!labelRegex.test(name2)) {
11250
- return { isValid: false, errorMessage: "INVALID_NAME" };
11251
- }
11252
- if (prefix2 && prefix2.length > 253) {
11253
- return { isValid: false, errorMessage: "MAX_253" };
11254
- }
11255
- if (name2 && name2.length > 63) {
11256
- return { isValid: false, errorMessage: "MAX_63" };
11298
+ function isUtf8(buffer) {
11299
+ try {
11300
+ const decoder = new TextDecoder("utf-8", { fatal: true });
11301
+ decoder.decode(buffer);
11302
+ return true;
11303
+ } catch (e2) {
11304
+ return false;
11257
11305
  }
11258
- return { isValid: true };
11259
11306
  }
11260
- function validateLabelValue(value2) {
11261
- const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-\_]*[a-zA-Z0-9]$)/;
11262
- if (value2 === "") {
11263
- return { isValid: true };
11264
- }
11265
- if (value2.length > 63) {
11266
- return { isValid: false, errorMessage: "MAX_63" };
11267
- }
11268
- if (!labelValueRegex.test(value2)) {
11269
- return { isValid: false, errorMessage: "INVALID_VALUE" };
11270
- }
11271
- return { isValid: true };
11307
+ function readFileAsBase64(file) {
11308
+ return new Promise((resolve, reject) => {
11309
+ const reader = new FileReader();
11310
+ reader.onload = async () => {
11311
+ const arrayBuffer = reader.result;
11312
+ if (arrayBuffer instanceof ArrayBuffer) {
11313
+ if (isUtf8(arrayBuffer)) {
11314
+ resolve(await file.text());
11315
+ } else {
11316
+ const base64String = btoa(
11317
+ String.fromCharCode(...new Uint8Array(arrayBuffer))
11318
+ );
11319
+ resolve(base64String);
11320
+ }
11321
+ return;
11322
+ }
11323
+ reject(new Error("Failed to read file"));
11324
+ };
11325
+ reader.onerror = reject;
11326
+ reader.readAsArrayBuffer(file);
11327
+ });
11272
11328
  }
11273
11329
  const LabelFormatPopover_piveun = "";
11274
11330
  const PodLabelFormatRulePopoverStyle = "p5jt6nm";
@@ -11356,59 +11412,86 @@ const LabelFormatPopover = ({
11356
11412
  })
11357
11413
  });
11358
11414
  };
11359
- const KeyValueTableForm_1eydq7y = "";
11360
- function _KeyValueTableFormForm(props, ref) {
11415
+ const index_t3zi07 = "";
11416
+ function _KeyValueTableForm(props, ref) {
11361
11417
  const {
11418
+ value: value2,
11362
11419
  defaultValue,
11363
- onSubmit,
11420
+ onChange,
11364
11421
  extraColumns,
11365
11422
  addButtonText,
11366
- noValueValidation
11423
+ noValueValidation,
11424
+ isHideLabelFormatPopover,
11425
+ isValueOptional = true,
11426
+ canImportFromFile,
11427
+ minSize,
11428
+ validateKey,
11429
+ validateValue,
11430
+ onSubmit
11367
11431
  } = props;
11368
11432
  const {
11369
11433
  t: t2
11370
11434
  } = common.useTranslation();
11371
- const [value2, setValue] = React.useState([]);
11372
11435
  const tableFormRef = React.useRef(null);
11436
+ const [_value, _setValue] = React.useState(value2 || defaultValue);
11437
+ const [forceUpdateCount, setForceUpdateCount] = React.useState(0);
11438
+ const validate = React.useCallback(() => {
11439
+ return new Promise((resolve) => {
11440
+ var _a;
11441
+ (_a = tableFormRef.current) == null ? void 0 : _a.validateWholeFields();
11442
+ setForceUpdateCount(forceUpdateCount + 1);
11443
+ setTimeout(() => {
11444
+ var _a2;
11445
+ const isValid = (_a2 = tableFormRef.current) == null ? void 0 : _a2.isValid();
11446
+ resolve(isValid || false);
11447
+ }, 0);
11448
+ });
11449
+ }, [forceUpdateCount]);
11373
11450
  React.useImperativeHandle(ref, () => ({
11374
- submit: () => {
11375
- return new Promise((res, rej) => {
11376
- var _a;
11377
- (_a = tableFormRef.current) == null ? void 0 : _a.validateWholeFields();
11378
- setTimeout(() => {
11379
- var _a2;
11380
- const isValid = (_a2 = tableFormRef.current) == null ? void 0 : _a2.isValid();
11381
- if (isValid) {
11382
- res(onSubmit(value2));
11383
- } else {
11384
- rej();
11385
- }
11386
- }, 0);
11387
- });
11451
+ validate,
11452
+ submit: async () => {
11453
+ const isValid = await validate();
11454
+ if (isValid) {
11455
+ return onSubmit == null ? void 0 : onSubmit(_value);
11456
+ }
11457
+ return Promise.reject();
11458
+ },
11459
+ setValue: (value22) => {
11460
+ var _a;
11461
+ _setValue(value22);
11462
+ (_a = tableFormRef.current) == null ? void 0 : _a.setData(value22);
11463
+ }
11464
+ }), [validate, onSubmit, _value]);
11465
+ React.useEffect(() => {
11466
+ var _a;
11467
+ if (value2 && !lodashEs.isEqual(value2, _value)) {
11468
+ _setValue(value2);
11469
+ (_a = tableFormRef.current) == null ? void 0 : _a.setData(value2);
11388
11470
  }
11389
- }), [onSubmit, value2]);
11471
+ }, [value2]);
11390
11472
  const renderTextAreaFunc = ({
11391
11473
  value: value22,
11392
- onChange
11474
+ onChange: onChange2
11393
11475
  }) => {
11394
11476
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.TextArea, {
11395
11477
  autoSize: true,
11396
- className: "clsjtk2",
11478
+ className: "c17gq8cd",
11397
11479
  size: "small",
11398
11480
  value: value22,
11399
11481
  onChange: (e2) => {
11400
- onChange(e2.target.value);
11482
+ onChange2(e2.target.value);
11401
11483
  }
11402
11484
  });
11403
11485
  };
11404
11486
  return /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Space, {
11405
11487
  size: 8,
11406
11488
  direction: "vertical",
11407
- className: "cq3mbby",
11489
+ className: "c1n7fiws",
11408
11490
  children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.TableForm, {
11409
11491
  ref: tableFormRef,
11410
- onBodyChange: (value22) => {
11411
- setValue(value22);
11492
+ onBodyChange: (newValue) => {
11493
+ _setValue(newValue);
11494
+ onChange == null ? void 0 : onChange(newValue);
11412
11495
  },
11413
11496
  columns: [{
11414
11497
  key: "key",
@@ -11419,46 +11502,72 @@ function _KeyValueTableFormForm(props, ref) {
11419
11502
  }) => {
11420
11503
  if (!value22)
11421
11504
  return t2("dovetail.key_empty_text");
11505
+ const validate2 = validateKey || validateLabelKey;
11422
11506
  const {
11423
- isValid
11424
- } = validateLabelKey(value22 || "");
11507
+ isValid,
11508
+ errorMessage
11509
+ } = validate2(value22 || "");
11425
11510
  if (!isValid)
11426
- return t2("dovetail.format_error");
11511
+ return errorMessage || t2("dovetail.format_error");
11427
11512
  },
11428
11513
  render: renderTextAreaFunc
11429
11514
  }, {
11430
11515
  key: "value",
11431
- title: t2("dovetail.value_optional"),
11516
+ title: isValueOptional ? t2("dovetail.value_optional") : t2("dovetail.value"),
11432
11517
  type: "input",
11433
11518
  validator: ({
11434
11519
  value: value22
11435
11520
  }) => {
11436
11521
  if (noValueValidation)
11437
11522
  return;
11523
+ const validate2 = validateValue || validateLabelValue;
11438
11524
  const {
11439
- isValid
11440
- } = validateLabelValue(value22 || "");
11525
+ isValid,
11526
+ errorMessage
11527
+ } = validate2(value22 || "", isValueOptional);
11441
11528
  if (!isValid)
11442
- return t2("dovetail.format_error");
11529
+ return errorMessage || t2("dovetail.format_error");
11443
11530
  },
11444
11531
  render: renderTextAreaFunc
11445
11532
  }, ...extraColumns || []],
11446
- disableBatchFilling: true,
11447
- hideEmptyTable: true,
11448
11533
  rowAddConfig: {
11449
11534
  addible: true,
11450
11535
  text: () => addButtonText
11451
11536
  },
11452
11537
  defaultData: defaultValue,
11453
11538
  row: {
11454
- deletable: true
11455
- }
11456
- }), /* @__PURE__ */ common.jsxRuntimeExports.jsx(LabelFormatPopover, {
11539
+ deletable: _value.length > (minSize || 0)
11540
+ },
11541
+ disableBatchFilling: true,
11542
+ hideEmptyTable: true
11543
+ }), isHideLabelFormatPopover ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(LabelFormatPopover, {
11457
11544
  noValueValidation
11458
- })]
11545
+ }), canImportFromFile ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Upload, {
11546
+ multiple: false,
11547
+ showUploadList: false,
11548
+ onChange: async (e2) => {
11549
+ var _a;
11550
+ const fileValue = {
11551
+ key: e2.file.name,
11552
+ value: await readFileAsBase64(e2.file.originFileObj)
11553
+ };
11554
+ let newValue = [..._value, fileValue];
11555
+ if (_value.some((v) => v.key === fileValue.key)) {
11556
+ newValue = _value.map((v) => v.key === fileValue.key ? fileValue : v);
11557
+ }
11558
+ _setValue(newValue);
11559
+ (_a = tableFormRef.current) == null ? void 0 : _a.setData(newValue);
11560
+ onChange == null ? void 0 : onChange(newValue);
11561
+ },
11562
+ children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Button, {
11563
+ type: "link",
11564
+ size: "small",
11565
+ children: t2("dovetail.import_from_file")
11566
+ })
11567
+ }) : null]
11459
11568
  });
11460
11569
  }
11461
- const KeyValueTableFormForm = React.forwardRef(_KeyValueTableFormForm);
11570
+ const KeyValueTableForm = React.forwardRef(_KeyValueTableForm);
11462
11571
  const EditNodeTaintForm_cgov7z = "";
11463
11572
  const UlStyle = "u19jcs7t";
11464
11573
  const EditNodeTaintForm = React.forwardRef(function EditNodeTaintForm2(props, ref) {
@@ -11471,6 +11580,7 @@ const EditNodeTaintForm = React.forwardRef(function EditNodeTaintForm2(props, re
11471
11580
  const {
11472
11581
  t: t2
11473
11582
  } = common.useTranslation();
11583
+ const tableFormRef = React.useRef(null);
11474
11584
  const defaultValue = React.useMemo(() => {
11475
11585
  var _a;
11476
11586
  return ((_a = nodeModel._rawYaml.spec) == null ? void 0 : _a.taints) || [];
@@ -11506,8 +11616,14 @@ const EditNodeTaintForm = React.forwardRef(function EditNodeTaintForm2(props, re
11506
11616
  errorNotification: false
11507
11617
  });
11508
11618
  }, [nodeModel, mutateAsync, t2]);
11509
- return /* @__PURE__ */ common.jsxRuntimeExports.jsx(KeyValueTableFormForm, {
11510
- ref,
11619
+ React.useImperativeHandle(ref, () => ({
11620
+ submit: () => {
11621
+ var _a;
11622
+ return (_a = tableFormRef.current) == null ? void 0 : _a.submit();
11623
+ }
11624
+ }), []);
11625
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(KeyValueTableForm, {
11626
+ ref: tableFormRef,
11511
11627
  defaultValue,
11512
11628
  onSubmit,
11513
11629
  addButtonText: t2("dovetail.add_taint"),
@@ -11784,7 +11900,7 @@ const WorkloadPodsTable = ({
11784
11900
  title: i18n2.t("dovetail.ip_address"),
11785
11901
  sortable: true,
11786
11902
  width: 160
11787
- }, hideNodeColumn ? void 0 : NodeNameColumnRenderer(i18n2), WorkloadImageColumnRenderer(i18n2), PodContainersNumColumnRenderer(i18n2), RestartCountColumnRenderer(i18n2), AgeColumnRenderer(i18n2)].filter((v) => !!v);
11903
+ }, hideNodeColumn ? void 0 : NodeNameColumnRenderer(i18n2), WorkloadImageColumnRenderer(i18n2), PodContainersNumColumnRenderer(i18n2), RestartsColumnRenderer(i18n2), AgeColumnRenderer(i18n2)].filter((v) => !!v);
11788
11904
  const {
11789
11905
  tableProps
11790
11906
  } = useEagleTable({
@@ -12327,7 +12443,7 @@ const PVRefField = (i18n2) => {
12327
12443
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12328
12444
  ResourceLink,
12329
12445
  {
12330
- resourceKind: "persistentvolumes",
12446
+ resourceName: "persistentvolumes",
12331
12447
  namespace: "",
12332
12448
  name: value2
12333
12449
  }
@@ -12341,7 +12457,7 @@ const PVStorageClassField = (i18n2) => {
12341
12457
  path: ["spec", "storageClassName"],
12342
12458
  title: i18n2.t("dovetail.storage_class"),
12343
12459
  renderContent(value2) {
12344
- return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ResourceLink, { resourceKind: "storageclasses", namespace: "", name: value2 });
12460
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ResourceLink, { resourceName: "storageclasses", namespace: "", name: value2 });
12345
12461
  }
12346
12462
  };
12347
12463
  };
@@ -12409,7 +12525,7 @@ const PVCRefField = (i18n2) => {
12409
12525
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12410
12526
  ResourceLink,
12411
12527
  {
12412
- resourceKind: "persistentvolumeclaims",
12528
+ resourceName: "persistentvolumeclaims",
12413
12529
  namespace: pv2.pvcNamespace || "default",
12414
12530
  name: value2,
12415
12531
  uid: pv2.pvcUid
@@ -12699,7 +12815,7 @@ const PodLogTab = (i18n2) => ({
12699
12815
  ]
12700
12816
  });
12701
12817
  const NetworkPolicyRulesViewer_r6jity = "";
12702
- const MonacoYamlEditor$1 = React.lazy(() => Promise.resolve().then(() => require("./MonacoYamlEditor-63a619ee.cjs")));
12818
+ const MonacoYamlEditor$1 = React.lazy(() => Promise.resolve().then(() => require("./MonacoYamlEditor-9b8b7cef.cjs")));
12703
12819
  const EditorStyle$1 = "e1cjl2b8";
12704
12820
  const NetworkPolicyRulesViewer = ({
12705
12821
  ingressOrEgress,
@@ -12776,13 +12892,13 @@ const PodContainersTable = ({
12776
12892
  }
12777
12893
  },
12778
12894
  {
12779
- key: "restartCount",
12780
- dataIndex: ["restartCount"],
12895
+ key: "restarts",
12896
+ dataIndex: ["restarts"],
12781
12897
  title: i18n2.t("dovetail.restarts"),
12782
12898
  sortable: true,
12783
12899
  align: "right",
12784
12900
  width: 120,
12785
- sorter: CommonSorter(["restartCount"])
12901
+ sorter: CommonSorter(["restarts"])
12786
12902
  },
12787
12903
  {
12788
12904
  key: "started",
@@ -15086,18 +15202,26 @@ const NamespacesFilter = ({
15086
15202
  };
15087
15203
  function useNamespaceRefineFilter() {
15088
15204
  const { value: nsFilters = [] } = useNamespacesFilter();
15089
- const filters = React.useMemo(() => ({
15090
- permanent: [
15091
- {
15092
- operator: "or",
15093
- value: nsFilters.filter((filter) => filter !== ALL_NS).map((filter) => ({
15094
- field: "metadata.namespace",
15095
- operator: "eq",
15096
- value: filter
15097
- }))
15098
- }
15099
- ]
15100
- }), [nsFilters]);
15205
+ const filters = React.useMemo(() => {
15206
+ const filters2 = nsFilters.filter((filter) => filter !== ALL_NS);
15207
+ if (filters2.length === 0) {
15208
+ return {
15209
+ permanent: []
15210
+ };
15211
+ }
15212
+ return {
15213
+ permanent: [
15214
+ {
15215
+ operator: "or",
15216
+ value: filters2.map((filter) => ({
15217
+ field: "metadata.namespace",
15218
+ operator: "eq",
15219
+ value: filter
15220
+ }))
15221
+ }
15222
+ ]
15223
+ };
15224
+ }, [nsFilters]);
15101
15225
  return filters;
15102
15226
  }
15103
15227
  const index_1l2xllo = "";
@@ -15262,6 +15386,11 @@ function usePathMap(options) {
15262
15386
  transformApplyValues
15263
15387
  };
15264
15388
  }
15389
+ var FormItemLayout = /* @__PURE__ */ ((FormItemLayout2) => {
15390
+ FormItemLayout2["VERTICAL"] = "VERTICAL";
15391
+ FormItemLayout2["HORIZONTAL"] = "HORIZONTAL";
15392
+ return FormItemLayout2;
15393
+ })(FormItemLayout || {});
15265
15394
  function useFieldsConfig(config, formConfig, resourceId) {
15266
15395
  var _a, _b, _c;
15267
15396
  const action = resourceId ? "edit" : "create";
@@ -15283,7 +15412,8 @@ function useFieldsConfig(config, formConfig, resourceId) {
15283
15412
  action
15284
15413
  });
15285
15414
  }
15286
- const RefineFormContent_ahna8x = "";
15415
+ const RefineFormContent_lnhybh = "";
15416
+ const VerticalFormItemStyle = "v154n7ie";
15287
15417
  function renderCommonFormFiled(props) {
15288
15418
  const {
15289
15419
  field,
@@ -15310,7 +15440,7 @@ function renderCommonFormFiled(props) {
15310
15440
  switch (fieldConfig.type) {
15311
15441
  case "number":
15312
15442
  ele = /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Fields.Integer, {
15313
- className: "c154n7ie",
15443
+ className: "c1c9j4da",
15314
15444
  placeholder: fieldConfig.placeholder,
15315
15445
  input: {
15316
15446
  value: value2,
@@ -15353,7 +15483,7 @@ const RefineFormContent = (props) => {
15353
15483
  control,
15354
15484
  name: fieldConfig.path.join("."),
15355
15485
  rules: {
15356
- validate(value2) {
15486
+ async validate(value2) {
15357
15487
  const formValue = getValues();
15358
15488
  if (!fieldConfig.validators || fieldConfig.validators.length === 0)
15359
15489
  return true;
@@ -15361,7 +15491,7 @@ const RefineFormContent = (props) => {
15361
15491
  const {
15362
15492
  isValid,
15363
15493
  errorMsg
15364
- } = func(value2, formValue, FormType.FORM);
15494
+ } = await func(value2, formValue, FormType.FORM);
15365
15495
  if (!isValid)
15366
15496
  return errorMsg;
15367
15497
  }
@@ -15389,13 +15519,14 @@ const RefineFormContent = (props) => {
15389
15519
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Form.Item, {
15390
15520
  label: fieldConfig.label,
15391
15521
  colon: false,
15392
- labelCol: {
15522
+ labelCol: fieldConfig.layout === FormItemLayout.VERTICAL ? {} : {
15393
15523
  flex: `0 0 ${(formConfig == null ? void 0 : formConfig.labelWidth) || "216px"}`
15394
15524
  },
15395
- help: (_a2 = fieldState.error) == null ? void 0 : _a2.message,
15525
+ help: fieldConfig.isHideErrorStatus ? "" : (_a2 = fieldState.error) == null ? void 0 : _a2.message,
15396
15526
  extra: fieldConfig.helperText,
15397
- validateStatus: fieldState.invalid ? "error" : void 0,
15527
+ validateStatus: fieldState.invalid && !fieldConfig.isHideErrorStatus ? "error" : void 0,
15398
15528
  "data-test-id": fieldConfig.key,
15529
+ className: fieldConfig.layout === FormItemLayout.VERTICAL ? VerticalFormItemStyle : "",
15399
15530
  children: ele
15400
15531
  }, fieldConfig.key);
15401
15532
  }
@@ -15404,7 +15535,7 @@ const RefineFormContent = (props) => {
15404
15535
  return /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Space, {
15405
15536
  direction: "vertical",
15406
15537
  size: 16,
15407
- className: "c1c9j4da",
15538
+ className: "cjxv8cf",
15408
15539
  children: [fields, /* @__PURE__ */ common.jsxRuntimeExports.jsx(FormErrorAlert, {
15409
15540
  errorMsgs: errorMsgs || [],
15410
15541
  style: {
@@ -16123,7 +16254,7 @@ const PlainCodeStyle = "pqch97v";
16123
16254
  const ErrorMsgStyle = "eh2qjnl";
16124
16255
  const ErrorWrapperStyle = "e19q2bnp";
16125
16256
  const YamlEditorStyle = "y16u5v3w";
16126
- const MonacoYamlEditor = React.lazy(() => Promise.resolve().then(() => require("./MonacoYamlEditor-63a619ee.cjs")));
16257
+ const MonacoYamlEditor = React.lazy(() => Promise.resolve().then(() => require("./MonacoYamlEditor-9b8b7cef.cjs")));
16127
16258
  const MonacoYamlDiffEditor = React.lazy(() => Promise.resolve().then(() => require("./MonacoYamlDiffEditor-7a07db88.cjs")));
16128
16259
  const YamlEditorComponent = React.forwardRef(
16129
16260
  function YamlEditorComponent2(props, ref) {
@@ -16648,21 +16779,21 @@ const useYamlForm = ({
16648
16779
  }
16649
16780
  return changeValues;
16650
16781
  };
16651
- const validateRules = (yamlValue) => {
16782
+ const validateRules = async (yamlValue) => {
16652
16783
  const errorMap = {};
16653
16784
  if (rules && isYamlValid && isSchemaValid) {
16654
16785
  const formValue = yaml$2.load(yamlValue || "");
16655
- rules.forEach((rule2) => {
16786
+ for (const rule2 of rules) {
16656
16787
  const { path: path2, validators } = rule2;
16657
16788
  const value2 = lodashEs.get(formValue, path2);
16658
16789
  for (const validator of validators || []) {
16659
- const { isValid, errorMsg } = validator(value2, formValue, FormType.YAML);
16790
+ const { isValid, errorMsg } = await validator(value2, formValue, FormType.YAML);
16660
16791
  if (!isValid) {
16661
16792
  errorMap[path2.join(".")] = `${errorMsg}(${path2.join(".")})`;
16662
16793
  break;
16663
16794
  }
16664
16795
  }
16665
- });
16796
+ }
16666
16797
  }
16667
16798
  setRulesErrors(lodashEs.uniq(Object.values(errorMap)));
16668
16799
  return errorMap;
@@ -16800,7 +16931,7 @@ function YamlForm(props) {
16800
16931
  try {
16801
16932
  const result = await ((_a = formProps.onFinish) == null ? void 0 : _a.call(formProps, store));
16802
16933
  if (result) {
16803
- (_b = props.onFinish) == null ? void 0 : _b.call(props);
16934
+ (_b = props.onFinish) == null ? void 0 : _b.call(props, result);
16804
16935
  }
16805
16936
  } catch {
16806
16937
  } finally {
@@ -16871,20 +17002,21 @@ function RefineFormContainer({
16871
17002
  config,
16872
17003
  id,
16873
17004
  refineProps: {
16874
- onMutationSuccess: () => {
16875
- onSuccess == null ? void 0 : onSuccess();
17005
+ onMutationSuccess: (data2) => {
17006
+ onSuccess == null ? void 0 : onSuccess(data2);
16876
17007
  },
16877
17008
  onMutationError() {
16878
17009
  onError == null ? void 0 : onError();
16879
17010
  },
16880
17011
  redirect: false,
17012
+ mutationMeta: {
17013
+ updateType: "put"
17014
+ },
16881
17015
  ...formConfig == null ? void 0 : formConfig.refineCoreProps
16882
17016
  },
16883
17017
  formConfig
16884
17018
  });
16885
- const {
16886
- transformApplyValues
16887
- } = usePathMap({
17019
+ const { transformApplyValues } = usePathMap({
16888
17020
  pathMap: formConfig == null ? void 0 : formConfig.pathMap,
16889
17021
  transformInitValues: formConfig == null ? void 0 : formConfig.transformInitValues,
16890
17022
  transformApplyValues: (formConfig == null ? void 0 : formConfig.transformApplyValues) || ((v) => v)
@@ -16899,14 +17031,16 @@ function RefineFormContainer({
16899
17031
  initialValuesForCreate: transformApplyValues(
16900
17032
  refineFormResult.formResult.getValues()
16901
17033
  ),
16902
- initialValuesForEdit: transformApplyValues(refineFormResult.formResult.getValues()),
17034
+ initialValuesForEdit: transformApplyValues(
17035
+ refineFormResult.formResult.getValues()
17036
+ ),
16903
17037
  id,
16904
17038
  action,
16905
17039
  isShowLayout: false,
16906
17040
  useFormProps: {
16907
17041
  redirect: false
16908
17042
  },
16909
- rules: fieldsConfig == null ? void 0 : fieldsConfig.map((config2) => ({
17043
+ rules: fieldsConfig == null ? void 0 : fieldsConfig.filter((config2) => !config2.isSkipValidationInYaml).map((config2) => ({
16910
17044
  path: config2.path,
16911
17045
  validators: config2.validators
16912
17046
  })),
@@ -16974,51 +17108,45 @@ function YamlFormContainer({
16974
17108
  onSaveButtonPropsChange
16975
17109
  }) {
16976
17110
  const action = id ? "edit" : "create";
16977
- const {
16978
- transformInitValues,
16979
- transformApplyValues
16980
- } = usePathMap({
17111
+ const { transformInitValues, transformApplyValues } = usePathMap({
16981
17112
  pathMap: formConfig == null ? void 0 : formConfig.pathMap,
16982
17113
  transformInitValues: formConfig == null ? void 0 : formConfig.transformInitValues,
16983
17114
  transformApplyValues: (formConfig == null ? void 0 : formConfig.transformApplyValues) || ((v) => v)
16984
17115
  });
16985
- const yamlFormProps = React.useMemo(
16986
- () => {
16987
- return {
16988
- ...customYamlFormProps,
16989
- config,
16990
- transformInitValues,
16991
- transformApplyValues,
16992
- initialValuesForCreate: (customYamlFormProps == null ? void 0 : customYamlFormProps.initialValuesForCreate) || config.initValue,
16993
- initialValuesForEdit: void 0,
16994
- id,
16995
- action,
16996
- isShowLayout: false,
16997
- useFormProps: {
16998
- redirect: false
16999
- },
17000
- rules: void 0,
17001
- onSaveButtonPropsChange,
17002
- onErrorsChange(errors) {
17003
- if (errors.length) {
17004
- onError == null ? void 0 : onError();
17005
- }
17006
- },
17007
- onFinish: onSuccess
17008
- };
17009
- },
17010
- [
17011
- id,
17012
- action,
17013
- customYamlFormProps,
17116
+ const yamlFormProps = React.useMemo(() => {
17117
+ return {
17118
+ ...customYamlFormProps,
17014
17119
  config,
17015
17120
  transformInitValues,
17016
17121
  transformApplyValues,
17017
- onSuccess,
17018
- onError,
17019
- onSaveButtonPropsChange
17020
- ]
17021
- );
17122
+ initialValuesForCreate: (customYamlFormProps == null ? void 0 : customYamlFormProps.initialValuesForCreate) || config.initValue,
17123
+ initialValuesForEdit: void 0,
17124
+ id,
17125
+ action,
17126
+ isShowLayout: false,
17127
+ useFormProps: {
17128
+ redirect: false
17129
+ },
17130
+ rules: void 0,
17131
+ onSaveButtonPropsChange,
17132
+ onErrorsChange(errors) {
17133
+ if (errors.length) {
17134
+ onError == null ? void 0 : onError();
17135
+ }
17136
+ },
17137
+ onFinish: onSuccess
17138
+ };
17139
+ }, [
17140
+ id,
17141
+ action,
17142
+ customYamlFormProps,
17143
+ config,
17144
+ transformInitValues,
17145
+ transformApplyValues,
17146
+ onSuccess,
17147
+ onError,
17148
+ onSaveButtonPropsChange
17149
+ ]);
17022
17150
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(YamlForm, { ...yamlFormProps });
17023
17151
  }
17024
17152
  const FormModal_64brhp = "";
@@ -17058,7 +17186,8 @@ function FormModal(props) {
17058
17186
  const {
17059
17187
  resource: resourceFromProps,
17060
17188
  id,
17061
- yamlFormProps: customYamlFormProps
17189
+ yamlFormProps: customYamlFormProps,
17190
+ onSuccess
17062
17191
  } = props;
17063
17192
  const {
17064
17193
  i18n: i18n2
@@ -17137,9 +17266,10 @@ function FormModal(props) {
17137
17266
  onError: () => {
17138
17267
  setIsError(true);
17139
17268
  },
17140
- onSuccess: () => {
17269
+ onSuccess: (data2) => {
17141
17270
  setIsError(false);
17142
17271
  popModal();
17272
+ onSuccess == null ? void 0 : onSuccess(data2);
17143
17273
  }
17144
17274
  };
17145
17275
  if (config.formConfig && (((_a2 = config.formConfig) == null ? void 0 : _a2.formType) === FormType.FORM || "fields" in config.formConfig)) {
@@ -17153,7 +17283,7 @@ function FormModal(props) {
17153
17283
  ...commonFormProps,
17154
17284
  formConfig: config.formConfig
17155
17285
  });
17156
- }, [id, customYamlFormProps, config, isYamlMode, popModal, setSaveButtonProps]);
17286
+ }, [id, customYamlFormProps, config, isYamlMode, popModal, setSaveButtonProps, onSuccess]);
17157
17287
  return /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Modal, {
17158
17288
  className: common.cx_default(FullscreenModalStyle),
17159
17289
  style: {
@@ -17326,6 +17456,7 @@ const EditLabelForm = React.forwardRef(
17326
17456
  const { resourceModel } = props;
17327
17457
  const { mutateAsync } = core.useUpdate();
17328
17458
  const { t: t2 } = common.useTranslation();
17459
+ const tableFormRef = React.useRef(null);
17329
17460
  const defaultValue = React.useMemo(() => {
17330
17461
  var _a2;
17331
17462
  return Object.keys(((_a2 = resourceModel.metadata) == null ? void 0 : _a2.labels) || {}).map((key2) => {
@@ -17367,10 +17498,20 @@ const EditLabelForm = React.forwardRef(
17367
17498
  },
17368
17499
  [resourceModel, mutateAsync, t2]
17369
17500
  );
17501
+ React.useImperativeHandle(
17502
+ ref,
17503
+ () => ({
17504
+ submit: () => {
17505
+ var _a2;
17506
+ return (_a2 = tableFormRef.current) == null ? void 0 : _a2.submit();
17507
+ }
17508
+ }),
17509
+ []
17510
+ );
17370
17511
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
17371
- KeyValueTableFormForm,
17512
+ KeyValueTableForm,
17372
17513
  {
17373
- ref,
17514
+ ref: tableFormRef,
17374
17515
  defaultValue,
17375
17516
  onSubmit,
17376
17517
  addButtonText: t2("dovetail.add_label")
@@ -17413,6 +17554,7 @@ const EditAnnotationForm = React.forwardRef(function EditAnnotationForm2(props,
17413
17554
  const { resourceModel } = props;
17414
17555
  const { mutateAsync } = core.useUpdate();
17415
17556
  const { t: t2 } = common.useTranslation();
17557
+ const tableFormRef = React.useRef(null);
17416
17558
  const defaultValue = React.useMemo(() => {
17417
17559
  var _a2;
17418
17560
  return Object.keys(((_a2 = resourceModel.metadata) == null ? void 0 : _a2.annotations) || {}).map((key2) => {
@@ -17454,10 +17596,20 @@ const EditAnnotationForm = React.forwardRef(function EditAnnotationForm2(props,
17454
17596
  },
17455
17597
  [resourceModel, mutateAsync, t2]
17456
17598
  );
17599
+ React.useImperativeHandle(
17600
+ ref,
17601
+ () => ({
17602
+ submit: () => {
17603
+ var _a2;
17604
+ return (_a2 = tableFormRef.current) == null ? void 0 : _a2.submit();
17605
+ }
17606
+ }),
17607
+ []
17608
+ );
17457
17609
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
17458
- KeyValueTableFormForm,
17610
+ KeyValueTableForm,
17459
17611
  {
17460
- ref,
17612
+ ref: tableFormRef,
17461
17613
  defaultValue,
17462
17614
  onSubmit,
17463
17615
  addButtonText: t2("dovetail.add_annotation"),
@@ -17712,7 +17864,7 @@ const ReferenceLink = (props) => {
17712
17864
  ResourceLink,
17713
17865
  {
17714
17866
  name: ownerReference.name,
17715
- resourceKind: resource.name || "",
17867
+ resourceName: resource.name || "",
17716
17868
  namespace: namespace2
17717
17869
  }
17718
17870
  );
@@ -17774,7 +17926,7 @@ const IngressRulesComponent = ({ ingress }) => {
17774
17926
  /* @__PURE__ */ common.jsxRuntimeExports.jsx(
17775
17927
  ResourceLink,
17776
17928
  {
17777
- resourceKind: "services",
17929
+ resourceName: "services",
17778
17930
  namespace: ingress.metadata.namespace || "default",
17779
17931
  name: r2.serviceName
17780
17932
  }
@@ -17828,6 +17980,10 @@ const CommonSorter = (dataIndex) => (a2, b) => {
17828
17980
  const valB = lodashExports.get(b, dataIndex);
17829
17981
  if (valA === valB)
17830
17982
  return 0;
17983
+ if (valA !== void 0 && valB === void 0)
17984
+ return 1;
17985
+ if (valA === void 0 && valB !== void 0)
17986
+ return -1;
17831
17987
  if (valA > valB)
17832
17988
  return 1;
17833
17989
  return -1;
@@ -17912,7 +18068,7 @@ const WorkloadImageColumnRenderer = (i18n2) => {
17912
18068
  }
17913
18069
  };
17914
18070
  };
17915
- const WorkloadRestartsColumnRenderer = (i18n2) => {
18071
+ const RestartsColumnRenderer = (i18n2) => {
17916
18072
  const dataIndex = ["restarts"];
17917
18073
  return {
17918
18074
  key: "restarts",
@@ -17920,7 +18076,14 @@ const WorkloadRestartsColumnRenderer = (i18n2) => {
17920
18076
  width: 120,
17921
18077
  dataIndex,
17922
18078
  align: "right",
17923
- title: i18n2.t("dovetail.restarts")
18079
+ sortable: true,
18080
+ sorter: CommonSorter(dataIndex),
18081
+ title: i18n2.t("dovetail.restarts"),
18082
+ render: (value2) => {
18083
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ValueDisplay, {
18084
+ value: value2
18085
+ });
18086
+ }
17924
18087
  };
17925
18088
  };
17926
18089
  const ReplicasColumnRenderer = (i18n2) => {
@@ -17984,7 +18147,7 @@ const NodeNameColumnRenderer = (i18n2, options) => {
17984
18147
  sorter: CommonSorter(dataIndex),
17985
18148
  render: (v) => {
17986
18149
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ResourceLink, {
17987
- resourceKind: "nodes",
18150
+ resourceName: "nodes",
17988
18151
  name: v,
17989
18152
  namespace: ""
17990
18153
  });
@@ -17992,19 +18155,6 @@ const NodeNameColumnRenderer = (i18n2, options) => {
17992
18155
  ...options
17993
18156
  };
17994
18157
  };
17995
- const RestartCountColumnRenderer = (i18n2) => {
17996
- const dataIndex = ["restartCount"];
17997
- return {
17998
- key: "restartCount",
17999
- display: true,
18000
- dataIndex,
18001
- title: i18n2.t("dovetail.restarts"),
18002
- sortable: true,
18003
- width: 120,
18004
- align: "right",
18005
- sorter: CommonSorter(dataIndex)
18006
- };
18007
- };
18008
18158
  const CompletionsCountColumnRenderer = (i18n2) => {
18009
18159
  const dataIndex = ["succeeded"];
18010
18160
  return {
@@ -18374,7 +18524,7 @@ const PVRefColumnRenderer = (i18n2) => {
18374
18524
  sortable: true,
18375
18525
  render(value2) {
18376
18526
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ResourceLink, {
18377
- resourceKind: "persistentvolumes",
18527
+ resourceName: "persistentvolumes",
18378
18528
  namespace: "",
18379
18529
  name: value2
18380
18530
  });
@@ -18391,7 +18541,7 @@ const PVStorageClassColumnRenderer = (i18n2) => {
18391
18541
  sortable: true,
18392
18542
  render(value2) {
18393
18543
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ResourceLink, {
18394
- resourceKind: "storageclasses",
18544
+ resourceName: "storageclasses",
18395
18545
  namespace: "",
18396
18546
  name: value2
18397
18547
  });
@@ -18424,7 +18574,7 @@ const PVCRefColumnRenderer = (i18n2) => {
18424
18574
  sortable: true,
18425
18575
  render(value2, pv2) {
18426
18576
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ResourceLink, {
18427
- resourceKind: "persistentvolumeclaims",
18577
+ resourceName: "persistentvolumeclaims",
18428
18578
  namespace: pv2.pvcNamespace || "default",
18429
18579
  name: value2,
18430
18580
  uid: pv2.pvcUid
@@ -18802,6 +18952,7 @@ exports.EventsTab = EventsTab;
18802
18952
  exports.EventsTableTabField = EventsTableTabField;
18803
18953
  exports.FormContainerType = FormContainerType;
18804
18954
  exports.FormErrorAlert = FormErrorAlert;
18955
+ exports.FormItemLayout = FormItemLayout;
18805
18956
  exports.FormModal = FormModal;
18806
18957
  exports.FormMode = FormMode;
18807
18958
  exports.FormType = FormType;
@@ -18828,6 +18979,7 @@ exports.KeyValue = KeyValue;
18828
18979
  exports.KeyValueAnnotation = KeyValueAnnotation;
18829
18980
  exports.KeyValueListWidget = KeyValueListWidget;
18830
18981
  exports.KeyValueSecret = KeyValueSecret;
18982
+ exports.KeyValueTableForm = KeyValueTableForm;
18831
18983
  exports.LabelsField = LabelsField;
18832
18984
  exports.Layout = Layout;
18833
18985
  exports.ListPage = ListPage;
@@ -18921,7 +19073,7 @@ exports.ResourceTable = ResourceTable;
18921
19073
  exports.ResourceTableField = ResourceTableField;
18922
19074
  exports.ResourceTableGroup = ResourceTableGroup;
18923
19075
  exports.ResourceUsageBar = ResourceUsageBar;
18924
- exports.RestartCountColumnRenderer = RestartCountColumnRenderer;
19076
+ exports.RestartsColumnRenderer = RestartsColumnRenderer;
18925
19077
  exports.SCAllowExpandColumnRenderer = SCAllowExpandColumnRenderer;
18926
19078
  exports.SCReclaimPolicyColumnRenderer = SCReclaimPolicyColumnRenderer;
18927
19079
  exports.SCReclaimPolicyField = SCReclaimPolicyField;
@@ -18981,7 +19133,6 @@ exports.WorkloadModel = WorkloadModel;
18981
19133
  exports.WorkloadPodsTable = WorkloadPodsTable;
18982
19134
  exports.WorkloadReplicas = WorkloadReplicas;
18983
19135
  exports.WorkloadReplicasForm = WorkloadReplicasForm;
18984
- exports.WorkloadRestartsColumnRenderer = WorkloadRestartsColumnRenderer;
18985
19136
  exports.YamlEditorComponent = YamlEditorComponent;
18986
19137
  exports.YamlEditorStyle = YamlEditorStyle;
18987
19138
  exports.YamlForm = YamlForm;
@@ -18991,6 +19142,7 @@ exports.dovetailRefineI18n = dovetailRefineI18n;
18991
19142
  exports.generateSchemaTypeValue = generateSchemaTypeValue;
18992
19143
  exports.generateValueFromSchema = generateValueFromSchema;
18993
19144
  exports.getApiVersion = getApiVersion;
19145
+ exports.getResourceNameByKind = getResourceNameByKind;
18994
19146
  exports.index = index;
18995
19147
  exports.matchSelector = matchSelector;
18996
19148
  exports.modelPlugin = modelPlugin;
@@ -19015,3 +19167,6 @@ exports.useNamespacesFilter = useNamespacesFilter;
19015
19167
  exports.useOpenForm = useOpenForm;
19016
19168
  exports.useRefineForm = useRefineForm;
19017
19169
  exports.useSchema = useSchema;
19170
+ exports.validateDnsSubdomain = validateDnsSubdomain;
19171
+ exports.validateLabelKey = validateLabelKey;
19172
+ exports.validateLabelValue = validateLabelValue;