-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Intruduce own component for the space quota, minor adjustments
- Loading branch information
1 parent
2543c5f
commit c2aafe8
Showing
7 changed files
with
72 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
Enhancement: Implement the right sidebar for spaces | ||
|
||
The right sidebar for a space functions similar to the files sidebar and gives the user basic information and actions for the current space. | ||
|
||
https://github.com/owncloud/web/pull/6437 | ||
https://github.com/owncloud/web/issues/6284 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<div> | ||
<p class="oc-mb-s oc-mt-rm" v-text="spaceStorageDetailsLabel" /> | ||
<oc-progress | ||
:value="parseInt(quotaUsagePercent)" | ||
:max="100" | ||
size="small" | ||
:variation="quotaProgressVariant" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import filesize from 'filesize' | ||
export default { | ||
name: 'SpaceQuota', | ||
props: { | ||
spaceQuota: { | ||
type: Object, | ||
required: true | ||
} | ||
}, | ||
computed: { | ||
spaceStorageDetailsLabel() { | ||
return this.$gettextInterpolate( | ||
this.$gettext('%{used} of %{total} used (%{percentage} % used)'), | ||
{ | ||
used: this.quotaUsed, | ||
total: this.quotaTotal, | ||
percentage: this.quotaUsagePercent | ||
} | ||
) | ||
}, | ||
quotaTotal() { | ||
return filesize(this.spaceQuota.total) | ||
}, | ||
quotaUsed() { | ||
return filesize(this.spaceQuota.used) | ||
}, | ||
quotaUsagePercent() { | ||
return ((this.spaceQuota.used / this.spaceQuota.total) * 100).toFixed(2) | ||
}, | ||
quotaProgressVariant() { | ||
switch (this.spaceQuota.state) { | ||
case 'normal': | ||
return 'primary' | ||
case 'nearing': | ||
return 'warning' | ||
case 'critical': | ||
return 'warning' | ||
default: | ||
return 'danger' | ||
} | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters