Add up-to-date default workspace labels (#709)

* Add up-to-date workspace labels

* Use iterators instead of creating copies of the mappings

* Re-add guard clause

Signed-off-by: davfsa <davfsa@gmail.com>

* merge origin

* Fix duplicate icons and simplify implementation.

---------

Signed-off-by: davfsa <davfsa@gmail.com>
Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
davfsa
2025-03-18 03:05:14 +01:00
committed by GitHub
parent 14b17c0667
commit 7fe89ac5eb
5 changed files with 187 additions and 197 deletions

View File

@@ -17,12 +17,8 @@ const cpuPoller = new FunctionPoller<number, []>(cpuUsage, [bind(round)], bind(p
cpuPoller.initialize('cpu');
export const Cpu = (): BarBoxChild => {
const renderLabel = (cpuUsg: number, rnd: boolean): string => {
return rnd ? `${Math.round(cpuUsg)}%` : `${cpuUsg.toFixed(2)}%`;
};
const labelBinding = Variable.derive([bind(cpuUsage), bind(round)], (cpuUsg, rnd) => {
return renderLabel(cpuUsg, rnd);
const labelBinding = Variable.derive([bind(cpuUsage), bind(round)], (cpuUsg: number, round: boolean) => {
return round ? `${Math.round(cpuUsg)}%` : `${cpuUsg.toFixed(2)}%`;
});
const cpuModule = Module({