Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 8cec0869 authored by Pierre Jarriges's avatar Pierre Jarriges
Browse files

fix delete static view

parent 26f14273
No related branches found
No related tags found
1 merge request!1Dev
......@@ -31,9 +31,15 @@ class ArticleList {
contents: this.state.articles.map(art => {
return {
tag: "li",
style_rules: { display: "grid", gridTemplateColumns: "auto 100px 100px", gap: "10px" },
style_rules: { display: "grid", gridTemplateColumns: "auto auto 100px 100px", gap: "10px", alignItems: "center" },
contents: [
{ tag: "span", contents: `[${art.locale}] <b>${art.title}</b> - ${art._id.$oid}` },
art.with_static_view ? {
tag: "a",
href: art.metadata.view_uri,
contents: art.metadata.view_uri,
target: "_blank"
} : { tag: "span" },
{
tag: "button", contents: "Select", onclick: () => {
this.params.on_select_article(art)
......
......@@ -80,7 +80,7 @@ class UpdateArticleForm {
display: "flex",
flexDirection: "column",
gap: "20px",
maxWidth: "800px",
maxWidth: "1200px",
},
contents: [
this.articles_list.render(),
......
......@@ -113,7 +113,7 @@ async fn main() -> std::io::Result<()> {
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// empty 404 ////////////////////////////////////////////////////////////////////////////////////////////////
.default_service(to(|| {
HttpResponse::NotFound().body("<h1>404 - Page not found</h1>")
HttpResponse::NotFound().body("<!DOCTYPE html><html><head><meta charset='utf-8'><title>Page not found</title></head><body> <h1>404 : Page not found</h1></body></html>")
}))
})
.bind(format!("0.0.0.0:{}", env_var("SERVER_PORT").unwrap()))?
......
......@@ -100,13 +100,8 @@ pub fn delete_static_view(
) -> Result<(), String> {
if let Some(path) = path {
if path.exists() {
let parent = path.parent().unwrap();
if let Err(e) = remove_dir_all(parent) {
return Err(format!(
"Error deleting static view at {:?} : {}",
parent, e
));
if let Err(e) = remove_dir_all(path) {
return Err(format!("Error deleting static view at {:?} : {}", path, e));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment