12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <h3><i class="ui home icon"></i> Set Proxy Root</h3>
- <p>For all routing not found in the proxy rule, will be redirected to the proxy root server.</p>
- <div class="ui form">
- <div class="field">
- <label>Proxy Root</label>
- <input type="text" id="proxyRoot">
- <small>E.g. localhost:8080</small>
- </div>
- <div class="field">
- <div class="ui checkbox">
- <input type="checkbox" id="rootReqTLS">
- <label>Root require TLS Connection <br><small>(i.e. Your proxy target starts with https://)</small></label>
- </div>
- </div>
- </div>
- <br>
- <button class="ui teal button" onclick="setProxyRoot()"><i class="home icon" ></i> Set Proxy Root</button>
- <div class="ui green message" id="ProxyRootUpdate" style="display:none">
- <i class="ui checkmark icon"></i> Proxy Root Updated
- </div>
- <script>
- function initRootInfo(){
- $.get("/api/proxy/list?type=root", function(data){
- if (data == null){
- }else{
- $("#proxyRoot").val(data.Domain);
- }
- });
- }
- initRootInfo();
- function setProxyRoot(){
- var newpr = $("#proxyRoot").val();
- if (newpr.trim() == ""){
- $("#proxyRoot").parent().addClass('error');
- return
- }else{
- $("#proxyRoot").parent().removeClass('error');
- }
- var rootReqTls = $("#rootReqTLS")[0].checked;
- //Create the endpoint by calling add
- $.ajax({
- url: "/api/proxy/add",
- data: {"type": "root", tls: rootReqTls, ep: newpr},
- success: function(data){
- if (data.error != undefined){
- alert(data.error);
- }else{
- //OK
- initRootInfo();
- $("#ProxyRootUpdate").stop().slideDown('fast').delay(3000).slideUp('fast');
- }
- }
- });
- }
- </script>
|