优化界面显示

This commit is contained in:
GoEdgeLab
2022-10-23 11:44:09 +08:00
parent 19cc57d78f
commit 300c4e133c
5 changed files with 19 additions and 6 deletions

View File

@@ -117,6 +117,16 @@ func TrimZeroSuffix(s string) string {
}
func formatDigit(d string) string {
if len(d) == 0 {
return d
}
var prefix = ""
if d[0] < '0' || d[0] > '9' {
prefix = d[:1]
d = d[1:]
}
var l = len(d)
if l > 3 {
var pieces = l / 3
@@ -131,7 +141,7 @@ func formatDigit(d string) string {
d2 += ", "
}
}
return d2
return prefix + d2
}
return d
return prefix + d
}

View File

@@ -45,6 +45,8 @@ func TestFormatFloat(t *testing.T) {
t.Log(numberutils.FormatFloat(1234, 2))
t.Log(numberutils.FormatFloat(1234.00001, 4))
t.Log(numberutils.FormatFloat(1234.56700, 4))
t.Log(numberutils.FormatFloat(-1234.56700, 2))
t.Log(numberutils.FormatFloat(-221745.12, 2))
}
func TestTrimZeroSuffix(t *testing.T) {

View File

@@ -133,7 +133,7 @@ Tea.context(function () {
this.showNodeTasks = function () {
teaweb.popup("/clusters/tasks/listPopup", {
height: "24em",
width: "50em"
width: "54em"
})
}
@@ -166,7 +166,7 @@ Tea.context(function () {
this.showDNSTasks = function () {
teaweb.popup("/dns/tasks/listPopup", {
height: "24em",
width: "50em"
width: "54em"
})
}
});

View File

@@ -27,11 +27,12 @@
{{task.node.name}} &nbsp; <a :href="'/clusters/cluster/node?clusterId=' + cluster.id + '&nodeId=' + task.node.id" target="_blank"><i class="icon linkify small grey"></i></a>
</td>
<td>
<span v-if="task.type == 'configChanged'">同步配置</span>
<span v-if="task.type == 'configChanged' || task.type == 'globalServerConfigChanged'">同步配置</span>
<span v-if="task.type == 'ipItemChanged'">同步IP名单</span>
<span v-if="task.type == 'scriptsChanged'">同步脚本</span>
<span v-if="task.type == 'nodeLevelChanged'">同步L2节点</span>
<span v-if="task.type == 'ddosProtectionChanged'">DDoS配置</span>
<span v-if="task.type == 'userServersStateChanged'">用户服务状态</span>
</td>
<td>
<span v-if="task.isDone" class="red">{{task.error}}</span>

View File

@@ -81,7 +81,7 @@
</td>
</tr>
<tr>
<td>是否启用</td>
<td>启用当前用户</td>
<td>
<checkbox name="isOn" v-model="user.isOn"></checkbox>
</td>