add /config endpoint, add docker proxy setup, and style chat box
This commit is contained in:
@@ -224,8 +224,10 @@ pub fn load_username() -> Option<String> {
|
||||
return None;
|
||||
}
|
||||
|
||||
pub fn load_config() -> Option<GuiConfig> {
|
||||
None
|
||||
pub async fn load_config() -> color_eyre::Result<GuiConfig> {
|
||||
color_eyre::eyre::bail!(
|
||||
"there is no config on desktop because desktops cannot be configured as they are tables"
|
||||
)
|
||||
}
|
||||
|
||||
pub fn init_logging() {
|
||||
|
||||
+15
-3
@@ -320,7 +320,8 @@ pub async fn network_connect(
|
||||
)
|
||||
.ey()?;
|
||||
|
||||
if let Some(server_hash) = &CONFIG.cert_hash {
|
||||
if let Some(server_hash) = &CONFIG.try_get().and_then(|cfg| cfg.cert_hash) {
|
||||
error!("{:?}", server_hash);
|
||||
let hash = web_sys::js_sys::Uint8Array::from(server_hash.as_slice());
|
||||
web_sys::js_sys::Reflect::set(&object, &"value".into(), &hash).ey()?;
|
||||
}
|
||||
@@ -394,8 +395,19 @@ fn load_config_from_env() -> Option<GuiConfig> {
|
||||
serde_json::from_str(option_env!("MUMBLE_WEB2_GUI_CONFIG")?).ok()?
|
||||
}
|
||||
|
||||
pub fn load_config() -> Option<GuiConfig> {
|
||||
load_config_from_window().or_else(load_config_from_env)
|
||||
pub async fn load_config() -> color_eyre::Result<()> {
|
||||
let config_url = option_env!("MUMBLE_WEB2_GUI_CONFIG_URL").ok_or(eyre!("foo"))?;
|
||||
|
||||
let config = reqwest::get(config_url)
|
||||
.await
|
||||
.unwrap()
|
||||
.json::<GuiConfig>()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
crate::CONFIG.set(config);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn init_logging() {
|
||||
|
||||
Reference in New Issue
Block a user