1
0
Fork 0
forked from alemi/upub

fix(web): controls below searchbar, not at side

This commit is contained in:
əlemi 2024-05-23 01:45:34 +02:00
parent c19cc19a90
commit a2812ebf15
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -5,7 +5,6 @@ use crate::prelude::*;
#[component] #[component]
pub fn DebugPage() -> impl IntoView { pub fn DebugPage() -> impl IntoView {
let query_params = use_query_map(); let query_params = use_query_map();
let cached_ref: NodeRef<html::Input> = create_node_ref();
let auth = use_context::<Auth>().expect("missing auth context"); let auth = use_context::<Auth>().expect("missing auth context");
let (cached, set_cached) = create_signal(false); let (cached, set_cached) = create_signal(false);
let (plain, set_plain) = create_signal(false); let (plain, set_plain) = create_signal(false);
@ -42,28 +41,27 @@ pub fn DebugPage() -> impl IntoView {
ev.prevent_default(); ev.prevent_default();
navigate(&format!("/web/config/dev?q={}", text.get()), NavigateOptions::default()); navigate(&format!("/web/config/dev?q={}", text.get()), NavigateOptions::default());
} > } >
<table class="align w-100" > <table class="align w-100">
<tr> <tr>
<td> <td class="w-100">
<small><a <input class="w-100" type="text"
href={move|| Uri::web(U::Object, &text.get())} prop:value=text
>obj</a> on:input=move|ev| set_text.set(event_target_value(&ev))
" " placeholder="AP id"
<a />
href={move|| Uri::web(U::User, &text.get())} </td>
>usr</a></small> <td>
</td> <input type="submit" class="w-100" value="fetch" />
<td class="w-100"> </td>
<input class="w-100" type="text" <td>
prop:value=text <input type="checkbox" title="load from local cache" value="cached"
on:input=move|ev| set_text.set(event_target_value(&ev)) class:loader=loading
placeholder="AP id" prop:checked=cached
/> on:input=move |ev| set_cached.set(event_target_checked(&ev))
</td> />
<td><input type="submit" class="w-100" value="fetch" /></td> </td>
<td><input type="checkbox" class:loader=loading title="cached" value="cached" prop:checked=cached on:input=move |ev| set_cached.set(event_target_checked(&ev)) /></td> </tr>
</tr> </table>
</table>
</form> </form>
</div> </div>
<pre class="ma-1"> <pre class="ma-1">
@ -74,17 +72,21 @@ pub fn DebugPage() -> impl IntoView {
})} })}
</pre> </pre>
<p class="center"> <p class="center">
<input type="checkbox" title="show plain (and valid) json" value="plain" prop:checked=plain on:input=move |ev| set_plain.set(event_target_checked(&ev)) /> <input type="checkbox" title="show plain (and valid) json" value="plain" prop:checked=plain on:input=move |ev| set_plain.set(event_target_checked(&ev)) />
" plain :: " " plain :: "
<a href=move || cached_query().0 target="_blank" rel="nofollow noreferrer">external</a> <a href={move|| Uri::web(U::Object, &text.get())} >obj</a>
" :: " " :: "
<a href="#" <a href={move|| Uri::web(U::User, &text.get())} >usr</a>
onclick={move || " :: "
format!( <a href=move || cached_query().0 target="_blank" rel="nofollow noreferrer">ext</a>
"javascript:navigator.clipboard.writeText(`{}`)", " :: "
object.get().map(|x| serde_json::to_string(&x).unwrap_or_default()).unwrap_or_default() <a href="#"
) onclick={move ||
} >copy</a> format!(
"javascript:navigator.clipboard.writeText(`{}`)",
object.get().map(|x| serde_json::to_string(&x).unwrap_or_default()).unwrap_or_default()
)
} >copy</a>
</p> </p>
</div> </div>
} }