4 Commits

Author SHA1 Message Date
338f29272c Version bump to v0.3.1
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2022-10-31 14:39:50 -04:00
d2d6317b4e Added some padding at the bottom of the page so the device statistics don't get covered by the footer
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-10-31 14:38:34 -04:00
ae155b2d7e Made the tabs look better
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-10-29 01:14:08 -04:00
c878447c45 Changed to using a tabbed layout instead of separate pages for everything
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-10-28 01:06:09 -04:00
13 changed files with 100 additions and 77 deletions

View File

@ -1,6 +1,6 @@
si = require('systeminformation')
window.onload = () ->
window.addEventListener('load', () ->
# Grab the static CPU information
si.cpu()
.then((data) ->
@ -9,13 +9,13 @@ window.onload = () ->
document.getElementById('cpuThreads').innerText = data.cores
document.getElementById('cpuClockBase').innerText = data.speed
document.getElementById('cpuClockBoost').innerText = data.speedMax
console.log(data)
).catch((error) ->
console.error(error)
)
# Start the CPU temperature loop
setCpuTemp()
, false)
setCpuTemp = () ->
si.cpuTemperature()

View File

@ -1,6 +1,6 @@
si = require('systeminformation')
window.onload = () ->
window.addEventListener('load', () ->
# Set the option selector to trigger an info grab on element change
document.getElementById('gpuSelector').addEventListener('change', () ->
updateGpuInfo(@value)
@ -11,6 +11,7 @@ window.onload = () ->
# Run the updateGpuInfo function with the default value of 0
updateGpuInfo()
, false)
loadGpus = () ->
si.graphics()
@ -22,7 +23,6 @@ loadGpus = () ->
optionElem.setAttribute('value', i)
document.getElementById('gpuSelector').appendChild(optionElem)
i++
console.log(data)
).catch((error) ->
console.error(error)
)

View File

@ -1,6 +1,6 @@
si = require('systeminformation')
window.onload = () ->
window.addEventListener('load', () ->
# Grab the static CPU information
si.mem()
.then((data) ->
@ -11,6 +11,7 @@ window.onload = () ->
# Start the CPU temperature loop
getMemoryUsage()
, false)
getMemoryUsage = () ->
si.mem()

View File

@ -1,5 +1,16 @@
@loadPage = (pagePath) ->
window.location.href = pagePath + '.html'
@openTab = (tab) ->
# show the component info that's selected
tabs = document.querySelectorAll('.tab-button')
displays = document.querySelectorAll('.component-display')
i = 0
while i < displays.length
if displays[i].getAttribute('data-component') == tab
displays[i].classList.add('active')
tabs[i].classList.add('active')
else
displays[i].classList.remove('active')
tabs[i].classList.remove('active')
i++
@formatBytes = (bytes, decimals = 2) ->
if bytes == 0

View File

@ -1,6 +1,6 @@
si = require('systeminformation')
window.onload = () ->
window.addEventListener('load', () ->
# Set the option selector to trigger an info grab on element change
document.getElementById('diskSelector').addEventListener('change', () ->
updateDiskInfo(@value)
@ -14,6 +14,7 @@ window.onload = () ->
# Start running our function to update the drive's temperature
setDiskTemp()
, false)
loadDisks = () ->
si.diskLayout()

View File

@ -1,4 +1,8 @@
$tab-bar-height: 50px
body
margin: 0
padding: $tab-bar-height 0 90px
background: white
font-size: 18px
@ -33,6 +37,47 @@ button
.container.fluid
max-width: 100%
margin: 0
#wrapper
margin-top: 25px
#tab-bar
position: fixed
top: 0
left: 0
z-index: 10
width: 100%
height: $tab-bar-height
margin: 0
padding: 0
background: #eee
border-bottom: 1px solid #bbb
box-shadow: 0 1px 2px rgba(0, 0, 0, .25)
.row
display: relative
.tab-button
float: left
height: 50px
margin: 0
background-color: #eee
border: none
border-right: 1px solid #999
border-radius: 0
color: #212121
font-size: 2rem
font-weight: bold
transition: all 230ms ease-in-out
&.active
background-color: white
.component-display
display: none
&.active
display: block
.pageLink
text-decoration: none
@ -87,6 +132,7 @@ table.hardware-info
bottom: 0
padding-top: 25px
padding-bottom: 25px
background: white
border-top: 1px solid #999
font-size: 16px

View File

@ -1,11 +1,3 @@
{% extends 'layout.twig' %}
{% block scripts %}
<script src="./js/cpu.js" charset="utf-8"></script>
{% endblock %}
{% block content %}
<header class="row">
<div class="columns twelve u-text-center">
<h1>Sentry CPU Info</h1>
@ -44,11 +36,3 @@
</div>
</article>
</section>
<section class="row">
<div class="columns twelve">
<a href="index.html">Back</a>
</div>
</section>
{% endblock %}

View File

@ -1,11 +1,3 @@
{% extends 'layout.twig' %}
{% block scripts %}
<script src="./js/gpu.js" charset="utf-8"></script>
{% endblock %}
{% block content %}
<header class="row">
<div class="columns twelve u-text-center">
<h1>GPU Info</h1>
@ -34,11 +26,3 @@
</table>
</article>
</section>
<section class="row">
<div class="columns twelve">
<a href="index.html">Back</a>
</div>
</section>
{% endblock %}

View File

@ -8,11 +8,39 @@
<link rel="stylesheet" href="./styles/sentry.css">
<title>Sentry System Monitor</title>
<script src="./js/sentry.js" charset="utf-8"></script>
{% block scripts %}{% endblock %}
<script src="./js/cpu.js"></script>
<script src="./js/memory.js"></script>
<script src="./js/storage.js"></script>
<script src="./js/gpu.js"></script>
</head>
<body>
<div class="container">
{% block content %}{% endblock %}
<!-- tab buttons -->
<div id="tab-bar">
<div class="container fluid">
<div class="row">
<div class="columns twelve">
<button class="tab-button active" onclick="openTab('cpu')">CPU</button>
<button class="tab-button" onclick="openTab('memory')">Memory</button>
<button class="tab-button" onclick="openTab('storage')">Storage</button>
<button class="tab-button" onclick="openTab('gpu')">GPU</button>
</div>
</div>
</div>
</div>
<div id="wrapper" class="container">
<div class="component-display active" data-component="cpu">
{% include 'cpu.twig' %}
</div>
<div class="component-display" data-component="memory">
{% include 'memory.twig' %}
</div>
<div class="component-display" data-component="storage">
{% include 'storage.twig' %}
</div>
<div class="component-display" data-component="gpu">
{% include 'gpu.twig' %}
</div>
</div>
<footer id="footer">

View File

@ -1,11 +1,3 @@
{% extends 'layout.twig' %}
{% block scripts %}
<script src="./js/memory.js" charset="utf-8"></script>
{% endblock %}
{% block content %}
<header class="row">
<div class="columns twelve u-text-center">
<h1>Memory Info</h1>
@ -16,11 +8,3 @@
<p><span id="memoryFree">N/a</span> free out of <span id="memoryTotal">N/a</span>.</p>
<p><span id="memoryActive">N/a</span> is actively used | <span id="memoryBuffCache">N/a</span> is used in buffers/cache.</p>
</section>
<section class="row">
<div class="columns twelve">
<a href="index.html">Back</a>
</div>
</section>
{% endblock %}

View File

@ -1,11 +1,3 @@
{% 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>
@ -42,11 +34,3 @@
</table>
</article>
</section>
<section class="row">
<div class="columns twelve">
<a href="index.html">Back</a>
</div>
</section>
{% endblock %}

View File

@ -6,7 +6,7 @@ function createWindow () {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
height: 700,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,

View File

@ -1,6 +1,6 @@
{
"name": "sentry",
"version": "0.3.0",
"version": "0.3.1",
"description": "Desktop app to view system information and sensors",
"main": "main.js",
"scripts": {