diff --git a/web/controllers/client.go b/web/controllers/client.go index f46b494..798d51f 100644 --- a/web/controllers/client.go +++ b/web/controllers/client.go @@ -107,9 +107,11 @@ func (s *ClientController) Edit() { c.Cnf.P = s.GetString("p") c.Cnf.Compress = common.GetBoolByStr(s.GetString("compress")) c.Cnf.Crypt = s.GetBoolNoErr("crypt") - c.Flow.FlowLimit = int64(s.GetIntNoErr("flow_limit")) - c.RateLimit = s.GetIntNoErr("rate_limit") - c.MaxConn = s.GetIntNoErr("max_conn") + if s.GetSession("isAdmin").(bool) { + 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() diff --git a/web/views/client/edit.html b/web/views/client/edit.html index a80bde3..62bb779 100755 --- a/web/views/client/edit.html +++ b/web/views/client/edit.html @@ -12,6 +12,7 @@ placeholder="remark"> + {{if eq true .isAdmin}}
@@ -36,6 +37,7 @@ placeholder="empty means to be unrestricted">
+ {{end}}
diff --git a/web/views/client/list.html b/web/views/client/list.html index 913d432..aa7a3c3 100755 --- a/web/views/client/list.html +++ b/web/views/client/list.html @@ -197,7 +197,7 @@ }, { field: 'Status',//域值 - title: 'setting status',//内容 + title: 'run',//内容 visible: true,//false表示不显示 sortable: true,//启用排序 formatter: function (value, row, index) { @@ -210,7 +210,7 @@ }, { field: 'IsConnect',//域值 - title: 'client status',//内容 + title: 'status',//内容 visible: true,//false表示不显示 sortable: true,//启用排序 formatter: function (value, row, index) { @@ -228,12 +228,12 @@ sortable: true,//启用排序 formatter: function (value, row, index) { btn_group = '
' - btn = ` {{if eq true .isAdmin}}{{end}}
` + btn = `{{if eq true .isAdmin}}{{end}}
` if (row.Status) { - return btn_group {{if eq true .isAdmin}}+ `` {{end}}+ btn + return btn_group {{if eq true .isAdmin}}+ ``{{end}}+ btn } else { - return btn_group {{if eq true .isAdmin}}+ `` {{end}}+ btn + return btn_group {{if eq true .isAdmin}}+ ``{{end}}+ btn } } },