@dovetail-v2/refine 0.3.20-alpha.1 → 0.3.21-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.
@@ -5,7 +5,7 @@ import { Unstructured } from 'k8s-api-provider';
5
5
  import { ConfigMap, Secret } from 'kubernetes-types/core/v1';
6
6
  import { NetworkPolicy } from 'kubernetes-types/networking/v1';
7
7
  import React from 'react';
8
- import { JobModel, ResourceModel, WorkloadModel, WorkloadBaseModel, CronJobModel, IngressModel, ServiceModel, StorageClassModel, PersistentVolumeModel, PersistentVolumeClaimModel } from '../../models';
8
+ import { JobModel, ResourceModel, WorkloadModel, WorkloadBaseModel, CronJobModel, IngressModel, ServiceModel, StorageClassModel, PersistentVolumeModel, PersistentVolumeClaimModel, PodModel } from '../../models';
9
9
  export type ShowField<Model extends ResourceModel> = {
10
10
  key: string;
11
11
  title?: React.ReactNode;
@@ -94,3 +94,4 @@ export declare const SCReclaimPolicyField: <Model extends StorageClassModel>(i18
94
94
  export declare const IsSCAllowVolumeExpansionField: <Model extends StorageClassModel>(i18n: I18nType) => ShowField<Model>;
95
95
  export declare const ResourceTableField: <Model extends ResourceModel<Unstructured>>(resource: string, useTableParams?: import("@refinedev/core").useTableProps<Model, import("@refinedev/core").HttpError, Model> | undefined) => ShowField<Model>;
96
96
  export declare const PodCountOfJobField: <Model extends JobModel>(i18n: I18nType) => ShowField<Model>;
97
+ export declare const PodWorkloadField: <Model extends PodModel>(i18n: I18nType) => ShowField<Model>;
package/dist/refine.cjs CHANGED
@@ -7973,7 +7973,7 @@ var styled_default = process.env.NODE_ENV !== "production" ? new Proxy(styled, {
7973
7973
  return o(prop);
7974
7974
  }
7975
7975
  }) : styled;
7976
- const index_l4xyq7 = "";
7976
+ const index_o09auy = "";
7977
7977
  const ErrorWrapper = /* @__PURE__ */ styled_default("div")({
7978
7978
  name: "ErrorWrapper",
7979
7979
  class: "egn3dbn",
@@ -8031,6 +8031,9 @@ const WidgetErrorContent = (props) => {
8031
8031
  className: "error-content",
8032
8032
  children: [/* @__PURE__ */ common.jsxRuntimeExports.jsx("p", {
8033
8033
  className: common.cx_default(fontMap[type2], "title", `${type2}-title`),
8034
+ style: {
8035
+ marginBottom: !!refetch ? "8px" : "0"
8036
+ },
8034
8037
  children: errorText || t2("dovetail.obtain_data_error")
8035
8038
  }), props.children, !refetch ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(kit.button, {
8036
8039
  size: type2 === "list" ? "middle" : "small",
@@ -10986,6 +10989,7 @@ const useEagleTable = (params) => {
10986
10989
  const { columns, tableProps, formatter, Dropdown = K8sDropdown } = params;
10987
10990
  const [selectedKeys, setSelectedKeys] = React.useState([]);
10988
10991
  const [currentPage, setCurrentPage] = React.useState((tableProps == null ? void 0 : tableProps.currentPage) || 1);
10992
+ const prevFiltersRef = React.useRef([]);
10989
10993
  const { resource } = core.useResource();
10990
10994
  const currentSize = (tableProps == null ? void 0 : tableProps.defaultSize) || 10;
10991
10995
  const useTableParams = React.useMemo(() => {
@@ -11059,10 +11063,11 @@ const useEagleTable = (params) => {
11059
11063
  ]);
11060
11064
  }, []);
11061
11065
  React.useEffect(() => {
11062
- if (lodashEs.isEqual(params.filters, table.filters)) {
11066
+ if (lodashEs.isEqual(params.filters, prevFiltersRef.current)) {
11063
11067
  return;
11064
11068
  }
11065
11069
  table.setFilters(params.filters || [], "replace");
11070
+ prevFiltersRef.current = params.filters || [];
11066
11071
  }, [params.filters]);
11067
11072
  return {
11068
11073
  tableProps: finalProps,
@@ -12237,6 +12242,56 @@ const NodeTaintsTable = ({
12237
12242
  showMenuColumn: false
12238
12243
  });
12239
12244
  };
12245
+ const ReferenceLink = (props) => {
12246
+ const { ownerReference, namespace: namespace2, pod: pod2 } = props;
12247
+ const configs = React.useContext(ConfigsContext);
12248
+ const { data: deploymentsData } = core.useList({
12249
+ resource: "deployments",
12250
+ meta: {
12251
+ kind: "Deployment",
12252
+ resourceBasePath: "/apis/apps/v1"
12253
+ },
12254
+ pagination: {
12255
+ mode: "off"
12256
+ }
12257
+ });
12258
+ const { data: replicaSetsData } = core.useList({
12259
+ resource: "replicasets",
12260
+ meta: {
12261
+ kind: "ReplicaSet",
12262
+ resourceBasePath: "/apis/apps/v1"
12263
+ },
12264
+ pagination: {
12265
+ mode: "off"
12266
+ }
12267
+ });
12268
+ if (ownerReference.kind === "ReplicaSet") {
12269
+ const deployment = pod2.getBelongToDeployment(
12270
+ (deploymentsData == null ? void 0 : deploymentsData.data) || [],
12271
+ (replicaSetsData == null ? void 0 : replicaSetsData.data) || []
12272
+ );
12273
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12274
+ ResourceLink,
12275
+ {
12276
+ name: (deployment == null ? void 0 : deployment.name) || "",
12277
+ resourceName: "deployments",
12278
+ namespace: namespace2
12279
+ }
12280
+ );
12281
+ }
12282
+ const resource = Object.values(configs).find((c2) => c2.kind === ownerReference.kind);
12283
+ if (!resource) {
12284
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ValueDisplay, { value: "" });
12285
+ }
12286
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12287
+ ResourceLink,
12288
+ {
12289
+ name: ownerReference.name,
12290
+ resourceName: resource.name || "",
12291
+ namespace: namespace2
12292
+ }
12293
+ );
12294
+ };
12240
12295
  function PVVolumeModeDisplay(props) {
12241
12296
  const { value: value2 } = props;
12242
12297
  const i18n2 = common.useTranslation();
@@ -13163,6 +13218,27 @@ const PodCountOfJobField = (i18n2) => {
13163
13218
  }
13164
13219
  };
13165
13220
  };
13221
+ const PodWorkloadField = (i18n2) => {
13222
+ return {
13223
+ key: "podWorkload",
13224
+ title: i18n2.t("dovetail.workload"),
13225
+ path: ["metadata", "ownerReferences"],
13226
+ col: 12,
13227
+ renderContent(value2, record) {
13228
+ const ownerReferences = value2;
13229
+ if (!(ownerReferences == null ? void 0 : ownerReferences.length)) {
13230
+ return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ValueDisplay, {
13231
+ value: ""
13232
+ });
13233
+ }
13234
+ return ownerReferences.map((o) => /* @__PURE__ */ common.jsxRuntimeExports.jsx(ReferenceLink, {
13235
+ pod: record,
13236
+ ownerReference: o,
13237
+ namespace: record.metadata.namespace || "default"
13238
+ }, o.name));
13239
+ }
13240
+ };
13241
+ };
13166
13242
  const index_15s69c5 = "";
13167
13243
  const ItemWrapperStyle = "i1hk9uwu";
13168
13244
  const LabelsAndAnnotationsShow = ({
@@ -17798,56 +17874,6 @@ const EditButton = () => {
17798
17874
  }
17799
17875
  );
17800
17876
  };
17801
- const ReferenceLink = (props) => {
17802
- const { ownerReference, namespace: namespace2, pod: pod2 } = props;
17803
- const configs = React.useContext(ConfigsContext);
17804
- const { data: deploymentsData } = core.useList({
17805
- resource: "deployments",
17806
- meta: {
17807
- kind: "Deployment",
17808
- resourceBasePath: "/apis/apps/v1"
17809
- },
17810
- pagination: {
17811
- mode: "off"
17812
- }
17813
- });
17814
- const { data: replicaSetsData } = core.useList({
17815
- resource: "replicasets",
17816
- meta: {
17817
- kind: "ReplicaSet",
17818
- resourceBasePath: "/apis/apps/v1"
17819
- },
17820
- pagination: {
17821
- mode: "off"
17822
- }
17823
- });
17824
- if (ownerReference.kind === "ReplicaSet") {
17825
- const deployment = pod2.getBelongToDeployment(
17826
- (deploymentsData == null ? void 0 : deploymentsData.data) || [],
17827
- (replicaSetsData == null ? void 0 : replicaSetsData.data) || []
17828
- );
17829
- return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
17830
- ResourceLink,
17831
- {
17832
- name: (deployment == null ? void 0 : deployment.name) || "",
17833
- resourceName: "deployments",
17834
- namespace: namespace2
17835
- }
17836
- );
17837
- }
17838
- const resource = Object.values(configs).find((c2) => c2.kind === ownerReference.kind);
17839
- if (!resource) {
17840
- return /* @__PURE__ */ common.jsxRuntimeExports.jsx(ValueDisplay, { value: "" });
17841
- }
17842
- return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
17843
- ResourceLink,
17844
- {
17845
- name: ownerReference.name,
17846
- resourceName: resource.name || "",
17847
- namespace: namespace2
17848
- }
17849
- );
17850
- };
17851
17877
  const TextTags = (props) => {
17852
17878
  const { value: value2 } = props;
17853
17879
  if (!value2) {
@@ -20348,6 +20374,7 @@ exports.PodSelectorGroup = PodSelectorGroup;
20348
20374
  exports.PodShell = PodShell;
20349
20375
  exports.PodShellModal = PodShellModal;
20350
20376
  exports.PodWorkloadColumnRenderer = PodWorkloadColumnRenderer;
20377
+ exports.PodWorkloadField = PodWorkloadField;
20351
20378
  exports.PodsField = PodsField;
20352
20379
  exports.PodsGroup = PodsGroup;
20353
20380
  exports.PortMappingColumnRenderer = PortMappingColumnRenderer;
package/dist/refine.js CHANGED
@@ -7954,7 +7954,7 @@ var styled_default = process.env.NODE_ENV !== "production" ? new Proxy(styled, {
7954
7954
  return o(prop);
7955
7955
  }
7956
7956
  }) : styled;
7957
- const index_l4xyq7 = "";
7957
+ const index_o09auy = "";
7958
7958
  const ErrorWrapper = /* @__PURE__ */ styled_default("div")({
7959
7959
  name: "ErrorWrapper",
7960
7960
  class: "egn3dbn",
@@ -8012,6 +8012,9 @@ const WidgetErrorContent = (props) => {
8012
8012
  className: "error-content",
8013
8013
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("p", {
8014
8014
  className: cx_default(fontMap[type2], "title", `${type2}-title`),
8015
+ style: {
8016
+ marginBottom: !!refetch ? "8px" : "0"
8017
+ },
8015
8018
  children: errorText || t2("dovetail.obtain_data_error")
8016
8019
  }), props.children, !refetch ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
8017
8020
  size: type2 === "list" ? "middle" : "small",
@@ -10967,6 +10970,7 @@ const useEagleTable = (params) => {
10967
10970
  const { columns, tableProps, formatter, Dropdown: Dropdown2 = K8sDropdown } = params;
10968
10971
  const [selectedKeys, setSelectedKeys] = useState([]);
10969
10972
  const [currentPage, setCurrentPage] = useState((tableProps == null ? void 0 : tableProps.currentPage) || 1);
10973
+ const prevFiltersRef = useRef([]);
10970
10974
  const { resource } = useResource();
10971
10975
  const currentSize = (tableProps == null ? void 0 : tableProps.defaultSize) || 10;
10972
10976
  const useTableParams = useMemo(() => {
@@ -11040,10 +11044,11 @@ const useEagleTable = (params) => {
11040
11044
  ]);
11041
11045
  }, []);
11042
11046
  useEffect(() => {
11043
- if (isEqual$1(params.filters, table.filters)) {
11047
+ if (isEqual$1(params.filters, prevFiltersRef.current)) {
11044
11048
  return;
11045
11049
  }
11046
11050
  table.setFilters(params.filters || [], "replace");
11051
+ prevFiltersRef.current = params.filters || [];
11047
11052
  }, [params.filters]);
11048
11053
  return {
11049
11054
  tableProps: finalProps,
@@ -12218,6 +12223,56 @@ const NodeTaintsTable = ({
12218
12223
  showMenuColumn: false
12219
12224
  });
12220
12225
  };
12226
+ const ReferenceLink = (props) => {
12227
+ const { ownerReference, namespace: namespace2, pod: pod2 } = props;
12228
+ const configs = useContext(ConfigsContext);
12229
+ const { data: deploymentsData } = useList({
12230
+ resource: "deployments",
12231
+ meta: {
12232
+ kind: "Deployment",
12233
+ resourceBasePath: "/apis/apps/v1"
12234
+ },
12235
+ pagination: {
12236
+ mode: "off"
12237
+ }
12238
+ });
12239
+ const { data: replicaSetsData } = useList({
12240
+ resource: "replicasets",
12241
+ meta: {
12242
+ kind: "ReplicaSet",
12243
+ resourceBasePath: "/apis/apps/v1"
12244
+ },
12245
+ pagination: {
12246
+ mode: "off"
12247
+ }
12248
+ });
12249
+ if (ownerReference.kind === "ReplicaSet") {
12250
+ const deployment = pod2.getBelongToDeployment(
12251
+ (deploymentsData == null ? void 0 : deploymentsData.data) || [],
12252
+ (replicaSetsData == null ? void 0 : replicaSetsData.data) || []
12253
+ );
12254
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12255
+ ResourceLink,
12256
+ {
12257
+ name: (deployment == null ? void 0 : deployment.name) || "",
12258
+ resourceName: "deployments",
12259
+ namespace: namespace2
12260
+ }
12261
+ );
12262
+ }
12263
+ const resource = Object.values(configs).find((c2) => c2.kind === ownerReference.kind);
12264
+ if (!resource) {
12265
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, { value: "" });
12266
+ }
12267
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12268
+ ResourceLink,
12269
+ {
12270
+ name: ownerReference.name,
12271
+ resourceName: resource.name || "",
12272
+ namespace: namespace2
12273
+ }
12274
+ );
12275
+ };
12221
12276
  function PVVolumeModeDisplay(props) {
12222
12277
  const { value: value2 } = props;
12223
12278
  const i18n2 = useTranslation();
@@ -13144,6 +13199,27 @@ const PodCountOfJobField = (i18n2) => {
13144
13199
  }
13145
13200
  };
13146
13201
  };
13202
+ const PodWorkloadField = (i18n2) => {
13203
+ return {
13204
+ key: "podWorkload",
13205
+ title: i18n2.t("dovetail.workload"),
13206
+ path: ["metadata", "ownerReferences"],
13207
+ col: 12,
13208
+ renderContent(value2, record) {
13209
+ const ownerReferences = value2;
13210
+ if (!(ownerReferences == null ? void 0 : ownerReferences.length)) {
13211
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
13212
+ value: ""
13213
+ });
13214
+ }
13215
+ return ownerReferences.map((o) => /* @__PURE__ */ jsxRuntimeExports.jsx(ReferenceLink, {
13216
+ pod: record,
13217
+ ownerReference: o,
13218
+ namespace: record.metadata.namespace || "default"
13219
+ }, o.name));
13220
+ }
13221
+ };
13222
+ };
13147
13223
  const index_15s69c5 = "";
13148
13224
  const ItemWrapperStyle = "i1hk9uwu";
13149
13225
  const LabelsAndAnnotationsShow = ({
@@ -17779,56 +17855,6 @@ const EditButton = () => {
17779
17855
  }
17780
17856
  );
17781
17857
  };
17782
- const ReferenceLink = (props) => {
17783
- const { ownerReference, namespace: namespace2, pod: pod2 } = props;
17784
- const configs = useContext(ConfigsContext);
17785
- const { data: deploymentsData } = useList({
17786
- resource: "deployments",
17787
- meta: {
17788
- kind: "Deployment",
17789
- resourceBasePath: "/apis/apps/v1"
17790
- },
17791
- pagination: {
17792
- mode: "off"
17793
- }
17794
- });
17795
- const { data: replicaSetsData } = useList({
17796
- resource: "replicasets",
17797
- meta: {
17798
- kind: "ReplicaSet",
17799
- resourceBasePath: "/apis/apps/v1"
17800
- },
17801
- pagination: {
17802
- mode: "off"
17803
- }
17804
- });
17805
- if (ownerReference.kind === "ReplicaSet") {
17806
- const deployment = pod2.getBelongToDeployment(
17807
- (deploymentsData == null ? void 0 : deploymentsData.data) || [],
17808
- (replicaSetsData == null ? void 0 : replicaSetsData.data) || []
17809
- );
17810
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
17811
- ResourceLink,
17812
- {
17813
- name: (deployment == null ? void 0 : deployment.name) || "",
17814
- resourceName: "deployments",
17815
- namespace: namespace2
17816
- }
17817
- );
17818
- }
17819
- const resource = Object.values(configs).find((c2) => c2.kind === ownerReference.kind);
17820
- if (!resource) {
17821
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, { value: "" });
17822
- }
17823
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
17824
- ResourceLink,
17825
- {
17826
- name: ownerReference.name,
17827
- resourceName: resource.name || "",
17828
- namespace: namespace2
17829
- }
17830
- );
17831
- };
17832
17858
  const TextTags = (props) => {
17833
17859
  const { value: value2 } = props;
17834
17860
  if (!value2) {
@@ -20330,6 +20356,7 @@ export {
20330
20356
  PodShell,
20331
20357
  PodShellModal,
20332
20358
  PodWorkloadColumnRenderer,
20359
+ PodWorkloadField,
20333
20360
  PodsField,
20334
20361
  PodsGroup,
20335
20362
  PortMappingColumnRenderer,
package/dist/style.css CHANGED
@@ -730,9 +730,6 @@
730
730
  align-items: center;
731
731
  justify-content: center;
732
732
  }
733
- .e136jgy8 .title {
734
- margin-bottom: 8px;
735
- }
736
733
  .e136jgy8 .title.list-title {
737
734
  margin-bottom: 16px;
738
735
  }/* // basic */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.3.20-alpha.1",
3
+ "version": "0.3.21-alpha.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -10,8 +10,8 @@
10
10
  "module": "./dist/refine.js",
11
11
  "types": "./dist/index.d.ts",
12
12
  "dependencies": {
13
- "@cloudtower/eagle": "^0.34.24",
14
- "@cloudtower/icons-react": "^0.34.24",
13
+ "@cloudtower/eagle": "^490.0.1",
14
+ "@cloudtower/icons-react": "^490.0.1",
15
15
  "@patternfly/react-core": "^5.1.1",
16
16
  "@patternfly/react-log-viewer": "^5.0.0",
17
17
  "@refinedev/core": "^4.47.2",
@@ -86,8 +86,8 @@
86
86
  "vite-plugin-commonjs": "^0.10.0"
87
87
  },
88
88
  "peerDependencies": {
89
- "@cloudtower/eagle": "^0.34.24",
90
- "@cloudtower/icons-react": "^0.34.24",
89
+ "@cloudtower/eagle": "^490.0.1",
90
+ "@cloudtower/icons-react": "^490.0.1",
91
91
  "@refinedev/core": "^4.47.2",
92
92
  "antd": "4.5.0",
93
93
  "i18next": "^23.2.3",