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