Domain link Update
This commit is contained in:
+13
-1
@@ -124,7 +124,10 @@ fn load_config() -> Config {
|
|||||||
.parse::<usize>()
|
.parse::<usize>()
|
||||||
.expect("Invalid CHUNK_SIZE_KB")
|
.expect("Invalid CHUNK_SIZE_KB")
|
||||||
* 1024,
|
* 1024,
|
||||||
domain: std::env::var("DOMAIN").ok().map(|d| d.trim_end_matches('/').to_string()),
|
domain: std::env::var("DOMAIN")
|
||||||
|
.ok()
|
||||||
|
.map(|d| d.trim().trim_end_matches('/').to_string())
|
||||||
|
.filter(|d| !d.is_empty()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +229,16 @@ async fn list_files(State(state): State<AppState>) -> Html<String> {
|
|||||||
.config
|
.config
|
||||||
.domain
|
.domain
|
||||||
.clone()
|
.clone()
|
||||||
|
.map(|d| {
|
||||||
|
if d.contains("://") {
|
||||||
|
d
|
||||||
|
} else {
|
||||||
|
format!("https://{}", d)
|
||||||
|
}
|
||||||
|
})
|
||||||
.unwrap_or_else(|| format!("http://localhost:{}", state.config.port));
|
.unwrap_or_else(|| format!("http://localhost:{}", state.config.port));
|
||||||
|
|
||||||
|
tracing::info!("Using base URL for commands: {}", base_url);
|
||||||
|
|
||||||
let mut file_list_items = String::new();
|
let mut file_list_items = String::new();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user