summaryrefslogtreecommitdiff
path: root/src/client/app/common
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-06-09 01:45:25 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-06-09 01:45:25 +0900
commit6eff8fde74e01fa3527585ec1fbd3629d51bc97a (patch)
tree55c39e88edb7e68f1928554b85bd036c96bc7ed8 /src/client/app/common
parentMerge pull request #1685 from 2vg/patch-1 (diff)
downloadsharkey-6eff8fde74e01fa3527585ec1fbd3629d51bc97a.tar.gz
sharkey-6eff8fde74e01fa3527585ec1fbd3629d51bc97a.tar.bz2
sharkey-6eff8fde74e01fa3527585ec1fbd3629d51bc97a.zip
サーバーの統計情報をメモリに記憶するようにするなど
Diffstat (limited to 'src/client/app/common')
-rw-r--r--src/client/app/common/views/widgets/server.cpu-memory.vue9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/app/common/views/widgets/server.cpu-memory.vue b/src/client/app/common/views/widgets/server.cpu-memory.vue
index fbd36b255a..6bf998c249 100644
--- a/src/client/app/common/views/widgets/server.cpu-memory.vue
+++ b/src/client/app/common/views/widgets/server.cpu-memory.vue
@@ -76,9 +76,15 @@ export default Vue.extend({
},
mounted() {
this.connection.on('stats', this.onStats);
+ this.connection.on('statsLog', this.onStatsLog);
+ this.connection.send({
+ type: 'requestLog',
+ id: Math.random().toString()
+ });
},
beforeDestroy() {
this.connection.off('stats', this.onStats);
+ this.connection.off('statsLog', this.onStatsLog);
},
methods: {
onStats(stats) {
@@ -94,6 +100,9 @@ export default Vue.extend({
this.cpuP = (stats.cpu_usage * 100).toFixed(0);
this.memP = (stats.mem.used / stats.mem.total * 100).toFixed(0);
+ },
+ onStatsLog(statsLog) {
+ statsLog.forEach(stats => this.onStats(stats));
}
}
});