Remove inputs related codepaths

This commit is contained in:
2025-08-24 13:38:23 +02:00
parent 334ed4ce9a
commit 5171770f1a
10 changed files with 63 additions and 368 deletions

View File

@@ -24,7 +24,6 @@ use crate::{
Storage,
},
templates::{
FlakeListTemplate,
FlakeTemplate,
IndexTemplate,
RevisionTemplate,
@@ -85,34 +84,29 @@ pub fn make_router(storage: Storage) -> anyhow::Result<Router> {
let app = Router::new()
.route("/", get(route_index))
.route("/flakes", get(route_flakes))
.route("/flakes/{uri}", get(route_flake))
.route("/flakes/{flake_uri}", get(route_flake))
.route("/revisions/{revision_uri}", get(route_revision))
.route("/derivation/{derivation_path}", get(route_revision))
.with_state(state);
Ok(app)
}
async fn route_index() -> Result<impl IntoResponse, AppError> {
Ok(render_template(&IndexTemplate {})?)
}
async fn route_flakes(
async fn route_index(
State(state): State<AppState>,
) -> Result<impl IntoResponse, AppError> {
Ok(render_template(&FlakeListTemplate {
Ok(render_template(&IndexTemplate {
flakes: state.storage.flakes().await?,
})?)
}
async fn route_flake(
State(state): State<AppState>,
Path(uri): Path<String>,
Path(flake_uri): Path<String>,
) -> Result<impl IntoResponse, AppError> {
Ok(render_template(&FlakeTemplate {
uri: uri.clone(),
revisions: state.storage.revisions_from_flake(&uri).await?,
current_inputs: state.storage.current_inputs_for_flake(&uri).await?,
flake_uri: flake_uri.clone(),
revisions: state.storage.revisions_from_flake(&flake_uri).await?,
})?)
}
@@ -123,7 +117,6 @@ async fn route_revision(
Ok(render_template(&RevisionTemplate {
revision_uri: revision_uri.clone(),
inputs: state.storage.inputs_for_revision(&revision_uri).await?,
input_of: state.storage.input_of_for_revision(&revision_uri).await?,
revision: state.storage.revision(&revision_uri).await?,
})?)
}