diff --git a/src/main.rs b/src/main.rs index 7b5530a..a35c912 100644 --- a/src/main.rs +++ b/src/main.rs @@ -137,7 +137,7 @@ impl PictrsPage { } impl PictrsClient { - async fn page(&self, slug: Option) -> Result { + async fn page(&self, query: &PageQuery) -> Result { let mut url = self.pict_rs_endpoint.clone(); url.set_path("/internal/hashes"); @@ -145,7 +145,7 @@ impl PictrsClient { .client .get(url.as_str()) .header("x-api-token", &self.pict_rs_api_key) - .query(&PageQuery { slug }) + .query(query) .send() .await?; @@ -190,13 +190,17 @@ impl PictrsClient { #[derive(Debug, serde::Deserialize, serde::Serialize)] struct PageQuery { slug: Option, + timestamp: Option, } async fn index( - web::Query(PageQuery { slug }): web::Query, + web::Query(query): web::Query, client: web::Data, ) -> Result { - let page = client.page(slug).await.map_err(ErrorInternalServerError)?; + let page = client + .page(&query) + .await + .map_err(ErrorInternalServerError)?; let page = match page { PageResponse::Ok { page, .. } => page, diff --git a/static/index.css b/static/index.css index aa4417a..8cfc21b 100644 --- a/static/index.css +++ b/static/index.css @@ -22,6 +22,17 @@ nav a { padding: 8px 16px; } +nav form { + display: inline-block; +} + +nav input { + padding: 8px; +} +nav input[type="submit"] { + padding: 8px 16px; +} + section { display: flex; flex-wrap: wrap; diff --git a/templates/index.rs.html b/templates/index.rs.html index 6046455..f49ada3 100644 --- a/templates/index.rs.html +++ b/templates/index.rs.html @@ -14,7 +14,6 @@ - @if page.prev_link().is_some() || page.next_link().is_some() { - }
@if page.hashes.is_empty() {