|
@@ -75,13 +75,13 @@
|
|
|
$("#rootReqTLS").parent().addClass("disabled");
|
|
|
|
|
|
//Check if web server is enabled. If not, ask if the user want to enable it
|
|
|
- if (!$("#webserv_enable").parent().checkbox("is checked")){
|
|
|
+ /*if (!$("#webserv_enable").parent().checkbox("is checked")){
|
|
|
confirmBox("Enable static web server now?", function(choice){
|
|
|
if (choice == true){
|
|
|
$("#webserv_enable").parent().checkbox("set checked");
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
+ }*/
|
|
|
}else{
|
|
|
$("#rootReqTLS").parent().removeClass("disabled");
|
|
|
$("#proxyRoot").parent().removeClass("disabled");
|
|
@@ -89,7 +89,7 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function initRootInfo(){
|
|
|
+ function initRootInfo(callback=undefined){
|
|
|
$.get("/api/proxy/list?type=root", function(data){
|
|
|
if (data == null){
|
|
|
|
|
@@ -97,11 +97,30 @@
|
|
|
$("#proxyRoot").val(data.Domain);
|
|
|
checkRootRequireTLS(data.Domain);
|
|
|
}
|
|
|
+
|
|
|
+ if (callback != undefined){
|
|
|
+ callback();
|
|
|
+ }
|
|
|
});
|
|
|
-
|
|
|
}
|
|
|
- initRootInfo();
|
|
|
-
|
|
|
+ initRootInfo(function(){
|
|
|
+ updateWebServerLinkSettings();
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ function updateWebServerLinkSettings(){
|
|
|
+ let currentProxyRoot = $("#proxyRoot").val().trim();
|
|
|
+ $.get("/api/webserv/status", function(webservStatus){
|
|
|
+ if (currentProxyRoot == "127.0.0.1:" + webservStatus.ListeningPort || currentProxyRoot == "localhost:" + webservStatus.ListeningPort){
|
|
|
+ //The root is pointing to the static web server
|
|
|
+ $("#useStaticWebServer").parent().checkbox("set checked");
|
|
|
+ $(".webservRootDisabled").addClass("disabled");
|
|
|
+ }else{
|
|
|
+ $(".webservRootDisabled").removeClass("disabled");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
function updateRootSettingStates(){
|
|
|
$.get("/api/cert/tls", function(data){
|
|
|
if (data == true){
|
|
@@ -137,7 +156,7 @@
|
|
|
let useRedirect = $("#unsetRedirect")[0].checked;
|
|
|
updateRedirectionDomainSettingInputBox(useRedirect);
|
|
|
});
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
}
|
|
|
checkCustomRedirectForUnsetSubd();
|
|
@@ -189,8 +208,22 @@
|
|
|
msgbox(data.error, false, 5000);
|
|
|
}else{
|
|
|
//OK
|
|
|
- initRootInfo();
|
|
|
- msgbox("Proxy Root Updated")
|
|
|
+ initRootInfo(function(){
|
|
|
+ //Check if WebServ is enabled
|
|
|
+ let currentProxyRoot = $("#proxyRoot").val().trim();
|
|
|
+ $.get("/api/webserv/status", function(webservStatus){
|
|
|
+ if (!webservStatus.Running){
|
|
|
+ //Force enable static web server
|
|
|
+ $("#webserv_enable").parent().checkbox("set checked");
|
|
|
+ }
|
|
|
+
|
|
|
+ setTimeout(function(){
|
|
|
+ updateWebServerLinkSettings();
|
|
|
+ msgbox("Proxy Root Updated");
|
|
|
+ }, 1000);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
});
|