可以修改单个用户的带宽算法

This commit is contained in:
GoEdgeLab
2023-02-27 10:46:48 +08:00
parent 314ee86f2c
commit 1faed99e5b
4 changed files with 37 additions and 11 deletions

View File

@@ -68,6 +68,7 @@ func (this *UpdateAction) RunGet(params struct {
"mobile": user.Mobile, "mobile": user.Mobile,
"isOn": user.IsOn, "isOn": user.IsOn,
"countAccessKeys": countAccessKeys, "countAccessKeys": countAccessKeys,
"bandwidthAlgo": user.BandwidthAlgo,
// 实名认证 // 实名认证
"hasNewIndividualIdentity": hasNewIndividualIdentity, "hasNewIndividualIdentity": hasNewIndividualIdentity,
@@ -98,6 +99,7 @@ func (this *UpdateAction) RunPost(params struct {
Remark string Remark string
IsOn bool IsOn bool
ClusterId int64 ClusterId int64
BandwidthAlgo string
// OTP // OTP
OtpOn bool OtpOn bool
@@ -159,6 +161,7 @@ func (this *UpdateAction) RunPost(params struct {
Remark: params.Remark, Remark: params.Remark,
IsOn: params.IsOn, IsOn: params.IsOn,
NodeClusterId: params.ClusterId, NodeClusterId: params.ClusterId,
BandwidthAlgo: params.BandwidthAlgo,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -109,6 +109,7 @@ func (this *UserAction) RunGet(params struct {
"isVerified": user.IsVerified, "isVerified": user.IsVerified,
"registeredIP": user.RegisteredIP, "registeredIP": user.RegisteredIP,
"registeredRegion": registeredRegion, "registeredRegion": registeredRegion,
"bandwidthAlgo": user.BandwidthAlgo,
// 实名认证 // 实名认证
"hasNewIndividualIdentity": hasNewIndividualIdentity, "hasNewIndividualIdentity": hasNewIndividualIdentity,

View File

@@ -80,6 +80,18 @@
<textarea rows="3" name="remark" v-model="user.remark"></textarea> <textarea rows="3" name="remark" v-model="user.remark"></textarea>
</td> </td>
</tr> </tr>
<tr>
<td>带宽算法</td>
<td>
<select class="ui dropdown auto-width" name="bandwidthAlgo" v-model="user.bandwidthAlgo">
<option value="">[使用默认]</option>
<option value="secondly">峰值带宽</option>
<option value="avg">平均带宽</option>
</select>
<p class="comment" v-if="user.bandwidthAlgo == 'secondly'">按在计时时间段内5分钟最高带宽峰值计算比如5分钟内最高的某个时间点带宽为100Mbps那么就认为此时间段内的峰值带宽为100Mbps。</p>
<p class="comment" v-if="user.bandwidthAlgo == 'avg'">按在计时时间段内5分钟平均带宽计算即此时间段内的总流量除以时间段的秒数比如5分钟300秒内总流量600MB那么带宽即为<code-label>600MB * 8bit/300s = 16Mbps</code-label>;通常平均带宽算法要比峰值带宽要少很多。</p>
</td>
</tr>
<tr> <tr>
<td>启用当前用户</td> <td>启用当前用户</td>
<td> <td>

View File

@@ -71,6 +71,16 @@
<span v-else class="disabled">没有设置。</span> <span v-else class="disabled">没有设置。</span>
</td> </td>
</tr> </tr>
<tr>
<td>带宽算法</td>
<td>
<span v-if="user.bandwidthAlgo.length > 0">
<span v-if="user.bandwidthAlgo == 'secondly'">峰值带宽</span>
<span v-if="user.bandwidthAlgo == 'avg'">平均带宽</span>
</span>
<span v-else class="disabled">使用默认。</span>
</td>
</tr>
<tr> <tr>
<td>注册IP</td> <td>注册IP</td>
<td> <td>