rework of the server side

main change: the same server may be used for several instruments

- client classes are 'Interactors' dealing with the parameters etc.
- methods from history are added to the clients
+ improvements on the js client side
This commit is contained in:
l_samenv
2025-03-19 08:14:06 +01:00
parent b8ac8f8bb5
commit 958e472f3b
8 changed files with 445 additions and 292 deletions

View File

@ -91,18 +91,21 @@ new Settings()
.treat("hideRightPart", "hr", to_bool, false) //used to completely disable the right part
.treat("wideGraphs", "wg", to_bool, false) //used to toggle the size of the graphs part
.treat("showAsync", "sa", to_bool, false)
.treat("device", "dev", 0, "*")
.treat("server", "srv", 0, "*")
.treat("device", "dev", 0, "")
.treat("server", "srv", 0, "")
.treat("instrument", "instrument", 0, "")
.treat("timerange", "time", 0, "-1800,0")
if (window['instrument']) {
window['clientTags'] = "&instrument=" + window["instrument"];
if (window.instrument) {
window.clientTags = "&instrument=" + window.instrument;
} else {
window['clientTags'] = "&stream=" + window["server"] + "&device=" + window["device"];
let args = '';
if (window.server) { args += "&stream=" + window.server; }
if (window.device) { args += "&device=" + window.device; }
window.clientTags = args;
}
console.log('TAGS', window['clientTags']);
console.log('TAGS', window.clientTags);
function loadFirstBlocks() {
if (debug_main_daniel) {
@ -112,11 +115,19 @@ function loadFirstBlocks() {
if (showMain) pushInitCommand("getblock?path=main&", "main")
if (showConsole) pushInitCommand("console?", "console")
if (nColumns == 1) { // probably mobile phone}
if (showGraphics) pushInitCommand("gettime?time=" + window["timerange"] + "&", "graphics")
if (showGraphics) pushInitCommand("gettime?time=" + window.timerange + "&", "graphics")
if (showOverview) pushInitCommand("getblock?path=_overview&", "overview")
var goFS = document.getElementById('header');
goFS.addEventListener(
'click',
function () {
document.body.requestFullscreen();
},
false,
);
} else {
if (showOverview) pushInitCommand("getblock?path=_overview&", "overview")
if (showGraphics) pushInitCommand("gettime?time=" + window["timerange"] + "&", "graphics")
if (showGraphics) pushInitCommand("gettime?time=" + window.timerange + "&", "graphics")
// last is shown first
}
}
@ -169,7 +180,7 @@ window.onload = function() {
let crossElement = document.getElementById("close-cross");
if(window["hideRightPart"]){
if(window.hideRightPart){
document.body.removeChild(crossElement);
}else{
crossElement.onclick = function(){
@ -193,7 +204,7 @@ window.onload = function() {
elements[2].style.display = "none"; // hide parameters
}
}else{ // else it toggles the graphs window's size and triggers the adjustGrid()
window["wideGraphs"] = !window['wideGraphs'];
window.wideGraphs = ! window.wideGraphs;
adjustGrid();
}
}
@ -207,9 +218,8 @@ window.onload = function() {
// var homeButton = document.getElementById("home-icon");
// TODO : uncomment this code with the right URL to navigate to when the way to select the instrument will be decided.
homeButton.onclick = function () {
window.location = "/select";
window.location = "/select_experiment";
};
buildUpdateConnection();
// if (location.hash) {