mirror of
https://github.com/speatzle/nfsense.git
synced 2025-09-13 15:19:08 +00:00
Add Tera templates support
This commit is contained in:
parent
5d952b736b
commit
ecd71fc6a7
4 changed files with 613 additions and 17 deletions
|
@ -16,10 +16,15 @@ use tracing::info;
|
|||
use tracing_subscriber;
|
||||
use web::auth::SessionState;
|
||||
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
mod api;
|
||||
mod apply;
|
||||
mod config_manager;
|
||||
mod definitions;
|
||||
mod state;
|
||||
mod templates;
|
||||
mod web;
|
||||
|
||||
#[tokio::main]
|
||||
|
|
14
src/templates/mod.rs
Normal file
14
src/templates/mod.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
use tera::Tera;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref TEMPLATES: Tera = {
|
||||
let tera = match Tera::new("src/templates/**/*.net*") {
|
||||
Ok(t) => t,
|
||||
Err(e) => {
|
||||
println!("Parsing error(s): {}", e);
|
||||
::std::process::exit(1);
|
||||
}
|
||||
};
|
||||
tera
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue