Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Magellol committed Apr 29, 2023
1 parent 6a67d23 commit 6b33a37
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 35 deletions.
2 changes: 1 addition & 1 deletion app/bindings/Response.ts
Original file line number Diff line number Diff line change
@@ -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, }
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, }
6 changes: 0 additions & 6 deletions app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -145,10 +143,6 @@ async fn fetch_sensor() -> Result<Response, SensorError> {
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(),
})
}

Expand Down
2 changes: 1 addition & 1 deletion app/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 0 additions & 2 deletions client/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
12 changes: 2 additions & 10 deletions client/Thermal/Thermal.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -56,14 +56,6 @@
color: transparent;
}

.model {
font-size: 12px;
}

.model.loading {
color: grey;
}

.loadGaugeContainer {
/* Relative to `.container` */
position: absolute;
Expand Down
14 changes: 1 addition & 13 deletions client/Thermal/Thermal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const Thermal: React.FC<
Pick<ThermalGaugeProps, "paths"> & {
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 }) => {
Expand Down Expand Up @@ -110,18 +110,6 @@ export const Thermal: React.FC<
)}
>
<span className={styles.label}>{label}</span>
<span
className={classNames(
styles.model,
styles.glowyText,
pipe(resp, O.match(constant(styles.loading), constNull))
)}
>
{pipe(
resp,
O.match(constant("—"), (r) => r.model)
)}
</span>
</header>
<div className={styles.rays}>
{pipe(
Expand Down
4 changes: 4 additions & 0 deletions client/ThermalGauge/ThermalGauge.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion client/ThermalGauge/ThermalGauge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const ThermalGauge: React.FC<Props> = React.memo(
),
}}
>
{n}
{n}<sup className={styles.degSymbol}>°</sup>
</span>
))
)}
Expand Down
2 changes: 1 addition & 1 deletion client/UsageGauge/UsageGauge.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

.nContainer {
position: absolute;
top: 52px;
top: 47px;
color: white;
font-size: 13px;
}
2 changes: 2 additions & 0 deletions client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 6b33a37

Please sign in to comment.