This commit is contained in:
root
2020-03-01 15:05:26 +08:00
parent 0865c98a7f
commit 0897f84a04
59 changed files with 13628 additions and 25877 deletions

114
web/views/index/add.html Executable file → Normal file
View File

@@ -1,128 +1,119 @@
<div class="row tile">
<div class="col-md-12 col-md-auto">
<div class="ibox float-e-margins">
<h3 class="ibox-title">add</h3>
<h3 class="ibox-title" langtag="page-add"></h3>
<div class="ibox-content">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label" langtag="info-mode">类型 </label>
<label class="control-label font-bold" langtag="word-scheme"></label>
<div class="col-sm-10">
<select class="form-control" name="type" id="type">
<option {{if eq "tcp" .type}}selected{{end}} value="tcp">tcp</option>
<option {{if eq "udp" .type}}selected{{end}} value="udp">udp</option>
<option {{if eq "socks5" .type}}selected{{end}} value="socks5">socks5
<option {{if eq "tcp" .type}}selected{{end}} value="tcp" langtag="scheme-tcp"></option>
<option {{if eq "udp" .type}}selected{{end}} value="udp" langtag="scheme-udp"></option>
<option {{if eq "httpProxy" .type}}selected{{end}} value="httpProxy" langtag="scheme-httpProxy"></option>
<option {{if eq "socks5" .type}}selected{{end}} value="socks5" langtag="scheme-socks5">
</option>
<option {{if eq "httpProxy" .type}}selected{{end}} value="httpProxy">http</option>
<option {{if eq "secret" .type}}selected{{end}} value="secret">secret</option>
<option {{if eq "p2p" .type}}selected{{end}} value="p2p">p2p</option>
{{/*<option {{if eq "file" .type}}selected{{end}} value="file">file*/}}
<option {{if eq "secret" .type}}selected{{end}} value="secret" langtag="scheme-secret"></option>
<option {{if eq "p2p" .type}}selected{{end}} value="p2p" langtag="scheme-p2p"></option>
{{/*<option {{if eq "file" .type}}selected{{end}} value="file" langtag="scheme-file"></option>*/}}
</select>
</div>
</div>
<div class="form-group" id="client_id">
<label class="control-label font-bold" langtag="word-clientid"></label>
<div class="col-sm-10">
<input value="{{.client_id}}" class="form-control" type="text" name="client_id" placeholder="" langtag="word-clientid">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" langtag="info-remark">备注</label>
<label class="control-label font-bold" langtag="word-remark"></label>
<div class="col-sm-10">
<input class="form-control" type="text" name="remark"
placeholder="empty means to be unrestricted">
<input class="form-control" type="text" name="remark" placeholder="" langtag="info-unrestricted">
</div>
</div>
{{if eq true .allow_multi_ip}}
<div class="form-group" id="server_ip">
<label class="col-sm-2 control-label" langtag="info-server-ip">服务端ip</label>
<label class="control-label font-bold" langtag="word-serverip"></label>
<div class="col-sm-10">
<input class="form-control" type="text" value="0.0.0.0" name="server_ip"
placeholder="such as 0.0.0.0">
<input class="form-control" type="text" value="0.0.0.0" name="server_ip" placeholder="" langtag="info-suchasip">
</div>
</div>
{{end}}
<div class="form-group" id="port">
<label class="col-sm-2 control-label" langtag="info-server-port">服务端端口</label>
<label class="control-label font-bold" langtag="word-serverport"></label>
<div class="col-sm-10">
<input class="form-control" type="text" name="port" placeholder="such as 8024">
<input class="form-control" type="text" name="port" placeholder="" langtag="info-suchasport">
</div>
</div>
{{if eq true .allow_local_proxy}}
<div class="form-group" id="local_proxy">
<label class="control-label col-sm-2" langtag="info-local-proxy">是否代理为服务端本地</label>
<label class="control-label font-bold" langtag="word-proxytolocal"></label>
<div class="col-sm-10">
<select class="form-control" name="local_proxy">
<option value="0">no</option>
<option value="1">yes</option>
<option value="0" langtag="word-no"></option>
<option value="1" langtag="word-yes"></option>
</select>
</div>
</div>
{{end}}
<div class="form-group" id="target">
<label class="col-sm-2 control-label" langtag="info-target">目标(ip:端口)</label>
<label class="control-label font-bold" langtag="word-target"></label>
<div class="col-sm-10">
<textarea class="form-control" name="target" rows="4" placeholder="10.1.50.203:22
10.1.50.202:22"></textarea>
<span class="help-block m-b-none">can only fill in ports if it is local machine proxy, only tcp supports load balancing
</span>
</div>
</div>
<div class="form-group" id="client_id">
<label class="col-sm-2 control-label" langtag="info-client-id">客户端id</label>
<div class="col-sm-10">
<input value="{{.client_id}}" class="form-control" type="text" name="client_id"
placeholder="id of client">
<textarea class="form-control" name="target" rows="4" placeholder="" langtag="info-suchasiplist"></textarea>
<span class="help-block m-b-none" langtag="info-targettunnel"></span>
</div>
</div>
<div class="form-group" id="local_path">
<label class="col-sm-2 control-label" langtag="info-local-path">本地路径</label>
<label class="control-label font-bold" langtag="word-localpath"></label>
<div class="col-sm-10">
<input class="form-control" type="text" name="local_path"
placeholder="such as /tmp">
<input class="form-control" type="text" name="local_path" placeholder="" langtag="info-suchaslocalpath">
</div>
</div>
<div class="form-group" id="strip_pre">
<label class="col-sm-2 control-label" langtag="info-strip-pre">访问前缀</label>
<label class="control-label font-bold" langtag="word-stripprefix"></label>
<div class="col-sm-10">
<input class="form-control" type="text" name="strip_pre"
placeholder="such as static">
<input class="form-control" type="text" name="strip_pre" placeholder="" langtag="info-suchasstripprefix">
</div>
</div>
<div class="form-group" id="password">
<label class="col-sm-2 control-label" langtag="info-unique-vkey">唯一验证密钥</label>
<label class="control-label font-bold" langtag="word-identificationkey"></label>
<div class="col-sm-10">
<input class="form-control" type="text" name="password"
placeholder="unique identification key">
<span class="help-block m-b-none">when p2p or secret</span>
<input class="form-control" type="text" name="password" placeholder="" langtag="word-identificationkey">
<span class="help-block m-b-none" langtag="info-identificationkey"></span>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-2">
&nbsp;<button class="btn btn-success" type="button" id="add"><i
class="fa fa-fw fa-lg fa-eye"></i>新增
<button class="btn btn-success" type="button" onclick="submitform('add', '{{.web_base_url}}/index/add', $('form').serializeArray())">
<i class="fa fa-fw fa-lg fa-check-circle"></i> <span langtag="word-add"></span>
</button>
</div>
</div>
</form>
</div>
&nbsp;
</div>
</div>
</div>
<script>
var arr = []
arr["all"] = ["type", "port", "compress", "u", "p", "target", "password", "strip_pre", "local_path", "local_proxy"]
arr["tcp"] = ["type", "port", "target", "compress", "u", "p", "local_proxy", "tcp隧道模式提供一条tcp隧道适用于ssh、远程桌面等添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,访问公网服务器的设定端口,则相当于访问内网目标地址的目标端口"]
arr["udp"] = ["type", "port", "target", "compress", "local_proxy", "udp隧道模式提供一条udp隧道适用于dns、内网dns访问等添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后访问公网服务器的设定端口则相当于访问内网目标地址的udp目标端口"]
arr["socks5"] = ["type", "port", "compress", "u", "p", "socks5代理模式内网socks5代理配合proxifer可如同使用vpn一样访问内网设备或资源添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后在外网环境下本机配置socks5代理即访问内网设备或者资源 "]
arr["httpProxy"] = ["type", "port", "compress", "u", "p", " http代理模式内网http代理可访问内网网站添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后在外网环境下本机配置http代理即访问内网站点"]
arr["secret"] = ["type", "target", "compress", "password", "u", "p", " http代理模式内网http代理可访问内网网站添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后在外网环境下本机配置http代理即访问内网站点"]
arr["p2p"] = ["type", "target", "compress", "password", "u", "p", " http代理模式内网http代理可访问内网网站添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后在外网环境下本机配置http代理即访问内网站点"]
arr["file"] = ["type", "strip_pre", "local_path", "port", " http代理模式内网http代理可访问内网网站添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后在外网环境下本机配置http代理即访问内网站点"]
arr["all"] = ["type", "port", "compress", "u", "p", "target", "password", "local_path", "strip_pre", "local_proxy"]
arr["tcp"] = ["type", "port", "target", "u", "p", "compress", "local_proxy"]
arr["udp"] = ["type", "port", "target", "compress", "local_proxy"]
arr["socks5"] = ["type", "port", "compress", "u", "p"]
arr["httpProxy"] = ["type", "port", "compress", "u", "p"]
arr["secret"] = ["type", "target", "compress", "u", "p", "password"]
arr["p2p"] = ["type", "target", "password"]
arr["file"] = ["type", "port", "local_path", "strip_pre"]
arrClientHide = ["compress", "u", "p", "crypt", "mux"]
function resetForm() {
@@ -159,18 +150,5 @@
resetForm()
resetClientCnf()
})
$("#add").on("click", function () {
$.ajax({
type: "POST",
url: "{{.web_base_url}}/index/add",
data: $("form").serializeArray(),
success: function (res) {
alert(res.msg)
if (res.status) {
history.back(-1)
}
}
})
})
})
</script>