1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-21 18:18:20 +09:00
cherrypick/src/client/app/common/views/widgets/server.uptimes.vue

48 lines
761 B
Vue
Raw Normal View History

2018-02-20 07:56:39 +09:00
<template>
<div class="uptimes">
<p>Uptimes</p>
<p>Process: {{ process }}</p>
<p>OS: {{ os }}</p>
2018-02-20 07:56:39 +09:00
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import formatUptime from '../../scripts/format-uptime';
2018-02-20 07:56:39 +09: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) {
this.process = formatUptime(stats.process_uptime);
this.os = formatUptime(stats.os_uptime);
2018-02-20 07:56:39 +09:00
}
}
});
</script>
<style lang="stylus" scoped>
.uptimes
padding 10px 14px
> p
margin 0
font-size 12px
color #505050
&:first-child
font-weight bold
</style>