@dovetail-v2/refine 0.3.16-alpha.0 → 0.3.17-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ErrorContent/index.d.ts +2 -1
- package/dist/components/YamlEditor/YamlEditorComponent.d.ts +1 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/locales/zh-CN/index.d.ts +2 -0
- package/dist/refine.cjs +58 -28
- package/dist/refine.js +59 -29
- package/dist/style.css +3 -0
- package/package.json +1 -1
|
@@ -4,7 +4,8 @@ export declare const ErrorContent: import("@linaria/react").StyledComponent<Reac
|
|
|
4
4
|
export declare enum ErrorContentType {
|
|
5
5
|
List = "list",
|
|
6
6
|
Card = "card",
|
|
7
|
-
Widget = "widget"
|
|
7
|
+
Widget = "widget",
|
|
8
|
+
Item = "item"
|
|
8
9
|
}
|
|
9
10
|
export type WidgetErrorContentProps = {
|
|
10
11
|
className?: string;
|
|
@@ -16,6 +16,7 @@ export type YamlEditorProps<T extends string | Record<string, unknown> = string>
|
|
|
16
16
|
readOnly?: boolean;
|
|
17
17
|
debounceTime?: number;
|
|
18
18
|
isScrollOnFocus?: boolean;
|
|
19
|
+
isHideActions?: boolean;
|
|
19
20
|
onChange?: (value: T) => void;
|
|
20
21
|
onValidate?: (valid: boolean, schemaValid: boolean) => void;
|
|
21
22
|
onEditorCreate?: (editor: editor.IStandaloneCodeEditor) => void;
|
package/dist/i18n.d.ts
CHANGED
package/dist/refine.cjs
CHANGED
|
@@ -1230,6 +1230,8 @@ const target_service_port = "目标服务端口";
|
|
|
1230
1230
|
const select_workload = "选择工作负载";
|
|
1231
1231
|
const no_search_result = "无搜索结果";
|
|
1232
1232
|
const clear_search_condition = "清空搜索条件";
|
|
1233
|
+
const no_labels = "无标签";
|
|
1234
|
+
const no_annotations = "无注解";
|
|
1233
1235
|
const dovetail = {
|
|
1234
1236
|
copy,
|
|
1235
1237
|
reset_arguments,
|
|
@@ -1501,7 +1503,9 @@ const dovetail = {
|
|
|
1501
1503
|
target_service_port,
|
|
1502
1504
|
select_workload,
|
|
1503
1505
|
no_search_result,
|
|
1504
|
-
clear_search_condition
|
|
1506
|
+
clear_search_condition,
|
|
1507
|
+
no_labels,
|
|
1508
|
+
no_annotations
|
|
1505
1509
|
};
|
|
1506
1510
|
const ZH = {
|
|
1507
1511
|
dovetail
|
|
@@ -7953,7 +7957,7 @@ var styled_default = process.env.NODE_ENV !== "production" ? new Proxy(styled, {
|
|
|
7953
7957
|
return o(prop);
|
|
7954
7958
|
}
|
|
7955
7959
|
}) : styled;
|
|
7956
|
-
const
|
|
7960
|
+
const index_l4xyq7 = "";
|
|
7957
7961
|
const ErrorWrapper = /* @__PURE__ */ styled_default("div")({
|
|
7958
7962
|
name: "ErrorWrapper",
|
|
7959
7963
|
class: "egn3dbn",
|
|
@@ -7968,6 +7972,7 @@ var ErrorContentType = /* @__PURE__ */ ((ErrorContentType2) => {
|
|
|
7968
7972
|
ErrorContentType2["List"] = "list";
|
|
7969
7973
|
ErrorContentType2["Card"] = "card";
|
|
7970
7974
|
ErrorContentType2["Widget"] = "widget";
|
|
7975
|
+
ErrorContentType2["Item"] = "item";
|
|
7971
7976
|
return ErrorContentType2;
|
|
7972
7977
|
})(ErrorContentType || {});
|
|
7973
7978
|
const WidgetErrorContent = (props) => {
|
|
@@ -7982,18 +7987,26 @@ const WidgetErrorContent = (props) => {
|
|
|
7982
7987
|
t: t2
|
|
7983
7988
|
} = common.useTranslation();
|
|
7984
7989
|
const fontMap = {
|
|
7990
|
+
// 小卡片
|
|
7985
7991
|
[
|
|
7986
7992
|
"widget"
|
|
7987
7993
|
/* Widget */
|
|
7988
7994
|
]: eagle.Typo.Label.l1_regular_title,
|
|
7995
|
+
// 详情里整个大卡片
|
|
7989
7996
|
[
|
|
7990
7997
|
"card"
|
|
7991
7998
|
/* Card */
|
|
7992
7999
|
]: eagle.Typo.Label.l1_bold,
|
|
8000
|
+
// 列表
|
|
7993
8001
|
[
|
|
7994
8002
|
"list"
|
|
7995
8003
|
/* List */
|
|
7996
|
-
]: eagle.Typo.Display.d2_bold_title
|
|
8004
|
+
]: eagle.Typo.Display.d2_bold_title,
|
|
8005
|
+
// 详情里的某一项
|
|
8006
|
+
[
|
|
8007
|
+
"item"
|
|
8008
|
+
/* Item */
|
|
8009
|
+
]: eagle.Typo.Heading.h2_bold_title
|
|
7997
8010
|
};
|
|
7998
8011
|
return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ErrorWrapper, {
|
|
7999
8012
|
className: common.cx_default(props.className, type2),
|
|
@@ -9699,8 +9712,8 @@ class PodModel extends WorkloadBaseModel {
|
|
|
9699
9712
|
return this.ips.join(", ");
|
|
9700
9713
|
}
|
|
9701
9714
|
get hasDnsConfig() {
|
|
9702
|
-
var _a, _b, _c, _d;
|
|
9703
|
-
return !!(((_a = this.spec) == null ? void 0 : _a.dnsConfig) && (((_b = this.spec.dnsConfig.nameservers) == null ? void 0 : _b.length) || ((_c = this.spec.dnsConfig.searches) == null ? void 0 : _c.length) || ((_d = this.spec.dnsConfig.options) == null ? void 0 : _d.length)));
|
|
9715
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
9716
|
+
return !!(((_a = this.spec) == null ? void 0 : _a.dnsConfig) && (((_b = this.spec.dnsConfig.nameservers) == null ? void 0 : _b.length) || ((_c = this.spec.dnsConfig.searches) == null ? void 0 : _c.length) || ((_d = this.spec.dnsConfig.options) == null ? void 0 : _d.length)) || ((_e = this.spec) == null ? void 0 : _e.dnsPolicy) || ((_g = (_f = this.spec) == null ? void 0 : _f.hostAliases) == null ? void 0 : _g.length));
|
|
9704
9717
|
}
|
|
9705
9718
|
}
|
|
9706
9719
|
class PodMetricsModel extends ResourceModel {
|
|
@@ -10390,7 +10403,14 @@ const ConditionsTable = ({ conditions = [] }) => {
|
|
|
10390
10403
|
width: 120,
|
|
10391
10404
|
sortable: true,
|
|
10392
10405
|
render: (value2) => {
|
|
10393
|
-
return
|
|
10406
|
+
return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
|
|
10407
|
+
eagle.StatusCapsule,
|
|
10408
|
+
{
|
|
10409
|
+
color: value2 === "True" ? "green" : "red",
|
|
10410
|
+
className: common.cx_default(StateTagStyle, "no-background"),
|
|
10411
|
+
children: value2 === "True" ? t2("dovetail.true") : t2("dovetail.false")
|
|
10412
|
+
}
|
|
10413
|
+
);
|
|
10394
10414
|
}
|
|
10395
10415
|
},
|
|
10396
10416
|
{
|
|
@@ -10789,7 +10809,7 @@ function validateNodePort(nodePort, allNodePorts, i18n2) {
|
|
|
10789
10809
|
return { isValid: true };
|
|
10790
10810
|
}
|
|
10791
10811
|
function K8sDropdown(props) {
|
|
10792
|
-
var _a;
|
|
10812
|
+
var _a, _b;
|
|
10793
10813
|
const { record, size = "normal", customButton } = props;
|
|
10794
10814
|
const globalStore = useGlobalStore();
|
|
10795
10815
|
const useResourceResult = core.useResource();
|
|
@@ -10800,7 +10820,7 @@ function K8sDropdown(props) {
|
|
|
10800
10820
|
const { openDeleteConfirmModal } = useDeleteModal({ resourceName: resourceName || "" });
|
|
10801
10821
|
const download2 = useDownloadYAML();
|
|
10802
10822
|
const openForm = useOpenForm();
|
|
10803
|
-
const isInShowPage = useResourceResult.action === "show";
|
|
10823
|
+
const isInShowPage = useResourceResult.action === "show" && ((_a = useResourceResult.resource) == null ? void 0 : _a.name) === config.name;
|
|
10804
10824
|
const { data: canEditData } = core.useCan({
|
|
10805
10825
|
resource: resourceName,
|
|
10806
10826
|
action: AccessControlAuth.Edit,
|
|
@@ -10815,7 +10835,7 @@ function K8sDropdown(props) {
|
|
|
10815
10835
|
namespace: record.namespace
|
|
10816
10836
|
}
|
|
10817
10837
|
});
|
|
10818
|
-
const formType = ((
|
|
10838
|
+
const formType = ((_b = config.formConfig) == null ? void 0 : _b.formType) || FormType.FORM;
|
|
10819
10839
|
return /* @__PURE__ */ common.jsxRuntimeExports.jsx(common.jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(
|
|
10820
10840
|
eagle.Dropdown,
|
|
10821
10841
|
{
|
|
@@ -11453,16 +11473,21 @@ const KeyValue = (props) => {
|
|
|
11453
11473
|
const {
|
|
11454
11474
|
t: t2
|
|
11455
11475
|
} = common.useTranslation();
|
|
11456
|
-
const result = Object.keys(data2).map((key2) =>
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
className:
|
|
11460
|
-
children:
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11476
|
+
const result = Object.keys(data2).map((key2) => {
|
|
11477
|
+
const value2 = hideSecret ? toAsterisk(data2[key2]) : data2[key2];
|
|
11478
|
+
return /* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
|
|
11479
|
+
className: ContentBlockStyle,
|
|
11480
|
+
children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
|
|
11481
|
+
className: common.cx_default(KeyStyle, eagle.Typo.Label.l4_regular),
|
|
11482
|
+
children: key2
|
|
11483
|
+
}), /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
|
|
11484
|
+
className: common.cx_default(eagle.Typo.Label.l4_regular, ValueStyle$2),
|
|
11485
|
+
children: value2 || /* @__PURE__ */ common.jsxRuntimeExports.jsx(ValueDisplay, {
|
|
11486
|
+
value: ""
|
|
11487
|
+
})
|
|
11488
|
+
})]
|
|
11489
|
+
}, key2);
|
|
11490
|
+
});
|
|
11466
11491
|
if (!result.length) {
|
|
11467
11492
|
return /* @__PURE__ */ common.jsxRuntimeExports.jsx(WidgetErrorContent, {
|
|
11468
11493
|
errorText: empty2 || t2("dovetail.empty"),
|
|
@@ -11758,6 +11783,7 @@ function _KeyValueTableForm(props, ref) {
|
|
|
11758
11783
|
rowIndex,
|
|
11759
11784
|
disabled
|
|
11760
11785
|
}) => {
|
|
11786
|
+
const record = _value[rowIndex || 0];
|
|
11761
11787
|
return /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.AutoComplete, {
|
|
11762
11788
|
options: keyOptions || [],
|
|
11763
11789
|
value: value22,
|
|
@@ -11767,7 +11793,7 @@ function _KeyValueTableForm(props, ref) {
|
|
|
11767
11793
|
var _a;
|
|
11768
11794
|
return ((_a = option == null ? void 0 : option.label) == null ? void 0 : _a.toString().toLowerCase().includes(inputValue.toLowerCase())) || false;
|
|
11769
11795
|
},
|
|
11770
|
-
disabled: disabled || disabledChagneDefaultValues && (
|
|
11796
|
+
disabled: disabled || disabledChagneDefaultValues && defaultValue.some((row) => lodashEs.isEqual(row, record)),
|
|
11771
11797
|
allowClear: true
|
|
11772
11798
|
});
|
|
11773
11799
|
};
|
|
@@ -11777,12 +11803,13 @@ function _KeyValueTableForm(props, ref) {
|
|
|
11777
11803
|
rowIndex,
|
|
11778
11804
|
disabled
|
|
11779
11805
|
}) => {
|
|
11806
|
+
const record = _value[rowIndex || 0];
|
|
11780
11807
|
return /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.TextArea, {
|
|
11781
11808
|
autoSize: true,
|
|
11782
11809
|
className: "c17gq8cd",
|
|
11783
11810
|
size: "small",
|
|
11784
11811
|
value: value22,
|
|
11785
|
-
disabled: disabled || disabledChagneDefaultValues && (
|
|
11812
|
+
disabled: disabled || disabledChagneDefaultValues && defaultValue.some((row) => lodashEs.isEqual(row, record)),
|
|
11786
11813
|
onChange: (e2) => {
|
|
11787
11814
|
onChange2(e2.target.value);
|
|
11788
11815
|
}
|
|
@@ -11843,8 +11870,9 @@ function _KeyValueTableForm(props, ref) {
|
|
|
11843
11870
|
defaultData: _value,
|
|
11844
11871
|
row: {
|
|
11845
11872
|
deletable: _value.length > (minSize || 0),
|
|
11846
|
-
disableActions(rowIndex) {
|
|
11847
|
-
|
|
11873
|
+
disableActions(rowIndex, datas) {
|
|
11874
|
+
const record = datas[rowIndex];
|
|
11875
|
+
if (disabledChagneDefaultValues && defaultValue.some((row) => lodashEs.isEqual(row, record))) {
|
|
11848
11876
|
return ["delete"];
|
|
11849
11877
|
}
|
|
11850
11878
|
}
|
|
@@ -13062,8 +13090,8 @@ const LabelsAndAnnotationsShow = ({
|
|
|
13062
13090
|
}), Object.keys(labels || {}).length ? /* @__PURE__ */ common.jsxRuntimeExports.jsx(Tags, {
|
|
13063
13091
|
value: labels
|
|
13064
13092
|
}) : /* @__PURE__ */ common.jsxRuntimeExports.jsx(WidgetErrorContent, {
|
|
13065
|
-
errorText: sksI18n.t("dovetail.
|
|
13066
|
-
type: ErrorContentType.
|
|
13093
|
+
errorText: sksI18n.t("dovetail.no_labels"),
|
|
13094
|
+
type: ErrorContentType.Item
|
|
13067
13095
|
})]
|
|
13068
13096
|
}), /* @__PURE__ */ common.jsxRuntimeExports.jsxs("div", {
|
|
13069
13097
|
className: ItemWrapperStyle,
|
|
@@ -13072,7 +13100,8 @@ const LabelsAndAnnotationsShow = ({
|
|
|
13072
13100
|
children: sksI18n.t("dovetail.annotation")
|
|
13073
13101
|
}), /* @__PURE__ */ common.jsxRuntimeExports.jsx(KeyValue, {
|
|
13074
13102
|
data: annotations,
|
|
13075
|
-
|
|
13103
|
+
empty: sksI18n.t("dovetail.no_annotations"),
|
|
13104
|
+
errorContent: ErrorContentType.Item
|
|
13076
13105
|
})]
|
|
13077
13106
|
})]
|
|
13078
13107
|
});
|
|
@@ -15755,7 +15784,8 @@ const YamlEditorComponent = React.forwardRef(
|
|
|
15755
15784
|
eleRef,
|
|
15756
15785
|
className,
|
|
15757
15786
|
debounceTime,
|
|
15758
|
-
isScrollOnFocus = true
|
|
15787
|
+
isScrollOnFocus = true,
|
|
15788
|
+
isHideActions = false
|
|
15759
15789
|
} = props;
|
|
15760
15790
|
const { t: t2 } = common.useTranslation();
|
|
15761
15791
|
const [isCollapsed, setIsCollapsed] = React.useState(
|
|
@@ -15861,7 +15891,7 @@ const YamlEditorComponent = React.forwardRef(
|
|
|
15861
15891
|
),
|
|
15862
15892
|
/* @__PURE__ */ common.jsxRuntimeExports.jsx("div", { className: common.cx_default(TitleStyle, "yaml-editor-title"), children: title || t2("dovetail.configure_file") })
|
|
15863
15893
|
] }),
|
|
15864
|
-
/* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Space, { size: 14, children: [
|
|
15894
|
+
isHideActions ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Space, { size: 14, children: [
|
|
15865
15895
|
isDiff ? void 0 : /* @__PURE__ */ common.jsxRuntimeExports.jsxs(common.jsxRuntimeExports.Fragment, { children: [
|
|
15866
15896
|
/* @__PURE__ */ common.jsxRuntimeExports.jsx(
|
|
15867
15897
|
eagle.Tooltip,
|
package/dist/refine.js
CHANGED
|
@@ -11,7 +11,7 @@ import { ResourceContext, matchResourceFromRoute, useResource, useDelete, useNav
|
|
|
11
11
|
import { parse, stringify } from "qs";
|
|
12
12
|
import React, { createElement, isValidElement, cloneElement, Children, useContext, useCallback, createContext, useState, useEffect, useMemo, useRef, useImperativeHandle, lazy, Suspense, memo, forwardRef } from "react";
|
|
13
13
|
import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Router } from "react-router-dom";
|
|
14
|
-
import { usePushModal, usePopModal, DeleteDialog, Tag, RejectDialog, RejectDialogType, Typo, Input, Select, AntdOption, Button, Form, Space, TextArea, kitContext, Loading, Table as Table$2, Pagination, Alert, ImmersiveDialog, SmallDialog, Fields, Units, Link as Link$1, OverflowTooltip, Tooltip, Dropdown, Menu as Menu$1, Icon, Divider, LegacyModal,
|
|
14
|
+
import { usePushModal, usePopModal, DeleteDialog, Tag, RejectDialog, RejectDialogType, Typo, Input, Select, AntdOption, Button, Form, Space, TextArea, kitContext, Loading, Table as Table$2, Pagination, Alert, ImmersiveDialog, SmallDialog, Fields, Units, Link as Link$1, OverflowTooltip, Tooltip, StatusCapsule, Dropdown, Menu as Menu$1, Icon, Divider, LegacyModal, Popover, AntdTable, Upload, TableForm, AutoComplete, getOptions, DonutChart, SegmentControl, Checkbox, Tabs as Tabs$1, TabsTabPane, Col, Row, useMessage, SearchInput, Token, AntdSelectOptGroup, WizardDialog, MenuItemGroup, Layout as Layout$1, InputGroup, InputInteger, Time as Time$1, ModalStack, KitStoreProvider, ConfigProvider } from "@cloudtower/eagle";
|
|
15
15
|
import { EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, PlusAddCreateNew16BoldOntintIcon, ViewEye16GradientGrayIcon, EntityFilterIgnoreGradient16GrayIcon, InfoICircleFill16GrayIcon, InfoICircleFill16Gray70Icon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, ArrowChevronDownSmall16BlueIcon, ArrowChevronUpSmall16BlueIcon, Retry16GradientBlueIcon, OpenTerminal16GradientBlueIcon, ArrowChevronDown16BlueIcon, ArrowChevronUp16BlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, EditPen16GradientGrayIcon, EditPen16GradientBlueIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, Pause16GradientBlueIcon, EditPen16BlueIcon } from "@cloudtower/icons-react";
|
|
16
16
|
import { first, get as get$2, cloneDeep, set, omit as omit$1, merge, isEqual as isEqual$1, debounce, last, setWith, clone, isObject as isObject$4, uniq, keyBy } from "lodash-es";
|
|
17
17
|
import yaml$2 from "js-yaml";
|
|
@@ -1211,6 +1211,8 @@ const target_service_port = "目标服务端口";
|
|
|
1211
1211
|
const select_workload = "选择工作负载";
|
|
1212
1212
|
const no_search_result = "无搜索结果";
|
|
1213
1213
|
const clear_search_condition = "清空搜索条件";
|
|
1214
|
+
const no_labels = "无标签";
|
|
1215
|
+
const no_annotations = "无注解";
|
|
1214
1216
|
const dovetail = {
|
|
1215
1217
|
copy,
|
|
1216
1218
|
reset_arguments,
|
|
@@ -1482,7 +1484,9 @@ const dovetail = {
|
|
|
1482
1484
|
target_service_port,
|
|
1483
1485
|
select_workload,
|
|
1484
1486
|
no_search_result,
|
|
1485
|
-
clear_search_condition
|
|
1487
|
+
clear_search_condition,
|
|
1488
|
+
no_labels,
|
|
1489
|
+
no_annotations
|
|
1486
1490
|
};
|
|
1487
1491
|
const ZH = {
|
|
1488
1492
|
dovetail
|
|
@@ -7934,7 +7938,7 @@ var styled_default = process.env.NODE_ENV !== "production" ? new Proxy(styled, {
|
|
|
7934
7938
|
return o(prop);
|
|
7935
7939
|
}
|
|
7936
7940
|
}) : styled;
|
|
7937
|
-
const
|
|
7941
|
+
const index_l4xyq7 = "";
|
|
7938
7942
|
const ErrorWrapper = /* @__PURE__ */ styled_default("div")({
|
|
7939
7943
|
name: "ErrorWrapper",
|
|
7940
7944
|
class: "egn3dbn",
|
|
@@ -7949,6 +7953,7 @@ var ErrorContentType = /* @__PURE__ */ ((ErrorContentType2) => {
|
|
|
7949
7953
|
ErrorContentType2["List"] = "list";
|
|
7950
7954
|
ErrorContentType2["Card"] = "card";
|
|
7951
7955
|
ErrorContentType2["Widget"] = "widget";
|
|
7956
|
+
ErrorContentType2["Item"] = "item";
|
|
7952
7957
|
return ErrorContentType2;
|
|
7953
7958
|
})(ErrorContentType || {});
|
|
7954
7959
|
const WidgetErrorContent = (props) => {
|
|
@@ -7963,18 +7968,26 @@ const WidgetErrorContent = (props) => {
|
|
|
7963
7968
|
t: t2
|
|
7964
7969
|
} = useTranslation();
|
|
7965
7970
|
const fontMap = {
|
|
7971
|
+
// 小卡片
|
|
7966
7972
|
[
|
|
7967
7973
|
"widget"
|
|
7968
7974
|
/* Widget */
|
|
7969
7975
|
]: Typo.Label.l1_regular_title,
|
|
7976
|
+
// 详情里整个大卡片
|
|
7970
7977
|
[
|
|
7971
7978
|
"card"
|
|
7972
7979
|
/* Card */
|
|
7973
7980
|
]: Typo.Label.l1_bold,
|
|
7981
|
+
// 列表
|
|
7974
7982
|
[
|
|
7975
7983
|
"list"
|
|
7976
7984
|
/* List */
|
|
7977
|
-
]: Typo.Display.d2_bold_title
|
|
7985
|
+
]: Typo.Display.d2_bold_title,
|
|
7986
|
+
// 详情里的某一项
|
|
7987
|
+
[
|
|
7988
|
+
"item"
|
|
7989
|
+
/* Item */
|
|
7990
|
+
]: Typo.Heading.h2_bold_title
|
|
7978
7991
|
};
|
|
7979
7992
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorWrapper, {
|
|
7980
7993
|
className: cx_default(props.className, type2),
|
|
@@ -9680,8 +9693,8 @@ class PodModel extends WorkloadBaseModel {
|
|
|
9680
9693
|
return this.ips.join(", ");
|
|
9681
9694
|
}
|
|
9682
9695
|
get hasDnsConfig() {
|
|
9683
|
-
var _a, _b, _c, _d;
|
|
9684
|
-
return !!(((_a = this.spec) == null ? void 0 : _a.dnsConfig) && (((_b = this.spec.dnsConfig.nameservers) == null ? void 0 : _b.length) || ((_c = this.spec.dnsConfig.searches) == null ? void 0 : _c.length) || ((_d = this.spec.dnsConfig.options) == null ? void 0 : _d.length)));
|
|
9696
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
9697
|
+
return !!(((_a = this.spec) == null ? void 0 : _a.dnsConfig) && (((_b = this.spec.dnsConfig.nameservers) == null ? void 0 : _b.length) || ((_c = this.spec.dnsConfig.searches) == null ? void 0 : _c.length) || ((_d = this.spec.dnsConfig.options) == null ? void 0 : _d.length)) || ((_e = this.spec) == null ? void 0 : _e.dnsPolicy) || ((_g = (_f = this.spec) == null ? void 0 : _f.hostAliases) == null ? void 0 : _g.length));
|
|
9685
9698
|
}
|
|
9686
9699
|
}
|
|
9687
9700
|
class PodMetricsModel extends ResourceModel {
|
|
@@ -10371,7 +10384,14 @@ const ConditionsTable = ({ conditions = [] }) => {
|
|
|
10371
10384
|
width: 120,
|
|
10372
10385
|
sortable: true,
|
|
10373
10386
|
render: (value2) => {
|
|
10374
|
-
return
|
|
10387
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10388
|
+
StatusCapsule,
|
|
10389
|
+
{
|
|
10390
|
+
color: value2 === "True" ? "green" : "red",
|
|
10391
|
+
className: cx_default(StateTagStyle, "no-background"),
|
|
10392
|
+
children: value2 === "True" ? t2("dovetail.true") : t2("dovetail.false")
|
|
10393
|
+
}
|
|
10394
|
+
);
|
|
10375
10395
|
}
|
|
10376
10396
|
},
|
|
10377
10397
|
{
|
|
@@ -10770,7 +10790,7 @@ function validateNodePort(nodePort, allNodePorts, i18n2) {
|
|
|
10770
10790
|
return { isValid: true };
|
|
10771
10791
|
}
|
|
10772
10792
|
function K8sDropdown(props) {
|
|
10773
|
-
var _a;
|
|
10793
|
+
var _a, _b;
|
|
10774
10794
|
const { record, size = "normal", customButton } = props;
|
|
10775
10795
|
const globalStore = useGlobalStore();
|
|
10776
10796
|
const useResourceResult = useResource();
|
|
@@ -10781,7 +10801,7 @@ function K8sDropdown(props) {
|
|
|
10781
10801
|
const { openDeleteConfirmModal } = useDeleteModal({ resourceName: resourceName || "" });
|
|
10782
10802
|
const download2 = useDownloadYAML();
|
|
10783
10803
|
const openForm = useOpenForm();
|
|
10784
|
-
const isInShowPage = useResourceResult.action === "show";
|
|
10804
|
+
const isInShowPage = useResourceResult.action === "show" && ((_a = useResourceResult.resource) == null ? void 0 : _a.name) === config.name;
|
|
10785
10805
|
const { data: canEditData } = useCan({
|
|
10786
10806
|
resource: resourceName,
|
|
10787
10807
|
action: AccessControlAuth.Edit,
|
|
@@ -10796,7 +10816,7 @@ function K8sDropdown(props) {
|
|
|
10796
10816
|
namespace: record.namespace
|
|
10797
10817
|
}
|
|
10798
10818
|
});
|
|
10799
|
-
const formType = ((
|
|
10819
|
+
const formType = ((_b = config.formConfig) == null ? void 0 : _b.formType) || FormType.FORM;
|
|
10800
10820
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10801
10821
|
Dropdown,
|
|
10802
10822
|
{
|
|
@@ -11434,16 +11454,21 @@ const KeyValue = (props) => {
|
|
|
11434
11454
|
const {
|
|
11435
11455
|
t: t2
|
|
11436
11456
|
} = useTranslation();
|
|
11437
|
-
const result = Object.keys(data2).map((key2) =>
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
className:
|
|
11441
|
-
children:
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11457
|
+
const result = Object.keys(data2).map((key2) => {
|
|
11458
|
+
const value2 = hideSecret ? toAsterisk(data2[key2]) : data2[key2];
|
|
11459
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
11460
|
+
className: ContentBlockStyle,
|
|
11461
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11462
|
+
className: cx_default(KeyStyle, Typo.Label.l4_regular),
|
|
11463
|
+
children: key2
|
|
11464
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
11465
|
+
className: cx_default(Typo.Label.l4_regular, ValueStyle$2),
|
|
11466
|
+
children: value2 || /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
|
|
11467
|
+
value: ""
|
|
11468
|
+
})
|
|
11469
|
+
})]
|
|
11470
|
+
}, key2);
|
|
11471
|
+
});
|
|
11447
11472
|
if (!result.length) {
|
|
11448
11473
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent, {
|
|
11449
11474
|
errorText: empty2 || t2("dovetail.empty"),
|
|
@@ -11739,6 +11764,7 @@ function _KeyValueTableForm(props, ref) {
|
|
|
11739
11764
|
rowIndex,
|
|
11740
11765
|
disabled
|
|
11741
11766
|
}) => {
|
|
11767
|
+
const record = _value[rowIndex || 0];
|
|
11742
11768
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(AutoComplete, {
|
|
11743
11769
|
options: keyOptions || [],
|
|
11744
11770
|
value: value22,
|
|
@@ -11748,7 +11774,7 @@ function _KeyValueTableForm(props, ref) {
|
|
|
11748
11774
|
var _a;
|
|
11749
11775
|
return ((_a = option == null ? void 0 : option.label) == null ? void 0 : _a.toString().toLowerCase().includes(inputValue.toLowerCase())) || false;
|
|
11750
11776
|
},
|
|
11751
|
-
disabled: disabled || disabledChagneDefaultValues && (
|
|
11777
|
+
disabled: disabled || disabledChagneDefaultValues && defaultValue.some((row) => isEqual$1(row, record)),
|
|
11752
11778
|
allowClear: true
|
|
11753
11779
|
});
|
|
11754
11780
|
};
|
|
@@ -11758,12 +11784,13 @@ function _KeyValueTableForm(props, ref) {
|
|
|
11758
11784
|
rowIndex,
|
|
11759
11785
|
disabled
|
|
11760
11786
|
}) => {
|
|
11787
|
+
const record = _value[rowIndex || 0];
|
|
11761
11788
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(TextArea, {
|
|
11762
11789
|
autoSize: true,
|
|
11763
11790
|
className: "c17gq8cd",
|
|
11764
11791
|
size: "small",
|
|
11765
11792
|
value: value22,
|
|
11766
|
-
disabled: disabled || disabledChagneDefaultValues && (
|
|
11793
|
+
disabled: disabled || disabledChagneDefaultValues && defaultValue.some((row) => isEqual$1(row, record)),
|
|
11767
11794
|
onChange: (e2) => {
|
|
11768
11795
|
onChange2(e2.target.value);
|
|
11769
11796
|
}
|
|
@@ -11824,8 +11851,9 @@ function _KeyValueTableForm(props, ref) {
|
|
|
11824
11851
|
defaultData: _value,
|
|
11825
11852
|
row: {
|
|
11826
11853
|
deletable: _value.length > (minSize || 0),
|
|
11827
|
-
disableActions(rowIndex) {
|
|
11828
|
-
|
|
11854
|
+
disableActions(rowIndex, datas) {
|
|
11855
|
+
const record = datas[rowIndex];
|
|
11856
|
+
if (disabledChagneDefaultValues && defaultValue.some((row) => isEqual$1(row, record))) {
|
|
11829
11857
|
return ["delete"];
|
|
11830
11858
|
}
|
|
11831
11859
|
}
|
|
@@ -13043,8 +13071,8 @@ const LabelsAndAnnotationsShow = ({
|
|
|
13043
13071
|
}), Object.keys(labels || {}).length ? /* @__PURE__ */ jsxRuntimeExports.jsx(Tags, {
|
|
13044
13072
|
value: labels
|
|
13045
13073
|
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent, {
|
|
13046
|
-
errorText: sksI18n.t("dovetail.
|
|
13047
|
-
type: ErrorContentType.
|
|
13074
|
+
errorText: sksI18n.t("dovetail.no_labels"),
|
|
13075
|
+
type: ErrorContentType.Item
|
|
13048
13076
|
})]
|
|
13049
13077
|
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
13050
13078
|
className: ItemWrapperStyle,
|
|
@@ -13053,7 +13081,8 @@ const LabelsAndAnnotationsShow = ({
|
|
|
13053
13081
|
children: sksI18n.t("dovetail.annotation")
|
|
13054
13082
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValue, {
|
|
13055
13083
|
data: annotations,
|
|
13056
|
-
|
|
13084
|
+
empty: sksI18n.t("dovetail.no_annotations"),
|
|
13085
|
+
errorContent: ErrorContentType.Item
|
|
13057
13086
|
})]
|
|
13058
13087
|
})]
|
|
13059
13088
|
});
|
|
@@ -15736,7 +15765,8 @@ const YamlEditorComponent = forwardRef(
|
|
|
15736
15765
|
eleRef,
|
|
15737
15766
|
className,
|
|
15738
15767
|
debounceTime,
|
|
15739
|
-
isScrollOnFocus = true
|
|
15768
|
+
isScrollOnFocus = true,
|
|
15769
|
+
isHideActions = false
|
|
15740
15770
|
} = props;
|
|
15741
15771
|
const { t: t2 } = useTranslation();
|
|
15742
15772
|
const [isCollapsed, setIsCollapsed] = useState(
|
|
@@ -15842,7 +15872,7 @@ const YamlEditorComponent = forwardRef(
|
|
|
15842
15872
|
),
|
|
15843
15873
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cx_default(TitleStyle, "yaml-editor-title"), children: title || t2("dovetail.configure_file") })
|
|
15844
15874
|
] }),
|
|
15845
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Space, { size: 14, children: [
|
|
15875
|
+
isHideActions ? null : /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, { size: 14, children: [
|
|
15846
15876
|
isDiff ? void 0 : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
15847
15877
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15848
15878
|
Tooltip,
|
package/dist/style.css
CHANGED