summaryrefslogtreecommitdiff
path: root/src/client/app/desktop/views/components/settings.drive.vue
blob: 8bb0c760a73f202890ecb10e35f5f3ca115899f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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>