|
@@ -69,7 +69,7 @@
|
|
<Br>
|
|
<Br>
|
|
<button id="startbtn" class="ui teal button" onclick="startService();">Start Service</button>
|
|
<button id="startbtn" class="ui teal button" onclick="startService();">Start Service</button>
|
|
<button id="stopbtn" class="ui red disabled button" onclick="stopService();">Stop Service</button>
|
|
<button id="stopbtn" class="ui red disabled button" onclick="stopService();">Stop Service</button>
|
|
-
|
|
|
|
|
|
+<div id="statusErrmsg" class="ui red message" style="display: none;"></div>
|
|
<script>
|
|
<script>
|
|
//Get the latest server status from proxy server
|
|
//Get the latest server status from proxy server
|
|
function initRPStaste(){
|
|
function initRPStaste(){
|
|
@@ -95,7 +95,7 @@
|
|
function startService(){
|
|
function startService(){
|
|
$.post("/api/proxy/enable", {enable: true}, function(data){
|
|
$.post("/api/proxy/enable", {enable: true}, function(data){
|
|
if (data.error != undefined){
|
|
if (data.error != undefined){
|
|
- errmsg(data.error);
|
|
|
|
|
|
+ statusErrmsg(data.error);
|
|
}
|
|
}
|
|
initRPStaste();
|
|
initRPStaste();
|
|
});
|
|
});
|
|
@@ -104,12 +104,18 @@
|
|
function stopService(){
|
|
function stopService(){
|
|
$.post("/api/proxy/enable", {enable: false}, function(data){
|
|
$.post("/api/proxy/enable", {enable: false}, function(data){
|
|
if (data.error != undefined){
|
|
if (data.error != undefined){
|
|
- errmsg(data.error);
|
|
|
|
|
|
+ statusErrmsg(data.error);
|
|
}
|
|
}
|
|
initRPStaste();
|
|
initRPStaste();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //Show error message
|
|
|
|
+ function statusErrmsg(message){
|
|
|
|
+ $("#statusErrmsg").html(`<i class="red remove icon"></i> ${message}`);
|
|
|
|
+ $("#statusErrmsg").slideDown('fast').delay(5000).slideUp('fast');
|
|
|
|
+ }
|
|
|
|
+
|
|
function handlePortChange(){
|
|
function handlePortChange(){
|
|
var newPortValue = $("#incomingPort").val();
|
|
var newPortValue = $("#incomingPort").val();
|
|
if (isNaN(newPortValue - 1)){
|
|
if (isNaN(newPortValue - 1)){
|
|
@@ -119,7 +125,7 @@
|
|
|
|
|
|
$.post("/api/proxy/setIncoming", {incoming: newPortValue}, function(data){
|
|
$.post("/api/proxy/setIncoming", {incoming: newPortValue}, function(data){
|
|
if (data.error != undefined){
|
|
if (data.error != undefined){
|
|
- errmsg(data.error);
|
|
|
|
|
|
+ statusErrmsg(data.error);
|
|
}
|
|
}
|
|
$("#portUpdateSucc").stop().finish().slideDown("fast").delay(3000).slideUp("fast");
|
|
$("#portUpdateSucc").stop().finish().slideDown("fast").delay(3000).slideUp("fast");
|
|
initRPStaste();
|
|
initRPStaste();
|