Actualiza denominaciones en módulos y temas
This commit is contained in:
parent
0b9c53fce1
commit
61813a44e5
4 changed files with 16 additions and 5 deletions
|
|
@ -51,6 +51,9 @@ impl Application {
|
||||||
#[cfg(feature = "database")]
|
#[cfg(feature = "database")]
|
||||||
module::all::run_migrations();
|
module::all::run_migrations();
|
||||||
|
|
||||||
|
// Inicializa los módulos que lo requieran.
|
||||||
|
module::all::init_modules();
|
||||||
|
|
||||||
// Ejecuta la función de inicio de la aplicación.
|
// Ejecuta la función de inicio de la aplicación.
|
||||||
trace::info!("Calling application bootstrap");
|
trace::info!("Calling application bootstrap");
|
||||||
app.bootstrap();
|
app.bootstrap();
|
||||||
|
|
@ -59,8 +62,8 @@ impl Application {
|
||||||
let server = super::HttpServer::new(move || {
|
let server = super::HttpServer::new(move || {
|
||||||
super::App::new()
|
super::App::new()
|
||||||
.wrap(tracing_actix_web::TracingLogger::default())
|
.wrap(tracing_actix_web::TracingLogger::default())
|
||||||
.configure(&module::all::modules)
|
.configure(&module::all::configure_services)
|
||||||
.configure(&theme::all::themes)
|
.configure(&theme::all::configure_services)
|
||||||
.default_service(super::web::route().to(service_not_found))
|
.default_service(super::web::route().to(service_not_found))
|
||||||
})
|
})
|
||||||
.bind(format!(
|
.bind(format!(
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,13 @@ fn add_to_enabled(list: &mut Vec<ModuleStaticRef>, module: ModuleStaticRef) {
|
||||||
|
|
||||||
// CONFIGURE MODULES *******************************************************************************
|
// CONFIGURE MODULES *******************************************************************************
|
||||||
|
|
||||||
pub fn modules(cfg: &mut app::web::ServiceConfig) {
|
pub fn init_modules() {
|
||||||
|
for m in ENABLED_MODULES.read().unwrap().iter() {
|
||||||
|
m.init_module();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn configure_services(cfg: &mut app::web::ServiceConfig) {
|
||||||
for m in ENABLED_MODULES.read().unwrap().iter() {
|
for m in ENABLED_MODULES.read().unwrap().iter() {
|
||||||
m.configure_service(cfg);
|
m.configure_service(cfg);
|
||||||
}
|
}
|
||||||
|
|
@ -87,7 +93,7 @@ pub fn register_actions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "database")]
|
#[cfg(feature = "database")]
|
||||||
pub fn run_migrations() {
|
pub(crate) fn run_migrations() {
|
||||||
run_now({
|
run_now({
|
||||||
struct Migrator;
|
struct Migrator;
|
||||||
impl MigratorTrait for Migrator {
|
impl MigratorTrait for Migrator {
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@ pub trait ModuleTrait: BaseModule + Send + Sync {
|
||||||
vec![]
|
vec![]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn init_module(&self) {}
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
fn configure_service(&self, cfg: &mut app::web::ServiceConfig) {}
|
fn configure_service(&self, cfg: &mut app::web::ServiceConfig) {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ pub fn theme_by_single_name(single_name: &str) -> Option<ThemeStaticRef> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn themes(cfg: &mut app::web::ServiceConfig) {
|
pub fn configure_services(cfg: &mut app::web::ServiceConfig) {
|
||||||
theme_static_files!(cfg, "/theme");
|
theme_static_files!(cfg, "/theme");
|
||||||
|
|
||||||
for t in THEMES.read().unwrap().iter() {
|
for t in THEMES.read().unwrap().iter() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue