2019-09-09 17:00:25 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="remaining-space-container">
|
|
|
|
<p class="remaining-space-container__title">{{label}}</p>
|
2019-10-04 18:30:31 +01:00
|
|
|
<p class="remaining-space-container__amount"><b>{{remaining}}</b></p>
|
2019-09-09 17:00:25 +01:00
|
|
|
<div class="remaining-space-container__bar">
|
2019-09-30 16:17:30 +01:00
|
|
|
<VInfo :text="infoMessage">
|
2019-10-02 11:26:50 +01:00
|
|
|
<VBar
|
|
|
|
:current="currentBarAmount"
|
|
|
|
:max="maxBarAmount"
|
|
|
|
color="#224CA5"
|
|
|
|
/>
|
2019-09-30 16:17:30 +01:00
|
|
|
</VInfo>
|
2019-09-09 17:00:25 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
|
|
|
|
2019-09-30 16:17:30 +01:00
|
|
|
import VBar from '@/app/components/VBar.vue';
|
|
|
|
import VInfo from '@/app/components/VInfo.vue';
|
2019-10-25 10:53:35 +01:00
|
|
|
|
2019-10-04 18:30:31 +01:00
|
|
|
import { formatBytes } from '@/app/utils/converter';
|
2019-09-09 17:00:25 +01:00
|
|
|
|
|
|
|
@Component ({
|
|
|
|
components: {
|
2019-09-30 16:17:30 +01:00
|
|
|
VBar,
|
|
|
|
VInfo,
|
2019-09-09 17:00:25 +01:00
|
|
|
},
|
|
|
|
})
|
2019-09-30 16:17:30 +01:00
|
|
|
export default class BarInfo extends Vue {
|
2019-09-09 17:00:25 +01:00
|
|
|
@Prop({default: ''})
|
|
|
|
private readonly label: string;
|
|
|
|
@Prop({default: ''})
|
|
|
|
private readonly amount: number;
|
|
|
|
@Prop({default: ''})
|
|
|
|
private readonly infoText: string;
|
|
|
|
@Prop({default: ''})
|
|
|
|
private readonly currentBarAmount: number;
|
|
|
|
@Prop({default: ''})
|
|
|
|
private readonly maxBarAmount: number;
|
|
|
|
|
|
|
|
public get infoMessage(): string {
|
|
|
|
return `${Math.floor(100 - (this.currentBarAmount / this.maxBarAmount) * 100)}% ${this.infoText}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
public get remaining(): string {
|
2019-10-04 18:30:31 +01:00
|
|
|
return formatBytes(this.amount);
|
2019-09-09 17:00:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2019-10-11 17:28:47 +01:00
|
|
|
<style scoped lang="scss">
|
|
|
|
p {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
2019-09-09 17:00:25 +01:00
|
|
|
.remaining-space-container {
|
2019-10-11 17:28:47 +01:00
|
|
|
width: 339px;
|
|
|
|
height: 99px;
|
2019-09-09 17:00:25 +01:00
|
|
|
background-color: #FFFFFF;
|
|
|
|
border: 1px solid #E9EFF4;
|
|
|
|
border-radius: 11px;
|
2019-10-11 17:28:47 +01:00
|
|
|
padding: 32px 30px;
|
|
|
|
margin-bottom: 13px;
|
2019-09-09 17:00:25 +01:00
|
|
|
position: relative;
|
|
|
|
|
|
|
|
&__title {
|
|
|
|
font-size: 14px;
|
2019-10-11 17:28:47 +01:00
|
|
|
line-height: 21px;
|
2019-09-09 17:00:25 +01:00
|
|
|
color: #586C86;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__amount {
|
|
|
|
font-size: 32px;
|
|
|
|
line-height: 57px;
|
|
|
|
color: #535F77;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|