nezha/resource/template/page/home.html

114 lines
5.4 KiB
HTML
Raw Normal View History

2019-12-08 03:59:58 -05:00
{{define "page/home"}}
{{template "common/header" .}}
{{template "common/menu" .}}
<div class="nb-container">
<div class="ui container">
2019-12-09 03:02:49 -05:00
<div class="ui four status cards">
2019-12-10 02:33:05 -05:00
<div v-for='server in servers' class="card">
2019-12-08 10:18:29 -05:00
<div class="content">
2019-12-10 02:33:05 -05:00
<div class="header"><i v-if='server.Host.CountryCode'
:class="server.Host.CountryCode + ' flag'"></i>
<?server.Name?>
<i class="yellow info circle icon"></i>
<div class='ui content popup'>
系统:
<?server.Host.Platform?>-
<?server.Host.PlatformVersion?> [<span v-if='server.Host.Virtualization'>
<?server.Host.Virtualization?>:</span>
<?server.Host.Arch?>]<br>
CPU
<?server.Host.CPU?><br>
硬盘:
<?server.State.DiskUsed?>/
<?server.State.DiskTotal?><br>
内存:
<?server.State.MemUsed?>/
<?server.State.MemTotal?><br>
交换:
<?server.State.SwapUsed?>/
<?server.State.SwapTotal?><br>
流量:<i class='arrow alternate circle down outline icon'></i>
<?server.State.NetInTransfer?> <i class='arrow alternate circle up outline icon'></i>
<?server.State.NetOutTransfer?><br>
启动:
<?server.Host.BootTime?><br>
版本v
<?server.Host.Version?><br>
</div>
2019-12-09 03:02:49 -05:00
</div>
2019-12-08 10:18:29 -05:00
<div class="description">
2019-12-09 03:02:49 -05:00
<div class="ui grid">
<div class="three wide column">CPU</div>
<div class="thirteen wide column">
2019-12-10 02:33:05 -05:00
<div class="ui active progress" :data-value="server.State.CPU" data-total="100">
2019-12-09 03:02:49 -05:00
<div class="bar">
<div class="progress"></div>
</div>
</div>
</div>
2019-12-09 10:45:23 -05:00
<div class="three wide column">内存</div>
2019-12-09 03:02:49 -05:00
<div class="thirteen wide column">
2019-12-10 02:33:05 -05:00
<div class="ui active progress" :data-value="server.State.MemUsed"
:data-total="server.State.MemTotal">
2019-12-09 03:02:49 -05:00
<div class="bar">
<div class="progress"></div>
</div>
</div>
</div>
2019-12-09 10:45:23 -05:00
<div class="three wide column">交换</div>
2019-12-09 03:02:49 -05:00
<div class="thirteen wide column">
2019-12-10 02:33:05 -05:00
<div class="ui active progress" :data-value="server.State.SwapUsed"
:data-total="server.State.SwapTotal">
2019-12-09 03:02:49 -05:00
<div class="bar">
<div class="progress"></div>
</div>
</div>
2019-12-08 10:18:29 -05:00
</div>
2019-12-09 05:14:31 -05:00
<div class="three wide column">网络</div>
<div class="thirteen wide column">
2019-12-10 02:33:05 -05:00
<i class="arrow alternate circle down outline icon"></i>
<?server.State.NetInSpeed?>/s
<i class="arrow alternate circle up outline icon"></i>
<?server.State.NetOutSpeed?>/s
2019-12-09 10:45:23 -05:00
</div>
<div class="three wide column">硬盘</div>
<div class="thirteen wide column">
2019-12-10 02:33:05 -05:00
<div class="ui active progress" :data-value="server.State.DiskUsed"
:data-total="server.State.DiskTotal">
2019-12-09 10:45:23 -05:00
<div class="bar">
<div class="progress"></div>
</div>
</div>
</div>
<div class="three wide column">在线</div>
<div class="thirteen wide column">
2019-12-10 02:33:05 -05:00
<i class="clock icon"></i>
<?server.State.Uptime?>
2019-12-09 05:14:31 -05:00
</div>
2019-12-08 10:18:29 -05:00
</div>
</div>
</div>
</div>
</div>
2019-12-08 03:59:58 -05:00
</div>
</div>
{{template "common/footer" .}}
2019-12-09 05:14:31 -05:00
<script>
2019-12-10 02:33:05 -05:00
const servers = {{.Servers }};
var statusCards = new Vue({
el: 'div.status.cards',
delimiters: ['<?', '?>'],
data: {
servers,
},
mounted() {
$('.progress').progress();
$('.yellow.info.icon').popup({
popup: '.ui.content.popup'
});
},
methods: {
}
});
2019-12-09 05:14:31 -05:00
</script>
2019-12-08 03:59:58 -05:00
{{end}}