From d831dba5a625ff0f4af8dcd1034a4bdba0086436 Mon Sep 17 00:00:00 2001 From: Fankai Liu Date: Thu, 11 Jan 2024 21:10:31 +0800 Subject: [PATCH] update update salvo version --- Cargo.lock | 2 +- Cargo.toml | 2 +- locales/readme.yml | 18 ++++++++++++++++++ src/template/README.md | 1 + src/template/src/routers/user.hbs | 2 ++ src/utils/create_project.rs | 6 +++--- 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4aab608..855fc2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1238,7 +1238,7 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "salvo-cli" -version = "0.1.40" +version = "0.1.41" dependencies = [ "ansi_term", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index eddae47..0e0b10f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "salvo-cli" -version = "0.1.40" +version = "0.1.41" edition = "2021" authors = ["Fankai Liu liufankai137@outlook.com","mrxiaozhuox mrxzx.info@gmail.com"] keywords = ["salvo", "cli","template"] diff --git a/locales/readme.yml b/locales/readme.yml index 3b8c8d7..df23895 100644 --- a/locales/readme.yml +++ b/locales/readme.yml @@ -879,3 +879,21 @@ mongodb_usage_import_user_data: th: 🎯 โปรดเรียกใช้โปรแกรมก่อน, จากนั้นนำเข้าข้อมูลจาก data/user.json ไปยังตารางผู้ใช้ el: 🎯 Παρακαλώ πρώτα τρέξτε το πρόγραμμα, στη συνέχεια εισάγετε τα δεδομένα από το data/user.json στον πίνακα χρήστη da: 🎯 Kør venligst først programmet, importér derefter data fra data/user.json ind i brugertabellen +rust_version_tip: + en: "😄 The latest version of Salvo requires Rust version 1.75. If your compilation fails, please try upgrading with `rustup update`." + zh_CN: "😄 最新版的 Salvo 依赖 Rust 版本 1.75。如果编译失败,请尝试使用 `rustup update` 来升级版本。" + zh_TW: "😄 最新版的 Salvo 需要 Rust 版本 1.75。如果您的編譯失敗,請嘗試使用 `rustup update` 來升級版本。" + fr: "😄 La dernière version de Salvo nécessite la version 1.75 de Rust. Si votre compilation échoue, veuillez essayer de mettre à niveau avec `rustup update`." + ja: "😄 最新のSalvoにはRustのバージョン1.75が必要です。コンパイルに失敗した場合は、`rustup update`でアップグレードしてみてください。" + es: "😄 La última versión de Salvo requiere la versión 1.75 de Rust. Si la compilación falla, intenta actualizar con `rustup update`." + de: "😄 Die neueste Version von Salvo erfordert die Rust-Version 1.75. Wenn die Kompilierung fehlschlägt, versuchen Sie bitte, mit `rustup update` zu aktualisieren." + ru: "😄 Последняя версия Salvo требует версии Rust 1.75. Если компиляция не удаётся, пожалуйста, попробуйте обновиться с помощью `rustup update`." + it: "😄 L'ultima versione di Salvo richiede la versione 1.75 di Rust. Se la compilazione fallisce, prova ad aggiornare con `rustup update`." + pt: "😄 A versão mais recente do Salvo requer a versão 1.75 do Rust. Se a compilação falhar, tente atualizar com `rustup update`." + ko: "😄 최신 Salvo 버전은 Rust 1.75 버전을 필요로 합니다. 컴파일에 실패한다면, `rustup update`로 업그레이드를 시도해보세요." + no: "😄 Den nyeste versjonen av Salvo krever Rust versjon 1.75. Hvis kompileringen feiler, vennligst prøv å oppgradere med `rustup update`." + is: "😄 Nýjasta útgáfa af Salvo krefst Rust útgáfu 1.75. Ef þýðing mistekst, reyndu þá að uppfæra með `rustup update`." + uk: "😄 Остання версія Salvo потребує версію Rust 1.75. Якщо компіляція не вдається, будь ласка, спробуйте оновити за допомогою `rustup update`." + th: "😄 เวอร์ชันล่าสุดของ Salvo ต้องการ Rust เวอร์ชัน 1.75 หากการคอมไพล์ล้มเหลว กรุณาลองอัพเดทด้วย `rustup update`" + el: "😄 Η τελευταία έκδοση του Salvo απαιτεί την έκδοση 1.75 της Rust. Εάν η συνταξιοποίηση αποτύχει, δοκιμάστε να αναβαθμίσετε με `rustup update`." + da: "😄 Den nyeste version af Salvo kræver Rust version 1.75. Hvis din kompilering fejler, prøv da at opgradere med `rustup update`." \ No newline at end of file diff --git a/src/template/README.md b/src/template/README.md index d5de760..7fd81cc 100644 --- a/src/template/README.md +++ b/src/template/README.md @@ -1,5 +1,6 @@ # {{introduction}} {{introduction_text}} +{{{rust_version_tip}}} {{#if is_sqlite}} {{/if}} ``` shell diff --git a/src/template/src/routers/user.hbs b/src/template/src/routers/user.hbs index 365f540..029b7e0 100644 --- a/src/template/src/routers/user.hbs +++ b/src/template/src/routers/user.hbs @@ -15,6 +15,7 @@ use salvo::{ writing::{Redirect, Text}, Request, Response, }; +use salvo::Writer; #[derive(Template)] #[template(path = "login.html")] @@ -119,6 +120,7 @@ use salvo::{ oapi::extract::{JsonBody, PathParam}, Request, Response, }; +use salvo::Writer; #[endpoint( tags("comm"),)] pub async fn post_login(req: JsonBody, res: &mut Response) { diff --git a/src/utils/create_project.rs b/src/utils/create_project.rs index 1cc0e76..e79b8fb 100644 --- a/src/utils/create_project.rs +++ b/src/utils/create_project.rs @@ -51,9 +51,9 @@ pub fn create_project(project: Project) -> Result<()> { fn after_print_info(project_name: &String) { println!(); // a new line - // print success info success(t!("create_info", project_name = project_name).replace(r"\n", "\n")); success(t!("create_success").replace(r"\n", "\n")); + success(t!("rust_version_tip").replace(r"`", "`")); println!(); // a new line } @@ -83,7 +83,7 @@ pub fn write_project_file( "jsonwebtoken": "8.3.0", "once_cell": "1.18.0", "salvo": { - "version": "0.63", + "version": "0.64", "features": ["anyhow", "logging", "cors", "oapi", "jwt-auth", "rustls", "catch-panic","cookie","serve-static","test"] }, "serde": "1.0.188", @@ -142,7 +142,7 @@ pub fn write_project_file( data["database_connection_failed"] = handlebars::JsonValue::String(t!("database_connection_failed")); data["user_does_not_exist"] = handlebars::JsonValue::String(t!("user_does_not_exist")); - + data["rust_version_tip"] = handlebars::JsonValue::String(t!("rust_version_tip")); let mut dependencies = data["dependencies"].clone(); handle_dependencies( &mut dependencies,