Commit 5cbaef0f authored by ari_darmawan's avatar ari_darmawan

create last logs login

parent 5fff1548
This diff is collapsed.
......@@ -26,6 +26,7 @@
"ckeditor4-angular": "^1.3.0",
"core-js": "^2.5.4",
"jquery": "^3.3.1",
"moment": "^2.29.3",
"ngx-ckeditor": "^0.4.0",
"popper.js": "^1.15.0",
"rxjs": "^6.3.3",
......
......@@ -67,7 +67,7 @@ export class AdminDashboardReportComponent implements OnInit {
private FormBuilder : FormBuilder,
// private _MetaBaseService : MetaBaseService,
private _DashboardService : DashboardService,
private _SP : ServiceProxyWeb) { }
public _SP : ServiceProxyWeb) { }
ngOnInit() {
......
.downloadExportReport{
border: 1px solid #607D8B;
padding: 5px 10px;
border-radius: 3px;
float: right;
font-size: 12px;
background: #607D8B;
color: #fff;
cursor: pointer;
margin: 0 10px 30px 0;
}
.downloadExportReport:hover{
color: #ffffff;
background-color:#263238 ;
}
.Table-Background{
/* border: 2px solid #ebe9e9; */
padding: 20px 5px;
margin: 10px;
/* border-radius: 10px; */
}
.table th {
vertical-align: middle;
}
.table td, .table th {
min-width: 150px;
}
.table td:first-child, .table th:first-child {
min-width: 20px;
}
\ No newline at end of file
<div class="row">
<!-- <div class="col-12 col-sm-12 text-center mt-5" *ngIf="isTicketReportEmpty == true">
<p style="font-size:18px;" class="text-muted"><i class="fas fa-table fa-3x"></i> <br> No List of Report</p>
</div>
<div class="col-12 col-sm-12 text-center mt-5" *ngIf="isTicketReportLoading == true">
<p style="font-size:18px;" class="text-muted"><i class="fas fa-spinner fa-spin"></i> Retrieving data</p>
</div> -->
<div class="col-12 col-sm-12 Table-Background" *ngIf="!isLoading && !isEmpaty">
<span class="downloadExportReport" *ngIf="RoleID == _SP.PARAM_SPV ">
Download Excel
<i class="fas fa-download"></i>
</span>
<div class="table-responsive mt-4">
<table class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th>#</th>
<th>Username</th>
<th>Last Login</th>
</tr>
</thead>
<!-- [ngStyle]="{'background-color': (i%2 == 0)? '#ccc' : '#fff'}" -->
<!-- <tbody>
<ng-container *ngFor="let data of TicketReportData; let i = index">
<tr>
<td>{{((i+1) + ((TicketReportRequest.perpage * TicketReportRequest.page) - TicketReportRequest.perpage))}}.</td>
<td>{{data.ticket_no}}</td>
<td>{{data.ticket_title}}</td>
<td>{{data.ticket_created_time | date: 'dd MMMM yyyy HH:mm'}}</td>
<td>{{data.customer_type}}</td>
<td>{{data.customer_name}}</td>
<td>{{data.customer_type_id}}</td>
<td>{{data.customer_id_number}}</td>
<td>{{data.customer_mobile_phone}}</td>
<td>{{data.customer_mobile_phone2}}</td>
<td>{{data.customer_email}}</td>
<td>{{data.penyebab_pengaduan }}</td>
<td>{{data.ticket_service_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.ticket_description}}</td>
<td>{{data.ticket_status}}
<div *ngIf="data.team_name == null">
( Defect )
</div>
</td>
<td>{{data.ticket_resolved_date | date: 'dd MMMM yyyy HH:mm'}}</td>
<td>{{data.ticket_total_days_resolved}}</td>
</tr>
</ng-container>
</tbody> -->
</table>
</div>
</div>
</div>
<br>
<!-- <div class="row" *ngIf="isTicketReportLoading == false && isTicketReportEmpty == false">
<div class="col-12">
<p class="text-center text-muted">
<small>
{{PagingDisplay}}
</small>
</p>
</div>
<div class="col-6">
<h5 class="text-center arataka-paging-arrow mb-5" (click)="PagingArrowLeft()">
<i class="fas fa-chevron-left"></i> Previous
</h5>
</div>
<div class="col-6">
<h5 class="text-center arataka-paging-arrow mb-5" (click)="PagingArrowRight()">
Next <i class="fas fa-chevron-right"></i>
</h5>
</div>
</div> -->
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LogsLoginComponent } from './logs-login.component';
describe('LogsLoginComponent', () => {
let component: LogsLoginComponent;
let fixture: ComponentFixture<LogsLoginComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LogsLoginComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LogsLoginComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { ServiceProxyWeb } from '../../../../shared/serviceproxy/service-proxy.service';
@Component({
selector: 'app-logs-login',
templateUrl: './logs-login.component.html',
styleUrls: ['./logs-login.component.css']
})
export class LogsLoginComponent implements OnInit {
isLoading: boolean = false;
isEmpaty: boolean = false;
RoleID = this._SP.getUserInformation.values.roles[0].id
constructor(
public _SP : ServiceProxyWeb
) { }
ngOnInit() {
}
}
......@@ -9,6 +9,7 @@ import { AdminTicketOnpicComponent } from './admin-ticket-onpic/admin-ticket-onp
import { AdminTicketOnpicDetailComponent } from './admin-ticket-onpic/admin-ticket-onpic-detail/admin-ticket-onpic-detail.component';
import { AdminMacroComponent } from './admin-macro/admin-macro.component';
import { AdminLivedashboardComponent } from './admin-livedashboard/admin-livedashboard.component';
import { LoginLogsComponent } from './login-logs/login-logs.component';
const routes: Routes = [
{
......@@ -19,6 +20,10 @@ const routes: Routes = [
path: 'live-dashboard',
component: AdminLivedashboardComponent
},
{
path: 'logs-login',
component: LoginLogsComponent
},
{
path: 'ticket',
component: AdminTicketComponent
......
......@@ -4,12 +4,17 @@
<h6 class="text-muted"><i class="fas fa-ticket-alt"></i> Ticket</h6>
</div>
<div class="col-sm-2 mb-3">
<button class="btn btn-sm btn-block arataka-btn-primary" *ngIf="RoleID == _SP.PARAM_AGENT" (click)="AddNewClick()"><i class="fas fa-plus-circle"></i> Add New Ticket</button>
<button routerLink="/admin/ticket/create" class="btn btn-sm btn-block arataka-btn-primary" *ngIf="RoleID == _SP.PARAM_AGENT">
<i class="fas fa-plus-circle"></i>
Add New Ticket
</button>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-4 col-lg-3 mb-3">
<label class="text-muted"><small>Filter Status</small></label>
<label class="text-muted">
<small>Filter Status</small>
</label>
<select type="text"
class="form-control form-control-sm select-style"
[(ngModel)]="KeyFilterStatus"
......@@ -21,7 +26,9 @@
</div>
<div class="col-12 col-sm-12 col-md-4 col-lg-3 mb-3" *ngIf="RoleID == _SP.PARAM_AGENT">
<!-- <ng-container> -->
<label class="text-muted"><small>Filter By</small></label>
<label class="text-muted">
<small>Filter By</small>
</label>
<select type="text"
class="form-control form-control-sm select-style"
[(ngModel)]="KeyFilterByContact"
......@@ -43,18 +50,26 @@
<div class="col-4 col-sm-4 col-md-3 col-lg-3 mb-3">
<label><small></small></label>
<button
class="btn btn-sm btn-success arataka-btn-success" style="margin-top: 29px; width: 100px;" (click)="DoSearch()"><i class="bi bi-search"></i> Search
class="btn btn-sm btn-success arataka-btn-success" style="margin-top: 29px; width: 100px;" (click)="DoSearch()">
<i class="bi bi-search"></i>
Search
</button>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 text-center mt-5" *ngIf="isTicketListEmpty == true">
<p style="font-size:18px;" class="text-muted"><i class="fas fa-table fa-3x"></i> <br> Empty Data</p>
<div class="col-12 col-sm-12 text-center mt-5" *ngIf="isTicketListEmpty">
<p style="font-size:18px;" class="text-muted">
<i class="fas fa-table fa-3x"></i>
<br> Empty Data
</p>
</div>
<div class="col-12 col-sm-12 text-center mt-5" *ngIf="isTicketListLoading == true">
<p style="font-size:18px;" class="text-muted"><i class="fas fa-spinner fa-spin"></i> Retrieving data</p>
<div class="col-12 col-sm-12 text-center mt-5" *ngIf="isTicketListLoading">
<p style="font-size:18px;" class="text-muted">
<i class="fas fa-spinner fa-spin"></i>
Retrieving data
</p>
</div>
<div class="col-12 col-sm-12 Table-Background" *ngIf="isTicketListLoading == false && isTicketListEmpty == false">
<div class="col-12 col-sm-12 Table-Background" *ngIf="!isTicketListLoading && !isTicketListEmpty">
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered table-sm">
<thead>
......@@ -93,7 +108,10 @@
<td>{{data.agent_name}}</td>
<td style="width: 8%; text-align: center;">
<button
class="btn btn-sm btn-block arataka-btn-default" (click)="pageToDetail(data)"><i class="far fa-eye"></i> Detail</button>
class="btn btn-sm btn-block arataka-btn-default" routerLink="/admin/ticket/detail/{{data.id}}">
<i class="far fa-eye"></i>
Detail
</button>
</td>
</tr>
</ng-container>
......@@ -103,7 +121,7 @@
</div>
</div>
<br>
<div class="row" *ngIf="isTicketListLoading == false && isTicketListEmpty == false">
<div class="row" *ngIf="!isTicketListLoading && !isTicketListEmpty">
<div class="col-12">
<p class="text-center text-muted">
<small>
......
......@@ -23,6 +23,8 @@ import { AdminLdTicketbyservicefamilyComponent } from './admin-livedashboard/adm
import { AdminLdTicketbystatusComponent } from './admin-livedashboard/admin-ld-ticketbystatus/admin-ld-ticketbystatus.component';
import { AdminLdTop10ticketbycategoryComponent } from './admin-livedashboard/admin-ld-top10ticketbycategory/admin-ld-top10ticketbycategory.component';
import { AdminLdTop10usercreateticketComponent } from './admin-livedashboard/admin-ld-top10usercreateticket/admin-ld-top10usercreateticket.component';
import { LogsLoginComponent } from './admin-dashboard/logs-login/logs-login.component';
import { LoginLogsComponent } from './login-logs/login-logs.component';
/*import { PipeSha256 } from '../pipe/pipe-global.pipe';
import { PipeEncryptoJs } from '../pipe/pipe-global.pipe';
import { PipeDencryptoJs } from '../pipe/pipe-global.pipe';
......@@ -49,6 +51,8 @@ import { PipeDencryptoJs } from '../pipe/pipe-global.pipe';
AdminLdTicketbystatusComponent,
AdminLdTop10ticketbycategoryComponent,
AdminLdTop10usercreateticketComponent,
LogsLoginComponent,
LoginLogsComponent,
],
imports: [
PipeglobalModule,
......
.downloadExportReport{
border: 1px solid #607D8B;
padding: 5px 10px;
border-radius: 3px;
float: right;
font-size: 12px;
background: #607D8B;
color: #fff;
cursor: pointer;
margin: 30px 10px 30px 0;
}
.downloadExportReport:hover{
color: #ffffff;
background-color:#263238 ;
}
.Table-Background{
/* border: 2px solid #ebe9e9; */
padding: 20px 5px;
margin: 10px;
/* border-radius: 10px; */
}
.table th {
vertical-align: middle;
}
.table td, .table th {
min-width: 150px;
}
.table td:first-child, .table th:first-child {
min-width: 20px;
}
\ No newline at end of file
<div class="container">
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-2">
<label class="text-muted"><small>Start Date</small></label>
<div class="input-group date" id="StartDate" data-target-input="nearest">
<input type="text"
class="form-control form-control-sm datetimepicker-input" data-toggle="datetimepicker"
data-target="#StartDate" />
<div class="input-group-append" data-target="#StartDate" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar-alt"></i></div>
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-2">
<label class="text-muted"><small>End Date</small></label>
<div class="input-group date" id="EndDate" data-target-input="nearest">
<input type="text"
class="form-control form-control-sm datetimepicker-input" data-toggle="datetimepicker"
data-target="#EndDate" />
<div class="input-group-append" data-target="#EndDate" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar-alt"></i></div>
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-3">
<label class="text-muted"><small>Search</small></label>
<input type="text" class="form-control form-control-sm" (keyup.enter)="requestLogLogin()" [(ngModel)]="listRequest.search_text" placeholder="Type.." maxlength="100">
</div>
<div class="col-12 col-sm-12 col-md-4 col-lg-2">
<label class="text-muted"><small></small></label>
<button class="btn btn-sm btn-success arataka-btn-success" style="margin-top: 31px; width: 100px;" (click)="requestLogLogin()">
<i class="bi bi-search"></i>
Search
</button>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-3">
<span class="downloadExportReport" (click)="exportFile()">
Download Excel
<i class="fas fa-download"></i>
</span>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 text-center mt-5" *ngIf="isEmpaty">
<p style="font-size:18px;" class="text-muted"><i class="fas fa-table fa-3x"></i> <br> No List of Logs Login</p>
</div>
<div class="col-12 col-sm-12 text-center mt-5" *ngIf="isLoading">
<p style="font-size:18px;" class="text-muted"><i class="fas fa-spinner fa-spin"></i> Retrieving data</p>
</div>
<div class="col-12 col-sm-12" *ngIf="!isLoading && !isEmpaty">
<div class="table-responsive mt-4">
<table class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th>No</th>
<th>Name</th>
<th>Username</th>
<th>Team</th>
<th>Last Login</th>
</tr>
</thead>
<!-- [ngStyle]="{'background-color': (i%2 == 0)? '#ccc' : '#fff'}" -->
<tbody>
<ng-container *ngFor="let data of loginLogs.items; let i = index">
<tr>
<td>{{((i+1) + ((listRequest.filter_limit * listRequest.filter_page) - listRequest.filter_limit))}}.</td>
<td>{{data.name}}</td>
<td>{{data.username}}</td>
<td>{{data.team_name}}</td>
<td>{{data.updated_at | date: 'dd MMMM yyyy HH:mm'}}</td>
</tr>
</ng-container>
</tbody>
</table>
</div>
</div>
</div>
<br>
<div class="row" *ngIf="!isLoading && !isEmpaty">
<div class="col-12">
<p class="text-center text-muted">
<small>
{{loginLogs.pageTitle}}
</small>
</p>
</div>
<div class="col-6">
<h5 class="text-center arataka-paging-arrow mb-5" (click)="PreviousPage()">
<i class="fas fa-chevron-left"></i> Previous
</h5>
</div>
<div class="col-6">
<h5 class="text-center arataka-paging-arrow mb-5" (click)="nextPage()">
Next <i class="fas fa-chevron-right"></i>
</h5>
</div>
</div>
</div>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LoginLogsComponent } from './login-logs.component';
describe('LoginLogsComponent', () => {
let component: LoginLogsComponent;
let fixture: ComponentFixture<LoginLogsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoginLogsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LoginLogsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { ServiceProxyWeb, MicroService } from '../../../shared/serviceproxy/service-proxy.service';
import { HttpErrorResponse } from '@angular/common/http';
import { DomSanitizer } from '@angular/platform-browser';
import { ChangeDetectorRef } from '@angular/core';
import * as moment from 'moment';
declare const AratakaConfig : any;
interface bodyData {
"filter_id": number,
"filter_limit": number,
"filter_page": number,
"is_lookup": boolean,
"order_field": string,
"person_id": number,
"search_text": string,
"team_id": number,
"time_end": string,
"time_start": string
}
interface logsLogin {
"email": string,
"id": number,
"name": string,
"person_id": number,
"search_text": string,
"team_id": number,
"team_name": string,
"type": string,
"username": string,
"updated_user": string,
"updated_at": Date
}
interface items {
items: logsLogin[],
code: number,
count: number,
pageTitle: string,
from: number
}
@Component({
selector: 'app-login-logs',
templateUrl: './login-logs.component.html',
styleUrls: ['./login-logs.component.css']
})
export class LoginLogsComponent implements OnInit {
isLoading: boolean = false;
isEmpaty: boolean = false;
RoleID = this._SP.getUserInformation.values.roles[0].id;
listRequest: bodyData = {
"filter_id": null,
"filter_limit": 10,
"filter_page": 1,
"is_lookup": false,
"order_field": "",
"person_id": null,
"search_text": "",
"team_id": null,
"time_end": "",
"time_start": ""
}
loginLogs: items;
constructor(
public _SP : ServiceProxyWeb,
private API: MicroService,
private sanitizer: DomSanitizer,
private _cRef: ChangeDetectorRef,
) {
moment.locale("en-sg");
}
ngOnInit() {
this.requestLogLogin();
var StartD= new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
StartD.setMonth(StartD.getMonth() -3)
var EndD = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
AratakaConfig.BootstrapDateRangeCustomPicker({
StartDate : {
ID : '#StartDate',
DateValue : StartD,
Format : 'DD MMMM YYYY',
},
EndDate : {
ID :'#EndDate',
DateValue : EndD,
Format : 'DD MMMM YYYY',
},
})
this.listRequest.time_start = AratakaConfig.GetDateBDTP({ ID: '#StartDate', isGet: true, isGetFormat: 'YYYY-MM-DD'})
this.listRequest.time_end = AratakaConfig.GetDateBDTP({ ID: '#EndDate', isGet: true, isGetFormat: 'YYYY-MM-DD' })
this.changeDate()
}
nextPage() {
let count = 1;
if (this.listRequest.filter_page < Math.ceil(this.loginLogs.count / this.listRequest.filter_limit)) {
this.listRequest.filter_page += count
this.loginLogs.pageTitle = "Page "+ this.listRequest.filter_page +" from " + Math.ceil(this.loginLogs.count / this.listRequest.filter_limit) + ', Total ' + this.loginLogs.count + ' Data';
this.requestLogLogin();
}
}
changeDate() {
var that = this;
AratakaConfig.BootstrapDateChangePicker('#StartDate', function(e){
that.listRequest.time_start= AratakaConfig.GetDateBDTP({ ID: '#StartDate', isGet: true, isGetFormat: 'YYYY-MM-DD' });
that._cRef.detectChanges();
})
AratakaConfig.BootstrapDateChangePicker('#EndDate', function(e){
that.listRequest.time_end = AratakaConfig.GetDateBDTP({ ID: '#EndDate', isGet: true, isGetFormat: 'YYYY-MM-DD' });
that._cRef.detectChanges();
})
}
PreviousPage() {
if(this.listRequest.filter_page != 1){
this.listRequest.filter_page -= 1
this.loginLogs.pageTitle = "Page "+this.listRequest.filter_page+" from " + Math.ceil(this.loginLogs.count / this.listRequest.filter_limit) + ', Total ' + this.loginLogs.count + ' Data';
this.requestLogLogin();
}
}
exportFile() {
const params = {
"filter_limit": null,
"filter_page": null,
}
AratakaConfig.LoadingPage.showLoading('Export File.., Please wait..')
this.API.exportFile('user_log/export', this.listRequest)
.subscribe((response: any) => {
const data = `data:application/octet-stream;base64,${response.base_64}`;
const fileName: string = `log-login-${moment(this.listRequest.time_start).format('DD MMM YYYY')}-${moment(this.listRequest.time_end).format('DD MMM YYYY')}-${moment(new Date()).format('DD MMM YYYY LTS')}.xlsx`;
this.sanitizer.bypassSecurityTrustResourceUrl(data);
const a: HTMLAnchorElement = document.createElement('a') as HTMLAnchorElement;
a.href = data;
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
AratakaConfig.LoadingPage.hideLoading()
}, (err: HttpErrorResponse) => {
AratakaConfig.LoadingPage.hideLoading()
AratakaConfig.Alert.showAlert(err.error.message,'alert-danger',2000)
})
}
requestLogLogin() {
this.isLoading = true;
this.API.post('user_log/list', this.listRequest)
.subscribe((response: items) => {
if (response.items.length > 0) {
this.loginLogs = {...response};
this.loginLogs.pageTitle = "Page "+ this.listRequest.filter_page + ' from '+ Math.ceil(this.loginLogs.count / this.listRequest.filter_limit ) +', Total ' + this.loginLogs.count + ' Data';
this.loginLogs.from = Math.ceil(this.loginLogs.count / this.listRequest.filter_limit );
this.isEmpaty = false;
} else {
this.isEmpaty = true;
}
this.isLoading = false;
}, (err: HttpErrorResponse) => {
this.isLoading = false;
this.isEmpaty = true
})
}
}
......@@ -2,12 +2,21 @@ import { Component, OnInit } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';
import { Router } from '@angular/router';
import { ServiceProxyWeb } from '../../../shared/serviceproxy/service-proxy.service';
import { ServiceProxyWeb, MicroService} from '../../../shared/serviceproxy/service-proxy.service';
import { AuthService } from '../../../shared/serviceproxy/service-proxy.service';
import * as $ from 'jquery';
declare const AratakaConfig : any;
interface logsLogin {
"email": string,
"name": string,
"person_id": number,
"team_id": number,
"team_name": string,
"type": string,
"username": string
}
@Component({
selector: 'app-auth-signin',
......@@ -36,10 +45,21 @@ export class AuthSigninComponent implements OnInit {
public SiteName = this._Service.SITE_NAME
public CompanyName = this._Service.COMPANY_NAME
logsRequest: logsLogin = {
"email": "",
"name": "",
"person_id": 0,
"team_id": 0,
"team_name": "",
"type": "",
"username": ""
};
constructor(
private _AuthService : AuthService,
private _Service : ServiceProxyWeb,
private router: Router,
private API: MicroService
) { }
ngOnInit() {
......@@ -171,6 +191,14 @@ export class AuthSigninComponent implements OnInit {
console.log(btoa(_Request.Username + ':' + _Request.Password))
this._AuthService.ItopLogin(btoa(_Request.Username + ':' + _Request.Password))
.subscribe((result: any) => {
console.log(result)
this.logsRequest.email = result.values.email;
this.logsRequest.name = result.values.contact_name;
this.logsRequest.person_id = result.values.user_id;
this.logsRequest.team_id = result.values.team_id;
this.logsRequest.type = "LOGIN";
this.logsRequest.username = this.Username;
if (result !== null) {
console.log(JSON.stringify(result))
......@@ -186,6 +214,7 @@ export class AuthSigninComponent implements OnInit {
);
this._Service.setUserTokenBearer(localStorage.getItem('TokenBearer'))
//set user information login
localStorage.setItem('StorageUserLogNobuCall', JSON.stringify(result));
......@@ -194,6 +223,14 @@ export class AuthSigninComponent implements OnInit {
localStorage.setItem('UserAccessTime',Today.toString())
location.reload();
// create logs login
this.API.post('user_log', this.logsRequest)
.subscribe((response: any) => {
console.log(response)
}, (err: HttpErrorResponse) => {
})
} else {
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
......
......@@ -16,7 +16,8 @@ export class SideBarMenuComponent implements OnInit {
public Env = environment;
public TeamID = this._SP.getUserInformation.values.team_id
public TeamID = this._SP.getUserInformation.values.team_id;
public RoleID = this._SP.getUserInformation.values.roles[0].id;
//from appcomponent to child component
@Input('AppSendLogo') public appLogo;
......@@ -43,7 +44,7 @@ export class SideBarMenuComponent implements OnInit {
MenuSideBarBank(){
MenuSideBarBank() {
this.MenuSideBarCollapseItem = [
{
......@@ -56,8 +57,31 @@ export class SideBarMenuComponent implements OnInit {
Child : []
}
]
if (this.RoleID == '1') {
this.MenuSideBarCollapseItem = [
{
RouteName : 'Ticket',
OriginalName : 'Ticket',
RouteIcon : 'fas fa-ticket-alt',
RouteAddress : '/admin/ticket',
RouteActive : '',
Show : true,
Child : []
},
{
RouteName : 'Log',
OriginalName : 'Log',
RouteIcon : 'fas fa-ticket-alt',
RouteAddress : '/admin/logs-login',
RouteActive : '',
Show : true,
Child : []
}
]
}
if(this.TeamID == this.Env.Team.ServiceDesk){
if(this.TeamID == this.Env.Team.ServiceDesk) {
this.MenuSideBarCollapseItem.push(
{
RouteName : 'Ticket On Pic',
......@@ -71,7 +95,7 @@ export class SideBarMenuComponent implements OnInit {
)
}
if(this.TeamID == this.Env.Team.SupervisorNobu){
if(this.TeamID == this.Env.Team.SupervisorNobu) {
this.MenuSideBarCollapseItem.push(
{
RouteName : 'Macro',
......
......@@ -8,7 +8,7 @@ export const environment = {
// ApiUrlBase : 'http://innodev.vnetcloud.com/nobucall-api/',
//dev
// ApiUrlBase : 'http://innodev.vnetcloud.com/nobucall-api-v2/',
ApiUrlBase : 'http://innodev.vnetcloud.com/nobucall-api-v2/',
//uat
// ApiUrlBase : 'http://innodev.vnetcloud.com/nobucall-api-uat/',
......@@ -19,7 +19,11 @@ export const environment = {
// PROD
// ApiUrlBase : 'http://innodev.vnetcloud.com/nobucall-api-sit/',
ApiUrlBase : 'http://crm.nobubank.com/nobucall-api-v2/',
// ApiUrlBase : 'http://crm.nobubank.com/nobucall-api-v2/',
// API Micro Service
APIMICROSERVICE : 'http://innodev.vnetcloud.com/nobu-history-login/api/v1/',
SITE_NAME : "Visionet Helpdesk System",
SITE_LOGO : "https://i0.wp.com/jogorogo.info/wp-content/uploads/2017/07/logo_visionet.png?fit=879%2C227",
COMPANY_NAME : "PT. Visionet Data Internasional",
......
......@@ -10,7 +10,7 @@ import { environment } from '../../environments/environment.prod';
//const API_URL = environment.apiUrl;
const API_URL = environment.ApiUrlBase;
const API_MICROSERVICE = environment.APIMICROSERVICE;
const ckConfig = environment.ckeConfig;
const SITE_NAME = environment.SITE_NAME;
......@@ -28,6 +28,34 @@ const ZENDESK_API_URL = environment.ZENDESK_API_URL
const ZENDESK_API_USER = environment.ZENDESK_API_USER
const ZENDESK_API_PASS = environment.ZENDESK_API_PASS
@Injectable({
providedIn: 'root'
})
export class MicroService {
constructor(private injector: Injector, private http : HttpClient) { }
post(url: string, request: object) {
var service = this.injector.get(ServiceProxyWeb)
var headers = new HttpHeaders({
'Content-Type': 'application/json',
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
});
var options = { headers: headers };
return this.http.post(`${API_MICROSERVICE}${url}`, request, options);
}
exportFile(url: string, request: object) {
var service = this.injector.get(ServiceProxyWeb)
var headers = new HttpHeaders({
'Content-Type': 'application/json',
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
});
var options = { headers: headers };
return this.http.post(`${API_MICROSERVICE}${url}`, request, options);
}
}
@Injectable({
providedIn: 'root'
......
......@@ -1474,10 +1474,10 @@
"resolved" "https://registry.npmjs.org/circular-json/-/circular-json-0.5.9.tgz"
"version" "0.5.9"
"ckeditor4-angular@^1.0.0-beta.2":
"integrity" "sha512-fMAe2jMnf087eljy+aYK+AVVRJWxmEPHH5d7t/LiNJnZfEIEnp94jHN3E3QdJx0flrPzk5FifHBrpq4NMpC8Gw=="
"resolved" "https://registry.npmjs.org/ckeditor4-angular/-/ckeditor4-angular-1.0.0-beta.2.tgz"
"version" "1.0.0-beta.2"
"ckeditor4-angular@^1.3.0":
"integrity" "sha512-+xWaI0fKIWq0V3ItWikgkgoWjpijF1g/rVgkueZCVWA9aVw7dDUdA+wlQ48yDbZeb3ODrdIZqDnyqnD8mIXM4w=="
"resolved" "https://registry.npmjs.org/ckeditor4-angular/-/ckeditor4-angular-1.3.0.tgz"
"version" "1.3.0"
dependencies:
"load-script" "^1.0.0"
"tslib" "^1.9.0"
......@@ -4453,10 +4453,10 @@
dependencies:
"minimist" "0.0.8"
"moment@^2.10.2":
"integrity" "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
"resolved" "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz"
"version" "2.29.1"
"moment@^2.10.2", "moment@^2.29.3":
"integrity" "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
"resolved" "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz"
"version" "2.29.3"
"move-concurrently@^1.0.1":
"integrity" "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I="
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment