Skip to content

Commit

Permalink
Toolbar drop-down uiux
Browse files Browse the repository at this point in the history
  • Loading branch information
veniware committed May 17, 2024
1 parent 0db0295 commit 5a37ab8
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Protest/Front/deviceslist.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DevicesList extends List {
this.utilitiesDropDown = this.AddToolbarDropdown("mono/hammer.svg?light");
this.sentChatButton = this.AddSendToChatButton();

this.utilitiesDropDown.menu.style.height = "134px";
this.utilitiesDropDown.menu.style.height = "168px";

const optionPing = document.createElement("div");
optionPing.style.backgroundImage = "url(mono/ping.svg)";
Expand Down
29 changes: 28 additions & 1 deletion Protest/Front/deviceview.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class DeviceView extends View {
this.utilitiesDropDown = this.AddToolbarDropdown("mono/hammer.svg?light");
this.bar.insertBefore(this.utilitiesDropDown.button, this.sendChatButton);

this.utilitiesDropDown.menu.style.height = "134px";
this.utilitiesDropDown.menu.style.height = "200px";

const optionPing = document.createElement("div");
optionPing.style.backgroundImage = "url(mono/ping.svg)";
Expand All @@ -119,6 +119,11 @@ class DeviceView extends View {
optionTraceRoute.textContent = "Trace Router";
this.utilitiesDropDown.list.append(optionTraceRoute);

const optionPortScan = document.createElement("div");
optionPortScan.style.backgroundImage = "url(mono/portscan.svg)";
optionPortScan.textContent = "Port scan";
this.utilitiesDropDown.list.append(optionPortScan);

const optionLocateIp = document.createElement("div");
optionLocateIp.style.backgroundImage = "url(mono/locate.svg)";
optionLocateIp.textContent = "Locate IP";
Expand Down Expand Up @@ -194,6 +199,28 @@ class DeviceView extends View {
new TraceRoute().Filter(target);
};

optionPortScan.onclick=()=> {
let target;
if ("ip" in this.link) {
target = this.link.ip.v;
}
else if ("hostname" in this.link) {
target = this.link.hostname.v;
}
else {
this.ConfirmBox("No IP or Hostname", true);
}

for (let i=0; i<WIN.array.length; i++) {
if (!(WIN.array[i] instanceof PortScan)) continue;
WIN.array[i].Filter(target);
WIN.array[i].BringToFront();
return;
}

new PortScan().Filter(target);
};

optionLocateIp.onclick=()=> {
let target;
if ("ip" in this.link) {
Expand Down
2 changes: 2 additions & 0 deletions Protest/Front/dnslookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ class DnsLookup extends Console {
label.style.fontFamily = "monospace";
label.style.fontWeight = "600";
label.style.marginRight = "4px";
label.style.height = "22px";
label.style.lineHeight = "22px";
label.style.padding = "1px 4px";
label.style.borderRadius = "4px";

Expand Down
6 changes: 6 additions & 0 deletions Protest/Front/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,22 @@ class Ping extends Console {

const optionRemoveAll = document.createElement("div");
optionRemoveAll.style.padding = "4px 8px";
optionRemoveAll.style.height = "24px";
optionRemoveAll.style.lineHeight = "24px";
optionRemoveAll.textContent = "Clear";
this.clearDropDown.list.append(optionRemoveAll);

const optionRemoveReachable = document.createElement("div");
optionRemoveReachable.style.padding = "4px 8px";
optionRemoveReachable.style.height = "24px";
optionRemoveReachable.style.lineHeight = "24px";
optionRemoveReachable.textContent = "Remove reachable";
this.clearDropDown.list.append(optionRemoveReachable);

const optionRemoveUnreachable = document.createElement("div");
optionRemoveUnreachable.style.padding = "4px 8px";
optionRemoveUnreachable.style.height = "24px";
optionRemoveUnreachable.style.lineHeight = "24px";
optionRemoveUnreachable.textContent = "Remove unreachable";
this.clearDropDown.list.append(optionRemoveUnreachable);

Expand Down
11 changes: 5 additions & 6 deletions Protest/Front/window.css
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@
border-radius: 2px;
padding: 2px;
margin: 2px;
height: 22px;
line-height: 22px;
height: 28px;
line-height: 28px;
text-transform: capitalize;
padding-left: 28px;
background-size: 22px 22px;
background-size: 24px 24px;
background-position: 2px center;
background-repeat: no-repeat;
white-space: nowrap;
Expand All @@ -226,11 +226,10 @@
}

.win-toolbar>.win-toolbar-button>.win-toolbar-submenu>div>div:hover {
background-color: var(--clr-highlight);
background-color: var(--clr-select);
}

.win-toolbar>.win-toolbar-button>.win-toolbar-submenu>div>div:active {
background-color: var(--clr-select);
background-color: var(--clr-accent);
}

.win-toolbar>.win-toolbar-button>input[type="text"] {
Expand Down

0 comments on commit 5a37ab8

Please sign in to comment.