Skip to content

Commit

Permalink
Hide not relevant info
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Oct 7, 2024
1 parent 74dfcdc commit 61e4db2
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 101 deletions.
108 changes: 56 additions & 52 deletions platforms/interface/ui/pages/cpu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -115,37 +115,39 @@

<div class="flex w-2/5 flex-col justify-start gap-5 sm:w-full">
<!-- cpu power usage -->
<div class="transparent-800 rounded-xl p-8 sm:p-4">
<div class="flex items-baseline justify-between">
<div class="mb-5 flex items-center gap-3">
<div class="transparent-900 flex aspect-square items-center justify-center rounded-lg p-3 sm:p-2">
<Plug />
{#if $hardwareInfo.cpu.power.length > 0}
<div class="transparent-800 rounded-xl p-8 sm:p-4">
<div class="flex items-baseline justify-between">
<div class="mb-5 flex items-center gap-3">
<div class="transparent-900 flex aspect-square items-center justify-center rounded-lg p-3 sm:p-2">
<Plug />
</div>
<h2>CPU Power Usage</h2>
</div>
<div>
<ToggleButton selected={minutes} on:click={() => (minutes = !minutes)} />
</div>
<h2>CPU Power Usage</h2>
</div>

<div>
<ToggleButton selected={minutes} on:click={() => (minutes = !minutes)} />
<LineChart
props={{
statistics: [
{
label: "Power Usage",
color: "yellow",
data: minutes
? $hardwareStatistics.minutes.map((value) => value.cpu.power)
: $hardwareStatistics.seconds.map((value) => value.cpu.power),
},
],
time: minutes ? "m" : "s",
unit: " W",
}}
/>
</div>
</div>

<div>
<LineChart
props={{
statistics: [
{
label: "Power Usage",
color: "yellow",
data: minutes
? $hardwareStatistics.minutes.map((value) => value.cpu.power)
: $hardwareStatistics.seconds.map((value) => value.cpu.power),
},
],
time: minutes ? "m" : "s",
unit: " W",
}}
/>
</div>
</div>
{/if}

<!-- cpu load -->
<div class="transparent-800 rounded-xl p-8 sm:p-4">
Expand Down Expand Up @@ -184,37 +186,39 @@
</div>

<!-- cpu voltage -->
<div class="transparent-800 rounded-xl p-8 sm:p-4">
<div class="flex items-baseline justify-between">
<div class="mb-5 flex items-center gap-3">
<div class="transparent-900 flex aspect-square items-center justify-center rounded-lg p-3 sm:p-2">
<Zap />
{#if $hardwareInfo.cpu.voltage.length > 0}
<div class="transparent-800 rounded-xl p-8 sm:p-4">
<div class="flex items-baseline justify-between">
<div class="mb-5 flex items-center gap-3">
<div class="transparent-900 flex aspect-square items-center justify-center rounded-lg p-3 sm:p-2">
<Zap />
</div>
<h2>CPU Voltage</h2>
</div>
<div>
<ToggleButton selected={minutes} on:click={() => (minutes = !minutes)} />
</div>
<h2>CPU Voltage</h2>
</div>

<div>
<ToggleButton selected={minutes} on:click={() => (minutes = !minutes)} />
<LineChart
props={{
statistics: [
{
label: "Voltage",
color: "orange",
data: minutes
? $hardwareStatistics.minutes.map((value) => value.cpu.voltage)
: $hardwareStatistics.seconds.map((value) => value.cpu.voltage),
},
],
time: minutes ? "m" : "s",
unit: " V",
}}
/>
</div>
</div>

<div>
<LineChart
props={{
statistics: [
{
label: "Voltage",
color: "orange",
data: minutes
? $hardwareStatistics.minutes.map((value) => value.cpu.voltage)
: $hardwareStatistics.seconds.map((value) => value.cpu.voltage),
},
],
time: minutes ? "m" : "s",
unit: " V",
}}
/>
</div>
</div>
{/if}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion platforms/interface/ui/pages/gpu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h3>Vendor: {$hardwareInfo.gpu.name?.split(" ")[0] ?? "N/A"}</h3>
<h3>Name: {$hardwareInfo.gpu.name ?? "N/A"}</h3>
<h3>GPU memory: {$hardwareInfo.gpu.memory.length > 2 ? Math.round($hardwareInfo.gpu.memory[2]?.value ?? 0) : "N/A"} GB</h3>
<h3>Driver date: {$hardwareInfo.gpu.info}</h3>
<h3>Driver: {$hardwareInfo.gpu.info}</h3>
<h3>
Primary monitor: {$hardwareInfo.system.monitor.monitors.find((monitor) => monitor.primary)?.resolution ?? "N/A"}
{$hardwareInfo.system.monitor.monitors.find((monitor) => monitor.primary)?.refreshRate ?? "N/A"} Hz
Expand Down
16 changes: 9 additions & 7 deletions platforms/interface/ui/pages/home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,15 @@
($hardwareInfo.ram.load[3]?.value ?? 0) + ($hardwareInfo.ram.load[4]?.value ?? 0)
).toFixed(1)} GB`}
</h3>
<div>
<MeterChart
readings={[$hardwareInfo.ram.load[3]]}
categories={["Virtual RAM usage"]}
type={{ name: "virtual memory usage", unit: "GB" }}
/>
</div>
{#if $hardwareInfo.ram.load[3]?.value ?? 0 > 0}
<div>
<MeterChart
readings={[$hardwareInfo.ram.load[3]]}
categories={["Virtual RAM usage"]}
type={{ name: "virtual memory usage", unit: "GB" }}
/>
</div>
{/if}
</div>
</div>

Expand Down
82 changes: 42 additions & 40 deletions platforms/interface/ui/pages/storage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -82,51 +82,53 @@
</div>
</div>

<div class="transparent-800 w-1/2 rounded-xl p-8 sm:w-full sm:p-4">
<div class="flex items-baseline justify-between">
<div class="mb-5 flex items-center gap-3">
<div class="transparent-900 flex aspect-square items-center justify-center rounded-lg p-3 sm:p-2">
<Thermometer />
{#if item.temperature.value > 0}
<div class="transparent-800 w-1/2 rounded-xl p-8 sm:w-full sm:p-4">
<div class="flex items-baseline justify-between">
<div class="mb-5 flex items-center gap-3">
<div class="transparent-900 flex aspect-square items-center justify-center rounded-lg p-3 sm:p-2">
<Thermometer />
</div>
<h2><span class="line-clamp-1">{item.name}</span> Temperature</h2>
</div>
<div>
<ToggleButton selected={minutes} on:click={() => (minutes = !minutes)} />
</div>
<h2><span class="line-clamp-1">{item.name}</span> Temperature</h2>
</div>
<div>
<ToggleButton selected={minutes} on:click={() => (minutes = !minutes)} />
</div>
</div>
<div>
<LineChart
props={{
statistics: [
{
label: `Max Temperature`,
color: "max",
data: minutes
? $hardwareStatistics.minutes.map((value) => value.storage[i].temperature.max)
: $hardwareStatistics.seconds.map((value) => value.storage[i].temperature.max),
},
<LineChart
props={{
statistics: [
{
label: `Max Temperature`,
color: "max",
data: minutes
? $hardwareStatistics.minutes.map((value) => value.storage[i].temperature.max)
: $hardwareStatistics.seconds.map((value) => value.storage[i].temperature.max),
},

{
label: `Current Temperature`,
color: "current",
data: minutes
? $hardwareStatistics.minutes.map((value) => value.storage[i].temperature.value)
: $hardwareStatistics.seconds.map((value) => value.storage[i].temperature.value),
},
{
label: `Min Temperature`,
color: "min",
data: minutes
? $hardwareStatistics.minutes.map((value) => value.storage[i].temperature.min)
: $hardwareStatistics.seconds.map((value) => value.storage[i].temperature.min),
},
],
unit: " °C",
time: minutes ? "m" : "s",
}}
/>
{
label: `Current Temperature`,
color: "current",
data: minutes
? $hardwareStatistics.minutes.map((value) => value.storage[i].temperature.value)
: $hardwareStatistics.seconds.map((value) => value.storage[i].temperature.value),
},
{
label: `Min Temperature`,
color: "min",
data: minutes
? $hardwareStatistics.minutes.map((value) => value.storage[i].temperature.min)
: $hardwareStatistics.seconds.map((value) => value.storage[i].temperature.min),
},
],
unit: " °C",
time: minutes ? "m" : "s",
}}
/>
</div>
</div>
</div>
{/if}
</div>
{/each}
</div>
Expand Down
2 changes: 1 addition & 1 deletion platforms/interface/web/src/components/getStarted.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<h3>Launch Cores Web in any browser and use the connection code from Cores Desktop.</h3>
<a
class="bg-cores-max hover:text-cores-max mt-5 rounded-2xl px-5 py-3 text-2xl font-medium duration-200 ease-in-out hover:bg-white hover:from-transparent hover:to-transparent"
href="/settings">Setup</a
href="/connections">Setup</a
>
</div>
</div>
Expand Down

0 comments on commit 61e4db2

Please sign in to comment.