mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 06:10:44 +08:00
Distinguish local repos from seeded ones
A repository can sit in storage without being seeded, which `rad ls` hides and `rad ls --all` shows as "local". A new Settings preference picks the `Show` passed to `list_repos_summary`, defaulting to seeded.
This commit is contained in:
@@ -81,6 +81,7 @@ pub fn router(ctx: Context) -> Router {
|
||||
"/seeded_not_replicated",
|
||||
post(seeded_not_replicated_handler),
|
||||
)
|
||||
.route("/seed", post(seed_handler))
|
||||
.route("/unseed", post(unseed_handler))
|
||||
.route("/clean", post(clean_handler))
|
||||
.route("/repo_by_id", post(repo_handler))
|
||||
@@ -178,6 +179,15 @@ async fn seeded_not_replicated_handler(State(ctx): State<Context>) -> impl IntoR
|
||||
Ok::<_, Error>(Json(rids))
|
||||
}
|
||||
|
||||
async fn seed_handler(
|
||||
State(ctx): State<Context>,
|
||||
Json(RepoBody { rid }): Json<RepoBody>,
|
||||
) -> impl IntoResponse {
|
||||
ctx.seed(rid)?;
|
||||
|
||||
Ok::<_, Error>(Json(()))
|
||||
}
|
||||
|
||||
async fn unseed_handler(
|
||||
State(ctx): State<Context>,
|
||||
Json(RepoBody { rid }): Json<RepoBody>,
|
||||
|
||||
Reference in New Issue
Block a user