Skip to content

Commit

Permalink
优化gpu前端展示代码 (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
nap0o authored Jun 23, 2024
1 parent f75847d commit 877b4cd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion resource/template/theme-angel-kanade/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
[<span
v-if="server.Host.Virtualization">@#server.Host.Virtualization#@:</span>@#server.Host.Arch#@]<br />
CPU: @#server.Host.CPU#@<br />
GPU: @#server.Host.GPU#@<br />
<template v-if="server.Host.GPU">
GPU: @#server.Host.GPU#@
</template>
{{tr "DiskUsed"}}:
@#formatByteSize(server.State.DiskUsed)#@/@#formatByteSize(server.Host.DiskTotal)#@<br />
{{tr "MemUsed"}}:
Expand Down
6 changes: 4 additions & 2 deletions resource/template/theme-default/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
<br />
CPU: @#server.Host.CPU#@
<br />
GPU: @#server.Host.GPU#@
<br />
<template v-if="server.Host.GPU">
GPU: @#server.Host.GPU#@
<br />
</template>
{{tr "DiskUsed"}}:
@#formatByteSize(server.State.DiskUsed)#@/@#formatByteSize(server.Host.DiskTotal)#@
<br />
Expand Down
3 changes: 2 additions & 1 deletion resource/template/theme-server-status/home-group-false.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
</span>
<span class="node-cell-expand" v-if="node.host.GPU">
<span class="node-cell-expand-label">GPU:</span>
@#node.host.GPU.join(",")#@ (@#node.gpu.percent#@%)
@#node.host.GPU.join(",")#@
(@#parseInt(node.state.GPU >=0 ? node.state.GPU : 0)#@%)
</span>
<span class="node-cell-expand">
<span class="node-cell-expand-label">{{tr "DiskUsed"}}:</span>
Expand Down
3 changes: 2 additions & 1 deletion resource/template/theme-server-status/home-group-true.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
</span>
<span class="node-cell-expand" v-if="node.host.GPU">
<span class="node-cell-expand-label">GPU:</span>
@#node.host.GPU.join(",")#@ (@#node.gpu.percent#@%)
@#node.host.GPU.join(",")#@
(@#parseInt(node.state.GPU >=0 ? node.state.GPU : 0)#@%)
</span>
<span class="node-cell-expand">
<span class="node-cell-expand-label">{{tr "DiskUsed"}}:</span>
Expand Down
1 change: 0 additions & 1 deletion resource/template/theme-server-status/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ <h4 class="modal-title" id="mapChartTitle">{{tr "ServersOnWorldMap"}}</h4>
network: this.getNetworkSpeed(server.State.NetInSpeed, server.State.NetOutSpeed),
traffic: this.formatByteSize(server.State.NetInTransfer) + ' | ' + this.formatByteSize(server.State.NetOutTransfer),
cpu: this.formatPercents(server.live, this.toFixed2(server.State.CPU)),
gpu: this.formatPercents(server.live, this.toFixed2(server.State.GPU)),
memory: this.formatPercent(server.live, server.State.MemUsed, server.Host.MemTotal),
hdd: this.formatPercent(server.live, server.State.DiskUsed, server.Host.DiskTotal),
online: server.live,
Expand Down

0 comments on commit 877b4cd

Please sign in to comment.