feat: query Polaris dashboard API instead of ConfigMap
The plugin now fetches audit data from the Polaris dashboard service via the Kubernetes service proxy instead of reading from a ConfigMap. This works with the standard Polaris dashboard deployment without requiring additional configuration. - Replace ConfigMap.useGet with ApiProxy.request to /results.json - Compute score from result counts (pass/total) since the API response doesn't include a pre-computed score - Update error messages for service proxy context - Update CLAUDE.md to reflect new data source Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { Loader, SectionBox, SectionHeader } from '@kinvolk/headlamp-plugin/lib/
|
||||
import React from 'react';
|
||||
import {
|
||||
AuditData,
|
||||
computeScore,
|
||||
countResults,
|
||||
getRefreshInterval,
|
||||
ResultCounts,
|
||||
@@ -69,10 +70,11 @@ function ScoreBadge(props: { score: number }) {
|
||||
}
|
||||
|
||||
function OverviewSection(props: { data: AuditData; counts: ResultCounts }) {
|
||||
const score = computeScore(props.counts);
|
||||
return (
|
||||
<>
|
||||
<SectionBox title="Score">
|
||||
<ScoreBadge score={props.data.Score} />
|
||||
<ScoreBadge score={score} />
|
||||
</SectionBox>
|
||||
<SectionBox title="Check Summary">
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user