This commit is contained in:
Stefan Schwarz 2020-08-14 07:33:36 +02:00
parent 78e19bdfee
commit 7100621f5e

View file

@ -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()
}
}