diff --git a/ivette/src/frama-c/server.ts b/ivette/src/frama-c/server.ts index 4c8fd9181ee06030a8796e79477fba5be124f412..09cdc8962929efc69ba15023526551b98bf8b1b9 100644 --- a/ivette/src/frama-c/server.ts +++ b/ivette/src/frama-c/server.ts @@ -198,6 +198,8 @@ function _status(newStatus: Status): void { } } +const _update: () => void = debounce(() => STATUS.emit(status), 100); + // -------------------------------------------------------------------------- // --- Server Control (Start) // -------------------------------------------------------------------------- @@ -737,6 +739,7 @@ export function send<In, Out>( pollingTimer = setInterval(() => { client.poll(); }, polling); + _update(); } return response; } @@ -749,6 +752,7 @@ function _resolved(id: string): void { pending.delete(id); if (pending.size === 0) { rqCount = 0; + _update(); if (pollingTimer) { clearInterval(pollingTimer); pollingTimer = undefined; diff --git a/ivette/src/renderer/Controller.tsx b/ivette/src/renderer/Controller.tsx index 3cd1379e16540683b05593d2c40404040e45e1db..5fb9c65e5923e10f5b688cf652308e5def92acc1 100644 --- a/ivette/src/renderer/Controller.tsx +++ b/ivette/src/renderer/Controller.tsx @@ -385,7 +385,8 @@ export const Status = () => { running = 'BOOT'; break; case Server.Status.ON: - led = pending > 0 ? 'positive' : 'active'; + led = 'active'; + blink = pending > 0; running = 'ON'; break; case Server.Status.HALTING: