2024-04-29 22:48:53 +02:00
|
|
|
use dioxus::prelude::*;
|
2024-05-21 16:39:11 +02:00
|
|
|
use dioxus_sdk::{i18n::use_i18, translate};
|
2024-04-29 22:48:53 +02:00
|
|
|
|
2024-04-30 10:15:56 +02:00
|
|
|
use crate::components::{UnderConstruction, H1, HR};
|
2024-04-29 22:48:53 +02:00
|
|
|
|
|
|
|
#[component]
|
2024-05-21 16:39:11 +02:00
|
|
|
pub fn PublicationsProjects() -> Element {
|
|
|
|
let i18 = use_i18();
|
|
|
|
|
2024-04-29 22:48:53 +02:00
|
|
|
rsx! {
|
2024-04-30 10:15:56 +02:00
|
|
|
div {
|
2024-05-21 16:39:11 +02:00
|
|
|
class: "flex flex-col ",
|
|
|
|
UnderConstruction { },
|
|
|
|
div {
|
|
|
|
H1 { { translate!(i18, "publications_projects.publications.title") } }
|
|
|
|
Publications { },
|
|
|
|
},
|
|
|
|
HR {},
|
|
|
|
div {
|
|
|
|
H1 { { translate!(i18, "publications_projects.projects.title") } }
|
|
|
|
Projects { },
|
|
|
|
}
|
2024-04-30 10:15:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, PartialEq, Props)]
|
|
|
|
struct PublicationProp {
|
|
|
|
#[props(default = "".to_string())]
|
|
|
|
doi: String,
|
|
|
|
authors: String,
|
|
|
|
title: String,
|
|
|
|
conference: String,
|
|
|
|
#[props(default = "".to_string())]
|
|
|
|
description: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn Publications() -> Element {
|
2024-05-21 16:39:11 +02:00
|
|
|
let i18 = use_i18();
|
|
|
|
|
2024-04-30 10:15:56 +02:00
|
|
|
rsx! {
|
2024-04-29 22:48:53 +02:00
|
|
|
div {
|
2024-05-02 11:04:23 +02:00
|
|
|
class: "flex gap-4 items-center flex-wrap",
|
2024-04-29 22:48:53 +02:00
|
|
|
Publication {
|
2024-05-21 16:39:11 +02:00
|
|
|
title: translate!(i18, "publications_projects.publications.rpm.title"),
|
|
|
|
authors: translate!(i18, "publications_projects.publications.rpm.authors"),
|
|
|
|
conference: translate!(i18, "publications_projects.publications.rpm.conference"),
|
|
|
|
doi: translate!(i18, "publications_projects.publications.rpm.url"),
|
|
|
|
description: translate!(i18, "publications_projects.publications.rpm.description")
|
2024-04-30 10:15:56 +02:00
|
|
|
},
|
|
|
|
|
2024-04-29 22:48:53 +02:00
|
|
|
Publication {
|
2024-05-21 16:39:11 +02:00
|
|
|
title: translate!(i18, "publications_projects.publications.iot_fuzzers.title"),
|
|
|
|
authors: translate!(i18, "publications_projects.publications.iot_fuzzers.authors"),
|
|
|
|
conference: translate!(i18, "publications_projects.publications.iot_fuzzers.conference"),
|
|
|
|
doi: translate!(i18, "publications_projects.publications.iot_fuzzers.url"),
|
|
|
|
description: translate!(i18, "publications_projects.publications.iot_fuzzers.description")
|
2024-04-30 10:15:56 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fn Publication(prop: PublicationProp) -> Element {
|
2024-07-25 03:39:53 +02:00
|
|
|
let pattern = "T.-D. Tran";
|
2024-04-30 10:15:56 +02:00
|
|
|
rsx! {
|
|
|
|
Link {
|
|
|
|
class:"block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700",
|
|
|
|
to:"{prop.doi}",
|
|
|
|
new_tab: true,
|
|
|
|
h5 {
|
|
|
|
class:"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white",
|
|
|
|
"{prop.title}",
|
|
|
|
},
|
|
|
|
span { class: "text-lg text-gray-900 dark:text-white", "{prop.conference}" },
|
|
|
|
p {
|
2024-07-25 03:39:53 +02:00
|
|
|
class:"font-normal text-gray-700 dark:text-gray-400 italic",
|
|
|
|
Authors {
|
|
|
|
authors: "{prop.authors}",
|
|
|
|
pattern: "{pattern}",
|
|
|
|
},
|
2024-04-30 10:15:56 +02:00
|
|
|
}
|
|
|
|
p {
|
|
|
|
class:"font-normal text-gray-700 dark:text-gray-400",
|
|
|
|
"{prop.description}",
|
2024-04-29 22:48:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-30 10:15:56 +02:00
|
|
|
fn Projects() -> Element {
|
2024-05-21 16:39:11 +02:00
|
|
|
let i18 = use_i18();
|
|
|
|
|
2024-04-30 10:15:56 +02:00
|
|
|
rsx! {
|
2024-05-02 11:04:23 +02:00
|
|
|
div {
|
|
|
|
class: "flex gap-4 items-center flex-wrap",
|
|
|
|
Project {
|
2024-05-21 16:39:11 +02:00
|
|
|
title: translate!(i18, "publications_projects.projects.bachelorproject.title"),
|
|
|
|
authors: translate!(i18, "publications_projects.projects.bachelorproject.authors"),
|
|
|
|
kind: translate!(i18, "publications_projects.projects.bachelorproject.kind"),
|
|
|
|
url: translate!(i18, "publications_projects.projects.bachelorproject.url"),
|
|
|
|
description: translate!(i18, "publications_projects.projects.bachelorproject.description")
|
2024-04-30 10:15:56 +02:00
|
|
|
},
|
2024-05-02 11:04:23 +02:00
|
|
|
Project {
|
2024-05-21 16:39:11 +02:00
|
|
|
title: translate!(i18, "publications_projects.projects.dotfiles.title"),
|
|
|
|
authors: translate!(i18, "publications_projects.projects.dotfiles.authors"),
|
|
|
|
kind: translate!(i18, "publications_projects.projects.dotfiles.kind"),
|
|
|
|
url: translate!(i18, "publications_projects.projects.dotfiles.url"),
|
|
|
|
description: translate!(i18, "publications_projects.projects.dotfiles.description")
|
2024-05-02 11:04:23 +02:00
|
|
|
},
|
|
|
|
Project {
|
2024-05-21 16:39:11 +02:00
|
|
|
title: translate!(i18, "publications_projects.projects.homelab.title"),
|
|
|
|
authors: translate!(i18, "publications_projects.projects.homelab.authors"),
|
|
|
|
kind: translate!(i18, "publications_projects.projects.homelab.kind"),
|
|
|
|
url: translate!(i18, "publications_projects.projects.homelab.url"),
|
|
|
|
description: translate!(i18, "publications_projects.projects.homelab.description")
|
2024-05-02 11:04:23 +02:00
|
|
|
}
|
|
|
|
}
|
2024-04-30 10:15:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-29 22:48:53 +02:00
|
|
|
#[derive(Clone, PartialEq, Props)]
|
2024-04-30 10:15:56 +02:00
|
|
|
struct ProjectProp {
|
2024-04-29 22:48:53 +02:00
|
|
|
#[props(default = "".to_string())]
|
2024-04-30 10:15:56 +02:00
|
|
|
url: String,
|
2024-04-29 22:48:53 +02:00
|
|
|
authors: String,
|
|
|
|
title: String,
|
2024-04-30 10:15:56 +02:00
|
|
|
kind: String,
|
2024-04-29 22:48:53 +02:00
|
|
|
#[props(default = "".to_string())]
|
|
|
|
description: String,
|
|
|
|
}
|
|
|
|
|
2024-04-30 10:15:56 +02:00
|
|
|
fn Project(prop: ProjectProp) -> Element {
|
2024-07-25 03:39:53 +02:00
|
|
|
let pattern = "T.-D. Tran";
|
|
|
|
|
2024-04-29 22:48:53 +02:00
|
|
|
rsx! {
|
|
|
|
Link {
|
|
|
|
class:"block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700",
|
2024-04-30 10:15:56 +02:00
|
|
|
to:"{prop.url}",
|
2024-04-29 22:48:53 +02:00
|
|
|
new_tab: true,
|
|
|
|
h5 {
|
|
|
|
class:"mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white",
|
|
|
|
"{prop.title}",
|
|
|
|
},
|
2024-04-30 10:15:56 +02:00
|
|
|
p { class: "text-lg text-gray-900 dark:text-white", "{prop.kind}" },
|
2024-04-29 22:48:53 +02:00
|
|
|
p {
|
|
|
|
class:"font-normal text-gray-700 dark:text-gray-400",
|
2024-07-25 03:39:53 +02:00
|
|
|
Authors {
|
|
|
|
authors: "{prop.authors}",
|
|
|
|
pattern: "{pattern}",
|
|
|
|
},
|
2024-04-29 22:48:53 +02:00
|
|
|
}
|
|
|
|
p {
|
|
|
|
class:"font-normal text-gray-700 dark:text-gray-400",
|
|
|
|
"{prop.description}",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-07-25 03:39:53 +02:00
|
|
|
|
|
|
|
#[derive(Clone, PartialEq, Props)]
|
|
|
|
struct AuthorProp {
|
|
|
|
authors: String,
|
|
|
|
pattern: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn Authors(prop: AuthorProp) -> Element {
|
|
|
|
if let Some(start) = prop.authors.find(&prop.pattern) {
|
|
|
|
let end = start + prop.pattern.len();
|
|
|
|
let left = &prop.authors[..start];
|
|
|
|
let middle = &prop.authors[start..end];
|
|
|
|
let right = &prop.authors[end..];
|
|
|
|
rsx! {
|
|
|
|
"{left}" , b { "{middle}" }, "{right}",
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
rsx! { "{prop.authors}" }
|
|
|
|
}
|
|
|
|
}
|