diff --git a/src/components/PolarisView.tsx b/src/components/PolarisView.tsx
index 7a7313f..16f0127 100644
--- a/src/components/PolarisView.tsx
+++ b/src/components/PolarisView.tsx
@@ -1,4 +1,11 @@
-import { Loader, SectionBox, SectionHeader } from '@kinvolk/headlamp-plugin/lib/CommonComponents';
+import {
+ HeaderLabel,
+ Loader,
+ NameValueTable,
+ SectionBox,
+ SectionHeader,
+ StatusLabel,
+} from '@kinvolk/headlamp-plugin/lib/CommonComponents';
import React from 'react';
import {
AuditData,
@@ -17,94 +24,81 @@ const INTERVAL_OPTIONS = [
{ label: '30 minutes', value: 1800 },
];
+function scoreStatus(score: number): 'success' | 'warning' | 'error' {
+ if (score >= 80) return 'success';
+ if (score >= 50) return 'warning';
+ return 'error';
+}
+
function RefreshSettings(props: { interval: number; onChange: (seconds: number) => void }) {
return (
-
-
-
-
- );
-}
-
-function StatCard(props: { label: string; value: number; color?: string }) {
- return (
-
-
- {props.value}
-
-
{props.label}
-
- );
-}
-
-function ScoreBadge(props: { score: number }) {
- const color = props.score >= 80 ? '#4caf50' : props.score >= 50 ? '#ff9800' : '#f44336';
- return (
-
-
{props.score}%
-
Cluster Score
-
+ o.value === props.interval)?.label ?? ''}
+ />
);
}
function OverviewSection(props: { data: AuditData; counts: ResultCounts }) {
const score = computeScore(props.counts);
+ const status = scoreStatus(score);
+
return (
<>
-
+
+ {score}%
+
+ ),
+ },
+ ]}
+ />
-
-
-
-
-
-
+
+ {props.counts.pass}
+
+ ),
+ },
+ {
+ name: 'Warning',
+ value: (
+
+ {props.counts.warning}
+
+ ),
+ },
+ {
+ name: 'Danger',
+ value: (
+
+ {props.counts.danger}
+
+ ),
+ },
+ ]}
+ />
-
-
-
-
-
-
+
>
);
@@ -137,7 +131,18 @@ export default function PolarisView() {
{error && (
- {error}
+
+ {error}
+
+ ),
+ },
+ ]}
+ />
)}
@@ -145,7 +150,14 @@ export default function PolarisView() {
{!data && !error && (
- No Polaris audit results found.
+
)}
>