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.

fix(hosts): Merge filter sections into single row

rcourtmanc0e01a565150
diff --git a/frontend-modern/src/components/Hosts/HostsFilter.tsx b/frontend-modern/src/components/Hosts/HostsFilter.tsx
index 26444cf83c..1e386085d1 100644
--- a/frontend-modern/src/components/Hosts/HostsFilter.tsx
+++ b/frontend-modern/src/components/Hosts/HostsFilter.tsx
@@ -359,9 +359,7 @@ export const HostsFilter: Component<HostsFilterProps> = (props) => {
Offline
</button>
</div>
- </div>
- <div class="flex flex-wrap items-center gap-2">
<Show when={props.activeHostName}>
<div class="flex items-center gap-1 rounded-full bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 dark:bg-blue-900/40 dark:text-blue-200">
<span>Host: {props.activeHostName}</span>
diff --git a/frontend-modern/src/stores/websocket.ts b/frontend-modern/src/stores/websocket.ts
index f32d54b37d..5bbd9b08a5 100644
--- a/frontend-modern/src/stores/websocket.ts
+++ b/frontend-modern/src/stores/websocket.ts
@@ -334,16 +334,18 @@ export function createWebSocketStore(url: string) {
try {
const message: WSMessage = data;
- if (
- message.type === WEBSOCKET.MESSAGE_TYPES.INITIAL_STATE ||
- message.type === WEBSOCKET.MESSAGE_TYPES.RAW_DATA
- ) {
- // Update state properties individually to ensure reactivity
- if (message.data) {
- // Mark that we've received usable data (initial payload or raw update)
- if (!initialDataReceived()) {
- setInitialDataReceived(true);
- }
+ if (
+ message.type === WEBSOCKET.MESSAGE_TYPES.INITIAL_STATE ||
+ message.type === WEBSOCKET.MESSAGE_TYPES.RAW_DATA
+ ) {
+ // Update state properties individually, but batch the whole payload to
+ // reduce reactive recomputations and UI thrash on large updates.
+ if (message.data) {
+ batch(() => {
+ // Mark that we've received usable data (initial payload or raw update)
+ if (!initialDataReceived()) {
+ setInitialDataReceived(true);
+ }
// Only update if we have actual data, don't overwrite with empty arrays
if (message.data.nodes !== undefined) {
@@ -645,11 +647,12 @@ export function createWebSocketStore(url: string) {
// Updated recentlyResolved
}
- setState('lastUpdate', message.data.lastUpdate || new Date().toISOString());
- }
- logger.debug('message', {
- type: message.type,
- hasData: !!message.data,
+ setState('lastUpdate', message.data.lastUpdate || new Date().toISOString());
+ });
+ }
+ logger.debug('message', {
+ type: message.type,
+ hasData: !!message.data,
nodeCount: message.data?.nodes?.length || 0,
vmCount: message.data?.vms?.length || 0,
containerCount: message.data?.containers?.length || 0,