diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-06-09 01:45:25 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-06-09 01:45:25 +0900 |
| commit | 6eff8fde74e01fa3527585ec1fbd3629d51bc97a (patch) | |
| tree | 55c39e88edb7e68f1928554b85bd036c96bc7ed8 /src/client/app | |
| parent | Merge pull request #1685 from 2vg/patch-1 (diff) | |
| download | sharkey-6eff8fde74e01fa3527585ec1fbd3629d51bc97a.tar.gz sharkey-6eff8fde74e01fa3527585ec1fbd3629d51bc97a.tar.bz2 sharkey-6eff8fde74e01fa3527585ec1fbd3629d51bc97a.zip | |
サーバーの統計情報をメモリに記憶するようにするなど
Diffstat (limited to 'src/client/app')
| -rw-r--r-- | src/client/app/common/views/widgets/server.cpu-memory.vue | 9 |
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)); } } }); |