diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-03-05 18:37:12 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-03-05 18:37:12 +0900 |
| commit | 6374ddfc6841ef4aecfc10c117122e25801d220d (patch) | |
| tree | 63042efea343ddb748258dca26dd22ea61f10ce5 /src/web | |
| parent | v3986 (diff) | |
| download | sharkey-6374ddfc6841ef4aecfc10c117122e25801d220d.tar.gz sharkey-6374ddfc6841ef4aecfc10c117122e25801d220d.tar.bz2 sharkey-6374ddfc6841ef4aecfc10c117122e25801d220d.zip | |
:v:
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/app/desktop/views/components/settings.drive.vue | 35 | ||||
| -rw-r--r-- | src/web/app/desktop/views/components/settings.vue | 6 |
2 files changed, 39 insertions, 2 deletions
diff --git a/src/web/app/desktop/views/components/settings.drive.vue b/src/web/app/desktop/views/components/settings.drive.vue new file mode 100644 index 0000000000..8bb0c760a7 --- /dev/null +++ b/src/web/app/desktop/views/components/settings.drive.vue @@ -0,0 +1,35 @@ +<template> +<div class="root"> + <template v-if="!fetching"> + <el-progress :text-inside="true" :stroke-width="18" :percentage="Math.floor((usage / capacity) * 100)"/> + <p><b>{{ capacity | bytes }}</b>中<b>{{ usage | bytes }}</b>使用中</p> + </template> +</div> +</template> + +<script lang="ts"> +import Vue from 'vue'; +export default Vue.extend({ + data() { + return { + fetching: true, + usage: null, + capacity: null + }; + }, + mounted() { + (this as any).api('drive').then(info => { + this.capacity = info.capacity; + this.usage = info.usage; + this.fetching = false; + }); + } +}); +</script> + +<style lang="stylus" scoped> +.root + > p + > b + margin 0 8px +</style> diff --git a/src/web/app/desktop/views/components/settings.vue b/src/web/app/desktop/views/components/settings.vue index 096ba57fd7..a2c929152e 100644 --- a/src/web/app/desktop/views/components/settings.vue +++ b/src/web/app/desktop/views/components/settings.vue @@ -71,7 +71,7 @@ <section class="drive" v-show="page == 'drive'"> <h1>%i18n:desktop.tags.mk-settings.drive%</h1> - <mk-drive-setting/> + <x-drive/> </section> <section class="mute" v-show="page == 'mute'"> @@ -163,6 +163,7 @@ import X2fa from './settings.2fa.vue'; import XApi from './settings.api.vue'; import XApps from './settings.apps.vue'; import XSignins from './settings.signins.vue'; +import XDrive from './settings.drive.vue'; import { docsUrl, license, lang, version } from '../../../config'; import checkForUpdate from '../../../common/scripts/check-for-update'; @@ -174,7 +175,8 @@ export default Vue.extend({ X2fa, XApi, XApps, - XSignins + XSignins, + XDrive }, data() { return { |