From 6b33a37ec588518c4b038f9063f3137f36950df4 Mon Sep 17 00:00:00 2001 From: Thomas Lefebvre Date: Sat, 29 Apr 2023 18:55:49 -0400 Subject: [PATCH] Tweaks --- app/bindings/Response.ts | 2 +- app/src/main.rs | 6 ------ app/tauri.conf.json | 2 +- client/App.tsx | 2 -- client/Thermal/Thermal.css | 12 ++---------- client/Thermal/Thermal.tsx | 14 +------------- client/ThermalGauge/ThermalGauge.css | 4 ++++ client/ThermalGauge/ThermalGauge.tsx | 2 +- client/UsageGauge/UsageGauge.css | 2 +- client/index.tsx | 2 ++ 10 files changed, 13 insertions(+), 35 deletions(-) diff --git a/app/bindings/Response.ts b/app/bindings/Response.ts index 270acfc..2023b7d 100644 --- a/app/bindings/Response.ts +++ b/app/bindings/Response.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface Response { total_cpu_load: number, cpu_temp: number, gpu_temp: number, total_gpu_load: number, total_ram_load: number, total_vram_load: number, cpu_model: string, gpu_model: string, } \ No newline at end of file +export interface Response { total_cpu_load: number, cpu_temp: number, gpu_temp: number, total_gpu_load: number, total_ram_load: number, total_vram_load: number, } \ No newline at end of file diff --git a/app/src/main.rs b/app/src/main.rs index 0d3fc27..af9e454 100644 --- a/app/src/main.rs +++ b/app/src/main.rs @@ -51,8 +51,6 @@ struct Response { total_gpu_load: f64, total_ram_load: f64, total_vram_load: f64, - cpu_model: String, - gpu_model: String, } #[derive(Deserialize, Serialize)] @@ -145,10 +143,6 @@ async fn fetch_sensor() -> Result { Variant::Load { value } => Some(*value as f64), _ => None, })?, - - // TODO - cpu_model: "Intel Core i7-9750H".to_string(), - gpu_model: "NVIDIA GeForce RTX 2060".to_string(), }) } diff --git a/app/tauri.conf.json b/app/tauri.conf.json index d6878fb..e9168d8 100644 --- a/app/tauri.conf.json +++ b/app/tauri.conf.json @@ -2,7 +2,7 @@ "$schema": "../node_modules/@tauri-apps/cli/schema.json", "build": { "beforeBuildCommand": "just build false", - "beforeDevCommand": "just dev", + "beforeDevCommand": "just dev false", "devPath": "http://localhost:3000", "distDir": "../dist" }, diff --git a/client/App.tsx b/client/App.tsx index bf35ae1..228f37d 100644 --- a/client/App.tsx +++ b/client/App.tsx @@ -151,7 +151,6 @@ export const App: React.FC = () => { O.map((s) => ({ degrees: s.cpu_temp, load: s.total_cpu_load, - model: s.cpu_model, })) )} label="CPU Core" @@ -223,7 +222,6 @@ export const App: React.FC = () => { O.map((s) => ({ degrees: s.gpu_temp, load: s.total_gpu_load, - model: s.gpu_model, })) )} label="GPU Core" diff --git a/client/Thermal/Thermal.css b/client/Thermal/Thermal.css index 6aab4ad..a0eff30 100644 --- a/client/Thermal/Thermal.css +++ b/client/Thermal/Thermal.css @@ -9,8 +9,8 @@ .header { display: inline-flex; flex-direction: column; - text-shadow: 0 0 2px rgba(255, 255, 255, 0.5), - 0 0 4px rgba(255, 255, 255, 0.5); + text-shadow: 0 0 1px rgba(255, 255, 255, 0.5), + 0 0 2px rgba(255, 255, 255, 0.5); gap: 4px; padding-bottom: 16px; } @@ -56,14 +56,6 @@ color: transparent; } -.model { - font-size: 12px; -} - -.model.loading { - color: grey; -} - .loadGaugeContainer { /* Relative to `.container` */ position: absolute; diff --git a/client/Thermal/Thermal.tsx b/client/Thermal/Thermal.tsx index e5eb99f..7444de2 100644 --- a/client/Thermal/Thermal.tsx +++ b/client/Thermal/Thermal.tsx @@ -56,7 +56,7 @@ export const Thermal: React.FC< Pick & { label: string; // TODO: use newtype for percentage - resp: O.Option<{ degrees: number; load: number; model: string }>; + resp: O.Option<{ degrees: number; load: number; }>; dir: Dir; } > = ({ label, resp, paths, dir }) => { @@ -110,18 +110,6 @@ export const Thermal: React.FC< )} > {label} - - {pipe( - resp, - O.match(constant("—"), (r) => r.model) - )} -
{pipe( diff --git a/client/ThermalGauge/ThermalGauge.css b/client/ThermalGauge/ThermalGauge.css index 310b1fd..aa65af9 100644 --- a/client/ThermalGauge/ThermalGauge.css +++ b/client/ThermalGauge/ThermalGauge.css @@ -31,6 +31,10 @@ font-size: 52px; } +.degSymbol { + font-size: 22px; +} + .particlesContainer { /* TODO: this is somewhat directly related from the size of the ThermalGauge */ width: 150px; diff --git a/client/ThermalGauge/ThermalGauge.tsx b/client/ThermalGauge/ThermalGauge.tsx index 77363cc..5dfba92 100644 --- a/client/ThermalGauge/ThermalGauge.tsx +++ b/client/ThermalGauge/ThermalGauge.tsx @@ -279,7 +279,7 @@ export const ThermalGauge: React.FC = React.memo( ), }} > - {n} + {n}° )) )} diff --git a/client/UsageGauge/UsageGauge.css b/client/UsageGauge/UsageGauge.css index 86da683..8418c22 100644 --- a/client/UsageGauge/UsageGauge.css +++ b/client/UsageGauge/UsageGauge.css @@ -13,7 +13,7 @@ .nContainer { position: absolute; - top: 52px; + top: 47px; color: white; font-size: 13px; } \ No newline at end of file diff --git a/client/index.tsx b/client/index.tsx index f9c402a..6bf1ef3 100644 --- a/client/index.tsx +++ b/client/index.tsx @@ -5,6 +5,8 @@ import { App } from "./App"; import * as O from "./facades/Option"; import { mockInvoke } from "./mock"; +console.log(__DEMO__) + if (__DEMO__) { let count = 0; mockIPC((cmd) => {