add filters for archive raids. add date/time on raid details

This commit is contained in:
peter
2020-05-10 13:15:29 +02:00
parent a949085e62
commit f9110bd2df
13 changed files with 62 additions and 153 deletions
+14 -5
View File
@@ -7,6 +7,7 @@ import * as Path from 'path'
import * as Knex from 'knex';
import * as http from 'http';
import * as express from 'express';
import { existsSync } from "fs";
import { GuildManager } from '../Components/Guild/GuildManager';
import { ItemManager } from '../Components/Item/ItemManager';
import { RaidManager } from '../Components/Raid/RaidManager';
@@ -21,8 +22,6 @@ import { IAdmin } from './Interface';
import { Injector } from '../Injector/Injector';
import { PubSub } from '../Components/PubSub/PubSub';
getLogger().level = 'debug'
@RootComponent({
injectable: IAdmin,
injects: [
@@ -137,14 +136,24 @@ export class FrontworkAdmin
this.express.get('*.*', (req, res) => {
//console.log('*.*', req.path);
res.sendFile(Path.join(__dirname, distFolder, 'browser', decodeURIComponent(req.path)))
res.status(200)
try{
const filepath = Path.join(__dirname, distFolder, 'browser', decodeURIComponent(req.path))
if(!existsSync(filepath)){
throw new Error("Bad file access: "+filepath)
}
res.sendFile(filepath)
res.status(200)
}catch(e){
getLogger('Admin#startWebserver#serveFile').error(String(e))
res.send("404 NOT FOUND")
res.status(404)
}
})
try {
const req = require(distFolder + "/server.js")
await req.attachExpress(this.express, './dist', getLogger('angularSSR#'))
getLogger('Admin#startWebserver').info('Frontend from ' + ngExpressServer + " loaded")
getLogger('Admin#startWebserver').debug('Frontend from ' + ngExpressServer + " loaded")
} catch (e) {
getLogger('Admin#startWebserver').error(e)
getLogger('Admin#startWebserver').warn("No angular SSR module was provided in " + ngExpressServer)