This commit is contained in:
Park Byung Eun 2022-08-04 05:12:36 +00:00
parent 44a0b7bc8a
commit fc7fef6f8f
4 changed files with 92 additions and 25 deletions

View File

@ -205,7 +205,10 @@
{{ user.highRank }}
</div>
<div>
<div (click)="viewUserDetail(user.id!)">
<div
(click)="viewUserDetail(user.id!)"
style="cursor: pointer"
>
{{ user.signinId }}
</div>
<hr style="margin: 7px 0px" />

View File

@ -144,7 +144,11 @@
{{ i + 1 }}
</div>
<!-- 등급 || 아이디 -->
<div class="hidden lg:block">
<div
class="hidden lg:block"
style="cursor: pointer"
(click)="viewUserDetail(admin.userId!)"
>
{{ admin.rank }}
<hr style="margin: 7px 0px" />
{{ admin.signinId }}
@ -173,6 +177,7 @@
mat-flat-button
class="bet-mat-small-8"
[color]="'primary'"
(click)="__onClickIpBlock($event, admin.id)"
>
<span class="ml-2 mr-1">IP차단</span>
</button>
@ -184,6 +189,7 @@
mat-flat-button
class="bet-mat-small-8"
[color]="'primary'"
(click)="__onClickIdBlock($event, admin.id)"
>
<span class="ml-2 mr-1">ID블럭</span>
</button>

View File

@ -68,7 +68,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
pagination?: SessioninAdminPagination;
__isSearchOpened = false;
configForm!: FormGroup;
ipBlockConfigForm!: FormGroup;
idBlockConfigForm!: FormGroup;
private _unsubscribeAll: Subject<any> = new Subject<any>();
@ -91,28 +92,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
* On init
*/
ngOnInit(): void {
this.configForm = this._formBuilder.group({
title: '알림',
message:
'정말로 삭제하시겠습니까? <span class="font-medium">삭제!</span>',
icon: this._formBuilder.group({
show: true,
name: 'heroicons_outline:exclamation',
color: 'warn',
}),
actions: this._formBuilder.group({
confirm: this._formBuilder.group({
show: true,
label: '삭제',
color: 'warn',
}),
cancel: this._formBuilder.group({
show: true,
label: '취소',
}),
}),
dismissible: true,
});
// Get the pagination
this._sessioninAdminService.pagination$
.pipe(takeUntil(this._unsubscribeAll))
@ -126,6 +105,10 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
// Get the products
this.sessioninAdmins$ = this._sessioninAdminService.sessioninAdmins$;
// Set ip, id block config
this.__idBlockConfirmConfig();
this.__ipBlockConfirmConfig();
}
/**
@ -150,6 +133,11 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
// @ Private methods
// -----------------------------------------------------------------------------------------------------
viewUserDetail(id: string = '00b0292f-3d50-4669-a0c4-7a9d85efc98d'): void {
let url: string = 'member/user/' + id;
this.router.navigateByUrl(url);
}
/**
* toggle the search
* Used in 'bar'
@ -178,4 +166,73 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
__trackByFn(index: number, item: any): any {
return item.id || index;
}
__ipBlockConfirmConfig(): void {
this.ipBlockConfigForm = this._formBuilder.group({
title: '알림',
message: 'IP 차단 처리하시겠습니까?',
icon: this._formBuilder.group({
show: true,
name: 'heroicons_outline:exclamation',
color: 'warn',
}),
actions: this._formBuilder.group({
confirm: this._formBuilder.group({
show: true,
label: '확인',
color: 'warn',
}),
cancel: this._formBuilder.group({
show: true,
label: '취소',
}),
}),
dismissible: true,
});
}
__onClickIpBlock(event: MouseEvent, id: string): void {
// Open the dialog and save the reference of it
const dialogRef = this._fuseConfirmationService.open(
this.ipBlockConfigForm.value
);
// Subscribe to afterClosed from the dialog reference
dialogRef.afterClosed().subscribe((result) => {
console.log(result);
});
}
__idBlockConfirmConfig(): void {
this.idBlockConfigForm = this._formBuilder.group({
title: '알림',
message: 'ID블럭 처리하시겠습니까?',
icon: this._formBuilder.group({
show: true,
name: 'heroicons_outline:exclamation',
color: 'warn',
}),
actions: this._formBuilder.group({
confirm: this._formBuilder.group({
show: true,
label: '확인',
color: 'warn',
}),
cancel: this._formBuilder.group({
show: true,
label: '취소',
}),
}),
dismissible: true,
});
}
__onClickIdBlock(event: MouseEvent, id: string): void {
// Open the dialog and save the reference of it
const dialogRef = this._fuseConfirmationService.open(
this.idBlockConfigForm.value
);
// Subscribe to afterClosed from the dialog reference
dialogRef.afterClosed().subscribe((result) => {
console.log(result);
});
}
}

View File

@ -1,6 +1,7 @@
export interface SessioninAdmin {
id: string;
rank?: string;
userId?: string;
signinId?: string;
ip?: string;
domain?: string;