mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 10:52:53 +00:00
fix: fix action menu in the admin
This commit is contained in:
@@ -196,7 +196,7 @@ export default class Repository {
|
||||
const newCommit = branches.filter((f) => f.name == branch.name)[0]
|
||||
?.commit;
|
||||
if (branch.commit == newCommit && this.status == "ready") {
|
||||
console.log(`${this._model.repoId} is up to date`);
|
||||
console.log(`[UPDATE] ${this._model.repoId} is up to date`);
|
||||
return;
|
||||
}
|
||||
this._model.source.commit = newCommit;
|
||||
@@ -370,7 +370,10 @@ export default class Repository {
|
||||
}
|
||||
|
||||
get originalCachePath() {
|
||||
return join(this._model.repoId, "original") + (process.platform === "win32" ? "\\" : "/");
|
||||
return (
|
||||
join(this._model.repoId, "original") +
|
||||
(process.platform === "win32" ? "\\" : "/")
|
||||
);
|
||||
}
|
||||
|
||||
get status() {
|
||||
|
||||
@@ -139,17 +139,25 @@ router.get("/repos", async (req, res) => {
|
||||
status.push({ status: "download" });
|
||||
}
|
||||
const skipIndex = (page - 1) * limit;
|
||||
const [total, results] = await Promise.all([
|
||||
AnonymizedRepositoryModel.find(
|
||||
{
|
||||
$and: query,
|
||||
},
|
||||
{ originalFiles: 0 }
|
||||
).countDocuments(),
|
||||
AnonymizedRepositoryModel.find({ $and: query }, { originalFiles: 0 })
|
||||
.skip(skipIndex)
|
||||
.sort(sort)
|
||||
.limit(limit)
|
||||
.exec(),
|
||||
]);
|
||||
res.json({
|
||||
query: { $and: query },
|
||||
page,
|
||||
total: await AnonymizedRepositoryModel.find({
|
||||
$and: query,
|
||||
}).countDocuments(),
|
||||
total,
|
||||
sort,
|
||||
results: await AnonymizedRepositoryModel.find({ $and: query })
|
||||
.sort(sort)
|
||||
.limit(limit)
|
||||
.skip(skipIndex),
|
||||
results,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user