From 8ac85c9d0fd14a52b54933287924a000c56df5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rik=20Levente?= <33373714+Levminer@users.noreply.github.com> Date: Sat, 20 Jul 2024 22:16:45 +0200 Subject: [PATCH] Home header --- platforms/interface/ui/pages/home.svelte | 844 ++++++++++++----------- 1 file changed, 456 insertions(+), 388 deletions(-) diff --git a/platforms/interface/ui/pages/home.svelte b/platforms/interface/ui/pages/home.svelte index 59021d9..422f3c2 100644 --- a/platforms/interface/ui/pages/home.svelte +++ b/platforms/interface/ui/pages/home.svelte @@ -1,543 +1,611 @@
- -
-
-
-
- -
-

CPU

-
-

{$hardwareInfo.cpu.name}

-
-
- -
- -
- {#each $hardwareInfo.cpu.load as item, i} -
-
-

{item.name?.replaceAll("CPU", "")}

-

{Math.round(item.value)}%

-
- -
- {/each} -
-
-
- -
-
-
- -
-

RAM

-
-

{$hardwareInfo.ram.info[0]?.manufacturerName ?? "Generic Memory"}

-
-
- -
-
-
-
-

Virtual memory

-

{Math.round($hardwareInfo.ram.load[5]?.value ?? 0)}%

+ + {#if import.meta.env.VITE_CORES_MODE === "host"} +
+
+
+
+
+
- +

Cores

-
-
-
-
-
-
- -
-

GPU

-
-

{$hardwareInfo.gpu.name}

-
-
- -
-
- {#each $hardwareInfo.gpu.load as item, i} -
-
-

{item.name?.replaceAll("D3D", "")}

-

{Math.round(item.value)}%

-
- -
- {/each} -
-
-
-
- - -
-
-
-
- -
-

Drives

-
-
-
- {#each $hardwareInfo.system.storage.disks as item, i} -
-
-

{item.name} Read Speed

-

{parseFloat((item.throughputRead / 1_048_576).toFixed(2))} MB/s

-
- -
-
-
-

{item.name} Write Speed

-

{parseFloat((item.throughputWrite / 1_048_576).toFixed(2))} MB/s

-
- -
- {/each} + {#if $settings.licenseKey === "" || $settings.licenseKey === "free"} +

Free

+

Upgrade

+ {/if}
+
+ {/if} -
-
-
- + {#if page === "grid"} + +
+
+
+
+ +
+

CPU

-

Fans

-
+

{$hardwareInfo.cpu.name}

+
+
+ +
-
-
- {#each $hardwareInfo.system.superIO.fan as item, i} - {#if item.value != 0} +
+ {#each $hardwareInfo.cpu.load as item, i}
-

{item.name}

-

{Math.round($hardwareInfo.system.superIO.fanControl[i].value)}%

+

{item.name?.replaceAll("CPU", "")}

+

{Math.round(item.value)}%

- +
- {/if} - {/each} + {/each} +
-
-
-
-
- +
+
+
+ +
+

RAM

-

Interfaces

-
-
-
- {#each $hardwareInfo.system.network.interfaces as item, i} -
-
-

{item.name} Download Speed

-

{parseFloat((item.throughputDownload / 1_048_576).toFixed(2))} MB/s

-
- -
+

{$hardwareInfo.ram.info[0]?.manufacturerName ?? "Generic Memory"}

+
+
+ +
+
-

{item.name} Upload Speed

-

{parseFloat((item.throughputUpload / 1_048_576).toFixed(2))} MB/s

+

Virtual memory

+

{Math.round($hardwareInfo.ram.load[5]?.value ?? 0)}%

- +
- {/each} -
-
-
-
- - -
- -
-
-
-
-
-

CPU Temperature

-
-

- Avg. temperature: {Math.round( - $hardwareInfo.cpu.temperature.reduce((a, b) => a + b.value, 0) / $hardwareInfo.cpu.temperature.length, - )} °C -

-
- `Core #${i + 1} (${temp.value} °C)`)} - type={{ name: "temperature", unit: "°C" }} - />
-
+
- +
- -

CPU Clock Speed

+

GPU

-

- Avg. clock speed: {( - Math.round($hardwareInfo.cpu.clock.reduce((a, b) => a + b.value, 0) / $hardwareInfo.cpu.clock.length) / 1000 - ).toFixed(1)} GHz -

-
- `Core #${i + 1} (${(temp.value / 1000).toFixed(1)} GHz)`)} - type={{ name: "clock speed", unit: "MHz" }} - /> -
-
- -
-
-
- +

{$hardwareInfo.gpu.name}

+
+
+ +
+
+ {#each $hardwareInfo.gpu.load as item, i} +
+
+

{item.name?.replaceAll("D3D", "")}

+

{Math.round(item.value)}%

+
+ +
+ {/each}
-

CPU Power Usage

-
-

Power usage: {$hardwareInfo.cpu.power.reduce((a, b) => a + b.value, 0)} W

-
- power.value !== 0)} - categories={$hardwareInfo.cpu.power - .filter((power) => power.value !== 0) - .map((temp) => `${temp.name.replaceAll("CPU", "")} (${temp.value} W)`)} - type={{ name: "power usage", unit: "W" }} - />
+
-
+ +
+
- +
-

CPU Voltage

+

Drives

-

Avg. voltage: {($hardwareInfo.cpu.voltage.reduce((a, b) => a + b.value, 0) / $hardwareInfo.cpu.voltage.length).toFixed(1)} V

-
- `Core #${i + 1} (${temp.value} V)`)} - type={{ name: "voltage", unit: "V" }} - /> +
+
+ {#each $hardwareInfo.system.storage.disks as item, i} +
+
+

{item.name} Read Speed

+

{parseFloat((item.throughputRead / 1_048_576).toFixed(2))} MB/s

+
+ +
+
+
+

{item.name} Write Speed

+

{parseFloat((item.throughputWrite / 1_048_576).toFixed(2))} MB/s

+
+ +
+ {/each} +
-
- -
-
-
-
- + {#if $hardwareInfo.system.superIO.fanControl.length > 0} +
+
+
+ +
+

Fans

-

RAM Usage

-
-

- Memory: {`${$hardwareInfo.ram.load[0]?.value.toFixed(1) ?? 0}/${( - ($hardwareInfo.ram.load[0]?.value ?? 0) + ($hardwareInfo.ram.load[1]?.value ?? 0) - ).toFixed(1)} GB`} -

-
- +
+
+ {#each $hardwareInfo.system.superIO.fan as item, i} + {#if item.value != 0} +
+
+

{item.name}

+

{Math.round($hardwareInfo.system.superIO.fanControl[i].value)}%

+
+ +
+ {/if} + {/each} +
+
-
+ {/if} -
+
- +
-

Virtual RAM Usage

+

Interfaces

-

- Virtual memory: {`${$hardwareInfo.ram.load[3]?.value.toFixed(1) ?? 0}/${( - ($hardwareInfo.ram.load[3]?.value ?? 0) + ($hardwareInfo.ram.load[4]?.value ?? 0) - ).toFixed(1)} GB`} -

-
- +
+
+ {#each $hardwareInfo.system.network.interfaces as item, i} +
+
+

{item.name} Download Speed

+

{parseFloat((item.throughputDownload / 1_048_576).toFixed(2))} MB/s

+
+ +
+
+
+

{item.name} Upload Speed

+

{parseFloat((item.throughputUpload / 1_048_576).toFixed(2))} MB/s

+
+ +
+ {/each} +
- -
- {#if $hardwareInfo.gpu.temperature.length > 0} + +
+ +
-

GPU Temperature

+

CPU Temperature

Avg. temperature: {Math.round( - $hardwareInfo.gpu.temperature.reduce((a, b) => a + b.value, 0) / $hardwareInfo.gpu.temperature.length, + $hardwareInfo.cpu.temperature.reduce((a, b) => a + b.value, 0) / $hardwareInfo.cpu.temperature.length, )} °C

`${temp.name.replaceAll("GPU", "")} (${temp.value} °C)`)} + readings={$hardwareInfo.cpu.temperature} + categories={$hardwareInfo.cpu.temperature.map((temp, i) => `Core #${i + 1} (${temp.value} °C)`)} type={{ name: "temperature", unit: "°C" }} />
- {/if} - {#if $hardwareInfo.gpu.fan.length > 0}
- +
-

GPU Fan Speed

+ +

CPU Clock Speed

+
+

+ Avg. clock speed: {( + Math.round($hardwareInfo.cpu.clock.reduce((a, b) => a + b.value, 0) / $hardwareInfo.cpu.clock.length) / 1000 + ).toFixed(1)} GHz +

+
+ `Core #${i + 1} (${(temp.value / 1000).toFixed(1)} GHz)`)} + type={{ name: "clock speed", unit: "MHz" }} + />
-

Avg. fan speed: {Math.round($hardwareInfo.gpu.fan.reduce((a, b) => a + b.value, 0) / $hardwareInfo.gpu.fan.length)} RPM

- {#if $hardwareInfo.gpu.fan[0].max > 0} -
- `Fan #${i} (${temp.value} RPM)`)} - readings={$hardwareInfo.gpu.fan} - type={{ name: "fan speed", unit: "RPM" }} - /> -
- {/if}
- {/if} - {#if $hardwareInfo.gpu.memory.length > 2}
- +
-

GPU Memory Usage

+

CPU Power Usage

-

GPU memory: {`${$hardwareInfo.gpu.memory[0].value.toFixed(1)}/${$hardwareInfo.gpu.memory[2].value}`} GB

+

Power usage: {$hardwareInfo.cpu.power.reduce((a, b) => a + b.value, 0)} W

power.value !== 0)} + categories={$hardwareInfo.cpu.power + .filter((power) => power.value !== 0) + .map((temp) => `${temp.name.replaceAll("CPU", "")} (${temp.value} W)`)} + type={{ name: "power usage", unit: "W" }} />
- {/if} - {#if $hardwareInfo.gpu.clock.length > 0}
- +
-

GPU Clock Speed

+

CPU Voltage

+

+ Avg. voltage: {($hardwareInfo.cpu.voltage.reduce((a, b) => a + b.value, 0) / $hardwareInfo.cpu.voltage.length).toFixed(1)} V +

`${temp.name.replaceAll("GPU", "")} (${(temp.value / 1000).toFixed(1)} GHz)`, - )} - type={{ name: "clock speed", unit: "MHz" }} + readings={$hardwareInfo.cpu.voltage} + categories={$hardwareInfo.cpu.voltage.map((temp, i) => `Core #${i + 1} (${temp.value} V)`)} + type={{ name: "voltage", unit: "V" }} />
- {/if} +
- {#if $hardwareInfo.gpu.power.length > 0} + +
- +
-

GPU Power Usage

+

RAM Usage

-

Power usage: {$hardwareInfo.gpu.power.reduce((a, b) => a + b.value, 0)} W

+

+ Memory: {`${$hardwareInfo.ram.load[0]?.value.toFixed(1) ?? 0}/${( + ($hardwareInfo.ram.load[0]?.value ?? 0) + ($hardwareInfo.ram.load[1]?.value ?? 0) + ).toFixed(1)} GB`} +

+
+ +
+
+ +
+
+
+ +
+

Virtual RAM Usage

+
+

+ Virtual memory: {`${$hardwareInfo.ram.load[3]?.value.toFixed(1) ?? 0}/${( + ($hardwareInfo.ram.load[3]?.value ?? 0) + ($hardwareInfo.ram.load[4]?.value ?? 0) + ).toFixed(1)} GB`} +

`${temp.name.replaceAll("GPU", "")} (${temp.value} W)`)} - type={{ name: "power usage", unit: "W" }} + readings={[$hardwareInfo.ram.load[3]]} + categories={["Virtual RAM usage"]} + type={{ name: "virtual memory usage", unit: "GB" }} />
- {/if} -
-
+
- -
- -
-
-
-
- + +
+ {#if $hardwareInfo.gpu.temperature.length > 0} +
+
+
+ +
+

GPU Temperature

+
+

+ Avg. temperature: {Math.round( + $hardwareInfo.gpu.temperature.reduce((a, b) => a + b.value, 0) / $hardwareInfo.gpu.temperature.length, + )} °C +

+
+ `${temp.name.replaceAll("GPU", "")} (${temp.value} °C)`)} + type={{ name: "temperature", unit: "°C" }} + /> +
-

Drives

-
- {#each $hardwareInfo.system.storage.disks as { name, freeSpace, totalSpace, health }} -
-

Name: {name}

-

Health: {health}%

-

Available space: {freeSpace}/{totalSpace} GB

+ {/if} + + {#if $hardwareInfo.gpu.fan.length > 0} +
+
+
+ +
+

GPU Fan Speed

+
+

+ Avg. fan speed: {Math.round($hardwareInfo.gpu.fan.reduce((a, b) => a + b.value, 0) / $hardwareInfo.gpu.fan.length)} RPM +

+ {#if $hardwareInfo.gpu.fan[0].max > 0} +
+ `Fan #${i} (${temp.value} RPM)`)} + readings={$hardwareInfo.gpu.fan} + type={{ name: "fan speed", unit: "RPM" }} + /> +
+ {/if}
- {/each} -
+ {/if} -
-
-
- + {#if $hardwareInfo.gpu.memory.length > 2} +
+
+
+ +
+

GPU Memory Usage

+
+

GPU memory: {`${$hardwareInfo.gpu.memory[0].value.toFixed(1)}/${$hardwareInfo.gpu.memory[2].value}`} GB

+
+ +
-

Drive Temperatures

-
-
- disk.temperature)} - categories={$hardwareInfo.system.storage.disks.map((temp, i) => `${temp.name} (${temp.temperature.value} °C)`)} - type={{ name: "temperature", unit: "°C" }} - /> -
+ {/if} + + {#if $hardwareInfo.gpu.clock.length > 0} +
+
+
+ +
+

GPU Clock Speed

+
+
+ `${temp.name.replaceAll("GPU", "")} (${(temp.value / 1000).toFixed(1)} GHz)`, + )} + type={{ name: "clock speed", unit: "MHz" }} + /> +
+
+ {/if} + + {#if $hardwareInfo.gpu.power.length > 0} +
+
+
+ +
+ +

GPU Power Usage

+
+

Power usage: {$hardwareInfo.gpu.power.reduce((a, b) => a + b.value, 0)} W

+
+ `${temp.name.replaceAll("GPU", "")} (${temp.value} W)`)} + type={{ name: "power usage", unit: "W" }} + /> +
+
+ {/if}
- -
-
-
-
- + +
+ +
+
+
+
+ +
+

Drives

-

System

-
-
-

CPU: {$hardwareInfo.cpu.name}

-

RAM: {Math.round(($hardwareInfo.ram.load[0]?.value ?? 0) + ($hardwareInfo.ram.load[1]?.value ?? 0))} GB

-

GPU: {$hardwareInfo.gpu.name}

-

MB: {$hardwareInfo.system.motherboard.name}

-

OS: {$hardwareInfo.system.os.name}

+ {#each $hardwareInfo.system.storage.disks as { name, freeSpace, totalSpace, health }} +
+

Name: {name}

+

Health: {health}%

+

Available space: {freeSpace}/{totalSpace} GB

+
+ {/each}
-
- {#if $hardwareInfo.system.battery?.capacity.length ?? 0 > 0}
- +
-

Battery

+

Drive Temperatures

- -
-

Charge level: {Math.round($hardwareInfo.system.battery.level[0].value)}%

-

Health: {Math.round(100 - $hardwareInfo.system.battery.level[1].value)}%

-

Cycle count: {$hardwareInfo.system.battery.cycleCount}

-

- Capacity: {Math.round($hardwareInfo.system.battery.capacity[2].value / 1000)}/{Math.round( - $hardwareInfo.system.battery.capacity[1].value / 1000, - )} Wh -

+
+ disk.temperature)} + categories={$hardwareInfo.system.storage.disks.map((temp, i) => `${temp.name} (${temp.temperature.value} °C)`)} + type={{ name: "temperature", unit: "°C" }} + />
- {/if} +
- {#if $hardwareInfo.system.monitor.monitors.length > 0} + +
- +
-

Monitors

+

System

+
+

CPU: {$hardwareInfo.cpu.name}

+

RAM: {Math.round(($hardwareInfo.ram.load[0]?.value ?? 0) + ($hardwareInfo.ram.load[1]?.value ?? 0))} GB

+

GPU: {$hardwareInfo.gpu.name}

+

MB: {$hardwareInfo.system.motherboard.name}

+

OS: {$hardwareInfo.system.os.name}

+
+
+ + {#if $hardwareInfo.system.battery?.capacity.length ?? 0 > 0} +
+
+
+ +
+

Battery

+
- {#each $hardwareInfo.system.monitor.monitors as { name, refreshRate, resolution }}
-

Name: {name}

-

Resolution: {resolution}

-

Refresh rate: {refreshRate} Hz

+

Charge level: {Math.round($hardwareInfo.system.battery.level[0].value)}%

+

Health: {Math.round(100 - $hardwareInfo.system.battery.level[1].value)}%

+

Cycle count: {$hardwareInfo.system.battery.cycleCount}

+

+ Capacity: {Math.round($hardwareInfo.system.battery.capacity[2].value / 1000)}/{Math.round( + $hardwareInfo.system.battery.capacity[1].value / 1000, + )} Wh +

- {/each} -
- {/if} +
+ {/if} -
-
-
- + {#if $hardwareInfo.system.monitor.monitors.length > 0} +
+
+
+ +
+

Monitors

+
+ + {#each $hardwareInfo.system.monitor.monitors as { name, refreshRate, resolution }} +
+

Name: {name}

+

Resolution: {resolution}

+

Refresh rate: {refreshRate} Hz

+
+ {/each} +
+ {/if} + +
+
+
+ +
+

BIOS

+
+
+

Vendor: {$hardwareInfo.system.bios.vendor}

+

Version: {$hardwareInfo.system.bios.version}

+

Date: {$hardwareInfo.system.bios.date}

-

BIOS

-
-
-

Vendor: {$hardwareInfo.system.bios.vendor}

-

Version: {$hardwareInfo.system.bios.version}

-

Date: {$hardwareInfo.system.bios.date}

-
- -
-
-
-
- + +
+
+
+
+ +
+

Interfaces

-

Interfaces

+ {#each $hardwareInfo.system.network.interfaces as { name, description, ipAddress, mask, gateway, dns, speed, macAddress }} +
+

Name: {name}

+

Description: {description}

+

Address: {ipAddress} ({mask})

+

MAC address: {macAddress}

+

Gateway: {gateway} ({dns})

+

Speed: {speed} Mbit/s

+
+ {/each}
- {#each $hardwareInfo.system.network.interfaces as { name, description, ipAddress, mask, gateway, dns, speed, macAddress }} -
-

Name: {name}

-

Description: {description}

-

Address: {ipAddress} ({mask})

-

MAC address: {macAddress}

-

Gateway: {gateway} ({dns})

-

Speed: {speed} Mbit/s

-
- {/each}
-
+ {:else if page === "list"} + + {/if}