Compare commits
2 commits
40090f7d98
...
cafac264a7
Author | SHA1 | Date | |
---|---|---|---|
|
cafac264a7 | ||
|
afa265cdfc |
3 changed files with 18 additions and 9 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -2326,9 +2326,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version_check"
|
name = "version_check"
|
||||||
version = "0.9.4"
|
version = "0.9.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "walkdir"
|
name = "walkdir"
|
||||||
|
@ -2575,9 +2575,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xxhash-rust"
|
name = "xxhash-rust"
|
||||||
version = "0.8.11"
|
version = "0.8.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "63658493314859b4dfdf3fb8c1defd61587839def09582db50b8a4e93afca6bb"
|
checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "yansi"
|
name = "yansi"
|
||||||
|
|
|
@ -7,7 +7,7 @@ use serde_json::to_string;
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Auth() -> impl IntoView {
|
pub fn Auth() -> impl IntoView {
|
||||||
let websocket = expect_context::<WebSocketContext>();
|
let websocket = expect_context::<WebSocketContext>();
|
||||||
let (username, _set_username) = create_signal("Anonymous");
|
let (username, set_username) = create_signal("Anonymous".to_string());
|
||||||
|
|
||||||
let username_input_ref = create_node_ref::<Input>();
|
let username_input_ref = create_node_ref::<Input>();
|
||||||
let send_login = move |_| {
|
let send_login = move |_| {
|
||||||
|
@ -17,6 +17,8 @@ pub fn Auth() -> impl IntoView {
|
||||||
})
|
})
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
);
|
);
|
||||||
|
set_username.set(username_input_ref.get().unwrap().value());
|
||||||
|
username_input_ref.get().unwrap().set_value("");
|
||||||
logging::log!("sent");
|
logging::log!("sent");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,18 +26,22 @@ pub fn Auth() -> impl IntoView {
|
||||||
<div class="p-1">
|
<div class="p-1">
|
||||||
<h2 class="text-2xl">Sign in:</h2>
|
<h2 class="text-2xl">Sign in:</h2>
|
||||||
<p>Username:</p>
|
<p>Username:</p>
|
||||||
|
<form
|
||||||
|
onsubmit="return false"
|
||||||
|
on:submit=send_login
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
class="w-96 font-mono rounded-sm bg-slate-900 text-slate-200"
|
class="w-96 font-mono rounded-sm bg-slate-900 text-slate-200"
|
||||||
placeholder=move || username.get()
|
placeholder=move || username.get()
|
||||||
node_ref=username_input_ref
|
node_ref=username_input_ref
|
||||||
on:change=send_login.clone()
|
|
||||||
/>
|
/>
|
||||||
|
<br />
|
||||||
<input
|
<input
|
||||||
class="py-2 px-4 pl-4 font-bold text-white rounded border-b-4 bg-slate-600 border-slate-800 hover:bg-slate-700 hover:border-slate-500"
|
class="py-2 px-4 pl-4 font-bold text-white rounded border-b-4 bg-slate-600 border-slate-800 hover:bg-slate-700 hover:border-slate-500"
|
||||||
type="submit"
|
type="submit"
|
||||||
value="Send"
|
value="Send"
|
||||||
on:change=send_login.clone()
|
|
||||||
/>
|
/>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,18 +84,21 @@ pub fn Chat() -> impl IntoView {
|
||||||
</textarea>
|
</textarea>
|
||||||
<br/>
|
<br/>
|
||||||
<span>
|
<span>
|
||||||
|
<form
|
||||||
|
onsubmit="return false"
|
||||||
|
on:submit=send_message
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
class="w-80 h-11 font-mono rounded-sm bg-slate-900 text-slate-200"
|
class="w-80 h-11 font-mono rounded-sm bg-slate-900 text-slate-200"
|
||||||
placeholder="talk shit..."
|
placeholder="talk shit..."
|
||||||
node_ref=chat_input_ref
|
node_ref=chat_input_ref
|
||||||
on:change=send_message.clone()
|
|
||||||
/>
|
/>
|
||||||
<input
|
<input
|
||||||
class="py-2 px-4 pl-4 font-bold text-white rounded border-b-4 bg-slate-600 border-slate-800 hover:bg-slate-700 hover:border-slate-500"
|
class="py-2 px-4 pl-4 font-bold text-white rounded border-b-4 bg-slate-600 border-slate-800 hover:bg-slate-700 hover:border-slate-500"
|
||||||
type="submit"
|
type="submit"
|
||||||
value="Send"
|
value="Send"
|
||||||
on:change=send_message.clone()
|
|
||||||
/>
|
/>
|
||||||
|
</form>
|
||||||
</span>
|
</span>
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue