Merge branch 'daniel' of https://gitlab.psi.ch/samenv/seweb into daniel

This commit is contained in:
Daniel
2025-03-19 09:51:19 +01:00
13 changed files with 821 additions and 485 deletions

View File

@ -90,6 +90,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("instrument", "instrument", 0, "")
.treat("timerange", "time", 0, "-1800,0")
if (window.instrument) {
window.clientTags = "&instrument=" + window.instrument;
} else {
let args = '';
if (window.server) { args += "&stream=" + window.server; }
if (window.device) { args += "&device=" + window.device; }
window.clientTags = args;
}
console.log('TAGS', window.clientTags);
function loadFirstBlocks() {
if (debug_main_daniel) {
@ -99,11 +114,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=-1800,0&", "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=-1800,0&", "graphics")
if (showGraphics) pushInitCommand("gettime?time=" + window.timerange + "&", "graphics")
// last is shown first
}
}
@ -156,7 +179,7 @@ window.onload = function() {
let crossElement = document.getElementById("close-cross");
if(window["hideRightPart"]){
if(window.hideRightPart){
document.body.removeChild(crossElement);
}else{
crossElement.onclick = function(){
@ -180,7 +203,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();
}
}
@ -194,10 +217,9 @@ 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 = "http://" + location.hostname + ":8800/";
// };
homeButton.onclick = function () {
window.location = "/select_experiment";
};
buildUpdateConnection();
// if (location.hash) {
// console.log("hash in url", location.hash);