폴더명 수정
This commit is contained in:
parent
ce51b9e44f
commit
f5de3d038c
|
@ -423,11 +423,11 @@ export const appRoutes: Route[] = [
|
||||||
).then((m: any) => m.PaymentLogModule),
|
).then((m: any) => m.PaymentLogModule),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'sessionin-info',
|
path: 'user-session',
|
||||||
loadChildren: () =>
|
loadChildren: () =>
|
||||||
import(
|
import(
|
||||||
'app/modules/admin/report/sessionin-info/sessionin-info.module'
|
'app/modules/admin/report/user-session/user-session.module'
|
||||||
).then((m: any) => m.SessioninInfoModule),
|
).then((m: any) => m.UserSessionModule),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'sessionin-overlap',
|
path: 'sessionin-overlap',
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { assign, cloneDeep } from 'lodash-es';
|
import { assign, cloneDeep } from 'lodash-es';
|
||||||
import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api';
|
import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api';
|
||||||
import { sessioninInfos as sessioninInfosData } from './data';
|
import { userSessions as userSessionsData } from './data';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ReportSessioninInfoMockApi {
|
export class ReportUserSessionMockApi {
|
||||||
private _sessioninInfos: any[] = sessioninInfosData;
|
private _userSessions: any[] = userSessionsData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
@ -26,10 +26,10 @@ export class ReportSessioninInfoMockApi {
|
||||||
*/
|
*/
|
||||||
registerHandlers(): void {
|
registerHandlers(): void {
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
// @ SessioninInfos - GET
|
// @ UserSessions - GET
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
this._fuseMockApiService
|
this._fuseMockApiService
|
||||||
.onGet('api/apps/report/sessionin-info/sessionin-infos', 300)
|
.onGet('api/apps/report/user-session/user-sessions', 300)
|
||||||
.reply(({ request }) => {
|
.reply(({ request }) => {
|
||||||
// Get available queries
|
// Get available queries
|
||||||
const search = request.params.get('search');
|
const search = request.params.get('search');
|
||||||
|
@ -38,12 +38,12 @@ export class ReportSessioninInfoMockApi {
|
||||||
const page = parseInt(request.params.get('page') ?? '1', 10);
|
const page = parseInt(request.params.get('page') ?? '1', 10);
|
||||||
const size = parseInt(request.params.get('size') ?? '10', 10);
|
const size = parseInt(request.params.get('size') ?? '10', 10);
|
||||||
|
|
||||||
// Clone the sessioninInfos
|
// Clone the userSessions
|
||||||
let sessioninInfos: any[] | null = cloneDeep(this._sessioninInfos);
|
let userSessions: any[] | null = cloneDeep(this._userSessions);
|
||||||
|
|
||||||
// Sort the sessioninInfos
|
// Sort the userSessions
|
||||||
if (sort === 'signinId' || sort === 'nickname') {
|
if (sort === 'signinId' || sort === 'nickname') {
|
||||||
sessioninInfos.sort((a, b) => {
|
userSessions.sort((a, b) => {
|
||||||
const fieldA = a[sort].toString().toUpperCase();
|
const fieldA = a[sort].toString().toUpperCase();
|
||||||
const fieldB = b[sort].toString().toUpperCase();
|
const fieldB = b[sort].toString().toUpperCase();
|
||||||
return order === 'asc'
|
return order === 'asc'
|
||||||
|
@ -51,15 +51,15 @@ export class ReportSessioninInfoMockApi {
|
||||||
: fieldB.localeCompare(fieldA);
|
: fieldB.localeCompare(fieldA);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
sessioninInfos.sort((a, b) =>
|
userSessions.sort((a, b) =>
|
||||||
order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort]
|
order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If search exists...
|
// If search exists...
|
||||||
if (search) {
|
if (search) {
|
||||||
// Filter the sessioninInfos
|
// Filter the userSessions
|
||||||
sessioninInfos = sessioninInfos.filter(
|
userSessions = userSessions.filter(
|
||||||
(contact: any) =>
|
(contact: any) =>
|
||||||
contact.name &&
|
contact.name &&
|
||||||
contact.name.toLowerCase().includes(search.toLowerCase())
|
contact.name.toLowerCase().includes(search.toLowerCase())
|
||||||
|
@ -67,32 +67,32 @@ export class ReportSessioninInfoMockApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paginate - Start
|
// Paginate - Start
|
||||||
const sessioninInfosLength = sessioninInfos.length;
|
const userSessionsLength = userSessions.length;
|
||||||
|
|
||||||
// Calculate pagination details
|
// Calculate pagination details
|
||||||
const begin = page * size;
|
const begin = page * size;
|
||||||
const end = Math.min(size * (page + 1), sessioninInfosLength);
|
const end = Math.min(size * (page + 1), userSessionsLength);
|
||||||
const lastPage = Math.max(Math.ceil(sessioninInfosLength / size), 1);
|
const lastPage = Math.max(Math.ceil(userSessionsLength / size), 1);
|
||||||
|
|
||||||
// Prepare the pagination object
|
// Prepare the pagination object
|
||||||
let pagination = {};
|
let pagination = {};
|
||||||
|
|
||||||
// If the requested page number is bigger than
|
// If the requested page number is bigger than
|
||||||
// the last possible page number, return null for
|
// the last possible page number, return null for
|
||||||
// sessioninInfos but also send the last possible page so
|
// userSessions but also send the last possible page so
|
||||||
// the app can navigate to there
|
// the app can navigate to there
|
||||||
if (page > lastPage) {
|
if (page > lastPage) {
|
||||||
sessioninInfos = null;
|
userSessions = null;
|
||||||
pagination = {
|
pagination = {
|
||||||
lastPage,
|
lastPage,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// Paginate the results by size
|
// Paginate the results by size
|
||||||
sessioninInfos = sessioninInfos.slice(begin, end);
|
userSessions = userSessions.slice(begin, end);
|
||||||
|
|
||||||
// Prepare the pagination mock-api
|
// Prepare the pagination mock-api
|
||||||
pagination = {
|
pagination = {
|
||||||
length: sessioninInfosLength,
|
length: userSessionsLength,
|
||||||
size: size,
|
size: size,
|
||||||
page: page,
|
page: page,
|
||||||
lastPage: lastPage,
|
lastPage: lastPage,
|
||||||
|
@ -105,41 +105,39 @@ export class ReportSessioninInfoMockApi {
|
||||||
return [
|
return [
|
||||||
200,
|
200,
|
||||||
{
|
{
|
||||||
sessioninInfos,
|
userSessions,
|
||||||
pagination,
|
pagination,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
// @ SessioninInfo - GET
|
// @ UserSession - GET
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
this._fuseMockApiService
|
this._fuseMockApiService
|
||||||
.onGet('api/apps/report/sessionin-info/sessionin-info')
|
.onGet('api/apps/report/user-session/user-session')
|
||||||
.reply(({ request }) => {
|
.reply(({ request }) => {
|
||||||
// Get the id from the params
|
// Get the id from the params
|
||||||
const id = request.params.get('id');
|
const id = request.params.get('id');
|
||||||
|
|
||||||
// Clone the sessioninInfos
|
// Clone the userSessions
|
||||||
const sessioninInfos = cloneDeep(this._sessioninInfos);
|
const userSessions = cloneDeep(this._userSessions);
|
||||||
|
|
||||||
// Find the sessioninInfo
|
// Find the userSession
|
||||||
const sessioninInfo = sessioninInfos.find(
|
const userSession = userSessions.find((item: any) => item.id === id);
|
||||||
(item: any) => item.id === id
|
|
||||||
);
|
|
||||||
|
|
||||||
// Return the response
|
// Return the response
|
||||||
return [200, sessioninInfo];
|
return [200, userSession];
|
||||||
});
|
});
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
// @ SessioninInfo - POST
|
// @ UserSession - POST
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
this._fuseMockApiService
|
this._fuseMockApiService
|
||||||
.onPost('api/apps/report/sessionin-info/sessionin-info')
|
.onPost('api/apps/report/user-session/user-session')
|
||||||
.reply(() => {
|
.reply(() => {
|
||||||
// Generate a new sessioninInfo
|
// Generate a new userSession
|
||||||
const newSessioninInfo = {
|
const newUserSession = {
|
||||||
id: FuseMockApiUtils.guid(),
|
id: FuseMockApiUtils.guid(),
|
||||||
category: '',
|
category: '',
|
||||||
name: 'A New User',
|
name: 'A New User',
|
||||||
|
@ -161,58 +159,54 @@ export class ReportSessioninInfoMockApi {
|
||||||
active: false,
|
active: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Unshift the new sessioninInfo
|
// Unshift the new userSession
|
||||||
this._sessioninInfos.unshift(newSessioninInfo);
|
this._userSessions.unshift(newUserSession);
|
||||||
|
|
||||||
// Return the response
|
// Return the response
|
||||||
return [200, newSessioninInfo];
|
return [200, newUserSession];
|
||||||
});
|
});
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
// @ SessioninInfo - PATCH
|
// @ UserSession - PATCH
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
this._fuseMockApiService
|
this._fuseMockApiService
|
||||||
.onPatch('api/apps/report/sessionin-info/sessionin-info')
|
.onPatch('api/apps/report/user-session/user-session')
|
||||||
.reply(({ request }) => {
|
.reply(({ request }) => {
|
||||||
// Get the id and sessioninInfo
|
// Get the id and userSession
|
||||||
const id = request.body.id;
|
const id = request.body.id;
|
||||||
const sessioninInfo = cloneDeep(request.body.sessioninInfo);
|
const userSession = cloneDeep(request.body.userSession);
|
||||||
|
|
||||||
// Prepare the updated sessioninInfo
|
// Prepare the updated userSession
|
||||||
let updatedSessioninInfo = null;
|
let updatedUserSession = null;
|
||||||
|
|
||||||
// Find the sessioninInfo and update it
|
// Find the userSession and update it
|
||||||
this._sessioninInfos.forEach((item, index, sessioninInfos) => {
|
this._userSessions.forEach((item, index, userSessions) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
// Update the sessioninInfo
|
// Update the userSession
|
||||||
sessioninInfos[index] = assign(
|
userSessions[index] = assign({}, userSessions[index], userSession);
|
||||||
{},
|
|
||||||
sessioninInfos[index],
|
|
||||||
sessioninInfo
|
|
||||||
);
|
|
||||||
|
|
||||||
// Store the updated sessioninInfo
|
// Store the updated userSession
|
||||||
updatedSessioninInfo = sessioninInfos[index];
|
updatedUserSession = userSessions[index];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Return the response
|
// Return the response
|
||||||
return [200, updatedSessioninInfo];
|
return [200, updatedUserSession];
|
||||||
});
|
});
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
// @ SessioninInfo - DELETE
|
// @ UserSession - DELETE
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
this._fuseMockApiService
|
this._fuseMockApiService
|
||||||
.onDelete('api/apps/report/sessionin-info/sessionin-info')
|
.onDelete('api/apps/report/user-session/user-session')
|
||||||
.reply(({ request }) => {
|
.reply(({ request }) => {
|
||||||
// Get the id
|
// Get the id
|
||||||
const id = request.params.get('id');
|
const id = request.params.get('id');
|
||||||
|
|
||||||
// Find the sessioninInfo and delete it
|
// Find the userSession and delete it
|
||||||
this._sessioninInfos.forEach((item, index) => {
|
this._userSessions.forEach((item, index) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
this._sessioninInfos.splice(index, 1);
|
this._userSessions.splice(index, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|
||||||
export const sessioninInfos = [
|
export const userSessions = [
|
||||||
{
|
{
|
||||||
id: '1',
|
id: '1',
|
||||||
signinId: 'lala1',
|
signinId: 'lala1',
|
|
@ -315,11 +315,11 @@ export const defaultNavigation: FuseNavigationItem[] = [
|
||||||
link: '/report/payment-log',
|
link: '/report/payment-log',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'report.sessionin-info',
|
id: 'report.user-session',
|
||||||
title: 'Sessionin Info',
|
title: 'User Session',
|
||||||
type: 'basic',
|
type: 'basic',
|
||||||
icon: 'heroicons_outline:academic-cap',
|
icon: 'heroicons_outline:academic-cap',
|
||||||
link: '/report/sessionin-info',
|
link: '/report/user-session',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'report.sessionin-overlap',
|
id: 'report.sessionin-overlap',
|
||||||
|
|
|
@ -58,7 +58,7 @@ import { ReportMoneyLogMockApi } from './apps/report/money-log/api';
|
||||||
import { ReportCompLogMockApi } from './apps/report/comp-log/api';
|
import { ReportCompLogMockApi } from './apps/report/comp-log/api';
|
||||||
import { ReportModificationLogMockApi } from './apps/report/modification-log/api';
|
import { ReportModificationLogMockApi } from './apps/report/modification-log/api';
|
||||||
import { ReportPaymentLogMockApi } from './apps/report/payment-log/api';
|
import { ReportPaymentLogMockApi } from './apps/report/payment-log/api';
|
||||||
import { ReportSessioninInfoMockApi } from './apps/report/sessionin-info/api';
|
import { ReportUserSessionMockApi } from './apps/report/user-session/api';
|
||||||
import { ReportSessioninOverlapMockApi } from './apps/report/sessionin-overlap/api';
|
import { ReportSessioninOverlapMockApi } from './apps/report/sessionin-overlap/api';
|
||||||
import { ReportAdminSessionMockApi } from './apps/report/admin-session/api';
|
import { ReportAdminSessionMockApi } from './apps/report/admin-session/api';
|
||||||
import { ReportExcelLogMockApi } from './apps/report/excel-log/api';
|
import { ReportExcelLogMockApi } from './apps/report/excel-log/api';
|
||||||
|
@ -131,7 +131,7 @@ export const mockApiServices = [
|
||||||
ReportCompLogMockApi,
|
ReportCompLogMockApi,
|
||||||
ReportModificationLogMockApi,
|
ReportModificationLogMockApi,
|
||||||
ReportPaymentLogMockApi,
|
ReportPaymentLogMockApi,
|
||||||
ReportSessioninInfoMockApi,
|
ReportUserSessionMockApi,
|
||||||
ReportSessioninOverlapMockApi,
|
ReportSessioninOverlapMockApi,
|
||||||
ReportAdminSessionMockApi,
|
ReportAdminSessionMockApi,
|
||||||
ReportExcelLogMockApi,
|
ReportExcelLogMockApi,
|
||||||
|
|
|
@ -99,8 +99,8 @@
|
||||||
<div
|
<div
|
||||||
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
|
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
|
||||||
>
|
>
|
||||||
<ng-container *ngIf="sessioninInfos$ | async as sessioninInfos">
|
<ng-container *ngIf="userSessions$ | async as userSessions">
|
||||||
<ng-container *ngIf="sessioninInfos.length > 0; else noUser">
|
<ng-container *ngIf="userSessions.length > 0; else noUserSession">
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div
|
<div
|
||||||
|
@ -123,10 +123,10 @@
|
||||||
<div class="hidden lg:block">회원차단/해제</div>
|
<div class="hidden lg:block">회원차단/해제</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Rows -->
|
<!-- Rows -->
|
||||||
<ng-container *ngIf="sessioninInfos$ | async as sessioninInfos">
|
<ng-container *ngIf="userSessions$ | async as userSessions">
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngFor="
|
*ngFor="
|
||||||
let info of sessioninInfos;
|
let info of userSessions;
|
||||||
let i = index;
|
let i = index;
|
||||||
trackBy: __trackByFn
|
trackBy: __trackByFn
|
||||||
"
|
"
|
||||||
|
@ -196,7 +196,7 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-template #noUser>
|
<ng-template #noUserSession>
|
||||||
<div
|
<div
|
||||||
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
|
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
|
||||||
>
|
>
|
|
@ -30,9 +30,9 @@ import { fuseAnimations } from '@fuse/animations';
|
||||||
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
||||||
|
|
||||||
import { User } from '../../../member/user/models/user';
|
import { User } from '../../../member/user/models/user';
|
||||||
import { SessioninInfo } from '../models/sessionin-info';
|
import { UserSession } from '../models/user-session';
|
||||||
import { SessioninInfoPagination } from '../models/sessionin-info-pagination';
|
import { UserSessionPagination } from '../models/user-session-pagination';
|
||||||
import { SessioninInfoService } from '../services/sessionin-info.service';
|
import { UserSessionService } from '../services/user-session.service';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -66,13 +66,13 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||||
@ViewChild(MatSort) private _sort!: MatSort;
|
@ViewChild(MatSort) private _sort!: MatSort;
|
||||||
|
|
||||||
sessioninInfos$!: Observable<SessioninInfo[] | undefined>;
|
userSessions$!: Observable<UserSession[] | undefined>;
|
||||||
users$!: Observable<User[] | undefined>;
|
users$!: Observable<User[] | undefined>;
|
||||||
|
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
searchInputControl = new FormControl();
|
searchInputControl = new FormControl();
|
||||||
selectedSessioninInfo?: SessioninInfo;
|
selectedUserSession?: UserSession;
|
||||||
pagination?: SessioninInfoPagination;
|
pagination?: UserSessionPagination;
|
||||||
__isSearchOpened = false;
|
__isSearchOpened = false;
|
||||||
|
|
||||||
ipBlockConfigForm!: FormGroup;
|
ipBlockConfigForm!: FormGroup;
|
||||||
|
@ -87,7 +87,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
private _changeDetectorRef: ChangeDetectorRef,
|
private _changeDetectorRef: ChangeDetectorRef,
|
||||||
private _fuseConfirmationService: FuseConfirmationService,
|
private _fuseConfirmationService: FuseConfirmationService,
|
||||||
private _formBuilder: FormBuilder,
|
private _formBuilder: FormBuilder,
|
||||||
private _sessioninInfoService: SessioninInfoService,
|
private _userSessionService: UserSessionService,
|
||||||
private router: Router
|
private router: Router
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
@ -100,9 +100,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
*/
|
*/
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
// Get the pagination
|
// Get the pagination
|
||||||
this._sessioninInfoService.pagination$
|
this._userSessionService.pagination$
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
.subscribe((pagination: SessioninInfoPagination | undefined) => {
|
.subscribe((pagination: UserSessionPagination | undefined) => {
|
||||||
// Update the pagination
|
// Update the pagination
|
||||||
this.pagination = pagination;
|
this.pagination = pagination;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get the products
|
// Get the products
|
||||||
this.sessioninInfos$ = this._sessioninInfoService.sessioninInfos$;
|
this.userSessions$ = this._userSessionService.userSessions$;
|
||||||
|
|
||||||
this.__idBlockConfirmConfig();
|
this.__idBlockConfirmConfig();
|
||||||
this.__ipBlockConfirmConfig();
|
this.__ipBlockConfirmConfig();
|
||||||
|
@ -132,7 +132,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
// Mark for check
|
// Mark for check
|
||||||
this._changeDetectorRef.markForCheck();
|
this._changeDetectorRef.markForCheck();
|
||||||
|
|
||||||
// If the sessioninInfo changes the sort order...
|
// If the userSession changes the sort order...
|
||||||
this._sort.sortChange
|
this._sort.sortChange
|
||||||
.pipe(takeUntil(this._unsubscribeAll))
|
.pipe(takeUntil(this._unsubscribeAll))
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
|
@ -145,7 +145,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap(() => {
|
switchMap(() => {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
return this._sessioninInfoService.getSessioninInfos(
|
return this._userSessionService.getUserSessions(
|
||||||
this._paginator.pageIndex,
|
this._paginator.pageIndex,
|
||||||
this._paginator.pageSize,
|
this._paginator.pageSize,
|
||||||
this._sort.active,
|
this._sort.active,
|
|
@ -1,4 +1,4 @@
|
||||||
export interface SessioninInfoPagination {
|
export interface UserSessionPagination {
|
||||||
length: number;
|
length: number;
|
||||||
size: number;
|
size: number;
|
||||||
page: number;
|
page: number;
|
|
@ -1,4 +1,4 @@
|
||||||
export interface SessioninInfo {
|
export interface UserSession {
|
||||||
id?: string;
|
id?: string;
|
||||||
signinId?: string;
|
signinId?: string;
|
||||||
nickname?: string;
|
nickname?: string;
|
|
@ -7,19 +7,19 @@ import {
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { catchError, Observable, throwError } from 'rxjs';
|
import { catchError, Observable, throwError } from 'rxjs';
|
||||||
|
|
||||||
import { SessioninInfo } from '../models/sessionin-info';
|
import { UserSession } from '../models/user-session';
|
||||||
import { SessioninInfoPagination } from '../models/sessionin-info-pagination';
|
import { UserSessionPagination } from '../models/user-session-pagination';
|
||||||
import { SessioninInfoService } from '../services/sessionin-info.service';
|
import { UserSessionService } from '../services/user-session.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class SessioninInfoResolver implements Resolve<any> {
|
export class UserSessionResolver implements Resolve<any> {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private _sessioninInfoService: SessioninInfoService,
|
private _userSessionService: UserSessionService,
|
||||||
private _router: Router
|
private _router: Router
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
@ -36,9 +36,9 @@ export class SessioninInfoResolver implements Resolve<any> {
|
||||||
resolve(
|
resolve(
|
||||||
route: ActivatedRouteSnapshot,
|
route: ActivatedRouteSnapshot,
|
||||||
state: RouterStateSnapshot
|
state: RouterStateSnapshot
|
||||||
): Observable<SessioninInfo | undefined> {
|
): Observable<UserSession | undefined> {
|
||||||
return this._sessioninInfoService
|
return this._userSessionService
|
||||||
.getSessioninInfoById(route.paramMap.get('id'))
|
.getUserSessionById(route.paramMap.get('id'))
|
||||||
.pipe(
|
.pipe(
|
||||||
// Error here means the requested product is not available
|
// Error here means the requested product is not available
|
||||||
catchError((error) => {
|
catchError((error) => {
|
||||||
|
@ -61,11 +61,11 @@ export class SessioninInfoResolver implements Resolve<any> {
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class SessioninInfosResolver implements Resolve<any> {
|
export class UserSessionsResolver implements Resolve<any> {
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
constructor(private _sessioninInfoService: SessioninInfoService) {}
|
constructor(private _userSessionService: UserSessionService) {}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
// @ Public methods
|
// @ Public methods
|
||||||
|
@ -81,9 +81,9 @@ export class SessioninInfosResolver implements Resolve<any> {
|
||||||
route: ActivatedRouteSnapshot,
|
route: ActivatedRouteSnapshot,
|
||||||
state: RouterStateSnapshot
|
state: RouterStateSnapshot
|
||||||
): Observable<{
|
): Observable<{
|
||||||
pagination: SessioninInfoPagination;
|
pagination: UserSessionPagination;
|
||||||
sessioninInfos: SessioninInfo[];
|
userSessions: UserSession[];
|
||||||
}> {
|
}> {
|
||||||
return this._sessioninInfoService.getSessioninInfos();
|
return this._userSessionService.getUserSessions();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -12,21 +12,21 @@ import {
|
||||||
throwError,
|
throwError,
|
||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
|
|
||||||
import { SessioninInfo } from '../models/sessionin-info';
|
import { UserSession } from '../models/user-session';
|
||||||
import { SessioninInfoPagination } from '../models/sessionin-info-pagination';
|
import { UserSessionPagination } from '../models/user-session-pagination';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class SessioninInfoService {
|
export class UserSessionService {
|
||||||
// Private
|
// Private
|
||||||
private __pagination = new BehaviorSubject<
|
private __pagination = new BehaviorSubject<UserSessionPagination | undefined>(
|
||||||
SessioninInfoPagination | undefined
|
|
||||||
>(undefined);
|
|
||||||
private __sessioninInfo = new BehaviorSubject<SessioninInfo | undefined>(
|
|
||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
private __sessioninInfos = new BehaviorSubject<SessioninInfo[] | undefined>(
|
private __userSession = new BehaviorSubject<UserSession | undefined>(
|
||||||
|
undefined
|
||||||
|
);
|
||||||
|
private __userSessions = new BehaviorSubject<UserSession[] | undefined>(
|
||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -42,22 +42,22 @@ export class SessioninInfoService {
|
||||||
/**
|
/**
|
||||||
* Getter for pagination
|
* Getter for pagination
|
||||||
*/
|
*/
|
||||||
get pagination$(): Observable<SessioninInfoPagination | undefined> {
|
get pagination$(): Observable<UserSessionPagination | undefined> {
|
||||||
return this.__pagination.asObservable();
|
return this.__pagination.asObservable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for sessioninInfo
|
* Getter for userSession
|
||||||
*/
|
*/
|
||||||
get sessioninInfo$(): Observable<SessioninInfo | undefined> {
|
get userSession$(): Observable<UserSession | undefined> {
|
||||||
return this.__sessioninInfo.asObservable();
|
return this.__userSession.asObservable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for sessioninInfos
|
* Getter for userSessions
|
||||||
*/
|
*/
|
||||||
get sessioninInfos$(): Observable<SessioninInfo[] | undefined> {
|
get userSessions$(): Observable<UserSession[] | undefined> {
|
||||||
return this.__sessioninInfos.asObservable();
|
return this.__userSessions.asObservable();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
@ -65,7 +65,7 @@ export class SessioninInfoService {
|
||||||
// -----------------------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get SessioninInfos
|
* Get UserSessions
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param page
|
* @param page
|
||||||
|
@ -74,21 +74,21 @@ export class SessioninInfoService {
|
||||||
* @param order
|
* @param order
|
||||||
* @param search
|
* @param search
|
||||||
*/
|
*/
|
||||||
getSessioninInfos(
|
getUserSessions(
|
||||||
page: number = 0,
|
page: number = 0,
|
||||||
size: number = 10,
|
size: number = 10,
|
||||||
sort: string = 'name',
|
sort: string = 'name',
|
||||||
order: 'asc' | 'desc' | '' = 'asc',
|
order: 'asc' | 'desc' | '' = 'asc',
|
||||||
search: string = ''
|
search: string = ''
|
||||||
): Observable<{
|
): Observable<{
|
||||||
pagination: SessioninInfoPagination;
|
pagination: UserSessionPagination;
|
||||||
sessioninInfos: SessioninInfo[];
|
userSessions: UserSession[];
|
||||||
}> {
|
}> {
|
||||||
return this._httpClient
|
return this._httpClient
|
||||||
.get<{
|
.get<{
|
||||||
pagination: SessioninInfoPagination;
|
pagination: UserSessionPagination;
|
||||||
sessioninInfos: SessioninInfo[];
|
userSessions: UserSession[];
|
||||||
}>('api/apps/report/sessionin-info/sessionin-infos', {
|
}>('api/apps/report/user-session/user-sessions', {
|
||||||
params: {
|
params: {
|
||||||
page: '' + page,
|
page: '' + page,
|
||||||
size: '' + size,
|
size: '' + size,
|
||||||
|
@ -100,7 +100,7 @@ export class SessioninInfoService {
|
||||||
.pipe(
|
.pipe(
|
||||||
tap((response) => {
|
tap((response) => {
|
||||||
this.__pagination.next(response.pagination);
|
this.__pagination.next(response.pagination);
|
||||||
this.__sessioninInfos.next(response.sessioninInfos);
|
this.__userSessions.next(response.userSessions);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -108,19 +108,19 @@ export class SessioninInfoService {
|
||||||
/**
|
/**
|
||||||
* Get product by id
|
* Get product by id
|
||||||
*/
|
*/
|
||||||
getSessioninInfoById(id: string | null): Observable<SessioninInfo> {
|
getUserSessionById(id: string | null): Observable<UserSession> {
|
||||||
return this.__sessioninInfos.pipe(
|
return this.__userSessions.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map((sessioninInfos) => {
|
map((userSessions) => {
|
||||||
// Find the product
|
// Find the product
|
||||||
const sessioninInfo =
|
const userSession =
|
||||||
sessioninInfos?.find((item) => item.id === id) || undefined;
|
userSessions?.find((item) => item.id === id) || undefined;
|
||||||
|
|
||||||
// Update the product
|
// Update the product
|
||||||
this.__sessioninInfo.next(sessioninInfo);
|
this.__userSession.next(userSession);
|
||||||
|
|
||||||
// Return the product
|
// Return the product
|
||||||
return sessioninInfo;
|
return userSession;
|
||||||
}),
|
}),
|
||||||
switchMap((product) => {
|
switchMap((product) => {
|
||||||
if (!product) {
|
if (!product) {
|
||||||
|
@ -135,24 +135,21 @@ export class SessioninInfoService {
|
||||||
/**
|
/**
|
||||||
* Create product
|
* Create product
|
||||||
*/
|
*/
|
||||||
createSessioninInfo(): Observable<SessioninInfo> {
|
createUserSession(): Observable<UserSession> {
|
||||||
return this.sessioninInfos$.pipe(
|
return this.userSessions$.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
switchMap((sessioninInfos) =>
|
switchMap((userSessions) =>
|
||||||
this._httpClient
|
this._httpClient
|
||||||
.post<SessioninInfo>('api/apps/report/sessionin-info/product', {})
|
.post<UserSession>('api/apps/report/user-session/product', {})
|
||||||
.pipe(
|
.pipe(
|
||||||
map((newSessioninInfo) => {
|
map((newUserSession) => {
|
||||||
// Update the sessioninInfos with the new product
|
// Update the userSessions with the new product
|
||||||
if (!!sessioninInfos) {
|
if (!!userSessions) {
|
||||||
this.__sessioninInfos.next([
|
this.__userSessions.next([newUserSession, ...userSessions]);
|
||||||
newSessioninInfo,
|
|
||||||
...sessioninInfos,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the new product
|
// Return the new product
|
||||||
return newSessioninInfo;
|
return newUserSession;
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
)
|
)
|
|
@ -24,14 +24,14 @@ import { SharedModule } from 'app/shared/shared.module';
|
||||||
|
|
||||||
import { COMPONENTS } from './components';
|
import { COMPONENTS } from './components';
|
||||||
|
|
||||||
import { sessioninInfoRoutes } from './sessionin-info.routing';
|
import { userSessionRoutes } from './user-session.routing';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [COMPONENTS],
|
declarations: [COMPONENTS],
|
||||||
imports: [
|
imports: [
|
||||||
TranslocoModule,
|
TranslocoModule,
|
||||||
SharedModule,
|
SharedModule,
|
||||||
RouterModule.forChild(sessioninInfoRoutes),
|
RouterModule.forChild(userSessionRoutes),
|
||||||
|
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatFormFieldModule,
|
MatFormFieldModule,
|
||||||
|
@ -51,4 +51,4 @@ import { sessioninInfoRoutes } from './sessionin-info.routing';
|
||||||
MatMomentDateModule,
|
MatMomentDateModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class SessioninInfoModule {}
|
export class UserSessionModule {}
|
|
@ -3,15 +3,15 @@ import { Route } from '@angular/router';
|
||||||
import { ListComponent } from './components/list.component';
|
import { ListComponent } from './components/list.component';
|
||||||
import { ViewComponent } from '../../member/user/components/view.component';
|
import { ViewComponent } from '../../member/user/components/view.component';
|
||||||
|
|
||||||
import { SessioninInfosResolver } from './resolvers/sessionin-info.resolver';
|
import { UserSessionsResolver } from './resolvers/user-session.resolver';
|
||||||
import { UserResolver } from '../../member/user/resolvers/user.resolver';
|
import { UserResolver } from '../../member/user/resolvers/user.resolver';
|
||||||
|
|
||||||
export const sessioninInfoRoutes: Route[] = [
|
export const userSessionRoutes: Route[] = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ListComponent,
|
component: ListComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
sessioninInfos: SessioninInfosResolver,
|
userSessions: UserSessionsResolver,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
|
@ -37,7 +37,7 @@
|
||||||
"Comp Log": "Comp Logs",
|
"Comp Log": "Comp Logs",
|
||||||
"Modification Log": "Member Modification Logs",
|
"Modification Log": "Member Modification Logs",
|
||||||
"Payment Log": "Manual Payment Logs",
|
"Payment Log": "Manual Payment Logs",
|
||||||
"Sessionin Info": "Sessionin Info",
|
"User Session": "User Session",
|
||||||
"Admin Session": "Admin Session",
|
"Admin Session": "Admin Session",
|
||||||
"Sessionin Overlap": "Sessionin Overlap",
|
"Sessionin Overlap": "Sessionin Overlap",
|
||||||
"Excel Log": "Excel Download Logs",
|
"Excel Log": "Excel Download Logs",
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
"Comp Log": "콤프사용 Logs",
|
"Comp Log": "콤프사용 Logs",
|
||||||
"Modification Log": "회원수정 로그",
|
"Modification Log": "회원수정 로그",
|
||||||
"Payment Log": "수동지급/회수 로그",
|
"Payment Log": "수동지급/회수 로그",
|
||||||
"Sessionin Info": "로그인정보",
|
"User Session": "로그인정보",
|
||||||
"Sessionin Overlap": "중복로그인",
|
"Sessionin Overlap": "중복로그인",
|
||||||
"Admin Session": "관리자 로그인정보",
|
"Admin Session": "관리자 로그인정보",
|
||||||
"Excel Log": "엑셀다운 로그",
|
"Excel Log": "엑셀다운 로그",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user