mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
feat: measure and display user quota (#72)
This commit is contained in:
@@ -406,6 +406,7 @@ angular
|
||||
$http.get("/api/user").then(
|
||||
(res) => {
|
||||
if (res) $scope.user = res.data;
|
||||
getQuota();
|
||||
},
|
||||
() => {
|
||||
$scope.user = null;
|
||||
@@ -425,6 +426,22 @@ angular
|
||||
);
|
||||
}
|
||||
getOptions();
|
||||
function getQuota() {
|
||||
$http.get("/api/user/quota").then((res) => {
|
||||
$scope.quota = res.data;
|
||||
$scope.quota.storage.percent = $scope.quota.storage.total
|
||||
? ($scope.quota.storage.used * 100) / $scope.quota.storage.total
|
||||
: 100;
|
||||
$scope.quota.file.percent = $scope.quota.file.total
|
||||
? ($scope.quota.file.used * 100) / $scope.quota.file.total
|
||||
: 100;
|
||||
$scope.quota.repository.percent = $scope.quota.repository.total
|
||||
? ($scope.quota.repository.used * 100) /
|
||||
$scope.quota.repository.total
|
||||
: 100;
|
||||
}, console.error);
|
||||
}
|
||||
getQuota();
|
||||
|
||||
function getMessage() {
|
||||
$http.get("/api/message").then(
|
||||
@@ -605,13 +622,6 @@ angular
|
||||
}
|
||||
getRepositories();
|
||||
|
||||
function getQuota() {
|
||||
$http.get("/api/user/quota").then((res) => {
|
||||
$scope.quota = res.data;
|
||||
}, console.error);
|
||||
}
|
||||
// getQuota();
|
||||
|
||||
$scope.removeRepository = (repo) => {
|
||||
if (
|
||||
confirm(
|
||||
|
||||
Reference in New Issue
Block a user