属实是神奇
This commit is contained in:
parent
df92d7d31f
commit
40752741c1
@ -8,6 +8,7 @@ SELECT
|
|||||||
md.blake_hash,
|
md.blake_hash,
|
||||||
md.xml_tested,
|
md.xml_tested,
|
||||||
md.len,
|
md.len,
|
||||||
|
md.time,
|
||||||
CASE
|
CASE
|
||||||
WHEN md.len > 1024 THEN
|
WHEN md.len > 1024 THEN
|
||||||
ld.text
|
ld.text
|
||||||
|
@ -194,11 +194,14 @@ const INFO_PAGE: &str = include_str!("info.html");
|
|||||||
|
|
||||||
async fn dashboard_page(State(db): State<DatabaseConnection>) -> Html<String> {
|
async fn dashboard_page(State(db): State<DatabaseConnection>) -> Html<String> {
|
||||||
let max_id = db_part::search::max_id(&db).await;
|
let max_id = db_part::search::max_id(&db).await;
|
||||||
let max_id_data = DbData::from_db(max_id, &db).await.unwrap();
|
let max_id_data = DbData::from_db(max_id, &db).await;
|
||||||
let max_ship = db_part::search::max_ship(&db).await;
|
let max_ship = db_part::search::max_ship(&db).await;
|
||||||
let max_save = db_part::search::max_save(&db).await;
|
let max_save = db_part::search::max_save(&db).await;
|
||||||
|
|
||||||
let mut page_content = INFO_PAGE
|
let mut page_content = INFO_PAGE.replace("|MAX_ID|", &max_id.to_string());
|
||||||
|
|
||||||
|
if let Some(max_id_data) = max_id_data {
|
||||||
|
page_content = page_content
|
||||||
.replace("|MAX_ID|", &max_id_data.save_id.to_string())
|
.replace("|MAX_ID|", &max_id_data.save_id.to_string())
|
||||||
.replace(
|
.replace(
|
||||||
"|MAX_SAVE_TYPE|",
|
"|MAX_SAVE_TYPE|",
|
||||||
@ -206,6 +209,13 @@ async fn dashboard_page(State(db): State<DatabaseConnection>) -> Html<String> {
|
|||||||
)
|
)
|
||||||
.replace("|MAX_LEN|", &max_id_data.len.to_string())
|
.replace("|MAX_LEN|", &max_id_data.len.to_string())
|
||||||
.replace("|MAX_HASH|", &max_id_data.blake_hash);
|
.replace("|MAX_HASH|", &max_id_data.blake_hash);
|
||||||
|
} else {
|
||||||
|
page_content = page_content
|
||||||
|
.replace("|MAX_ID|", "not found")
|
||||||
|
.replace("|MAX_SAVE_TYPE|", "not found")
|
||||||
|
.replace("|MAX_LEN|", "not found")
|
||||||
|
.replace("|MAX_HASH|", "not found");
|
||||||
|
}
|
||||||
if let Some(max_ship) = max_ship {
|
if let Some(max_ship) = max_ship {
|
||||||
page_content = page_content
|
page_content = page_content
|
||||||
.replace("|MAX_SHIP_ID|", &max_ship.save_id.to_string())
|
.replace("|MAX_SHIP_ID|", &max_ship.save_id.to_string())
|
||||||
|
Loading…
Reference in New Issue
Block a user