X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fapp-mgr%2Fapp-mgr.service.ts;h=7643da55f460f6af14611863f87854729d75590c;hb=refs%2Fchanges%2F72%2F2272%2F8;hp=315139e12d867fec9229f5971605c96739209bc8;hpb=b7d7982bbfbf3a1333feb8b811f99497752d3722;p=portal%2Fric-dashboard.git diff --git a/webapp-frontend/src/app/services/app-mgr/app-mgr.service.ts b/webapp-frontend/src/app/services/app-mgr/app-mgr.service.ts index 315139e1..7643da55 100644 --- a/webapp-frontend/src/app/services/app-mgr/app-mgr.service.ts +++ b/webapp-frontend/src/app/services/app-mgr/app-mgr.service.ts @@ -21,50 +21,51 @@ import { HttpClient, HttpResponse } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { XMDeployableApp, XMDeployedApp, XMXappInfo } from '../../interfaces/app-mgr.types'; -import { CommonService } from '../common/common.service'; +import { DashboardService } from '../dashboard/dashboard.service'; @Injectable() export class AppMgrService { private component = 'appmgr'; + private xappsPath = 'xapps'; constructor( - private httpClient: HttpClient, - private commonSvc: CommonService) { + private dashboardSvc: DashboardService, + private httpClient: HttpClient) { } getDeployable(instanceKey: string): Observable { - const url = this.commonSvc.buildPath(instanceKey, this.component, 'xapps', 'list'); - return this.httpClient.get(url); + const path = this.dashboardSvc.buildPath(this.component, instanceKey, this.xappsPath, 'list'); + return this.httpClient.get(path); } getDeployed(instanceKey: string): Observable { - const url = this.commonSvc.buildPath(instanceKey, this.component, 'xapps'); - return this.httpClient.get(url); + const path = this.dashboardSvc.buildPath(this.component, instanceKey, this.xappsPath); + return this.httpClient.get(path); } deployXapp(instanceKey: string, name: string): Observable> { const xappInfo: XMXappInfo = { name: name }; - const url = this.commonSvc.buildPath(instanceKey, this.component, 'xapps'); - return this.httpClient.post(url, xappInfo, { observe: 'response' }); + const path = this.dashboardSvc.buildPath(this.component, instanceKey, this.xappsPath); + return this.httpClient.post(path, xappInfo, { observe: 'response' }); } undeployXapp(instanceKey: string, name: string): Observable> { - const url = this.commonSvc.buildPath(instanceKey, this.component, 'xapps', name); - return this.httpClient.delete(url, { observe: 'response' }); + const path = this.dashboardSvc.buildPath(this.component, instanceKey, this.xappsPath, name); + return this.httpClient.delete(path, { observe: 'response' }); } getConfig(instanceKey: string): Observable { // For demo purpose, pull example config from local - return this.httpClient.get("/assets/mockdata/config.json"); - // Once Xapp manager contains layout, should call backend to get xapp config - //const url = this.commonSvc.buildPath(instanceKey, this.component, 'config'); - //return this.httpClient.get(url); + return this.httpClient.get('/assets/mockdata/config.json'); + // Once Xapp manager contains layout, should call backend to get xapp config + // const path = this.dashboardSvc.buildPath(this.component, instanceKey, 'config'); + // return this.httpClient.get(path); } putConfig(instanceKey: string, config: any): Observable> { - const url = this.commonSvc.buildPath(instanceKey, this.component, 'config'); - return this.httpClient.put(url, config, { observe: 'response' }); + const path = this.dashboardSvc.buildPath(this.component, instanceKey, 'config'); + return this.httpClient.put(path, config, { observe: 'response' }); } }