-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
111 lines (107 loc) · 3.01 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Sys info</title>
<link href="css/bootstrap.min.css" rel="stylesheet"></link>
</head>
<body>
<h3></h3>
<!-- All of the Node.js APIs are available in this renderer process. -->
<div class="container">
<div class="jumbotron">
<h3>System info<small> by <span style="color:aquamarine"> Ajmal Hassan</span></small></h3>
<div class="row">
<div class="col-sm-4">
<div class="thumbnail">
<div class="caption">
<h3><small id="Memory"></small></h3>
<canvas id="myChart" width="100" height="100"></canvas>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="thumbnail">
<div class="caption">
<h3><small>Processor Architecture</small></h3>
<p><script>document.write(process.arch)</script></p>
</div>
</div>
<div class="thumbnail">
<div class="caption">
<h3><small>Platform</small></h3>
<p><script>document.write(process.platform)</script></p>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="thumbnail">
<div class="caption">
<h3><small>Processor Name</small></h3>
<p><script>document.write(process.env.PROCESSOR_IDENTIFIER)</script></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="js/chart.min.js"></script>
<script>
var ctx = document.getElementById("myChart");
var total_mem = ((process.getSystemMemoryInfo().total/1024)/1024).toPrecision(3);
var mem_title = document.getElementById("Memory").innerHTML = `Memory Usage(out of ${total_mem} GB)`;
var free_mem = ((process.getSystemMemoryInfo().free/1024)/1024).toPrecision(3);
var used_mem = (total_mem - free_mem).toPrecision(3);
var myChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: [
`${used_mem} GB Used`,
`${free_mem} GB Free`
],
datasets: [
{
data: [used_mem, free_mem],
backgroundColor: [
"#FF6384",
"#36A2EB"
],
hoverBackgroundColor: [
"#FF6384",
"#36A2EB"
],
borderWidth: 0
}]
},
});
setInterval(function(){
var total_mem = ((process.getSystemMemoryInfo().total/1024)/1024).toPrecision(3);;
var free_mem = ((process.getSystemMemoryInfo().free/1024)/1024).toPrecision(3);;
var used_mem = (total_mem - free_mem).toPrecision(3)
var myChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: [
`${used_mem} GB Used`,
`${free_mem} GB Free`
],
datasets: [
{
data: [used_mem, free_mem],
backgroundColor: [
"#FF6384",
"#36A2EB"
],
hoverBackgroundColor: [
"#FF6384",
"#36A2EB"
],
borderWidth: 0
}]
},
});
},5000);
require('./renderer.js')
</script>
</html>