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
+5
View File
@@ -13523,6 +13523,11 @@
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"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": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz",
+1
View File
@@ -74,6 +74,7 @@
"ng2-smart-table": "1.3.5",
"ngx-cookie-service": "^2.2.0",
"ngx-echarts": "^4.0.1",
"node-fetch": "^2.6.0",
"node-sass": "^4.13.1",
"normalize.css": "6.0.0",
"pace-js": "1.0.2",
+9 -1
View File
@@ -7,11 +7,15 @@ import { resolve } from 'path';
import { enableProdMode } from '@angular/core';
const domino = require('domino');
const win = domino.createWindow('');
const fetch = require('node-fetch');
global['window'] = win;
global['document'] = win.document;
global['alert'] = console.log
global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
global['fetch'] = fetch.default;
export async function attachExpress(app, staticDir = "./dist", logger = console) {
const STATIC_FOLDER = resolve(process.cwd(), staticDir);
@@ -54,6 +58,10 @@ export async function attachExpress(app, staticDir = "./dist", logger = console)
app.get('*', (req, res) => {
//console.log('*', req.path);
res.render(resolve(STATIC_FOLDER, 'browser/index'), { req, res })
try{
res.render(resolve(STATIC_FOLDER, 'browser/index'), { req, res })
}catch(e){
loggerService.error(e)
}
});
}
@@ -15,6 +15,9 @@
<p style="white-space: pre-line;">
{{raid.description}}
</p>
<p>
{{raid.start | date : 'EEE MMM d'}} {{raid.start | date : 'HH:mm'}}
</p>
<div *ngIf="canSignup">
<div *ngIf="isSignedup" style="width: 100%;">
<p style="white-space: pre-line;">
@@ -39,7 +39,15 @@
</nb-card>
<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-item *ngFor="let raid of oldraids" [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 { LoggerService } from '../../services/LoggerService/logger.service';
import { FlashService } from '../../services/flash-service';
import { Tiers, _Tiers } from '../../../../../../backend/Types/Items';
@Component({
selector: 'raids',
@@ -16,11 +17,14 @@ export class FrontcraftRaidsComponent
extends UpdatingComponent
implements OnInit {
archiveCount = 50
tiers:string[] = ["any", ..._Tiers]
tier = "any"
manageRaid
raids = []
oldraids = []
pageSize = 10;
pageSize = 25;
constructor(
injector: Injector,
@@ -47,7 +51,11 @@ export class FrontcraftRaidsComponent
async refresh() {
this.raids = await this.api.get('RaidManager').getRaids()
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() {