1
0
Fork 0
forked from alemi/upub

fix(web): better config page, debug under config

This commit is contained in:
əlemi 2024-05-13 01:20:48 +02:00
parent 26f94cb0de
commit 01beeeca5c
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 27 additions and 39 deletions

View file

@ -107,13 +107,13 @@ pub fn App() -> impl IntoView {
<Route path="/web/home" view=move || view! { <TimelinePage name="home" tl=home_tl /> } /> <Route path="/web/home" view=move || view! { <TimelinePage name="home" tl=home_tl /> } />
<Route path="/web/server" view=move || view! { <TimelinePage name="server" tl=server_tl /> } /> <Route path="/web/server" view=move || view! { <TimelinePage name="server" tl=server_tl /> } />
<Route path="/web/config" view=move || view! { <ConfigPage setter=set_config /> } />
<Route path="/web/about" view=AboutPage /> <Route path="/web/about" view=AboutPage />
<Route path="/web/config" view=move || view! { <ConfigPage setter=set_config /> } />
<Route path="/web/config/dev" view=DebugPage />
<Route path="/web/users/:id" view=move || view! { <UserPage tl=user_tl /> } /> <Route path="/web/users/:id" view=move || view! { <UserPage tl=user_tl /> } />
<Route path="/web/objects/:id" view=move || view! { <ObjectPage tl=context_tl /> } /> <Route path="/web/objects/:id" view=move || view! { <ObjectPage tl=context_tl /> } />
<Route path="/web/debug" view=DebugPage />
<Route path="/web/search" view=SearchPage /> <Route path="/web/search" view=SearchPage />
<Route path="/" view=move || view! { <Redirect path="/web" /> } /> <Route path="/" view=move || view! { <Redirect path="/web" /> } />

View file

@ -53,46 +53,34 @@ pub fn ConfigPage(setter: WriteSignal<Config>) -> impl IntoView {
view! { view! {
<div> <div>
<Breadcrumb>config</Breadcrumb> <Breadcrumb>config</Breadcrumb>
<p class="center mt-0"><small>config is saved in your browser local storage</small></p>
<p> <p>
<input type="checkbox" title="likes" class="mr-1" <span title="embedded video attachments will loop like gifs if this option is enabled">
<input type="checkbox" class="mr-1"
prop:checked=get_cfg!(loop_videos) prop:checked=get_cfg!(loop_videos)
on:input=set_cfg!(loop_videos) on:input=set_cfg!(loop_videos)
/> loop videos /> loop videos
</span>
</p> </p>
<p> <p>
<input type="checkbox" title="likes" class="mr-1" <span title="any post with a summary is considered to have a content warning, and collapsed by default if this option is enabled">
<input type="checkbox" class="mr-1"
prop:checked=get_cfg!(collapse_content_warnings) prop:checked=get_cfg!(collapse_content_warnings)
on:input=set_cfg!(collapse_content_warnings) on:input=set_cfg!(collapse_content_warnings)
/> collapse content warnings /> collapse content warnings
</span>
</p> </p>
<div class="mt-s mb-s" > <hr />
<table class="ma-3 center"> <p><code title="unchecked elements won't show in timelines">filters</code></p>
<tr> <ul>
<th></th> <li><span title="like activities"><input type="checkbox" prop:checked=get_cfg!(filter likes) on:input=set_cfg!(filter likes) />" likes"</span></li>
<th>filters</th> <li><span title="create activities with object"><input type="checkbox" prop:checked=get_cfg!(filter creates) on:input=set_cfg!(filter creates)/>" creates"</span></li>
</tr> <li><span title="announce activities with object"><input type="checkbox" prop:checked=get_cfg!(filter announces) on:input=set_cfg!(filter announces) />" announces"</span></li>
<tr> <li><span title="follow, accept and reject activities"><input type="checkbox" prop:checked=get_cfg!(filter follows) on:input=set_cfg!(filter follows) />" follows"</span></li>
<td><input type="checkbox" prop:checked=get_cfg!(filter likes) on:input=set_cfg!(filter likes) /></td> <li><span title="objects without a related activity to display"><input type="checkbox" prop:checked=get_cfg!(filter orphans) on:input=set_cfg!(filter orphans) />" orphans"</span></li>
<td>likes</td> </ul>
</tr> <hr />
<tr> <p><a href="/web/config/dev" title="access the devtools page">devtools</a></p>
<td><input type="checkbox" prop:checked=get_cfg!(filter creates) on:input=set_cfg!(filter creates)/></td>
<td>creates</td>
</tr>
<tr>
<td><input type="checkbox" prop:checked=get_cfg!(filter announces) on:input=set_cfg!(filter announces) /></td>
<td>announces</td>
</tr>
<tr>
<td><input type="checkbox" prop:checked=get_cfg!(filter follows) on:input=set_cfg!(filter follows) /></td>
<td>follows</td>
</tr>
<tr>
<td><input type="checkbox" prop:checked=get_cfg!(filter orphans) on:input=set_cfg!(filter orphans) /></td>
<td>orphans</td>
</tr>
</table>
</div>
</div> </div>
} }
} }
@ -359,7 +347,7 @@ pub fn DebugPage() -> impl IntoView {
let (query, set_query) = create_signal("".to_string()); let (query, set_query) = create_signal("".to_string());
view! { view! {
<div> <div>
<Breadcrumb back=true>debug</Breadcrumb> <Breadcrumb back=true>config :: devtools</Breadcrumb>
<div class="mt-1" > <div class="mt-1" >
<form on:submit=move|ev| { <form on:submit=move|ev| {
ev.prevent_default(); ev.prevent_default();