mirror of
https://github.com/Noratrieb/does-it-build.git
synced 2026-01-14 10:25:01 +01:00
Store more metadata
And other various improvements
This commit is contained in:
parent
f6fac25c6f
commit
7f1702bc28
11 changed files with 75 additions and 55 deletions
16
src/web.rs
16
src/web.rs
|
|
@ -53,6 +53,9 @@ async fn web_build(State(state): State<AppState>, Query(query): Query<BuildQuery
|
|||
rustflags: Option<String>,
|
||||
version: &'static str,
|
||||
status: Status,
|
||||
build_date: Option<String>,
|
||||
build_duration_s: Option<f32>,
|
||||
does_it_build_version: Option<String>,
|
||||
}
|
||||
|
||||
match state
|
||||
|
|
@ -73,6 +76,19 @@ async fn web_build(State(state): State<AppState>, Query(query): Query<BuildQuery
|
|||
rustflags: build.rustflags,
|
||||
version: crate::VERSION,
|
||||
status: build.status,
|
||||
build_date: build.build_date.map(|build_date| {
|
||||
time::OffsetDateTime::from_unix_timestamp_nanos(build_date as i128 * 1000000)
|
||||
.map(|build_date| {
|
||||
build_date
|
||||
.format(&time::format_description::well_known::Rfc3339)
|
||||
.unwrap()
|
||||
})
|
||||
.unwrap()
|
||||
}),
|
||||
build_duration_s: build
|
||||
.build_duration_ms
|
||||
.map(|build_duration_ms| (build_duration_ms as f32) / 1000.0),
|
||||
does_it_build_version: build.does_it_build_version,
|
||||
};
|
||||
Html(page.render().unwrap()).into_response()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue