refactored sitekey routes

This commit is contained in:
realaravinth
2021-05-05 12:57:05 +05:30
parent f0254b3b77
commit 6069962d3e
24 changed files with 48 additions and 44 deletions

View File

@@ -37,6 +37,12 @@ lazy_static! {
static ref INDEX: String = IndexPage::default().render_once().unwrap();
}
async fn panel() -> impl Responder {
HttpResponse::Ok()
.content_type("text/html; charset=utf-8")
.body(&*INDEX)
}
pub fn services(cfg: &mut actix_web::web::ServiceConfig) {
use crate::define_resource;
use crate::PAGES;
@@ -45,12 +51,6 @@ pub fn services(cfg: &mut actix_web::web::ServiceConfig) {
sitekey::services(cfg);
}
async fn panel() -> impl Responder {
HttpResponse::Ok()
.content_type("text/html; charset=utf-8")
.body(&*INDEX)
}
pub mod routes {
use super::sitekey::routes::Sitekey;
pub struct Panel {

View File

@@ -26,7 +26,7 @@ lazy_static! {
}
#[derive(TemplateOnce, Clone)]
#[template(path = "panel/add-site-key/index.html")]
#[template(path = "panel/sitekey/add/index.html")]
pub struct IndexPage<'a> {
pub levels: usize,
pub form_title: &'a str,

View File

@@ -24,7 +24,7 @@ use crate::errors::*;
use crate::Data;
#[derive(TemplateOnce, Clone)]
#[template(path = "panel/site-keys/index.html")]
#[template(path = "panel/sitekey/list/index.html")]
pub struct IndexPage {
sitekeys: SiteKeys,
}