From 6eff8fde74e01fa3527585ec1fbd3629d51bc97a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 9 Jun 2018 01:45:25 +0900 Subject: サーバーの統計情報をメモリに記憶するようにするなど MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/common/views/widgets/server.cpu-memory.vue | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/client/app/common') 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)); } } }); -- cgit v1.2.3-freya