Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
veniware committed Jun 4, 2024
1 parent db94856 commit 728e654
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 37 deletions.
30 changes: 5 additions & 25 deletions Protest/Front/deviceview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2642,26 +2642,16 @@ class DeviceView extends View {

const snmpInput = document.createElement("select");
snmpInput.style.marginLeft = "0";
snmpInput.style.width = "160px";
snmpInput.style.width = "200px";
snmpInput.style.gridArea = "3 / 3";
snmpInput.disabled = true;
grid.appendChild(snmpInput);

const ver2Option = document.createElement("option");
ver2Option.value = "2";
ver2Option.text = "Version 2";
snmpInput.appendChild(ver2Option);

const ver3Option = document.createElement("option");
ver3Option.value = "3";
ver3Option.text = "Version 3";
snmpInput.appendChild(ver3Option);

snmpInput.value = "3";
//TODO: implement SNMP

const portScanInput = document.createElement("select");
portScanInput.style.marginLeft = "0";
portScanInput.style.width = "160px";
portScanInput.style.width = "200px";
portScanInput.style.gridArea = "5 / 3";
grid.appendChild(portScanInput);

Expand All @@ -2681,21 +2671,11 @@ class DeviceView extends View {
portScanInput.appendChild(extendedOption);

snmpToggle.checkbox.onchange = ()=> {
if (snmpToggle.checkbox.checked) {
snmpInput.disabled = false;
}
else {
snmpInput.disabled = true;
}
snmpInput.disabled = !snmpToggle.checkbox.checked;
};

portScanToggle.checkbox.onchange = ()=> {
if (portScanToggle.checkbox.checked) {
portScanInput.disabled = false;
}
else {
portScanInput.disabled = true;
}
portScanInput.disabled = !portScanToggle.checkbox.checked;
};

dialog.okButton.onclick = async ()=> {
Expand Down
10 changes: 9 additions & 1 deletion Protest/Front/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,15 @@ class List extends Window {
if (!(this.columnsElements[i].textContent in entry)) continue;

const newAttr = document.createElement("div");
newAttr.textContent = entry[this.columnsElements[i].textContent].v;
let value = entry[this.columnsElements[i].textContent].v;
if (value.length > 0) {
newAttr.textContent = value;
}
else {
newAttr.textContent = "empty";
newAttr.style.color = "#666";
newAttr.style.fontStyle = "italic";
}
element.appendChild(newAttr);

if (i === 0) {
Expand Down
4 changes: 3 additions & 1 deletion Protest/Front/passwordgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ class PassGen extends Window {
stampButton.type = "button";
buttonsBox.appendChild(stampButton);

generateButton.style.width = copyButton.style.width = "96px";
copyButton.style.width = "72px";
generateButton.style.width = "96px";
generateButton.style.height = copyButton.style.height = stampButton.style.height = "40px";
generateButton.style.margin = copyButton.style.margin = stampButton.style.margin = "2px";

Expand Down Expand Up @@ -307,6 +308,7 @@ class PassGen extends Window {
this.Strength();
};

this.cmbOptions.onchange();
this.Generate();

this.LoadWords();
Expand Down
2 changes: 1 addition & 1 deletion Protest/Front/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const MENU = {
//{ t:"RS-232", i:"mono/serialconsole.svg?light", g:"utilities", h:true, f:()=>{}, k:"rs 232 serial terminal console" },
{ t:"Encoder", i:"mono/encoder.svg?light", g:"utilities", h:true, f:args=> new Encoder(args), k:"binary hex base64 url html decode" },
{ t:"Network calculator", i:"mono/netcalc.svg?light", g:"utilities", h:true, f:args=> new NetCalc(args), k:"subnet" },
{ t:"Password generator", i:"mono/passgen.svg?light", g:"utilities", h:false, f:args=> new PassGen(args), k:"code" },
{ t:"Password generator", i:"mono/passgen.svg?light", g:"utilities", h:false, f:()=> new PassGen(), k:"code" },
{ t:"Screen capture", i:"mono/screenrecord.svg?light", g:"utilities", h:true, f:args=> new ScreenCapture(), k:"recorder shot" },
{ t:"Camera tester", i:"mono/webcam.svg?light", g:"utilities", h:true, f:args=> new CameraTester(), k:"webcam" },
{ t:"Microphone tester", i:"mono/mic.svg?light", g:"utilities", h:true, f:args=> new MicTester(), k:"audio input" },
Expand Down
13 changes: 4 additions & 9 deletions Protest/Protocols/Snmp.Polling.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
using Lextm.SharpSnmpLib;
using Lextm.SharpSnmpLib.Messaging;
using Lextm.SharpSnmpLib.Security;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection.Metadata;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using Lextm.SharpSnmpLib;
using Lextm.SharpSnmpLib.Messaging;
using Lextm.SharpSnmpLib.Security;

namespace Protest.Protocols.Snmp;

Expand Down

0 comments on commit 728e654

Please sign in to comment.