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")]
|
||||
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.
|
||||
trace::info!("Calling application bootstrap");
|
||||
app.bootstrap();
|
||||
|
|
@ -59,8 +62,8 @@ impl Application {
|
|||
let server = super::HttpServer::new(move || {
|
||||
super::App::new()
|
||||
.wrap(tracing_actix_web::TracingLogger::default())
|
||||
.configure(&module::all::modules)
|
||||
.configure(&theme::all::themes)
|
||||
.configure(&module::all::configure_services)
|
||||
.configure(&theme::all::configure_services)
|
||||
.default_service(super::web::route().to(service_not_found))
|
||||
})
|
||||
.bind(format!(
|
||||
|
|
|
|||
|
|
@ -72,7 +72,13 @@ fn add_to_enabled(list: &mut Vec<ModuleStaticRef>, module: ModuleStaticRef) {
|
|||
|
||||
// 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() {
|
||||
m.configure_service(cfg);
|
||||
}
|
||||
|
|
@ -87,7 +93,7 @@ pub fn register_actions() {
|
|||
}
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
pub fn run_migrations() {
|
||||
pub(crate) fn run_migrations() {
|
||||
run_now({
|
||||
struct Migrator;
|
||||
impl MigratorTrait for Migrator {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ pub trait ModuleTrait: BaseModule + Send + Sync {
|
|||
vec![]
|
||||
}
|
||||
|
||||
fn init_module(&self) {}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
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");
|
||||
|
||||
for t in THEMES.read().unwrap().iter() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue