2018-02-19 16:56:39 -06:00
|
|
|
<template>
|
|
|
|
<div class="cpu">
|
|
|
|
<x-pie class="pie" :value="usage"/>
|
|
|
|
<div>
|
2018-11-05 10:40:11 -06:00
|
|
|
<p><fa icon="microchip"/>CPU</p>
|
2018-11-19 14:30:22 -06:00
|
|
|
<p>{{ meta.cpu.cores }} Logical cores</p>
|
2018-02-21 09:07:37 -06:00
|
|
|
<p>{{ meta.cpu.model }}</p>
|
2018-02-19 16:56:39 -06:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import XPie from './server.pie.vue';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
components: {
|
2018-02-20 10:39:51 -06:00
|
|
|
XPie
|
2018-02-19 16:56:39 -06:00
|
|
|
},
|
|
|
|
props: ['connection', 'meta'],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
usage: 0
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.connection.on('stats', this.onStats);
|
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
this.connection.off('stats', this.onStats);
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onStats(stats) {
|
|
|
|
this.usage = stats.cpu_usage;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2018-09-28 05:59:19 -05:00
|
|
|
.cpu
|
2018-02-19 16:56:39 -06:00
|
|
|
> .pie
|
|
|
|
padding 10px
|
|
|
|
height 100px
|
|
|
|
float left
|
|
|
|
|
|
|
|
> div
|
|
|
|
float left
|
|
|
|
width calc(100% - 100px)
|
|
|
|
padding 10px 10px 10px 0
|
|
|
|
|
|
|
|
> p
|
|
|
|
margin 0
|
|
|
|
font-size 12px
|
2018-09-28 05:59:19 -05:00
|
|
|
color var(--chartCaption)
|
2018-02-19 16:56:39 -06:00
|
|
|
|
|
|
|
&:first-child
|
|
|
|
font-weight bold
|
|
|
|
|
2018-11-05 10:40:11 -06:00
|
|
|
> [data-icon]
|
2018-02-19 16:56:39 -06:00
|
|
|
margin-right 4px
|
|
|
|
|
|
|
|
&:after
|
|
|
|
content ""
|
|
|
|
display block
|
|
|
|
clear both
|
|
|
|
|
|
|
|
</style>
|