mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-20 08:00:30 +08:00
优化界面显示
This commit is contained in:
@@ -117,6 +117,16 @@ func TrimZeroSuffix(s string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func formatDigit(d 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)
|
var l = len(d)
|
||||||
if l > 3 {
|
if l > 3 {
|
||||||
var pieces = l / 3
|
var pieces = l / 3
|
||||||
@@ -131,7 +141,7 @@ func formatDigit(d string) string {
|
|||||||
d2 += ", "
|
d2 += ", "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return d2
|
return prefix + d2
|
||||||
}
|
}
|
||||||
return d
|
return prefix + d
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ func TestFormatFloat(t *testing.T) {
|
|||||||
t.Log(numberutils.FormatFloat(1234, 2))
|
t.Log(numberutils.FormatFloat(1234, 2))
|
||||||
t.Log(numberutils.FormatFloat(1234.00001, 4))
|
t.Log(numberutils.FormatFloat(1234.00001, 4))
|
||||||
t.Log(numberutils.FormatFloat(1234.56700, 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) {
|
func TestTrimZeroSuffix(t *testing.T) {
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ Tea.context(function () {
|
|||||||
this.showNodeTasks = function () {
|
this.showNodeTasks = function () {
|
||||||
teaweb.popup("/clusters/tasks/listPopup", {
|
teaweb.popup("/clusters/tasks/listPopup", {
|
||||||
height: "24em",
|
height: "24em",
|
||||||
width: "50em"
|
width: "54em"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ Tea.context(function () {
|
|||||||
this.showDNSTasks = function () {
|
this.showDNSTasks = function () {
|
||||||
teaweb.popup("/dns/tasks/listPopup", {
|
teaweb.popup("/dns/tasks/listPopup", {
|
||||||
height: "24em",
|
height: "24em",
|
||||||
width: "50em"
|
width: "54em"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,11 +27,12 @@
|
|||||||
{{task.node.name}} <a :href="'/clusters/cluster/node?clusterId=' + cluster.id + '&nodeId=' + task.node.id" target="_blank"><i class="icon linkify small grey"></i></a>
|
{{task.node.name}} <a :href="'/clusters/cluster/node?clusterId=' + cluster.id + '&nodeId=' + task.node.id" target="_blank"><i class="icon linkify small grey"></i></a>
|
||||||
</td>
|
</td>
|
||||||
<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 == 'ipItemChanged'">同步IP名单</span>
|
||||||
<span v-if="task.type == 'scriptsChanged'">同步脚本</span>
|
<span v-if="task.type == 'scriptsChanged'">同步脚本</span>
|
||||||
<span v-if="task.type == 'nodeLevelChanged'">同步L2节点</span>
|
<span v-if="task.type == 'nodeLevelChanged'">同步L2节点</span>
|
||||||
<span v-if="task.type == 'ddosProtectionChanged'">DDoS配置</span>
|
<span v-if="task.type == 'ddosProtectionChanged'">DDoS配置</span>
|
||||||
|
<span v-if="task.type == 'userServersStateChanged'">用户服务状态</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span v-if="task.isDone" class="red">{{task.error}}</span>
|
<span v-if="task.isDone" class="red">{{task.error}}</span>
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>是否启用</td>
|
<td>启用当前用户</td>
|
||||||
<td>
|
<td>
|
||||||
<checkbox name="isOn" v-model="user.isOn"></checkbox>
|
<checkbox name="isOn" v-model="user.isOn"></checkbox>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user