Skip to content

Commit 00b1593

Browse files
committed
flux: Add node weight to flux nodes in Map
1 parent 3716760 commit 00b1593

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

flux/src/mapView.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
import { Icon } from '@iconify/react';
22
import Deployment from '@kinvolk/headlamp-plugin/lib/K8s/deployment';
33
import { useMemo } from 'react';
4-
import { helmReleaseClass } from './helm-releases/HelmReleaseList';
4+
import { HelmRelease, HelmRepository, Kustomization, OCIRepository } from './common/Resources';
55
import { FluxHelmReleaseDetailView } from './helm-releases/HelmReleaseSingle';
6-
import { kustomizationClass } from './kustomizations/KustomizationList';
76
import { FluxKustomizationDetailView } from './kustomizations/KustomizationSingle';
8-
import { helmRepositoryClass, ociRepositoryClass } from './sources/SourceList';
97
import { FluxSourceDetailView } from './sources/SourceSingle';
108

11-
const HelmRelease = helmReleaseClass();
12-
const HelmRepostory = helmRepositoryClass();
13-
const OciSource = ociRepositoryClass();
14-
const Kustomization = kustomizationClass();
15-
169
export const makeKubeToKubeEdge = (from: any, to: any): any => ({
1710
id: `${from.metadata.uid}-${to.metadata.uid}`,
1811
source: from.metadata.uid,
@@ -51,7 +44,7 @@ const helmRepositorySource: any = {
5144
label: 'Helm Repository',
5245
icon: <Icon icon="simple-icons:flux" width="100%" height="100%" color="rgb(50, 108, 229)" />,
5346
useData() {
54-
const [repositories] = HelmRepostory.useList();
47+
const [repositories] = HelmRepository.useList();
5548
const [releases] = HelmRelease.useList();
5649

5750
return useMemo(() => {
@@ -61,6 +54,7 @@ const helmRepositorySource: any = {
6154
id: it.metadata.uid,
6255
kubeObject: it,
6356
detailsComponent: HelmRepositoryDetails,
57+
weight: 1100,
6458
}));
6559
const edges: any[] = [];
6660

@@ -100,6 +94,7 @@ const helmReleaseSource = {
10094
id: it.metadata.uid,
10195
kubeObject: it,
10296
detailsComponent: HelmReleaseDetails,
97+
weight: 1050,
10398
}));
10499
const edges = [];
105100

@@ -139,6 +134,7 @@ const kustomizationSource = {
139134
id: it.metadata.uid,
140135
kubeObject: it,
141136
detailsComponent: KustomizationDetails,
137+
weight: 1050,
142138
}));
143139
const edges = [];
144140

@@ -170,14 +166,15 @@ const ociSource = {
170166
icon: <Icon icon="simple-icons:flux" width="100%" height="100%" color="rgb(50, 108, 229)" />,
171167
useData() {
172168
const [kustomizations] = Kustomization.useList();
173-
const [ocisources] = OciSource.useList();
169+
const [ocisources] = OCIRepository.useList();
174170

175171
return useMemo(() => {
176172
if (!kustomizations || !ocisources) return null;
177173
const nodes = ocisources?.map(it => ({
178174
id: it.metadata.uid,
179175
kubeObject: it,
180176
detailsComponent: OCIRepositoryDetails,
177+
weight: 1100,
181178
}));
182179
const edges = [];
183180

0 commit comments

Comments
 (0)