mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-15 14:38:03 +02:00
feat: measure and display user quota (#72)
This commit is contained in:
@@ -152,6 +152,67 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-1 mr-1" style="margin-top: -0.25rem !important">
|
||||
<strong>Repository</strong>
|
||||
<div class="progress" style="min-width: 150px">
|
||||
<div
|
||||
class="progress-bar"
|
||||
ng-class="{'progress-bar-striped progress-bar-animated w-100 bg-dark': !quota, 'bg-success': quota.repository.percent < 25 || quota.repository.total == 0, 'bg-danger': quota.repository.percent > 95 && quota.repository.total > 0, 'bg-warning': quota.repository.percent > 75 && quota.repository.total > 0 }"
|
||||
role="progressbar"
|
||||
style="width: {{quota.repository.percent}}%;"
|
||||
aria-valuenow="{{quota.repository.used}}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="{{quota.repository.total}}"
|
||||
>
|
||||
<span ng-show="quota"
|
||||
>{{quota.repository.used |
|
||||
number}}/{{quota.repository.total}}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-1 mr-1" style="margin-top: -0.25rem !important">
|
||||
<strong>Storage</strong>
|
||||
<div class="progress" style="min-width: 150px">
|
||||
<div
|
||||
class="progress-bar"
|
||||
ng-class="{'progress-bar-striped progress-bar-animated w-100 bg-dark': !quota, 'bg-success': quota.storage.percent < 25 || quota.storage.total == 0, 'bg-danger': quota.storage.percent > 95 && quota.storage.total > 0, 'bg-warning': quota.storage.percent > 75 && quota.storage.total > 0 }"
|
||||
role="progressbar"
|
||||
style="width: {{quota.storage.percent}}%;"
|
||||
aria-valuenow="{{quota.storage.used}}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="{{quota.storage.total}}"
|
||||
>
|
||||
<span ng-show="quota"
|
||||
>{{quota.storage.used |
|
||||
humanFileSize}}/{{quota.storage.total|
|
||||
humanFileSize}}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-1 mr-1" style="margin-top: -0.25rem !important">
|
||||
<strong>File</strong>
|
||||
<div class="progress" style="min-width: 150px">
|
||||
<div
|
||||
class="progress-bar"
|
||||
ng-class="{'progress-bar-striped progress-bar-animated w-100 bg-dark': !quota, 'bg-success': quota.file.percent < 25 || quota.file.total == 0, 'bg-danger': quota.file.percent > 95 && quota.file.total > 0, 'bg-warning': quota.file.percent > 75 && quota.file.total > 0 }"
|
||||
role="progressbar"
|
||||
style="width: {{quota.file.percent}}%;"
|
||||
aria-valuenow="{{quota.file.used}}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="{{quota.file.total}}"
|
||||
>
|
||||
<span ng-show="quota"
|
||||
>{{quota.file.used | number}}/{{quota.file.total ||
|
||||
"∞"}}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -235,7 +296,7 @@
|
||||
data-toggle="tooltip"
|
||||
data-placement="bottom"
|
||||
>
|
||||
<i class="fas fa-database"></i> {{::repo.size |
|
||||
<i class="fas fa-database"></i> {{::repo.size.storage |
|
||||
humanFileSize}}</span
|
||||
>
|
||||
<span
|
||||
|
||||
@@ -1,4 +1,56 @@
|
||||
<div class="container py-4">
|
||||
<h2>Quota</h2>
|
||||
<h3>Quota</h3>
|
||||
<h5>Repository</h5>
|
||||
<div class="progress">
|
||||
<div
|
||||
class="progress-bar"
|
||||
ng-class="{'progress-bar-striped progress-bar-animated w-100 bg-dark': !quota, 'bg-success': quota.repository.percent < 25 || quota.repository.total == 0, 'bg-danger': quota.repository.percent > 95 && quota.repository.total > 0, 'bg-warning': quota.repository.percent > 75 && quota.repository.total > 0 }"
|
||||
role="progressbar"
|
||||
style="width: {{quota.repository.percent}}%;"
|
||||
aria-valuenow="{{quota.repository.used}}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="{{quota.repository.total}}"
|
||||
>
|
||||
<span ng-show="quota"
|
||||
>{{quota.repository.used | number}}/{{quota.repository.total}}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<h5>Storage</h5>
|
||||
<div class="progress">
|
||||
<div
|
||||
class="progress-bar"
|
||||
ng-class="{'progress-bar-striped progress-bar-animated w-100 bg-dark': !quota, 'bg-success': quota.storage.percent < 25 || quota.storage.total == 0, 'bg-danger': quota.storage.percent > 95 && quota.storage.total > 0, 'bg-warning': quota.storage.percent > 75 && quota.storage.total > 0 }"
|
||||
role="progressbar"
|
||||
style="width: {{quota.storage.percent}}%;"
|
||||
aria-valuenow="{{quota.storage.used}}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="{{quota.storage.total}}"
|
||||
>
|
||||
<span ng-show="quota"
|
||||
>{{quota.storage.used | humanFileSize}}/{{quota.storage.total|
|
||||
humanFileSize}}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<h5>File</h5>
|
||||
<div class="progress">
|
||||
<div
|
||||
class="progress-bar"
|
||||
ng-class="{'progress-bar-striped progress-bar-animated w-100 bg-dark': !quota, 'bg-success': quota.file.percent < 25 || quota.file.total == 0, 'bg-danger': quota.file.percent > 95 && quota.file.total > 0, 'bg-warning': quota.file.percent > 75 && quota.file.total > 0 }"
|
||||
role="progressbar"
|
||||
style="width: {{quota.file.percent}}%;"
|
||||
aria-valuenow="{{quota.file.used}}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="{{quota.file.total}}"
|
||||
>
|
||||
<span ng-show="quota"
|
||||
>{{quota.file.used | number}}/{{quota.file.total || "∞"}}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Default anonymization options</h2>
|
||||
<form class="form needs-validation" name="default" novalidate>
|
||||
<!-- Terms -->
|
||||
|
||||
Reference in New Issue
Block a user