Skip to content

Commit

Permalink
Fix monitor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
veniware committed May 20, 2024
1 parent daf3d76 commit 351a47f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Protest/Front/deviceview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Protest/Front/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1558,7 +1558,7 @@ class Monitor extends Window {
for (let j=0; j<ctx.length; j++) {
ctx[j].clearRect(0, 0, canvases[j].width, height);

if (options.showPeak && peak >=0 && valley !== peak) {
if (options.showPeak && peak >= 0 && valley !== peak) {
ctx[j].lineWidth = 1;
ctx[j].strokeStyle = "#C0C0C080";
ctx[j].setLineDash([2, 2]);
Expand Down
4 changes: 4 additions & 0 deletions Protest/Front/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
8 changes: 4 additions & 4 deletions Protest/Front/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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=> {} },

Expand Down

0 comments on commit 351a47f

Please sign in to comment.