Commit da8f1f1f authored by ari_darmawan's avatar ari_darmawan

get environment

parent 36ac5efa
import { Component, OnInit,Injector, Input, Output, EventEmitter } from '@angular/core'; import { Component, OnInit,Injector, Input, Output, EventEmitter } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { ServiceProxyWeb } from '../shared/serviceproxy/service-proxy.service'; import { ServiceProxyWeb, MicroService } from '../shared/serviceproxy/service-proxy.service';
import { environment } from '../environments/environment.prod';
import * as $ from 'jquery'; import * as $ from 'jquery';
declare const AratakaConfig : any; declare const AratakaConfig : any;
...@@ -22,14 +22,15 @@ export class AppComponent implements OnInit{ ...@@ -22,14 +22,15 @@ export class AppComponent implements OnInit{
constructor( constructor(
private router: Router, private router: Router,
private _ServiceProxyWeb : ServiceProxyWeb private _ServiceProxyWeb : ServiceProxyWeb,
private MicroService: MicroService
) { } ) { }
public href: string = ""; public href: string = "";
ngOnInit() { ngOnInit() {
this.getEnvironment();
} }
onActivateMenu(e) { onActivateMenu(e) {
...@@ -63,7 +64,6 @@ export class AppComponent implements OnInit{ ...@@ -63,7 +64,6 @@ export class AppComponent implements OnInit{
} }
userInformation(){ userInformation(){
//Setting Login Time for 480 Minute / 8 Hour //Setting Login Time for 480 Minute / 8 Hour
var setDate = new Date(localStorage.getItem('UserAccessTime')) var setDate = new Date(localStorage.getItem('UserAccessTime'))
var Today = new Date() var Today = new Date()
...@@ -71,8 +71,42 @@ export class AppComponent implements OnInit{ ...@@ -71,8 +71,42 @@ export class AppComponent implements OnInit{
this.router.navigate(['auth']); this.router.navigate(['auth']);
localStorage.clear(); localStorage.clear();
} }
}
getEnvironment() {
this.MicroService.getEnv()
.subscribe((res: any) => {
environment.PARAM_SPV = res.values[0].id_field;
environment.PARAM_AGENT = res.values[1].id_field;
environment.PARAM_SERVICEDESK = res.values[2].id_field;
environment.PARAM_SUPPORT = res.values[3].id_field;
environment.category.servicesubcategory_id = res.values[24].id_field;
environment.Team.EChanelSupportCardOpr = res.values[5].id_field;
environment.Team.EChanelSupportCardOpr2 = res.values[6].id_field;
environment.Team.AtmPaymentSettlement = res.values[7].id_field;
environment.Team.ITOprPolicyAndQA = res.values[8].id_field;
environment.Team.ProductAndProcessConsumer = res.values[9].id_field;
environment.Team.PortofolioAndMonitoringCollectio = res.values[10].id_field;
environment.Team.MerchantProcessing = res.values[11].id_field;
environment.Team.BarcodeQRIS = res.values[12].id_field;
environment.Team.ITSolution = res.values[13].id_field;
environment.Team.DigitalBussinessSupport = res.values[14].id_field;
environment.Team.ConsumerLoan = res.values[15].id_field;
environment.Team.SBAndFinancialPlanning = res.values[16].id_field;
environment.Team.ServiceDesk = res.values[17].id_field;
environment.Team.CsCabangBranchAgent = res.values[18].id_field;
environment.Team.AgentCallCenter = res.values[19].id_field;
environment.Team.OvoCSTeam = res.values[20].id_field;
environment.Team.SKNRTGS = res.values[21].id_field;
environment.Team.SociomileStaff = res.values[22].id_field;
environment.Team.ProductInovationAndBusinessSupport = res.values[23].id_field;
environment.Team.ITRM = res.values[25].id_field;
environment.Team.SupervisorNobu = res.values[26].id_field;
environment.Team.MerchantBusiness = res.values[27].id_field;
environment.Team.ServiceReport = res.values[28].id_field;
environment.Agent.NobuCall = res.values[29].id_field;
environment.Agent.ServiceDesk = res.values[30].id_field;
})
} }
} }
{ {
"APIBASEURL" : "http://innodev.vnetcloud.com/nobucall-api-v2/", "APIBASEURL" : "http://localhost:9825/",
"MICROSERVICEURL" : "hhttp://innodev.vnetcloud.com/nobu-history-login/api/v1/", "MICROSERVICEURL" : "hhttp://innodev.vnetcloud.com/nobu-history-login/api/v1/",
"SITE_NAME" : "Visionet Helpdesk System", "SITE_NAME" : "Visionet Helpdesk System",
"SITE_LOGO" : "https://i0.wp.com/jogorogo.info/wp-content/uploads/2017/07/logo_visionet.png?fit=879%2C227", "SITE_LOGO" : "https://i0.wp.com/jogorogo.info/wp-content/uploads/2017/07/logo_visionet.png?fit=879%2C227",
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
"PermintaanKeNobuCall" : 5, "PermintaanKeNobuCall" : 5,
"TelponTerputus" : 7 "TelponTerputus" : 7
}, },
"category": {
"servicesubcategory_id": 702
},
"Team" : { "Team" : {
"EChanelSupportCardOpr" : 26, "EChanelSupportCardOpr" : 26,
"EChanelSupportCardOpr2" : 42451, "EChanelSupportCardOpr2" : 42451,
......
...@@ -7,7 +7,7 @@ export const environment = { ...@@ -7,7 +7,7 @@ export const environment = {
"COMPANY_NAME" : "PT. Visionet Data Internasional", "COMPANY_NAME" : "PT. Visionet Data Internasional",
"PARAM_AGENTROLEID" : 2, "PARAM_AGENTROLEID" : 2,
"PARAM_AGENTSPVROLEID" : 1, "PARAM_AGENTSPVROLEID" : 1,
"PARAM_SPV" : "1", "PARAM_SPV" : "",
"PARAM_AGENT" : "2", "PARAM_AGENT" : "2",
"PARAM_SERVICEDESK" : "4", "PARAM_SERVICEDESK" : "4",
"PARAM_SUPPORT" : "5", "PARAM_SUPPORT" : "5",
...@@ -23,6 +23,9 @@ export const environment = { ...@@ -23,6 +23,9 @@ export const environment = {
"PermintaanKeNobuCall" : 5, "PermintaanKeNobuCall" : 5,
"TelponTerputus" : 7 "TelponTerputus" : 7
}, },
"category": {
"servicesubcategory_id": 7133333
},
"Team" : { "Team" : {
"EChanelSupportCardOpr" : 26, "EChanelSupportCardOpr" : 26,
"EChanelSupportCardOpr2" : 42451, "EChanelSupportCardOpr2" : 42451,
......
...@@ -27,6 +27,9 @@ export const environment = { ...@@ -27,6 +27,9 @@ export const environment = {
"PermintaanKeNobuCall" : 5, "PermintaanKeNobuCall" : 5,
"TelponTerputus" : 7 "TelponTerputus" : 7
}, },
"category": {
"servicesubcategory_id": 7133333
},
"Team" : { "Team" : {
"EChanelSupportCardOpr" : 26, "EChanelSupportCardOpr" : 26,
"EChanelSupportCardOpr2" : 42451, "EChanelSupportCardOpr2" : 42451,
......
...@@ -6,11 +6,11 @@ import {Observable} from 'rxjs'; ...@@ -6,11 +6,11 @@ import {Observable} from 'rxjs';
import { Http, ResponseContentType, RequestOptions } from '@angular/http'; import { Http, ResponseContentType, RequestOptions } from '@angular/http';
//import { Observable } from 'rxjs'; //import { Observable } from 'rxjs';
import { environment } from '../../environments/environment.prod'; import { environment } from '../../environments/environment';
//const API_URL = environment.apiUrl; //const API_URL = environment.apiUrl;
var API_URL = "http://innodev.vnetcloud.com/nobucall-api-v2/"; var API_URL = environment.APIBASEURL;
var API_MICROSERVICE = "http://innodev.vnetcloud.com/nobu-history-login/api/v1/"; var API_MICROSERVICE = environment.MICROSERVICEURL;
var ckConfig = environment.ckeConfig; var ckConfig = environment.ckeConfig;
var SITE_NAME = environment.SITE_NAME; var SITE_NAME = environment.SITE_NAME;
var SITE_LOGO = environment.SITE_LOGO; var SITE_LOGO = environment.SITE_LOGO;
...@@ -24,25 +24,27 @@ var PARAM_SUPPORT = environment.PARAM_SUPPORT ...@@ -24,25 +24,27 @@ var PARAM_SUPPORT = environment.PARAM_SUPPORT
var ZENDESK_API_URL = environment.ZENDESK_API_URL var ZENDESK_API_URL = environment.ZENDESK_API_URL
var ZENDESK_API_USER = environment.ZENDESK_API_USER var ZENDESK_API_USER = environment.ZENDESK_API_USER
var ZENDESK_API_PASS = environment.ZENDESK_API_PASS var ZENDESK_API_PASS = environment.ZENDESK_API_PASS
var CATEGORY = environment.category.servicesubcategory_id
fetch('./assets/configAPI.json').then(res => res.json()) console.log(environment)
.then(res => { // fetch('./assets/configAPI.json').then(res => res.json())
API_URL = res.APIBASEURL; // .then(res => {
API_MICROSERVICE = res.MICROSERVICEURL; // API_URL = res.APIBASEURL;
ckConfig = res.ckeConfig; // API_MICROSERVICE = res.MICROSERVICEURL;
SITE_NAME = res.SITE_NAME; // ckConfig = res.ckeConfig;
SITE_LOGO = res.SITE_LOGO; // SITE_NAME = res.SITE_NAME;
COMPANY_NAME = res.COMPANY_NAME // SITE_LOGO = res.SITE_LOGO;
PARAM_AGENTROLEID = res.PARAM_AGENTROLEID // COMPANY_NAME = res.COMPANY_NAME
PARAM_AGENTSPVROLEID = res.PARAM_AGENTSPVROLEID // PARAM_AGENTROLEID = res.PARAM_AGENTROLEID
PARAM_SPV = res.PARAM_SPV // PARAM_AGENTSPVROLEID = res.PARAM_AGENTSPVROLEID
PARAM_AGENT = res.PARAM_AGENT // PARAM_SPV = res.PARAM_SPV
PARAM_SERVICEDESK = res.PARAM_SERVICEDESK // PARAM_AGENT = res.PARAM_AGENT
PARAM_SUPPORT = res.PARAM_SUPPORT // PARAM_SERVICEDESK = res.PARAM_SERVICEDESK
ZENDESK_API_URL = res.ZENDESK_API_URL // PARAM_SUPPORT = res.PARAM_SUPPORT
ZENDESK_API_USER = res.ZENDESK_API_USER // ZENDESK_API_URL = res.ZENDESK_API_URL
ZENDESK_API_PASS = res.ZENDESK_API_PASS // ZENDESK_API_USER = res.ZENDESK_API_USER
}) // ZENDESK_API_PASS = res.ZENDESK_API_PASS
// CATEGORY = res.category.servicesubcategory_id
// })
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
...@@ -71,6 +73,16 @@ export class MicroService { ...@@ -71,6 +73,16 @@ export class MicroService {
return this.http.post(`${API_MICROSERVICE}${url}`, request, options); return this.http.post(`${API_MICROSERVICE}${url}`, request, options);
} }
getEnv() {
const service = this.injector.get(ServiceProxyWeb)
let headers = new HttpHeaders({
'Content-Type': 'application/json'
});
let options = { headers: headers };
return this.http.get(API_URL +'environment', options);
}
} }
@Injectable({ @Injectable({
......
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