|
|
|
@ -8,23 +8,22 @@ const Controller = require('libflitter/controller/Controller')
|
|
|
|
|
*/
|
|
|
|
|
class Home extends Controller {
|
|
|
|
|
static get services() {
|
|
|
|
|
return [...super.services, 'Vue']
|
|
|
|
|
return [...super.services, 'Vue', 'models']
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Serve the main welcome page.
|
|
|
|
|
*/
|
|
|
|
|
welcome(req, res){
|
|
|
|
|
async welcome(req, res){
|
|
|
|
|
const Setting = this.models.get('Setting')
|
|
|
|
|
if ( await Setting.get('home.allow_landing') ) {
|
|
|
|
|
return res.page('welcome', {
|
|
|
|
|
user: req.user,
|
|
|
|
|
...this.Vue.data(),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Return the welcome view.
|
|
|
|
|
* The page() method is added by Flitter and passes some
|
|
|
|
|
* helpful contextual data to the view as well.
|
|
|
|
|
*/
|
|
|
|
|
return res.page('welcome', {
|
|
|
|
|
user: req.user,
|
|
|
|
|
...this.Vue.data(),
|
|
|
|
|
})
|
|
|
|
|
return res.redirect('/dash')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async tmpl(req, res) {
|
|
|
|
|