属实是神奇
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
|
||||||
|
@ -29,7 +29,7 @@ pub fn ships_table() -> Statement {
|
|||||||
.boolean()
|
.boolean()
|
||||||
.not_null(),
|
.not_null(),
|
||||||
);
|
);
|
||||||
// .col(ColumnDef::new(Ships::XmlData));
|
// .col(ColumnDef::new(Ships::XmlData));
|
||||||
DatabaseBackend::Postgres.build(&table)
|
DatabaseBackend::Postgres.build(&table)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,18 +194,28 @@ 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());
|
||||||
.replace("|MAX_ID|", &max_id_data.save_id.to_string())
|
|
||||||
.replace(
|
if let Some(max_id_data) = max_id_data {
|
||||||
"|MAX_SAVE_TYPE|",
|
page_content = page_content
|
||||||
&max_id_data.save_type.to_value().to_string(),
|
.replace("|MAX_ID|", &max_id_data.save_id.to_string())
|
||||||
)
|
.replace(
|
||||||
.replace("|MAX_LEN|", &max_id_data.len.to_string())
|
"|MAX_SAVE_TYPE|",
|
||||||
.replace("|MAX_HASH|", &max_id_data.blake_hash);
|
&max_id_data.save_type.to_value().to_string(),
|
||||||
|
)
|
||||||
|
.replace("|MAX_LEN|", &max_id_data.len.to_string())
|
||||||
|
.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