mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
parent
a1a86568d4
commit
6bd1f418e5
|
@ -100,6 +100,8 @@ daemon.on('data', function(data) {
|
|||
let Data = {
|
||||
input_devices: data['INPUT_DEVICES'],
|
||||
output_devices: data['OUTPUT_DEVICES'],
|
||||
python_version: data['PYTHON_VERSION'],
|
||||
hamlib_version: data['HAMLIB_VERSION'],
|
||||
serial_devices: data['SERIAL_DEVICES'],
|
||||
tnc_running_state: data['DAEMON_STATE'][0]['STATUS'],
|
||||
ram_usage: data['RAM'],
|
||||
|
|
|
@ -11,6 +11,7 @@ const {
|
|||
bearingDistance,
|
||||
latLngToLocator
|
||||
} = require('qth-locator');
|
||||
const os = require('os');
|
||||
|
||||
// https://stackoverflow.com/a/26227660
|
||||
var appDataFolder = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : process.env.HOME + "/.config")
|
||||
|
@ -321,10 +322,11 @@ advancedHamlibSettingsModal
|
|||
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
|
||||
collapseFirstRow.hide()
|
||||
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
|
||||
collapseSecondRow.show()
|
||||
collapseSecondRow.hide()
|
||||
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
|
||||
collapseThirdRow.show()
|
||||
|
||||
var collapseFourthRow = new bootstrap.Collapse(document.getElementById('collapseFourthRow'), {toggle: false})
|
||||
collapseFourthRow.show()
|
||||
|
||||
daemon.startTNC(rx_audio, tx_audio, deviceid, deviceport, pttprotocol, pttport, serialspeed, pttspeed, data_bits, stop_bits, handshake)
|
||||
|
||||
|
@ -350,10 +352,17 @@ advancedHamlibSettingsModal
|
|||
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
|
||||
collapseFirstRow.show()
|
||||
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
|
||||
collapseSecondRow.hide()
|
||||
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
|
||||
collapseThirdRow.hide()
|
||||
collapseSecondRow.show()
|
||||
|
||||
|
||||
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
|
||||
collapseThirdRow.hide()
|
||||
var collapseFourthRow = new bootstrap.Collapse(document.getElementById('collapseFourthRow'), {toggle: false})
|
||||
collapseFourthRow.hide()
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
@ -967,6 +976,27 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
|
|||
document.getElementById("progressbar_cpu").setAttribute("style", "width:" + arg.cpu_usage + "%;")
|
||||
document.getElementById("progressbar_cpu_value").innerHTML = arg.cpu_usage + "%"
|
||||
*/
|
||||
document.getElementById("ram_load").innerHTML = "RAM " + arg.ram_usage + "%"
|
||||
document.getElementById("cpu_load").innerHTML = "CPU " + arg.cpu_usage + "%"
|
||||
|
||||
// OPERATING SYSTEM
|
||||
|
||||
document.getElementById("operating_system").innerHTML = "OS " + os.type()
|
||||
|
||||
|
||||
// PYTHON VERSION
|
||||
document.getElementById("python_version").innerHTML = "Python " + arg.python_version
|
||||
document.getElementById("python_version").className = "btn btn-sm btn-success";
|
||||
|
||||
// HAMLIB VERSION
|
||||
document.getElementById("hamlib_version").innerHTML = "Hamlib " + arg.hamlib_version
|
||||
document.getElementById("hamlib_version").className = "btn btn-sm btn-success";
|
||||
|
||||
// NODE VERSION
|
||||
document.getElementById("node_version").innerHTML = "Node " + process.version
|
||||
document.getElementById("node_version").className = "btn btn-sm btn-success";
|
||||
|
||||
|
||||
// UPDATE AUDIO INPUT
|
||||
if (arg.tnc_running_state == "stopped") {
|
||||
if (document.getElementById("audio_input_selectbox").length != arg.input_devices.length) {
|
||||
|
@ -1054,10 +1084,11 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
|
|||
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
|
||||
collapseFirstRow.hide()
|
||||
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
|
||||
collapseSecondRow.show()
|
||||
collapseSecondRow.hide()
|
||||
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
|
||||
collapseThirdRow.show()
|
||||
|
||||
var collapseFourthRow = new bootstrap.Collapse(document.getElementById('collapseFourthRow'), {toggle: false})
|
||||
collapseFourthRow.show()
|
||||
} else {
|
||||
document.getElementById('hamlib_deviceid').disabled = false
|
||||
document.getElementById('hamlib_deviceport').disabled = false
|
||||
|
@ -1081,10 +1112,11 @@ ipcRenderer.on('action-update-daemon-state', (event, arg) => {
|
|||
var collapseFirstRow = new bootstrap.Collapse(document.getElementById('collapseFirstRow'), {toggle: false})
|
||||
collapseFirstRow.show()
|
||||
var collapseSecondRow = new bootstrap.Collapse(document.getElementById('collapseSecondRow'), {toggle: false})
|
||||
collapseSecondRow.hide()
|
||||
collapseSecondRow.show()
|
||||
var collapseThirdRow = new bootstrap.Collapse(document.getElementById('collapseThirdRow'), {toggle: false})
|
||||
collapseThirdRow.hide()
|
||||
|
||||
var collapseFourthRow = new bootstrap.Collapse(document.getElementById('collapseFourthRow'), {toggle: false})
|
||||
collapseFourthRow.hide()
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -621,11 +621,62 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
--></div>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row collapse multi-collapse show mt-2" id="collapseSecondRow">
|
||||
<div class="col">
|
||||
<div class="card text-dark bg-light mb-0">
|
||||
<div class="card-header p-1">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-motherboard" viewBox="0 0 16 16">
|
||||
<path d="M11.5 2a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5Zm2 0a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5Zm-10 8a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1h-6Zm0 2a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1h-6ZM5 3a1 1 0 0 0-1 1h-.5a.5.5 0 0 0 0 1H4v1h-.5a.5.5 0 0 0 0 1H4a1 1 0 0 0 1 1v.5a.5.5 0 0 0 1 0V8h1v.5a.5.5 0 0 0 1 0V8a1 1 0 0 0 1-1h.5a.5.5 0 0 0 0-1H9V5h.5a.5.5 0 0 0 0-1H9a1 1 0 0 0-1-1v-.5a.5.5 0 0 0-1 0V3H6v-.5a.5.5 0 0 0-1 0V3Zm0 1h3v3H5V4Zm6.5 7a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h2a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-2Z"/>
|
||||
<path d="M1 2a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-2H.5a.5.5 0 0 1-.5-.5v-1A.5.5 0 0 1 .5 9H1V8H.5a.5.5 0 0 1-.5-.5v-1A.5.5 0 0 1 .5 6H1V5H.5a.5.5 0 0 1-.5-.5v-2A.5.5 0 0 1 .5 2H1Zm1 11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v11Z"/>
|
||||
</svg>
|
||||
|
||||
|
||||
<strong>SYSTEM STATUS</strong>
|
||||
</div>
|
||||
<div class="card-body p-2 mb-1">
|
||||
<button class="btn btn-secondary btn-sm" id="python_version" type="button" disabled>Python</button>
|
||||
<button class="btn btn-secondary btn-sm" id="node_version" type="button" disabled> Node</button>
|
||||
<button class="btn btn-secondary btn-sm" id="hamlib_version" type="button" disabled>Hamlib</button>
|
||||
<button class="btn btn-secondary btn-sm" id="operating_system" type="button" disabled>OS</button>
|
||||
<button class="btn btn-secondary btn-sm" id="cpu_load" type="button" disabled>CPU</button>
|
||||
<button class="btn btn-secondary btn-sm" id="ram_load" type="button" disabled>RAM</button>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!--<hr class="m-1">-->
|
||||
<div class="container mt-2 p-0">
|
||||
<div class="row collapse multi-collapse" id="collapseSecondRow">
|
||||
<div class="row collapse multi-collapse" id="collapseThirdRow">
|
||||
<div class="col-5">
|
||||
<div class="card text-dark bg-light mb-1">
|
||||
<div class="card-header p-1"><strong>MY STATION</strong>
|
||||
|
@ -717,7 +768,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row collapse multi-collapse" id="collapseThirdRow">
|
||||
<div class="row collapse multi-collapse" id="collapseFourthRow">
|
||||
<div class="col-5">
|
||||
<div class="card text-dark bg-light mb-1">
|
||||
<div class="card-header p-1">
|
||||
|
|
|
@ -214,7 +214,14 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
|||
|
||||
if received_json["type"] == 'GET' and received_json["command"] == 'DAEMON_STATE':
|
||||
|
||||
data = {'COMMAND': 'DAEMON_STATE', 'DAEMON_STATE': [], 'INPUT_DEVICES': [], 'OUTPUT_DEVICES': [], 'SERIAL_DEVICES': [
|
||||
data = {
|
||||
'COMMAND': 'DAEMON_STATE',
|
||||
'DAEMON_STATE': [],
|
||||
'PYTHON_VERSION': str(python_version),
|
||||
'HAMLIB_VERSION': str(hamlib_version),
|
||||
'INPUT_DEVICES': [],
|
||||
'OUTPUT_DEVICES': [],
|
||||
'SERIAL_DEVICES': [
|
||||
], "CPU": str(psutil.cpu_percent()), "RAM": str(psutil.virtual_memory().percent), "VERSION": "0.1-prototype"}
|
||||
|
||||
if static.TNCSTARTED:
|
||||
|
|
|
@ -59,7 +59,6 @@ def noalsaerr():
|
|||
try:
|
||||
# get python version
|
||||
python_version = str(sys.version_info[0]) + "." + str(sys.version_info[1])
|
||||
|
||||
# installation path for Ubuntu 20.04 LTS python modules
|
||||
sys.path.append('/usr/local/lib/python'+ python_version +'/site-packages')
|
||||
# installation path for Ubuntu 20.10 +
|
||||
|
|
Loading…
Reference in a new issue