mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 03:16:53 +00:00
Code optimization
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/hex"
|
||||
"github.com/cnlh/nps/lib/crypt"
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
|
||||
"time"
|
||||
)
|
||||
|
||||
type AuthController struct {
|
||||
@@ -31,3 +32,10 @@ func (s *AuthController) GetAuthKey() {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (s *AuthController) GetTime() {
|
||||
m := make(map[string]interface{})
|
||||
m["time"] = time.Now().Unix()
|
||||
s.Data["json"] = m
|
||||
s.ServeJSON()
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ func (s *ClientController) List() {
|
||||
return
|
||||
}
|
||||
start, length := s.GetAjaxParams()
|
||||
list, cnt := server.GetClientList(start, length)
|
||||
list, cnt := server.GetClientList(start, length, s.GetString("search"))
|
||||
s.AjaxTable(list, cnt, cnt)
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ func (s *ClientController) Add() {
|
||||
} else {
|
||||
t := &file.Client{
|
||||
VerifyKey: s.GetString("vkey"),
|
||||
Id: file.GetCsvDb().GetClientId(),
|
||||
Id: int(file.GetCsvDb().GetClientId()),
|
||||
Status: true,
|
||||
Remark: s.GetString("remark"),
|
||||
Cnf: &file.Config{
|
||||
@@ -41,8 +41,9 @@ func (s *ClientController) Add() {
|
||||
Compress: common.GetBoolByStr(s.GetString("compress")),
|
||||
Crypt: s.GetBoolNoErr("crypt"),
|
||||
},
|
||||
RateLimit: s.GetIntNoErr("rate_limit"),
|
||||
MaxConn: s.GetIntNoErr("max_conn"),
|
||||
ConfigConnAllow: s.GetBoolNoErr("config_conn_allow"),
|
||||
RateLimit: s.GetIntNoErr("rate_limit"),
|
||||
MaxConn: s.GetIntNoErr("max_conn"),
|
||||
Flow: &file.Flow{
|
||||
ExportFlow: 0,
|
||||
InletFlow: 0,
|
||||
@@ -102,6 +103,7 @@ func (s *ClientController) Edit() {
|
||||
c.Flow.FlowLimit = int64(s.GetIntNoErr("flow_limit"))
|
||||
c.RateLimit = s.GetIntNoErr("rate_limit")
|
||||
c.MaxConn = s.GetIntNoErr("max_conn")
|
||||
c.ConfigConnAllow = s.GetBoolNoErr("config_conn_allow")
|
||||
if c.Rate != nil {
|
||||
c.Rate.Stop()
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ func (s *IndexController) GetTunnel() {
|
||||
start, length := s.GetAjaxParams()
|
||||
taskType := s.GetString("type")
|
||||
clientId := s.GetIntNoErr("client_id")
|
||||
list, cnt := server.GetTunnel(start, length, taskType, clientId)
|
||||
list, cnt := server.GetTunnel(start, length, taskType, clientId, s.GetString("search"))
|
||||
s.AjaxTable(list, cnt, cnt)
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ func (s *IndexController) Add() {
|
||||
Port: s.GetIntNoErr("port"),
|
||||
Mode: s.GetString("type"),
|
||||
Target: s.GetString("target"),
|
||||
Id: file.GetCsvDb().GetTaskId(),
|
||||
Id: int(file.GetCsvDb().GetTaskId()),
|
||||
Status: true,
|
||||
Remark: s.GetString("remark"),
|
||||
Password: s.GetString("password"),
|
||||
@@ -196,7 +196,7 @@ func (s *IndexController) HostList() {
|
||||
} else {
|
||||
start, length := s.GetAjaxParams()
|
||||
clientId := s.GetIntNoErr("client_id")
|
||||
list, cnt := file.GetCsvDb().GetHost(start, length, clientId)
|
||||
list, cnt := file.GetCsvDb().GetHost(start, length, clientId, s.GetString("search"))
|
||||
s.AjaxTable(list, cnt, cnt)
|
||||
}
|
||||
}
|
||||
@@ -231,7 +231,7 @@ func (s *IndexController) AddHost() {
|
||||
s.display("index/hadd")
|
||||
} else {
|
||||
h := &file.Host{
|
||||
Id: file.GetCsvDb().GetHostId(),
|
||||
Id: int(file.GetCsvDb().GetHostId()),
|
||||
Host: s.GetString("host"),
|
||||
Target: s.GetString("target"),
|
||||
HeaderChange: s.GetString("header"),
|
||||
@@ -275,7 +275,7 @@ func (s *IndexController) EditHost() {
|
||||
h.TargetArr = nil
|
||||
h.Location = s.GetString("location")
|
||||
h.Scheme = s.GetString("scheme")
|
||||
file.GetCsvDb().UpdateHost(h)
|
||||
file.GetCsvDb().StoreHostToCsv()
|
||||
var err error
|
||||
if h.Client, err = file.GetCsvDb().GetClient(s.GetIntNoErr("client_id")); err != nil {
|
||||
s.AjaxErr("modified error")
|
||||
|
@@ -1,7 +1,10 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/cnlh/nps/lib/common"
|
||||
"github.com/cnlh/nps/server"
|
||||
"github.com/cnlh/nps/vender/github.com/astaxie/beego"
|
||||
"time"
|
||||
)
|
||||
|
||||
type LoginController struct {
|
||||
@@ -15,6 +18,7 @@ func (self *LoginController) Verify() {
|
||||
if self.GetString("password") == beego.AppConfig.String("web_password") && self.GetString("username") == beego.AppConfig.String("web_username") {
|
||||
self.SetSession("auth", true)
|
||||
self.Data["json"] = map[string]interface{}{"status": 1, "msg": "login success"}
|
||||
server.Bridge.Register.Store(common.GetIpByAddr(self.Ctx.Request.RemoteAddr), time.Now().Add(time.Hour*time.Duration(2)))
|
||||
self.ServeJSON()
|
||||
} else {
|
||||
self.Data["json"] = map[string]interface{}{"status": 0, "msg": "username or password incorrect"}
|
||||
|
68
web/static/js/langchange.js
Normal file
68
web/static/js/langchange.js
Normal file
@@ -0,0 +1,68 @@
|
||||
(function ($) {
|
||||
$.fn.cloudLang = function (params) {
|
||||
|
||||
var defaults = {
|
||||
file: '/static/page/lang-example.xml',
|
||||
lang: 'zh'
|
||||
}
|
||||
|
||||
var aTexts = new Array();
|
||||
|
||||
if (params) $.extend(defaults, params);
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: defaults.file,
|
||||
dataType: "xml",
|
||||
success: function (xml) {
|
||||
$(xml).find('text').each(function () {
|
||||
var textId = $(this).attr("id");
|
||||
var text = $(this).find(defaults.lang).text();
|
||||
|
||||
aTexts[textId] = text;
|
||||
});
|
||||
|
||||
$.each($("*"), function (i, item) {
|
||||
//alert($(item).attr("langtag"));
|
||||
if ($(item).attr("langtag") != null)
|
||||
$(item).fadeOut(150).fadeIn(150).text(aTexts[$(item).attr("langtag")]);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
$(document).ready(function () {
|
||||
function setCookie(c_name, value, expiredays) {
|
||||
var exdate = new Date()
|
||||
exdate.setDate(exdate.getDate() + expiredays)
|
||||
document.cookie = c_name + "=" + escape(value) +
|
||||
((expiredays == null) ? "" : ";expires=" + exdate.toGMTString())
|
||||
}
|
||||
|
||||
function getCookie(c_name) {
|
||||
if (document.cookie.length > 0) {
|
||||
c_start = document.cookie.indexOf(c_name + "=")
|
||||
if (c_start != -1) {
|
||||
c_start = c_start + c_name.length + 1
|
||||
c_end = document.cookie.indexOf(";", c_start)
|
||||
if (c_end == -1) c_end = document.cookie.length
|
||||
return unescape(document.cookie.substring(c_start, c_end))
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
if (getCookie("lang") == "en") {
|
||||
$("body").cloudLang({lang: "en", file: "/static/page/lang-example.xml"});
|
||||
}
|
||||
$("#lang-en").click(function () {
|
||||
setCookie("lang", "en")
|
||||
$("body").cloudLang({lang: "en", file: "/static/page/lang-example.xml"});
|
||||
});
|
||||
|
||||
$("#langzh").click(function () {
|
||||
setCookie("lang", "zh")
|
||||
$("body").cloudLang({lang: "zh", file: "/static/page/lang-example.xml"});
|
||||
});
|
||||
});
|
@@ -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) {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">mode </label>
|
||||
<label class="col-sm-2 control-label" langtag="info-mode">类型 </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>
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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">
|
||||
@@ -29,14 +29,14 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="port">
|
||||
<label class="col-sm-2 control-label">port of server</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-server-port">服务端端口</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="port" placeholder="such as 8024">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="target">
|
||||
<label class="col-sm-2 control-label">target of Intranet(ip:port)</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-target">内网目标(ip:端口)</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>
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="client_id">
|
||||
<label class="col-sm-2 control-label">id of client</label>
|
||||
<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">
|
||||
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="local_path">
|
||||
<label class="col-sm-2 control-label">local path</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-local-path">本地路径</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="local_path"
|
||||
placeholder="such as /tmp">
|
||||
@@ -63,7 +63,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="strip_pre">
|
||||
<label class="col-sm-2 control-label">strip pre</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-strip-pre">访问前缀</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="strip_pre"
|
||||
placeholder="such as static">
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="password">
|
||||
<label class="col-sm-2 control-label">unique identification key</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-unique-vkey">唯一验证密钥</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="password"
|
||||
placeholder="unique identification key">
|
||||
@@ -82,7 +82,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>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<form class="form-horizontal">
|
||||
<input type="hidden" name="id" value="{{.t.Id}}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">mode </label>
|
||||
<label class="col-sm-2 control-label" langtag="info-mode">类型 </label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="type" id="type">
|
||||
<option {{if eq "tcp" .t.Mode}}selected{{end}} value="tcp">tcp</option>
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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 value="{{.t.Remark}}" class="form-control" type="text" name="remark"
|
||||
placeholder="empty means to be unrestricted">
|
||||
@@ -30,24 +30,24 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="port">
|
||||
<label class="col-sm-2 control-label">port of server</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-server-port">服务端端口</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.Port}}" class="form-control" type="text" name="port"
|
||||
placeholder="such as 8024">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="target">
|
||||
<label class="col-sm-2 control-label">target of Intranet(ip:port)</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-target">内网目标(ip:端口)</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">{{.t.Target}}</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>
|
||||
</span></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="client_id">
|
||||
<label class="col-sm-2 control-label">id of client</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-client-id">客户端id</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.Client.Id}}" value="{{.client_id}}" class="form-control" type="text"
|
||||
name="client_id"
|
||||
@@ -56,7 +56,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="local_path">
|
||||
<label class="col-sm-2 control-label">local path</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-local-path">本地路径</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.LocalPath}}" class="form-control" type="text" name="local_path"
|
||||
placeholder="such as /tmp">
|
||||
@@ -64,7 +64,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="strip_pre">
|
||||
<label class="col-sm-2 control-label">strip pre</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-strip-pre">访问前缀</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.StripPre}}" class="form-control" type="text" name="strip_pre"
|
||||
placeholder="such as static">
|
||||
@@ -72,7 +72,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="password">
|
||||
<label class="col-sm-2 control-label">unique identification key</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-unique-vkey">唯一验证密钥</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.t.Password}}" class="form-control" type="text" name="password"
|
||||
placeholder="unique identification key">
|
||||
@@ -83,7 +83,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>
|
||||
|
@@ -5,19 +5,19 @@
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<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="remark">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">host</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-host">域名</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="host" placeholder="such as a.proxy.com">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="scheme">
|
||||
<label class="control-label col-sm-2">scheme</label>
|
||||
<label class="control-label col-sm-2" langtag="info-scheme">协议类型</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="scheme">
|
||||
<option value="all">all</option>
|
||||
@@ -27,21 +27,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">url router</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-url-router">url路由</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" name="location"
|
||||
placeholder="empty means to be unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">client id</label>
|
||||
<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="client id">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">target of Intranet(ip:port)</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-target">内网目标(ip:端口)</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" type="text" name="target"
|
||||
placeholder="such as
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="header">
|
||||
<label class="col-sm-2 control-label">header modify</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-header-modify">request header修改</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" type="text" name="header"
|
||||
placeholder="Cache-Control: no-cache"></textarea>
|
||||
@@ -60,8 +60,8 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group" id="hostchange">
|
||||
<label class="col-sm-2 control-label">host modify</label>
|
||||
<div class="form-group" id="hostchange" >
|
||||
<label class="col-sm-2 control-label" langtag="info-host-change">request host修改</label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" value="" type="text" name="hostchange"
|
||||
placeholder="host modify">
|
||||
@@ -71,7 +71,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>
|
||||
|
@@ -6,21 +6,21 @@
|
||||
<form class="form-horizontal">
|
||||
<input type="hidden" name="id" value="{{.h.Id}}">
|
||||
<div class="form-group">
|
||||
<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 value="{{.h.Remark}}" class="form-control" type="text" name="remark"
|
||||
placeholder="remark">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">host</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-host">域名</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.Host}}" class="form-control" type="text" name="host"
|
||||
placeholder="such as a.proxy.com">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="scheme">
|
||||
<label class="control-label col-sm-2">scheme</label>
|
||||
<label class="control-label col-sm-2" langtag="info-scheme">协议类型</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" name="scheme">
|
||||
<option {{if eq "all" .h.Scheme}}selected{{end}} value="all">all</option>
|
||||
@@ -30,21 +30,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">url router</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-url-router">url路由</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.Location}}" class="form-control" type="text" name="location"
|
||||
placeholder="empty means to be unrestricted">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">client id</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-client-id">客户端id</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.Client.Id}}" class="form-control" type="text" name="client_id"
|
||||
placeholder="client id">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">target of Intranet(ip:port)</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-target">内网目标(ip:端口)</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" type="text" name="target"
|
||||
placeholder="such as
|
||||
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="header">
|
||||
<label class="col-sm-2 control-label">header modify</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-header-modify">request header修改</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" rows="4" type="text" name="header"
|
||||
placeholder="Cache-Control: no-cache">{{.h.HeaderChange}}</textarea>
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
</div>
|
||||
<div class="form-group" id="hostchange">
|
||||
<label class="col-sm-2 control-label">host modify</label>
|
||||
<label class="col-sm-2 control-label" langtag="info-host-change">request host修改</label>
|
||||
<div class="col-sm-10">
|
||||
<input value="{{.h.HostChange}}" class="form-control" value="" type="text" name="hostchange"
|
||||
placeholder="host modify">
|
||||
@@ -74,7 +74,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>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
<div id="toolbar">
|
||||
<a href="/index/addhost?vkey={{.task_id}}&client_id={{.client_id}}"
|
||||
class="btn btn-primary dim"
|
||||
type="button">new</a>
|
||||
type="button" langtag="info-new">新增</a>
|
||||
</div>
|
||||
<table id="taskList_table" class="table-striped table-hover"
|
||||
data-mobile-responsive="true"></table>
|
||||
@@ -46,8 +46,10 @@
|
||||
return {
|
||||
"offset": params.offset,
|
||||
"limit": params.limit,
|
||||
"search": params.search
|
||||
}
|
||||
},
|
||||
search: true,
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
striped: true, // 设置为true会有隔行变色效果
|
||||
showHeader: true,
|
||||
@@ -60,13 +62,14 @@
|
||||
detailView: true,
|
||||
smartDisplay: true, // 智能显示 pagination 和 cardview 等
|
||||
detailFormatter: function (index, row, element) {
|
||||
return '<b>export flow: </b>' + change(row.Flow.ExportFlow) + `       `
|
||||
+ '<b>inlet flow: </b>' + change(row.Flow.InletFlow) + `       `
|
||||
+ '<b>crypt: </b>' + row.Client.Cnf.Crypt + `       `
|
||||
+ '<b>compress: </b>' + row.Client.Cnf.Compress + `       ` + "<br/><br>"
|
||||
+ '<b>username: </b>' + row.Client.Cnf.U + `       `
|
||||
+ '<b>password: </b>' + row.Client.Cnf.P + `       ` + "<br/><br>"
|
||||
+ '<b>header_change: </b>' + row.HeaderChange + `       `
|
||||
return '<b langtag="info-export-flow">出口流量</b>:' + change(row.Flow.ExportFlow) + `       `
|
||||
+ '<b langtag="info-inlet-flow">入口流量</b>:' + change(row.Flow.InletFlow) + `       `
|
||||
+ '<b langtag="info-crypt">加密</b>:' + row.Client.Cnf.Crypt + `       `
|
||||
+ '<b langtag="info-compress">压缩</b>:' + row.Client.Cnf.Compress + `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-web-auth-username">basic权限认证用户名</b>:' + row.Client.Cnf.U + `       `
|
||||
+ '<b langtag="info-web-auth-password">basic权限认证密码</b>:' + row.Client.Cnf.P + `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-header-change">request header修改</b>:' + row.HeaderChange + `       ` + "<br/><br>"
|
||||
+ '<b langtag="info-host-change">request host 修改</b>:' + row.HostChange + `       `
|
||||
},
|
||||
//表格的列
|
||||
columns: [
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<div class="col-lg-3">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>client connection port</h5>
|
||||
<h5>客户端连接端口</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<h1 class="no-margins">{{.p}}</h1>
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="col-lg-3">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>number of clients</h5>
|
||||
<h5>总客户端数</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<h1 class="no-margins">{{.data.clientCount}}</h1>
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
{{/*<span class="label label-primary pull-right">今日</span>*/}}
|
||||
<h5>number of online clients</h5>
|
||||
<h5>在线客户端数</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<h1 class="no-margins">{{.data.clientOnlineCount}}</h1>
|
||||
@@ -36,7 +36,7 @@
|
||||
<div class="col-lg-3">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>number of tcp connections</h5>
|
||||
<h5>当前TCP连接总数</h5>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<h1 class="no-margins">{{.data.tcpCount}}</h1>
|
||||
@@ -49,7 +49,7 @@
|
||||
<div class="col-lg-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>config information</h5>
|
||||
<h5>配置信息</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
@@ -65,7 +65,7 @@
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>bridge type</strong>
|
||||
<strong>桥接模式</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.bridgeType}}</strong>
|
||||
@@ -75,7 +75,7 @@
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>http proxy port</strong>
|
||||
<strong>http代理端口</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.httpProxyPort}}</strong>
|
||||
@@ -85,7 +85,7 @@
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>https proxy port</strong>
|
||||
<strong>https代理端口</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.httpsProxyPort}}</strong>
|
||||
@@ -95,7 +95,7 @@
|
||||
<li class="list-group-item ">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>ip limit</strong>
|
||||
<strong>ip限制</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.ipLimit}}</strong>
|
||||
@@ -105,7 +105,7 @@
|
||||
<li class="list-group-item ">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>flow store interval</strong>
|
||||
<strong>流量持久化</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.flowStoreInterval}}</strong>
|
||||
@@ -115,7 +115,7 @@
|
||||
<li class="list-group-item ">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>log level</strong>
|
||||
<strong>日志级别</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.logLevel}}</strong>
|
||||
@@ -125,7 +125,7 @@
|
||||
<li class="list-group-item ">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>p2p port</strong>
|
||||
<strong>p2p端口</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.p2pPort}}</strong>
|
||||
@@ -135,7 +135,7 @@
|
||||
<li class="list-group-item ">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>server ip</strong>
|
||||
<strong>服务端IP</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.serverIp}}</strong>
|
||||
@@ -148,7 +148,7 @@
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="ibox-title">
|
||||
<h5>system now</h5>
|
||||
<h5>系统信息</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
@@ -162,7 +162,7 @@
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<span>cpu</span>
|
||||
<span>CPU</span>
|
||||
<small class="pull-right">{{.data.cpu}}%</small>
|
||||
</div>
|
||||
<div class="progress progress-small">
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
|
||||
<div>
|
||||
<span>virtual memory</span>
|
||||
<span>虚拟内存</span>
|
||||
<small class="pull-right">{{.data.virtual_mem}}%</small>
|
||||
</div>
|
||||
<div class="progress progress-small">
|
||||
@@ -189,7 +189,7 @@
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>load</strong>
|
||||
<strong>负载</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.load}}</strong>
|
||||
@@ -199,7 +199,7 @@
|
||||
<li class="list-group-item ">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>tcp num(establish)</strong>
|
||||
<strong>TCP连接数(establish)</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.tcp}}</strong>
|
||||
@@ -209,7 +209,7 @@
|
||||
<li class="list-group-item ">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>udp num(establish)</strong>
|
||||
<strong>UDP连接数(establish)</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong>{{.data.udp}}</strong>
|
||||
@@ -219,7 +219,7 @@
|
||||
<li class="list-group-item ">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>out</strong>
|
||||
<strong>出口带宽</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong id="send"></strong>
|
||||
@@ -229,7 +229,7 @@
|
||||
<li class="list-group-item ">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<strong>in</strong>
|
||||
<strong>入口带宽</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<strong id="recv"></strong>
|
||||
@@ -247,7 +247,7 @@
|
||||
<div class="col-lg-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>load</h5>
|
||||
<h5>负载</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
@@ -265,7 +265,7 @@
|
||||
<div class="col-lg-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>cpu</h5>
|
||||
<h5>CPU</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
@@ -285,7 +285,7 @@
|
||||
<div class="col-lg-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>virtual_mem</h5>
|
||||
<h5>内存</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
@@ -303,7 +303,7 @@
|
||||
<div class="col-lg-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>connection num</h5>
|
||||
<h5>连接数</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
@@ -324,7 +324,7 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>bandwidth</h5>
|
||||
<h5>带宽</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
@@ -345,7 +345,7 @@
|
||||
<div class="col-lg-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>traffic</h5>
|
||||
<h5>流量统计</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
@@ -363,7 +363,7 @@
|
||||
<div class="col-lg-6">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-title">
|
||||
<h5>types</h5>
|
||||
<h5>类型</h5>
|
||||
<div class="ibox-tools">
|
||||
<a class="collapse-link">
|
||||
<i class="fa fa-chevron-up"></i>
|
||||
@@ -397,7 +397,7 @@
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left',
|
||||
data: ['inlet flow', 'export flow']
|
||||
data: ['出口流量', '入口流量']
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@@ -406,8 +406,8 @@
|
||||
radius: '55%',
|
||||
center: ['50%', '60%'],
|
||||
data: [
|
||||
{value:{{.data.inletFlowCount}}, name: 'inlet flow'},
|
||||
{value:{{.data.exportFlowCount}}, name: 'export flow'},
|
||||
{value:{{.data.inletFlowCount}}, name: '入口流量'},
|
||||
{value:{{.data.exportFlowCount}}, name: '出口流量'},
|
||||
],
|
||||
itemStyle: {
|
||||
emphasis: {
|
||||
@@ -435,7 +435,7 @@
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left',
|
||||
data: ['tcp', 'socks5', 'http', 'udp', 'host', 'secret', 'p2p']
|
||||
data: ['tcp隧道数量', 'socks5隧道数量', 'http代理隧道数量', 'udp隧道数量', '域名解析数量', '私密代理数量', 'p2p数量']
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@@ -444,13 +444,13 @@
|
||||
radius: '55%',
|
||||
center: ['50%', '60%'],
|
||||
data: [
|
||||
{value:{{.data.tcpC}}, name: 'tcp'},
|
||||
{value:{{.data.socks5Count}}, name: 'socks5'},
|
||||
{value:{{.data.httpProxyCount}}, name: 'http'},
|
||||
{value:{{.data.udpCount}}, name: 'udp'},
|
||||
{value:{{.data.hostCount}}, name: 'host'},
|
||||
{value:{{.data.secretCount}}, name: 'secret'},
|
||||
{value:{{.data.p2pCount}}, name: 'p2p'},
|
||||
{value:{{.data.tcpC}}, name: 'tcp隧道数量'},
|
||||
{value:{{.data.socks5Count}}, name: 'socks5隧道数量'},
|
||||
{value:{{.data.httpProxyCount}}, name: 'http代理隧道数量'},
|
||||
{value:{{.data.udpCount}}, name: 'udp隧道数量'},
|
||||
{value:{{.data.hostCount}}, name: '域名解析数量'},
|
||||
{value:{{.data.secretCount}}, name: '私密代理数量'},
|
||||
{value:{{.data.p2pCount}}, name: 'p2p数量'},
|
||||
],
|
||||
itemStyle: {
|
||||
emphasis: {
|
||||
@@ -477,7 +477,7 @@
|
||||
option = null;
|
||||
option = {
|
||||
title: {
|
||||
text: 'load'
|
||||
text: '负载'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -536,7 +536,7 @@
|
||||
option = null;
|
||||
option = {
|
||||
title: {
|
||||
text: 'cpu'
|
||||
text: 'CPU'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -583,7 +583,7 @@
|
||||
option = null;
|
||||
option = {
|
||||
title: {
|
||||
text: 'memory'
|
||||
text: '内存'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -637,7 +637,7 @@
|
||||
option = null;
|
||||
option = {
|
||||
title: {
|
||||
text: 'connection num(establish)'
|
||||
text: '连接数(establish)'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
@@ -691,7 +691,7 @@
|
||||
option = null;
|
||||
option = {
|
||||
title: {
|
||||
text: 'bandwidth'
|
||||
text: '带宽'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
@@ -753,4 +753,4 @@
|
||||
this.myChart7.resize();
|
||||
});
|
||||
|
||||
</script>
|
||||
</script>
|
@@ -19,7 +19,7 @@
|
||||
<div class="table-responsive">
|
||||
<div id="toolbar">
|
||||
<a href="/index/add?type={{.type}}&client_id={{.client_id}}" class="btn btn-primary dim"
|
||||
type="button">new</a>
|
||||
type="button" langtag="info-new">新增</a>
|
||||
</div>
|
||||
<table id="taskList_table" class="table-striped table-hover"
|
||||
data-mobile-responsive="true"></table>
|
||||
@@ -47,8 +47,10 @@
|
||||
"limit": params.limit,
|
||||
"type":{{.type}},
|
||||
"client_id":{{.client_id}},
|
||||
"search": params.search
|
||||
}
|
||||
},
|
||||
search: true,
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
striped: true, // 设置为true会有隔行变色效果
|
||||
showHeader: true,
|
||||
@@ -61,12 +63,12 @@
|
||||
detailView: true,
|
||||
smartDisplay: true, // 智能显示 pagination 和 cardview 等
|
||||
detailFormatter: function (index, row, element) {
|
||||
return '<b>export flow: </b>' + change(row.Flow.ExportFlow) + `       `
|
||||
+ '<b>inlet flow: </b>' + change(row.Flow.InletFlow) + `       ` + "<br/><br>"
|
||||
+ '<b>crypt: </b>' + row.Client.Cnf.Crypt + `       `
|
||||
+ '<b>compress: </b>' + row.Client.Cnf.Compress + `       `
|
||||
+ '<b>username: </b>' + row.Client.Cnf.U + `       `
|
||||
+ '<b>password: </b>' + row.Client.Cnf.P + `       `
|
||||
return '<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.Client.Cnf.Crypt + `       `
|
||||
+ '<b langtag="info-compress">压缩</b>:' + row.Client.Cnf.Compress + `       `
|
||||
+ '<b langtag="info-web-auth-username">basic权限认证用户名</b>:' + row.Client.Cnf.U + `       `
|
||||
+ '<b langtag="info-web-auth-password">basic权限认证密码</b>:' + row.Client.Cnf.P + `       `
|
||||
},
|
||||
//表格的列
|
||||
columns: [
|
||||
|
@@ -24,7 +24,7 @@
|
||||
<script src="/static/js/bootstrap-table.min.js"></script>
|
||||
<script src="/static/js/inspinia.js"></script>
|
||||
<!-- Latest compiled and minified Locales -->
|
||||
|
||||
<script src="/static/js/langchange.js" type="text/javascript"></script>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -47,34 +47,42 @@
|
||||
</div>
|
||||
</li>
|
||||
<li class="{{if eq "index" .menu}}active{{end}}">
|
||||
<a href="/"><i class="fa fa-dashboard"></i> <span class="nav-label">dashboard</span></a>
|
||||
<a href="/"><i class="fa fa-dashboard"></i> <span langtag="menu-dashboard" class="nav-label">仪表盘</span></a>
|
||||
</li>
|
||||
<li class="{{if eq "client" .menu}}active{{end}}">
|
||||
<a href="/client/list"><i class="fa fa-clipboard"></i> <span class="nav-label">client</span></a>
|
||||
<a href="/client/list"><i class="fa fa-clipboard"></i> <span langtag="menu-client"
|
||||
class="nav-label">客户端</span></a>
|
||||
</li>
|
||||
<li class="{{if eq "host" .menu}}active{{end}}">
|
||||
<a href="/index/hostlist"><i class="fa fa-paperclip"></i> <span class="nav-label">host</span></a>
|
||||
<a href="/index/hostlist"><i class="fa fa-paperclip"></i> <span langtag="menu-host"
|
||||
class="nav-label">域名解析</span></a>
|
||||
</li>
|
||||
<li class="{{if eq "tcp" .menu}}active{{end}}">
|
||||
<a href="/index/tcp"><i class="fa fa-line-chart"></i> <span class="nav-label">tcp</span></a>
|
||||
<a href="/index/tcp"><i class="fa fa-line-chart"></i> <span langtag="menu-tcp"
|
||||
class="nav-label">tcp隧道</span></a>
|
||||
</li>
|
||||
<li class="{{if eq "udp" .menu}}active{{end}}">
|
||||
<a href="/index/udp"><i class="fa fa-server"></i> <span class="nav-label">udp</span></a>
|
||||
<a href="/index/udp"><i class="fa fa-server"></i> <span langtag="menu-udp"
|
||||
class="nav-label">udp隧道</span></a>
|
||||
</li>
|
||||
<li class="{{if eq "http" .menu}}active{{end}}">
|
||||
<a href="/index/http"><i class="fa fa-html5"></i> <span class="nav-label">http</span></a>
|
||||
<a href="/index/http"><i class="fa fa-html5"></i> <span langtag="menu-http"
|
||||
class="nav-label">http代理</span></a>
|
||||
</li>
|
||||
<li class="{{if eq "socks5" .menu}}active{{end}}">
|
||||
<a href="/index/socks5"><i class="fa fa-table"></i> <span class="nav-label">socks5</span></a>
|
||||
<a href="/index/socks5"><i class="fa fa-table"></i> <span langtag="menu-socks5" class="nav-label">socks5代理</span></a>
|
||||
</li>
|
||||
<li class="{{if eq "secret" .menu}}active{{end}}">
|
||||
<a href="/index/secret"><i class="fa fa-backward"></i> <span class="nav-label">secret</span></a>
|
||||
<a href="/index/secret"><i class="fa fa-backward"></i> <span langtag="menu-secret"
|
||||
class="nav-label">私密代理</span></a>
|
||||
</li>
|
||||
<li class="{{if eq "p2p" .menu}}active{{end}}">
|
||||
<a href="/index/p2p"><i class="fa fa-dashcube"></i> <span class="nav-label">p2p</span></a>
|
||||
<a href="/index/p2p"><i class="fa fa-dashcube"></i> <span langtag="menu-p2p"
|
||||
class="nav-label">p2p代理</span></a>
|
||||
</li>
|
||||
<li class="{{if eq "file" .menu}}active{{end}}">
|
||||
<a href="/index/file"><i class="fa fa-laptop"></i> <span class="nav-label">file</span></a>
|
||||
<a href="/index/file"><i class="fa fa-laptop"></i> <span langtag="menu-file"
|
||||
class="nav-label">文件代理</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -92,6 +100,12 @@
|
||||
<span class="m-r-sm text-muted welcome-message">Welcome to use <a
|
||||
href="https://github.com/cnlh/nps">NPS</a></span>
|
||||
</li>
|
||||
<li>
|
||||
<a id="lang-en">English</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="langzh">简体中文</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/login/out">
|
||||
|
Reference in New Issue
Block a user