Compare commits
2 Commits
b1cb7dff27
...
a908bf0e8a
| Author | SHA1 | Date | |
|---|---|---|---|
| a908bf0e8a | |||
| aeff2b1759 |
@@ -9,6 +9,8 @@ RestartSec=1
|
|||||||
# Change with proper user to run the service
|
# Change with proper user to run the service
|
||||||
User=web
|
User=web
|
||||||
# Change with the installation location of the executable
|
# Change with the installation location of the executable
|
||||||
|
# It is possible to use a custom config file location
|
||||||
|
# by adding '--config /path/to/config.toml' to the command bellow
|
||||||
ExecStart=/usr/share/bin/aindustries-be
|
ExecStart=/usr/share/bin/aindustries-be
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -10,6 +10,28 @@ pub(crate) struct Page {
|
|||||||
body: Vec<Box<dyn Render>>,
|
body: Vec<Box<dyn Render>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) struct PageBuilder {
|
||||||
|
title: Option<String>,
|
||||||
|
head: Option<Vec<Box<dyn Render>>>
|
||||||
|
body: Option<Vec<Box<dyn Render>>>
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PageBuilder {
|
||||||
|
pub(crate) fn new() -> Self {
|
||||||
|
Self {
|
||||||
|
title: None,
|
||||||
|
head: None,
|
||||||
|
body: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn title<T>(mut self, title: T)
|
||||||
|
where T: Into<String>
|
||||||
|
{
|
||||||
|
self.title = Some(title.into());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Render for Vec<Box<dyn Render>> {
|
impl Render for Vec<Box<dyn Render>> {
|
||||||
fn render(&self) -> String {
|
fn render(&self) -> String {
|
||||||
let mut result = String::new();
|
let mut result = String::new();
|
||||||
@@ -45,6 +67,10 @@ impl Render for Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Page {
|
impl Page {
|
||||||
|
pub(crate) fn builder() -> PageBuilder {
|
||||||
|
PageBuilder::new()
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn new<T>(title: T) -> Self
|
pub(crate) fn new<T>(title: T) -> Self
|
||||||
where
|
where
|
||||||
T: Into<String>,
|
T: Into<String>,
|
||||||
|
|||||||
Reference in New Issue
Block a user