fix(hosts): Merge filter sections into single row
This commit is contained in:
parent
ca8cd0e3b4
commit
c48c5b8861
2 changed files with 18 additions and 17 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue