diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-11-16 05:26:36 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-11-16 05:26:36 +0900 |
| commit | a86ae9fa50ecb0767657ece666819126fb1cf933 (patch) | |
| tree | b4099d9195b1e6029768047e5da4d823e47a8585 /src/client | |
| parent | [Client] Improve admin dashboard (diff) | |
| download | sharkey-a86ae9fa50ecb0767657ece666819126fb1cf933.tar.gz sharkey-a86ae9fa50ecb0767657ece666819126fb1cf933.tar.bz2 sharkey-a86ae9fa50ecb0767657ece666819126fb1cf933.zip | |
Better UX
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/admin/views/dashboard.vue | 2 | ||||
| -rw-r--r-- | src/client/app/mios.ts | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/client/app/admin/views/dashboard.vue b/src/client/app/admin/views/dashboard.vue index 2a6d9a3101..3fd024a133 100644 --- a/src/client/app/admin/views/dashboard.vue +++ b/src/client/app/admin/views/dashboard.vue @@ -148,7 +148,7 @@ export default Vue.extend({ }, updateStats() { - this.$root.api('stats').then(stats => { + this.$root.api('stats', {}, false, true).then(stats => { this.stats = stats; }); } diff --git a/src/client/app/mios.ts b/src/client/app/mios.ts index 2f5dcde159..5ed4dfd4db 100644 --- a/src/client/app/mios.ts +++ b/src/client/app/mios.ts @@ -385,15 +385,19 @@ export default class MiOS extends EventEmitter { * @param data パラメータ */ @autobind - public api(endpoint: string, data: { [x: string]: any } = {}, forceFetch = false): Promise<{ [x: string]: any }> { - if (++pending === 1) { - spinner = document.createElement('div'); - spinner.setAttribute('id', 'wait'); - document.body.appendChild(spinner); + public api(endpoint: string, data: { [x: string]: any } = {}, forceFetch = false, silent = false): Promise<{ [x: string]: any }> { + if (!silent) { + if (++pending === 1) { + spinner = document.createElement('div'); + spinner.setAttribute('id', 'wait'); + document.body.appendChild(spinner); + } } const onFinally = () => { - if (--pending === 0) spinner.parentNode.removeChild(spinner); + if (!silent) { + if (--pending === 0) spinner.parentNode.removeChild(spinner); + } }; const promise = new Promise((resolve, reject) => { |