mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
improve dashboard
This commit is contained in:
@@ -71,7 +71,8 @@
|
||||
Claim repository
|
||||
</a>
|
||||
<a class="btn btn-primary" href="/anonymize">
|
||||
Annoymize repository
|
||||
<i class="fa fa-plus-circle" aria-hidden="true"></i> Annoymize
|
||||
repository
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -114,7 +115,7 @@
|
||||
<td>{{repo.branch}}</td>
|
||||
<!-- <td>{{repo.commit.substring(0, 6)}}</td> -->
|
||||
<td class="text-center">{{repo.terms.length}}</td>
|
||||
<td class="text-center">{{repo.status}}</td>
|
||||
<td class="text-center">{{repo.status | title}}</td>
|
||||
<td class="text-center">{{repo.anonymizeDate | date}}</td>
|
||||
<td class="text-center">{{repo.pageView}}</td>
|
||||
<td class="text-center">{{repo.lastView | date}}</td>
|
||||
@@ -138,35 +139,49 @@
|
||||
class="dropdown-item"
|
||||
href="/anonymize/{{repo.repoId}}"
|
||||
target="_self"
|
||||
>Edit</a
|
||||
>
|
||||
<i class="fa fa-edit" aria-hidden="true"></i> Edit
|
||||
</a>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
href="#"
|
||||
ng-show="repo.status == 'ready'"
|
||||
ng-click="updateRepository(repo)"
|
||||
>Force update</a
|
||||
>
|
||||
<i class="fa fa-undo" aria-hidden="true"></i> Force
|
||||
update
|
||||
</a>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
href="#"
|
||||
ng-show="repo.status == 'removed'"
|
||||
ng-click="updateRepository(repo)"
|
||||
>Enable</a
|
||||
>
|
||||
<i class="fa fa-check-circle" aria-hidden="true"></i> Enable
|
||||
</a>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
href="#"
|
||||
ng-show="repo.status != 'removed'"
|
||||
ng-click="removeRepository(repo)"
|
||||
>Remove</a
|
||||
>
|
||||
<i class="fa fa-remove" aria-hidden="true"></i> Remove
|
||||
</a>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
href="/r/{{repo.repoId}}"
|
||||
target="_self"
|
||||
>View</a
|
||||
>
|
||||
<i class="fa fa-eye" aria-hidden="true"></i> View Repo
|
||||
</a>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
href="/w/{{repo.repoId}}"
|
||||
target="_self"
|
||||
ng-if="repo.options.page"
|
||||
>
|
||||
<i class="fa fa-globe" aria-hidden="true"></i> View Page
|
||||
</a>
|
||||
<a
|
||||
class="dropdown-item"
|
||||
href="/w/{{repo.repoId}}"
|
||||
|
||||
@@ -61,6 +61,19 @@ angular
|
||||
return result;
|
||||
};
|
||||
})
|
||||
.filter("title", function() {
|
||||
return function(str) {
|
||||
if (!str) return str;
|
||||
|
||||
str = str.toLowerCase();
|
||||
var words = str.split(" ");
|
||||
|
||||
var capitalized = words.map(function(word) {
|
||||
return word.charAt(0).toUpperCase() + word.substring(1, word.length);
|
||||
});
|
||||
return capitalized.join(" ");
|
||||
};
|
||||
})
|
||||
.controller("mainController", function($scope, $http, $location) {
|
||||
$scope.title = "Main";
|
||||
$scope.user = { status: "connection" };
|
||||
|
||||
@@ -152,7 +152,8 @@ router.delete("/:repoId/", async (req, res) => {
|
||||
try {
|
||||
await repoUtils.updateStatus(repoConfig, "removed");
|
||||
await repoUtils.removeRepository(repoConfig);
|
||||
return res.send("ok");
|
||||
console.log(`${req.params.repoId} is removed`);
|
||||
return res.json("ok");
|
||||
} catch (error) {
|
||||
return res.status(500).json({ error });
|
||||
}
|
||||
|
||||
@@ -43,9 +43,6 @@ router.get("/anonymized_repositories", async (req, res) => {
|
||||
) {
|
||||
await repoUtils.updateStatus({ repoId: repo.repoId }, "expired");
|
||||
repo.status = "expired";
|
||||
} else {
|
||||
await repoUtils.updateStatus({ repoId: repo.repoId }, "ready");
|
||||
repo.status = "ready";
|
||||
}
|
||||
}
|
||||
res.json(repos);
|
||||
@@ -60,7 +57,7 @@ router.get("/all_repositories", async (req, res) => {
|
||||
{ projection: { repositories: 1 } }
|
||||
);
|
||||
if (!user) {
|
||||
res.status(401).send({error: "user_not_found"});
|
||||
res.status(401).send({ error: "user_not_found" });
|
||||
}
|
||||
if (user.repositories && req.query.force !== "1") {
|
||||
return res.json(user.repositories);
|
||||
|
||||
Reference in New Issue
Block a user