5 Commits

Author SHA1 Message Date
c451237ab9 Version bump to v0.3.0
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2022-08-24 00:29:48 -04:00
b4fb652727 Updated dependencies
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-08-24 00:28:51 -04:00
a23827355a Added a temperature reading for the current selected disk
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-08-24 00:23:36 -04:00
be030532ea Fixed the hardware info tables to use the full section width
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-08-23 23:59:05 -04:00
0656a1ff34 Added page for storage device info
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-08-23 23:54:13 -04:00
7 changed files with 690 additions and 451 deletions

View File

@ -0,0 +1,60 @@
si = require('systeminformation')
window.onload = () ->
# Set the option selector to trigger an info grab on element change
document.getElementById('diskSelector').addEventListener('change', () ->
updateDiskInfo(@value)
)
# Load GPUs into the selector
loadDisks()
# Run the updateGpuInfo function with the default value of 0
updateDiskInfo()
# Start running our function to update the drive's temperature
setDiskTemp()
loadDisks = () ->
si.diskLayout()
.then((data) ->
i = 0
while i < data.length
optionElem = document.createElement('option')
diskName = data[i].name + ' (' + data[i].device + ')'
optionElem.innerText = diskName
optionElem.setAttribute('value', i)
document.getElementById('diskSelector').appendChild(optionElem)
i++
).catch((error) ->
console.error(error)
)
updateDiskInfo = (diskId = 0) ->
si.diskLayout()
.then((data) ->
document.getElementById('diskInfo').innerText = data[diskId].name
document.getElementById('diskPath').innerText = data[diskId].device
document.getElementById('diskType').innerText = data[diskId].type
document.getElementById('diskSize').innerText = formatBytes(data[diskId].size)
document.getElementById('diskVendor').innerText = data[diskId].vendor
).catch((error) ->
console.error(error)
)
setDiskTemp = (diskId = -1) ->
selector = document.getElementById('diskSelector')
if selector.length < 1
return
if (diskId = -1)
diskId = selector.value
si.diskLayout()
.then((data) ->
if (data[diskId].temperature)
document.getElementById('diskTemp').innerText = data[diskId].temperature
).catch((error) ->
console.error(error)
)
setTimeout(setDiskTemp, 2000)

View File

@ -15,7 +15,7 @@
<section class="row"> <section class="row">
<article class="columns eight"> <article class="columns eight">
<h5>CPU Model: <span id="cpuInfo">Random CPU</span></h5> <h5>CPU Model: <span id="cpuInfo">Random CPU</span></h5>
<table class="hardware-info"> <table class="hardware-info u-full-width">
<tbody> <tbody>
<tr> <tr>
<td>Physical cores</td> <td>Physical cores</td>

View File

@ -14,23 +14,25 @@
</header> </header>
<section class="row"> <section class="row">
<h5>GPU Model: <span id="gpuInfo">Random GPU</span></h5> <article class="columns twelve">
<table class="hardware-info"> <h5>GPU Model: <span id="gpuInfo">Random GPU</span></h5>
<tbody> <table class="hardware-info u-full-width">
<tr> <tbody>
<td>GPU vendor</td> <tr>
<td><span id="gpuVendor">N/a</span></td> <td>GPU vendor</td>
</tr> <td><span id="gpuVendor">N/a</span></td>
<tr> </tr>
<td>GPU memory</td> <tr>
<td><span id="gpuVram">N/a</span></td> <td>GPU memory</td>
</tr> <td><span id="gpuVram">N/a</span></td>
<tr> </tr>
<td>Bus</td> <tr>
<td><span id="gpuBus">N/a</span></td> <td>Bus</td>
</tr> <td><span id="gpuBus">N/a</span></td>
</tbody> </tr>
</table> </tbody>
</table>
</article>
</section> </section>
<section class="row"> <section class="row">

View File

@ -32,6 +32,14 @@
<p class="u-text-center">Memory</p> <p class="u-text-center">Memory</p>
</a> </a>
</div> </div>
<!-- Storage devices page link -->
<div class="columns six u-text-center">
<a href="storage.html" class="pageLink">
<i class="fa-solid fa-hard-drive"></i>
<p class="u-text-center">Storage devices</p>
</a>
</div>
</section> </section>
{% endblock %} {% endblock %}

52
assets/twig/storage.twig Normal file
View File

@ -0,0 +1,52 @@
{% extends 'layout.twig' %}
{% block scripts %}
<script src="./js/storage.js" charset="utf-8"></script>
{% endblock %}
{% block content %}
<header class="row">
<div class="columns twelve u-text-center">
<h1>Storage Device Info</h1>
<select id="diskSelector"></select>
</div>
</header>
<section class="row">
<article class="columns twelve">
<h5>Device Model: <span id="diskInfo">Loading...</span></h5>
<table class="hardware-info u-full-width">
<tbody>
<tr>
<td>Disk Path</td>
<td><span id="diskPath">N/a</span></td>
</tr>
<tr>
<td>Device Type</td>
<td><span id="diskType">N/a</span></td>
</tr>
<tr>
<td>Capacity</td>
<td><span id="diskSize">N/a</span></td>
</tr>
<tr>
<td>Vendor</td>
<td><span id="diskVendor">N/a</span></td>
</tr>
<tr>
<td>Current Temperature</td>
<td><span id="diskTemp">N/a</span></td>
</tr>
</tbody>
</table>
</article>
</section>
<section class="row">
<div class="columns twelve">
<a href="index.html">Back</a>
</div>
</section>
{% endblock %}

979
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "sentry", "name": "sentry",
"version": "0.2.2", "version": "0.3.0",
"description": "Desktop app to view system information and sensors", "description": "Desktop app to view system information and sensors",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
@ -33,7 +33,7 @@
"systeminformation": "^5.11.15" "systeminformation": "^5.11.15"
}, },
"build": { "build": {
"appId": "net.bitgoblin.sentry", "appId": "tech.bitgoblin.sentry",
"copyright": "Copyright © 2022 ${author}", "copyright": "Copyright © 2022 ${author}",
"win": { "win": {
"target": "nsis", "target": "nsis",