add filters for archive raids. add date/time on raid details
This commit is contained in:
@@ -8,6 +8,7 @@ plugins
|
|||||||
static
|
static
|
||||||
data
|
data
|
||||||
conf
|
conf
|
||||||
|
log.txt
|
||||||
|
|
||||||
*.d.ts
|
*.d.ts
|
||||||
*.js
|
*.js
|
||||||
|
|||||||
@@ -1,138 +0,0 @@
|
|||||||
[36m[2020-04-12T02:46:02.286] [DEBUG] Admin#makeKnex - [39mMaking new knex: {
|
|
||||||
client: 'sqlite3',
|
|
||||||
connection: {
|
|
||||||
filename: '/home/cake/nitowa.xyz/frontcraft/admin/data/frontworkAdmin.sqlite'
|
|
||||||
},
|
|
||||||
migrations: {
|
|
||||||
directory: '/home/cake/nitowa.xyz/frontcraft/admin/migrations',
|
|
||||||
extension: 'ts'
|
|
||||||
},
|
|
||||||
useNullAsDefault: true
|
|
||||||
}
|
|
||||||
[36m[2020-04-12T02:46:02.426] [DEBUG] Admin#startWebsocket - [39mWebsocket up on 20000
|
|
||||||
[36m[2020-04-12T02:46:02.427] [DEBUG] UserManager#initialize - [39msetting up permissions
|
|
||||||
skipping spec insertion
|
|
||||||
[36m[2020-04-12T02:46:02.613] [DEBUG] Admin#start - [39m6 components initialized
|
|
||||||
[32m[2020-04-12T02:46:03.296] [INFO] Admin#startWebserver - [39mFrontend from /home/cake/nitowa.xyz/frontcraft/admin/dist/server.js loaded
|
|
||||||
[32m[2020-04-12T02:46:03.297] [INFO] Admin#startWebserver - [39mAdmin panel listening for HTTP on *8080
|
|
||||||
[36m[2020-04-12T02:46:42.194] [DEBUG] UserManager#checkConnection - [39m{
|
|
||||||
celinda: {
|
|
||||||
connections: { '45536': [Socket] },
|
|
||||||
auth: { token: [Object], user: [Object], port: 20001 },
|
|
||||||
user: {
|
|
||||||
id: 3,
|
|
||||||
username: 'celinda',
|
|
||||||
rank: 'Officer',
|
|
||||||
MC: 1,
|
|
||||||
BWL: 0,
|
|
||||||
ZG: 1,
|
|
||||||
AQ20: 1,
|
|
||||||
AQ40: 1,
|
|
||||||
Naxx: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} [ 'cfa202ff-5f2c-4e4e-9fa5-9a45233ab0e0' ]
|
|
||||||
[36m[2020-04-12T02:49:29.208] [DEBUG] UserManager#closeHandler - [39m{
|
|
||||||
celinda: {
|
|
||||||
connections: {},
|
|
||||||
auth: { token: [Object], user: [Object], port: 20001 },
|
|
||||||
user: {
|
|
||||||
id: 3,
|
|
||||||
username: 'celinda',
|
|
||||||
rank: 'Officer',
|
|
||||||
MC: 1,
|
|
||||||
BWL: 0,
|
|
||||||
ZG: 1,
|
|
||||||
AQ20: 1,
|
|
||||||
AQ40: 1,
|
|
||||||
Naxx: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} [ 'cfa202ff-5f2c-4e4e-9fa5-9a45233ab0e0' ]
|
|
||||||
[36m[2020-04-12T02:49:31.572] [DEBUG] UserManager#checkConnection - [39m{
|
|
||||||
celinda: {
|
|
||||||
connections: { '46948': [Socket] },
|
|
||||||
auth: { token: [Object], user: [Object], port: 20001 },
|
|
||||||
user: {
|
|
||||||
id: 3,
|
|
||||||
username: 'celinda',
|
|
||||||
rank: 'Officer',
|
|
||||||
MC: 1,
|
|
||||||
BWL: 0,
|
|
||||||
ZG: 1,
|
|
||||||
AQ20: 1,
|
|
||||||
AQ40: 1,
|
|
||||||
Naxx: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} [ 'cfa202ff-5f2c-4e4e-9fa5-9a45233ab0e0' ]
|
|
||||||
[36m[2020-04-12T02:49:37.031] [DEBUG] UserManager#closeHandler - [39m{
|
|
||||||
celinda: {
|
|
||||||
connections: {},
|
|
||||||
auth: { token: [Object], user: [Object], port: 20001 },
|
|
||||||
user: {
|
|
||||||
id: 3,
|
|
||||||
username: 'celinda',
|
|
||||||
rank: 'Officer',
|
|
||||||
MC: 1,
|
|
||||||
BWL: 0,
|
|
||||||
ZG: 1,
|
|
||||||
AQ20: 1,
|
|
||||||
AQ40: 1,
|
|
||||||
Naxx: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} [ 'cfa202ff-5f2c-4e4e-9fa5-9a45233ab0e0' ]
|
|
||||||
[36m[2020-04-12T02:49:38.886] [DEBUG] UserManager#checkConnection - [39m{
|
|
||||||
celinda: {
|
|
||||||
connections: { '47044': [Socket] },
|
|
||||||
auth: { token: [Object], user: [Object], port: 20001 },
|
|
||||||
user: {
|
|
||||||
id: 3,
|
|
||||||
username: 'celinda',
|
|
||||||
rank: 'Officer',
|
|
||||||
MC: 1,
|
|
||||||
BWL: 0,
|
|
||||||
ZG: 1,
|
|
||||||
AQ20: 1,
|
|
||||||
AQ40: 1,
|
|
||||||
Naxx: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} [ 'cfa202ff-5f2c-4e4e-9fa5-9a45233ab0e0' ]
|
|
||||||
[36m[2020-04-12T02:49:44.132] [DEBUG] UserManager#closeHandler - [39m{} []
|
|
||||||
[36m[2020-04-12T02:52:10.916] [DEBUG] UserManager#checkConnection - [39m{
|
|
||||||
celinda: {
|
|
||||||
connections: { '48390': [Socket] },
|
|
||||||
auth: { token: [Object], user: [Object], port: 20001 },
|
|
||||||
user: {
|
|
||||||
id: 3,
|
|
||||||
username: 'celinda',
|
|
||||||
rank: 'Officer',
|
|
||||||
MC: 1,
|
|
||||||
BWL: 0,
|
|
||||||
ZG: 0,
|
|
||||||
AQ20: 1,
|
|
||||||
AQ40: 1,
|
|
||||||
Naxx: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} [ '7a8bbb51-412a-4bee-9e0e-9b7cbaef82d8' ]
|
|
||||||
[32m[2020-04-12T02:52:47.682] [INFO] process#SIGINT - [39mShutting down from SIGINT (Ctrl-C)
|
|
||||||
[36m[2020-04-12T02:52:47.684] [DEBUG] UserManager#closeHandler - [39m{
|
|
||||||
celinda: {
|
|
||||||
connections: {},
|
|
||||||
auth: { token: [Object], user: [Object], port: 20001 },
|
|
||||||
user: {
|
|
||||||
id: 3,
|
|
||||||
username: 'celinda',
|
|
||||||
rank: 'Officer',
|
|
||||||
MC: 1,
|
|
||||||
BWL: 0,
|
|
||||||
ZG: 0,
|
|
||||||
AQ20: 1,
|
|
||||||
AQ40: 1,
|
|
||||||
Naxx: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} [ '7a8bbb51-412a-4bee-9e0e-9b7cbaef82d8' ]
|
|
||||||
+2
-1
@@ -5,7 +5,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"knex": "knex",
|
"knex": "knex",
|
||||||
"launch": "node lib/src/backend/Launcher.js > log.txt",
|
"launch": "npm run debug > log.txt",
|
||||||
|
"debug": "node lib/src/backend/Launcher.js",
|
||||||
"start": "npm run build && npm run launch",
|
"start": "npm run build && npm run launch",
|
||||||
"start-backend": "npm run build-backend && npm run launch",
|
"start-backend": "npm run build-backend && npm run launch",
|
||||||
"test": "rm -rf data && npm run build-backend && mocha lib/test/backendTest.js",
|
"test": "rm -rf data && npm run build-backend && mocha lib/test/backendTest.js",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import * as Path from 'path'
|
|||||||
import * as Knex from 'knex';
|
import * as Knex from 'knex';
|
||||||
import * as http from 'http';
|
import * as http from 'http';
|
||||||
import * as express from 'express';
|
import * as express from 'express';
|
||||||
|
import { existsSync } from "fs";
|
||||||
import { GuildManager } from '../Components/Guild/GuildManager';
|
import { GuildManager } from '../Components/Guild/GuildManager';
|
||||||
import { ItemManager } from '../Components/Item/ItemManager';
|
import { ItemManager } from '../Components/Item/ItemManager';
|
||||||
import { RaidManager } from '../Components/Raid/RaidManager';
|
import { RaidManager } from '../Components/Raid/RaidManager';
|
||||||
@@ -21,8 +22,6 @@ import { IAdmin } from './Interface';
|
|||||||
import { Injector } from '../Injector/Injector';
|
import { Injector } from '../Injector/Injector';
|
||||||
import { PubSub } from '../Components/PubSub/PubSub';
|
import { PubSub } from '../Components/PubSub/PubSub';
|
||||||
|
|
||||||
getLogger().level = 'debug'
|
|
||||||
|
|
||||||
@RootComponent({
|
@RootComponent({
|
||||||
injectable: IAdmin,
|
injectable: IAdmin,
|
||||||
injects: [
|
injects: [
|
||||||
@@ -137,14 +136,24 @@ export class FrontworkAdmin
|
|||||||
|
|
||||||
this.express.get('*.*', (req, res) => {
|
this.express.get('*.*', (req, res) => {
|
||||||
//console.log('*.*', req.path);
|
//console.log('*.*', req.path);
|
||||||
res.sendFile(Path.join(__dirname, distFolder, 'browser', decodeURIComponent(req.path)))
|
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)
|
res.status(200)
|
||||||
|
}catch(e){
|
||||||
|
getLogger('Admin#startWebserver#serveFile').error(String(e))
|
||||||
|
res.send("404 NOT FOUND")
|
||||||
|
res.status(404)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const req = require(distFolder + "/server.js")
|
const req = require(distFolder + "/server.js")
|
||||||
await req.attachExpress(this.express, './dist', getLogger('angularSSR#'))
|
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) {
|
} catch (e) {
|
||||||
getLogger('Admin#startWebserver').error(e)
|
getLogger('Admin#startWebserver').error(e)
|
||||||
getLogger('Admin#startWebserver').warn("No angular SSR module was provided in " + ngExpressServer)
|
getLogger('Admin#startWebserver').warn("No angular SSR module was provided in " + ngExpressServer)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { getSpecTableData, SpecT } from "../../Types/PlayerSpecs";
|
|||||||
import { IAdmin } from "../../Admin/Interface";
|
import { IAdmin } from "../../Admin/Interface";
|
||||||
import { IUserManager } from "../User/Interface";
|
import { IUserManager } from "../User/Interface";
|
||||||
import { ICharacterManager } from "./Interface";
|
import { ICharacterManager } from "./Interface";
|
||||||
|
import { getLogger } from "log4js";
|
||||||
|
|
||||||
@Injectable(ICharacterManager)
|
@Injectable(ICharacterManager)
|
||||||
export class CharacterManager
|
export class CharacterManager
|
||||||
@@ -61,7 +62,9 @@ implements FrontworkComponent<CharacterManagerIfc, RPCInterface>, ICharacterMana
|
|||||||
initialize = async () => {
|
initialize = async () => {
|
||||||
if(this.initialized) return
|
if(this.initialized) return
|
||||||
this.initialized = true
|
this.initialized = true
|
||||||
await this.admin.knex('specs').insert(getSpecTableData()).catch(e => { console.log("skipping spec insertion") })
|
await this.admin.knex('specs').insert(getSpecTableData()).catch(e => {
|
||||||
|
getLogger('CharacterManager#createCharacter').debug("skipping spec insertion")
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
createCharacter = async (userToken: string, character : Character) : Promise<Character> => {
|
createCharacter = async (userToken: string, character : Character) : Promise<Character> => {
|
||||||
@@ -72,7 +75,7 @@ implements FrontworkComponent<CharacterManagerIfc, RPCInterface>, ICharacterMana
|
|||||||
const char : Character = await this.admin.knex.select('*').from('characters').where(character).first()
|
const char : Character = await this.admin.knex.select('*').from('characters').where(character).first()
|
||||||
return char
|
return char
|
||||||
}catch(e){
|
}catch(e){
|
||||||
console.log(e);
|
getLogger('CharacterManager#createCharacter').error(e);
|
||||||
}
|
}
|
||||||
throw new Error('Unable to create character')
|
throw new Error('Unable to create character')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ import { IRaidManager } from "../Raid/Interface";
|
|||||||
import { IItemManager } from "../Item/Interface";
|
import { IItemManager } from "../Item/Interface";
|
||||||
import { IGuildManager } from "../Guild/Interface";
|
import { IGuildManager } from "../Guild/Interface";
|
||||||
|
|
||||||
getLogger().level = "debug"
|
|
||||||
|
|
||||||
const uuid = require('uuid/v4')
|
const uuid = require('uuid/v4')
|
||||||
|
|
||||||
const salt = "6pIbc6yjSN"
|
const salt = "6pIbc6yjSN"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { Injector } from './Injector/Injector';
|
import { Injector } from './Injector/Injector';
|
||||||
import { IAdmin } from './Admin/Interface';
|
import { IAdmin } from './Admin/Interface';
|
||||||
import "./Admin/Admin"
|
import "./Admin/Admin"
|
||||||
require('events').EventEmitter.defaultMaxListeners = 0;
|
import {getLogger} from 'log4js';
|
||||||
|
getLogger().level = "debug"
|
||||||
|
|
||||||
|
require('events').EventEmitter.defaultMaxListeners = 0;
|
||||||
Injector.resolve<IAdmin>(IAdmin).start()
|
Injector.resolve<IAdmin>(IAdmin).start()
|
||||||
Generated
+5
@@ -13523,6 +13523,11 @@
|
|||||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node-fetch": {
|
||||||
|
"version": "2.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||||
|
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||||
|
},
|
||||||
"node-fetch-npm": {
|
"node-fetch-npm": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz",
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
"ng2-smart-table": "1.3.5",
|
"ng2-smart-table": "1.3.5",
|
||||||
"ngx-cookie-service": "^2.2.0",
|
"ngx-cookie-service": "^2.2.0",
|
||||||
"ngx-echarts": "^4.0.1",
|
"ngx-echarts": "^4.0.1",
|
||||||
|
"node-fetch": "^2.6.0",
|
||||||
"node-sass": "^4.13.1",
|
"node-sass": "^4.13.1",
|
||||||
"normalize.css": "6.0.0",
|
"normalize.css": "6.0.0",
|
||||||
"pace-js": "1.0.2",
|
"pace-js": "1.0.2",
|
||||||
|
|||||||
@@ -7,11 +7,15 @@ import { resolve } from 'path';
|
|||||||
import { enableProdMode } from '@angular/core';
|
import { enableProdMode } from '@angular/core';
|
||||||
const domino = require('domino');
|
const domino = require('domino');
|
||||||
const win = domino.createWindow('');
|
const win = domino.createWindow('');
|
||||||
|
const fetch = require('node-fetch');
|
||||||
|
|
||||||
global['window'] = win;
|
global['window'] = win;
|
||||||
global['document'] = win.document;
|
global['document'] = win.document;
|
||||||
global['alert'] = console.log
|
global['alert'] = console.log
|
||||||
global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
|
global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
|
||||||
|
global['fetch'] = fetch.default;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export async function attachExpress(app, staticDir = "./dist", logger = console) {
|
export async function attachExpress(app, staticDir = "./dist", logger = console) {
|
||||||
const STATIC_FOLDER = resolve(process.cwd(), staticDir);
|
const STATIC_FOLDER = resolve(process.cwd(), staticDir);
|
||||||
@@ -54,6 +58,10 @@ export async function attachExpress(app, staticDir = "./dist", logger = console)
|
|||||||
|
|
||||||
app.get('*', (req, res) => {
|
app.get('*', (req, res) => {
|
||||||
//console.log('*', req.path);
|
//console.log('*', req.path);
|
||||||
|
try{
|
||||||
res.render(resolve(STATIC_FOLDER, 'browser/index'), { req, res })
|
res.render(resolve(STATIC_FOLDER, 'browser/index'), { req, res })
|
||||||
|
}catch(e){
|
||||||
|
loggerService.error(e)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
<p style="white-space: pre-line;">
|
<p style="white-space: pre-line;">
|
||||||
{{raid.description}}
|
{{raid.description}}
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
{{raid.start | date : 'EEE MMM d'}} {{raid.start | date : 'HH:mm'}}
|
||||||
|
</p>
|
||||||
<div *ngIf="canSignup">
|
<div *ngIf="canSignup">
|
||||||
<div *ngIf="isSignedup" style="width: 100%;">
|
<div *ngIf="isSignedup" style="width: 100%;">
|
||||||
<p style="white-space: pre-line;">
|
<p style="white-space: pre-line;">
|
||||||
|
|||||||
@@ -39,7 +39,15 @@
|
|||||||
</nb-card>
|
</nb-card>
|
||||||
|
|
||||||
<nb-card class="col-12 col-xl-9">
|
<nb-card class="col-12 col-xl-9">
|
||||||
<nb-card-header>Previous raids</nb-card-header>
|
<nb-card-header>Previous raids (Limit <input nbInput style="width: 100px;" type="number" [(ngModel)]="archiveCount" (change)="refresh()" />
|
||||||
|
Showing only tier
|
||||||
|
<nb-select [(selected)]="tier" placeholder="Tier" (selectedChange)="refresh()">
|
||||||
|
<nb-option *ngFor="let _tier of tiers" [value]="_tier">
|
||||||
|
{{_tier}}
|
||||||
|
</nb-option>
|
||||||
|
</nb-select>
|
||||||
|
)
|
||||||
|
</nb-card-header>
|
||||||
<nb-list nbInfiniteList listenWindowScroll [threshold]="500">
|
<nb-list nbInfiniteList listenWindowScroll [threshold]="500">
|
||||||
<nb-list-item *ngFor="let raid of oldraids" [routerLink]="'/frontcraft/archive/'+raid.id">
|
<nb-list-item *ngFor="let raid of oldraids" [routerLink]="'/frontcraft/archive/'+raid.id">
|
||||||
<a [routerLink]="'/frontcraft/archive/'+raid.id">
|
<a [routerLink]="'/frontcraft/archive/'+raid.id">
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { IApiService } from '../../services/ApiService/ApiService';
|
|||||||
import { UpdatingComponent } from '../../UpdatingComponent';
|
import { UpdatingComponent } from '../../UpdatingComponent';
|
||||||
import { LoggerService } from '../../services/LoggerService/logger.service';
|
import { LoggerService } from '../../services/LoggerService/logger.service';
|
||||||
import { FlashService } from '../../services/flash-service';
|
import { FlashService } from '../../services/flash-service';
|
||||||
|
import { Tiers, _Tiers } from '../../../../../../backend/Types/Items';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'raids',
|
selector: 'raids',
|
||||||
@@ -16,11 +17,14 @@ export class FrontcraftRaidsComponent
|
|||||||
extends UpdatingComponent
|
extends UpdatingComponent
|
||||||
implements OnInit {
|
implements OnInit {
|
||||||
|
|
||||||
|
archiveCount = 50
|
||||||
|
tiers:string[] = ["any", ..._Tiers]
|
||||||
|
tier = "any"
|
||||||
|
|
||||||
manageRaid
|
manageRaid
|
||||||
raids = []
|
raids = []
|
||||||
oldraids = []
|
oldraids = []
|
||||||
pageSize = 10;
|
pageSize = 25;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
injector: Injector,
|
injector: Injector,
|
||||||
@@ -47,7 +51,11 @@ export class FrontcraftRaidsComponent
|
|||||||
async refresh() {
|
async refresh() {
|
||||||
this.raids = await this.api.get('RaidManager').getRaids()
|
this.raids = await this.api.get('RaidManager').getRaids()
|
||||||
const raidManager = this.api.get('RaidManager')
|
const raidManager = this.api.get('RaidManager')
|
||||||
this.oldraids = await raidManager.getPastRaids(10)
|
this.oldraids = await raidManager.getPastRaids(this.archiveCount)
|
||||||
|
|
||||||
|
if(this.tier !== "any"){
|
||||||
|
this.oldraids = this.oldraids.filter(raid => raid.tier === this.tier)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
|
|||||||
Reference in New Issue
Block a user