Compare commits
No commits in common. "aa2797c51c24dfe9e17efe97b2a87435677d38ad" and "df9c3ac996f017f90cce42719798263bcbd72b83" have entirely different histories.
aa2797c51c
...
df9c3ac996
|
|
@ -17,21 +17,8 @@
|
||||||
<button class="button-outer" (click)="punishmentType = 'warn'">Warnings</button>
|
<button class="button-outer" (click)="punishmentType = 'warn'">Warnings</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="historySearchContainer">
|
<div class="historySearchContainer">
|
||||||
<input class="historySearch"
|
<input class="historySearch" type="text" placeholder="Search..">
|
||||||
type="text"
|
|
||||||
placeholder="Search.."
|
|
||||||
[(ngModel)]="searchTerm"
|
|
||||||
(input)="filterNames()"
|
|
||||||
>
|
|
||||||
<button class="searchButton">Search</button>
|
<button class="searchButton">Search</button>
|
||||||
<div class="search-dropdown" *ngIf="filteredNames.length > 0 && searchTerm">
|
|
||||||
<div
|
|
||||||
class="dropdown-item"
|
|
||||||
*ngFor="let name of filteredNames"
|
|
||||||
(mousedown)="selectName(name)">
|
|
||||||
{{ name }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="historyTable">
|
<div class="historyTable">
|
||||||
|
|
|
||||||
|
|
@ -42,26 +42,3 @@ main .container {
|
||||||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-results {
|
|
||||||
position: absolute;
|
|
||||||
top: 100%;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
max-height: 300px;
|
|
||||||
overflow-y: auto;
|
|
||||||
background-color: white;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border-top: none;
|
|
||||||
z-index: 1000;
|
|
||||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-item {
|
|
||||||
padding: 8px 12px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dropdown-item:hover {
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,52 +1,19 @@
|
||||||
import {Component, OnInit} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {HeaderComponent} from "../header/header.component";
|
import {HeaderComponent} from "../header/header.component";
|
||||||
import {HistoryComponent} from './history/history.component';
|
import {HistoryComponent} from './history/history.component';
|
||||||
import {HistoryService} from '../../api';
|
|
||||||
import {NgForOf, NgIf} from '@angular/common';
|
|
||||||
import {FormsModule} from '@angular/forms';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bans',
|
selector: 'app-bans',
|
||||||
imports: [
|
imports: [
|
||||||
HeaderComponent,
|
HeaderComponent,
|
||||||
HistoryComponent,
|
HistoryComponent
|
||||||
NgIf,
|
|
||||||
FormsModule,
|
|
||||||
NgForOf
|
|
||||||
],
|
],
|
||||||
templateUrl: './bans.component.html',
|
templateUrl: './bans.component.html',
|
||||||
styleUrl: './bans.component.scss'
|
styleUrl: './bans.component.scss'
|
||||||
})
|
})
|
||||||
export class BansComponent implements OnInit {
|
export class BansComponent {
|
||||||
|
|
||||||
constructor(public historyApi: HistoryService) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public userType: 'player' | 'staff' = "player";
|
public userType: 'player' | 'staff' = "player";
|
||||||
public punishmentType: 'all' | 'ban' | 'mute' | 'kick' | 'warn' = "all";
|
public punishmentType: 'all' | 'ban' | 'mute' | 'kick' | 'warn' = "all";
|
||||||
public names: string[] = [];
|
|
||||||
public searchTerm: string = '';
|
|
||||||
public filteredNames: string[] = [];
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.historyApi.getUserNames(this.userType, this.punishmentType).subscribe(names => {
|
|
||||||
this.names = names;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public filterNames() {
|
|
||||||
if (!this.searchTerm) {
|
|
||||||
this.filteredNames = [];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.filteredNames = this.names.filter(name =>
|
|
||||||
name.toLowerCase().startsWith(this.searchTerm.toLowerCase())
|
|
||||||
).slice(0, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
public selectName(name: string) {
|
|
||||||
this.searchTerm = name;
|
|
||||||
this.filteredNames = [];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user