Modifica la forma de identificar temas y módulos
Cada módulo y cada tema requerirá a partir de ahora un identificador que debería ser único y con alguna sintaxis particular aún por definir (por ejemplo, admitiendo sólo minúsculas y sin espacios).
This commit is contained in:
parent
3764f707da
commit
83fd12b5cc
16 changed files with 65 additions and 30 deletions
|
|
@ -1,4 +1,28 @@
|
|||
mod configure;
|
||||
pub use configure::AdminModule;
|
||||
use crate::prelude::*;
|
||||
|
||||
localize!("en-US", "src/base/module/admin/locales");
|
||||
|
||||
mod summary;
|
||||
|
||||
pub struct AdminModule;
|
||||
|
||||
impl Module for AdminModule {
|
||||
fn id(&self) -> &'static str {
|
||||
"admin"
|
||||
}
|
||||
|
||||
fn name(&self) -> String {
|
||||
l("module_name")
|
||||
}
|
||||
|
||||
fn description(&self) -> String {
|
||||
l("module_desc")
|
||||
}
|
||||
|
||||
fn configure_module(&self, cfg: &mut server::web::ServiceConfig) {
|
||||
cfg.service(
|
||||
server::web::scope("/admin")
|
||||
.route("", server::web::get().to(summary::summary))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue