8 changed files with 143 additions and 32 deletions
@ -0,0 +1,62 @@ |
|||
import {AbstractPerperiodGraphComponent} from "./abstract.perperiod.graph.component"; |
|||
import {Component, Input} from "@angular/core"; |
|||
import {ServerService} from "../../services/server.service"; |
|||
import {GraphService} from "../../services/graph.service"; |
|||
import {MatSnackBar} from "@angular/material/snack-bar"; |
|||
|
|||
@Component({ |
|||
selector: 'app-doxing-graph', |
|||
template: ` |
|||
<div> |
|||
<mat-radio-group |
|||
style="display: flex; justify-content: center;flex-direction: row;" |
|||
[(ngModel)]="settingsOfChart.period" |
|||
[disabled]="settingsOfChart.loading" |
|||
(ngModelChange)="updateDoxingGraph()"> |
|||
<mat-radio-button style="padding-right: 1%; padding-left: 1%" value="day">За месяц</mat-radio-button> |
|||
<mat-radio-button style="padding-right: 1%; padding-left: 1%" value="month">За год</mat-radio-button> |
|||
<mat-radio-button style="padding-right: 1%; padding-left: 1%" value="year">За 10 лет</mat-radio-button> |
|||
</mat-radio-group> |
|||
</div> |
|||
<div class="chart-container"> |
|||
<canvas id="doxingCanvasChart" >{{ settingsOfChart.chart }}</canvas> |
|||
</div>` |
|||
}) |
|||
export class DoxingGraphComponent extends AbstractPerperiodGraphComponent { |
|||
|
|||
@Input("steam64") |
|||
steam64: string|null = null; |
|||
|
|||
constructor(protected override serverService: ServerService, |
|||
private graphService: GraphService, |
|||
private snack: MatSnackBar) { |
|||
super(serverService); |
|||
} |
|||
|
|||
doxingTabChanged(event: any, tabIndex: number): boolean { |
|||
if (event.index == tabIndex) { |
|||
this.updateDoxingGraph(); |
|||
} |
|||
return true; |
|||
} |
|||
|
|||
updateDoxingGraph() { |
|||
if (this.steam64) { |
|||
if (this.settingsOfChart.loading) return; |
|||
this.settingsOfChart.loading = true; |
|||
this.graphService.getDoxingOnPeriod(this.getSearchFilter(this.steam64)).subscribe( |
|||
(objs) => { |
|||
this.updateGraph(objs, "doxingCanvasChart", |
|||
(items: any) => "", |
|||
"fff", |
|||
-1, |
|||
'countryAndCity') |
|||
}, (err) => { |
|||
this.settingsOfChart.loading = false; |
|||
this.snack.open("Ошибка загрузка данных"); |
|||
} |
|||
) |
|||
} else |
|||
this.snack.open("Используется только в профиле") |
|||
} |
|||
} |
|||
@ -1,10 +1,10 @@ |
|||
{ |
|||
"/api": { |
|||
"target": "http://192.168.3.3:26272/", |
|||
"target": "http://gigaboss.goyda.network:26272/", |
|||
"secure": false |
|||
}, |
|||
"/site_content": { |
|||
"target": "https://192.168.3.3:14088/", |
|||
"target": "https://gigaboss.goyda.network:14088/", |
|||
"secure": false |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue