Skip to content

Commit 0d3b756

Browse files
committed
Added rough process graph on click
1 parent 424285b commit 0d3b756

File tree

19 files changed

+9938
-47
lines changed

19 files changed

+9938
-47
lines changed

package-lock.json

Lines changed: 9575 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
"name": "over-the-top",
33
"version": "0.8.1",
44
"description": "A minimal Electron application written with Typescript",
5-
"main": "dist/bundle.js",
5+
"main": "dist/main.js",
66
"scripts": {
77
"build:worker": "tsc src/old/worker/worker.ts --outDir dist",
88
"build:prod": "webpack --config webpack.prod.config.js",
99
"build:dev": "webpack --config webpack.dev.config.js",
1010
"build:dev:watch": "webpack --config webpack.dev.config.js --watch",
1111
"lint": "tslint -c tslint.json -p tsconfig.json",
12-
"start": "yarn run build:dev && electron dist/bundle.js",
13-
"start:watch": "yarn run build:dev:watch & electron dist/bundle.js",
14-
"start:prod": "yarn run build:prod && electron ./dist/bundle.js",
12+
"start": "yarn run build:dev && electron dist/main.js",
13+
"start:watch": "yarn run build:dev:watch & electron dist/main.js",
14+
"start:prod": "yarn run build:prod && electron ./dist/main.js",
1515
"package-curent": "electron-packager . --out=out",
1616
"package-linux": "electron-packager . --out=out --platform=linux --arch=x64",
1717
"package-win": "electron-packager . --out=out --platform=win32 --arch=x64",
@@ -54,7 +54,6 @@
5454
"sass-loader": "^16.0.5",
5555
"style-loader": "^4.0.0",
5656
"ts-loader": "^9.4.2",
57-
"ttf-loader": "^1.0.2",
5857
"typescript": "^5.8.3",
5958
"webpack": "^5.99.9",
6059
"webpack-cli": "^6.0.1",
@@ -64,7 +63,7 @@
6463
"color": "^5.0.0",
6564
"deep-equal": "^2.2.1",
6665
"overlayscrollbars": "^2.11.4",
67-
"overlayscrollbars-react": "^0.5.0",
66+
"overlayscrollbars-react": "^0.5.6",
6867
"parse-domain": "^8.2.2",
6968
"react": "^19.1.0",
7069
"react-dom": "^19.1.0",
@@ -73,6 +72,7 @@
7372
"styled-components": "^6.1.19",
7473
"systeminformation": "^5.27.7",
7574
"two.js": "0.8.19",
76-
"uuid": "^11.1.0"
75+
"uuid": "^11.1.0",
76+
"voronoijs": "^1.0.0"
7777
}
7878
}

src/html/detail.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8"/>
5+
<title>Process Detail</title>
6+
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
7+
<meta
8+
http-equiv="Content-Security-Policy"
9+
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"
10+
/>
11+
<link rel="stylesheet" href="detail.css">
12+
<script defer src="detail.js"></script>
13+
</head>
14+
<body>
15+
<div id="root"></div>
16+
</body>
17+
</html>

src/html/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"
1010
/>
1111
<link rel="stylesheet" href="main.css">
12-
<script defer src="bundle.js"></script>
12+
<script defer src="main.js"></script>
1313
<!-- <link rel="stylesheet" href="../../node_modules/react-perfect-scrollbar/dist/css/styles.css"/>-->
1414
</head>
1515
<body>

src/scss/common.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
html {
2+
height: 100%;
3+
width: 100%;
4+
}
5+
6+
body {
7+
font-family: 'Exo', sans-serif;
8+
margin: 0;
9+
height: 100%;
10+
width: 100%;
11+
}
12+
13+
button {
14+
font-family: 'Exo', sans-serif;
15+
background: none;
16+
border: none;
17+
text-decoration: none;
18+
font-size: 15px;
19+
}
20+
21+
#root {
22+
height: 100%;
23+
width: 100%;
24+
}
25+
26+
p {
27+
margin: 0;
28+
}

src/scss/main.scss

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,9 @@
66
@use "settings";
77
@use "disk";
88
@use "details";
9+
@use "common";
910

10-
html {
11-
height: 100%;
12-
width: 100%;
13-
}
14-
15-
body {
16-
font-family: 'Exo', sans-serif;
17-
margin: 0;
18-
height: 100%;
19-
width: 100%;
20-
}
2111

22-
button {
23-
font-family: 'Exo', sans-serif;
24-
background: none;
25-
border: none;
26-
text-decoration: none;
27-
font-size: 15px;
28-
}
29-
30-
#root {
31-
height: 100%;
32-
width: 100%;
33-
}
34-
35-
p {
36-
margin: 0;
37-
}
3812

3913
.main {
4014
position: fixed;

src/scss/process-detail.scss

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
@use "fonts.scss";
2+
@use "common.scss";
3+
4+
.process-detail-container {
5+
background-color: #242424; // $background
6+
color: #FFFFFF; // $primary
7+
height: 100%;
8+
padding: 20px;
9+
box-sizing: border-box;
10+
font-family: 'Exo', sans-serif;
11+
}
12+
13+
.process-detail-header {
14+
font-size: 20px; // Reduced font size
15+
font-weight: normal; // Not bolded
16+
text-align: center; // Centered
17+
border-bottom: 1px solid #444444;
18+
padding-bottom: 10px;
19+
margin-bottom: 20px;
20+
}
21+
22+
.process-overall-usage {
23+
display: flex;
24+
justify-content: space-around;
25+
margin-bottom: 20px;
26+
padding-bottom: 10px;
27+
border-bottom: 1px solid #444444;
28+
}
29+
30+
.process-overall-usage-item {
31+
flex: 1;
32+
text-align: center;
33+
font-size: 16px;
34+
}
35+
36+
.process-overall-usage-value {
37+
font-weight: bold;
38+
font-size: 18px;
39+
}
40+
41+
.process-pids-table {
42+
width: 100%;
43+
border-collapse: collapse;
44+
font-size: 14px;
45+
}
46+
47+
.process-pids-table th,
48+
.process-pids-table td {
49+
padding: 8px;
50+
text-align: left;
51+
border-bottom: 1px solid #333333;
52+
}
53+
54+
.process-pids-table th {
55+
font-weight: bold;
56+
border-bottom: 1px solid #AAA; // Changed from 2px to 1px
57+
}
58+
59+
.process-action-buttons {
60+
display: flex;
61+
justify-content: center;
62+
gap: 10px;
63+
margin-top: auto;
64+
}
65+
66+
.process-action-buttons button {
67+
flex: 1; // Take equal space
68+
max-width: calc(50% - 5px); // Half width minus half of the gap
69+
padding: 10px 20px;
70+
border-radius: 5px;
71+
cursor: pointer;
72+
background-color: #555555;
73+
color: #FFFFFF;
74+
border: none;
75+
}
76+
77+
.process-action-buttons button:hover {
78+
background-color: #666666;
79+
}
80+
81+
.selected-row {
82+
background-color: rgba(255, 255, 255, 0.1);
83+
}
84+
85+
.command-cell {
86+
max-width: 200px; // Adjust as needed
87+
overflow: hidden;
88+
white-space: nowrap;
89+
text-overflow: ellipsis;
90+
}

src/ts/backend/config/default.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const DEFAULT_CONFIG: Config = {
5757
process: {
5858
timing: {
5959
updateInterval: 3000,
60+
processDetailUpdateInterval: 10000,
6061
}
6162
},
6263
gpu: {

src/ts/backend/config/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export interface Config {
6161
process: {
6262
timing: {
6363
updateInterval: number,
64+
processDetailUpdateInterval: number, // New property
6465
}
6566
},
6667
color: {

src/ts/backend/cpu.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {CpuInfo, CpuSpeedUpdate, CpuTemperatureUpdate, CpuUsageUpdate} from "../data/cpu";
22
import * as si from "systeminformation";
33
import {CPUSystemInformation} from "../data/system";
4+
import {bound} from "../ui/util/data";
45

56
export async function cpuInfo(): Promise<CpuInfo> {
67
const siCpuInfo = await si.cpu();
@@ -13,8 +14,10 @@ export async function cpuInfo(): Promise<CpuInfo> {
1314

1415
export async function cpuUsageUpdate(): Promise<CpuUsageUpdate> {
1516
const siCpuUpdate = await si.currentLoad();
16-
const coreUsages = siCpuUpdate.cpus.map(coreUsage => coreUsage.load / 100);
17-
const overallUsage = siCpuUpdate.currentLoad / 100;
17+
const coreUsages = siCpuUpdate.cpus
18+
.map(coreUsage => coreUsage.load / 100)
19+
.map(usage => bound(usage));
20+
const overallUsage = bound(siCpuUpdate.currentLoad / 100);
1821
return {
1922
overallUsage,
2023
coreUsages,

0 commit comments

Comments
 (0)