Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
✨ Replace clipboardButtons with hardwareInspector
Browse files Browse the repository at this point in the history
Those buttons are useless now that touchscreen keyboard shortcuts work
  • Loading branch information
GitSquared committed Feb 24, 2019
1 parent c65469e commit b00b12c
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 94 deletions.
2 changes: 1 addition & 1 deletion src/_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@ async function initUI() {
// Left column
window.mods.clock = new Clock("mod_column_left");
window.mods.sysinfo = new Sysinfo("mod_column_left");
window.mods.hardwareInspector = new HardwareInspector("mod_column_left");
window.mods.cpuinfo = new Cpuinfo("mod_column_left");
window.mods.ramwatcher = new RAMwatcher("mod_column_left");
window.mods.toplist = new Toplist("mod_column_left");
window.mods.clipboardButtons = new ClipboardButtons("mod_column_left");

// Right column
window.mods.netstat = new Netstat("mod_column_right");
Expand Down
63 changes: 0 additions & 63 deletions src/assets/css/mod_clipboardButtons.css

This file was deleted.

49 changes: 49 additions & 0 deletions src/assets/css/mod_hardwareInspector.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
div#mod_hardwareInspector {
border-top: 0.092vh solid rgba(var(--color_r), var(--color_g), var(--color_b), 0.3);
font-family: var(--font_main_light);
letter-spacing: 0.092vh;
padding: 0.645vh 0vh;
display: flex;
}

div#mod_hardwareInspector::before {
content: "";
border-left: 0.092vh solid rgba(var(--color_r), var(--color_g), var(--color_b), 0.3);
align-self: flex-start;
position: relative;
left: -0.092vh;
top: -1.111vh;
height: 0.833vh;
}

div#mod_hardwareInspector::after {
content: "";
border-right: 0.092vh solid rgba(var(--color_r), var(--color_g), var(--color_b), 0.3);
position: relative;
right: -0.092vh;
top: -1.111vh;
height: 0.833vh;
}

div#mod_hardwareInspector_inner {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-evenly;
flex-wrap: wrap;
width: 100%;
}

div#mod_hardwareInspector_inner > div {
text-align: left;
}

div#mod_hardwareInspector_inner > div > * {
font-size: 1.3vh;
line-height: 1.5vh;
margin: 0vh;
}

div#mod_hardwareInspector_inner > div > h2 {
opacity: 0.5;
}
28 changes: 0 additions & 28 deletions src/classes/clipboardButtons.class.js

This file was deleted.

44 changes: 44 additions & 0 deletions src/classes/hardwareInspector.class.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
class HardwareInspector {
constructor(parentId) {
if (!parentId) throw "Missing parameters";

// Create DOM
this.parent = document.getElementById(parentId);
this._element = document.createElement("div");
this._element.setAttribute("id", "mod_hardwareInspector");
this._element.innerHTML = `<div id="mod_hardwareInspector_inner">
<div>
<h1>MANUFACTURER</h1>
<h2 id="mod_hardwareInspector_manufacturer" >NONE</h2>
</div>
<div>
<h1>MODEL</h1>
<h2 id="mod_hardwareInspector_model" >NONE</h2>
</div>
<div>
<h1>CHASSIS</h1>
<h2 id="mod_hardwareInspector_chassis" >NONE</h2>
</div>
</div>`;

this.parent.append(this._element);

this.updateInfo();
this.infoUpdater = setInterval(() => {
this.updateInfo();
}, 20000);
}
updateInfo() {
window.si.system().then(d => {
document.getElementById("mod_hardwareInspector_manufacturer").innerText = d.manufacturer;
document.getElementById("mod_hardwareInspector_model").innerText = d.model;
});
window.si.chassis().then(d => {
document.getElementById("mod_hardwareInspector_chassis").innerText = d.type;
});
}
}

module.exports = {
HardwareInspector
};
4 changes: 2 additions & 2 deletions src/ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<link rel="stylesheet" href="assets/css/mod_column.css" />
<link rel="stylesheet" href="assets/css/mod_clock.css" />
<link rel="stylesheet" href="assets/css/mod_sysinfo.css" />
<link rel="stylesheet" href="assets/css/mod_hardwareInspector.css" />
<link rel="stylesheet" href="assets/css/mod_cpuinfo.css" />
<link rel="stylesheet" href="assets/css/mod_netstat.css" />
<link rel="stylesheet" href="assets/css/mod_conninfo.css" />
<link rel="stylesheet" href="assets/css/mod_globe.css" />
<link rel="stylesheet" href="assets/css/mod_ramwatcher.css" />
<link rel="stylesheet" href="assets/css/mod_toplist.css" />
<link rel="stylesheet" href="assets/css/mod_clipboardButtons.css" />
<!-- Load extra CSS -->
<link rel="stylesheet" href="assets/css/extra_ratios.css" />

Expand All @@ -37,13 +37,13 @@
<!-- Load secondary modules classes -->
<script src="classes/clock.class.js"></script>
<script src="classes/sysinfo.class.js"></script>
<script src="classes/hardwareInspector.class.js"></script>
<script src="classes/cpuinfo.class.js"></script>
<script src="classes/netstat.class.js"></script>
<script src="classes/conninfo.class.js"></script>
<script src="classes/locationGlobe.class.js"></script>
<script src="classes/ramwatcher.class.js"></script>
<script src="classes/toplist.class.js"></script>
<script src="classes/clipboardButtons.class.js"></script>
<!-- Load extra classes -->
<script src="classes/audiofx.class.js"></script>
</head>
Expand Down

0 comments on commit b00b12c

Please sign in to comment.