diff --git a/crates/rkvm-web/index.html b/crates/rkvm-web/index.html index 039daa4..2910191 100644 --- a/crates/rkvm-web/index.html +++ b/crates/rkvm-web/index.html @@ -105,6 +105,17 @@ .tb-err { color: var(--danger); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + .nopw-banner { position: fixed; top: 8px; left: 8px; z-index: 30; max-width: min(460px, calc(100vw - 16px)); + display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: var(--r1); + background: rgba(120, 22, 32, 0.92); border: 1px solid var(--danger); color: #fff; + font: 500 12.5px/1.4 var(--font); box-shadow: var(--shadow); } + .nopw-banner button { flex: none; background: none; border: 0; color: #fff; cursor: pointer; + font-size: 12px; padding: 0 2px; opacity: .8; } + .nopw-banner button:hover { opacity: 1; } + .nopw-card { margin: 0 0 14px; padding: 10px 12px; max-width: 320px; border-radius: var(--r1); + background: rgba(240, 97, 109, 0.12); border: 1px solid rgba(240, 97, 109, 0.5); + color: #ffd5d9; font-size: 12.5px; } + .drawer-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px); z-index: 40; animation: fade 0.18s ease; } .drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; overflow-y: auto; diff --git a/crates/rkvm-web/src/app.rs b/crates/rkvm-web/src/app.rs index c42532c..fc501bf 100644 --- a/crates/rkvm-web/src/app.rs +++ b/crates/rkvm-web/src/app.rs @@ -33,6 +33,8 @@ pub fn App() -> impl IntoView { let checking = RwSignal::new(true); let is_setup = RwSignal::new(true); let needs_login = RwSignal::new(false); + let no_password = RwSignal::new(false); + let nopw_dismissed = RwSignal::new(false); let conn_state = RwSignal::new("idle".to_string()); let error = RwSignal::new(Option::::None); let password = RwSignal::new(String::new()); @@ -62,6 +64,7 @@ pub fn App() -> impl IntoView { is_setup.set(setup_done); if setup_done { needs_login.set(rest::auth_required().await); + no_password.set(rest::no_password().await); } checking.set(false); }); @@ -76,6 +79,7 @@ pub fn App() -> impl IntoView { Ok(()) => { is_setup.set(true); needs_login.set(rest::auth_required().await); + no_password.set(rest::no_password().await); } Err(e) => error.set(Some(e)), } @@ -296,7 +300,7 @@ pub fn App() -> impl IntoView { - + @@ -305,7 +309,22 @@ pub fn App() -> impl IntoView { {move || error.get().unwrap_or_default()} - + + + +
@@ -370,6 +389,11 @@ pub fn App() -> impl IntoView {

"rustkvm"

+ +
+ "No password is set. Anyone on this network can connect, control this machine and open a root shell on the device. After connecting, set a password in ⚙ Settings → Password." +
+
+
{move || pw_msg.get()}
diff --git a/crates/rkvm-web/src/terminal.rs b/crates/rkvm-web/src/terminal.rs index d041ef6..0dd0a12 100644 --- a/crates/rkvm-web/src/terminal.rs +++ b/crates/rkvm-web/src/terminal.rs @@ -169,7 +169,7 @@ pub fn Terminal(
- "Serial / Terminal" + "Device shell (root)"