@dovetail-v2/refine 0.1.11 → 0.1.13

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.
@@ -1575,6 +1575,12 @@ var __publicField = (obj, key, value) => {
1575
1575
  const name_format_rule_1 = "由字母、数字、连字符 (-)、下划线(_) 或点 (.) 组成";
1576
1576
  const name_format_rule_2 = "以字母或数字开头和结尾";
1577
1577
  const name_format_rule_3 = "不超过 63 个字符";
1578
+ const taint_effect_NoSchedule_tooltip_1 = "正在节点上运行的 Pod 不会被驱逐。";
1579
+ const taint_effect_NoSchedule_tooltip_2 = "新 Pod 不会调度到污点节点,除非有匹配的容忍度。";
1580
+ const taint_effect_PreferNoSchedule_tooltip_1 = "不容忍污点的 Pod 将被立即驱逐。";
1581
+ const taint_effect_PreferNoSchedule_tooltip_2 = "容忍污点但未设置容忍时长的 Pod 将继续运行。";
1582
+ const taint_effect_PreferNoSchedule_tooltip_3 = "容忍污点并设置了容忍时长的 Pod 将按指定时间运行,时间结束后被驱逐。";
1583
+ const taint_effect_NoExecute_tooltip_3 = "控制平面将尝试避免将不能容忍污点的 Pod 调度到节点上,但无法保证完全避免。";
1578
1584
  const dovetail = {
1579
1585
  copy: copy$1,
1580
1586
  reset_arguments,
@@ -1802,7 +1808,13 @@ var __publicField = (obj, key, value) => {
1802
1808
  suffix_format_rule_3,
1803
1809
  name_format_rule_1,
1804
1810
  name_format_rule_2,
1805
- name_format_rule_3
1811
+ name_format_rule_3,
1812
+ taint_effect_NoSchedule_tooltip_1,
1813
+ taint_effect_NoSchedule_tooltip_2,
1814
+ taint_effect_PreferNoSchedule_tooltip_1,
1815
+ taint_effect_PreferNoSchedule_tooltip_2,
1816
+ taint_effect_PreferNoSchedule_tooltip_3,
1817
+ taint_effect_NoExecute_tooltip_3
1806
1818
  };
1807
1819
  const ZH = {
1808
1820
  dovetail
@@ -8195,6 +8207,9 @@ var __publicField = (obj, key, value) => {
8195
8207
  }
8196
8208
  // Fetch and process OpenAPI schemas
8197
8209
  async fetch() {
8210
+ if (this.schemas) {
8211
+ return this.schemas;
8212
+ }
8198
8213
  try {
8199
8214
  const response = await fetch(
8200
8215
  `${this.pathPrefix}${this.resourceBasePath}`
@@ -8242,6 +8257,24 @@ var __publicField = (obj, key, value) => {
8242
8257
  });
8243
8258
  }
8244
8259
  }
8260
+ class SchemaStore {
8261
+ constructor() {
8262
+ __publicField(this, "openapiMap", {});
8263
+ }
8264
+ async fetchSchemas(resourceBasePath, pathPrefix) {
8265
+ const openapi = this.openapiMap[`${resourceBasePath}-${pathPrefix}`] || new K8sOpenAPI(resourceBasePath, pathPrefix);
8266
+ this.openapiMap[`${resourceBasePath}-${pathPrefix}`] = openapi;
8267
+ const schemas = await openapi.fetch();
8268
+ return schemas;
8269
+ }
8270
+ async fetchSchema(resourceBasePath, pathPrefix, kind) {
8271
+ const openapi = this.openapiMap[`${resourceBasePath}-${pathPrefix}`] || new K8sOpenAPI(resourceBasePath, pathPrefix);
8272
+ this.openapiMap[`${resourceBasePath}-${pathPrefix}`] = openapi;
8273
+ await openapi.fetch();
8274
+ return openapi.findSchema(kind);
8275
+ }
8276
+ }
8277
+ const schemaStore = new SchemaStore();
8245
8278
  const ConstantsContext = React.createContext({
8246
8279
  schemaUrlPrefix: ""
8247
8280
  });
@@ -8260,8 +8293,7 @@ var __publicField = (obj, key, value) => {
8260
8293
  if (state2.schemasMap[apiGroup]) {
8261
8294
  return { apiGroup, schemas: state2.schemasMap[apiGroup] };
8262
8295
  }
8263
- const openapi = new K8sOpenAPI(apiGroup, schemaUrlPrefix);
8264
- const groupSchemas = await openapi.fetch();
8296
+ const groupSchemas = await schemaStore.fetchSchemas(apiGroup, schemaUrlPrefix);
8265
8297
  return { apiGroup, schemas: groupSchemas || [] };
8266
8298
  })
8267
8299
  );
@@ -8290,20 +8322,12 @@ var __publicField = (obj, key, value) => {
8290
8322
  const useResourceResult = core.useResource();
8291
8323
  const resource = (options == null ? void 0 : options.resource) || useResourceResult.resource;
8292
8324
  const { schemaUrlPrefix } = React.useContext(ConstantsContext);
8293
- const openapi = React.useMemo(
8294
- () => {
8295
- var _a2;
8296
- return new K8sOpenAPI((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.resourceBasePath, schemaUrlPrefix);
8297
- },
8298
- [(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.resourceBasePath, schemaUrlPrefix]
8299
- );
8300
8325
  const fetchSchema = React.useCallback(async () => {
8301
- var _a2;
8326
+ var _a2, _b2;
8302
8327
  setLoading(true);
8303
8328
  setError(null);
8304
8329
  try {
8305
- await openapi.fetch();
8306
- const schema2 = await openapi.findSchema((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.kind);
8330
+ const schema2 = await schemaStore.fetchSchema((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.resourceBasePath, schemaUrlPrefix, (_b2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _b2.kind);
8307
8331
  setSchema(schema2 || null);
8308
8332
  setError(null);
8309
8333
  } catch (e2) {
@@ -8311,7 +8335,7 @@ var __publicField = (obj, key, value) => {
8311
8335
  } finally {
8312
8336
  setLoading(false);
8313
8337
  }
8314
- }, [(_b = resource == null ? void 0 : resource.meta) == null ? void 0 : _b.kind, openapi]);
8338
+ }, [(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.kind, (_b = resource == null ? void 0 : resource.meta) == null ? void 0 : _b.resourceBasePath, schemaUrlPrefix]);
8315
8339
  React.useEffect(() => {
8316
8340
  if (options == null ? void 0 : options.skip)
8317
8341
  return;
@@ -8936,11 +8960,6 @@ var __publicField = (obj, key, value) => {
8936
8960
  } = props;
8937
8961
  const auxiliaryLineRef = React.useRef(null);
8938
8962
  const wrapperRef = React.useRef(null);
8939
- React.useMemo(() => ({
8940
- current: currentPage,
8941
- pageSize: defaultSize,
8942
- onChange: onPageChange
8943
- }), [currentPage, defaultSize, onPageChange]);
8944
8963
  const finalColumns = React.useMemo(() => {
8945
8964
  if (RowMenu) {
8946
8965
  const actionColumn = {
@@ -9538,10 +9557,8 @@ var __publicField = (obj, key, value) => {
9538
9557
  distributeStorage: validators.distributeStorage(v)
9539
9558
  });
9540
9559
  },
9541
- onBlur: () => {
9542
- },
9543
- onFocus: () => {
9544
- }
9560
+ onBlur: () => void 0,
9561
+ onFocus: () => void 0
9545
9562
  },
9546
9563
  min: 1,
9547
9564
  meta: {},
@@ -11563,7 +11580,7 @@ var __publicField = (obj, key, value) => {
11563
11580
  width: 120,
11564
11581
  render(value2) {
11565
11582
  const colorMap = {
11566
- "Warning": "red",
11583
+ "Warning": "warning",
11567
11584
  "Normal": "green"
11568
11585
  };
11569
11586
  return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.StatusCapsule, { color: colorMap[value2], className: cx_default(StateTagStyle, "no-background"), children: i18n2.t(`dovetail.${value2.toLowerCase()}`) });
@@ -12164,40 +12181,413 @@ var __publicField = (obj, key, value) => {
12164
12181
  })
12165
12182
  });
12166
12183
  }
12167
- const NodeTaintsTable = ({ taints = [] }) => {
12168
- const { t: t2 } = useTranslation();
12169
- const component = React.useContext(ComponentContext);
12170
- const Table2 = component.Table || Table$1;
12171
- const taintsWithId = addId(taints, "key");
12172
- const columns = [
12173
- {
12174
- key: "key",
12175
- display: true,
12176
- dataIndex: "key",
12177
- title: t2("dovetail.key"),
12178
- width: 120,
12179
- sortable: true
12180
- },
12181
- {
12182
- key: "value",
12183
- display: true,
12184
- dataIndex: "value",
12185
- title: t2("dovetail.value"),
12186
- width: 120,
12187
- sortable: true
12188
- },
12189
- {
12184
+ function validateLabelKey(key2) {
12185
+ const labelPrefixRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.]*[a-zA-Z0-9]$)/;
12186
+ const labelNameRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
12187
+ let prefix, name2;
12188
+ const splitResult = key2.split("/");
12189
+ if (splitResult.length === 1) {
12190
+ name2 = splitResult[0];
12191
+ } else {
12192
+ prefix = splitResult[0];
12193
+ name2 = splitResult[1];
12194
+ }
12195
+ if (prefix === "") {
12196
+ return { isValid: false, errorMessage: "EMPTY_PREFIX" };
12197
+ }
12198
+ if (prefix && !labelPrefixRegex.test(prefix)) {
12199
+ return { isValid: false, errorMessage: "INVALID_PREFIX" };
12200
+ }
12201
+ if (!labelNameRegex.test(name2)) {
12202
+ return { isValid: false, errorMessage: "INVALID_NAME" };
12203
+ }
12204
+ if (prefix && prefix.length > 253) {
12205
+ return { isValid: false, errorMessage: "MAX_253" };
12206
+ }
12207
+ if (name2 && name2.length > 63) {
12208
+ return { isValid: false, errorMessage: "MAX_63" };
12209
+ }
12210
+ return { isValid: true };
12211
+ }
12212
+ function validateLabelValue(value2) {
12213
+ const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
12214
+ if (value2 === "") {
12215
+ return { isValid: true };
12216
+ }
12217
+ if (value2.length > 63) {
12218
+ return { isValid: false, errorMessage: "MAX_63" };
12219
+ }
12220
+ if (!labelValueRegex.test(value2)) {
12221
+ return { isValid: false, errorMessage: "INVALID_VALUE" };
12222
+ }
12223
+ return { isValid: true };
12224
+ }
12225
+ const LabelFormatPopover_105yfzn = "";
12226
+ const PodLabelFormatRulePopoverStyle = "p5jt6nm";
12227
+ const LabelFormatPopover = () => {
12228
+ const {
12229
+ t: t2
12230
+ } = useTranslation();
12231
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Popover, {
12232
+ overlayClassName: PodLabelFormatRulePopoverStyle,
12233
+ placement: "bottomRight",
12234
+ content: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.AntdTable, {
12235
+ bordered: true,
12236
+ dataSource: [{
12237
+ object: t2("dovetail.key"),
12238
+ contains: t2("dovetail.suffix"),
12239
+ optional: t2("dovetail.no"),
12240
+ rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
12241
+ }, {
12242
+ object: t2("dovetail.key"),
12243
+ contains: t2("dovetail.name"),
12244
+ optional: t2("dovetail.yes"),
12245
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12246
+ }, {
12247
+ object: t2("dovetail.value"),
12248
+ contains: t2("dovetail.name"),
12249
+ optional: t2("dovetail.no"),
12250
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
12251
+ }],
12252
+ columns: [{
12253
+ key: "object",
12254
+ title: t2("dovetail.object"),
12255
+ dataIndex: "object",
12256
+ render: (cell, record, index2) => {
12257
+ return {
12258
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
12259
+ className: eagle.Typo.Label.l4_bold,
12260
+ children: cell
12261
+ }),
12262
+ props: {
12263
+ rowSpan: index2 === 0 ? 2 : index2 === 1 ? 0 : 1
12264
+ }
12265
+ };
12266
+ }
12267
+ }, {
12268
+ key: "contains",
12269
+ title: t2("dovetail.contains"),
12270
+ dataIndex: "contains"
12271
+ }, {
12272
+ key: "optional",
12273
+ title: t2("dovetail.optional"),
12274
+ dataIndex: "optional"
12275
+ }, {
12276
+ key: "rule",
12277
+ title: t2("dovetail.format_requirements"),
12278
+ dataIndex: "rule",
12279
+ render: (cell) => {
12280
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
12281
+ className: "rule-list",
12282
+ children: cell.map((rule2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
12283
+ children: rule2
12284
+ }, index2))
12285
+ });
12286
+ }
12287
+ }],
12288
+ pagination: false
12289
+ }),
12290
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Button, {
12291
+ size: "small",
12292
+ type: "link",
12293
+ children: t2("dovetail.look_format_requirement")
12294
+ })
12295
+ });
12296
+ };
12297
+ const KeyValueTableForm_1eydq7y = "";
12298
+ function _KeyValueTableFormForm(props, ref) {
12299
+ const {
12300
+ defaultValue,
12301
+ onSubmit,
12302
+ extraColumns,
12303
+ addButtonText
12304
+ } = props;
12305
+ const {
12306
+ t: t2
12307
+ } = useTranslation();
12308
+ const [value2, setValue] = React.useState([]);
12309
+ const tableFormRef = React.useRef(null);
12310
+ React.useImperativeHandle(ref, () => ({
12311
+ submit: () => {
12312
+ return new Promise((res, rej) => {
12313
+ var _a;
12314
+ (_a = tableFormRef.current) == null ? void 0 : _a.validateWholeFields();
12315
+ setTimeout(() => {
12316
+ var _a2;
12317
+ const isValid = (_a2 = tableFormRef.current) == null ? void 0 : _a2.isValid();
12318
+ if (isValid) {
12319
+ res(onSubmit(value2));
12320
+ } else {
12321
+ rej();
12322
+ }
12323
+ }, 0);
12324
+ });
12325
+ }
12326
+ }), [onSubmit, value2]);
12327
+ const renderTextAreaFunc = ({
12328
+ value: value22,
12329
+ onChange
12330
+ }) => {
12331
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.TextArea, {
12332
+ autoSize: true,
12333
+ className: "clsjtk2",
12334
+ size: "small",
12335
+ value: value22,
12336
+ onChange: (e2) => {
12337
+ onChange(e2.target.value);
12338
+ }
12339
+ });
12340
+ };
12341
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(eagle.Space, {
12342
+ size: 8,
12343
+ direction: "vertical",
12344
+ className: "cq3mbby",
12345
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx(eagle.TableForm, {
12346
+ ref: tableFormRef,
12347
+ onBodyChange: (value22) => {
12348
+ setValue(value22);
12349
+ },
12350
+ columns: [{
12351
+ key: "key",
12352
+ title: t2("dovetail.key"),
12353
+ type: "input",
12354
+ validator: ({
12355
+ value: value22
12356
+ }) => {
12357
+ if (!value22)
12358
+ return t2("dovetail.key_empty_text");
12359
+ const {
12360
+ isValid
12361
+ } = validateLabelKey(value22 || "");
12362
+ if (!isValid)
12363
+ return t2("dovetail.format_error");
12364
+ },
12365
+ render: renderTextAreaFunc
12366
+ }, {
12367
+ key: "value",
12368
+ title: t2("dovetail.value_optional"),
12369
+ type: "input",
12370
+ validator: ({
12371
+ value: value22
12372
+ }) => {
12373
+ const {
12374
+ isValid
12375
+ } = validateLabelValue(value22 || "");
12376
+ if (!isValid)
12377
+ return t2("dovetail.format_error");
12378
+ },
12379
+ render: renderTextAreaFunc
12380
+ }, ...extraColumns || []],
12381
+ disableBatchFilling: true,
12382
+ hideEmptyTable: true,
12383
+ rowAddConfig: {
12384
+ addible: true,
12385
+ text: () => addButtonText
12386
+ },
12387
+ defaultData: defaultValue,
12388
+ row: {
12389
+ deletable: true
12390
+ }
12391
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {})]
12392
+ });
12393
+ }
12394
+ const KeyValueTableFormForm = React.forwardRef(_KeyValueTableFormForm);
12395
+ const EditNodeTaintForm_cgov7z = "";
12396
+ const UlStyle = "u19jcs7t";
12397
+ const EditNodeTaintForm = React.forwardRef(function EditNodeTaintForm2(props, ref) {
12398
+ const {
12399
+ nodeModel
12400
+ } = props;
12401
+ const {
12402
+ mutateAsync
12403
+ } = core.useUpdate();
12404
+ const {
12405
+ t: t2
12406
+ } = useTranslation();
12407
+ const defaultValue = React.useMemo(() => {
12408
+ var _a;
12409
+ return ((_a = nodeModel._rawYaml.spec) == null ? void 0 : _a.taints) || [];
12410
+ }, [nodeModel]);
12411
+ const onSubmit = React.useCallback((_value) => {
12412
+ const value2 = _value;
12413
+ const newYaml = nodeModel._globalStore.restoreItem(nodeModel);
12414
+ if (newYaml.spec) {
12415
+ newYaml.spec.taints = value2;
12416
+ }
12417
+ pruneBeforeEdit(newYaml);
12418
+ return mutateAsync({
12419
+ id: nodeModel.id,
12420
+ resource: nodeModel.name || "",
12421
+ values: newYaml,
12422
+ meta: {
12423
+ resourceBasePath: nodeModel.apiVersion,
12424
+ kind: nodeModel.kind
12425
+ },
12426
+ successNotification() {
12427
+ return {
12428
+ message: t2("dovetail.edit_node_taint_success_toast", {
12429
+ kind: nodeModel.kind,
12430
+ name: nodeModel.metadata.name,
12431
+ interpolation: {
12432
+ escapeValue: false
12433
+ }
12434
+ }),
12435
+ type: "success"
12436
+ };
12437
+ },
12438
+ errorNotification: false
12439
+ });
12440
+ }, [nodeModel, mutateAsync, t2]);
12441
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueTableFormForm, {
12442
+ ref,
12443
+ defaultValue,
12444
+ onSubmit,
12445
+ addButtonText: t2("dovetail.add_taint"),
12446
+ extraColumns: [{
12190
12447
  key: "effect",
12191
- display: true,
12192
- dataIndex: "effect",
12193
12448
  title: t2("dovetail.effect"),
12194
- width: 120,
12195
- sortable: true,
12196
- render: (value2) => {
12197
- return t2(`dovetail.node_taint_${value2}`);
12449
+ render: ({
12450
+ value: value2,
12451
+ onChange
12452
+ }) => {
12453
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Select, {
12454
+ input: {},
12455
+ value: value2,
12456
+ onChange,
12457
+ size: "small",
12458
+ children: eagle.getOptions([{
12459
+ value: "NoSchedule",
12460
+ children: t2(`dovetail.node_taint_${"NoSchedule"}`),
12461
+ suffix: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Tooltip, {
12462
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(TaintEffectTooltip, {
12463
+ effect: "NoSchedule"
12464
+ /* NoSchedule */
12465
+ }),
12466
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, {
12467
+ src: iconsReact.InfoICircleFill16GrayIcon,
12468
+ hoverSrc: iconsReact.InfoICircleFill16Gray70Icon
12469
+ })
12470
+ })
12471
+ }, {
12472
+ value: "PreferNoSchedule",
12473
+ children: t2(`dovetail.node_taint_${"PreferNoSchedule"}`),
12474
+ suffix: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Tooltip, {
12475
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(TaintEffectTooltip, {
12476
+ effect: "PreferNoSchedule"
12477
+ /* PreferNoSchedule */
12478
+ }),
12479
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, {
12480
+ src: iconsReact.InfoICircleFill16GrayIcon,
12481
+ hoverSrc: iconsReact.InfoICircleFill16Gray70Icon
12482
+ })
12483
+ })
12484
+ }, {
12485
+ value: "NoExecute",
12486
+ children: t2(`dovetail.node_taint_${"NoExecute"}`),
12487
+ suffix: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Tooltip, {
12488
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(TaintEffectTooltip, {
12489
+ effect: "NoExecute"
12490
+ /* NoExecute */
12491
+ }),
12492
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, {
12493
+ src: iconsReact.InfoICircleFill16GrayIcon,
12494
+ hoverSrc: iconsReact.InfoICircleFill16Gray70Icon
12495
+ })
12496
+ })
12497
+ }])
12498
+ });
12499
+ },
12500
+ validator: ({
12501
+ value: value2
12502
+ }) => {
12503
+ if (!value2)
12504
+ return t2("dovetail.taint_effect_empty_text");
12198
12505
  }
12506
+ }]
12507
+ });
12508
+ });
12509
+ const TaintEffectTooltip = ({
12510
+ effect: effect2
12511
+ }) => {
12512
+ const {
12513
+ t: t2
12514
+ } = useTranslation();
12515
+ const TaintEffectTooltipTextConfig = {
12516
+ [
12517
+ "NoSchedule"
12518
+ /* NoSchedule */
12519
+ ]: {
12520
+ title: "NoSchedule",
12521
+ tooltips: [t2("dovetail.taint_effect_NoSchedule_tooltip_1"), t2("dovetail.taint_effect_NoSchedule_tooltip_2")]
12522
+ },
12523
+ [
12524
+ "PreferNoSchedule"
12525
+ /* PreferNoSchedule */
12526
+ ]: {
12527
+ title: "PreferNoSchedule",
12528
+ tooltips: [t2("dovetail.taint_effect_PreferNoSchedule_tooltip_1"), t2("dovetail.taint_effect_PreferNoSchedule_tooltip_2"), t2("dovetail.taint_effect_PreferNoSchedule_tooltip_3")]
12529
+ },
12530
+ [
12531
+ "NoExecute"
12532
+ /* NoExecute */
12533
+ ]: {
12534
+ title: "NoExecute",
12535
+ tooltips: [t2("dovetail.taint_effect_NoExecute_tooltip_3")]
12199
12536
  }
12200
- ];
12537
+ };
12538
+ const config = TaintEffectTooltipTextConfig[effect2];
12539
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
12540
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("b", {
12541
+ children: config.title
12542
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
12543
+ className: UlStyle,
12544
+ children: config.tooltips.map((tooltip, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
12545
+ children: tooltip
12546
+ }, index2))
12547
+ })]
12548
+ });
12549
+ };
12550
+ const NodeTaintsTable_wrxeox = "";
12551
+ const EffectStyle = "evoxbc1";
12552
+ const NodeTaintsTable = ({
12553
+ taints = []
12554
+ }) => {
12555
+ const {
12556
+ t: t2
12557
+ } = useTranslation();
12558
+ const component = React.useContext(ComponentContext);
12559
+ const Table2 = component.Table || Table$1;
12560
+ const taintsWithId = addId(taints, "key");
12561
+ const columns = [{
12562
+ key: "key",
12563
+ display: true,
12564
+ dataIndex: "key",
12565
+ title: t2("dovetail.key"),
12566
+ sortable: true
12567
+ }, {
12568
+ key: "value",
12569
+ display: true,
12570
+ dataIndex: "value",
12571
+ title: t2("dovetail.value"),
12572
+ sortable: true
12573
+ }, {
12574
+ key: "effect",
12575
+ display: true,
12576
+ dataIndex: "effect",
12577
+ title: t2("dovetail.effect"),
12578
+ sortable: true,
12579
+ render: (value2) => {
12580
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Tooltip, {
12581
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(TaintEffectTooltip, {
12582
+ effect: value2
12583
+ }),
12584
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
12585
+ className: EffectStyle,
12586
+ children: t2(`dovetail.node_taint_${value2}`)
12587
+ })
12588
+ });
12589
+ }
12590
+ }];
12201
12591
  const {
12202
12592
  data: finalData,
12203
12593
  currentPage,
@@ -12206,40 +12596,34 @@ var __publicField = (obj, key, value) => {
12206
12596
  } = useTableData({
12207
12597
  data: taintsWithId,
12208
12598
  columns,
12209
- defaultSorters: [
12210
- {
12211
- field: "lastUpdateTime",
12212
- order: "desc"
12213
- }
12214
- ]
12599
+ defaultSorters: [{
12600
+ field: "lastUpdateTime",
12601
+ order: "desc"
12602
+ }]
12215
12603
  });
12216
12604
  const currentSize = 10;
12217
12605
  if (taintsWithId.length === 0) {
12218
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12219
- WidgetErrorContent,
12220
- {
12221
- errorText: t2("dovetail.no_resource", { kind: t2("dovetail.taint") }),
12222
- type: ErrorContentType.Card
12223
- }
12224
- );
12606
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent, {
12607
+ errorText: t2("dovetail.no_resource", {
12608
+ kind: t2("dovetail.taint")
12609
+ }),
12610
+ type: ErrorContentType.Card
12611
+ });
12225
12612
  }
12226
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
12227
- Table2,
12228
- {
12229
- tableKey: "condition",
12230
- loading: false,
12231
- data: finalData,
12232
- total: taintsWithId.length,
12233
- columns: addDefaultRenderToColumns(columns),
12234
- rowKey: "key",
12235
- empty: t2("dovetail.empty"),
12236
- defaultSize: currentSize,
12237
- currentPage,
12238
- onPageChange,
12239
- onSorterChange,
12240
- showMenuColumn: false
12241
- }
12242
- );
12613
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Table2, {
12614
+ tableKey: "condition",
12615
+ loading: false,
12616
+ data: finalData,
12617
+ total: taintsWithId.length,
12618
+ columns: addDefaultRenderToColumns(columns),
12619
+ rowKey: "key",
12620
+ empty: t2("dovetail.empty"),
12621
+ defaultSize: currentSize,
12622
+ currentPage,
12623
+ onPageChange,
12624
+ onSorterChange,
12625
+ showMenuColumn: false
12626
+ });
12243
12627
  };
12244
12628
  function PVVolumeModeDisplay(props) {
12245
12629
  const { value: value2 } = props;
@@ -18612,7 +18996,6 @@ var __publicField = (obj, key, value) => {
18612
18996
  const [currentItemCount, setCurrentItemCount] = React.useState(0);
18613
18997
  const [paused, setPaused] = React.useState(false);
18614
18998
  const [wrap, setWrap] = React.useState(false);
18615
- const [linesBehind, setLinesBehind] = React.useState(0);
18616
18999
  const logViewerRef = React.useRef(null);
18617
19000
  const abortControllerRef = React.useRef(null);
18618
19001
  const dataProvider = core.useDataProvider();
@@ -18626,10 +19009,6 @@ var __publicField = (obj, key, value) => {
18626
19009
  if (logViewerRef && logViewerRef.current) {
18627
19010
  logViewerRef.current.scrollToBottom();
18628
19011
  }
18629
- } else if (logs.length !== currentItemCount) {
18630
- setLinesBehind(logs.length - currentItemCount);
18631
- } else {
18632
- setLinesBehind(0);
18633
19012
  }
18634
19013
  }, [paused, logs, currentItemCount]);
18635
19014
  const onScroll = (params) => {
@@ -18748,7 +19127,6 @@ var __publicField = (obj, key, value) => {
18748
19127
  setSelectedContainer(newValue);
18749
19128
  setLogs([]);
18750
19129
  setPaused(false);
18751
- setLinesBehind(0);
18752
19130
  },
18753
19131
  value: selectedContainer
18754
19132
  },
@@ -39062,218 +39440,6 @@ WARNING: This link could potentially be dangerous`)) {
39062
39440
  }
39063
39441
  ) : null });
39064
39442
  }
39065
- function validateLabelKey(key2) {
39066
- const labelPrefixRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.]*[a-zA-Z0-9]$)/;
39067
- const labelNameRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
39068
- let prefix, name2;
39069
- const splitResult = key2.split("/");
39070
- if (splitResult.length === 1) {
39071
- name2 = splitResult[0];
39072
- } else {
39073
- prefix = splitResult[0];
39074
- name2 = splitResult[1];
39075
- }
39076
- if (prefix === "") {
39077
- return { isValid: false, errorMessage: "EMPTY_PREFIX" };
39078
- }
39079
- if (prefix && !labelPrefixRegex.test(prefix)) {
39080
- return { isValid: false, errorMessage: "INVALID_PREFIX" };
39081
- }
39082
- if (!labelNameRegex.test(name2)) {
39083
- return { isValid: false, errorMessage: "INVALID_NAME" };
39084
- }
39085
- if (prefix && prefix.length > 253) {
39086
- return { isValid: false, errorMessage: "MAX_253" };
39087
- }
39088
- if (name2 && name2.length > 63) {
39089
- return { isValid: false, errorMessage: "MAX_63" };
39090
- }
39091
- return { isValid: true };
39092
- }
39093
- function validateLabelValue(value2) {
39094
- const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
39095
- if (value2 === "") {
39096
- return { isValid: true };
39097
- }
39098
- if (value2.length > 63) {
39099
- return { isValid: false, errorMessage: "MAX_63" };
39100
- }
39101
- if (!labelValueRegex.test(value2)) {
39102
- return { isValid: false, errorMessage: "INVALID_VALUE" };
39103
- }
39104
- return { isValid: true };
39105
- }
39106
- const LabelFormatPopover_105yfzn = "";
39107
- const PodLabelFormatRulePopoverStyle = "p5jt6nm";
39108
- const LabelFormatPopover = () => {
39109
- const {
39110
- t: t2
39111
- } = useTranslation();
39112
- return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Popover, {
39113
- overlayClassName: PodLabelFormatRulePopoverStyle,
39114
- placement: "bottomRight",
39115
- content: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.AntdTable, {
39116
- bordered: true,
39117
- dataSource: [{
39118
- object: t2("dovetail.key"),
39119
- contains: t2("dovetail.suffix"),
39120
- optional: t2("dovetail.no"),
39121
- rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
39122
- }, {
39123
- object: t2("dovetail.key"),
39124
- contains: t2("dovetail.name"),
39125
- optional: t2("dovetail.yes"),
39126
- rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
39127
- }, {
39128
- object: t2("dovetail.value"),
39129
- contains: t2("dovetail.name"),
39130
- optional: t2("dovetail.no"),
39131
- rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
39132
- }],
39133
- columns: [{
39134
- key: "object",
39135
- title: t2("dovetail.object"),
39136
- dataIndex: "object",
39137
- render: (cell, record, index2) => {
39138
- return {
39139
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
39140
- className: eagle.Typo.Label.l4_bold,
39141
- children: cell
39142
- }),
39143
- props: {
39144
- rowSpan: index2 === 0 ? 2 : index2 === 1 ? 0 : 1
39145
- }
39146
- };
39147
- }
39148
- }, {
39149
- key: "contains",
39150
- title: t2("dovetail.contains"),
39151
- dataIndex: "contains"
39152
- }, {
39153
- key: "optional",
39154
- title: t2("dovetail.optional"),
39155
- dataIndex: "optional"
39156
- }, {
39157
- key: "rule",
39158
- title: t2("dovetail.format_requirements"),
39159
- dataIndex: "rule",
39160
- render: (cell) => {
39161
- return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
39162
- className: "rule-list",
39163
- children: cell.map((rule2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
39164
- children: rule2
39165
- }, index2))
39166
- });
39167
- }
39168
- }],
39169
- pagination: false
39170
- }),
39171
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Button, {
39172
- size: "small",
39173
- type: "link",
39174
- children: t2("dovetail.look_format_requirement")
39175
- })
39176
- });
39177
- };
39178
- const KeyValueTableForm_1eydq7y = "";
39179
- function _KeyValueTableFormForm(props, ref) {
39180
- const {
39181
- defaultValue,
39182
- onSubmit,
39183
- extraColumns,
39184
- addButtonText
39185
- } = props;
39186
- const {
39187
- t: t2
39188
- } = useTranslation();
39189
- const [value2, setValue] = React.useState([]);
39190
- const tableFormRef = React.useRef(null);
39191
- React.useImperativeHandle(ref, () => ({
39192
- submit: () => {
39193
- return new Promise((res, rej) => {
39194
- var _a;
39195
- (_a = tableFormRef.current) == null ? void 0 : _a.validateWholeFields();
39196
- setTimeout(() => {
39197
- var _a2;
39198
- const isValid = (_a2 = tableFormRef.current) == null ? void 0 : _a2.isValid();
39199
- if (isValid) {
39200
- res(onSubmit(value2));
39201
- } else {
39202
- rej();
39203
- }
39204
- }, 0);
39205
- });
39206
- }
39207
- }), [onSubmit, value2]);
39208
- const renderTextAreaFunc = ({
39209
- value: value22,
39210
- onChange
39211
- }) => {
39212
- return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.TextArea, {
39213
- autoSize: true,
39214
- className: "clsjtk2",
39215
- size: "small",
39216
- value: value22,
39217
- onChange: (e2) => {
39218
- onChange(e2.target.value);
39219
- }
39220
- });
39221
- };
39222
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(eagle.Space, {
39223
- size: 8,
39224
- direction: "vertical",
39225
- className: "cq3mbby",
39226
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx(eagle.TableForm, {
39227
- ref: tableFormRef,
39228
- onBodyChange: (value22) => {
39229
- setValue(value22);
39230
- },
39231
- columns: [{
39232
- key: "key",
39233
- title: t2("dovetail.key"),
39234
- type: "input",
39235
- validator: ({
39236
- value: value22
39237
- }) => {
39238
- if (!value22)
39239
- return t2("dovetail.key_empty_text");
39240
- const {
39241
- isValid,
39242
- errorMessage
39243
- } = validateLabelKey(value22 || "");
39244
- if (!isValid)
39245
- return t2("dovetail.format_error");
39246
- },
39247
- render: renderTextAreaFunc
39248
- }, {
39249
- key: "value",
39250
- title: t2("dovetail.value_optional"),
39251
- type: "input",
39252
- validator: ({
39253
- value: value22
39254
- }) => {
39255
- const {
39256
- isValid
39257
- } = validateLabelValue(value22 || "");
39258
- if (!isValid)
39259
- return t2("dovetail.format_error");
39260
- },
39261
- render: renderTextAreaFunc
39262
- }, ...extraColumns || []],
39263
- disableBatchFilling: true,
39264
- hideEmptyTable: true,
39265
- rowAddConfig: {
39266
- addible: true,
39267
- text: () => addButtonText
39268
- },
39269
- defaultData: defaultValue,
39270
- row: {
39271
- deletable: true
39272
- }
39273
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {})]
39274
- });
39275
- }
39276
- const KeyValueTableFormForm = React.forwardRef(_KeyValueTableFormForm);
39277
39443
  const EditLabelForm = React.forwardRef(
39278
39444
  function EditLabelForm2(props, ref) {
39279
39445
  var _a;
@@ -39338,26 +39504,23 @@ WARNING: This link could potentially be dangerous`)) {
39338
39504
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
39339
39505
  eagle.Menu.Item,
39340
39506
  {
39507
+ ...props,
39341
39508
  className: "ant-dropdown-menu-item",
39342
- onClick: () => {
39509
+ onClick: (e2) => {
39510
+ var _a;
39343
39511
  const modalProps = {
39344
39512
  formRef,
39345
39513
  title: t2("dovetail.edit_label"),
39346
39514
  fullscreen: true,
39347
39515
  renderContent() {
39348
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
39349
- EditLabelForm,
39350
- {
39351
- ref: formRef,
39352
- resourceModel
39353
- }
39354
- );
39516
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(EditLabelForm, { ref: formRef, resourceModel });
39355
39517
  }
39356
39518
  };
39357
39519
  pushModal({
39358
39520
  component: EditFieldModal,
39359
39521
  props: modalProps
39360
39522
  });
39523
+ (_a = props.onClick) == null ? void 0 : _a.call(props, e2);
39361
39524
  },
39362
39525
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.EditPen16BlueIcon, children: t2("dovetail.edit_label") })
39363
39526
  }
@@ -39425,31 +39588,57 @@ WARNING: This link could potentially be dangerous`)) {
39425
39588
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
39426
39589
  eagle.Menu.Item,
39427
39590
  {
39591
+ ...props,
39428
39592
  className: "ant-dropdown-menu-item",
39429
- onClick: () => {
39593
+ onClick: (e2) => {
39594
+ var _a;
39430
39595
  const modalProps = {
39431
39596
  formRef,
39432
39597
  title: t2("dovetail.edit_annotation"),
39433
39598
  fullscreen: true,
39434
39599
  renderContent() {
39435
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
39436
- EditAnnotationForm,
39437
- {
39438
- ref: formRef,
39439
- resourceModel
39440
- }
39441
- );
39600
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(EditAnnotationForm, { ref: formRef, resourceModel });
39442
39601
  }
39443
39602
  };
39444
39603
  pushModal({
39445
39604
  component: EditFieldModal,
39446
39605
  props: modalProps
39447
39606
  });
39607
+ (_a = props.onClick) == null ? void 0 : _a.call(props, e2);
39448
39608
  },
39449
39609
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.EditPen16BlueIcon, children: t2("dovetail.edit_annotation") })
39450
39610
  }
39451
39611
  );
39452
39612
  }
39613
+ function EditNodeTaintDropdownMenuItem(props) {
39614
+ const { formRef, resourceModel } = props;
39615
+ const { t: t2 } = useTranslation();
39616
+ const pushModal = eagle.usePushModal();
39617
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
39618
+ eagle.Menu.Item,
39619
+ {
39620
+ ...props,
39621
+ className: "ant-dropdown-menu-item",
39622
+ onClick: (e2) => {
39623
+ var _a;
39624
+ const modalProps = {
39625
+ formRef,
39626
+ title: t2("dovetail.edit_node_taint"),
39627
+ fullscreen: true,
39628
+ renderContent() {
39629
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(EditNodeTaintForm, { ref: formRef, nodeModel: resourceModel });
39630
+ }
39631
+ };
39632
+ pushModal({
39633
+ component: EditFieldModal,
39634
+ props: modalProps
39635
+ });
39636
+ (_a = props.onClick) == null ? void 0 : _a.call(props, e2);
39637
+ },
39638
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.EditPen16BlueIcon, children: t2("dovetail.edit_node_taint") })
39639
+ }
39640
+ );
39641
+ }
39453
39642
  const index_sazpyf = "";
39454
39643
  const WrapperStyle = "wfg6u6g";
39455
39644
  const InnerBar = ({
@@ -40739,6 +40928,7 @@ WARNING: This link could potentially be dangerous`)) {
40739
40928
  exports2.EditAnnotationDropdownMenuItem = EditAnnotationDropdownMenuItem;
40740
40929
  exports2.EditButton = EditButton;
40741
40930
  exports2.EditLabelDropdownMenuItem = EditLabelDropdownMenuItem;
40931
+ exports2.EditNodeTaintDropdownMenuItem = EditNodeTaintDropdownMenuItem;
40742
40932
  exports2.ErrorContent = WidgetErrorContent;
40743
40933
  exports2.ErrorContentType = ErrorContentType;
40744
40934
  exports2.ErrorWrapper = ErrorWrapper;