mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
Add Stop seeding to the sidebar context menu
`rad unseed` only drops the seeding policy and leaves the repository in storage, so while `list_repos_summary` listed everything on disk an unseeded repository never left the sidebar and unseeding looked like it had done nothing. That call now filters by seeding policy. The confirmation dialog also offers to delete the files, running the equivalent of `rad clean` after the unseed. Co-authored-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
co-authored by
Rūdolfs Ošiņš
parent
f4ab2544ae
commit
fe37d6a85c
@@ -81,6 +81,8 @@ pub fn router(ctx: Context) -> Router {
|
||||
"/seeded_not_replicated",
|
||||
post(seeded_not_replicated_handler),
|
||||
)
|
||||
.route("/unseed", post(unseed_handler))
|
||||
.route("/clean", post(clean_handler))
|
||||
.route("/repo_by_id", post(repo_handler))
|
||||
.route("/list_repo_refs", post(list_repo_refs_handler))
|
||||
.route("/version", post(version_handler))
|
||||
@@ -172,6 +174,24 @@ async fn seeded_not_replicated_handler(State(ctx): State<Context>) -> impl IntoR
|
||||
Ok::<_, Error>(Json(rids))
|
||||
}
|
||||
|
||||
async fn unseed_handler(
|
||||
State(ctx): State<Context>,
|
||||
Json(RepoBody { rid }): Json<RepoBody>,
|
||||
) -> impl IntoResponse {
|
||||
ctx.unseed(rid)?;
|
||||
|
||||
Ok::<_, Error>(Json(()))
|
||||
}
|
||||
|
||||
async fn clean_handler(
|
||||
State(ctx): State<Context>,
|
||||
Json(RepoBody { rid }): Json<RepoBody>,
|
||||
) -> impl IntoResponse {
|
||||
ctx.clean(rid)?;
|
||||
|
||||
Ok::<_, Error>(Json(()))
|
||||
}
|
||||
|
||||
async fn list_notifications_handler() -> impl IntoResponse {
|
||||
Ok::<_, Error>(Json(Vec::<
|
||||
radicle_types::domain::inbox::models::notification::NotificationsByRepo,
|
||||
|
||||
Reference in New Issue
Block a user