web user auth bug

pull/103/head
刘河 2019-03-27 10:06:10 +08:00
parent b43abb4b5d
commit b09d3ec22c
3 changed files with 12 additions and 8 deletions

View File

@ -107,9 +107,11 @@ func (s *ClientController) Edit() {
c.Cnf.P = s.GetString("p") c.Cnf.P = s.GetString("p")
c.Cnf.Compress = common.GetBoolByStr(s.GetString("compress")) c.Cnf.Compress = common.GetBoolByStr(s.GetString("compress"))
c.Cnf.Crypt = s.GetBoolNoErr("crypt") c.Cnf.Crypt = s.GetBoolNoErr("crypt")
if s.GetSession("isAdmin").(bool) {
c.Flow.FlowLimit = int64(s.GetIntNoErr("flow_limit")) c.Flow.FlowLimit = int64(s.GetIntNoErr("flow_limit"))
c.RateLimit = s.GetIntNoErr("rate_limit") c.RateLimit = s.GetIntNoErr("rate_limit")
c.MaxConn = s.GetIntNoErr("max_conn") c.MaxConn = s.GetIntNoErr("max_conn")
}
c.ConfigConnAllow = s.GetBoolNoErr("config_conn_allow") c.ConfigConnAllow = s.GetBoolNoErr("config_conn_allow")
if c.Rate != nil { if c.Rate != nil {
c.Rate.Stop() c.Rate.Stop()

View File

@ -12,6 +12,7 @@
placeholder="remark"> placeholder="remark">
</div> </div>
</div> </div>
{{if eq true .isAdmin}}
<div class="form-group" id="flow_limit"> <div class="form-group" id="flow_limit">
<label class="col-sm-2 control-label" langtag="info-flow-limit"></label> <label class="col-sm-2 control-label" langtag="info-flow-limit"></label>
<div class="col-sm-10"> <div class="col-sm-10">
@ -36,6 +37,7 @@
placeholder="empty means to be unrestricted"> placeholder="empty means to be unrestricted">
</div> </div>
</div> </div>
{{end}}
<div class="form-group" id="u"> <div class="form-group" id="u">
<label class="control-label col-sm-2" langtag="info-web-auth-username">basic</label> <label class="control-label col-sm-2" langtag="info-web-auth-username">basic</label>
<div class="col-sm-10"> <div class="col-sm-10">

View File

@ -197,7 +197,7 @@
}, },
{ {
field: 'Status',//域值 field: 'Status',//域值
title: 'setting status',//内容 title: 'run',//内容
visible: true,//false表示不显示 visible: true,//false表示不显示
sortable: true,//启用排序 sortable: true,//启用排序
formatter: function (value, row, index) { formatter: function (value, row, index) {
@ -210,7 +210,7 @@
}, },
{ {
field: 'IsConnect',//域值 field: 'IsConnect',//域值
title: 'client status',//内容 title: 'status',//内容
visible: true,//false表示不显示 visible: true,//false表示不显示
sortable: true,//启用排序 sortable: true,//启用排序
formatter: function (value, row, index) { formatter: function (value, row, index) {