Compare commits

...

9 Commits

Author SHA1 Message Date
d9ae5f8c2b fix deploy 2025-04-12 22:00:12 +02:00
116458feda Merge branch 'main' of https://nas.vincent-bouquet.fr/gitea/Vincent/reap-simulator-vincent 2025-04-12 21:51:38 +02:00
238dec4050 move to src for deploy 2025-04-12 21:50:58 +02:00
Kwimbee
0b8f06099a fix DMX sniff on T1 2025-01-23 17:11:48 +01:00
Kwimbee
ea5680b473 indent fix + typo + dmx sniff fix 2025-01-23 13:26:14 +01:00
Vincent BOUQUET
c7fbc0f50c fix pressure test failing
pressure should not be raising if test fails
2023-12-16 15:48:40 +01:00
Kwimbee
4f427eda4e no return 2023-12-14 11:19:24 +01:00
Kwimbee
b306a982de discovery page now dynamic 2023-12-12 17:33:04 +01:00
Kwimbee
8800fc6c97 fix max wet bar init value 2023-12-12 17:32:51 +01:00
25 changed files with 204 additions and 148 deletions

18
deploy.ps1 Normal file
View File

@@ -0,0 +1,18 @@
# Define variables
$localFolder = "./src/."
$remoteUser = "debian"
$remoteHost = "robe.vincent-bouquet.fr"
$remotePath = "/var/www/html/public/reap"
$port = 22 # Change this if your SSH server uses a different port
# Build the SCP commands
$sshCommand = "ssh -p ${port} ${remoteUser}@${remoteHost} 'mkdir -p `"${remotePath}`" && sudo rm -rf `"${remotePath}/*`"'"
$scpCommand = "scp -r -P ${port} `"${localFolder}`" ${remoteUser}@${remoteHost}:`"${remotePath}`""
# Execute SSH command to clean remote directory
Write-Host "Cleaning remote directory: $remotePath"
Invoke-Expression $sshCommand
# Execute the command
Write-Host "Executing: $scpCommand"
Invoke-Expression $scpCommand

View File

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 314 B

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,11 +1,13 @@
// GLOBAL VARIABLES
var is_pressure_test_ongoing = false;
var rains_value = 0;
var rains_loop_timing = 2000;
$(document).ready(function () {
initSessionStorage();
populateUIFromSessionStorage();
loopRainsSimulator();
loop_rains_simulator();
// Sets the proper fixture name in the header and title
var fixturename = "Robin iForte - Simulated";
@@ -79,7 +81,7 @@ function toggleStandbyMode() {
populateUIFromSessionStorage();
}
function loopRainsSimulator() {
function loop_rains_simulator() {
var rains_tube_age = sessionStorage.getItem("iforte_demo_rains_age");
var rains_lowest = sessionStorage.getItem("iforte_demo_rains_lowest");
@@ -95,17 +97,16 @@ function loopRainsSimulator() {
}
$("#iforte_rains_bar_current").width(rains_value + "%");
$("#iforte_rains_bar_max").width(rains_lowest + "%");
if (rains_value < rains_lowest) {
sessionStorage.setItem("iforte_demo_rains_lowest", rains_value);
$("#iforte_rains_bar_max").width(rains_value + "%");
}
setTimeout(() => {
loopRainsSimulator();
}, 1000);
loop_rains_simulator();
}, rains_loop_timing);
}
function pressureTest() {
@@ -130,14 +131,14 @@ function pressureTest() {
}
function pressure_test_loop(time, temp, pressure) {
var is_test_failing = sessionStorage.getItem("iforte_demo_pressure_test");
if (is_pressure_test_ongoing) {
if (time == 0) {
is_pressure_test_ongoing = false;
$("#pt-l1").html("");
$("#pt-l3").html("");
var is_test_failing = sessionStorage.getItem("iforte_demo_pressure_test");
if (is_test_failing == 1) {
$('#pt-l2').html('FAIL')
$('#pt-l2').addClass('ptf')
@@ -160,7 +161,12 @@ function pressure_test_loop(time, temp, pressure) {
"Remaining Time " +
new Date(time * 1000).toISOString().substring(14, 19)
);
$("#pt-l3").html(temp + " °C / delta " + pressure.toFixed(2) + " hPa");
if (is_test_failing == 1) {
$("#pt-l3").html(temp + " °C / delta 0.00 hPa");
} else {
$("#pt-l3").html(temp + " °C / delta " + pressure.toFixed(2) + " hPa");
}
setTimeout(() => {
temp = temp + 1;

View File

@@ -26,7 +26,7 @@
</div>
</div>
</nav>
<div class="fixed-top text-center device-label" id="pth" onclick="window.location = ('../index.html')"></div>
<div class="fixed-top text-center device-label" id="pth" ></div>
<div class="container-fluid in">
<h1>Discovery</h1>
<div class="row" id="boxes">
@@ -34,7 +34,7 @@
<div class="clearfix">
<div class="float-left pt02">
<input type="checkbox" id="w-ot">
<label for="w-ot" class="pl04"> Move devices with warning to top</label>
<label for="w-ot" class="pl04">Move devices with warning to top</label>
</div>
<button class="btn btn-primary float-right" id="scan">Discover (1)</button>
</div>
@@ -127,19 +127,19 @@
<tbody>
<tr>
<td>iForte</td>
<td>350</td>
<td>Mode 1 (54 channels)</td>
<td>52:53:01:2c:00:0e</td>
<td id="iforte_dmxa_v">1</td>
<td id="iforte_dmxp_v">Mode 1</td>
<td id="iforte_rdmu_v">52:53:01:2c:00:0e</td>
<td><a href="../iforte/index.html">2.247.136.14</a></td>
<td style="display: none;">47</td>
<td style="display: none;">14.0</td>
<td>
<div class="rains sl">
<div style="width:63%"></div>
<div id="iforte_rains_bar_max" style="width:63%"></div>
</div>
</td>
<td style="display: none;">2.3.2023 16:19:02 - OK</td>
<td>active</td>
<td id="iforte_devs_v">active</td>
</tr>
<tr>
<td>Robin T1 Wash</td>

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -55,7 +55,7 @@
<div
class="fixed-top text-center device-label"
id="pth"
onclick="window.location = ('../index.html')"
></div>
<div class="container-fluid in">

View File

@@ -1,39 +1,39 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<link rel="stylesheet" href="../files/bootstrap.min.css">
<link rel="stylesheet" href="../files/layout.css">
<script src="../files/jquery-3.3.1.min.js"></script>
<script src="../files/popper.min.js"></script>
<script src="../files/bootstrap.min.js"></script>
<script src="./base.js"></script>
</head>
<body>
<nav class="navbar fixed-top navbar-expand-md navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="./index.html"><img src="../files/robe_logo_white.svg"></a><button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item"><a class="nav-link" href="./index.html">Status</a></li>
<li class="nav-item"><a class="nav-link" href="./personality.html">Personality</a></li>
<li class="nav-item active"><a class="nav-link" href="./logs.html">Logs</a></li>
<li class="nav-item"><a class="nav-link" href="./sensors.html">RAINS logs</a></li>
<li class="nav-item"><a class="nav-link" href="./discovery.html">Discovery</a></li>
<li class="nav-item"><a class="nav-link" id="scfg">Settings</a></li>
<li class="nav-item"><a class="nav-link" id="idnt"><img class="rdmi" src="../files/identify.svg"></a></li>
</ul>
</div>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<link rel="stylesheet" href="../files/bootstrap.min.css">
<link rel="stylesheet" href="../files/layout.css">
<script src="../files/jquery-3.3.1.min.js"></script>
<script src="../files/popper.min.js"></script>
<script src="../files/bootstrap.min.js"></script>
<script src="./base.js"></script>
</head>
<body>
<nav class="navbar fixed-top navbar-expand-md navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="./index.html"><img src="../files/robe_logo_white.svg"></a><button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item"><a class="nav-link" href="./index.html">Status</a></li>
<li class="nav-item"><a class="nav-link" href="./personality.html">Personality</a></li>
<li class="nav-item active"><a class="nav-link" href="./logs.html">Logs</a></li>
<li class="nav-item"><a class="nav-link" href="./sensors.html">RAINS logs</a></li>
<li class="nav-item"><a class="nav-link" href="./discovery.html">Discovery</a></li>
<li class="nav-item"><a class="nav-link" id="scfg">Settings</a></li>
<li class="nav-item"><a class="nav-link" id="idnt"><img class="rdmi" src="../files/identify.svg"></a></li>
</ul>
</div>
</nav>
<div class="fixed-top text-center device-label" id="pth" onclick="window.location = ('../index.html')"></div>
<div class="container-fluid in">
<h1>Device logs</h1>
<div class="row" id="boxes">
<div class="col-12 box-c">
<h2 id="sta_err"><button class="btn btn-primary btn-pm" type="button" data-toggle="collapse"
data-target="#lfb"><i class="blue"></i></button> Logs filter<a class="cfg"
onclick="cfgm();"><img src="../files/settings.svg"></a></h2>
</div>
</nav>
<div class="fixed-top text-center device-label" id="pth" ></div>
<div class="container-fluid in">
<h1>Device logs</h1>
<div class="row" id="boxes">
<div class="col-12 box-c">
<h2 id="sta_err"><button class="btn btn-primary btn-pm" type="button" data-toggle="collapse"
data-target="#lfb"><i class="blue"></i></button> Logs filter<a class="cfg"
onclick="cfgm();"><img src="../files/settings.svg"></a></h2>
<div class="box collapse clearfix" id="lfb">
<small>Logs filters not functionnal on this simulator.</small>
<br>
@@ -362,7 +362,7 @@
<li class="">37°C</li>
<li class="dn">-32°C</li>
</ul>
<h3>Display orientation</h3>Side Botom
<h3>Display orientation</h3>Side Bottom
</div>
</div>
</div>
@@ -386,7 +386,7 @@
<li class="">34°C</li>
<li class="">33°C</li>
</ul>
<h3>Display orientation</h3>Side Botom
<h3>Display orientation</h3>Side Bottom
</div>
</div>
</div>
@@ -407,7 +407,7 @@
<li class="">21°C</li>
<li class="dn">-32°C</li>
</ul>
<h3>Display orientation</h3>Side Botom
<h3>Display orientation</h3>Side Bottom
</div>
</div>
</div>
@@ -459,83 +459,99 @@
</div>
</div>
<script>
var is_sniffing = false;
// CREATES MODAL FOR LOG TOOLS
function cfgm() {
$('#m-t').html('Logs tools');
$('#m-f').empty();
$('.sb').unbind();
var tl = c_btn('Download log file', 0, ' dlog');
tl += c_btn('Start DMX sniff', 0, ' ddmx');
$('#m-b').html(tl);
$('#cfg-modal').modal();
$('.dlog').bind('click', function () {
close_modal()
});
$('.ddmx').bind('click', function () {
close_modal()
})
function cfgm() {
$('#m-t').html('Logs tools');
$('#m-f').empty();
$('.sb').unbind();
var tl = c_btn('Download log file', 0, ' dlog');
if (!is_sniffing) {
tl += c_btn('Start DMX sniff', 0, ' ddmx');
} else {
tl += c_btn('Stop DMX sniff', 0, ' ddmx');
}
$('#m-b').html(tl);
$('#cfg-modal').modal();
$('.dlog').bind('click', function () {
// download logs
close_modal()
});
$('.ddmx').bind('click', function () {
// start sniff
if (is_sniffing) {
$('.ddmx').html('Start DMX sniff');
is_sniffing = false;
} else {
$('.ddmx').html('Stop DMX sniff');
is_sniffing = true;
}
function lfix(l) {
return l.charAt(0).toUpperCase() + l.slice(1).toLowerCase().replace('ems', 'EMS')
}
function c_chb(id, t, v, ch) {
var html =
'<div class="form-check form-check-inline"><input type="checkbox" class="form-check-input" id="' + id +
'" value="' + v + '"' + ch + '>';
html += '<label class="form-check-label" for="' + id + '">' + t + '</label></div>';
return html
}
function c_tit(id, t, e, c, p) {
var html =
'<h3><button class="btn btn-primary btn-pm" type="button" data-toggle="collapse" data-target="#' + id +
'"><i></i></button>';
html += ' ' + t;
if (p) html += '<div class="fall"><input type="checkbox" id="' + id + '_p"> all must pass</div>';
html += '</h3>';
html += '<div class="collapse' + c + '" id="' + id + '">';
close_modal()
})
}
function lfix(l) {
return l.charAt(0).toUpperCase() + l.slice(1).toLowerCase().replace('ems', 'EMS')
}
function c_chb(id, t, v, ch) {
var html =
'<div class="form-check form-check-inline"><input type="checkbox" class="form-check-input" id="' + id +
'" value="' + v + '"' + ch + '>';
html += '<label class="form-check-label" for="' + id + '">' + t + '</label></div>';
return html
}
function c_tit(id, t, e, c, p) {
var html =
'<h3><button class="btn btn-primary btn-pm" type="button" data-toggle="collapse" data-target="#' + id +
'"><i></i></button>';
html += ' ' + t;
if (p) html += '<div class="fall"><input type="checkbox" id="' + id + '_p"> all must pass</div>';
html += '</h3>';
html += '<div class="collapse' + c + '" id="' + id + '">';
if (e) html += '</div>';
return html
}
function c_ftmp(i, t) {
}
function c_ftmp(i, t) {
var html = '';
html += '<div class="form-row">';
html += '<div class="form-group col-auto"><label class="col-form-label" id="tl' + i + '" for="fts' + i +
html += '<div class="form-group col-auto"><label class="col-form-label" id="tl' + i + '" for="fts' + i +
'">' + t + '</label></div>';
html += '<div class="form-group col-auto"><select class="form-control" id="fts' + i + '">';
html += '<option value="0">-</option><option value="1">&lt;=</option><option value="2">&gt;=</option>';
html += '</select></div>';
html += '<div class="form-group col-auto"><input type="text" class="form-control" size="5" id="ftv' + i +
'"></div>';
html += '<div class="form-group col-auto"><label class="col-form-label" for="ftv' + i +
'">&deg;<span class="tu" t1_tu_v"></span></label></div>';
html += '</div>';
return html
}
function c_dt(n, t, e, c, it) {
var html = '<div class="form-group' + c + '">';
html += '<label for="' + n + '" class="col-form-label">' + t + '</label>';
html += '</div><div class="form-group' + c + '">';
html += '<input type="' + it + '" class="form-control" id="' + n + '" step="1">';
html += e.length > 0 ? '<div class="invalid-feedback">' + e + '</div>' : '';
html += '</div>';
return html
}
function c_sil(id, t, o) {
var html = '<div class="form-group col-auto"><label class="col-form-label" for="' + id + '">' + t +
'</label></div>';
html += '<div class="form-group col-auto"><select class="form-control" id="' + id + '">';
for (i = 0; i < o.length; i++) {
html += '<option value="' + i + '">' + o[i] + '</option>'
}
html += '</select></div>';
return html
}
</script>
</body>
</html>
html += '<div class="form-group col-auto"><select class="form-control" id="fts' + i + '">';
html += '<option value="0">-</option><option value="1">&lt;=</option><option value="2">&gt;=</option>';
html += '</select></div>';
html += '<div class="form-group col-auto"><input type="text" class="form-control" size="5" id="ftv' + i +
'"></div>';
html += '<div class="form-group col-auto"><label class="col-form-label" for="ftv' + i +
'">&deg;<span class="tu" t1_tu_v"></span></label></div>';
html += '</div>';
return html
}
function c_dt(n, t, e, c, it) {
var html = '<div class="form-group' + c + '">';
html += '<label for="' + n + '" class="col-form-label">' + t + '</label>';
html += '</div><div class="form-group' + c + '">';
html += '<input type="' + it + '" class="form-control" id="' + n + '" step="1">';
html += e.length > 0 ? '<div class="invalid-feedback">' + e + '</div>' : '';
html += '</div>';
return html
}
function c_sil(id, t, o) {
var html = '<div class="form-group col-auto"><label class="col-form-label" for="' + id + '">' + t +
'</label></div>';
html += '<div class="form-group col-auto"><select class="form-control" id="' + id + '">';
for (i = 0; i < o.length; i++) {
html += '<option value="' + i + '">' + o[i] + '</option>'
}
html += '</select></div>';
return html
}
</script>
</body>
</html>

View File

@@ -55,7 +55,7 @@
<div
class="fixed-top text-center device-label"
id="pth"
onclick="window.location = ('../index.html')"
></div>
<div class="container-fluid in">
<h1>Personality</h1>

View File

@@ -26,7 +26,7 @@
</div>
</div>
</nav>
<div class="fixed-top text-center device-label" id="pth" onclick="window.location = ('../index.html')"></div>
<div class="fixed-top text-center device-label" id="pth" ></div>
<div class="container-fluid in">
<h1>RAINS logs</h1>
<div class="row" id="boxes">

View File

@@ -30,7 +30,7 @@
</div>
</div>
</nav>
<div class="fixed-top text-center device-label" id="pth" onclick="window.location = ('../index.html')"></div>
<div class="fixed-top text-center device-label" id="pth" ></div>
<div class="container in">
<h1>Discovery</h1>
<div class="row" id="boxes">

View File

@@ -23,7 +23,7 @@
</div>
</div>
</nav>
<div class="fixed-top text-center device-label" id="pth" onclick="window.location = ('../index.html')"></div>
<div class="fixed-top text-center device-label" id="pth" ></div>
<div class="container in">
<h1>Device status</h1>
<div class="row" id="boxes">

View File

@@ -30,7 +30,7 @@
</div>
</div>
</nav>
<div class="fixed-top text-center device-label" id="pth" onclick="window.location = ('../index.html')"></div>
<div class="fixed-top text-center device-label" id="pth" ></div>
<div class="container in">
<h1>Device logs</h1>
<div class="row" id="boxes">
@@ -323,22 +323,38 @@
</div>
</div>
<script>
// CREATES MODAL FOR LOG TOOLS
function cfgm() {
$('#m-t').html('Logs tools');
$('#m-f').empty();
$('.sb').unbind();
var tl = c_btn('Download log file', 0, ' dlog');
tl += c_btn('Start DMX sniff', 0, ' ddmx');
$('#m-b').html(tl);
$('#cfg-modal').modal();
$('.dlog').bind('click', function () {
close_modal()
});
$('.ddmx').bind('click', function () {
close_modal()
})
var is_sniffing = false;
// CREATES MODAL FOR LOG TOOLS
function cfgm() {
$('#m-t').html('Logs tools');
$('#m-f').empty();
$('.sb').unbind();
var tl = c_btn('Download log file', 0, ' dlog');
if (!is_sniffing) {
tl += c_btn('Start DMX sniff', 0, ' ddmx');
} else {
tl += c_btn('Stop DMX sniff', 0, ' ddmx');
}
$('#m-b').html(tl);
$('#cfg-modal').modal();
$('.dlog').bind('click', function () {
// download logs
close_modal()
});
$('.ddmx').bind('click', function () {
// start sniff
if (is_sniffing) {
$('.ddmx').html('Start DMX sniff');
is_sniffing = false;
} else {
$('.ddmx').html('Stop DMX sniff');
is_sniffing = true;
}
close_modal()
})
}
function lfix(l) {
return l.charAt(0).toUpperCase() + l.slice(1).toLowerCase().replace('ems', 'EMS')

View File

@@ -31,7 +31,7 @@
</div>
</div>
</nav>
<div class="fixed-top text-center device-label" id="pth" onclick="window.location = ('../index.html')"></div>
<div class="fixed-top text-center device-label" id="pth" ></div>
<div class="container in">
<h1>Personality</h1>
<div class="row" id="boxes">

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB