Skip to content

Commit 56d259e

Browse files
authored
Merge pull request #70 from oslabs-beta/dev
Dev
2 parents aa439dd + 0fbf605 commit 56d259e

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

client/src/components/ClusterSelector.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import {
77
SelectValue,
88
} from '@/components/ui/select';
99
import { useCluster } from '@/contexts/ClusterContext';
10-
import { ServerIcon, MapPinIcon } from 'lucide-react';
10+
import { ServerIcon } from 'lucide-react';
1111

1212
const ClusterSelector: React.FC = () => {
13-
const { clusters, selectedCluster, setSelectedCluster, loading } = useCluster();
13+
const { clusters, selectedCluster, setSelectedCluster, loading } =
14+
useCluster();
1415

1516
if (loading) {
1617
return (
17-
<div className="flex items-center gap-2 text-sm text-muted-foreground">
18+
<div className="text-muted-foreground flex items-center gap-2 text-sm">
1819
<ServerIcon className="h-4 w-4" />
1920
Loading clusters...
2021
</div>
@@ -23,7 +24,7 @@ const ClusterSelector: React.FC = () => {
2324

2425
if (clusters.length === 0) {
2526
return (
26-
<div className="flex items-center gap-2 text-sm text-muted-foreground">
27+
<div className="text-muted-foreground flex items-center gap-2 text-sm">
2728
<ServerIcon className="h-4 w-4" />
2829
No clusters available
2930
</div>
@@ -32,21 +33,23 @@ const ClusterSelector: React.FC = () => {
3233

3334
const handleClusterChange = (value: string) => {
3435
const [name, location] = value.split('|');
35-
const cluster = clusters.find(c => c.name === name && c.location === location);
36+
const cluster = clusters.find(
37+
(c) => c.name === name && c.location === location,
38+
);
3639
if (cluster) {
3740
setSelectedCluster(cluster);
3841
}
3942
};
4043

41-
const selectedValue = selectedCluster
44+
const selectedValue = selectedCluster
4245
? `${selectedCluster.name}|${selectedCluster.location}`
4346
: '';
4447

4548
return (
4649
<div className="flex items-center gap-3">
4750
<div className="flex items-center gap-2 text-sm font-medium">
48-
<ServerIcon className="h-4 w-4 text-primary" />
49-
<span>Cluster:</span>
51+
<ServerIcon className="text-primary h-4 w-4" />
52+
<span>Connected to</span>
5053
</div>
5154
<Select value={selectedValue} onValueChange={handleClusterChange}>
5255
<SelectTrigger className="w-[280px]">
@@ -60,10 +63,6 @@ const ClusterSelector: React.FC = () => {
6063
<div className="flex items-center gap-2">
6164
<div className="flex flex-col">
6265
<span className="font-medium">{cluster.name}</span>
63-
<div className="flex items-center gap-1 text-xs text-muted-foreground">
64-
<MapPinIcon className="h-3 w-3" />
65-
{cluster.location}
66-
</div>
6766
</div>
6867
</div>
6968
</SelectItem>
@@ -76,4 +75,3 @@ const ClusterSelector: React.FC = () => {
7675
};
7776

7877
export default ClusterSelector;
79-

client/src/components/EnhancedInfoCard.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
NetworkIcon,
1010
ServerIcon,
1111
Activity,
12+
MapPinIcon,
1213
} from 'lucide-react';
1314
import { useFetchMetrics } from '../hooks/hookMetric';
1415
import { motion } from 'motion/react';
@@ -43,7 +44,11 @@ const StatusBadge = ({ status }: { status: string }) => {
4344
};
4445

4546
const GKEClusterCard: React.FC = () => {
46-
const { selectedCluster: cluster, loading: clusterLoading, error } = useCluster();
47+
const {
48+
selectedCluster: cluster,
49+
loading: clusterLoading,
50+
error,
51+
} = useCluster();
4752

4853
const cpuMetric = 'kubernetes.io/container/cpu/limit_utilization';
4954
const memMetric = 'kubernetes.io/container/memory/request_utilization';

0 commit comments

Comments
 (0)