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

Commit 389f03d

Browse files
Added visual improvements and help. Changed resources to relative path.
1 parent 4dedb70 commit 389f03d

File tree

3 files changed

+62
-25
lines changed

3 files changed

+62
-25
lines changed

.classpath

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88
<classpathentry kind="output" path="target/classes"/>
99
<classpathentry kind="con" path="MULE_RUNTIME"/>
1010
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
11-
<classpathentry kind="var" path="M2_REPO/commons-net/commons-net/3.5/commons-net-3.5.jar"/>
1211
</classpath>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1313
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1414

15-
<mule.version>3.8.4</mule.version>
15+
<mule.version>3.9.1</mule.version>
1616
<mule.tools.version>1.2</mule.tools.version>
1717
</properties>
1818

src/main/resources/web/index.html

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,17 @@
5454
.content {
5555
margin: 0 auto;
5656
width: 800px;
57-
padding: 10px;
5857
background-repeat: no-repeat;
59-
background-position: 760px 22px;
58+
background-position: 732px 12px;
6059
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AMJADYhJU0FUwAAClNJREFUaN61mntwVNUdxz/3LsHIM8meDQEVKqiVooUy4ouiUq0K7AmCIx0dpx2xHVo7fWk743RatTrVjqPS1lbr27ZWpjJC2LMgtlVq8V20agedFikKEpLs2U2IPEOS2z/u797sbvaG3QV+M5ndvefcc37fc87v9T1xOBJJW0gq//ta69KPAuLAOOBkYDx4o/0Ozh6gDfg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L5yDZULZqTtWGubodFo0LQM0CluL/Y0xc6oSREW/uE3BZ4A3giTDZbNkLV4ysSh3n6Hqd9hjE6mX1R8nf8LyyNyDfusHrRCd6j9bU/wcOxBkv5BVVWAAAAABJRU5ErkJggg==);
6160
}
62-
.content h1 {
63-
margin: 30px 0px;
61+
.content .header {
62+
padding-top: 20px;
63+
padding-bottom: 30px;
64+
}
65+
.content .header h1 {
66+
font-weight: bold;
67+
font-size: 2em;
6468
}
6569
input:disabled {
6670
background-color: #ccc;
@@ -88,35 +92,51 @@
8892
border: none;
8993
border-radius: 2px;
9094
}
95+
.helpBox {
96+
margin-top: 10px;
97+
margin-bottom: 10px;
98+
}
9199
#output {
92100
min-height: 100px;
93-
background-color: lightgray;
101+
background-color: #F2F2F2;
94102
margin-top: 6px;
95-
border: 1px solid gray;
96-
border-radius: 4px;
97-
padding: 4px;
103+
border: 1px solid #00A0DF;
98104
font-family: monospace;
99105
}
100106
#output .command {
107+
color: #00607C;
108+
margin-top: 10px;
109+
margin-bottom: 10px;
110+
}
111+
#output pre.output {
112+
color: #414042;
113+
margin-left: 1%;
114+
width: 96%;
101115
}
102-
#output .output {
103-
color: red;
104-
margin-bottom: 5px;
116+
#output textarea.output {
117+
color: #414042;
118+
margin-left: 1%;
119+
width: 96%;
120+
background-color: #00000000;
121+
border: solid 1px #999;
122+
overflow-x: scroll;
123+
overflow-y: auto;
124+
height: 150px;
105125
}
106126
.warn {
107127
border-color: red;
108128
}
109129
</style>
110130
<title>Network connectivity tools</title>
111-
<script src="/js/jquery.min.js" type="text/javascript"></script>
112-
<script src="/js/toastr.min.js" type="text/javascript"></script>
113-
<link href="/css/toastr.min.css" rel="stylesheet" />
131+
<script src="js/jquery.min.js" type="text/javascript"></script>
132+
<script src="js/toastr.min.js" type="text/javascript"></script>
133+
<link href="css/toastr.min.css" rel="stylesheet" />
114134
</head>
115135
<body>
116136
<div class="content">
117-
<h1>Network connectivity tools</h1>
137+
<div class="header"><h1>Network connectivity tools</h1></div>
118138
<form id="theForm" action="#">
119-
<div>
139+
<div>
120140
<select name="operation" id="operation">
121141
<option value="ping" selected>Ping</option>
122142
<option value="traceroute">Traceroute</option>
@@ -125,14 +145,21 @@ <h1>Network connectivity tools</h1>
125145
<option value="curl">curl</option>
126146
</select>
127147
<input name="ip" placeholder="IP Address or Host" type="text" title="IP" id="ip" />
128-
<input name="path" placeholder="Path" type="text" title="PATH" id="path" />
129148
<input name="port" placeholder="Port" type="text" title="PORT" id="port" />
149+
<input name="path" placeholder="Path" type="text" title="PATH" id="path" />
130150
<button type="button" id="check">Run</button>
131151
<button type="button" id="clean">Clean Console</button>
132-
</div>
152+
</div>
133153
</form>
134-
<div id="output">
135-
</div>
154+
<div>
155+
<div class="helpBox" id="pingHelp">Set an IP Address or Hostname and hit Run</div>
156+
<div class="helpBox" id="tracerouteHelp" style="display: none;">Set an IP Address or Hostname and hit Run</div>
157+
<div class="helpBox" id="socketHelp" style="display: none;">Set an IP Address or Hostname, the Port and hit Run</div>
158+
<div class="helpBox" id="dnsHelp" style="display: none;">Set a Hostname and hit Run</div>
159+
<div class="helpBox" id="curlHelp" style="display: none;">Set an IP Address or Hostname, the Path, the Port and hit Run</div>
160+
</div>
161+
<pre id="output">
162+
</pre>
136163
</div>
137164
<script type="text/javascript">
138165
$(document).ready(function() {
@@ -158,23 +185,30 @@ <h1>Network connectivity tools</h1>
158185
var operation = e.target.value;
159186
var inputs = $("#theForm input").removeClass();
160187
inputs.removeAttr( "disabled" );
188+
var helps = $(".helpBox");
189+
helps.hide();
161190
switch (operation) {
162191
case "ping":
163192
$("#path").attr("disabled", true);
164193
$("#port").attr("disabled", true);
194+
$("#pingHelp").show();
165195
break;
166196
case "traceroute":
167197
$("#path").attr("disabled", true);
168198
$("#port").attr("disabled", true);
199+
$("#tracerouteHelp").show();
169200
break;
170201
case "socket":
171202
$("#path").attr("disabled", true);
203+
$("#socketHelp").show();
172204
break;
173205
case "dns":
174206
$("#path").attr("disabled", true);
175207
$("#port").attr("disabled", true);
208+
$("#dnsHelp").show();
176209
break;
177210
case "curl":
211+
$("#curlHelp").show();
178212
break;
179213
default:
180214

@@ -213,13 +247,17 @@ <h1>Network connectivity tools</h1>
213247
apiurl += '&path=' + path;
214248
apiurl += '&port=' + port;
215249
}
216-
console.log(operation + " " + ip + " " + path + " " + port);
250+
console.log(operation + " " + ip + " " + port + " " + path );
217251
$.ajax({
218252
url: apiurl
219253
})
220254
.done(function(result) {
221-
$("#output").append('<pre class="command">&gt; ' + operation + ' ' + ip + ' ' + path + ' ' + port + '</pre>');
222-
$("#output").append('<pre class="output">' + result + '</pre>');
255+
$("#output").append('<pre class="command">&gt; ' + operation + ' ' + ip + ' ' + port + ' ' + path + '</pre>');
256+
if (operation === 'curl') {
257+
$("#output").append('<textarea class="output">' + result + '</textarea>');
258+
} else {
259+
$("#output").append('<pre class="output">' + result + '</pre>');
260+
}
223261
})
224262
.fail(function() {
225263
toastr["error"]("Couldn't complete request", "Error during invocation")

0 commit comments

Comments
 (0)