폴더명 수정

This commit is contained in:
이담 정 2022-08-04 08:40:45 +00:00
parent b5cf7173e7
commit ce51b9e44f
16 changed files with 139 additions and 144 deletions

View File

@ -437,11 +437,11 @@ export const appRoutes: Route[] = [
).then((m: any) => m.SessioninOverlapModule), ).then((m: any) => m.SessioninOverlapModule),
}, },
{ {
path: 'sessionin-admin', path: 'admin-session',
loadChildren: () => loadChildren: () =>
import( import(
'app/modules/admin/report/sessionin-admin/sessionin-admin.module' 'app/modules/admin/report/admin-session/admin-session.module'
).then((m: any) => m.SessioninAdminModule), ).then((m: any) => m.AdminSessionModule),
}, },
{ {
path: 'excel-log', path: 'excel-log',

View File

@ -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 { sessioninAdmins as sessioninAdminsData } from './data'; import { adminSessions as adminSessionsData } from './data';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class ReportSessioninAdminMockApi { export class ReportAdminSessionMockApi {
private _sessioninAdmins: any[] = sessioninAdminsData; private _adminSessions: any[] = adminSessionsData;
/** /**
* Constructor * Constructor
@ -26,10 +26,10 @@ export class ReportSessioninAdminMockApi {
*/ */
registerHandlers(): void { registerHandlers(): void {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninAdmins - GET // @ AdminSessions - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/report/sessionin-admin/sessionin-admins', 300) .onGet('api/apps/report/admin-session/admin-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 ReportSessioninAdminMockApi {
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 sessioninAdmins // Clone the adminSessions
let sessioninAdmins: any[] | null = cloneDeep(this._sessioninAdmins); let adminSessions: any[] | null = cloneDeep(this._adminSessions);
// Sort the sessioninAdmins // Sort the adminSessions
// if (sort === 'sku' || sort === 'name' || sort === 'active') { // if (sort === 'sku' || sort === 'name' || sort === 'active') {
// sessioninAdmins.sort((a, b) => { // adminSessions.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 ReportSessioninAdminMockApi {
// : fieldB.localeCompare(fieldA); // : fieldB.localeCompare(fieldA);
// }); // });
// } else { // } else {
// sessioninAdmins.sort((a, b) => // adminSessions.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 sessioninAdmins // Filter the adminSessions
sessioninAdmins = sessioninAdmins.filter( adminSessions = adminSessions.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 ReportSessioninAdminMockApi {
} }
// Paginate - Start // Paginate - Start
const sessioninAdminsLength = sessioninAdmins.length; const adminSessionsLength = adminSessions.length;
// Calculate pagination details // Calculate pagination details
const begin = page * size; const begin = page * size;
const end = Math.min(size * (page + 1), sessioninAdminsLength); const end = Math.min(size * (page + 1), adminSessionsLength);
const lastPage = Math.max(Math.ceil(sessioninAdminsLength / size), 1); const lastPage = Math.max(Math.ceil(adminSessionsLength / 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
// sessioninAdmins but also send the last possible page so // adminSessions 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) {
sessioninAdmins = null; adminSessions = null;
pagination = { pagination = {
lastPage, lastPage,
}; };
} else { } else {
// Paginate the results by size // Paginate the results by size
sessioninAdmins = sessioninAdmins.slice(begin, end); adminSessions = adminSessions.slice(begin, end);
// Prepare the pagination mock-api // Prepare the pagination mock-api
pagination = { pagination = {
length: sessioninAdminsLength, length: adminSessionsLength,
size: size, size: size,
page: page, page: page,
lastPage: lastPage, lastPage: lastPage,
@ -105,41 +105,39 @@ export class ReportSessioninAdminMockApi {
return [ return [
200, 200,
{ {
sessioninAdmins, adminSessions,
pagination, pagination,
}, },
]; ];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninAdmin - GET // @ AdminSession - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/report/sessionin-admin/sessionin-admin') .onGet('api/apps/report/admin-session/admin-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 sessioninAdmins // Clone the adminSessions
const sessioninAdmins = cloneDeep(this._sessioninAdmins); const adminSessions = cloneDeep(this._adminSessions);
// Find the sessioninAdmin // Find the adminSession
const sessioninAdmin = sessioninAdmins.find( const adminSession = adminSessions.find((item: any) => item.id === id);
(item: any) => item.id === id
);
// Return the response // Return the response
return [200, sessioninAdmin]; return [200, adminSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninAdmin - POST // @ AdminSession - POST
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPost('api/apps/report/sessionin-admin/sessionin-admin') .onPost('api/apps/report/admin-session/admin-session')
.reply(() => { .reply(() => {
// Generate a new sessioninAdmin // Generate a new adminSession
const newSessioninAdmin = { const newAdminSession = {
id: FuseMockApiUtils.guid(), id: FuseMockApiUtils.guid(),
category: '', category: '',
name: 'A New User', name: 'A New User',
@ -161,58 +159,58 @@ export class ReportSessioninAdminMockApi {
active: false, active: false,
}; };
// Unshift the new sessioninAdmin // Unshift the new adminSession
this._sessioninAdmins.unshift(newSessioninAdmin); this._adminSessions.unshift(newAdminSession);
// Return the response // Return the response
return [200, newSessioninAdmin]; return [200, newAdminSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninAdmin - PATCH // @ AdminSession - PATCH
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPatch('api/apps/report/sessionin-admin/sessionin-admin') .onPatch('api/apps/report/admin-session/admin-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id and sessioninAdmin // Get the id and adminSession
const id = request.body.id; const id = request.body.id;
const sessioninAdmin = cloneDeep(request.body.sessioninAdmin); const adminSession = cloneDeep(request.body.adminSession);
// Prepare the updated sessioninAdmin // Prepare the updated adminSession
let updatedSessioninAdmin = null; let updatedAdminSession = null;
// Find the sessioninAdmin and update it // Find the adminSession and update it
this._sessioninAdmins.forEach((item, index, sessioninAdmins) => { this._adminSessions.forEach((item, index, adminSessions) => {
if (item.id === id) { if (item.id === id) {
// Update the sessioninAdmin // Update the adminSession
sessioninAdmins[index] = assign( adminSessions[index] = assign(
{}, {},
sessioninAdmins[index], adminSessions[index],
sessioninAdmin adminSession
); );
// Store the updated sessioninAdmin // Store the updated adminSession
updatedSessioninAdmin = sessioninAdmins[index]; updatedAdminSession = adminSessions[index];
} }
}); });
// Return the response // Return the response
return [200, updatedSessioninAdmin]; return [200, updatedAdminSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninAdmin - DELETE // @ AdminSession - DELETE
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onDelete('api/apps/report/sessionin-admin/sessionin-admin') .onDelete('api/apps/report/admin-session/admin-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 sessioninAdmin and delete it // Find the adminSession and delete it
this._sessioninAdmins.forEach((item, index) => { this._adminSessions.forEach((item, index) => {
if (item.id === id) { if (item.id === id) {
this._sessioninAdmins.splice(index, 1); this._adminSessions.splice(index, 1);
} }
}); });

View File

@ -1,6 +1,6 @@
/* eslint-disable */ /* eslint-disable */
export const sessioninAdmins = [ export const adminSessions = [
{ {
id: '1', id: '1',
rank: '본사', rank: '본사',

View File

@ -329,11 +329,11 @@ export const defaultNavigation: FuseNavigationItem[] = [
link: '/report/sessionin-overlap', link: '/report/sessionin-overlap',
}, },
{ {
id: 'report.sessionin-admin', id: 'report.admin-session',
title: 'Sessionin Admin', title: 'Admin Session',
type: 'basic', type: 'basic',
icon: 'heroicons_outline:academic-cap', icon: 'heroicons_outline:academic-cap',
link: '/report/sessionin-admin', link: '/report/admin-session',
}, },
{ {
id: 'report.excel-log', id: 'report.excel-log',

View File

@ -60,7 +60,7 @@ 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 { ReportSessioninInfoMockApi } from './apps/report/sessionin-info/api';
import { ReportSessioninOverlapMockApi } from './apps/report/sessionin-overlap/api'; import { ReportSessioninOverlapMockApi } from './apps/report/sessionin-overlap/api';
import { ReportSessioninAdminMockApi } from './apps/report/sessionin-admin/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';
import { ReportLoosingMockApi } from './apps/report/loosing/api'; import { ReportLoosingMockApi } from './apps/report/loosing/api';
import { BoardNoticeMockApi } from './apps/board/notice/api'; import { BoardNoticeMockApi } from './apps/board/notice/api';
@ -133,7 +133,7 @@ export const mockApiServices = [
ReportPaymentLogMockApi, ReportPaymentLogMockApi,
ReportSessioninInfoMockApi, ReportSessioninInfoMockApi,
ReportSessioninOverlapMockApi, ReportSessioninOverlapMockApi,
ReportSessioninAdminMockApi, ReportAdminSessionMockApi,
ReportExcelLogMockApi, ReportExcelLogMockApi,
ReportLoosingMockApi, ReportLoosingMockApi,
BoardNoticeMockApi, BoardNoticeMockApi,

View File

@ -24,14 +24,14 @@ import { SharedModule } from 'app/shared/shared.module';
import { COMPONENTS } from './components'; import { COMPONENTS } from './components';
import { sessioninAdminRoutes } from './sessionin-admin.routing'; import { adminSessionRoutes } from './admin-session.routing';
@NgModule({ @NgModule({
declarations: [COMPONENTS], declarations: [COMPONENTS],
imports: [ imports: [
TranslocoModule, TranslocoModule,
SharedModule, SharedModule,
RouterModule.forChild(sessioninAdminRoutes), RouterModule.forChild(adminSessionRoutes),
MatButtonModule, MatButtonModule,
MatFormFieldModule, MatFormFieldModule,
@ -51,4 +51,4 @@ import { sessioninAdminRoutes } from './sessionin-admin.routing';
MatMomentDateModule, MatMomentDateModule,
], ],
}) })
export class SessioninAdminModule {} export class AdminSessionModule {}

View File

@ -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 { SessioninAdminsResolver } from './resolvers/sessionin-admin.resolver'; import { AdminSessionsResolver } from './resolvers/admin-session.resolver';
import { UserResolver } from '../../member/user/resolvers/user.resolver'; import { UserResolver } from '../../member/user/resolvers/user.resolver';
export const sessioninAdminRoutes: Route[] = [ export const adminSessionRoutes: Route[] = [
{ {
path: '', path: '',
component: ListComponent, component: ListComponent,
resolve: { resolve: {
sessioninAdmins: SessioninAdminsResolver, adminSessions: AdminSessionsResolver,
}, },
}, },
{ {

View File

@ -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="sessioninAdmins$ | async as sessioninAdmins"> <ng-container *ngIf="adminSessions$ | async as adminSessions">
<ng-container *ngIf="sessioninAdmins.length > 0; else noUser"> <ng-container *ngIf="adminSessions.length > 0; else noAdminSession">
<div class="grid"> <div class="grid">
<!-- Header --> <!-- Header -->
<div <div
@ -128,10 +128,10 @@
<div class="hidden lg:block">회원차단/해제</div> <div class="hidden lg:block">회원차단/해제</div>
</div> </div>
<!-- Rows --> <!-- Rows -->
<ng-container *ngIf="sessioninAdmins$ | async as sessioninAdmins"> <ng-container *ngIf="adminSessions$ | async as adminSessions">
<ng-container <ng-container
*ngFor=" *ngFor="
let admin of sessioninAdmins; let admin of adminSessions;
let i = index; let i = index;
trackBy: __trackByFn trackBy: __trackByFn
" "
@ -211,7 +211,7 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
<ng-template #noUser> <ng-template #noAdminSession>
<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"
> >

View File

@ -24,13 +24,13 @@ import {
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmationService } from '@fuse/services/confirmation'; import { FuseConfirmationService } from '@fuse/services/confirmation';
import { SessioninAdmin } from '../models/sessionin-admin'; import { AdminSession } from '../models/admin-session';
import { SessioninAdminPagination } from '../models/sessionin-admin-pagination'; import { AdminSessionPagination } from '../models/admin-session-pagination';
import { SessioninAdminService } from '../services/sessionin-admin.service'; import { AdminSessionService } from '../services/admin-session.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@Component({ @Component({
selector: 'sessionin-admin-list', selector: 'admin-session-list',
templateUrl: './list.component.html', templateUrl: './list.component.html',
styles: [ styles: [
/* language=SCSS */ /* language=SCSS */
@ -60,12 +60,12 @@ 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;
sessioninAdmins$!: Observable<SessioninAdmin[] | undefined>; adminSessions$!: Observable<AdminSession[] | undefined>;
isLoading = false; isLoading = false;
searchInputControl = new FormControl(); searchInputControl = new FormControl();
selectedSessioninAdmin?: SessioninAdmin; selectedAdminSession?: AdminSession;
pagination?: SessioninAdminPagination; pagination?: AdminSessionPagination;
__isSearchOpened = false; __isSearchOpened = false;
ipBlockConfigForm!: FormGroup; ipBlockConfigForm!: FormGroup;
@ -80,7 +80,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 _sessioninAdminService: SessioninAdminService, private _adminSessionService: AdminSessionService,
private router: Router private router: Router
) {} ) {}
@ -93,9 +93,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
*/ */
ngOnInit(): void { ngOnInit(): void {
// Get the pagination // Get the pagination
this._sessioninAdminService.pagination$ this._adminSessionService.pagination$
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))
.subscribe((pagination: SessioninAdminPagination | undefined) => { .subscribe((pagination: AdminSessionPagination | undefined) => {
// Update the pagination // Update the pagination
this.pagination = pagination; this.pagination = pagination;
@ -104,7 +104,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
// Get the products // Get the products
this.sessioninAdmins$ = this._sessioninAdminService.sessioninAdmins$; this.adminSessions$ = this._adminSessionService.adminSessions$;
// Set ip, id block config // Set ip, id block config
this.__idBlockConfirmConfig(); this.__idBlockConfirmConfig();

View File

@ -1,4 +1,4 @@
export interface SessioninAdminPagination { export interface AdminSessionPagination {
length: number; length: number;
size: number; size: number;
page: number; page: number;

View File

@ -1,4 +1,4 @@
export interface SessioninAdmin { export interface AdminSession {
id: string; id: string;
rank?: string; rank?: string;
userId?: string; userId?: string;

View File

@ -7,19 +7,19 @@ import {
} from '@angular/router'; } from '@angular/router';
import { catchError, Observable, throwError } from 'rxjs'; import { catchError, Observable, throwError } from 'rxjs';
import { SessioninAdmin } from '../models/sessionin-admin'; import { AdminSession } from '../models/admin-session';
import { SessioninAdminPagination } from '../models/sessionin-admin-pagination'; import { AdminSessionPagination } from '../models/admin-session-pagination';
import { SessioninAdminService } from '../services/sessionin-admin.service'; import { AdminSessionService } from '../services/admin-session.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninAdminResolver implements Resolve<any> { export class AdminSessionResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor( constructor(
private _sessioninAdminService: SessioninAdminService, private _adminSessionService: AdminSessionService,
private _router: Router private _router: Router
) {} ) {}
@ -36,9 +36,9 @@ export class SessioninAdminResolver implements Resolve<any> {
resolve( resolve(
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<SessioninAdmin | undefined> { ): Observable<AdminSession | undefined> {
return this._sessioninAdminService return this._adminSessionService
.getSessioninAdminById(route.paramMap.get('id')) .getAdminSessionById(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 SessioninAdminResolver implements Resolve<any> {
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninAdminsResolver implements Resolve<any> { export class AdminSessionsResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor(private _sessioninAdminService: SessioninAdminService) {} constructor(private _adminSessionService: AdminSessionService) {}
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ Public methods // @ Public methods
@ -81,9 +81,9 @@ export class SessioninAdminsResolver implements Resolve<any> {
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<{ ): Observable<{
pagination: SessioninAdminPagination; pagination: AdminSessionPagination;
sessioninAdmins: SessioninAdmin[]; adminSessions: AdminSession[];
}> { }> {
return this._sessioninAdminService.getSessioninAdmins(); return this._adminSessionService.getAdminSessions();
} }
} }

View File

@ -12,21 +12,21 @@ import {
throwError, throwError,
} from 'rxjs'; } from 'rxjs';
import { SessioninAdmin } from '../models/sessionin-admin'; import { AdminSession } from '../models/admin-session';
import { SessioninAdminPagination } from '../models/sessionin-admin-pagination'; import { AdminSessionPagination } from '../models/admin-session-pagination';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninAdminService { export class AdminSessionService {
// Private // Private
private __pagination = new BehaviorSubject< private __pagination = new BehaviorSubject<
SessioninAdminPagination | undefined AdminSessionPagination | undefined
>(undefined); >(undefined);
private __sessioninAdmin = new BehaviorSubject<SessioninAdmin | undefined>( private __adminSession = new BehaviorSubject<AdminSession | undefined>(
undefined undefined
); );
private __sessioninAdmins = new BehaviorSubject<SessioninAdmin[] | undefined>( private __adminSessions = new BehaviorSubject<AdminSession[] | undefined>(
undefined undefined
); );
@ -42,22 +42,22 @@ export class SessioninAdminService {
/** /**
* Getter for pagination * Getter for pagination
*/ */
get pagination$(): Observable<SessioninAdminPagination | undefined> { get pagination$(): Observable<AdminSessionPagination | undefined> {
return this.__pagination.asObservable(); return this.__pagination.asObservable();
} }
/** /**
* Getter for sessioninAdmin * Getter for adminSession
*/ */
get sessioninAdmin$(): Observable<SessioninAdmin | undefined> { get adminSession$(): Observable<AdminSession | undefined> {
return this.__sessioninAdmin.asObservable(); return this.__adminSession.asObservable();
} }
/** /**
* Getter for sessioninAdmins * Getter for adminSessions
*/ */
get sessioninAdmins$(): Observable<SessioninAdmin[] | undefined> { get adminSessions$(): Observable<AdminSession[] | undefined> {
return this.__sessioninAdmins.asObservable(); return this.__adminSessions.asObservable();
} }
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
@ -65,7 +65,7 @@ export class SessioninAdminService {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
/** /**
* Get SessioninAdmins * Get AdminSessions
* *
* *
* @param page * @param page
@ -74,21 +74,21 @@ export class SessioninAdminService {
* @param order * @param order
* @param search * @param search
*/ */
getSessioninAdmins( getAdminSessions(
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: SessioninAdminPagination; pagination: AdminSessionPagination;
sessioninAdmins: SessioninAdmin[]; adminSessions: AdminSession[];
}> { }> {
return this._httpClient return this._httpClient
.get<{ .get<{
pagination: SessioninAdminPagination; pagination: AdminSessionPagination;
sessioninAdmins: SessioninAdmin[]; adminSessions: AdminSession[];
}>('api/apps/report/sessionin-admin/sessionin-admins', { }>('api/apps/report/admin-session/admin-sessions', {
params: { params: {
page: '' + page, page: '' + page,
size: '' + size, size: '' + size,
@ -100,7 +100,7 @@ export class SessioninAdminService {
.pipe( .pipe(
tap((response) => { tap((response) => {
this.__pagination.next(response.pagination); this.__pagination.next(response.pagination);
this.__sessioninAdmins.next(response.sessioninAdmins); this.__adminSessions.next(response.adminSessions);
}) })
); );
} }
@ -108,19 +108,19 @@ export class SessioninAdminService {
/** /**
* Get product by id * Get product by id
*/ */
getSessioninAdminById(id: string | null): Observable<SessioninAdmin> { getAdminSessionById(id: string | null): Observable<AdminSession> {
return this.__sessioninAdmins.pipe( return this.__adminSessions.pipe(
take(1), take(1),
map((sessioninAdmins) => { map((adminSessions) => {
// Find the product // Find the product
const sessioninAdmin = const adminSession =
sessioninAdmins?.find((item) => item.id === id) || undefined; adminSessions?.find((item) => item.id === id) || undefined;
// Update the product // Update the product
this.__sessioninAdmin.next(sessioninAdmin); this.__adminSession.next(adminSession);
// Return the product // Return the product
return sessioninAdmin; return adminSession;
}), }),
switchMap((product) => { switchMap((product) => {
if (!product) { if (!product) {
@ -135,24 +135,21 @@ export class SessioninAdminService {
/** /**
* Create product * Create product
*/ */
createSessioninAdmin(): Observable<SessioninAdmin> { createAdminSession(): Observable<AdminSession> {
return this.sessioninAdmins$.pipe( return this.adminSessions$.pipe(
take(1), take(1),
switchMap((sessioninAdmins) => switchMap((adminSessions) =>
this._httpClient this._httpClient
.post<SessioninAdmin>('api/apps/report/sessionin-admin/product', {}) .post<AdminSession>('api/apps/report/admin-session/product', {})
.pipe( .pipe(
map((newSessioninAdmin) => { map((newAdminSession) => {
// Update the sessioninAdmins with the new product // Update the adminSessions with the new product
if (!!sessioninAdmins) { if (!!adminSessions) {
this.__sessioninAdmins.next([ this.__adminSessions.next([newAdminSession, ...adminSessions]);
newSessioninAdmin,
...sessioninAdmins,
]);
} }
// Return the new product // Return the new product
return newSessioninAdmin; return newAdminSession;
}) })
) )
) )

View File

@ -38,7 +38,7 @@
"Modification Log": "Member Modification Logs", "Modification Log": "Member Modification Logs",
"Payment Log": "Manual Payment Logs", "Payment Log": "Manual Payment Logs",
"Sessionin Info": "Sessionin Info", "Sessionin Info": "Sessionin Info",
"Sessionin Admin": "Sessionin Admin Info", "Admin Session": "Admin Session",
"Sessionin Overlap": "Sessionin Overlap", "Sessionin Overlap": "Sessionin Overlap",
"Excel Log": "Excel Download Logs", "Excel Log": "Excel Download Logs",
"Loosing": "Loosing Management", "Loosing": "Loosing Management",

View File

@ -47,7 +47,7 @@
"Payment Log": "수동지급/회수 로그", "Payment Log": "수동지급/회수 로그",
"Sessionin Info": "로그인정보", "Sessionin Info": "로그인정보",
"Sessionin Overlap": "중복로그인", "Sessionin Overlap": "중복로그인",
"Sessionin Admin": "관리자 로그인정보", "Admin Session": "관리자 로그인정보",
"Excel Log": "엑셀다운 로그", "Excel Log": "엑셀다운 로그",
"Loosing": "루징관리", "Loosing": "루징관리",
"Notice": "공지사항", "Notice": "공지사항",