@dovetail-v2/refine 0.3.29-alpha.3 → 0.3.30-alpha.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.
@@ -7,5 +7,6 @@ export declare const ServiceInClusterAccessComponent: React.FC<Props>;
7
7
  export declare const ServiceOutClusterAccessComponent: React.FC<Props & {
8
8
  breakLine?: boolean;
9
9
  clusterVip: string;
10
+ showDashedUnderline?: boolean;
10
11
  }>;
11
12
  export {};
package/dist/refine.cjs CHANGED
@@ -10307,7 +10307,8 @@ const DashedUnderlineSpanStyle = "dvp1i89";
10307
10307
  const ServiceOutClusterAccessComponent = ({
10308
10308
  service,
10309
10309
  breakLine = true,
10310
- clusterVip
10310
+ clusterVip,
10311
+ showDashedUnderline = true
10311
10312
  }) => {
10312
10313
  var _a, _b, _c, _d, _e;
10313
10314
  const {
@@ -10327,6 +10328,9 @@ const ServiceOutClusterAccessComponent = ({
10327
10328
  title: i18n2.t("dovetail.default_http_protocol_tooltip"),
10328
10329
  children: /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", {
10329
10330
  className: DashedUnderlineSpanStyle,
10331
+ style: showDashedUnderline ? void 0 : {
10332
+ borderBottom: "none"
10333
+ },
10330
10334
  children: `${clusterVip}:${p.nodePort}`
10331
10335
  })
10332
10336
  })
@@ -10351,6 +10355,9 @@ const ServiceOutClusterAccessComponent = ({
10351
10355
  title: i18n2.t("dovetail.default_http_protocol_tooltip"),
10352
10356
  children: /* @__PURE__ */ common.jsxRuntimeExports.jsxs("span", {
10353
10357
  className: DashedUnderlineSpanStyle,
10358
+ style: showDashedUnderline ? void 0 : {
10359
+ borderBottom: "none"
10360
+ },
10354
10361
  children: [clusterVip, ":", p.nodePort]
10355
10362
  })
10356
10363
  })
@@ -12156,11 +12163,18 @@ function K8sDropdown(props) {
12156
12163
  }
12157
12164
  });
12158
12165
  const formType = (_b = config == null ? void 0 : config.formConfig) == null ? void 0 : _b.formType;
12166
+ const { action } = core.useParsed();
12167
+ const { resource } = core.useResource();
12168
+ const isInShowPage = action === "show";
12169
+ const isSameResource = resourceName === (resource == null ? void 0 : resource.name);
12170
+ const isShowPageSameResource = isInShowPage && isSameResource;
12171
+ const shouldHideEdit = hideEditProp || isShowPageSameResource;
12172
+ const shouldHideEditYaml = hideEditYaml || formType !== FormType.FORM;
12159
12173
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(common.jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12160
12174
  eagle.Dropdown,
12161
12175
  {
12162
12176
  overlay: /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Menu, { children: [
12163
- hideEditProp || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12177
+ shouldHideEdit || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12164
12178
  eagle.Menu.Item,
12165
12179
  {
12166
12180
  onClick: () => openForm({ id: record.id, resourceName, resourceConfig: config }),
@@ -12170,7 +12184,7 @@ function K8sDropdown(props) {
12170
12184
  )}` : t2("dovetail.edit_yaml") })
12171
12185
  }
12172
12186
  ),
12173
- hideEditYaml || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12187
+ shouldHideEditYaml || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12174
12188
  eagle.Menu.Item,
12175
12189
  {
12176
12190
  onClick: () => openForm({
@@ -14196,7 +14210,8 @@ const ServiceOutClusterAccessField = (clusterVip) => ({
14196
14210
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ServiceOutClusterAccessComponent, {
14197
14211
  service: record,
14198
14212
  breakLine: false,
14199
- clusterVip
14213
+ clusterVip,
14214
+ showDashedUnderline: false
14200
14215
  });
14201
14216
  }
14202
14217
  });
package/dist/refine.js CHANGED
@@ -10288,7 +10288,8 @@ const DashedUnderlineSpanStyle = "dvp1i89";
10288
10288
  const ServiceOutClusterAccessComponent = ({
10289
10289
  service,
10290
10290
  breakLine = true,
10291
- clusterVip
10291
+ clusterVip,
10292
+ showDashedUnderline = true
10292
10293
  }) => {
10293
10294
  var _a, _b, _c, _d, _e;
10294
10295
  const {
@@ -10308,6 +10309,9 @@ const ServiceOutClusterAccessComponent = ({
10308
10309
  title: i18n2.t("dovetail.default_http_protocol_tooltip"),
10309
10310
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
10310
10311
  className: DashedUnderlineSpanStyle,
10312
+ style: showDashedUnderline ? void 0 : {
10313
+ borderBottom: "none"
10314
+ },
10311
10315
  children: `${clusterVip}:${p.nodePort}`
10312
10316
  })
10313
10317
  })
@@ -10332,6 +10336,9 @@ const ServiceOutClusterAccessComponent = ({
10332
10336
  title: i18n2.t("dovetail.default_http_protocol_tooltip"),
10333
10337
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
10334
10338
  className: DashedUnderlineSpanStyle,
10339
+ style: showDashedUnderline ? void 0 : {
10340
+ borderBottom: "none"
10341
+ },
10335
10342
  children: [clusterVip, ":", p.nodePort]
10336
10343
  })
10337
10344
  })
@@ -12137,11 +12144,18 @@ function K8sDropdown(props) {
12137
12144
  }
12138
12145
  });
12139
12146
  const formType = (_b = config == null ? void 0 : config.formConfig) == null ? void 0 : _b.formType;
12147
+ const { action } = useParsed();
12148
+ const { resource } = useResource();
12149
+ const isInShowPage = action === "show";
12150
+ const isSameResource = resourceName === (resource == null ? void 0 : resource.name);
12151
+ const isShowPageSameResource = isInShowPage && isSameResource;
12152
+ const shouldHideEdit = hideEditProp || isShowPageSameResource;
12153
+ const shouldHideEditYaml = hideEditYaml || formType !== FormType.FORM;
12140
12154
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12141
12155
  Dropdown,
12142
12156
  {
12143
12157
  overlay: /* @__PURE__ */ jsxRuntimeExports.jsxs(Menu$1, { children: [
12144
- hideEditProp || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
12158
+ shouldHideEdit || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
12145
12159
  Menu$1.Item,
12146
12160
  {
12147
12161
  onClick: () => openForm({ id: record.id, resourceName, resourceConfig: config }),
@@ -12151,7 +12165,7 @@ function K8sDropdown(props) {
12151
12165
  )}` : t2("dovetail.edit_yaml") })
12152
12166
  }
12153
12167
  ),
12154
- hideEditYaml || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
12168
+ shouldHideEditYaml || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
12155
12169
  Menu$1.Item,
12156
12170
  {
12157
12171
  onClick: () => openForm({
@@ -14177,7 +14191,8 @@ const ServiceOutClusterAccessField = (clusterVip) => ({
14177
14191
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessComponent, {
14178
14192
  service: record,
14179
14193
  breakLine: false,
14180
- clusterVip
14194
+ clusterVip,
14195
+ showDashedUnderline: false
14181
14196
  });
14182
14197
  }
14183
14198
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.3.29-alpha.3",
3
+ "version": "0.3.30-alpha.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",