mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 11:56:53 +00:00
Code optimization
This commit is contained in:
@@ -5,59 +5,72 @@
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group" id="remark">
|
||||
<label class="col-sm-2 control-label">remark</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-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="empty means to be unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="flow_limit">
|
||||
<label class="col-sm-2 control-label">flow limitation</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-flow-limit">流量限制</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="flow_limit"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">unit: M</span>
|
||||
<span class="help-block m-b-none" langtag="info-flow-limit-unit">unit: M</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="rate_limit">
|
||||
<label class="control-label col-sm-2">bandwidth limitation</label>
|
||||
<label class="control-label col-sm-2" langtag="info-bandwidth">带宽限制</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="rate_limit"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">unit: KB/S</span>
|
||||
<span class="help-block m-b-none" langtag="info-bandwidth-unit">unit: KB/S</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="max_conn">
|
||||
<label class="control-label col-sm-2">maximum number of client connections</label>
|
||||
<label class="control-label col-sm-2" langtag="info-max-conn-num">客户端最大连接数量</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="max_conn"
|
||||
placeholder="empty means to be unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="u">
|
||||
<label class="control-label col-sm-2">web authentication username</label>
|
||||
<label class="control-label col-sm-2" langtag="info-web-auth-username">basic权限认证用户名</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="u" placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" type="text" name="u"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">only socks5 , web, HTTP forward proxy </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="p">
|
||||
<label class="control-label col-sm-2">web authentication password </label>
|
||||
<label class="control-label col-sm-2" langtag="info-web-auth-password">basic权限认证密码 </label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="p" placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" type="text" name="p"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">only socks5 , web, HTTP forward proxy </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="vkey">
|
||||
<label class="control-label col-sm-2">client connection key</label>
|
||||
<label class="control-label col-sm-2" langtag="info-client-vkey">客户端验证密钥</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="vkey" placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" type="text" name="vkey"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">unique, non-filling will be generated automatically</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="config_conn_allow">
|
||||
<label class="control-label col-sm-2" langtag="info-config-conn-allow">是否允许客户端以配置文件模式连接</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="config_conn_allow">
|
||||
<option value="1">yes</option>
|
||||
<option value="0">no</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="compress">
|
||||
<label class="control-label col-sm-2">compress</label>
|
||||
<label class="control-label col-sm-2" langtag="info-compress">压缩</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="compress">
|
||||
<option value="0">no</option>
|
||||
@@ -66,7 +79,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="compress">
|
||||
<label class="control-label col-sm-2">crypt</label>
|
||||
<label class="control-label col-sm-2" langtag="info-crypt">加密</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="crypt">
|
||||
<option value="0">no</option>
|
||||
@@ -78,7 +91,7 @@
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-success" href="#" id="add"><i
|
||||
class="fa fa-fw fa-lg fa-eye"></i>add
|
||||
class="fa fa-fw fa-lg fa-eye"></i>新增
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-md-auto">
|
||||
<div class="ibox float-e-margins">
|
||||
@@ -7,13 +6,14 @@
|
||||
<form class="form-horizontal">
|
||||
<input type="hidden" name="id" value="{{.c.Id}}">
|
||||
<div class="form-group" id="remark">
|
||||
<label class="col-sm-2 control-label">remark</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-remark">备注</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.Remark}}" type="text" name="remark" placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" value="{{.c.Remark}}" type="text" name="remark"
|
||||
placeholder="empty means to be unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="flow_limit">
|
||||
<label class="col-sm-2 control-label">flow limitation</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-flow-limit">流量限制</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.Flow.FlowLimit}}" type="text" name="flow_limit"
|
||||
placeholder="empty means to be unrestricted">
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="rate_limit">
|
||||
<label class="control-label col-sm-2">bandwidth limitation</label>
|
||||
<label class="control-label col-sm-2" langtag="info-bandwidth">带宽限制</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.RateLimit}}" type="text" name="rate_limit"
|
||||
placeholder="empty means to be unrestricted">
|
||||
@@ -30,35 +30,47 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="max_conn">
|
||||
<label class="control-label col-sm-2">maximum number of client connections</label>
|
||||
<label class="control-label col-sm-2" langtag="info-max-conn-num">客户端最大连接数</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.MaxConn}}" type="text" name="max_conn"
|
||||
placeholder="empty means to be unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="u">
|
||||
<label class="control-label col-sm-2">web authentication username</label>
|
||||
<label class="control-label col-sm-2" langtag="info-web-auth-username">basic权限认证用户名</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.Cnf.U}}" type="text" name="u" placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" value="{{.c.Cnf.U}}" type="text" name="u"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">only socks5 , web, HTTP forward proxy </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="p">
|
||||
<label class="control-label col-sm-2">web authentication password </label>
|
||||
<label class="control-label col-sm-2" langtag="info-web-auth-password">basic权限认证密码 </label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.Cnf.P}}" type="text" name="p" placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" value="{{.c.Cnf.P}}" type="text" name="p"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">only socks5 , web, HTTP forward proxy </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="vkey">
|
||||
<label class="control-label col-sm-2">client connection key</label>
|
||||
<label class="control-label col-sm-2" langtag="info-client-vkey">客户端验证密钥</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="{{.c.VerifyKey}}" type="text" name="vkey" placeholder="empty means to be unrestricted">
|
||||
<input class="form-control" value="{{.c.VerifyKey}}" type="text" name="vkey"
|
||||
placeholder="empty means to be unrestricted">
|
||||
<span class="help-block m-b-none">unique, non-filling will be generated automatically</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="config_conn_allow">
|
||||
<label class="control-label col-sm-2" langtag="info-config-conn-allow">是否允许客户端以配置文件模式连接</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="config_conn_allow">
|
||||
<option {{if eq true .c.ConfigConnAllow}}selected{{end}} value="1">yes</option>
|
||||
<option {{if eq false .c.ConfigConnAllow}}selected{{end}} value="0">no</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="compress">
|
||||
<label class="control-label col-sm-2">compress</label>
|
||||
<label class="control-label col-sm-2" langtag="info-compress">压缩</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="compress">
|
||||
<option {{if eq false .c.Cnf.Compress}}selected{{end}} value="0">no</option>
|
||||
@@ -67,7 +79,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="compress">
|
||||
<label class="control-label col-sm-2">crypt</label>
|
||||
<label class="control-label col-sm-2" langtag="info-crypt">加密</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="crypt">
|
||||
<option {{if eq false .c.Cnf.Crypt}}selected{{end}} value="0">no</option>
|
||||
@@ -79,7 +91,7 @@
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-success" href="#" id="add"><i
|
||||
class="fa fa-fw fa-lg fa-eye"></i>save
|
||||
class="fa fa-fw fa-lg fa-eye"></i>新增
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
<div class="content">
|
||||
<div class="table-responsive">
|
||||
<div id="toolbar">
|
||||
<a href="/client/add" class="btn btn-primary dim" type="button">new</i></a>
|
||||
<a href="/client/add" class="btn btn-primary dim" type="button" langtag="info-new">新增</a>
|
||||
</div>
|
||||
<table id="taskList_table" class="table-striped table-hover"
|
||||
data-mobile-responsive="true"></table>
|
||||
@@ -109,6 +109,7 @@
|
||||
url: "/client/list", // 服务器数据的加载地址
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
striped: true, // 设置为true会有隔行变色效果
|
||||
search: true,
|
||||
showHeader: true,
|
||||
showColumns: true,
|
||||
showRefresh: true,
|
||||
@@ -119,17 +120,18 @@
|
||||
detailView: true,
|
||||
smartDisplay: true, // 智能显示 pagination 和 cardview 等
|
||||
detailFormatter: function (index, row, element) {
|
||||
return '<b>max connection num: </b>' + row.MaxConn + `       `
|
||||
+ '<b>now conn num: </b>' + row.NowConn + `       `
|
||||
+ '<b>rate limit: </b>' + row.Flow.FlowLimit + `m       `
|
||||
+ '<b>flow limit: </b>' + row.RateLimit + `kb/s       `
|
||||
+ '<b>export flow: </b>' + change(row.Flow.ExportFlow) + `       `
|
||||
+ '<b>inlet flow: </b>' + change(row.Flow.InletFlow) + `       ` + "<br/><br>"
|
||||
+ '<b>crypt: </b>' + row.Cnf.Crypt + `       `
|
||||
+ '<b>compress: </b>' + row.Cnf.Compress + `       `
|
||||
+ '<b>username: </b>' + row.Cnf.U + `       `
|
||||
+ '<b>password: </b>' + row.Cnf.P + `       ` + "<br/><br>"
|
||||
+ '<b>commond: </b>' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.VerifyKey + " -type=" +{{.bridgeType}} +"</code>"
|
||||
return '<b langtag="info-max-conn-num">最大连接数</b>:' + row.MaxConn + `       `
|
||||
+ '<b langtag="info-now-conn-num">当前连接数</b>:' + row.NowConn + `       `
|
||||
+ '<b langtag="info-flow-limit">流量限制</b>:' + row.Flow.FlowLimit + `m       `
|
||||
+ '<b langtag="info-rate-limit">带宽限制</b>:' + row.RateLimit + `kb/s       `
|
||||
+ '<b langtag="info-export-flow">出口流量</b>:' + change(row.Flow.ExportFlow) + `       `
|
||||
+ '<b langtag="info-inlet-flow">入口流量</b>:' + change(row.Flow.InletFlow) + `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-crypt">加密</b>:' + row.Cnf.Crypt + `       `
|
||||
+ '<b langtag="info-compress">压缩</b>:' + row.Cnf.Compress + `       `
|
||||
+ '<b langtag="info-config-conn-allow">是否允许配置文件模式连接</b>:' + row.ConfigConnAllow + `       `
|
||||
+ '<b langtag="info-web-auth-username">basic认证用户名</b>:' + row.Cnf.U + `       `
|
||||
+ '<b langtag="info-web-auth-password">basic认证密码</b>:' + row.Cnf.P + `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-command">命令</b>:' + "<code>./npc{{.win}} -server={{.ip}}:{{.p}} -vkey=" + row.VerifyKey + " -type=" +{{.bridgeType}} +"</code>"
|
||||
},
|
||||
//表格的列
|
||||
columns: [
|
||||
@@ -147,7 +149,7 @@
|
||||
},
|
||||
{
|
||||
field: 'VerifyKey',//域值
|
||||
title: 'key',//标题
|
||||
title: 'vkey',//标题
|
||||
visible: true,//false表示不显示
|
||||
sortable: true,//启用排序
|
||||
formatter: function (value, row, index) {
|
||||
|
Reference in New Issue
Block a user