switching to a zip for results
This commit is contained in:
@@ -11,6 +11,7 @@ dioxus-sdk-time = "0.7.0"
|
|||||||
dioxus-primitives = { git = "https://github.com/DioxusLabs/components", version = "0.0.1", default-features = false }
|
dioxus-primitives = { git = "https://github.com/DioxusLabs/components", version = "0.0.1", default-features = false }
|
||||||
reqwest = "0.12.25"
|
reqwest = "0.12.25"
|
||||||
strum = { version = "0.27.2", default-features = false, features = ["derive"] }
|
strum = { version = "0.27.2", default-features = false, features = ["derive"] }
|
||||||
|
async_zip = { version = "0.0.18", features = ["full-wasm"] }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["web"]
|
default = ["web"]
|
||||||
|
|||||||
BIN
assets/results.zip
git.filemode.normal_file
BIN
assets/results.zip
git.filemode.normal_file
Binary file not shown.
@@ -737,10 +737,15 @@ fn PaginationPlaceholder(small: bool) -> Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn get_results() -> Result<String> {
|
async fn get_results() -> Result<String> {
|
||||||
Ok(
|
use async_zip::base::read::mem::ZipFileReader;
|
||||||
reqwest::get(format!("{}/assets/results.csv", std::env!("URL")))
|
let archive = reqwest::get(format!("{}/assets/results.zip", std::env!("URL")))
|
||||||
.await?
|
.await?
|
||||||
.text()
|
.bytes()
|
||||||
.await?,
|
.await?
|
||||||
)
|
.to_vec();
|
||||||
|
let zip = ZipFileReader::new(archive).await?;
|
||||||
|
let mut string = String::new();
|
||||||
|
let mut reader = zip.reader_with_entry(0).await?;
|
||||||
|
reader.read_to_string_checked(&mut string).await?;
|
||||||
|
Ok(string)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const FAVICON: Asset = asset!("/assets/favicon.ico");
|
|||||||
const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css");
|
const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css");
|
||||||
const COMPONENTS_CSS: Asset = asset!("/assets/dx-components-theme.css");
|
const COMPONENTS_CSS: Asset = asset!("/assets/dx-components-theme.css");
|
||||||
const RESULT: Asset = asset!(
|
const RESULT: Asset = asset!(
|
||||||
"/assets/results.csv",
|
"/assets/results.zip",
|
||||||
AssetOptions::builder().with_hash_suffix(false)
|
AssetOptions::builder().with_hash_suffix(false)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user