Browse Source

rc 0.0.0.1

master
gsd 3 months ago
parent
commit
34135b68ce
  1. 4
      src/app/app-routing.module.ts
  2. 6
      src/app/app.module.ts
  3. 12
      src/app/entities/DonateStat.ts
  4. 52
      src/app/pages/about-page/about-page.component.html
  5. 3
      src/app/pages/about-page/about-page.component.scss
  6. 20
      src/app/pages/about-page/about-page.component.ts
  7. 131
      src/app/pages/internal-components/DonateSearchTable.ts
  8. 6
      src/app/pages/profile-page/profile-page.component.html
  9. 25
      src/app/pages/statistic-page/statistic-page.component.html
  10. 2
      src/app/pages/statistic-page/statistic-page.component.scss
  11. 28
      src/app/pages/statistic-page/statistic-page.component.ts
  12. 12
      src/app/services/vip.service.ts

4
src/app/app-routing.module.ts

@ -9,6 +9,7 @@ import {MessagesPageComponent} from "./pages/messages-page/messages-page.compone
import {VipPageComponent} from "./pages/vip-page/vip-page.component";
import {DowngamePageComponent} from "./pages/downgame-page/downgame-page.component";
import {StatisticPageComponent} from "./pages/statistic-page/statistic-page.component";
import {AboutPageComponent} from "./pages/about-page/about-page.component";
const routes: Routes = [
{ path: "", component: MainPageComponent},
@ -19,7 +20,8 @@ const routes: Routes = [
{ path: "messages", component: MessagesPageComponent },
{ path: "vip", component: VipPageComponent },
{ path: "putisRun", component: DowngamePageComponent },
{ path: "statistic", component: StatisticPageComponent }
{ path: "statistic", component: StatisticPageComponent },
{ path: "about", component: AboutPageComponent }
];
@NgModule({

6
src/app/app.module.ts

@ -68,6 +68,8 @@ import {MatCheckboxModule} from "@angular/material/checkbox";
import {PromocodeService} from "./services/promocode.service";
import { DowngamePageComponent } from './pages/downgame-page/downgame-page.component';
import { StatisticPageComponent } from './pages/statistic-page/statistic-page.component';
import {DonateSearchTable} from "./pages/internal-components/DonateSearchTable";
import { AboutPageComponent } from './pages/about-page/about-page.component';
registerLocaleData(localeRu, "ru")
@ -88,6 +90,7 @@ registerLocaleData(localeRu, "ru")
MessageSearchTable,
BanlistSearchTable,
AnnoncesListCarules,
DonateSearchTable,
//search filters
FilterMatChipAccount,
FilterMatChipMessage,
@ -105,7 +108,8 @@ registerLocaleData(localeRu, "ru")
VipFreeDialog,
VipPromocodeDialog,
DowngamePageComponent,
StatisticPageComponent
StatisticPageComponent,
AboutPageComponent
],
imports: [
BrowserModule,

12
src/app/entities/DonateStat.ts

@ -0,0 +1,12 @@
export class DonateStat {
amount!:number;
utime!:number;
timestamp!:Date;
accountId!:number;
tf2Keys!:number;
tf2Refs!:number;
rubles!:number;
beExtended!:string;
accountName!:string;
status!:string;
}

52
src/app/pages/about-page/about-page.component.html

@ -0,0 +1,52 @@
<div class="content-in-center-header" style="flex-direction: column;">
<h1>О нас</h1>
<h3>Ваши любимые "Факты 13". Существуем с 2018 по {{getYear()}}!</h3>
</div>
<div class="content-in-center">
<div class="content-in-border">
<p>Факты 13 — это дружный сервачок русского народа, где вы можете хорошо отдохнуть со своими друзьями или тупыми рандомами после школы или завода.</p>
</div>
<div class="content-in-border">
<p>У нас обширный список серверов, на котором стоят уникальные карты, сделанные картоделом <a href="https://steamcommunity.com/id/pycckuu_nytuh/">Русский Путин</a></p>
</div>
<div class="content-in-border">
<p>Прекрасные плагины недающие заскучать и написанные таким же прекрасным кодером <a href="https://steamcommunity.com/id/catxakep/">ОТДЫХАЕМ</a></p>
</div>
<div class="content-in-border">
<p>Зачем ждать? Заходи сейчас! Если админ не разлил пиво на сервера</p>
</div>
<div class="content-in-border">
<p>Мы стараемся держаться открытости говнокода, чтоб у вас не было мысли что мы пытаемся вас наебать. Можешь проверить кпопки ниже.</p>
<div class="container responsive-grid-250">
<mat-card (click)="actionService.goToUrlViaTab('https://git.pblr-nyk.pro/gsd/Facti13.Web.Backend.Java.V2')">
<mat-card-title>Backend</mat-card-title>
<mat-card-subtitle>"стабильность"</mat-card-subtitle>
</mat-card>
<mat-card (click)="actionService.goToUrlViaTab('https://git.pblr-nyk.pro/gsd/Facti13.Frontend.Angular')">
<mat-card-title>Frontend</mat-card-title>
<mat-card-subtitle>"дизайн"</mat-card-subtitle>
</mat-card>
<mat-card (click)="actionService.goToUrlViaTab('https://git.pblr-nyk.pro/gsd/Facti13.HundredPlayers.Plugins')">
<mat-card-title>Плагины</mat-card-title>
<mat-card-subtitle>не все</mat-card-subtitle>
</mat-card>
<mat-card (click)="actionService.goToUrlViaTab('https://git.pblr-nyk.pro/gsd/Facti13.Bot.Discord.V2')">
<mat-card-title>DiscordBot</mat-card-title>
<mat-card-subtitle>гебня бот</mat-card-subtitle>
</mat-card>
<mat-card (click)="actionService.goToUrlViaTab('https://git.pblr-nyk.pro/gsd/SourceManager')">
<mat-card-title>SourceManager</mat-card-title>
<mat-card-subtitle>руль этой помойки</mat-card-subtitle>
</mat-card>
<mat-card (click)="actionService.goToUrlViaTab('https://git.pblr-nyk.pro/gsd/Facti13.SteamTradeBot.JS.v1')">
<mat-card-title>TradeBot</mat-card-title>
<mat-card-subtitle>иногда работает</mat-card-subtitle>
</mat-card>
</div>
</div>
</div>

3
src/app/pages/about-page/about-page.component.scss

@ -0,0 +1,3 @@
::ng-deep mat-card {
cursor: pointer;
}

20
src/app/pages/about-page/about-page.component.ts

@ -0,0 +1,20 @@
import { Component, OnInit } from '@angular/core';
import {ActionService} from "../../services/action.service";
@Component({
selector: 'app-about-page',
templateUrl: './about-page.component.html',
styleUrls: ['./about-page.component.scss']
})
export class AboutPageComponent implements OnInit {
constructor(public actionService: ActionService) { }
ngOnInit(): void {
}
getYear():number {
return new Date().getFullYear();
}
}

131
src/app/pages/internal-components/DonateSearchTable.ts

@ -0,0 +1,131 @@
import {AbstractSearchTable} from "./abstract-search-table.component";
import {SearchFilter} from "../../entities/search/SearchFilter";
import {DonateStat} from "../../entities/DonateStat";
import {Component} from "@angular/core";
import {AuthService} from "../../services/auth.service";
import {ServerService} from "../../services/server.service";
import {PlayerService} from "../../services/player.service";
import {ActivatedRoute, Router} from "@angular/router";
import {VipService} from "../../services/vip.service";
import {MatTableDataSource} from "@angular/material/table";
@Component({
selector: 'app-donate-search-table',
template: `
<div style="padding-bottom: 10px;">
<mat-chip-list>
<mat-chip [matMenuTriggerFor]="addFilter">Искать по...</mat-chip>
<mat-menu #addFilter>
<button mat-menu-item (click)="filter.addAccountToSearch('')" [disabled]="account_id!=null">Профилю</button>
<button mat-menu-item [matMenuTriggerFor]="timeSelect">Времени</button>
</mat-menu>
<mat-menu #timeSelect>
<button mat-menu-item (click)="filter.addEndTimeToSearch()">До ...</button>
<button mat-menu-item (click)="filter.addBeginTimeToSearch()">После ...</button>
</mat-menu>
<mat-chip *ngIf="filter.updated" (click)="updateData()">Обновить</mat-chip>
<app-filter-mat-chip-account
[filter]="filter"
[hidden]="account_id!=null"
></app-filter-mat-chip-account>
<app-filter-mat-chip-date-begin
[filter]="filter">
</app-filter-mat-chip-date-begin>
<app-filter-mat-chip-date-end
[filter]="filter">
</app-filter-mat-chip-date-end>
</mat-chip-list>
</div>
<div>
<div class="loading-shade"
*ngIf="loading || err">
<mat-spinner *ngIf="loading"></mat-spinner>
<div class="err" *ngIf="err">
Слишком много запросов или сервер не отвечает, обнови страницу.
<br>
<button mat-button (click)="err=false; loading=false">Закрыть</button>
</div>
</div>
<table mat-table [dataSource]="dataSource" style="width: 100%">
<ng-container matColumnDef="accountName">
<th mat-header-cell *matHeaderCellDef> Имя игрока </th>
<td mat-cell *matCellDef="let row" [matMenuTriggerFor]="accountMenu"> {{row.accountName}}
<mat-menu #accountMenu>
<button mat-menu-item (click)="filter.addAccountToSearch(row.accountName)" [disabled]="!row.accountName">Добавить в поиск</button>
<button mat-menu-item (click)="filter.addAccountToSearch('[U:1:'+row.accountId+']')">Добавить в поиск используя ID</button>
<button mat-menu-item (click)="authService.searchPlayer(row.accountId)">Открыть профиль</button>
</mat-menu></td>
</ng-container>
<ng-container matColumnDef="timestamp">
<th mat-header-cell *matHeaderCellDef> Время </th>
<td mat-cell *matCellDef="let row" [matMenuTriggerFor]="dateMenu"> {{row.timestamp | date:"HH:mm dd/MM/yyyy"}}
<mat-menu #dateMenu>
<button mat-menu-item (click)="filter.addEndTimeToSearch(row.timestamp)">Искать до {{row.timestamp | date:"HH:mm:ss dd/MM/yyyy"}}</button>
<button mat-menu-item (click)="filter.addBeginTimeToSearch(row.timestamp)">Искать после {{row.timestamp | date:"HH:mm:ss dd/MM/yyyy"}}</button>
</mat-menu></td>
</ng-container>
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef>Статус</th>
<td mat-cell *matCellDef="let row"> {{row.status}}</td>
</ng-container>
<ng-container matColumnDef="amount">
<th mat-header-cell *matHeaderCellDef>Выдано на</th>
<td mat-cell *matCellDef="let row"> {{getFancyAmount(row.amount)}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<!-- Row shown when there is no matching data. -->
<div *ngIf="!loading">
<tr class="mat-row" *matNoDataRow>
<td class="mat-cell" colspan="4">Но никто не пришел...</td>
</tr>
</div>
</table>
<mat-paginator
[pageSizeOptions]="[5, 10, 25, 100]"
[pageSize]="10"
(page)="updateData()"
></mat-paginator>
</div>
`
})
export class DonateSearchTable extends AbstractSearchTable<DonateStat, SearchFilter> {
displayedColumns: string[] = ['accountName', 'timestamp', 'status', 'amount'];
constructor(authService: AuthService,
serverService: ServerService,
playerService: PlayerService,
router: Router,
route: ActivatedRoute,
private vipService: VipService) {
super(authService, serverService, playerService, route, router);
super.filter = new SearchFilter();
}
private getDonateStat(): boolean {
this.filter.updated = false;
this.loading = true;
this.vipService.getDonateStat(this.filter, this.paginator).subscribe(
(res) => {
this.dataSource = new MatTableDataSource<DonateStat>(res.data)
this.err = false;
}, (e) => this.err = true, () => this.loading = false
)
return true;
}
override updateData() {
super.updateData();
this.getDonateStat();
}
getFancyAmount(amount: number):string {
if (amount == -1) return '';
if (amount <= 24 * 60 * 60) return `${amount/60} минут`;
else return `${amount/(24 * 60 * 60)} день`;
}
}

6
src/app/pages/profile-page/profile-page.component.html

@ -123,15 +123,13 @@
<app-banlist-search-table [account_id]="profile.steamids.account_id"></app-banlist-search-table>
</mat-expansion-panel>
<mat-expansion-panel hideToggle>
<mat-expansion-panel hideToggle *ngIf="profile!=null && profile.steamids!=null">
<mat-expansion-panel-header>
<mat-panel-title>
История получения VIP
</mat-panel-title>
</mat-expansion-panel-header>
<div>
<p>Табличка где каво когда </p>
</div>
<app-donate-search-table [account_id]="profile.steamids.account_id"></app-donate-search-table>
</mat-expansion-panel>
<mat-expansion-panel hideToggle>
<mat-expansion-panel-header>

25
src/app/pages/statistic-page/statistic-page.component.html

@ -51,10 +51,31 @@
</div>
<div class="content-in-border">
<h2>Уникальные игроки</h2>
<div></div>
<h4>За "уникальность" берется игрок который зашел за данный период первый раз и поиграл более 5 минут</h4>
<div class="container responsive-grid-250">
<mat-card>
<mat-card-title>{{uniq.day}}</mat-card-title>
<mat-card-subtitle>игроков за день</mat-card-subtitle>
</mat-card>
<mat-card>
<mat-card-title>{{uniq.month}}</mat-card-title>
<mat-card-subtitle>игроков за месяц</mat-card-subtitle>
</mat-card>
<mat-card>
<mat-card-title>{{uniq.year}}</mat-card-title>
<mat-card-subtitle>игроков за год</mat-card-subtitle>
</mat-card>
<mat-card>
<mat-card-title>{{uniq.total}}</mat-card-title>
<mat-card-subtitle>игроков за всё время</mat-card-subtitle>
</mat-card>
</div>
</div>
<div class="content-in-border">
<h2>Последние выданые випки</h2>
<div></div>
<div>
<app-need-auth-to-continue *ngIf="!authService.isAuth()"></app-need-auth-to-continue>
<app-donate-search-table *ngIf="authService.isAuth()"></app-donate-search-table>
</div>
</div>
</div>

2
src/app/pages/statistic-page/statistic-page.component.scss

@ -1,3 +1,3 @@
h2 {
h2,h5,h4 {
color: #000000;
}

28
src/app/pages/statistic-page/statistic-page.component.ts

@ -3,6 +3,9 @@ import {GraphService} from "../../services/graph.service";
import {Chart} from "chart.js/auto";
import {GraphData} from "../../entities/graph/GraphData";
import {ActionService} from "../../services/action.service";
import {Uniq} from "../../entities/servers/Uniq";
import {ServerService} from "../../services/server.service";
import {AuthService} from "../../services/auth.service";
export interface Period {
name: string
@ -38,10 +41,33 @@ export class StatisticPageComponent implements OnInit {
chart!:Chart;
uniq!: Uniq;
constructor(private graphService: GraphService,
private actionService: ActionService) { }
private actionService: ActionService,
private serverService: ServerService,
public authService: AuthService) { }
ngOnInit(): void {
this.getServers();
this.getUniq();
}
getUniq() {
this.serverService.getStats("uniq").subscribe(
(res) => this.uniq = res.export()
);
}
getServers() {
this.serverService.servers.subscribe(
(res) => {
const keys = Object.keys(res.data);
for (const key of keys) {
this.serverList.push({name: res.data[key].name, server_id: key});
}
}
)
}
getGraph() {

12
src/app/services/vip.service.ts

@ -2,6 +2,11 @@ import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {map, Observable} from "rxjs";
import {VipBuy} from "../entities/VipBuy";
import {SearchFilter} from "../entities/search/SearchFilter";
import {MatPaginator} from "@angular/material/paginator";
import {PagingAndSortingPaginator} from "../entities/PagingAndSortingPaginator";
import {Ban} from "../entities/ban/Ban";
import {DonateStat} from "../entities/DonateStat";
@Injectable({
providedIn: 'root'
@ -17,4 +22,11 @@ export class VipService {
getFreeVip(): Observable<any> {
return this.http.post(`api/profile/current/freevip`, null);
}
getDonateStat(filters: SearchFilter, paginator: MatPaginator | undefined) {
return this.http.post(`api/profile/donate`, filters,
{params: {size: paginator?paginator.pageSize:20, page: paginator?paginator.pageIndex:0}}).pipe(
map((res) => PagingAndSortingPaginator<DonateStat>.newObj().fromData(res).updatePaginator(paginator))
);
}
}

Loading…
Cancel
Save