You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
43 lines
1.1 KiB
// manager.js
|
|
// Copyright (C) 2024 DTP Technologies, LLC
|
|
// All Rights Reserved
|
|
|
|
'use strict';
|
|
|
|
import express from 'express';
|
|
|
|
import { SiteController } from '../../lib/site-lib.js';
|
|
import { populateClientId, populateProjectId } from './lib/populators.js';
|
|
|
|
export default class ManagerController extends SiteController {
|
|
|
|
static get name ( ) { return 'ManagerController'; }
|
|
static get slug ( ) { return 'manager'; }
|
|
|
|
constructor (dtp) {
|
|
super(dtp, ManagerController.slug);
|
|
}
|
|
|
|
async start ( ) {
|
|
const { dtp } = this;
|
|
const {
|
|
// limiter: limiterService,
|
|
session: sessionService,
|
|
} = dtp.services;
|
|
|
|
// const limiterConfig = limiterService.config.manager;
|
|
const authCheck = sessionService.authCheckMiddleware({ requireLogin: true });
|
|
|
|
const router = express.Router();
|
|
dtp.app.use('/manager', authCheck, router);
|
|
|
|
router.param('clientId', populateClientId(this));
|
|
router.param('projectId', populateProjectId(this));
|
|
|
|
router.get('/', this.getDashboard.bind(this));
|
|
}
|
|
|
|
async getDashboard (req, res) {
|
|
res.render('manager/dashboard');
|
|
}
|
|
}
|