Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Make web-interface name links look like links everywhere

rcourtman18b5b1dd580a
diff --git a/frontend-modern/src/components/Alerts/AlertResourceGroupHeader.tsx b/frontend-modern/src/components/Alerts/AlertResourceGroupHeader.tsx
index 131614d4c4..db9f479fb9 100644
--- a/frontend-modern/src/components/Alerts/AlertResourceGroupHeader.tsx
+++ b/frontend-modern/src/components/Alerts/AlertResourceGroupHeader.tsx
@@ -1,7 +1,10 @@
import { Show } from 'solid-js';
import { GROUPED_TABLE_ROW_BADGE_CLASS } from '@/components/shared/groupedTableRowPresentation';
-import { WebInterfaceNameLink } from '@/components/shared/WebInterfaceNameLink';
+import {
+ WEB_INTERFACE_LINK_COLOR_CLASS,
+ WebInterfaceNameLink,
+} from '@/components/shared/WebInterfaceNameLink';
import type { GroupHeaderMeta } from '@/features/alerts/thresholds/tableTypes';
interface AlertResourceGroupHeaderProps {
@@ -18,7 +21,7 @@ export function AlertResourceGroupHeader(props: AlertResourceGroupHeaderProps) {
<WebInterfaceNameLink
name={groupLabel()}
url={props.meta?.host}
- class="text-base-content transition-colors duration-150 hover:text-sky-600 dark:hover:text-sky-400"
+ class={WEB_INTERFACE_LINK_COLOR_CLASS}
fallbackClass=""
title={`Open ${groupLabel()} web interface`}
/>
diff --git a/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx b/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx
index 7764eacaa7..fee125d9aa 100644
--- a/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx
+++ b/frontend-modern/src/components/Alerts/AlertResourceTableRow.tsx
@@ -9,7 +9,10 @@ import { TogglePrimitive } from '@/components/shared/Toggle';
import { StatusBadge } from '@/components/shared/StatusBadge';
import { ThresholdSlider } from '@/components/Workloads/ThresholdSlider';
import { TableCell, TableRow } from '@/components/shared/Table';
-import { WebInterfaceNameLink } from '@/components/shared/WebInterfaceNameLink';
+import {
+ WEB_INTERFACE_LINK_COLOR_CLASS,
+ WebInterfaceNameLink,
+} from '@/components/shared/WebInterfaceNameLink';
import { getPlatformTableCellClassForKind } from '@/features/platformPage/sharedPlatformPage';
import {
getAlertResourceTableCustomBadgeLabel,
@@ -264,10 +267,8 @@ export function AlertResourceTableRow(props: AlertResourceTableRowProps) {
<WebInterfaceNameLink
name={resourceLabel()}
url={props.resource.host as string | null | undefined}
- class={`text-sm font-medium truncate flex-nowrap transition-colors duration-150 ${
- props.resource.disabled
- ? 'text-slate-500 '
- : 'text-base-content hover:text-sky-600 dark:hover:text-sky-400'
+ class={`text-sm font-medium truncate flex-nowrap ${
+ props.resource.disabled ? 'text-slate-500 ' : WEB_INTERFACE_LINK_COLOR_CLASS
}`}
fallbackClass={`text-sm font-medium truncate flex-nowrap ${
props.resource.disabled ? 'text-slate-500 ' : 'text-base-content'
diff --git a/frontend-modern/src/components/Workloads/GuestRow.tsx b/frontend-modern/src/components/Workloads/GuestRow.tsx
index 7b494e69db..853139e851 100644
--- a/frontend-modern/src/components/Workloads/GuestRow.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRow.tsx
@@ -28,7 +28,10 @@ import {
import { SummaryRowActionButton } from '@/components/shared/SummaryRowActionButton';
import { DiscoveryReadinessBadge } from '@/components/shared/DiscoveryReadinessBadge';
import { getWorkloadGuestDiskStatusMessage } from '@/utils/workloadGuestPresentation';
-import { WebInterfaceNameLink } from '@/components/shared/WebInterfaceNameLink';
+import {
+ WEB_INTERFACE_LINK_COLOR_CLASS,
+ WebInterfaceNameLink,
+} from '@/components/shared/WebInterfaceNameLink';
import type { GuestRowProps } from './guestRowModel';
import { useGuestRowState } from './useGuestRowState';
import type { WorkloadTableMetric } from './workloadMetricHistoryModel';
@@ -204,7 +207,7 @@ export function GuestRow(props: GuestRowProps) {
<WebInterfaceNameLink
name={props.guest.name}
url={customUrl()}
- class="text-[11px] font-medium text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 hover:underline select-none truncate"
+ class={`text-[11px] font-medium select-none truncate ${WEB_INTERFACE_LINK_COLOR_CLASS}`}
fallbackClass="text-[11px] font-medium text-base-content select-none truncate"
/>
{/* Show backup indicator in name cell only if backup column is hidden */}
@@ -241,7 +244,10 @@ export function GuestRow(props: GuestRowProps) {
{/* Availability */}
<Show when={isColVisible('availability')}>
- <td class="px-1.5 sm:px-2 py-0.5 align-middle text-center" data-workload-col="availability">
+ <td
+ class="px-1.5 sm:px-2 py-0.5 align-middle text-center"
+ data-workload-col="availability"
+ >
<Show when={availabilityPresentation()}>
{(ap) => <AvailabilityProbeCell presentation={ap()} />}
</Show>
diff --git a/frontend-modern/src/components/shared/NodeGroupHeader.tsx b/frontend-modern/src/components/shared/NodeGroupHeader.tsx
index 137826ee98..35469383dc 100644
--- a/frontend-modern/src/components/shared/NodeGroupHeader.tsx
+++ b/frontend-modern/src/components/shared/NodeGroupHeader.tsx
@@ -12,7 +12,7 @@ import {
getGroupedTableRowCellClass,
getGroupedTableRowClass,
} from './groupedTableRowPresentation';
-import { WebInterfaceNameLink } from './WebInterfaceNameLink';
+import { WEB_INTERFACE_LINK_COLOR_CLASS, WebInterfaceNameLink } from './WebInterfaceNameLink';
interface NodeGroupHeaderProps {
node: Node;
@@ -57,7 +57,7 @@ export const NodeGroupHeader: Component<NodeGroupHeaderProps> = (props) => {
<WebInterfaceNameLink
name={displayName()}
url={nodeUrl()}
- class="transition-colors duration-150 hover:text-sky-600 dark:hover:text-sky-400"
+ class={WEB_INTERFACE_LINK_COLOR_CLASS}
title={`Open ${props.node.name} web interface`}
/>
<Show when={showActualName()}>
diff --git a/frontend-modern/src/components/shared/WebInterfaceNameLink.tsx b/frontend-modern/src/components/shared/WebInterfaceNameLink.tsx
index cb31620189..faed45d43a 100644
--- a/frontend-modern/src/components/shared/WebInterfaceNameLink.tsx
+++ b/frontend-modern/src/components/shared/WebInterfaceNameLink.tsx
@@ -1,6 +1,12 @@
import { Show, type Component, type JSX } from 'solid-js';
import { asTrimmedString } from '@/utils/stringUtils';
+// Canonical link colors for resource names that open a web interface. Every
+// table and header that renders a WebInterfaceNameLink composes these with its
+// own sizing/layout classes so a saved URL always reads as a link.
+export const WEB_INTERFACE_LINK_COLOR_CLASS =
+ 'text-blue-600 hover:text-blue-700 hover:underline dark:text-blue-400 dark:hover:text-blue-300';
+
export interface WebInterfaceNameLinkProps {
name: string;
url?: string | null;
diff --git a/frontend-modern/src/features/docker/DockerContainersTable.tsx b/frontend-modern/src/features/docker/DockerContainersTable.tsx
index 3a845b7b78..9ab629ba6e 100644
--- a/frontend-modern/src/features/docker/DockerContainersTable.tsx
+++ b/frontend-modern/src/features/docker/DockerContainersTable.tsx
@@ -13,7 +13,10 @@ import {
} from '@/components/shared/groupedTableRowPresentation';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
import { StatusDot } from '@/components/shared/StatusDot';
-import { WebInterfaceNameLink } from '@/components/shared/WebInterfaceNameLink';
+import {
+ WEB_INTERFACE_LINK_COLOR_CLASS,
+ WebInterfaceNameLink,
+} from '@/components/shared/WebInterfaceNameLink';
import { usePersistentSignal } from '@/hooks/usePersistentSignal';
import { getSimpleStatusIndicator } from '@/utils/status';
import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
@@ -258,8 +261,7 @@ const DOCKER_CONTAINER_SEARCH_TIPS = {
{ code: '-watchtower', description: 'Hide containers matching a term' },
],
footerHighlight: 'Tip',
- footerText:
- 'Combine exclusions and save them as a default view to keep noisy containers hidden.',
+ footerText: 'Combine exclusions and save them as a default view to keep noisy containers hidden.',
};
export const DockerContainersTable: Component<DockerContainersTableProps> = (props) => {
@@ -366,10 +368,13 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
// Grouped-by-host view, mirroring the workloads table: preference persists
// locally (not in the URL) and only applies once the fleet spans more than
// one host; a single-host list gains nothing from a group header.
- const [groupingModePreference, setGroupingModePreference] =
- usePersistentSignal<GroupedTableMode>('dockerContainersGroupingMode', 'grouped', {
+ const [groupingModePreference, setGroupingModePreference] = usePersistentSignal<GroupedTableMode>(
+ 'dockerContainersGroupingMode',
+ 'grouped',
+ {
deserialize: (raw) => (raw === 'grouped' || raw === 'flat' ? raw : 'grouped'),
- });
+ },
+ );
const isGroupable = createMemo(() => hostOptions().length > 1);
const groupingMode = createMemo<GroupedTableMode>(() =>
isGroupable() ? groupingModePreference() : 'flat',
@@ -444,16 +449,11 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
const running = () => isContainerRunning(resource);
const metricsKey = () => buildMetricKeyForUnifiedResource(resource);
const cpuPercent = () => getPlatformTableFiniteMetric(resource.cpu?.current);
- const memoryUsed = () =>
- getPlatformTableFiniteMetric(resource.memory?.used) ?? 0;
- const memoryTotal = () =>
- getPlatformTableFiniteMetric(resource.memory?.total) ?? 0;
+ const memoryUsed = () => getPlatformTableFiniteMetric(resource.memory?.used) ?? 0;
+ const memoryTotal = () => getPlatformTableFiniteMetric(resource.memory?.total) ?? 0;
const memoryPercentOnly = () =>
- memoryTotal() > 0
- ? undefined
- : getPlatformTableFiniteMetric(resource.memory?.current);
- const hasMemoryMetric = () =>
- memoryTotal() > 0 || memoryPercentOnly() !== undefined;
+ memoryTotal() > 0 ? undefined : getPlatformTableFiniteMetric(resource.memory?.current);
+ const hasMemoryMetric = () => memoryTotal() > 0 || memoryPercentOnly() !== undefined;
const restartCount = () => resource.docker?.restartCount ?? 0;
const ports = () => dockerContainerPortsSummary(resource);
const networks = () => networksSummary(resource);
@@ -482,9 +482,7 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
);
case 'host':
return (
- <TableCell
- class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}
- >
+ <TableCell class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}>
<span class="block max-w-full truncate" title={host()}>
{host()}
</span>
@@ -492,9 +490,7 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
);
case 'runtime':
return (
- <TableCell
- class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}
- >
+ <TableCell class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}>
<span class="block max-w-full truncate" title={runtime()}>
{runtime()}
</span>
@@ -502,9 +498,7 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
);
case 'image':
return (
- <TableCell
- class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}
- >
+ <TableCell class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}>
<span class="block max-w-full truncate" title={image()}>
{image()}
</span>
@@ -512,9 +506,7 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
);
case 'state':
return (
- <TableCell
- class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}
- >
+ <TableCell class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}>
<span class="block max-w-full truncate" title={state()}>
{state()}
</span>
@@ -550,9 +542,7 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
);
case 'restarts':
return (
- <TableCell
- class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}
- >
+ <TableCell class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}>
<Show
when={typeof resource.docker?.restartCount === 'number'}
fallback={<span>—</span>}
@@ -571,22 +561,15 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
);
case 'ports':
return (
- <TableCell
- class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}
- >
- <span
- class="block max-w-full truncate font-mono text-[11px]"
- title={ports()}
- >
+ <TableCell class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}>
+ <span class="block max-w-full truncate font-mono text-[11px]" title={ports()}>
{ports()}
</span>
</TableCell>
);
case 'networks':
return (
- <TableCell
- class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}
- >
+ <TableCell class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}>
<span class="block max-w-full truncate" title={networks()}>
{networks()}
</span>
@@ -594,9 +577,7 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
);
case 'mounts':
return (
- <TableCell
- class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}
- >
+ <TableCell class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}>
<span class="block max-w-full truncate" title={mounts()}>
{mounts()}
</span>
@@ -604,9 +585,7 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
);
case 'updates':
return (
- <TableCell
- class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}
- >
+ <TableCell class={`${getPlatformTableCellClassForKind(column.kind)} text-base-content`}>
<Show
when={action}
fallback={
@@ -688,7 +667,7 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
<WebInterfaceNameLink
name={group.host}
url={group.hostResource?.customUrl}
- class="truncate text-blue-600 hover:text-blue-700 hover:underline dark:text-blue-400 dark:hover:text-blue-300"
+ class={`truncate ${WEB_INTERFACE_LINK_COLOR_CLASS}`}
fallbackClass="truncate"
/>
<span class={GROUPED_TABLE_ROW_BADGE_CLASS}>
@@ -788,7 +767,9 @@ export const DockerContainersTable: Component<DockerContainersTableProps> = (pro
body={
<Show
when={groupingMode() === 'grouped'}
- fallback={<For each={sortedRows()}>{(resource) => renderContainerRow(resource)}</For>}
+ fallback={
+ <For each={sortedRows()}>{(resource) => renderContainerRow(resource)}</For>
+ }
>
<For each={groupedRows()}>
{(group) => (
diff --git a/frontend-modern/src/features/docker/DockerNativeTableShared.tsx b/frontend-modern/src/features/docker/DockerNativeTableShared.tsx
index 1f30739a70..bfce43269d 100644
--- a/frontend-modern/src/features/docker/DockerNativeTableShared.tsx
+++ b/frontend-modern/src/features/docker/DockerNativeTableShared.tsx
@@ -1,7 +1,10 @@
import { type Component, type JSX } from 'solid-js';
import { StatusDot } from '@/components/shared/StatusDot';
import { TableCell } from '@/components/shared/Table';
-import { WebInterfaceNameLink } from '@/components/shared/WebInterfaceNameLink';
+import {
+ WEB_INTERFACE_LINK_COLOR_CLASS,
+ WebInterfaceNameLink,
+} from '@/components/shared/WebInterfaceNameLink';
import { getSimpleStatusIndicator, type StatusIndicator } from '@/utils/status';
import { asTrimmedString } from '@/utils/stringUtils';
import {
@@ -87,7 +90,7 @@ export const DockerResourceNameCell: Component<{
<WebInterfaceNameLink
name={name()}
url={props.resource.customUrl}
- class="truncate font-semibold text-blue-600 hover:text-blue-700 hover:underline dark:text-blue-400 dark:hover:text-blue-300"
+ class={`truncate font-semibold ${WEB_INTERFACE_LINK_COLOR_CLASS}`}
fallbackClass="truncate font-semibold text-base-content"
/>
</div>
diff --git a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
index 59b6f32ae3..9c77c09b7e 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxNodesTable.tsx
@@ -11,7 +11,10 @@ import { useWebSocket } from '@/contexts/appRuntime';
import { useAlertsActivation } from '@/stores/alertsActivation';
import { getAlertStyles } from '@/utils/alerts';
import { StatusDot } from '@/components/shared/StatusDot';
-import { WebInterfaceNameLink } from '@/components/shared/WebInterfaceNameLink';
+import {
+ WEB_INTERFACE_LINK_COLOR_CLASS,
+ WebInterfaceNameLink,
+} from '@/components/shared/WebInterfaceNameLink';
import { InlineDetailTableRow } from '@/components/shared/InlineDetailTableRow';
import { ResponsiveMetricCell } from '@/components/shared/responsive';
import { NodeDrawer } from '@/components/Workloads/NodeDrawer';
@@ -351,7 +354,7 @@ export const ProxmoxNodesTable: Component<{
<WebInterfaceNameLink
name={name()}
url={externalUrl()}
- class="truncate font-semibold text-base-content transition-colors hover:text-sky-600 dark:hover:text-sky-400"
+ class={`truncate font-semibold ${WEB_INTERFACE_LINK_COLOR_CLASS}`}
fallbackClass="truncate font-semibold text-base-content"
title={`Open ${name()} web interface`}
/>
diff --git a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
index 8cc517c0e3..cabdf27f1c 100644
--- a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
+++ b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
@@ -21,7 +21,10 @@ import { ActionIconButton } from '@/components/shared/Button';
import { ColumnPicker } from '@/components/shared/ColumnPicker';
import { StatusDot } from '@/components/shared/StatusDot';
import { TemperatureGauge } from '@/components/shared/TemperatureGauge';
-import { WebInterfaceNameLink } from '@/components/shared/WebInterfaceNameLink';
+import {
+ WEB_INTERFACE_LINK_COLOR_CLASS,
+ WebInterfaceNameLink,
+} from '@/components/shared/WebInterfaceNameLink';
import { TableCell, TableHead, TableRow } from '@/components/shared/Table';
import { TooltipPortal } from '@/components/shared/TooltipPortal';
import { hostOverrideIdCandidates } from '@/features/alerts/alertOverridesModel';
@@ -1575,7 +1578,7 @@ export const AgentsMachinesTable: Component<{
<WebInterfaceNameLink
name={name()}
url={savedWebInterfaceUrl()}
- class="truncate font-semibold text-blue-600 hover:text-blue-700 hover:underline dark:text-blue-400 dark:hover:text-blue-300"
+ class={`truncate font-semibold ${WEB_INTERFACE_LINK_COLOR_CLASS}`}
fallbackClass="truncate font-semibold text-base-content"
/>
</div>