Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
veniware committed Jul 14, 2024
1 parent 1673254 commit 2d33b18
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 34 deletions.
17 changes: 9 additions & 8 deletions Protest/Front/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,12 @@ class About extends Tabs {
credits.style.textAlign = "left";
credits.style.userSelect = "text";
credits.innerHTML = "Some of Pro-tests tools use external code and make use of the following libraries:<br>";
credits.innerHTML += "<b>-</b> Renci.SshNet <a target='_blank' href='https://nuget.org/packages/SSH.NET'>by Renci</a><br>";
credits.innerHTML += "<b>-</b> Lextm.SharpSnmpLib <a target='_blank' href='https://www.nuget.org/packages/Lextm.SharpSnmpLib'>by Lextm</a><br>";
credits.innerHTML += "<b>-</b> Open Sans typeface <a>by Steve Matteson</a><br>";
credits.innerHTML += "<b>-</b> MAC addresses lookup table <a target='_blank' href='https://regauth.standards.ieee.org/standards-ra-web/pub/view.html'>by ieee</a><br>";
credits.innerHTML += "<b>-</b> IP2Location LITE <a target='_blank' href='https://ip2location.com'>by ip2location.com</a><br>";
credits.innerHTML += "<b>-</b> IP2Proxy LITE <a target='_blank' href='https://ip2location.com'>by ip2location.com</a><br>";
credits.innerHTML += "<b>-</b> Renci.SshNet.SshClient <a target='_blank' href='https://nuget.org/packages/SSH.NET'>by Renci</a><br>";
credits.innerHTML += "<b>-</b> Open Sans typeface <a>by Steve Matteson</a><br>";
center.appendChild(credits);

center.appendChild(document.createElement("br"));
Expand Down Expand Up @@ -328,24 +329,24 @@ class About extends Tabs {
link1.style.display = "block";
link1.style.margin = "8px";
link1.target = "_blank";
link1.href = "https://lite.ip2location.com/database/db5-ip-country-region-city-latitude-longitude";
link1.textContent = "IP2Location - Location list";
link1.href = "https://regauth.standards.ieee.org/standards-ra-web/pub/view.html";
link1.textContent = "IEEE - MAC address block";
resources.append(link1);

const link2 = document.createElement("a");
link2.style.display = "block";
link2.style.margin = "8px";
link2.target = "_blank";
link2.href = "https://lite.ip2location.com/database/px1-ip-country";
link2.textContent = "IP2Location - Proxy list";
link2.href = "https://lite.ip2location.com/database/db5-ip-country-region-city-latitude-longitude";
link2.textContent = "IP2Location - Location list";
resources.append(link2);

const link3 = document.createElement("a");
link3.style.display = "block";
link3.style.margin = "8px";
link3.target = "_blank";
link3.href = "https://regauth.standards.ieee.org/standards-ra-web/pub/view.html";
link3.textContent = "IEEE - MAC address block";
link3.href = "https://lite.ip2location.com/database/px1-ip-country";
link3.textContent = "IP2Location - Proxy list";
resources.append(link3);

resources.append(resourcesText, link1, link2, link3);
Expand Down
2 changes: 1 addition & 1 deletion Protest/Front/mono/reverseproxy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 43 additions & 2 deletions Protest/Front/reverseproxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ class ReverseProxy extends List {
this.SetTitle("Reverse proxy");
this.SetIcon("mono/reverseproxy.svg");

const columns = ["name", "traffic"];
this.ws = null;

const columns = ["name", "status"];
this.SetupColumns(columns);
this.columnsOptions.style.display = "none";

this.SetupToolbar();
this.createButton = this.AddToolbarButton("Create task", "mono/add.svg?light");
this.createButton = this.AddToolbarButton("Create proxy", "mono/add.svg?light");
this.deleteButton = this.AddToolbarButton("Delete", "mono/delete.svg?light");
this.AddToolbarSeparator();
this.startButton = this.AddToolbarButton("Start", "mono/play.svg?light");
Expand All @@ -38,4 +40,43 @@ class ReverseProxy extends List {

}

Connect() {
let server = window.location.href;
server = server.replace("https://", "");
server = server.replace("http://", "");
if (server.indexOf("/") > 0) server = server.substring(0, server.indexOf("/"));

if (this.ws != null) {
try {
this.ws.close();
}
catch (ex) { };
}


this.ws = new WebSocket((KEEP.isSecure ? "wss://" : "ws://") + server + "/ws/ping");

this.ws.onopen = ()=> {

};

this.ws.onclose = ()=> {

};

this.ws.onerror = error=> {

};

}

Close() { //overrides
if (this.ws != null) this.ws.close();
super.Close();
}

EditDialog(entry=null) {

}

}
10 changes: 5 additions & 5 deletions Protest/Front/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ const MENU = {
{ t:"Address book", i:"mono/addressbook.svg?light", g:"documentation", h:false, f:()=> new AddressBook(), k:"phone email" },
{ t:"Team chat", i:"mono/chat.svg?light", g:"documentation", h:false, f:()=> new Chat(), k:"messages" },

{ 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:"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:"Reverse proxy", i:"mono/reverseproxy.svg?light", g:"tools", h:false, f:args=> new ReverseProxy(args), k:"man in the middle" },
//{ t:"Issues", i:"mono/issues.svg?light", g:"tools", h:false, f:()=> new Issues() },
//{ t:"SNMP traps", i:"mono/trap.svg?light", g:"tools", h:false, f:args=> new Snmp(args) },
//{ t:"Scripts", i:"mono/scripts.svg?light", g:"tools", h:false, f:args=> {} },
//{ t:"Script reports", i:"mono/reportfile.svg?light", g:"tools", h:true, f:args=> {} },
//{ t:"Ongoing scripts", i:"mono/ongoingscript.svg?light", g:"tools", h:true, f:args=> {} },
Expand All @@ -321,8 +321,8 @@ const MENU = {
{ t:"DHCP client", i:"mono/dhcp.svg?light", g:"utilities", h:false, f:args=> new DhcpDiscover(args), k:"discover" },
{ t:"NTP client", i:"mono/clock.svg?light", g:"utilities", h:false, f:args=> new NtpClient(args), k:"network time" },
{ t:"Site check", i:"mono/websitecheck.svg?light", g:"utilities", h:false, f:args=> new SiteCheck(args), k:"www website" },
{ t:"Reverse proxt", i:"mono/reverseproxy.svg?light", g:"utilities", h:false, f:args=> new ReverseProxy(args), k:"man in the middle" },
//{ t:"Speed test", i:"mono/speedtest.svg?light", g:"utilities", h:false, f:args=> new SpeedTest(args) },
//{ t:"Speed test", i:"mono/speedtest.svg?light", g:"utilities", h:false, f:args=> new SpeedTest(args) },
//{ t:"SNMP traps", i:"mono/trap.svg?light", g:"utilities", h:false, f:args=> new Snmp(args) },
{ t:"SNMP polling", i:"mono/snmp.svg?light", g:"utilities", h:false, f:args=> new Snmp(args) },
{ t:"WMI client", i:"mono/wmi.svg?light", g:"utilities", h:false, f:args=> new Wmi(args), k:"windows management instrumentation viewer" },
{ t:"Secure shell", i:"mono/ssh.svg?light", g:"utilities", h:false, f:()=> new Ssh({host:""}), k:"ssh terminal" },
Expand Down
32 changes: 14 additions & 18 deletions Protest/Protest.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>

<Product>Pro-test</Product>
<AssemblyName>protest</AssemblyName>
<Company>veniware</Company>
<PublisherName>veniware</PublisherName>
<Authors>andreas venizelou</Authors>
<Copyright>2024 veniware. Released into the public domain.</Copyright>
<Description>A management base for System Admins</Description>
<ApplicationIcon>protest.ico</ApplicationIcon>
<PackageIcon>protest.png</PackageIcon>
<ProjectGuid>{72F5BCA3-7752-45E8-8027-2060EBBDA456}</ProjectGuid>

<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
<verYear>$([System.DateTime]::UtcNow.ToString(yyyy))</verYear>
<verDoty>$([System.DateTime]::UtcNow.DayOfYear)</verDoty>
<VersionPrefix>5.0.$(verYear).$(verDoty)</VersionPrefix>
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
<Version>$(VersionPrefix)</Version>

<ServerGarbageCollection>true</ServerGarbageCollection>
<Nullable>disable</Nullable>
Expand All @@ -25,30 +33,18 @@
<WarningLevel>9999</WarningLevel>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>

<!--<Deterministic>false</Deterministic>-->
<!--<Version>5.0.0</Version>-->
<!--<AssemblyVersion>5.0.*</AssemblyVersion>-->

<verYear>$([System.DateTime]::UtcNow.ToString(yyyy))</verYear>
<verDoty>$([System.DateTime]::UtcNow.DayOfYear)</verDoty>

<VersionPrefix>5.0.$(verYear).$(verDoty)</VersionPrefix>
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
<Version>$(VersionPrefix)</Version>

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

<RunAnalyzersDuringLiveAnalysis>False</RunAnalyzersDuringLiveAnalysis>
<RunAnalyzersDuringBuild>True</RunAnalyzersDuringBuild>

<SelfContained>false</SelfContained>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>

<PublisherName>Pro-test</PublisherName>
<PublishAot>false</PublishAot>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 2d33b18

Please sign in to comment.