x
This commit is contained in:
parent
78e19bdfee
commit
7100621f5e
1 changed files with 21 additions and 4 deletions
|
@ -1,11 +1,28 @@
|
|||
use crate::db;
|
||||
use askama::Template;
|
||||
|
||||
#[derive(Template)]
|
||||
#[derive(Template, Default)]
|
||||
#[template(path = "index.html")]
|
||||
pub struct IndexTemplate {}
|
||||
pub struct IndexTemplate<'a> {
|
||||
devices: Vec<Device<'a>>,
|
||||
}
|
||||
|
||||
impl IndexTemplate {
|
||||
pub struct Device<'a> {
|
||||
pub macaddr: &'a str,
|
||||
pub nickname: &'a str,
|
||||
pub descr: &'a str,
|
||||
pub privacy: PrivacyLevel,
|
||||
}
|
||||
|
||||
#[repr(u8)]
|
||||
pub enum PrivacyLevel {
|
||||
Public = 1,
|
||||
Private = 2,
|
||||
Internal = 3,
|
||||
}
|
||||
|
||||
impl<'a> IndexTemplate<'a> {
|
||||
pub fn new() -> Self {
|
||||
Self {}
|
||||
Self::default()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue