Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b2cbce16c1 | |||
| c95aab3ca3 | |||
| 604106c688 | |||
| 44a0016a4d | |||
| 03d7379e13 | |||
| 861dff6901 | |||
| 03b75a836b |
@@ -0,0 +1,102 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Check if release is already finalized
|
||||||
|
run: |
|
||||||
|
VERSION=${GITHUB_REF_NAME#v}
|
||||||
|
TARBALL_URL="https://github.com/${{ github.repository }}/releases/download/${GITHUB_REF_NAME}/headlamp-polaris-plugin-${VERSION}.tar.gz"
|
||||||
|
HTTP_CODE=$(curl -sL -o /tmp/release.tar.gz -w "%{http_code}" "$TARBALL_URL" 2>/dev/null)
|
||||||
|
if [ "$HTTP_CODE" = "200" ]; then
|
||||||
|
ACTUAL="sha256:$(sha256sum /tmp/release.tar.gz | awk '{print $1}')"
|
||||||
|
EXPECTED=$(grep 'archive-checksum' artifacthub-pkg.yml | awk '{print $2}')
|
||||||
|
echo "Release tarball checksum: $ACTUAL"
|
||||||
|
echo "Metadata checksum: $EXPECTED"
|
||||||
|
if [ "$ACTUAL" = "$EXPECTED" ]; then
|
||||||
|
echo "SKIP_BUILD=true" >> $GITHUB_ENV
|
||||||
|
echo "Checksums match - release is finalized, nothing to do"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No existing release (HTTP $HTTP_CODE) - will build"
|
||||||
|
fi
|
||||||
|
rm -f /tmp/release.tar.gz
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
if: env.SKIP_BUILD != 'true'
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
if: env.SKIP_BUILD != 'true'
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build plugin
|
||||||
|
if: env.SKIP_BUILD != 'true'
|
||||||
|
run: npx @kinvolk/headlamp-plugin build
|
||||||
|
|
||||||
|
- name: Package tarball
|
||||||
|
if: env.SKIP_BUILD != 'true'
|
||||||
|
run: npx @kinvolk/headlamp-plugin package
|
||||||
|
|
||||||
|
- name: Compute tarball checksum
|
||||||
|
if: env.SKIP_BUILD != 'true'
|
||||||
|
run: |
|
||||||
|
TARBALL=$(ls *.tar.gz)
|
||||||
|
CHECKSUM=$(sha256sum "$TARBALL" | awk '{print $1}')
|
||||||
|
echo "TARBALL=$TARBALL" >> $GITHUB_ENV
|
||||||
|
echo "CHECKSUM=$CHECKSUM" >> $GITHUB_ENV
|
||||||
|
echo "Tarball: $TARBALL"
|
||||||
|
echo "Checksum: sha256:$CHECKSUM"
|
||||||
|
|
||||||
|
- name: Create GitHub release and upload tarball
|
||||||
|
if: env.SKIP_BUILD != 'true'
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: ${{ env.TARBALL }}
|
||||||
|
fail_on_unmatched_files: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Update metadata and align tag
|
||||||
|
if: env.SKIP_BUILD != 'true'
|
||||||
|
run: |
|
||||||
|
VERSION=${GITHUB_REF_NAME#v}
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
|
# Update metadata
|
||||||
|
git fetch origin main
|
||||||
|
git checkout origin/main -B temp-update
|
||||||
|
sed -i "s|headlamp/plugin/archive-checksum:.*|headlamp/plugin/archive-checksum: sha256:${CHECKSUM}|" artifacthub-pkg.yml
|
||||||
|
sed -i "s|headlamp/plugin/archive-url:.*|headlamp/plugin/archive-url: \"https://github.com/${{ github.repository }}/releases/download/${GITHUB_REF_NAME}/headlamp-polaris-plugin-${VERSION}.tar.gz\"|" artifacthub-pkg.yml
|
||||||
|
sed -i "s|^version:.*|version: ${VERSION}|" artifacthub-pkg.yml
|
||||||
|
git add artifacthub-pkg.yml
|
||||||
|
|
||||||
|
if ! git diff --cached --quiet; then
|
||||||
|
git commit -m "ci: update artifact hub metadata for ${GITHUB_REF_NAME}"
|
||||||
|
git push origin temp-update:main
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Force-move tag to the commit with correct checksum.
|
||||||
|
# This triggers a new CI run, but the guard step will detect
|
||||||
|
# that the release checksum already matches and skip the build.
|
||||||
|
git tag -f ${GITHUB_REF_NAME}
|
||||||
|
git push -f origin ${GITHUB_REF_NAME}
|
||||||
|
echo "Tag ${GITHUB_REF_NAME} aligned with updated metadata"
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
version: 0.2.0
|
version: 0.2.3
|
||||||
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: cpfarhood
|
- name: cpfarhood
|
||||||
email: "chris@farhood.org"
|
email: "chris@farhood.org"
|
||||||
annotations:
|
annotations:
|
||||||
headlamp/plugin/archive-url: "https://github.com/cpfarhood/headlamp-polaris-plugin/releases/download/v0.2.0/headlamp-polaris-plugin-0.2.0.tar.gz"
|
headlamp/plugin/archive-url: "https://github.com/cpfarhood/headlamp-polaris-plugin/releases/download/v0.2.3/headlamp-polaris-plugin-0.2.3.tar.gz"
|
||||||
headlamp/plugin/version-compat: ">=0.26"
|
headlamp/plugin/version-compat: ">=0.26"
|
||||||
headlamp/plugin/archive-checksum: sha256:f2e81af7b9e200cda2791baca284b6b06f48f2d662a04e9ef5a9d421757e5963
|
headlamp/plugin/archive-checksum: sha256:20f0a39450cb45258b5b8f10252a6d9ce1d6bdccd39c2347f5b316020ac2cb01
|
||||||
headlamp/plugin/distro-compat: in-cluster
|
headlamp/plugin/distro-compat: in-cluster
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "headlamp-polaris-plugin",
|
"name": "headlamp-polaris-plugin",
|
||||||
"version": "0.1.3",
|
"version": "0.2.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "headlamp-polaris-plugin",
|
"name": "headlamp-polaris-plugin",
|
||||||
"version": "0.1.3",
|
"version": "0.2.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@kinvolk/headlamp-plugin": "^0.13.0",
|
"@kinvolk/headlamp-plugin": "^0.13.0",
|
||||||
"@playwright/test": "^1.58.2"
|
"@playwright/test": "^1.58.2"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "headlamp-polaris-plugin",
|
"name": "headlamp-polaris-plugin",
|
||||||
"version": "0.2.0",
|
"version": "0.2.3",
|
||||||
"description": "Headlamp plugin for Fairwinds Polaris audit results",
|
"description": "Headlamp plugin for Fairwinds Polaris audit results",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "headlamp-plugin start",
|
"start": "headlamp-plugin start",
|
||||||
|
|||||||
+67
-17
@@ -125,11 +125,14 @@ export const INTERVAL_OPTIONS = [
|
|||||||
{ label: '30 minutes', value: 1800 },
|
{ label: '30 minutes', value: 1800 },
|
||||||
];
|
];
|
||||||
|
|
||||||
const STORAGE_KEY = 'polaris-plugin-refresh-interval';
|
const REFRESH_STORAGE_KEY = 'polaris-plugin-refresh-interval';
|
||||||
const DEFAULT_INTERVAL_SECONDS = 300; // 5 minutes
|
const DEFAULT_INTERVAL_SECONDS = 300; // 5 minutes
|
||||||
|
|
||||||
|
const URL_STORAGE_KEY = 'polaris-plugin-dashboard-url';
|
||||||
|
const DEFAULT_DASHBOARD_URL = '/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/';
|
||||||
|
|
||||||
export function getRefreshInterval(): number {
|
export function getRefreshInterval(): number {
|
||||||
const stored = localStorage.getItem(STORAGE_KEY);
|
const stored = localStorage.getItem(REFRESH_STORAGE_KEY);
|
||||||
if (stored !== null) {
|
if (stored !== null) {
|
||||||
const parsed = parseInt(stored, 10);
|
const parsed = parseInt(stored, 10);
|
||||||
if (!isNaN(parsed) && parsed > 0) {
|
if (!isNaN(parsed) && parsed > 0) {
|
||||||
@@ -140,13 +143,26 @@ export function getRefreshInterval(): number {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function setRefreshInterval(seconds: number): void {
|
export function setRefreshInterval(seconds: number): void {
|
||||||
localStorage.setItem(STORAGE_KEY, String(seconds));
|
localStorage.setItem(REFRESH_STORAGE_KEY, String(seconds));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDashboardUrl(): string {
|
||||||
|
const stored = localStorage.getItem(URL_STORAGE_KEY);
|
||||||
|
if (stored !== null && stored.trim() !== '') {
|
||||||
|
return stored.trim();
|
||||||
|
}
|
||||||
|
return DEFAULT_DASHBOARD_URL;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setDashboardUrl(url: string): void {
|
||||||
|
localStorage.setItem(URL_STORAGE_KEY, url.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Polaris dashboard proxy URL ---
|
// --- Polaris dashboard proxy URL ---
|
||||||
|
|
||||||
export const POLARIS_DASHBOARD_PROXY =
|
export function getPolarisProxyUrl(): string {
|
||||||
'/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/';
|
return getDashboardUrl();
|
||||||
|
}
|
||||||
|
|
||||||
// --- Score computation ---
|
// --- Score computation ---
|
||||||
|
|
||||||
@@ -157,8 +173,14 @@ export function computeScore(counts: ResultCounts): number {
|
|||||||
|
|
||||||
// --- Data fetching hook ---
|
// --- Data fetching hook ---
|
||||||
|
|
||||||
const POLARIS_API_PATH =
|
function getPolarisApiPath(): string {
|
||||||
'/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/results.json';
|
const baseUrl = getDashboardUrl();
|
||||||
|
return baseUrl.endsWith('/') ? `${baseUrl}results.json` : `${baseUrl}/results.json`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isFullUrl(url: string): boolean {
|
||||||
|
return url.startsWith('http://') || url.startsWith('https://');
|
||||||
|
}
|
||||||
|
|
||||||
interface PolarisDataState {
|
interface PolarisDataState {
|
||||||
data: AuditData | null;
|
data: AuditData | null;
|
||||||
@@ -177,7 +199,21 @@ export function usePolarisData(refreshIntervalSeconds: number): PolarisDataState
|
|||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
try {
|
try {
|
||||||
const result: AuditData = await ApiProxy.request(POLARIS_API_PATH);
|
const apiPath = getPolarisApiPath();
|
||||||
|
let result: AuditData;
|
||||||
|
|
||||||
|
if (isFullUrl(apiPath)) {
|
||||||
|
// Direct fetch for full URLs
|
||||||
|
const response = await fetch(apiPath);
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
||||||
|
}
|
||||||
|
result = await response.json();
|
||||||
|
} else {
|
||||||
|
// Kubernetes proxy for relative URLs
|
||||||
|
result = await ApiProxy.request(apiPath);
|
||||||
|
}
|
||||||
|
|
||||||
if (!cancelled) {
|
if (!cancelled) {
|
||||||
setData(result);
|
setData(result);
|
||||||
setError(null);
|
setError(null);
|
||||||
@@ -185,17 +221,31 @@ export function usePolarisData(refreshIntervalSeconds: number): PolarisDataState
|
|||||||
}
|
}
|
||||||
} catch (err: unknown) {
|
} catch (err: unknown) {
|
||||||
if (cancelled) return;
|
if (cancelled) return;
|
||||||
|
const apiPath = getPolarisApiPath();
|
||||||
const status = (err as { status?: number }).status;
|
const status = (err as { status?: number }).status;
|
||||||
if (status === 403) {
|
|
||||||
setError(
|
if (isFullUrl(apiPath)) {
|
||||||
'Access denied (403). Check that your RBAC permissions allow proxying to the Polaris service.'
|
// Full URL errors
|
||||||
);
|
if (status === 403) {
|
||||||
} else if (status === 404 || status === 503) {
|
setError('Access denied (403). Check authentication and CORS configuration.');
|
||||||
setError(
|
} else if (status === 404) {
|
||||||
'Polaris dashboard not reachable. Ensure Polaris is installed in the polaris namespace.'
|
setError('Polaris dashboard not found (404). Verify the URL is correct.');
|
||||||
);
|
} else {
|
||||||
|
setError(`Failed to fetch from ${apiPath}: ${String(err)}`);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setError(`Failed to fetch Polaris data: ${String(err)}`);
|
// Kubernetes proxy errors
|
||||||
|
if (status === 403) {
|
||||||
|
setError(
|
||||||
|
'Access denied (403). Check that your RBAC permissions allow proxying to the Polaris service.'
|
||||||
|
);
|
||||||
|
} else if (status === 404 || status === 503) {
|
||||||
|
setError(
|
||||||
|
'Polaris dashboard not reachable. Ensure Polaris is installed in the configured namespace.'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
setError(`Failed to fetch Polaris data: ${String(err)}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ function OverviewSection(props: { data: AuditData; counts: ResultCounts }) {
|
|||||||
{ name: 'Pass', value: counts.pass, fill: COLORS.pass },
|
{ name: 'Pass', value: counts.pass, fill: COLORS.pass },
|
||||||
{ name: 'Warning', value: counts.warning, fill: COLORS.warning },
|
{ name: 'Warning', value: counts.warning, fill: COLORS.warning },
|
||||||
{ name: 'Danger', value: counts.danger, fill: COLORS.danger },
|
{ name: 'Danger', value: counts.danger, fill: COLORS.danger },
|
||||||
{ name: 'Skipped', value: counts.skipped, fill: COLORS.skipped },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -51,14 +50,6 @@ function OverviewSection(props: { data: AuditData; counts: ResultCounts }) {
|
|||||||
name: 'Danger',
|
name: 'Danger',
|
||||||
value: <StatusLabel status="error">{counts.danger}</StatusLabel>,
|
value: <StatusLabel status="error">{counts.danger}</StatusLabel>,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'Skipped',
|
|
||||||
value: (
|
|
||||||
<span title="Only counts checks with Severity=ignore. Annotation-based exemptions are not included.">
|
|
||||||
{counts.skipped}
|
|
||||||
</span>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</SectionBox>
|
</SectionBox>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
computeScore,
|
computeScore,
|
||||||
countResultsForItems,
|
countResultsForItems,
|
||||||
filterResultsByNamespace,
|
filterResultsByNamespace,
|
||||||
POLARIS_DASHBOARD_PROXY,
|
getPolarisProxyUrl,
|
||||||
Result,
|
Result,
|
||||||
ResultCounts,
|
ResultCounts,
|
||||||
} from '../api/polaris';
|
} from '../api/polaris';
|
||||||
@@ -89,7 +89,7 @@ export default function NamespaceDetailView() {
|
|||||||
{
|
{
|
||||||
name: 'Polaris Dashboard',
|
name: 'Polaris Dashboard',
|
||||||
value: (
|
value: (
|
||||||
<a href={POLARIS_DASHBOARD_PROXY} target="_blank" rel="noopener noreferrer">
|
<a href={getPolarisProxyUrl()} target="_blank" rel="noopener noreferrer">
|
||||||
View in Polaris Dashboard
|
View in Polaris Dashboard
|
||||||
</a>
|
</a>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
countResultsForItems,
|
countResultsForItems,
|
||||||
filterResultsByNamespace,
|
filterResultsByNamespace,
|
||||||
getNamespaces,
|
getNamespaces,
|
||||||
POLARIS_DASHBOARD_PROXY,
|
getPolarisProxyUrl,
|
||||||
Result,
|
Result,
|
||||||
ResultCounts,
|
ResultCounts,
|
||||||
} from '../api/polaris';
|
} from '../api/polaris';
|
||||||
@@ -102,7 +102,7 @@ function NamespaceDetailPanel({ namespace, onClose }: NamespaceDetailPanelProps)
|
|||||||
right: 0,
|
right: 0,
|
||||||
top: 0,
|
top: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
width: '600px',
|
width: '800px',
|
||||||
backgroundColor: 'var(--background-paper, #fff)',
|
backgroundColor: 'var(--background-paper, #fff)',
|
||||||
boxShadow: '-2px 0 8px rgba(0,0,0,0.15)',
|
boxShadow: '-2px 0 8px rgba(0,0,0,0.15)',
|
||||||
overflowY: 'auto',
|
overflowY: 'auto',
|
||||||
@@ -140,7 +140,7 @@ function NamespaceDetailPanel({ namespace, onClose }: NamespaceDetailPanelProps)
|
|||||||
{
|
{
|
||||||
name: 'Polaris Dashboard',
|
name: 'Polaris Dashboard',
|
||||||
value: (
|
value: (
|
||||||
<a href={POLARIS_DASHBOARD_PROXY} target="_blank" rel="noopener noreferrer">
|
<a href={getPolarisProxyUrl()} target="_blank" rel="noopener noreferrer">
|
||||||
View in Polaris Dashboard
|
View in Polaris Dashboard
|
||||||
</a>
|
</a>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { NameValueTable, SectionBox } from '@kinvolk/headlamp-plugin/lib/CommonComponents';
|
import { NameValueTable, SectionBox } from '@kinvolk/headlamp-plugin/lib/CommonComponents';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { getRefreshInterval, INTERVAL_OPTIONS, setRefreshInterval } from '../api/polaris';
|
import { getDashboardUrl, getRefreshInterval, INTERVAL_OPTIONS, setDashboardUrl, setRefreshInterval } from '../api/polaris';
|
||||||
|
|
||||||
interface PluginSettingsProps {
|
interface PluginSettingsProps {
|
||||||
data?: { [key: string]: string | number | boolean };
|
data?: { [key: string]: string | number | boolean };
|
||||||
@@ -10,13 +10,20 @@ interface PluginSettingsProps {
|
|||||||
export default function PolarisSettings(props: PluginSettingsProps) {
|
export default function PolarisSettings(props: PluginSettingsProps) {
|
||||||
const { data, onDataChange } = props;
|
const { data, onDataChange } = props;
|
||||||
const currentInterval = (data?.refreshInterval as number) ?? getRefreshInterval();
|
const currentInterval = (data?.refreshInterval as number) ?? getRefreshInterval();
|
||||||
|
const currentUrl = (data?.dashboardUrl as string) ?? getDashboardUrl();
|
||||||
|
|
||||||
function handleChange(e: React.ChangeEvent<HTMLSelectElement>) {
|
function handleIntervalChange(e: React.ChangeEvent<HTMLSelectElement>) {
|
||||||
const seconds = Number(e.target.value);
|
const seconds = Number(e.target.value);
|
||||||
setRefreshInterval(seconds);
|
setRefreshInterval(seconds);
|
||||||
onDataChange?.({ ...data, refreshInterval: seconds });
|
onDataChange?.({ ...data, refreshInterval: seconds });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleUrlChange(e: React.ChangeEvent<HTMLInputElement>) {
|
||||||
|
const url = e.target.value;
|
||||||
|
setDashboardUrl(url);
|
||||||
|
onDataChange?.({ ...data, dashboardUrl: url });
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SectionBox title="Polaris Settings">
|
<SectionBox title="Polaris Settings">
|
||||||
<NameValueTable
|
<NameValueTable
|
||||||
@@ -24,7 +31,7 @@ export default function PolarisSettings(props: PluginSettingsProps) {
|
|||||||
{
|
{
|
||||||
name: 'Refresh Interval',
|
name: 'Refresh Interval',
|
||||||
value: (
|
value: (
|
||||||
<select value={currentInterval} onChange={handleChange}>
|
<select value={currentInterval} onChange={handleIntervalChange}>
|
||||||
{INTERVAL_OPTIONS.map(opt => (
|
{INTERVAL_OPTIONS.map(opt => (
|
||||||
<option key={opt.value} value={opt.value}>
|
<option key={opt.value} value={opt.value}>
|
||||||
{opt.label}
|
{opt.label}
|
||||||
@@ -33,6 +40,31 @@ export default function PolarisSettings(props: PluginSettingsProps) {
|
|||||||
</select>
|
</select>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'Dashboard URL',
|
||||||
|
value: (
|
||||||
|
<div>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
value={currentUrl}
|
||||||
|
onChange={handleUrlChange}
|
||||||
|
placeholder="/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/"
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
padding: '4px 8px',
|
||||||
|
border: '1px solid #ccc',
|
||||||
|
borderRadius: '4px',
|
||||||
|
fontSize: '14px',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<div style={{ fontSize: '12px', color: '#666', marginTop: '4px' }}>
|
||||||
|
Examples:<br />
|
||||||
|
• K8s proxy: <code>/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/</code><br />
|
||||||
|
• Full URL: <code>https://my-polaris.example.com</code>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</SectionBox>
|
</SectionBox>
|
||||||
|
|||||||
Reference in New Issue
Block a user