2018-02-19 16:56:39 -06:00
|
|
|
<template>
|
|
|
|
<div class="uptimes">
|
|
|
|
<p>Uptimes</p>
|
2018-12-15 16:06:43 -06:00
|
|
|
<p>Process: {{ process }}</p>
|
|
|
|
<p>OS: {{ os }}</p>
|
2018-02-19 16:56:39 -06:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-12-15 16:06:43 -06:00
|
|
|
import formatUptime from '../../scripts/format-uptime';
|
2018-02-19 16:56:39 -06:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
props: ['connection'],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
process: 0,
|
|
|
|
os: 0
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.connection.on('stats', this.onStats);
|
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
this.connection.off('stats', this.onStats);
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onStats(stats) {
|
2018-12-15 16:06:43 -06:00
|
|
|
this.process = formatUptime(stats.process_uptime);
|
|
|
|
this.os = formatUptime(stats.os_uptime);
|
2018-02-19 16:56:39 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
.uptimes
|
|
|
|
padding 10px 14px
|
|
|
|
|
|
|
|
> p
|
|
|
|
margin 0
|
|
|
|
font-size 12px
|
2018-12-27 13:26:32 -06:00
|
|
|
color var(--text)
|
2018-02-19 16:56:39 -06:00
|
|
|
|
|
|
|
&:first-child
|
|
|
|
font-weight bold
|
|
|
|
</style>
|