From f7f59f45711a8735c3ff4b908af791110ee51f15 Mon Sep 17 00:00:00 2001 From: gsd Date: Sun, 6 Apr 2025 15:56:06 +0300 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B5=D0=B2=D0=BE=D1=80=D0=BA=20=D1=84?= =?UTF-8?q?=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=BE=D0=B2=20=D0=BF=D0=BE=D0=B8?= =?UTF-8?q?=D1=81=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 16 ++- src/app/entities/search/BanSearchFilter.ts | 54 ++++++++ .../entities/search/MessageSearchFilter.ts | 11 ++ src/app/entities/search/SearchFilter.ts | 74 ++++++++++- .../banlist-page/banlist-page.component.html | 109 +++++++++++++--- .../banlist-page/banlist-page.component.scss | 20 +++ .../banlist-page/banlist-page.component.ts | 60 ++++++--- .../abstract-search-table.component.ts | 88 +++---------- .../search-filters/FilterMatChipBanId.ts | 28 +++++ .../search-filters/FilterMatChipMessage.ts | 26 ++++ .../base/FilterMatChipAccount.ts | 28 +++++ .../base/FilterMatChipDateBegin.ts | 29 +++++ .../base/FilterMatChipDateEnd.ts | 29 +++++ .../base/FilterMatChipServer.ts | 34 +++++ .../messages-page.component.html | 116 +++++------------- .../messages-page/messages-page.component.ts | 30 +---- src/app/services/ban.service.ts | 13 +- src/app/services/message.service.ts | 6 +- 18 files changed, 542 insertions(+), 229 deletions(-) create mode 100644 src/app/entities/search/BanSearchFilter.ts create mode 100644 src/app/pages/internal-components/search-filters/FilterMatChipBanId.ts create mode 100644 src/app/pages/internal-components/search-filters/FilterMatChipMessage.ts create mode 100644 src/app/pages/internal-components/search-filters/base/FilterMatChipAccount.ts create mode 100644 src/app/pages/internal-components/search-filters/base/FilterMatChipDateBegin.ts create mode 100644 src/app/pages/internal-components/search-filters/base/FilterMatChipDateEnd.ts create mode 100644 src/app/pages/internal-components/search-filters/base/FilterMatChipServer.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 8d0a97a..79fcba1 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -42,19 +42,33 @@ import {MatSelectModule} from "@angular/material/select"; import {MatDatepickerModule} from "@angular/material/datepicker"; import {MatNativeDateModule} from "@angular/material/core"; import {MatProgressSpinnerModule} from "@angular/material/progress-spinner"; +import {FilterMatChipAccount} from "./pages/internal-components/search-filters/base/FilterMatChipAccount"; +import {FilterMatChipMessage} from "./pages/internal-components/search-filters/FilterMatChipMessage"; +import {FilterMatChipServer} from "./pages/internal-components/search-filters/base/FilterMatChipServer"; +import {FilterMatChipDateBegin} from "./pages/internal-components/search-filters/base/FilterMatChipDateBegin"; +import {FilterMatChipDateEnd} from "./pages/internal-components/search-filters/base/FilterMatChipDateEnd"; +import {FilterMatChipBanId} from "./pages/internal-components/search-filters/FilterMatChipBanId"; registerLocaleData(localeRu, "ru") @NgModule({ declarations: [ AppComponent, + //pages MainPageComponent, ServersPageComponent, ProfilePageComponent, NeedAuthToContinue, RulesPageComponent, BanlistPageComponent, - MessagesPageComponent + MessagesPageComponent, + //search filters + FilterMatChipAccount, + FilterMatChipMessage, + FilterMatChipServer, + FilterMatChipDateBegin, + FilterMatChipDateEnd, + FilterMatChipBanId ], imports: [ BrowserModule, diff --git a/src/app/entities/search/BanSearchFilter.ts b/src/app/entities/search/BanSearchFilter.ts new file mode 100644 index 0000000..6b8b1c4 --- /dev/null +++ b/src/app/entities/search/BanSearchFilter.ts @@ -0,0 +1,54 @@ +import {SearchFilter} from "./SearchFilter"; +import {MatPaginator} from "@angular/material/paginator"; +import {ParamMap} from "@angular/router"; + +export class BanSearchFilter extends SearchFilter{ + ban_ids: number[]|null = null; + active: boolean|null = null; + admin_ids: string[]|null = null; + + override createQuery(paginator:MatPaginator|undefined): { [p: string]: any } { + let q:{[param: string]: any} = super.createQuery(paginator); + q["ban_ids"] = this.ban_ids?this.ban_ids.join(","):null; + q["active"] = this.active != null? this.active: null; + q["admin_ids"] = this.admin_ids?this.admin_ids.join(","):null; + return q; + } + + override fromQuery(param: ParamMap,paginator:MatPaginator|undefined) { + try {if (param.get("ban_ids")) { // @ts-ignore + this.message = param.get("ban_ids")?.split(",");}}catch (e) {} + + try {if (param.get("active")) { // @ts-ignore + this.message = param.get("active");}}catch (e) {} + + try {if (param.get("admin_ids")) { // @ts-ignore + this.message = param.get("admin_ids")?.split(",");}}catch (e) {} + + super.fromQuery(param, paginator); + } + + + changeBanIdToSearch(prev: number, name: any) { + if (this.ban_ids == null) + this.ban_ids = []; + this.ban_ids = this.ban_ids.filter(v => v !== prev); + if (this.ban_ids.indexOf(name.target.value) == -1) + this.ban_ids.push(name.target.value); + this.updated = true; + } + + addBanIdToSearch(name: number) { + if (this.ban_ids == null) + this.ban_ids = []; + if (this.ban_ids.indexOf(name) == -1) + this.ban_ids.push(name); + this.updated = true; + } + + removeBanIdFromSearch(name: number) { + if (this.ban_ids == null) return; + this.ban_ids = this.ban_ids.filter(v => v !== name); + this.updated = true; + } +} diff --git a/src/app/entities/search/MessageSearchFilter.ts b/src/app/entities/search/MessageSearchFilter.ts index 2b6bed9..ea18cff 100644 --- a/src/app/entities/search/MessageSearchFilter.ts +++ b/src/app/entities/search/MessageSearchFilter.ts @@ -17,4 +17,15 @@ export class MessageSearchFilter extends SearchFilter { this.message = param.get("message");}}catch (e) {} super.fromQuery(param, paginator); } + + + addMessageToSearch(name: any) { + this.message = name; + this.updated = true; + } + + removeMessageFromSearch() { + this.message = null; + this.updated = true; + } } diff --git a/src/app/entities/search/SearchFilter.ts b/src/app/entities/search/SearchFilter.ts index 742ee73..48ea2b4 100644 --- a/src/app/entities/search/SearchFilter.ts +++ b/src/app/entities/search/SearchFilter.ts @@ -11,7 +11,7 @@ export class SearchFilter implements ISearchFilter { createQuery(paginator:MatPaginator|undefined):{[param: string]: any} { let q: {[param: string]: any} = {}; - q["accounts"] = this.accounts?this.accounts.join(","):null; + q["accounts"] = this.accounts && this.accounts.length>0?this.accounts.join(","):null; q["begin"] = this.begin?this.begin.getTime():null; q["end"] = this.end?this.end.getTime():null; q["serverId"] = this.serverId; @@ -40,4 +40,76 @@ export class SearchFilter implements ISearchFilter { try {if (param.get("size") && paginator) { // @ts-ignore paginator.pageSize = param.get("size")*1;}}catch (e) {} } + + //accounts + changeAccountToSearch(prev: string, name: any) { + //tak nado + if (this.accounts == null) + this.accounts = []; + this.accounts = this.accounts.filter(v => v !== prev); + if (this.accounts.indexOf(name.target.value) == -1) + this.accounts.push(name.target.value); + this.updated = true; + } + + addAccountToSearch(name: string) { + if (this.accounts == null) + this.accounts = []; + if (this.accounts.indexOf(name) == -1) + this.accounts.push(name); + this.updated = true; + } + + removeAccountFromSearch(name: string) { + if (this.accounts == null) return; + this.accounts = this.accounts.filter(v => v !== name); + this.updated = true; + } + + //begindate + addBeginTimeToSearch(custom_date: any = null) { + if (custom_date == null) { + const d: Date = new Date(); + d.setUTCHours(0, 0, 0, 0); + this.begin = d; + } + else this.begin = new Date(custom_date); + + this.updated = true; + } + + removeBeginTimeFromSearch() { + this.begin = null; + this.updated = true; + } + + //enddate + + addEndTimeToSearch(custom_date: number|null = null) { + if (custom_date == null) { + const d: Date = new Date(); + d.setUTCHours(23, 59, 59, 999); + this.end = d; + } + else this.end = new Date(custom_date); + this.updated = true; + } + + removeEndTimeFromSearch() { + this.end = null; + this.updated = true; + } + + //server + addServerToSearch(server_id: string|null = null) { + this.serverId = server_id == null ? "%" : server_id; + if (server_id != null) { + this.updated = true; + } + } + + removeServerFromSearch() { + this.serverId = null; + this.updated = true; + } } diff --git a/src/app/pages/banlist-page/banlist-page.component.html b/src/app/pages/banlist-page/banlist-page.component.html index f4e7386..af76b98 100644 --- a/src/app/pages/banlist-page/banlist-page.component.html +++ b/src/app/pages/banlist-page/banlist-page.component.html @@ -1,25 +1,102 @@

Бан лист

-

Скоро и ты сюда попадешь браток {{total==0?'':'как и остальные ' + total + ' карликов'}}

+

Скоро и ты сюда попадешь браток {{getCount()==undefined?'':'как и остальные ' + getCount() + ' карликов'}}

- -
- - - - -

#{{ban.id}} {{ban.player_name}}

-
- -

{{ban.timestamp | date:'dd/MM/YYYY hh:mm:ss'}}

-
-
-

А хуй знает я еще не приудмал

-
-
+ +
+
+ + Искать по... + + + + + + + + + + Обновить + + + + + + + + +
+
+
+ +
+ Слишком много запросов или сервер не отвечает, обнови страницу. +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
ID бана {{row.id}} + Имя игрока {{row.player_name}} + + + + Время {{row.timestamp | date:"HH:mm dd/MM/yyyy"}} + + + + Причина {{row.ban_reason}} Модератор {{row.banned_by}} Действие пук
Бан лист пуст
+ + +
diff --git a/src/app/pages/banlist-page/banlist-page.component.scss b/src/app/pages/banlist-page/banlist-page.component.scss index e69de29..10fb7c5 100644 --- a/src/app/pages/banlist-page/banlist-page.component.scss +++ b/src/app/pages/banlist-page/banlist-page.component.scss @@ -0,0 +1,20 @@ +.loading-shade { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: rgba(0, 0, 0, 0.15); + z-index: 1; + display: flex; + align-items: center; + justify-content: center; +} + +.err { + max-width: 360px; + text-align: center; + background: white; + border-radius: 15px; + border: 0px solid black; +} diff --git a/src/app/pages/banlist-page/banlist-page.component.ts b/src/app/pages/banlist-page/banlist-page.component.ts index dd6176b..1793798 100644 --- a/src/app/pages/banlist-page/banlist-page.component.ts +++ b/src/app/pages/banlist-page/banlist-page.component.ts @@ -2,35 +2,63 @@ import { Component, OnInit } from '@angular/core'; import {AuthService} from "../../services/auth.service"; import {BanService} from "../../services/ban.service"; import {Ban} from "../../entities/ban/Ban"; +import {AbstractSearchTable} from "../internal-components/abstract-search-table.component"; +import {BanSearchFilter} from "../../entities/search/BanSearchFilter"; +import {ServerService} from "../../services/server.service"; +import {PlayerService} from "../../services/player.service"; +import {ActivatedRoute, Router} from "@angular/router"; +import {MatTableDataSource} from "@angular/material/table"; @Component({ selector: 'app-banlist-page', templateUrl: './banlist-page.component.html', styleUrls: ['./banlist-page.component.scss'] }) -export class BanlistPageComponent implements OnInit { - loading: boolean | null = null; - bans: Ban[] = []; - total: number = 0; +export class BanlistPageComponent extends AbstractSearchTable{ - constructor(public authService: AuthService, + displayedColumns: string[] = ['id', 'player_name', 'date', 'reason', 'admin_name', 'action']; + constructor(public override authService: AuthService, + protected override serverService: ServerService, + protected override playerService: PlayerService, + protected override router: Router, + protected override route: ActivatedRoute, private banService: BanService) { + super(authService, serverService, playerService, route, router); + super.filter = new BanSearchFilter(); } - ngOnInit(): void { - if (this.authService.isAuth()) { - this.getBanList(); - } - } - - getBanList() { + private getBanList(): boolean { + this.filter.updated = false; this.loading = true; - this.banService.getBanList().subscribe( + this.banService.getBanList(this.filter, this.paginator).subscribe( (res) => { - this.bans = res.data; - this.total = res.count; - }, () => {}, () => this.loading = false + this.dataSource = new MatTableDataSource(res.data); + this.err = false; + }, (e) => this.err = true, () => this.loading = false ) + return true; } + override updateData() { + super.updateData(); + this.getBanList(); + } + + addAdminIdToSearch(name: string) { + if (this.filter.admin_ids == null) + this.filter.admin_ids = []; + if (this.filter.admin_ids.indexOf(name) == -1) + this.filter.admin_ids.push(name); + this.filter.updated = true; + } + + removeAdminIdFromSearch(name: string) { + if (this.filter.admin_ids == null) return; + this.filter.admin_ids = this.filter.admin_ids.filter(v => v !== name); + this.filter.updated = true; + } + + getCount() { + return this.paginator?.length; + } } diff --git a/src/app/pages/internal-components/abstract-search-table.component.ts b/src/app/pages/internal-components/abstract-search-table.component.ts index 957a54a..49a5e0c 100644 --- a/src/app/pages/internal-components/abstract-search-table.component.ts +++ b/src/app/pages/internal-components/abstract-search-table.component.ts @@ -7,6 +7,8 @@ import {MatSort} from "@angular/material/sort"; import {SearchFilter} from "../../entities/search/SearchFilter"; import {ServerService} from "../../services/server.service"; import {ActivatedRoute, Router} from "@angular/router"; +import {AuthService} from "../../services/auth.service"; +import {PlayerService} from "../../services/player.service"; @Component({template: ''}) export abstract class AbstractSearchTable implements AfterViewInit { @@ -20,7 +22,9 @@ export abstract class AbstractSearchTable implements A err: boolean = false; - protected constructor(protected serverService: ServerService, + protected constructor(protected authService: AuthService, + protected serverService: ServerService, + protected playerService: PlayerService, protected route: ActivatedRoute, protected router: Router) { this.filter = new SearchFilter() as U; @@ -49,79 +53,17 @@ export abstract class AbstractSearchTable implements A ) } - changeAccountToSearch(prev: string, name: any) { - this.removeAccountFromSearch(prev); - this.addAccountToSearch(name.target.value); - this.filter.updated = true; - } - - addAccountToSearch(name: string) { - if (this.filter.accounts == null) - this.filter.accounts = []; - if (this.filter.accounts.indexOf(name) == -1) - this.filter.accounts.push(name); - this.filter.updated = true; - } - - removeAccountFromSearch(name: string) { - if (this.filter.accounts == null) return; - this.filter.accounts = this.filter.accounts.filter(v => v !== name); - this.filter.updated = true; - } - - addServerToSearch(server_id: string|null = null) { - this.filter.serverId = server_id == null ? "%" : server_id; - if (server_id != null) { - this.filter.updated = true; + searchPlayer(account_id: number) { + if (!this.authService.isAuth()) { + return; } - } - removeServerFromSearch() { - this.filter.serverId = null; - this.filter.updated = true; - } - - getServerName(server_id: string|null) { - try { - // @ts-ignore - return this.serverList.filter(s => s.server_id == server_id).pop().name; - } catch (e) { - return "Выбрать сервер"; - } - } - - addBeginTimeToSearch(custom_date: any = null) { - if (custom_date == null) { - const d: Date = new Date(); - d.setUTCHours(0, 0, 0, 0); - this.filter.begin = d; - } - else this.filter.begin = new Date(custom_date); - - this.filter.updated = true; - } - - removeBeginTimeFromSearch() { - this.filter.begin = null; - this.filter.updated = true; - } - - addEndTimeToSearch(custom_date: number|null = null) { - if (custom_date == null) { - const d: Date = new Date(); - d.setUTCHours(23, 59, 59, 999); - this.filter.end = d; - } - else this.filter.end = new Date(custom_date); - this.filter.updated = true; - } - - removeEndTimeFromSearch() { - this.filter.end = null; - this.filter.updated = true; - } - - filterChanges(event:any) { - this.filter.updated = true; + this.playerService.searchProfile(`[U:1:${account_id}]`).subscribe( + (res) => { + if (res.steam64 != null) + this.router.navigate(['profile', res.steam64]) + }, + (err) => {} + ) } } diff --git a/src/app/pages/internal-components/search-filters/FilterMatChipBanId.ts b/src/app/pages/internal-components/search-filters/FilterMatChipBanId.ts new file mode 100644 index 0000000..a293c7d --- /dev/null +++ b/src/app/pages/internal-components/search-filters/FilterMatChipBanId.ts @@ -0,0 +1,28 @@ +import {Component, Input} from "@angular/core"; +import {BanSearchFilter} from "../../../entities/search/BanSearchFilter"; + +@Component({ + selector: "app-filter-mat-chip-banid", + template: ` +
+ Ид: {{acId}} + + + + Ид бана без # + + + + +
` +}) +export class FilterMatChipBanId { + + @Input("filter") + filter: BanSearchFilter|undefined; +} diff --git a/src/app/pages/internal-components/search-filters/FilterMatChipMessage.ts b/src/app/pages/internal-components/search-filters/FilterMatChipMessage.ts new file mode 100644 index 0000000..f7a3bd9 --- /dev/null +++ b/src/app/pages/internal-components/search-filters/FilterMatChipMessage.ts @@ -0,0 +1,26 @@ +import {Component, Input} from "@angular/core"; +import {SearchFilter} from "../../../entities/search/SearchFilter"; +import {MessageSearchFilter} from "../../../entities/search/MessageSearchFilter"; + +@Component({ + selector: "app-filter-mat-chip-message", + template: ` + Сообщение содержит: {{filter.message}} + + + + Сообщение содержит... + + + + + ` +}) +export class FilterMatChipMessage { + @Input("filter") + filter: MessageSearchFilter|undefined; +} diff --git a/src/app/pages/internal-components/search-filters/base/FilterMatChipAccount.ts b/src/app/pages/internal-components/search-filters/base/FilterMatChipAccount.ts new file mode 100644 index 0000000..d6ecdf8 --- /dev/null +++ b/src/app/pages/internal-components/search-filters/base/FilterMatChipAccount.ts @@ -0,0 +1,28 @@ +import {Component, Input} from "@angular/core"; +import {SearchFilter} from "../../../../entities/search/SearchFilter"; + +@Component({ + selector: "app-filter-mat-chip-account", + template: ` +
+ Профиль: {{acId}} + + + + Ссылка, имя, все что угодно + + + + +
` +}) +export class FilterMatChipAccount { + + @Input("filter") + filter: SearchFilter|undefined; +} diff --git a/src/app/pages/internal-components/search-filters/base/FilterMatChipDateBegin.ts b/src/app/pages/internal-components/search-filters/base/FilterMatChipDateBegin.ts new file mode 100644 index 0000000..937afe1 --- /dev/null +++ b/src/app/pages/internal-components/search-filters/base/FilterMatChipDateBegin.ts @@ -0,0 +1,29 @@ +import {Component, Input} from "@angular/core"; +import {SearchFilter} from "../../../../entities/search/SearchFilter"; + +@Component({ + selector: "app-filter-mat-chip-date-begin", + template: ` + + Дата после {{filter.begin | date:"HH:mm dd/MM/yyyy"}} + + + + Дата после + + + + ` +})//todo mb abstract +export class FilterMatChipDateBegin { + @Input("filter") + filter: SearchFilter|undefined; +} diff --git a/src/app/pages/internal-components/search-filters/base/FilterMatChipDateEnd.ts b/src/app/pages/internal-components/search-filters/base/FilterMatChipDateEnd.ts new file mode 100644 index 0000000..cbc25e4 --- /dev/null +++ b/src/app/pages/internal-components/search-filters/base/FilterMatChipDateEnd.ts @@ -0,0 +1,29 @@ +import {Component, Input} from "@angular/core"; +import {SearchFilter} from "../../../../entities/search/SearchFilter"; + +@Component( + { selector: "app-filter-mat-chip-date-end", + template: ` + + Дата до {{filter.end | date:"HH:mm dd/MM/yyyy"}} + + + + Дата после + + + + `} +) +export class FilterMatChipDateEnd { + @Input("filter") + filter: SearchFilter|undefined; +} diff --git a/src/app/pages/internal-components/search-filters/base/FilterMatChipServer.ts b/src/app/pages/internal-components/search-filters/base/FilterMatChipServer.ts new file mode 100644 index 0000000..e39d9a8 --- /dev/null +++ b/src/app/pages/internal-components/search-filters/base/FilterMatChipServer.ts @@ -0,0 +1,34 @@ +import {Component, Input} from "@angular/core"; +import {SearchFilter} from "../../../../entities/search/SearchFilter"; + +@Component({ + selector: "app-filter-mat-chip-server", + template: ` + + {{getServerName?getServerName(filter.serverId):filter.serverId}} + + + + + + ` +}) +export class FilterMatChipServer { + @Input("filter") + filter: SearchFilter|undefined; + + @Input("serverList") + serverList:{name: string, server_id: string }[] = [] + + getServerName(server_id: string|null) { + try { + // @ts-ignore + return this.serverList.filter(s => s.server_id == server_id).pop().name; + } catch (e) { + return "Выбрать сервер"; + } + } +} diff --git a/src/app/pages/messages-page/messages-page.component.html b/src/app/pages/messages-page/messages-page.component.html index 7e8a96d..08d22a6 100644 --- a/src/app/pages/messages-page/messages-page.component.html +++ b/src/app/pages/messages-page/messages-page.component.html @@ -11,95 +11,33 @@ Искать по... - + - - + + - - + + Обновить -
- Профиль: {{acId}} - - - - Ссылка, имя, все что угодно - - - - -
- Сообщение содержит: {{filter.message}} - - - - Сообщение содержит... - - - - - - - {{getServerName(filter.serverId)}} - - - - - - - - Дата после {{filter.begin | date:"HH:mm dd/MM/yyyy"}} - - - - Дата после - - - - - - - Дата до {{filter.end | date:"HH:mm dd/MM/yyyy"}} - - - - Дата после - - - - + + + + + + + + +
@@ -109,6 +47,8 @@
Слишком много запросов или сервер не отвечает, обнови страницу. +
+
@@ -116,7 +56,7 @@ @@ -125,8 +65,8 @@ @@ -135,7 +75,7 @@ @@ -143,7 +83,7 @@ diff --git a/src/app/pages/messages-page/messages-page.component.ts b/src/app/pages/messages-page/messages-page.component.ts index 433ec05..116e5eb 100644 --- a/src/app/pages/messages-page/messages-page.component.ts +++ b/src/app/pages/messages-page/messages-page.component.ts @@ -21,13 +21,13 @@ export class MessagesPageComponent extends AbstractSearchTable { - if (res.steam64 != null) - this.router.navigate(['profile', res.steam64]) - }, - (err) => {} - ) - } } diff --git a/src/app/services/ban.service.ts b/src/app/services/ban.service.ts index 1654a96..060ffdc 100644 --- a/src/app/services/ban.service.ts +++ b/src/app/services/ban.service.ts @@ -3,6 +3,9 @@ import {HttpClient} from "@angular/common/http"; import {ShityPaginator} from "../entities/ShityPaginator"; import {Ban} from "../entities/ban/Ban"; import {map, Observable} from "rxjs"; +import {BanSearchFilter} from "../entities/search/BanSearchFilter"; +import {MatPaginator} from "@angular/material/paginator"; +import {PagingAndSortingPaginator} from "../entities/PagingAndSortingPaginator"; @Injectable({ providedIn: 'root' @@ -11,9 +14,11 @@ export class BanService { constructor(private http: HttpClient) { } - getBanList(): Observable> { - return this.http.get("api/web/banlist").pipe( - map((res) => ShityPaginator.newObj().fromData(res, "bans")) - ) + getBanList(filters: BanSearchFilter, paginator: MatPaginator | undefined) { + return this.http.post(`api/web/banlist`, + filters, + {params: {size: paginator?paginator.pageSize:20, page: paginator?paginator.pageIndex:0}}).pipe( + map((res) => PagingAndSortingPaginator.newObj().fromData(res).updatePaginator(paginator)) + ); } } diff --git a/src/app/services/message.service.ts b/src/app/services/message.service.ts index 4afde67..9c4b42c 100644 --- a/src/app/services/message.service.ts +++ b/src/app/services/message.service.ts @@ -4,7 +4,7 @@ import {MatPaginator} from "@angular/material/paginator"; import {map} from "rxjs"; import {PagingAndSortingPaginator} from "../entities/PagingAndSortingPaginator"; import {Message} from "../entities/profile/Message"; -import {SearchFilter} from "../entities/search/SearchFilter"; +import {MessageSearchFilter} from "../entities/search/MessageSearchFilter"; @Injectable({ providedIn: 'root' @@ -13,12 +13,12 @@ export class MessageService { constructor(private http: HttpClient) { } - getMessages(filters: SearchFilter, paginator: MatPaginator | undefined) { + getMessages(filters: MessageSearchFilter, paginator: MatPaginator | undefined) { return this.http.post( `/api/profile/messages/pages`, filters, {params: {size: paginator?paginator.pageSize:20, page: paginator?paginator.pageIndex:0}}).pipe( - (map((res) => PagingAndSortingPaginator.newObj().fromData(res).updatePaginator(paginator))) + map((res) => PagingAndSortingPaginator.newObj().fromData(res).updatePaginator(paginator)) ); } }
Игрок {{row.account_name}} - + Дата {{row.utime*1000 | date:"HH:mm:ss dd/MM/yyyy"}} - - + + Сообщение {{row.message}} - + Сервер {{row.serverName}} - +