폴더명 수정
This commit is contained in:
parent
b5cf7173e7
commit
ce51b9e44f
|
@ -437,11 +437,11 @@ export const appRoutes: Route[] = [
|
|||
).then((m: any) => m.SessioninOverlapModule),
|
||||
},
|
||||
{
|
||||
path: 'sessionin-admin',
|
||||
path: 'admin-session',
|
||||
loadChildren: () =>
|
||||
import(
|
||||
'app/modules/admin/report/sessionin-admin/sessionin-admin.module'
|
||||
).then((m: any) => m.SessioninAdminModule),
|
||||
'app/modules/admin/report/admin-session/admin-session.module'
|
||||
).then((m: any) => m.AdminSessionModule),
|
||||
},
|
||||
{
|
||||
path: 'excel-log',
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { assign, cloneDeep } from 'lodash-es';
|
||||
import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api';
|
||||
import { sessioninAdmins as sessioninAdminsData } from './data';
|
||||
import { adminSessions as adminSessionsData } from './data';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ReportSessioninAdminMockApi {
|
||||
private _sessioninAdmins: any[] = sessioninAdminsData;
|
||||
export class ReportAdminSessionMockApi {
|
||||
private _adminSessions: any[] = adminSessionsData;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -26,10 +26,10 @@ export class ReportSessioninAdminMockApi {
|
|||
*/
|
||||
registerHandlers(): void {
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ SessioninAdmins - GET
|
||||
// @ AdminSessions - GET
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
this._fuseMockApiService
|
||||
.onGet('api/apps/report/sessionin-admin/sessionin-admins', 300)
|
||||
.onGet('api/apps/report/admin-session/admin-sessions', 300)
|
||||
.reply(({ request }) => {
|
||||
// Get available queries
|
||||
const search = request.params.get('search');
|
||||
|
@ -38,12 +38,12 @@ export class ReportSessioninAdminMockApi {
|
|||
const page = parseInt(request.params.get('page') ?? '1', 10);
|
||||
const size = parseInt(request.params.get('size') ?? '10', 10);
|
||||
|
||||
// Clone the sessioninAdmins
|
||||
let sessioninAdmins: any[] | null = cloneDeep(this._sessioninAdmins);
|
||||
// Clone the adminSessions
|
||||
let adminSessions: any[] | null = cloneDeep(this._adminSessions);
|
||||
|
||||
// Sort the sessioninAdmins
|
||||
// Sort the adminSessions
|
||||
// if (sort === 'sku' || sort === 'name' || sort === 'active') {
|
||||
// sessioninAdmins.sort((a, b) => {
|
||||
// adminSessions.sort((a, b) => {
|
||||
// const fieldA = a[sort].toString().toUpperCase();
|
||||
// const fieldB = b[sort].toString().toUpperCase();
|
||||
// return order === 'asc'
|
||||
|
@ -51,15 +51,15 @@ export class ReportSessioninAdminMockApi {
|
|||
// : fieldB.localeCompare(fieldA);
|
||||
// });
|
||||
// } else {
|
||||
// sessioninAdmins.sort((a, b) =>
|
||||
// adminSessions.sort((a, b) =>
|
||||
// order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort]
|
||||
// );
|
||||
// }
|
||||
|
||||
// If search exists...
|
||||
if (search) {
|
||||
// Filter the sessioninAdmins
|
||||
sessioninAdmins = sessioninAdmins.filter(
|
||||
// Filter the adminSessions
|
||||
adminSessions = adminSessions.filter(
|
||||
(contact: any) =>
|
||||
contact.name &&
|
||||
contact.name.toLowerCase().includes(search.toLowerCase())
|
||||
|
@ -67,32 +67,32 @@ export class ReportSessioninAdminMockApi {
|
|||
}
|
||||
|
||||
// Paginate - Start
|
||||
const sessioninAdminsLength = sessioninAdmins.length;
|
||||
const adminSessionsLength = adminSessions.length;
|
||||
|
||||
// Calculate pagination details
|
||||
const begin = page * size;
|
||||
const end = Math.min(size * (page + 1), sessioninAdminsLength);
|
||||
const lastPage = Math.max(Math.ceil(sessioninAdminsLength / size), 1);
|
||||
const end = Math.min(size * (page + 1), adminSessionsLength);
|
||||
const lastPage = Math.max(Math.ceil(adminSessionsLength / size), 1);
|
||||
|
||||
// Prepare the pagination object
|
||||
let pagination = {};
|
||||
|
||||
// If the requested page number is bigger than
|
||||
// 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
|
||||
if (page > lastPage) {
|
||||
sessioninAdmins = null;
|
||||
adminSessions = null;
|
||||
pagination = {
|
||||
lastPage,
|
||||
};
|
||||
} else {
|
||||
// Paginate the results by size
|
||||
sessioninAdmins = sessioninAdmins.slice(begin, end);
|
||||
adminSessions = adminSessions.slice(begin, end);
|
||||
|
||||
// Prepare the pagination mock-api
|
||||
pagination = {
|
||||
length: sessioninAdminsLength,
|
||||
length: adminSessionsLength,
|
||||
size: size,
|
||||
page: page,
|
||||
lastPage: lastPage,
|
||||
|
@ -105,41 +105,39 @@ export class ReportSessioninAdminMockApi {
|
|||
return [
|
||||
200,
|
||||
{
|
||||
sessioninAdmins,
|
||||
adminSessions,
|
||||
pagination,
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ SessioninAdmin - GET
|
||||
// @ AdminSession - GET
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
this._fuseMockApiService
|
||||
.onGet('api/apps/report/sessionin-admin/sessionin-admin')
|
||||
.onGet('api/apps/report/admin-session/admin-session')
|
||||
.reply(({ request }) => {
|
||||
// Get the id from the params
|
||||
const id = request.params.get('id');
|
||||
|
||||
// Clone the sessioninAdmins
|
||||
const sessioninAdmins = cloneDeep(this._sessioninAdmins);
|
||||
// Clone the adminSessions
|
||||
const adminSessions = cloneDeep(this._adminSessions);
|
||||
|
||||
// Find the sessioninAdmin
|
||||
const sessioninAdmin = sessioninAdmins.find(
|
||||
(item: any) => item.id === id
|
||||
);
|
||||
// Find the adminSession
|
||||
const adminSession = adminSessions.find((item: any) => item.id === id);
|
||||
|
||||
// Return the response
|
||||
return [200, sessioninAdmin];
|
||||
return [200, adminSession];
|
||||
});
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ SessioninAdmin - POST
|
||||
// @ AdminSession - POST
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
this._fuseMockApiService
|
||||
.onPost('api/apps/report/sessionin-admin/sessionin-admin')
|
||||
.onPost('api/apps/report/admin-session/admin-session')
|
||||
.reply(() => {
|
||||
// Generate a new sessioninAdmin
|
||||
const newSessioninAdmin = {
|
||||
// Generate a new adminSession
|
||||
const newAdminSession = {
|
||||
id: FuseMockApiUtils.guid(),
|
||||
category: '',
|
||||
name: 'A New User',
|
||||
|
@ -161,58 +159,58 @@ export class ReportSessioninAdminMockApi {
|
|||
active: false,
|
||||
};
|
||||
|
||||
// Unshift the new sessioninAdmin
|
||||
this._sessioninAdmins.unshift(newSessioninAdmin);
|
||||
// Unshift the new adminSession
|
||||
this._adminSessions.unshift(newAdminSession);
|
||||
|
||||
// Return the response
|
||||
return [200, newSessioninAdmin];
|
||||
return [200, newAdminSession];
|
||||
});
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ SessioninAdmin - PATCH
|
||||
// @ AdminSession - PATCH
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
this._fuseMockApiService
|
||||
.onPatch('api/apps/report/sessionin-admin/sessionin-admin')
|
||||
.onPatch('api/apps/report/admin-session/admin-session')
|
||||
.reply(({ request }) => {
|
||||
// Get the id and sessioninAdmin
|
||||
// Get the id and adminSession
|
||||
const id = request.body.id;
|
||||
const sessioninAdmin = cloneDeep(request.body.sessioninAdmin);
|
||||
const adminSession = cloneDeep(request.body.adminSession);
|
||||
|
||||
// Prepare the updated sessioninAdmin
|
||||
let updatedSessioninAdmin = null;
|
||||
// Prepare the updated adminSession
|
||||
let updatedAdminSession = null;
|
||||
|
||||
// Find the sessioninAdmin and update it
|
||||
this._sessioninAdmins.forEach((item, index, sessioninAdmins) => {
|
||||
// Find the adminSession and update it
|
||||
this._adminSessions.forEach((item, index, adminSessions) => {
|
||||
if (item.id === id) {
|
||||
// Update the sessioninAdmin
|
||||
sessioninAdmins[index] = assign(
|
||||
// Update the adminSession
|
||||
adminSessions[index] = assign(
|
||||
{},
|
||||
sessioninAdmins[index],
|
||||
sessioninAdmin
|
||||
adminSessions[index],
|
||||
adminSession
|
||||
);
|
||||
|
||||
// Store the updated sessioninAdmin
|
||||
updatedSessioninAdmin = sessioninAdmins[index];
|
||||
// Store the updated adminSession
|
||||
updatedAdminSession = adminSessions[index];
|
||||
}
|
||||
});
|
||||
|
||||
// Return the response
|
||||
return [200, updatedSessioninAdmin];
|
||||
return [200, updatedAdminSession];
|
||||
});
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ SessioninAdmin - DELETE
|
||||
// @ AdminSession - DELETE
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
this._fuseMockApiService
|
||||
.onDelete('api/apps/report/sessionin-admin/sessionin-admin')
|
||||
.onDelete('api/apps/report/admin-session/admin-session')
|
||||
.reply(({ request }) => {
|
||||
// Get the id
|
||||
const id = request.params.get('id');
|
||||
|
||||
// Find the sessioninAdmin and delete it
|
||||
this._sessioninAdmins.forEach((item, index) => {
|
||||
// Find the adminSession and delete it
|
||||
this._adminSessions.forEach((item, index) => {
|
||||
if (item.id === id) {
|
||||
this._sessioninAdmins.splice(index, 1);
|
||||
this._adminSessions.splice(index, 1);
|
||||
}
|
||||
});
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable */
|
||||
|
||||
export const sessioninAdmins = [
|
||||
export const adminSessions = [
|
||||
{
|
||||
id: '1',
|
||||
rank: '본사',
|
|
@ -329,11 +329,11 @@ export const defaultNavigation: FuseNavigationItem[] = [
|
|||
link: '/report/sessionin-overlap',
|
||||
},
|
||||
{
|
||||
id: 'report.sessionin-admin',
|
||||
title: 'Sessionin Admin',
|
||||
id: 'report.admin-session',
|
||||
title: 'Admin Session',
|
||||
type: 'basic',
|
||||
icon: 'heroicons_outline:academic-cap',
|
||||
link: '/report/sessionin-admin',
|
||||
link: '/report/admin-session',
|
||||
},
|
||||
{
|
||||
id: 'report.excel-log',
|
||||
|
|
|
@ -60,7 +60,7 @@ import { ReportModificationLogMockApi } from './apps/report/modification-log/api
|
|||
import { ReportPaymentLogMockApi } from './apps/report/payment-log/api';
|
||||
import { ReportSessioninInfoMockApi } from './apps/report/sessionin-info/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 { ReportLoosingMockApi } from './apps/report/loosing/api';
|
||||
import { BoardNoticeMockApi } from './apps/board/notice/api';
|
||||
|
@ -133,7 +133,7 @@ export const mockApiServices = [
|
|||
ReportPaymentLogMockApi,
|
||||
ReportSessioninInfoMockApi,
|
||||
ReportSessioninOverlapMockApi,
|
||||
ReportSessioninAdminMockApi,
|
||||
ReportAdminSessionMockApi,
|
||||
ReportExcelLogMockApi,
|
||||
ReportLoosingMockApi,
|
||||
BoardNoticeMockApi,
|
||||
|
|
|
@ -24,14 +24,14 @@ import { SharedModule } from 'app/shared/shared.module';
|
|||
|
||||
import { COMPONENTS } from './components';
|
||||
|
||||
import { sessioninAdminRoutes } from './sessionin-admin.routing';
|
||||
import { adminSessionRoutes } from './admin-session.routing';
|
||||
|
||||
@NgModule({
|
||||
declarations: [COMPONENTS],
|
||||
imports: [
|
||||
TranslocoModule,
|
||||
SharedModule,
|
||||
RouterModule.forChild(sessioninAdminRoutes),
|
||||
RouterModule.forChild(adminSessionRoutes),
|
||||
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
|
@ -51,4 +51,4 @@ import { sessioninAdminRoutes } from './sessionin-admin.routing';
|
|||
MatMomentDateModule,
|
||||
],
|
||||
})
|
||||
export class SessioninAdminModule {}
|
||||
export class AdminSessionModule {}
|
|
@ -3,15 +3,15 @@ import { Route } from '@angular/router';
|
|||
import { ListComponent } from './components/list.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';
|
||||
|
||||
export const sessioninAdminRoutes: Route[] = [
|
||||
export const adminSessionRoutes: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: ListComponent,
|
||||
resolve: {
|
||||
sessioninAdmins: SessioninAdminsResolver,
|
||||
adminSessions: AdminSessionsResolver,
|
||||
},
|
||||
},
|
||||
{
|
|
@ -99,8 +99,8 @@
|
|||
<div
|
||||
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="sessioninAdmins.length > 0; else noUser">
|
||||
<ng-container *ngIf="adminSessions$ | async as adminSessions">
|
||||
<ng-container *ngIf="adminSessions.length > 0; else noAdminSession">
|
||||
<div class="grid">
|
||||
<!-- Header -->
|
||||
<div
|
||||
|
@ -128,10 +128,10 @@
|
|||
<div class="hidden lg:block">회원차단/해제</div>
|
||||
</div>
|
||||
<!-- Rows -->
|
||||
<ng-container *ngIf="sessioninAdmins$ | async as sessioninAdmins">
|
||||
<ng-container *ngIf="adminSessions$ | async as adminSessions">
|
||||
<ng-container
|
||||
*ngFor="
|
||||
let admin of sessioninAdmins;
|
||||
let admin of adminSessions;
|
||||
let i = index;
|
||||
trackBy: __trackByFn
|
||||
"
|
||||
|
@ -211,7 +211,7 @@
|
|||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
<ng-template #noUser>
|
||||
<ng-template #noAdminSession>
|
||||
<div
|
||||
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
|
||||
>
|
|
@ -24,13 +24,13 @@ import {
|
|||
import { fuseAnimations } from '@fuse/animations';
|
||||
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
||||
|
||||
import { SessioninAdmin } from '../models/sessionin-admin';
|
||||
import { SessioninAdminPagination } from '../models/sessionin-admin-pagination';
|
||||
import { SessioninAdminService } from '../services/sessionin-admin.service';
|
||||
import { AdminSession } from '../models/admin-session';
|
||||
import { AdminSessionPagination } from '../models/admin-session-pagination';
|
||||
import { AdminSessionService } from '../services/admin-session.service';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'sessionin-admin-list',
|
||||
selector: 'admin-session-list',
|
||||
templateUrl: './list.component.html',
|
||||
styles: [
|
||||
/* language=SCSS */
|
||||
|
@ -60,12 +60,12 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
|
||||
@ViewChild(MatSort) private _sort!: MatSort;
|
||||
|
||||
sessioninAdmins$!: Observable<SessioninAdmin[] | undefined>;
|
||||
adminSessions$!: Observable<AdminSession[] | undefined>;
|
||||
|
||||
isLoading = false;
|
||||
searchInputControl = new FormControl();
|
||||
selectedSessioninAdmin?: SessioninAdmin;
|
||||
pagination?: SessioninAdminPagination;
|
||||
selectedAdminSession?: AdminSession;
|
||||
pagination?: AdminSessionPagination;
|
||||
__isSearchOpened = false;
|
||||
|
||||
ipBlockConfigForm!: FormGroup;
|
||||
|
@ -80,7 +80,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
private _changeDetectorRef: ChangeDetectorRef,
|
||||
private _fuseConfirmationService: FuseConfirmationService,
|
||||
private _formBuilder: FormBuilder,
|
||||
private _sessioninAdminService: SessioninAdminService,
|
||||
private _adminSessionService: AdminSessionService,
|
||||
private router: Router
|
||||
) {}
|
||||
|
||||
|
@ -93,9 +93,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
*/
|
||||
ngOnInit(): void {
|
||||
// Get the pagination
|
||||
this._sessioninAdminService.pagination$
|
||||
this._adminSessionService.pagination$
|
||||
.pipe(takeUntil(this._unsubscribeAll))
|
||||
.subscribe((pagination: SessioninAdminPagination | undefined) => {
|
||||
.subscribe((pagination: AdminSessionPagination | undefined) => {
|
||||
// Update the pagination
|
||||
this.pagination = pagination;
|
||||
|
||||
|
@ -104,7 +104,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
});
|
||||
|
||||
// Get the products
|
||||
this.sessioninAdmins$ = this._sessioninAdminService.sessioninAdmins$;
|
||||
this.adminSessions$ = this._adminSessionService.adminSessions$;
|
||||
|
||||
// Set ip, id block config
|
||||
this.__idBlockConfirmConfig();
|
|
@ -1,4 +1,4 @@
|
|||
export interface SessioninAdminPagination {
|
||||
export interface AdminSessionPagination {
|
||||
length: number;
|
||||
size: number;
|
||||
page: number;
|
|
@ -1,4 +1,4 @@
|
|||
export interface SessioninAdmin {
|
||||
export interface AdminSession {
|
||||
id: string;
|
||||
rank?: string;
|
||||
userId?: string;
|
|
@ -7,19 +7,19 @@ import {
|
|||
} from '@angular/router';
|
||||
import { catchError, Observable, throwError } from 'rxjs';
|
||||
|
||||
import { SessioninAdmin } from '../models/sessionin-admin';
|
||||
import { SessioninAdminPagination } from '../models/sessionin-admin-pagination';
|
||||
import { SessioninAdminService } from '../services/sessionin-admin.service';
|
||||
import { AdminSession } from '../models/admin-session';
|
||||
import { AdminSessionPagination } from '../models/admin-session-pagination';
|
||||
import { AdminSessionService } from '../services/admin-session.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SessioninAdminResolver implements Resolve<any> {
|
||||
export class AdminSessionResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(
|
||||
private _sessioninAdminService: SessioninAdminService,
|
||||
private _adminSessionService: AdminSessionService,
|
||||
private _router: Router
|
||||
) {}
|
||||
|
||||
|
@ -36,9 +36,9 @@ export class SessioninAdminResolver implements Resolve<any> {
|
|||
resolve(
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<SessioninAdmin | undefined> {
|
||||
return this._sessioninAdminService
|
||||
.getSessioninAdminById(route.paramMap.get('id'))
|
||||
): Observable<AdminSession | undefined> {
|
||||
return this._adminSessionService
|
||||
.getAdminSessionById(route.paramMap.get('id'))
|
||||
.pipe(
|
||||
// Error here means the requested product is not available
|
||||
catchError((error) => {
|
||||
|
@ -61,11 +61,11 @@ export class SessioninAdminResolver implements Resolve<any> {
|
|||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SessioninAdminsResolver implements Resolve<any> {
|
||||
export class AdminSessionsResolver implements Resolve<any> {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(private _sessioninAdminService: SessioninAdminService) {}
|
||||
constructor(private _adminSessionService: AdminSessionService) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
// @ Public methods
|
||||
|
@ -81,9 +81,9 @@ export class SessioninAdminsResolver implements Resolve<any> {
|
|||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
): Observable<{
|
||||
pagination: SessioninAdminPagination;
|
||||
sessioninAdmins: SessioninAdmin[];
|
||||
pagination: AdminSessionPagination;
|
||||
adminSessions: AdminSession[];
|
||||
}> {
|
||||
return this._sessioninAdminService.getSessioninAdmins();
|
||||
return this._adminSessionService.getAdminSessions();
|
||||
}
|
||||
}
|
|
@ -12,21 +12,21 @@ import {
|
|||
throwError,
|
||||
} from 'rxjs';
|
||||
|
||||
import { SessioninAdmin } from '../models/sessionin-admin';
|
||||
import { SessioninAdminPagination } from '../models/sessionin-admin-pagination';
|
||||
import { AdminSession } from '../models/admin-session';
|
||||
import { AdminSessionPagination } from '../models/admin-session-pagination';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class SessioninAdminService {
|
||||
export class AdminSessionService {
|
||||
// Private
|
||||
private __pagination = new BehaviorSubject<
|
||||
SessioninAdminPagination | undefined
|
||||
AdminSessionPagination | undefined
|
||||
>(undefined);
|
||||
private __sessioninAdmin = new BehaviorSubject<SessioninAdmin | undefined>(
|
||||
private __adminSession = new BehaviorSubject<AdminSession | undefined>(
|
||||
undefined
|
||||
);
|
||||
private __sessioninAdmins = new BehaviorSubject<SessioninAdmin[] | undefined>(
|
||||
private __adminSessions = new BehaviorSubject<AdminSession[] | undefined>(
|
||||
undefined
|
||||
);
|
||||
|
||||
|
@ -42,22 +42,22 @@ export class SessioninAdminService {
|
|||
/**
|
||||
* Getter for pagination
|
||||
*/
|
||||
get pagination$(): Observable<SessioninAdminPagination | undefined> {
|
||||
get pagination$(): Observable<AdminSessionPagination | undefined> {
|
||||
return this.__pagination.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for sessioninAdmin
|
||||
* Getter for adminSession
|
||||
*/
|
||||
get sessioninAdmin$(): Observable<SessioninAdmin | undefined> {
|
||||
return this.__sessioninAdmin.asObservable();
|
||||
get adminSession$(): Observable<AdminSession | undefined> {
|
||||
return this.__adminSession.asObservable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for sessioninAdmins
|
||||
* Getter for adminSessions
|
||||
*/
|
||||
get sessioninAdmins$(): Observable<SessioninAdmin[] | undefined> {
|
||||
return this.__sessioninAdmins.asObservable();
|
||||
get adminSessions$(): Observable<AdminSession[] | undefined> {
|
||||
return this.__adminSessions.asObservable();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
@ -65,7 +65,7 @@ export class SessioninAdminService {
|
|||
// -----------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get SessioninAdmins
|
||||
* Get AdminSessions
|
||||
*
|
||||
*
|
||||
* @param page
|
||||
|
@ -74,21 +74,21 @@ export class SessioninAdminService {
|
|||
* @param order
|
||||
* @param search
|
||||
*/
|
||||
getSessioninAdmins(
|
||||
getAdminSessions(
|
||||
page: number = 0,
|
||||
size: number = 10,
|
||||
sort: string = 'name',
|
||||
order: 'asc' | 'desc' | '' = 'asc',
|
||||
search: string = ''
|
||||
): Observable<{
|
||||
pagination: SessioninAdminPagination;
|
||||
sessioninAdmins: SessioninAdmin[];
|
||||
pagination: AdminSessionPagination;
|
||||
adminSessions: AdminSession[];
|
||||
}> {
|
||||
return this._httpClient
|
||||
.get<{
|
||||
pagination: SessioninAdminPagination;
|
||||
sessioninAdmins: SessioninAdmin[];
|
||||
}>('api/apps/report/sessionin-admin/sessionin-admins', {
|
||||
pagination: AdminSessionPagination;
|
||||
adminSessions: AdminSession[];
|
||||
}>('api/apps/report/admin-session/admin-sessions', {
|
||||
params: {
|
||||
page: '' + page,
|
||||
size: '' + size,
|
||||
|
@ -100,7 +100,7 @@ export class SessioninAdminService {
|
|||
.pipe(
|
||||
tap((response) => {
|
||||
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
|
||||
*/
|
||||
getSessioninAdminById(id: string | null): Observable<SessioninAdmin> {
|
||||
return this.__sessioninAdmins.pipe(
|
||||
getAdminSessionById(id: string | null): Observable<AdminSession> {
|
||||
return this.__adminSessions.pipe(
|
||||
take(1),
|
||||
map((sessioninAdmins) => {
|
||||
map((adminSessions) => {
|
||||
// Find the product
|
||||
const sessioninAdmin =
|
||||
sessioninAdmins?.find((item) => item.id === id) || undefined;
|
||||
const adminSession =
|
||||
adminSessions?.find((item) => item.id === id) || undefined;
|
||||
|
||||
// Update the product
|
||||
this.__sessioninAdmin.next(sessioninAdmin);
|
||||
this.__adminSession.next(adminSession);
|
||||
|
||||
// Return the product
|
||||
return sessioninAdmin;
|
||||
return adminSession;
|
||||
}),
|
||||
switchMap((product) => {
|
||||
if (!product) {
|
||||
|
@ -135,24 +135,21 @@ export class SessioninAdminService {
|
|||
/**
|
||||
* Create product
|
||||
*/
|
||||
createSessioninAdmin(): Observable<SessioninAdmin> {
|
||||
return this.sessioninAdmins$.pipe(
|
||||
createAdminSession(): Observable<AdminSession> {
|
||||
return this.adminSessions$.pipe(
|
||||
take(1),
|
||||
switchMap((sessioninAdmins) =>
|
||||
switchMap((adminSessions) =>
|
||||
this._httpClient
|
||||
.post<SessioninAdmin>('api/apps/report/sessionin-admin/product', {})
|
||||
.post<AdminSession>('api/apps/report/admin-session/product', {})
|
||||
.pipe(
|
||||
map((newSessioninAdmin) => {
|
||||
// Update the sessioninAdmins with the new product
|
||||
if (!!sessioninAdmins) {
|
||||
this.__sessioninAdmins.next([
|
||||
newSessioninAdmin,
|
||||
...sessioninAdmins,
|
||||
]);
|
||||
map((newAdminSession) => {
|
||||
// Update the adminSessions with the new product
|
||||
if (!!adminSessions) {
|
||||
this.__adminSessions.next([newAdminSession, ...adminSessions]);
|
||||
}
|
||||
|
||||
// Return the new product
|
||||
return newSessioninAdmin;
|
||||
return newAdminSession;
|
||||
})
|
||||
)
|
||||
)
|
|
@ -38,7 +38,7 @@
|
|||
"Modification Log": "Member Modification Logs",
|
||||
"Payment Log": "Manual Payment Logs",
|
||||
"Sessionin Info": "Sessionin Info",
|
||||
"Sessionin Admin": "Sessionin Admin Info",
|
||||
"Admin Session": "Admin Session",
|
||||
"Sessionin Overlap": "Sessionin Overlap",
|
||||
"Excel Log": "Excel Download Logs",
|
||||
"Loosing": "Loosing Management",
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
"Payment Log": "수동지급/회수 로그",
|
||||
"Sessionin Info": "로그인정보",
|
||||
"Sessionin Overlap": "중복로그인",
|
||||
"Sessionin Admin": "관리자 로그인정보",
|
||||
"Admin Session": "관리자 로그인정보",
|
||||
"Excel Log": "엑셀다운 로그",
|
||||
"Loosing": "루징관리",
|
||||
"Notice": "공지사항",
|
||||
|
|
Loading…
Reference in New Issue
Block a user