extension

pull/103/head
刘河 2019-04-04 17:46:06 +08:00
parent f0f50579fc
commit 0c87b4119a
6 changed files with 29 additions and 4 deletions

View File

@ -49,3 +49,11 @@ auth_crypt_key =1234567812345678
#Web management multi-user login
#allow_user_login=true
#extension
allow_flow_limit=false
allow_rate_limit=false
allow_connection_num_limit=false
allow_multi_ip=false

View File

@ -45,6 +45,10 @@ func (s *BaseController) Prepare() {
}
s.Data["https_just_proxy"], _ = beego.AppConfig.Bool("https_just_proxy")
s.Data["allow_user_login"], _ = beego.AppConfig.Bool("allow_user_login")
s.Data["allow_flow_limit"], _ = beego.AppConfig.Bool("allow_flow_limit")
s.Data["allow_rate_limit"], _ = beego.AppConfig.Bool("allow_rate_limit")
s.Data["allow_connection_num_limit"], _ = beego.AppConfig.Bool("allow_connection_num_limit")
s.Data["allow_multi_ip"], _ = beego.AppConfig.Bool("allow_multi_ip")
}
//加载模板

View File

@ -11,7 +11,7 @@
placeholder="remark">
</div>
</div>
{{if eq true .allow_flow_limit}}
<div class="form-group" id="flow_limit">
<label class="col-sm-2 control-label" langtag="info-flow-limit"></label>
<div class="col-sm-10">
@ -20,7 +20,8 @@
<span class="help-block m-b-none" langtag="info-flow-limit-unit">unit: M</span>
</div>
</div>
{{end}}
{{if eq true .allow_rate_limit}}
<div class="form-group" id="rate_limit">
<label class="control-label col-sm-2" langtag="info-bandwidth"></label>
<div class="col-sm-10">
@ -29,6 +30,8 @@
<span class="help-block m-b-none" langtag="info-bandwidth-unit">unit: KB/S</span>
</div>
</div>
{{end}}
{{if eq true .allow_connection_num_limit}}
<div class="form-group" id="max_conn">
<label class="control-label col-sm-2" langtag="info-max-conn-num"></label>
<div class="col-sm-10">
@ -36,6 +39,7 @@
placeholder="empty means to be unrestricted">
</div>
</div>
{{end}}
<div class="form-group" id="u">
<label class="control-label col-sm-2" langtag="info-web-auth-username">basic</label>
<div class="col-sm-10">

View File

@ -13,6 +13,7 @@
</div>
</div>
{{if eq true .isAdmin}}
{{if eq true .allow_flow_limit}}
<div class="form-group" id="flow_limit">
<label class="col-sm-2 control-label" langtag="info-flow-limit"></label>
<div class="col-sm-10">
@ -21,6 +22,8 @@
<span class="help-block m-b-none">unit: M</span>
</div>
</div>
{{end}}
{{if eq true .allow_rate_limit}}
<div class="form-group" id="rate_limit">
<label class="control-label col-sm-2" langtag="info-bandwidth"></label>
@ -30,6 +33,9 @@
<span class="help-block m-b-none">unit: KB/S</span>
</div>
</div>
{{end}}
{{if eq true .allow_connection_num_limit}}
<div class="form-group" id="max_conn">
<label class="control-label col-sm-2" langtag="info-max-conn-num"></label>
<div class="col-sm-10">
@ -37,6 +43,7 @@
placeholder="empty means to be unrestricted">
</div>
</div>
{{end}}
{{end}}
<div class="form-group" id="u">
<label class="control-label col-sm-2" langtag="info-web-auth-username">basic</label>

View File

@ -27,7 +27,7 @@
placeholder="empty means to be unrestricted">
</div>
</div>
{{if eq true .allow_multi_ip}}
<div class="form-group" id="server_ip">
<label class="col-sm-2 control-label" langtag="info-server-ip">ip</label>
<div class="col-sm-10">
@ -35,7 +35,7 @@
placeholder="such as 0.0.0.0">
</div>
</div>
{{end}}
<div class="form-group" id="port">
<label class="col-sm-2 control-label" langtag="info-server-port"></label>
<div class="col-sm-10">

View File

@ -28,6 +28,7 @@
placeholder="empty means to be unrestricted">
</div>
</div>
{{if eq true .allow_multi_ip}}
<div class="form-group" id="server_ip">
<label class="col-sm-2 control-label" langtag="info-server-ip">ip</label>
<div class="col-sm-10">
@ -35,6 +36,7 @@
placeholder="such as 0.0.0.0">
</div>
</div>
{{end}}
<div class="form-group" id="port">
<label class="col-sm-2 control-label" langtag="info-server-port"></label>
<div class="col-sm-10">