Skip to content

Commit 597f2e4

Browse files
author
sarthakpranesh
committed
Changes
- removed unused files by wails - added splash screen, closes #4 - refactored other parts of the projects Signed-off-by: sarthakpranesh <[email protected]>
1 parent df3e9a5 commit 597f2e4

18 files changed

+44
-231
lines changed

build/cpuRoller

8.42 MB
Binary file not shown.

frontend/package.json.md5

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
de4d4f32319e215a59ff1b191f20e213
1+
43cffb60317db08ea5fde9d6b3e4e0de

frontend/public/favicon.ico

-3.08 KB
Binary file not shown.

frontend/public/index.html

+1-32
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,11 @@
22
<html lang="en">
33

44
<head>
5-
<meta charset="utf-8" />
6-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1" />
8-
<meta name="theme-color" content="#000000" />
9-
<meta name="description" content="Web site created using create-react-app" />
10-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
11-
<!--
12-
manifest.json provides metadata used when your web app is installed on a
13-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
14-
-->
15-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
16-
<!--
17-
Notice the use of %PUBLIC_URL% in the tags above.
18-
It will be replaced with the URL of the `public` folder during the build.
19-
Only files inside the `public` folder can be referenced from the HTML.
20-
21-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
22-
work correctly both with client-side routing and a non-root public URL.
23-
Learn how to configure a non-root public URL by running `npm run build`.
24-
-->
25-
<title>React App</title>
5+
<title>cpuRoller</title>
266
</head>
277

288
<body>
29-
<noscript>You need to enable JavaScript to run this app.</noscript>
309
<div id="app"></div>
31-
<!--
32-
This HTML file is a template.
33-
If you open it directly in the browser, you will see an empty page.
34-
35-
You can add webfonts, meta tags, or analytics to this file.
36-
The build step will place the bundled scripts into the <body> tag.
37-
38-
To begin the development, run `npm start` or `yarn start`.
39-
To create a production bundle, use `npm run build` or `yarn build`.
40-
-->
4110
</body>
4211

4312
</html>

frontend/public/logo192.png

-37.4 KB
Binary file not shown.

frontend/public/logo512.png

-176 KB
Binary file not shown.

frontend/public/manifest.json

-25
This file was deleted.

frontend/public/robots.txt

-3
This file was deleted.

frontend/src/App.css

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Cards overlay: #1f4068
33
Primary Text: #ececec
44
Secondary Text: #e43f5a
5-
6-
Progress Bar trail: #f4f4f4
7-
Progress Bar Path: #f0a500
8-
Progress Bar Circle width: #f0a500
95
*/
106

117
.App {

frontend/src/App.js

+24-12
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ import './App.css';
44
// importing components
55
import CircularUsage from './components/CircularUsage/index.js'
66

7+
import CpuLogo from './logo.png';
8+
79
const gbFact = 1073741824;
810

911
function App() {
12+
const [loading, setLoading] = useState(true);
1013
const [result, setResult] = useState(null);
1114
const [coreCount, setCoreCount] = useState(0);
1215

@@ -25,6 +28,7 @@ function App() {
2528
window.backend.initStats().then((result) => {
2629
setResult(result);
2730
FindAndSetCoreCount(result.CPUInfo);
31+
setLoading(false);
2832
});
2933
setInterval(() => {
3034
window.backend.updateCPUStats().then((result) => {
@@ -33,6 +37,14 @@ function App() {
3337
});
3438
}, 1000);
3539
}, [])
40+
41+
if (loading) {
42+
return (
43+
<div id="app" className="App">
44+
<img src={CpuLogo} />
45+
</div>
46+
)
47+
}
3648

3749
return (
3850
<div id="app" className="App">
@@ -59,7 +71,7 @@ function App() {
5971
/>
6072
</div>
6173
</div>
62-
<h4 className="PrimaryText SysInfo">
74+
<h5 className="PrimaryText SysInfo">
6375
<span className="SecondaryText">
6476
CPU Model:
6577
</span>
@@ -70,22 +82,22 @@ function App() {
7082
)
7183
: ""
7284
}
73-
</h4>
74-
<h4 className="PrimaryText SysInfo">
85+
</h5>
86+
<h5 className="PrimaryText SysInfo">
7587
<span className="SecondaryText">Total CPUs:</span> {coreCount}
76-
</h4>
77-
<h4 className="PrimaryText SysInfo">
88+
</h5>
89+
<h5 className="PrimaryText SysInfo">
7890
<span className="SecondaryText">Total Threads:</span> {result !== null ? result.CPUInfo.length : 0}
79-
</h4>
80-
<h4 className="PrimaryText SysInfo">
91+
</h5>
92+
<h5 className="PrimaryText SysInfo">
8193
<span className="SecondaryText">Cache Size:</span> {result !== null ? result.CPUInfo[0].cacheSize : 0}
82-
</h4>
83-
<h4 className="PrimaryText SysInfo">
94+
</h5>
95+
<h5 className="PrimaryText SysInfo">
8496
<span className="SecondaryText">Operating System:</span> {result !== null ? result.Os : " "}
85-
</h4>
86-
<h4 className="PrimaryText SysInfo">
97+
</h5>
98+
<h5 className="PrimaryText SysInfo">
8799
<span className="SecondaryText">System Arch:</span> {result !== null ? result.Arch : " "}
88-
</h4>
100+
</h5>
89101
</div>
90102
);
91103
}

frontend/src/components/CircularUsage/index.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@ import React from 'react'
22
// import {CircularProgressbarWithChildren} from 'react-circular-progressbar';
33
import ProgressBar from "../ProgressBar/index.js";
44

5-
// importing styles
5+
// importing styles and constants
66
import "./styles.css";
7+
import {ProgressBarCons} from '../../config/Constants.js'
78

89
const CircularUsage = ({percentage=66, title="title", subContent="subs"}) => {
910

1011
return (
1112
<div className="CircularUsageWrapper">
1213
<ProgressBar
1314
progress={percentage}
14-
strokeWidth={10}
15-
strokeColor='#f0a500'
16-
strokeLinecap='round'
17-
transition='0.3s ease'
18-
trackStrokeWidth={10}
19-
trackStrokeColor='#f4f4f4'
20-
trackStrokeLinecap='butt'
15+
strokeWidth={ProgressBarCons.strokeWidth}
16+
strokeColor={ProgressBarCons.strokeColor}
17+
trackStrokeWidth={ProgressBarCons.trackStrokeWidth}
18+
trackStrokeColor={ProgressBarCons.trackStrokeColor}
2119
>
2220
<div>
2321
<h1 className="PrimaryText CircularUsageTitle">{title}</h1>

frontend/src/components/CircularUsage/styles.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
width: 20vw;
33
height: 20vw;
44
display: flex;
5-
margin: 10px;
5+
margin: 20px;
66
flex-direction: column;
77
justify-content: center;
88
align-items: center;

frontend/src/components/ProgressBar/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ ProgressBar.defaultProps = {
122122
strokeWidth: 10,
123123
strokeColor: 'indianred',
124124
strokeLinecap: 'round',
125-
transition: '.3s ease',
125+
transition: '0.3s ease',
126126
trackStrokeColor: '#e6e6e6',
127127
trackStrokeWidth: 10,
128128
trackStrokeLinecap: 'round',

frontend/src/config/Constants.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
export const ProgressBarCons = {
3+
strokeWidth: 8,
4+
trackStrokeWidth: 4,
5+
strokeColor: '#f0a500',
6+
trackStrokeColor: '#f4f4f4',
7+
}

frontend/src/index.js

-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import ReactDOM from 'react-dom';
33
import 'core-js/stable';
44
import './index.css';
55
import App from './App';
6-
import * as serviceWorker from './serviceWorker';
76

87
import * as Wails from '@wailsapp/runtime';
98

@@ -15,8 +14,3 @@ Wails.Init(() => {
1514
document.getElementById("app")
1615
);
1716
});
18-
19-
// If you want your app to work offline and load faster, you can change
20-
// unregister() to register() below. Note this comes with some pitfalls.
21-
// Learn more about service workers: https://bit.ly/CRA-PWA
22-
serviceWorker.unregister();

frontend/src/logo.png

-300 KB
Loading

frontend/src/serviceWorker.js

-135
This file was deleted.

main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ func main() {
3030
css := mewn.String("./frontend/build/static/css/main.css")
3131

3232
app := wails.CreateApp(&wails.AppConfig{
33-
Width: 1024,
34-
Height: 768,
33+
Width: 800,
34+
Height: 500,
3535
Title: "cpuRoller",
3636
JS: js,
3737
CSS: css,
38-
Colour: "#131313",
38+
Colour: "#162447",
3939
})
4040
app.Bind(initStats)
4141
app.Bind(updateCPUStats)

0 commit comments

Comments
 (0)