Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b6d7e6b6c | |||
| 0e5ff9b7b7 | |||
| 8fab7828f4 | |||
| 1733eab21b |
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
version: 0.3.11
|
version: 0.3.12
|
||||||
name: headlamp-polaris-plugin
|
name: headlamp-polaris-plugin
|
||||||
displayName: Polaris
|
displayName: Polaris
|
||||||
createdAt: "2026-02-05T19:00:00Z"
|
createdAt: "2026-02-05T19:00:00Z"
|
||||||
@@ -28,7 +28,7 @@ maintainers:
|
|||||||
- name: privilegedescalation
|
- name: privilegedescalation
|
||||||
email: "chris@farhood.org"
|
email: "chris@farhood.org"
|
||||||
annotations:
|
annotations:
|
||||||
headlamp/plugin/archive-url: "https://github.com/privilegedescalation/headlamp-polaris-plugin/releases/download/v0.3.11/polaris-0.3.11.tar.gz"
|
headlamp/plugin/archive-url: "https://github.com/privilegedescalation/headlamp-polaris-plugin/releases/download/v0.3.12/polaris-0.3.12.tar.gz"
|
||||||
headlamp/plugin/version-compat: ">=0.26"
|
headlamp/plugin/version-compat: ">=0.26"
|
||||||
headlamp/plugin/archive-checksum: sha256:7df8d2066276eec0bdaad98d8a5bd7350861acc216963f7421c5ae476cd725b4
|
headlamp/plugin/archive-checksum: sha256:10ef76ed76a4320fce77159db135f817c7e695790786869fae162583ead82ccd
|
||||||
headlamp/plugin/distro-compat: in-cluster
|
headlamp/plugin/distro-compat: in-cluster
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "polaris",
|
"name": "polaris",
|
||||||
"version": "0.3.11",
|
"version": "0.3.12",
|
||||||
"description": "Headlamp plugin for Fairwinds Polaris audit results",
|
"description": "Headlamp plugin for Fairwinds Polaris audit results",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -35,8 +35,20 @@ const PolarisDataContext = React.createContext<PolarisDataContextValue | null>(n
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export function PolarisDataProvider(props: { children: React.ReactNode }) {
|
export function PolarisDataProvider(props: { children: React.ReactNode }) {
|
||||||
const interval = getRefreshInterval();
|
// Re-read interval on every render to pick up changes from settings
|
||||||
const state = usePolarisData(interval);
|
const [refreshInterval, setRefreshInterval] = React.useState(getRefreshInterval());
|
||||||
|
|
||||||
|
// Poll for interval changes (localStorage changes from settings)
|
||||||
|
React.useEffect(() => {
|
||||||
|
const intervalId = window.setInterval(() => {
|
||||||
|
const newInterval = getRefreshInterval();
|
||||||
|
setRefreshInterval(prev => (prev !== newInterval ? newInterval : prev));
|
||||||
|
}, 1000); // Check every second
|
||||||
|
|
||||||
|
return () => window.clearInterval(intervalId);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const state = usePolarisData(refreshInterval);
|
||||||
|
|
||||||
// Rename triggerRefresh to refresh for consistency
|
// Rename triggerRefresh to refresh for consistency
|
||||||
const value = React.useMemo(
|
const value = React.useMemo(
|
||||||
|
|||||||
+3
-1
@@ -373,7 +373,9 @@ export function usePolarisData(refreshIntervalSeconds: number): PolarisDataState
|
|||||||
result = await response.json();
|
result = await response.json();
|
||||||
} else {
|
} else {
|
||||||
// Kubernetes proxy for relative URLs
|
// Kubernetes proxy for relative URLs
|
||||||
result = await ApiProxy.request(apiPath);
|
result = await ApiProxy.request(apiPath, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cancelled) {
|
if (!cancelled) {
|
||||||
|
|||||||
@@ -58,7 +58,9 @@ export default function PolarisSettings(props: PluginSettingsProps) {
|
|||||||
}
|
}
|
||||||
result = await response.json();
|
result = await response.json();
|
||||||
} else {
|
} else {
|
||||||
result = await ApiProxy.request(apiPath);
|
result = await ApiProxy.request(apiPath, {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setTestResult({
|
setTestResult({
|
||||||
|
|||||||
Reference in New Issue
Block a user