Browse Source

auto update script executed

Toby Chui 1 year ago
parent
commit
fbf63a48d9
1 changed files with 37 additions and 3 deletions
  1. 37 3
      web/components/rproot.html

+ 37 - 3
web/components/rproot.html

@@ -1,7 +1,7 @@
 <div class="standardContainer">
     <div class="ui basic segment">
         <h2>Set Proxy Root</h2>
-        <p>For all routing not found in the proxy rules, request will be redirected to the proxy root server.</p>
+        <p>The default routing point for all incoming traffics. For all routing not found in the proxy rules, request will be redirected to the proxy root server.</p>
         <div class="ui form">
             <div class="field">
                 <label>Proxy Root</label>
@@ -10,16 +10,41 @@
             </div>
             <div class="field">
                 <div class="ui checkbox">
-                    <input type="checkbox" id="rootReqTLS" >
+                    <input type="checkbox" id="rootReqTLS">
                     <label>Root require TLS Connection <br><small>(i.e. Your proxy target starts with https://)</small></label>
                 </div>
             </div>
+            <br>
+            <button class="ui basic button" onclick="setProxyRoot()"><i class="teal home icon" ></i> Update Proxy Root</button>
+            <!-- Advance configs -->
+            <div class="ui basic segment" style="background-color: #f7f7f7; border-radius: 1em;">
+                <div id="advanceRootSettings" class="ui fluid accordion">
+                    <div class="title">
+                    <i class="dropdown icon"></i>
+                    Advance Root Routing Settings
+                    </div>
+                    <div class="content">
+                        <h4>Force Root Redirect for Unset Sub-domains</h4>
+                        <p>Enabling this option will force redirect user back to root if the user is requesting a sub-domain that is not registered in this layer of reverse proxy. <br>
+                            (Recommend for top-level reverse proxy setup only)</p>
+                        <div class="field">
+                            <div class="ui checkbox">
+                                <input type="checkbox" id="forceUnsetSubdRedirect">
+                                <label>Enable force redirect</label>
+                            </div>
+                        </div>
+                        <div class="ui divider"></div>
+                    </div>
+                </div>
+            </div>
         </div>
         <br>
-        <button class="ui basic button" onclick="setProxyRoot()"><i class="teal home icon" ></i> Update Proxy Root</button>
+        
     </div>
 </div>
 <script>
+    $("#advanceRootSettings").accordion();
+
     function initRootInfo(){
         $.get("/api/proxy/list?type=root", function(data){
             if (data == null){
@@ -44,6 +69,15 @@
                 }else if (data == "http"){
                     $("#rootReqTLS").parent().checkbox("set unchecked");
                 }
+
+                //Trim off the http or https from the origin
+                if (targetDomain.startsWith("http://")){
+                    targetDomain = targetDomain.substring(7);
+                    $("#proxyRoot").val(targetDomain);
+                }else if (targetDomain.startsWith("https://")){
+                    targetDomain = targetDomain.substring(8);
+                    $("#proxyRoot").val(targetDomain);
+                }
             }
        })
     }