Merge remote-tracking branch 'origin' into ip-session-age
This commit is contained in:
commit
af6e958c49
27 changed files with 6770 additions and 1420 deletions
|
|
@ -36,6 +36,9 @@ function getBaseUrl(res) {
|
|||
* Renders and serves a pug template
|
||||
*/
|
||||
function sendPug(res, view, locals) {
|
||||
if (!locals) {
|
||||
locals = {};
|
||||
}
|
||||
locals.loggedIn = locals.loggedIn || !!res.user;
|
||||
locals.loginName = locals.loginName || res.user ? res.user.name : false;
|
||||
locals.superadmin = locals.superadmin || res.user ? res.user.global_rank >= 255 : false;
|
||||
|
|
|
|||
7
src/web/routes/google_drive_userscript.js
Normal file
7
src/web/routes/google_drive_userscript.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { sendPug } from '../pug';
|
||||
|
||||
export default function initialize(app) {
|
||||
app.get('/google_drive_userscript', (req, res) => {
|
||||
return sendPug(res, 'google_drive_userscript')
|
||||
});
|
||||
}
|
||||
|
|
@ -178,6 +178,7 @@ module.exports = {
|
|||
require('./account').init(app);
|
||||
require('./acp').init(app);
|
||||
require('../google2vtt').attach(app);
|
||||
require('./routes/google_drive_userscript')(app);
|
||||
app.use(serveStatic(path.join(__dirname, '..', '..', 'www'), {
|
||||
maxAge: webConfig.getCacheTTL()
|
||||
}));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue