Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
Added visual improvements and help. Changed resources to relative path.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgegarciamule committed Jul 25, 2018
1 parent 4dedb70 commit 389f03d
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 25 deletions.
1 change: 0 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="MULE_RUNTIME"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="M2_REPO/commons-net/commons-net/3.5/commons-net-3.5.jar"/>
</classpath>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<mule.version>3.8.4</mule.version>
<mule.version>3.9.1</mule.version>
<mule.tools.version>1.2</mule.tools.version>
</properties>

Expand Down
84 changes: 61 additions & 23 deletions src/main/resources/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@
.content {
margin: 0 auto;
width: 800px;
padding: 10px;
background-repeat: no-repeat;
background-position: 760px 22px;
background-position: 732px 12px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AMJADYhJU0FUwAAClNJREFUaN61mntwVNUdxz/3LsHIM8meDQEVKqiVooUy4ouiUq0K7AmCIx0dpx2xHVo7fWk743RatTrVjqPS1lbr27ZWpjJC2LMgtlVq8V20agedFikKEpLs2U2IPEOS2z/u797sbvaG3QV+M5ndvefcc37fc87v9T1xOBJJW0gq//ta69KPAuLAOOBkYDx4o/0Ozh6gDfgf0A5kodeim/oAM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ubodFo0LQM0CluL/Y0xc6oSREW/uE3BZ4A3giTDZbNkLV4ysSh3n6Hqd9hjE6mX1R8nf8LyyNyDfusHrRCd6j9bU/wcOxBkv5BVVWAAAAABJRU5ErkJggg==);
}
.content h1 {
margin: 30px 0px;
.content .header {
padding-top: 20px;
padding-bottom: 30px;
}
.content .header h1 {
font-weight: bold;
font-size: 2em;
}
input:disabled {
background-color: #ccc;
Expand Down Expand Up @@ -88,35 +92,51 @@
border: none;
border-radius: 2px;
}
.helpBox {
margin-top: 10px;
margin-bottom: 10px;
}
#output {
min-height: 100px;
background-color: lightgray;
background-color: #F2F2F2;
margin-top: 6px;
border: 1px solid gray;
border-radius: 4px;
padding: 4px;
border: 1px solid #00A0DF;
font-family: monospace;
}
#output .command {
color: #00607C;
margin-top: 10px;
margin-bottom: 10px;
}
#output pre.output {
color: #414042;
margin-left: 1%;
width: 96%;
}
#output .output {
color: red;
margin-bottom: 5px;
#output textarea.output {
color: #414042;
margin-left: 1%;
width: 96%;
background-color: #00000000;
border: solid 1px #999;
overflow-x: scroll;
overflow-y: auto;
height: 150px;
}
.warn {
border-color: red;
}
</style>
<title>Network connectivity tools</title>
<script src="/js/jquery.min.js" type="text/javascript"></script>
<script src="/js/toastr.min.js" type="text/javascript"></script>
<link href="/css/toastr.min.css" rel="stylesheet" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/toastr.min.js" type="text/javascript"></script>
<link href="css/toastr.min.css" rel="stylesheet" />
</head>
<body>
<div class="content">
<h1>Network connectivity tools</h1>
<div class="header"><h1>Network connectivity tools</h1></div>
<form id="theForm" action="#">
<div>
<div>
<select name="operation" id="operation">
<option value="ping" selected>Ping</option>
<option value="traceroute">Traceroute</option>
Expand All @@ -125,14 +145,21 @@ <h1>Network connectivity tools</h1>
<option value="curl">curl</option>
</select>
<input name="ip" placeholder="IP Address or Host" type="text" title="IP" id="ip" />
<input name="path" placeholder="Path" type="text" title="PATH" id="path" />
<input name="port" placeholder="Port" type="text" title="PORT" id="port" />
<input name="path" placeholder="Path" type="text" title="PATH" id="path" />
<button type="button" id="check">Run</button>
<button type="button" id="clean">Clean Console</button>
</div>
</div>
</form>
<div id="output">
</div>
<div>
<div class="helpBox" id="pingHelp">Set an IP Address or Hostname and hit Run</div>
<div class="helpBox" id="tracerouteHelp" style="display: none;">Set an IP Address or Hostname and hit Run</div>
<div class="helpBox" id="socketHelp" style="display: none;">Set an IP Address or Hostname, the Port and hit Run</div>
<div class="helpBox" id="dnsHelp" style="display: none;">Set a Hostname and hit Run</div>
<div class="helpBox" id="curlHelp" style="display: none;">Set an IP Address or Hostname, the Path, the Port and hit Run</div>
</div>
<pre id="output">
</pre>
</div>
<script type="text/javascript">
$(document).ready(function() {
Expand All @@ -158,23 +185,30 @@ <h1>Network connectivity tools</h1>
var operation = e.target.value;
var inputs = $("#theForm input").removeClass();
inputs.removeAttr( "disabled" );
var helps = $(".helpBox");
helps.hide();
switch (operation) {
case "ping":
$("#path").attr("disabled", true);
$("#port").attr("disabled", true);
$("#pingHelp").show();
break;
case "traceroute":
$("#path").attr("disabled", true);
$("#port").attr("disabled", true);
$("#tracerouteHelp").show();
break;
case "socket":
$("#path").attr("disabled", true);
$("#socketHelp").show();
break;
case "dns":
$("#path").attr("disabled", true);
$("#port").attr("disabled", true);
$("#dnsHelp").show();
break;
case "curl":
$("#curlHelp").show();
break;
default:

Expand Down Expand Up @@ -213,13 +247,17 @@ <h1>Network connectivity tools</h1>
apiurl += '&path=' + path;
apiurl += '&port=' + port;
}
console.log(operation + " " + ip + " " + path + " " + port);
console.log(operation + " " + ip + " " + port + " " + path );
$.ajax({
url: apiurl
})
.done(function(result) {
$("#output").append('<pre class="command">&gt; ' + operation + ' ' + ip + ' ' + path + ' ' + port + '</pre>');
$("#output").append('<pre class="output">' + result + '</pre>');
$("#output").append('<pre class="command">&gt; ' + operation + ' ' + ip + ' ' + port + ' ' + path + '</pre>');
if (operation === 'curl') {
$("#output").append('<textarea class="output">' + result + '</textarea>');
} else {
$("#output").append('<pre class="output">' + result + '</pre>');
}
})
.fail(function() {
toastr["error"]("Couldn't complete request", "Error during invocation")
Expand Down

1 comment on commit 389f03d

@chriscatuk
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix #1
fix #2

Please sign in to comment.