diff --git a/Makefile.toml b/Makefile.toml index 1a3eab1..398db9e 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -17,12 +17,12 @@ dependencies = ["build_client_release", "build_server_release"] description = "Build client" install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" } command = "wasm-pack" -args = ["build", "app", "--target", "web", "--out-name", "app", "--dev"] +args = ["build", "app", "--target", "web", "--out-name", "app", "--out-dir", "../pslink/static/wasm/", "--dev"] [tasks.build_client_release] extend = "build_client" description = "Build client in release mode" -args = ["build", "app", "--target", "web", "--out-name", "app", "--release"] +args = ["build", "app", "--target", "web", "--out-name", "app", "--out-dir", "../pslink/static/wasm/", "--release"] [tasks.build_server] env = { SQLX_OFFLINE = 1 } diff --git a/app/src/lib.rs b/app/src/lib.rs index 956f036..b6ca058 100644 --- a/app/src/lib.rs +++ b/app/src/lib.rs @@ -6,6 +6,7 @@ pub mod pages; use pages::list_links; use pages::list_users; use seed::window; +use seed::IF; use seed::{attrs, button, div, input, label, log, prelude::*, App, Url, C}; use shared::apirequests::users::LoginUser; use shared::datatypes::Lang; @@ -391,11 +392,14 @@ fn view_login(lang: &I18n, model: &Model) -> Node { label![t("password")], input![ input_ev(Ev::Input, |s| { Msg::PasswordChanged(s) }), + keyboard_ev(Ev::KeyDown, |keyboard_event| { + IF!(keyboard_event.key() == "Enter" => Msg::Login) + }), attrs![ - At::Type => "password", - At::Placeholder => t("password"), - At::Name => "password", - At::Value => model.login_data.password], + At::Type => "password", + At::Placeholder => t("password"), + At::Name => "password", + At::Value => model.login_data.password], el_ref(&model.login_form.password) ] ], diff --git a/pslink/src/views.rs b/pslink/src/views.rs index e8ade3f..8eae04e 100644 --- a/pslink/src/views.rs +++ b/pslink/src/views.rs @@ -96,8 +96,8 @@ pub async fn wasm_app(config: web::Data) -> Result
Loading:
"#,