|
@@ -107,22 +107,22 @@
|
|
|
<div class="">
|
|
|
<h3><i class="ui exchange icon"></i> New Proxy Endpoint</h3>
|
|
|
<p>You can create a proxy endpoing by subdomain or virtual directories</p>
|
|
|
- <form class="ui form">
|
|
|
+ <div class="ui form">
|
|
|
<div class="field">
|
|
|
<label>Proxy Type</label>
|
|
|
<div class="ui selection dropdown">
|
|
|
- <input type="hidden" name="ptype">
|
|
|
+ <input type="hidden" id="ptype" value="subd">
|
|
|
<i class="dropdown icon"></i>
|
|
|
<div class="default text">Proxy Type</div>
|
|
|
<div class="menu">
|
|
|
- <div class="item" data-value="domain">Sub-domain</div>
|
|
|
+ <div class="item" data-value="subd">Sub-domain</div>
|
|
|
<div class="item" data-value="vdir">Virtual Directory</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="field">
|
|
|
<label>Subdomain Matching Keyword / Virtual Directory Name</label>
|
|
|
- <input type="text" name="first-name" placeholder="First Name">
|
|
|
+ <input type="text" id="rootname" placeholder="s1">
|
|
|
<div class="ui message">
|
|
|
Example of subdomain matching keyword:<br>
|
|
|
<code>s1.arozos.com</code> <br>(Any access starting with s1.arozos.com will be proxy to the IP address below)<br>
|
|
@@ -132,12 +132,17 @@
|
|
|
</div>
|
|
|
<div class="field">
|
|
|
<label>IP Address or Domain Name with port</label>
|
|
|
- <input type="text" name="last-name" placeholder="Last Name">
|
|
|
+ <input type="text" id="proxyDomain">
|
|
|
<small>E.g. 192.168.0.101:8000 or example.com</small>
|
|
|
</div>
|
|
|
-
|
|
|
- <button class="ui teal button" type="submit">Create Proxy Endpoint</button>
|
|
|
- </form>
|
|
|
+ <div class="field">
|
|
|
+ <div class="ui checkbox">
|
|
|
+ <input type="checkbox" id="reqTls">
|
|
|
+ <label>Proxy Target require TLS Connection (Unstable)</label>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <button class="ui teal button" onclick="newProxyEndpoint();">Create Proxy Endpoint</button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -162,6 +167,7 @@
|
|
|
initRPStaste();
|
|
|
$("#status").slideDown('fast');
|
|
|
$(".ui.dropdown").dropdown();
|
|
|
+ $(".ui.checkbox").checkbox();
|
|
|
|
|
|
$("#mainmenu").find(".item").each(function(){
|
|
|
$(this).on("click", function(e){
|
|
@@ -238,8 +244,8 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- initSubdomainProxy();
|
|
|
- function initSubdomainProxy(){
|
|
|
+ listSubd();
|
|
|
+ function listSubd(){
|
|
|
$("#subdList").html(``);
|
|
|
$.get("list?type=subd", function(data){
|
|
|
if (data.error !== undefined){
|
|
@@ -266,7 +272,43 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ //New Proxy Endpoint
|
|
|
+ function newProxyEndpoint(){
|
|
|
+ var type = $("#ptype").val();
|
|
|
+ var rootname = $("#rootname").val();
|
|
|
+ var proxyDomain = $("#proxyDomain").val();
|
|
|
+ var useTLS = $("#reqTls")[0].checked;
|
|
|
+
|
|
|
+ if (rootname.trim() == ""){
|
|
|
+ $("#rootname").parent().addClass("error");
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ $("#rootname").parent().removeClass("error");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (proxyDomain.trim() == ""){
|
|
|
+ $("#proxyDomain").parent().addClass("error");
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ $("#proxyDomain").parent().removeClass("error");
|
|
|
+ }
|
|
|
|
|
|
+ //Create the endpoint by calling add
|
|
|
+ $.ajax({
|
|
|
+ url: "./add",
|
|
|
+ data: {type: type, rootname: rootname, tls: useTLS, ep: proxyDomain},
|
|
|
+ success: function(data){
|
|
|
+ if (data.error != undefined){
|
|
|
+ alert(data.error);
|
|
|
+ }else{
|
|
|
+ //OK
|
|
|
+ listVdirs();
|
|
|
+ listSubd();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
function errmsg(message){
|
|
|
$("#errmsg").html(`<i class="red remove icon"></i> ${message}`);
|