From 351a47fcea69fe00229ce0fea06f681501867053 Mon Sep 17 00:00:00 2001 From: Andreas Venizelou Date: Mon, 20 May 2024 10:14:34 +0300 Subject: [PATCH] Fix monitor bug --- Protest/Front/deviceview.js | 4 ++-- Protest/Front/monitor.js | 4 ++-- Protest/Front/terminal.js | 4 ++++ Protest/Front/ui.js | 8 ++++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Protest/Front/deviceview.js b/Protest/Front/deviceview.js index 9f98016c..226afe17 100644 --- a/Protest/Front/deviceview.js +++ b/Protest/Front/deviceview.js @@ -511,11 +511,11 @@ class DeviceView extends View { if (overwriteProtocol.ssh) { //ssh const sshButton = this.CreateSideButton("mono/ssh.svg", "Secure shell"); - sshButton.onclick = ()=> UI.PromptAgent(this, "ssh", `${host}:${overwriteProtocol.ssh}`); + sshButton.onclick = ()=> new Ssh({host: `${host}:${overwriteProtocol.ssh}`}); } else if (ports.includes(22)) { const sshButton = this.CreateSideButton("mono/ssh.svg", "Secure shell"); - sshButton.onclick = ()=> UI.PromptAgent(this, "ssh", host); + sshButton.onclick = ()=> new Ssh({host: host}); } if (overwriteProtocol.http) { //http diff --git a/Protest/Front/monitor.js b/Protest/Front/monitor.js index 05e2324e..03a33deb 100644 --- a/Protest/Front/monitor.js +++ b/Protest/Front/monitor.js @@ -1249,7 +1249,7 @@ class Monitor extends Window { unit : unitInput.value, value : valueInput.value.toLocaleLowerCase(), min : 0, - max : parseFloat(maxInput.value.toLocaleLowerCase()), + max : isNaN(maxInput.value) ? maxInput.value.toLocaleLowerCase() : parseFloat(maxInput.value), showPeak: showPeakInput.checked, isComplement: complementingInput.checked, isDynamic: dynamicInput.checked, @@ -1558,7 +1558,7 @@ class Monitor extends Window { for (let j=0; j=0 && valley !== peak) { + if (options.showPeak && peak >= 0 && valley !== peak) { ctx[j].lineWidth = 1; ctx[j].strokeStyle = "#C0C0C080"; ctx[j].setLineDash([2, 2]); diff --git a/Protest/Front/terminal.js b/Protest/Front/terminal.js index 06ed94fd..065d0080 100644 --- a/Protest/Front/terminal.js +++ b/Protest/Front/terminal.js @@ -7,6 +7,10 @@ class Terminal extends Window { this.params = params ? params : {host:"", ansi:true, autoScroll:true, bell:false}; + if (!("ansi" in this.params)) this.params.ansi = true; + if (!("autoScroll" in this.params)) this.params.autoScroll = true; + if (!("bell" in this.params)) this.params.autoScroll = false; + this.AddCssDependencies("terminal.css"); this.cursor = {x:0, y:0}; diff --git a/Protest/Front/ui.js b/Protest/Front/ui.js index a0f62bf1..22028a51 100644 --- a/Protest/Front/ui.js +++ b/Protest/Front/ui.js @@ -299,16 +299,16 @@ const MENU = { { t:"Debit notes", i:"mono/notes.svg?light", g:"documentation", h:false, f:()=> new DebitNotes(), k:"" }, { t:"Team chat", i:"mono/chat.svg?light", g:"documentation", h:false, f:()=> new Chat(), k:"messages" }, - { t:"Issues", i:"mono/issues.svg?light", g:"tools", h:false, f:()=> new Issues() }, + //{ t:"Issues", i:"mono/issues.svg?light", g:"tools", h:false, f:()=> new Issues() }, { t:"Watchdog", i:"mono/watchdog.svg?light", g:"tools", h:false, f:()=> new Watchdog(), k:"" }, { t:"Gandalf", i:"mono/gandalf.svg?light", g:"tools", h:false, f:()=> new Gandalf() }, - { t:"Telnet", i:"mono/telnet.svg?light", g:"tools", h:true, f:()=> new Telnet({host:"", ansi:true, autoScroll:true, bell:false}), k:"terminal" }, - { t:"Secure shell", i:"mono/ssh.svg?light", g:"tools", h:false, f:()=> new Ssh({host:"", ansi:true, autoScroll:true, bell:false}), k:"ssh terminal" }, + { t:"Telnet", i:"mono/telnet.svg?light", g:"tools", h:true, f:()=> new Telnet({host:""}), k:"terminal" }, + { t:"Secure shell", i:"mono/ssh.svg?light", g:"tools", h:false, f:()=> new Ssh({host:""}), k:"ssh terminal" }, { t:"WMI client", i:"mono/wmi.svg?light", g:"tools", h:false, f:params=> new Wmi(params), k:"windows management instrumentation viewer" }, { t:"SNMP polling", i:"mono/snmp.svg?light", g:"tools", h:false, f:params=> new Snmp(params) }, //{ t:"SNMP traps", i:"mono/trap.svg?light", g:"tools", h:false, f:params=> new Snmp(params) }, - { t:"Scripts", i:"mono/scripts.svg?light", g:"tools", h:false, f:params=> {} }, + //{ t:"Scripts", i:"mono/scripts.svg?light", g:"tools", h:false, f:params=> {} }, //{ t:"Script reports", i:"mono/reportfile.svg?light", g:"tools", h:true, f:params=> {} }, //{ t:"Ongoing scripts", i:"mono/ongoingscript.svg?light", g:"tools", h:true, f:params=> {} },