pinakes-ui: integrate plugin pages into sidebar navigation; sanitize theme-extension CSS eval
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ie87e39c66253a7071f029d52dd5979716a6a6964
This commit is contained in:
parent
90504609e9
commit
ba01acf271
1 changed files with 7 additions and 16 deletions
|
|
@ -369,11 +369,13 @@ pub fn App() -> Element {
|
||||||
spawn(async move {
|
spawn(async move {
|
||||||
let js: String = vars
|
let js: String = vars
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(k, v)| {
|
.filter_map(|(k, v)| {
|
||||||
format!(
|
let k_js = serde_json::to_string(k).ok()?;
|
||||||
"document.documentElement.style.setProperty('{}','{}');",
|
let v_js = serde_json::to_string(v).ok()?;
|
||||||
k, v
|
Some(format!(
|
||||||
)
|
"document.documentElement.style.setProperty({k_js},\
|
||||||
|
{v_js});"
|
||||||
|
))
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
let _ = document::eval(&js).await;
|
let _ = document::eval(&js).await;
|
||||||
|
|
@ -849,17 +851,6 @@ pub fn App() -> Element {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
|
||||||
let sync_time_opt = plugin_registry
|
|
||||||
.read()
|
|
||||||
.last_refresh()
|
|
||||||
.map(|ts| ts.format("%H:%M").to_string());
|
|
||||||
rsx! {
|
|
||||||
if let Some(sync_time) = sync_time_opt {
|
|
||||||
div { class: "nav-sync-time", "Synced {sync_time}" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue