This commit is contained in:
arraykeys
2019-08-08 17:13:34 +08:00
parent e8e5966a8c
commit f0bf2d5fec
2885 changed files with 1195993 additions and 12 deletions
+35
View File
@@ -0,0 +1,35 @@
<div class="panel panel-default">
<div class="panel-heading">
<h4><span class="label label-danger">第二步:</span> 请选择节点</h4>
</div>
<div class="panel-body">
{{$clusterId := .clusterId}}
<div class="alert alert-info" role="alert">
<strong><span class="glyphicon glyphicon-volume-up"></span> 注意!</strong> 普通用户只能选择普通节点,VIP 可选择VIP节点。<i class="ace-icon fa fa-hand-o-right blue"></i> <a href="">如何成为VIP?</a>
</div>
<form class="form-horizontal" action="/tunnel/add" method="post">
<input type="hidden" name="mode" value="{{.mode}}" />
{{range $name, $regionCluster := .regionClusters}}
<h4><span class="label label-default">{{$name}}</span></h4>
{{range $regionKey, $regions := $regionCluster}}
<ul class="list-group w240 inline-group">
<li class="list-group-item"><strong>{{$regions.name}}</strong> <span class="pull-right"><span class="badge"></span></span></li>
{{range $clusterKey, $cluster := $regions.clusters}}
<li class="list-group-item cluster_{{$cluster.cluster_id}}">{{$cluster.name}}
<span class="pull-right">
<input name="cluster_id" type="radio" value="{{$cluster.cluster_id}}" {{if eq $clusterId $cluster.cluster_id}} checked {{end}}/>
</span>
</li>
{{end}}
</ul>
{{end}}
{{end}}
<div class="form-group center">
<div class="col-md-12" style="margin-left:10px;">
<a type="button" href="javascript:history.back(-1)" class="btn btn-default"><span class="glyphicon glyphicon-arrow-left"></span>上一步</a>
<button type="submit" class="btn btn-primary">下一步 <span class="glyphicon glyphicon-arrow-right"></span></button>
</div>
</div>
</form>
</div>
</div>
+88
View File
@@ -0,0 +1,88 @@
<div class="panel panel-default">
<div class="panel-heading">
<h4><span class="label label-danger">第三步:</span> 请填写隧道信息 </h4>
</div>
<div class="panel-body">
<form class="form-horizontal" method="post" action="/tunnel/save">
<input type="hidden" name="mode" value="{{.mode}}">
<input type="hidden" name="cluster_id" value="{{.clusterId}}">
<div class="form-group">
<label class="col-sm-4 control-label"><span class="text-danger"> * </span>隧道名称</label>
<div class="col-sm-4">
<input type="text" name="name" class="form-control" value="" placeholder="请输入隧道名称">
</div>
</div>
{{if eq .isHaveServer "1"}}
<div class="form-group">
<label class="col-sm-4 control-label"><span class="text-danger"> * </span> 选择Server</label>
<div class="col-sm-4">
<select name="server_id" class="form-control">
{{range $serverValue := .serverValues}}
<option value="{{$serverValue.server_id}}">{{$serverValue.name}}</option>
{{end}}
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"><span class="text-danger"> * </span>Server绑定IP</label>
<div class="col-sm-4">
<input type="text" name="server_listen_ip" class="form-control" value="" placeholder="请输入Server绑定IP">
</div>
</div>
{{else}}
<div class="form-group">
<label class="col-sm-4 control-label"><span class="text-danger"> * </span> Server</label>
<div class="col-sm-4">
<input type="hidden" name="server_id" class="form-control" value="{{.systemServer.cs_id}}" readonly>
<input type="text" class="form-control" value="系统server" readonly>
</div>
</div>
{{end}}
<div class="form-group">
<label class="col-sm-4 control-label"><span class="text-danger"> * </span>Server端口</label>
<div class="col-sm-4">
<input type="text" name="server_listen_port" class="form-control" value="" placeholder="请输入Server端口">
</div>
</div>
{{if eq .isHaveClient "1"}}
<div class="form-group">
<label class="col-sm-4 control-label"><span class="text-danger"> * </span> 选择Client</label>
<div class="col-sm-4">
<select name="client_id" class="form-control">
{{range $clientValue := .clientValues}}
<option value="{{$clientValue.client_id}}">{{$clientValue.name}}</option>
{{end}}
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"><span class="text-danger"> * </span>Client绑定IP</label>
<div class="col-sm-4">
<input type="text" name="client_local_host" class="form-control" value="" placeholder="请输入Server绑定IP">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"><span class="text-danger"> * </span>Client监听端口</label>
<div class="col-sm-4">
<input type="text" name="client_local_port" class="form-control" value="" placeholder="请输入Server监听端口">
</div>
</div>
{{else}}
<div class="form-group">
<label class="col-sm-4 control-label"><span class="text-danger"> * </span> Client</label>
<div class="col-sm-4">
<input type="hidden" name="client_id" class="form-control" value="{{.systemClient.cs_id}}" readonly>
<input type="text" class="form-control" value="系统client" readonly>
</div>
</div>
{{end}}
<div class="form-group center">
<div class="col-sm-12">
<a type="button" href="javascript:history.back(-1)" class="btn btn-default"><span class="glyphicon glyphicon-arrow-left"></span>上一步</a>
<button type="button" name="submit" onclick="Form.ajaxSubmit(this.form, false)" class="btn btn-primary">
<span class="glyphicon glyphicon-ok"></span> 保存 </button>
</div>
</div>
</form>
</div>
</div>
+79
View File
@@ -0,0 +1,79 @@
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-md-2">
<a href="/tunnel/mode" class="btn btn-primary">添加隧道</a>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th class="w13p">名称</th>
<th class="w8p">模式</th>
<th class="w8p">Server Ip</th>
<th class="w8p">Server Port</th>
<th class="w8p">Client Ip</th>
<th class="w8p">Client Port</th>
<th class="w8p">状态</th>
<th class="w8p">开启</th>
<th class="w13p">创建时间</th>
<th class="w13p">操作</th>
</tr>
</thead>
<tbody>
{{range $key, $tunnelValue := .tunnelValues}}
<tr>
<td>{{$tunnelValue.name}}</td>
<td>
{{if eq $tunnelValue.mode "0"}}
基础模式
{{else if eq $tunnelValue.mode "1"}}
高级模式
{{else}}
特殊模式
{{end}}
</td>
<td class="center">{{$tunnelValue.server_listen_ip}}</td>
<td class="center">{{$tunnelValue.server_listen_port}}</td>
<td class="center">{{$tunnelValue.client_local_host}}</td>
<td class="center">{{$tunnelValue.client_local_port}}</td>
<td class="center">{{if eq $tunnelValue.status "0"}}
<label class="label label-danger">异常</label>
{{else}}
<label class="label label-success">正常</label>
{{end}}
</td>
<td class="center">{{if eq $tunnelValue.is_open "0"}}
<label class="label label-danger">未开启</label>
{{else}}
<label class="label label-success">已开启</label>
{{end}}
</td>
<td class="center">{{dateFormat $tunnelValue.create_time "Y-m-d H:i:s"}}</td>
<td class="center">
{{if eq $tunnelValue.is_open "0"}}
<a onclick="Common.confirm('确定要开启隧道吗?', '/tunnel/open?tunnel_id={{$tunnelValue.tunnel_id}}')" class="glyphicon glyphicon-ok-circle">开启</a>
{{else}}
<a onclick="Common.confirm('确定要关闭隧道吗?', '/tunnel/close?tunnel_id={{$tunnelValue.tunnel_id}}')" class="glyphicon glyphicon-ban-circle">关闭</a>
{{end}}
{{if eq $tunnelValue.status "0"}}
{{if eq $tunnelValue.is_open "1"}}
<a onclick="Common.confirm('确定要重启隧道吗?', '/tunnel/refresh?tunnel_id={{$tunnelValue.tunnel_id}}')" class="glyphicon glyphicon-refresh">重启</a>
{{end}}
{{end}}
<a onclick="Common.confirm('确定要删除隧道吗?', '/tunnel/delete?tunnel_id={{$tunnelValue.tunnel_id}}')" class="glyphicon glyphicon-remove">删除</a>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-md-8 m-pagination" id="paginator">
</div>
</div>
</div>
</div>
+60
View File
@@ -0,0 +1,60 @@
<div class="panel panel-default">
<div class="panel-heading">
<h4>
<span class="label label-danger">第一步:</span> 请选择模式
</h4>
</div>
<div class="panel-body">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img alt="100%x200" src="/static/images/tunnel/base.png" data-holder-rendered="true" style="background-color: #9d9d9d ;height: 200px; width: 100%; display: block;" >
<div class="caption" style="height: 200px;">
<h3>基本模式</h3>
<p>基本模式基本模式基本模式基本模式基本模式基本模式基本模式基本模式基本模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式</p>
<p>
{{if eq .modeBase "1"}}
<a href="/tunnel/cluster?mode=0" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-hand-right"></span> 选择</a>
{{else}}
<a href="javascript:;" class="btn btn-primary" role="button" disabled="disabled"><span class="glyphicon glyphicon-remove"></span> 选择</a>
<span class="text-danger">没有权限</span>
{{end}}
</p>
</div>
</div>
</div>
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img data-src="holder.js/100%x200" alt="100%x200" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjQyIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDI0MiAyMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjwhLS0KU291cmNlIFVSTDogaG9sZGVyLmpzLzEwMCV4MjAwCkNyZWF0ZWQgd2l0aCBIb2xkZXIuanMgMi42LjAuCkxlYXJuIG1vcmUgYXQgaHR0cDovL2hvbGRlcmpzLmNvbQooYykgMjAxMi0yMDE1IEl2YW4gTWFsb3BpbnNreSAtIGh0dHA6Ly9pbXNreS5jbwotLT48ZGVmcz48c3R5bGUgdHlwZT0idGV4dC9jc3MiPjwhW0NEQVRBWyNob2xkZXJfMTVlNTE1YjY4YTQgdGV4dCB7IGZpbGw6I0FBQUFBQTtmb250LXdlaWdodDpib2xkO2ZvbnQtZmFtaWx5OkFyaWFsLCBIZWx2ZXRpY2EsIE9wZW4gU2Fucywgc2Fucy1zZXJpZiwgbW9ub3NwYWNlO2ZvbnQtc2l6ZToxMnB0IH0gXV0+PC9zdHlsZT48L2RlZnM+PGcgaWQ9ImhvbGRlcl8xNWU1MTViNjhhNCI+PHJlY3Qgd2lkdGg9IjI0MiIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNFRUVFRUUiLz48Zz48dGV4dCB4PSI4OS44NTkzNzUiIHk9IjEwNS4xIj4yNDJ4MjAwPC90ZXh0PjwvZz48L2c+PC9zdmc+" data-holder-rendered="true" style="height: 200px; width: 100%; display: block;">
<div class="caption" style="height: 200px;">
<h3>高级模式</h3>
<p>高级模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式高级模式</p>
<p>
{{if eq .modeSenior "1"}}
<a href="/tunnel/cluster?mode=1" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-hand-right"></span> 选择</a>
{{else}}
<a href="javascript:;" class="btn btn-primary" role="button" disabled="disabled">选择</a>
<span class="text-danger">没有权限</span>
{{end}}
</p>
</div>
</div>
</div>
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img data-src="holder.js/100%x200" alt="100%x200" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjQyIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDI0MiAyMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjwhLS0KU291cmNlIFVSTDogaG9sZGVyLmpzLzEwMCV4MjAwCkNyZWF0ZWQgd2l0aCBIb2xkZXIuanMgMi42LjAuCkxlYXJuIG1vcmUgYXQgaHR0cDovL2hvbGRlcmpzLmNvbQooYykgMjAxMi0yMDE1IEl2YW4gTWFsb3BpbnNreSAtIGh0dHA6Ly9pbXNreS5jbwotLT48ZGVmcz48c3R5bGUgdHlwZT0idGV4dC9jc3MiPjwhW0NEQVRBWyNob2xkZXJfMTVlNTE1YjMwMGMgdGV4dCB7IGZpbGw6I0FBQUFBQTtmb250LXdlaWdodDpib2xkO2ZvbnQtZmFtaWx5OkFyaWFsLCBIZWx2ZXRpY2EsIE9wZW4gU2Fucywgc2Fucy1zZXJpZiwgbW9ub3NwYWNlO2ZvbnQtc2l6ZToxMnB0IH0gXV0+PC9zdHlsZT48L2RlZnM+PGcgaWQ9ImhvbGRlcl8xNWU1MTViMzAwYyI+PHJlY3Qgd2lkdGg9IjI0MiIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNFRUVFRUUiLz48Zz48dGV4dCB4PSI4OS44NTkzNzUiIHk9IjEwNS4xIj4yNDJ4MjAwPC90ZXh0PjwvZz48L2c+PC9zdmc+" data-holder-rendered="true" style="height: 200px; width: 100%; display: block;">
<div class="caption" style="height: 200px;">
<h3>特殊模式</h3>
<p>特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式特殊模式</p>
<p>
{{if eq .modeSpecial "1"}}
<a href="/tunnel/cluster?mode=2" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-hand-right"></span> 选择</a>
{{else}}
<a href="javascript:;" class="btn btn-primary" role="button" disabled="disabled">选择</a>
<span class="text-danger">没有权限</span>
{{end}}
</p>
</div>
</div>
</div>
</div>
</div>