Loading config/.meepctl-repocfg.yaml +76 −6 Original line number Diff line number Diff line version: 1.8.1 version: 1.8.3 repo: name: AdvantEDGE Loading Loading @@ -138,6 +138,31 @@ repo: # archive object store configuration secret secret: meep-thanos-archive-objstore-config # Garbage Collection configuration gc: # enable garbage collection enabled: true # garbage collection interval (duration string) interval: 4h # run garbage collection on start run-on-start: true # Redis configuration redis: # enable redis garbage collection enabled: true # Influx configuration influx: # enable influx garbage collection enabled: true # list of databases that must not be removed exceptions: # - my_db_to_keep # - my_other_db_to_keep # Postgis configuration postgis: # enable postgis garbage collection enabled: false # Default monitoring dashboards dashboards: mec-sandbox: dashboards/mec-sandbox.json Loading Loading @@ -905,6 +930,21 @@ repo: # Go Packages go-packages: meep-ams-client: # location of source code src: go-packages/meep-ams-client # supports linting lint: false meep-app-support-client: # location of source code src: go-packages/meep-app-support-client # supports linting lint: false meep-applications: # location of source code src: go-packages/meep-applications # supports linting lint: true meep-couch: # location of source code src: go-packages/meep-couch Loading @@ -920,6 +960,11 @@ repo: src: go-packages/meep-data-model # supports linting lint: true meep-gc: # location of source code src: go-packages/meep-gc # supports linting lint: true meep-gis-asset-mgr: # location of source code src: go-packages/meep-gis-asset-mgr Loading @@ -930,6 +975,11 @@ repo: src: go-packages/meep-gis-cache # supports linting lint: true meep-gis-engine-client: # location of source code src: go-packages/meep-gis-engine-client # supports linting lint: false meep-http-logger: # location of source code src: go-packages/meep-http-logger Loading Loading @@ -985,6 +1035,11 @@ repo: src: go-packages/meep-net-char-mgr # supports linting lint: true meep-pdu-session-store: # location of source code src: go-packages/meep-pdu-session-store # supports linting lint: true meep-redis: # location of source code src: go-packages/meep-redis Loading @@ -1010,6 +1065,11 @@ repo: src: go-packages/meep-sandbox-store # supports linting lint: true meep-service-mgmt-client: # location of source code src: go-packages/meep-service-mgmt-client # supports linting lint: false meep-sessions: # location of source code src: go-packages/meep-sessions Loading @@ -1020,6 +1080,11 @@ repo: src: go-packages/meep-subscriptions # supports linting lint: true meep-swagger-api-mgr: # location of source code src: go-packages/meep-swagger-api-mgr # supports linting lint: true meep-users: # location of source code src: go-packages/meep-users Loading @@ -1030,11 +1095,6 @@ repo: src: go-packages/meep-wais-client # supports linting lint: false meep-ams-client: # location of source code src: go-packages/meep-ams-client # supports linting lint: false meep-watchdog: # location of source code src: go-packages/meep-watchdog Loading @@ -1048,6 +1108,16 @@ repo: # Javascript Packages js-packages: meep-auth-svc-client: # location of source code src: js-packages/meep-auth-svc-client # supports linting lint: false meep-gis-engine-client: # location of source code src: js-packages/meep-gis-engine-client # supports linting lint: false meep-metrics-engine-client: # location of source code src: js-packages/meep-metrics-engine-client Loading config/permissions.yaml +7 −0 Original line number Diff line number Diff line Loading @@ -853,6 +853,13 @@ services: path: '/events/{type}' method: 'POST' mode: 'allow' - name: 'ServicesGET' path: '/services' method: 'GET' mode: 'verify' roles: admin: 'allow' user: 'allow' #------------------------------ # WAI Service (Sbox) #------------------------------ Loading js-apps/frontend/src/js/containers/app-container.js +92 −15 Original line number Diff line number Diff line Loading @@ -98,7 +98,8 @@ import { sboxChangeMapPoaList, sboxChangeMapComputeList, sboxChangeApiTable, sboxChangeAppInstanceTable sboxChangeAppInstanceTable, sboxChangeSvcTable } from '../state/sbox'; const SBOX_ERR_COUNT_MAX = 5; Loading Loading @@ -160,7 +161,8 @@ class AppContainer extends Component { this.meepSandboxControlApi = new meepPlatformCtrlRestApiClient.SandboxControlApi(); this.meepActiveScenarioApi = new meepSandboxCtrlRestApiClient.ActiveScenarioApi(); this.meepEventsApi = new meepSandboxCtrlRestApiClient.EventsApi(); this.meepAppInfoApi = new meepSandboxCtrlRestApiClient.ApplicationsApi(); this.meepApplicationsApi = new meepSandboxCtrlRestApiClient.ApplicationsApi(); this.meepServicesApi = new meepSandboxCtrlRestApiClient.ServicesApi(); this.meepMetricsEngineApi = new meepMetricsEngineRestApiClient.MetricsApi(); this.meepGisAutomationApi = new meepGisEngineRestApiClient.AutomationApi(); this.meepGeoDataApi = new meepGisEngineRestApiClient.GeospatialDataApi(); Loading Loading @@ -255,6 +257,11 @@ class AppContainer extends Component { if (this.props.sandboxName !== prevProps.sandboxName) { this.setBasePaths(); } // Trigger API console refresh when switching back to sandbox page if (this.props.page === PAGE_SANDBOX && prevProps.page !== PAGE_SANDBOX) { this.refreshApiConsole = true; } } // Timers Loading Loading @@ -301,6 +308,7 @@ class AppContainer extends Component { this.refreshAutomation(); this.refreshMetricsTable(); this.refreshAppInstancesTable(); this.refreshServices(); } } } Loading Loading @@ -496,7 +504,7 @@ class AppContainer extends Component { deleteAppInstances() { var appInstances = this.props.appInstancesSelected; for (var i = 0; i < appInstances.length; i++) { this.meepAppInfoApi.applicationsAppInstanceIdDELETE(appInstances[i], null); this.meepApplicationsApi.applicationsAppInstanceIdDELETE(appInstances[i], null); } this.props.changeAppInstancesSelected([]); } Loading @@ -504,11 +512,11 @@ class AppContainer extends Component { createAppInstance(param) { var formParams = { 'name': param.appName, 'mepName': param.mepName, 'nodeName': param.mepName, 'type': 'USER', 'state': 'INITIALIZED' 'persist': false }; this.meepAppInfoApi.applicationsPOST(formParams, (error, data, response) => { this.meepApplicationsApi.applicationsPOST(formParams, (error, data, response) => { this.createAppInstanceCb(error, data, response); }); this.props.changeCurrentDialog(null); Loading Loading @@ -713,6 +721,7 @@ class AppContainer extends Component { this.props.changeApiTable(null); this.props.changeApiDetailedData(null); this.props.changeAppInstanceTable([]); this.props.changeSvcTable([]); } return; } Loading Loading @@ -948,6 +957,41 @@ class AppContainer extends Component { }); } /** * Callback function to receive the result of the servicesGET operation. * @callback module:api/ServicesApi~servicesGETCallback * @param {String} error Error message, if any. * @param {Array.<module:model/ServiceInfo>} data The data returned by the service call. * @param {String} response The complete HTTP response. */ getServicesCb(error, data) { if (error !== null) { this.props.changeSvcTable([]); return; } // Make sure are ready to update state if (this.props.updateAppInstancesInProgressCount !== -1) { return; } // Update App Instance table only if data is different var services = data ? data : []; const isArrayEqual = (x, y) => _.isEmpty(_.xorWith(x, y, _.isEqual)); if (!isArrayEqual(this.props.svcTable,services)) { this.props.changeSvcTable(services); // Update Edge App states this.refreshEdgeApps(this.props.appInstanceTable, services); } } refreshServices() { this.meepServicesApi.servicesGET(null, (error, data, response) => { this.getServicesCb(error, data, response); }); } /** * Callback function to receive the result of the postHttpQuery operation. * @callback module:api/AppsApi~applicationsGET Loading @@ -973,12 +1017,12 @@ class AppContainer extends Component { this.props.changeAppInstanceTable(appInstances); // Update Edge App states this.refreshEdgeApps(appInstances); this.refreshEdgeApps(appInstances, this.props.svcTable); } } refreshAppInstancesTable() { this.meepAppInfoApi.applicationsGET(null, (error, data, response) => { this.meepApplicationsApi.applicationsGET(null, (error, data, response) => { this.getAppInstancesCb(error, data, response); }); } Loading @@ -995,7 +1039,19 @@ class AppContainer extends Component { return null; } refreshEdgeApps(appInstances) { getSvcInstance(appId, services) { if (services) { for (var i = 0; i < services.length; i++) { let service = services[i]; if (service.appId === appId) { return service; } } } return null; } refreshEdgeApps(appInstances, services) { if (!this.props.edgeApps) { return; } Loading @@ -1017,16 +1073,26 @@ class AppContainer extends Component { // Find matching app instance, if any let appInstance = this.getAppInstance(edgeApp.id, appInstances); let svcInstance = this.getSvcInstance(edgeApp.id, services); // Update app instance ID when available if (appInstance && !edgeApp.appId) { edgeApp.appId = edgeApp.id; updateRequired = true; } // Update service state if (appInstance === null) { if (!appInstance || !svcInstance) { if (edgeApp.enabled) { edgeApp.enabled = false; edgeApp.appId = ''; edgeApp.svcId = ''; updateRequired = true; } } else { if (!edgeApp.enabled) { edgeApp.instance = appInstance.name; edgeApp.svcId = svcInstance.id; edgeApp.enabled = true; updateRequired = true; } Loading @@ -1042,7 +1108,7 @@ class AppContainer extends Component { } } decrementEdgeApps(appInstances) { decrementEdgeApps(appInstances, services) { if (!this.props.edgeApps) { return; } Loading @@ -1068,8 +1134,14 @@ class AppContainer extends Component { // Enable controls immediately after operation is complete if (edgeApp.enableInProgressCount < (EDGE_APP_ENABLE_COUNT_MAX - BLACKOUT_TIME)) { let appInstance = this.getAppInstance(edgeApp.id, appInstances); if (appInstance !== null) { let svcInstance = this.getSvcInstance(edgeApp.id, services); if (appInstance && !edgeApp.appId) { edgeApp.appId = edgeApp.id; } if (appInstance && svcInstance) { edgeApp.instance = appInstance.name; edgeApp.appId = edgeApp.id; edgeApp.svcId = svcInstance.id; edgeApp.enabled = true; edgeApp.enableInProgressCount = -1; } Loading @@ -1080,8 +1152,11 @@ class AppContainer extends Component { // Enable controls immediately after operation is complete if (edgeApp.disableInProgressCount < (EDGE_APP_DISABLE_COUNT_MAX - BLACKOUT_TIME)) { let appInstance = this.getAppInstance(edgeApp.id, appInstances); if (appInstance === null) { let svcInstance = this.getSvcInstance(edgeApp.id, services); if (!appInstance || !svcInstance) { edgeApp.enabled = false; edgeApp.appId = ''; edgeApp.svcId = ''; edgeApp.disableInProgressCount = -1; } } Loading Loading @@ -1114,7 +1189,7 @@ class AppContainer extends Component { } // Edge App counters this.decrementEdgeApps(this.props.appInstanceTable); this.decrementEdgeApps(this.props.appInstanceTable, this.props.svcTable); } renderPage() { Loading @@ -1135,7 +1210,7 @@ class AppContainer extends Component { eventsApi={this.meepEventsApi} metricsApi={this.meepMetricsEngineApi} automationApi={this.meepGisAutomationApi} applicationsApi={this.meepAppInfoApi} applicationsApi={this.meepApplicationsApi} /> ); Loading Loading @@ -1284,6 +1359,7 @@ const mapStateToProps = state => { edgeApps: state.ui.edgeApps, appInstanceTable: state.sbox.appInstanceTable.data, appInstancesSelected: state.ui.appInstancesSelected, svcTable: state.sbox.svcTable.data, updateUeInProgressCount: state.ui.updateUeInProgressCount, updateAppInstancesInProgressCount: state.ui.updateAppInstancesInProgressCount, activationInProgressCount: state.ui.activationInProgressCount, Loading Loading @@ -1327,6 +1403,7 @@ const mapDispatchToProps = dispatch => { changeMapComputeList: list => dispatch(sboxChangeMapComputeList(list)), changeApiTable: value => dispatch(sboxChangeApiTable(value)), changeAppInstanceTable: value => dispatch(sboxChangeAppInstanceTable(value)), changeSvcTable: value => dispatch(sboxChangeSvcTable(value)), changeUpdateUeInProgressCount: count => dispatch(uiSandboxChangeUpdateUeInProgressCount(count)), changeUpdateAutomationInProgressCount: count => dispatch(uiSandboxChangeUpdateAutomationInProgressCount(count)), changeUpdateAppInstancesInProgressCount: count => dispatch(uiSandboxChangeUpdateAppInstancesInProgressCount(count)), Loading js-apps/frontend/src/js/containers/sandbox/app-instance-info.js +32 −11 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class AppInstanceInfo extends Component { if (checked) { // Send event to enable service var sandboxEvent = { var enableEvent = { name: 'name', type: 'SCENARIO-UPDATE', eventScenarioUpdate: { Loading @@ -49,15 +49,33 @@ class AppInstanceInfo extends Component { } } }; this.props.eventsApi.sendEvent('SCENARIO-UPDATE', sandboxEvent); this.props.eventsApi.sendEvent('SCENARIO-UPDATE', enableEvent); // Enable edge app & start timer to temporarily ignore backend edgeApp.enabled = true; edgeApp.enableInProgressCount = EDGE_APP_ENABLE_COUNT_MAX; } else { // Delete app instance this.props.applicationsApi.applicationsAppInstanceIdDELETE(edgeApp.id, null); // Send event to disable service var disableEvent = { name: 'name', type: 'SCENARIO-UPDATE', eventScenarioUpdate: { action: 'REMOVE', gracePeriod: 10, node: { type: 'EDGE-APP', parent: edgeApp.mepName, nodeDataUnion: { process: { id: edgeApp.id, name: edgeApp.name } } } } }; this.props.eventsApi.sendEvent('SCENARIO-UPDATE', disableEvent); // Disable edge app & start timer to temporarily ignore backend edgeApp.enabled = false; Loading Loading @@ -94,7 +112,7 @@ class AppInstanceInfo extends Component { return ( <> <div style={{ marginTop: 15 }}> <Typography theme="primary" use="body1">MEC service startup in progress...<br/>This operation may take a few seconds.</Typography> <Typography theme="primary" use="body1">MEC Service startup in progress...<br/>This operation takes a few seconds.</Typography> </div> </> ); Loading @@ -104,7 +122,7 @@ class AppInstanceInfo extends Component { return ( <> <div style={{ marginTop: 15 }}> <Typography theme="primary" use="body1">MEC service shutdown in progress...<br/>This operation may take a few seconds.</Typography> <Typography theme="primary" use="body1">MEC Service shutdown in progress...<br/>This operation takes a few seconds.</Typography> </div> </> ); Loading @@ -114,7 +132,7 @@ class AppInstanceInfo extends Component { return ( <> <div style={{ marginTop: 15 }}> <Typography theme="primary" use="body1">This MEC service is currently disabled.</Typography> <Typography theme="primary" use="body1">This MEC Service is currently disabled.</Typography> </div> </> ); Loading @@ -131,19 +149,22 @@ class AppInstanceInfo extends Component { let isMec011 = edgeApp.pseudoName.includes('011'); let disabled = (isMec011 || edgeApp.enableInProgressCount !== -1 || edgeApp.disableInProgressCount !== -1) ? true : false; let mepInfoStr = (isMec011) ? edgeApp.mepName + ' platform API' : edgeApp.instance + ' running on ' + edgeApp.mepName; let appInfoStr = 'appInstanceId: ' + edgeApp.id; let appInfoStr = 'appInstanceId: ' + ((edgeApp.appId) ? edgeApp.appId : 'unavailable'); let svcInfoStr = 'serviceId: ' + ((edgeApp.svcId) ? edgeApp.svcId : 'unavailable'); return ( <> <Grid style={{ marginTop: 0}}> <GridCell title="Enable or disable the selected MEC API" span={12}> <p style={{ marginTop: 5, marginBottom: 10 }}> <Typography theme="primary" use="headline6">Application details</Typography> <Typography theme="primary" use="headline6">MEC Service details</Typography> </p> <Typography className="text-color-main" use="body1"> {mepInfoStr} {!isMec011 && appInfoStr && <br/>} {!isMec011 && <br/>} {!isMec011 && appInfoStr} {!isMec011 && <br/>} {!isMec011 && svcInfoStr} </Typography> </GridCell> </Grid> Loading js-apps/frontend/src/js/containers/sandbox/app-instance-table.js +1 −1 Original line number Diff line number Diff line Loading @@ -120,7 +120,7 @@ class AppInstanceTable extends Component { /> </TableCell> <TableCell className={classes.tableBodyCellNoWrap} scope="row"> {row.name} running on {row.mepName}<br/> {row.name} running on {row.nodeName}<br/> ID: {row.id} </TableCell> </TableRow> Loading Loading
config/.meepctl-repocfg.yaml +76 −6 Original line number Diff line number Diff line version: 1.8.1 version: 1.8.3 repo: name: AdvantEDGE Loading Loading @@ -138,6 +138,31 @@ repo: # archive object store configuration secret secret: meep-thanos-archive-objstore-config # Garbage Collection configuration gc: # enable garbage collection enabled: true # garbage collection interval (duration string) interval: 4h # run garbage collection on start run-on-start: true # Redis configuration redis: # enable redis garbage collection enabled: true # Influx configuration influx: # enable influx garbage collection enabled: true # list of databases that must not be removed exceptions: # - my_db_to_keep # - my_other_db_to_keep # Postgis configuration postgis: # enable postgis garbage collection enabled: false # Default monitoring dashboards dashboards: mec-sandbox: dashboards/mec-sandbox.json Loading Loading @@ -905,6 +930,21 @@ repo: # Go Packages go-packages: meep-ams-client: # location of source code src: go-packages/meep-ams-client # supports linting lint: false meep-app-support-client: # location of source code src: go-packages/meep-app-support-client # supports linting lint: false meep-applications: # location of source code src: go-packages/meep-applications # supports linting lint: true meep-couch: # location of source code src: go-packages/meep-couch Loading @@ -920,6 +960,11 @@ repo: src: go-packages/meep-data-model # supports linting lint: true meep-gc: # location of source code src: go-packages/meep-gc # supports linting lint: true meep-gis-asset-mgr: # location of source code src: go-packages/meep-gis-asset-mgr Loading @@ -930,6 +975,11 @@ repo: src: go-packages/meep-gis-cache # supports linting lint: true meep-gis-engine-client: # location of source code src: go-packages/meep-gis-engine-client # supports linting lint: false meep-http-logger: # location of source code src: go-packages/meep-http-logger Loading Loading @@ -985,6 +1035,11 @@ repo: src: go-packages/meep-net-char-mgr # supports linting lint: true meep-pdu-session-store: # location of source code src: go-packages/meep-pdu-session-store # supports linting lint: true meep-redis: # location of source code src: go-packages/meep-redis Loading @@ -1010,6 +1065,11 @@ repo: src: go-packages/meep-sandbox-store # supports linting lint: true meep-service-mgmt-client: # location of source code src: go-packages/meep-service-mgmt-client # supports linting lint: false meep-sessions: # location of source code src: go-packages/meep-sessions Loading @@ -1020,6 +1080,11 @@ repo: src: go-packages/meep-subscriptions # supports linting lint: true meep-swagger-api-mgr: # location of source code src: go-packages/meep-swagger-api-mgr # supports linting lint: true meep-users: # location of source code src: go-packages/meep-users Loading @@ -1030,11 +1095,6 @@ repo: src: go-packages/meep-wais-client # supports linting lint: false meep-ams-client: # location of source code src: go-packages/meep-ams-client # supports linting lint: false meep-watchdog: # location of source code src: go-packages/meep-watchdog Loading @@ -1048,6 +1108,16 @@ repo: # Javascript Packages js-packages: meep-auth-svc-client: # location of source code src: js-packages/meep-auth-svc-client # supports linting lint: false meep-gis-engine-client: # location of source code src: js-packages/meep-gis-engine-client # supports linting lint: false meep-metrics-engine-client: # location of source code src: js-packages/meep-metrics-engine-client Loading
config/permissions.yaml +7 −0 Original line number Diff line number Diff line Loading @@ -853,6 +853,13 @@ services: path: '/events/{type}' method: 'POST' mode: 'allow' - name: 'ServicesGET' path: '/services' method: 'GET' mode: 'verify' roles: admin: 'allow' user: 'allow' #------------------------------ # WAI Service (Sbox) #------------------------------ Loading
js-apps/frontend/src/js/containers/app-container.js +92 −15 Original line number Diff line number Diff line Loading @@ -98,7 +98,8 @@ import { sboxChangeMapPoaList, sboxChangeMapComputeList, sboxChangeApiTable, sboxChangeAppInstanceTable sboxChangeAppInstanceTable, sboxChangeSvcTable } from '../state/sbox'; const SBOX_ERR_COUNT_MAX = 5; Loading Loading @@ -160,7 +161,8 @@ class AppContainer extends Component { this.meepSandboxControlApi = new meepPlatformCtrlRestApiClient.SandboxControlApi(); this.meepActiveScenarioApi = new meepSandboxCtrlRestApiClient.ActiveScenarioApi(); this.meepEventsApi = new meepSandboxCtrlRestApiClient.EventsApi(); this.meepAppInfoApi = new meepSandboxCtrlRestApiClient.ApplicationsApi(); this.meepApplicationsApi = new meepSandboxCtrlRestApiClient.ApplicationsApi(); this.meepServicesApi = new meepSandboxCtrlRestApiClient.ServicesApi(); this.meepMetricsEngineApi = new meepMetricsEngineRestApiClient.MetricsApi(); this.meepGisAutomationApi = new meepGisEngineRestApiClient.AutomationApi(); this.meepGeoDataApi = new meepGisEngineRestApiClient.GeospatialDataApi(); Loading Loading @@ -255,6 +257,11 @@ class AppContainer extends Component { if (this.props.sandboxName !== prevProps.sandboxName) { this.setBasePaths(); } // Trigger API console refresh when switching back to sandbox page if (this.props.page === PAGE_SANDBOX && prevProps.page !== PAGE_SANDBOX) { this.refreshApiConsole = true; } } // Timers Loading Loading @@ -301,6 +308,7 @@ class AppContainer extends Component { this.refreshAutomation(); this.refreshMetricsTable(); this.refreshAppInstancesTable(); this.refreshServices(); } } } Loading Loading @@ -496,7 +504,7 @@ class AppContainer extends Component { deleteAppInstances() { var appInstances = this.props.appInstancesSelected; for (var i = 0; i < appInstances.length; i++) { this.meepAppInfoApi.applicationsAppInstanceIdDELETE(appInstances[i], null); this.meepApplicationsApi.applicationsAppInstanceIdDELETE(appInstances[i], null); } this.props.changeAppInstancesSelected([]); } Loading @@ -504,11 +512,11 @@ class AppContainer extends Component { createAppInstance(param) { var formParams = { 'name': param.appName, 'mepName': param.mepName, 'nodeName': param.mepName, 'type': 'USER', 'state': 'INITIALIZED' 'persist': false }; this.meepAppInfoApi.applicationsPOST(formParams, (error, data, response) => { this.meepApplicationsApi.applicationsPOST(formParams, (error, data, response) => { this.createAppInstanceCb(error, data, response); }); this.props.changeCurrentDialog(null); Loading Loading @@ -713,6 +721,7 @@ class AppContainer extends Component { this.props.changeApiTable(null); this.props.changeApiDetailedData(null); this.props.changeAppInstanceTable([]); this.props.changeSvcTable([]); } return; } Loading Loading @@ -948,6 +957,41 @@ class AppContainer extends Component { }); } /** * Callback function to receive the result of the servicesGET operation. * @callback module:api/ServicesApi~servicesGETCallback * @param {String} error Error message, if any. * @param {Array.<module:model/ServiceInfo>} data The data returned by the service call. * @param {String} response The complete HTTP response. */ getServicesCb(error, data) { if (error !== null) { this.props.changeSvcTable([]); return; } // Make sure are ready to update state if (this.props.updateAppInstancesInProgressCount !== -1) { return; } // Update App Instance table only if data is different var services = data ? data : []; const isArrayEqual = (x, y) => _.isEmpty(_.xorWith(x, y, _.isEqual)); if (!isArrayEqual(this.props.svcTable,services)) { this.props.changeSvcTable(services); // Update Edge App states this.refreshEdgeApps(this.props.appInstanceTable, services); } } refreshServices() { this.meepServicesApi.servicesGET(null, (error, data, response) => { this.getServicesCb(error, data, response); }); } /** * Callback function to receive the result of the postHttpQuery operation. * @callback module:api/AppsApi~applicationsGET Loading @@ -973,12 +1017,12 @@ class AppContainer extends Component { this.props.changeAppInstanceTable(appInstances); // Update Edge App states this.refreshEdgeApps(appInstances); this.refreshEdgeApps(appInstances, this.props.svcTable); } } refreshAppInstancesTable() { this.meepAppInfoApi.applicationsGET(null, (error, data, response) => { this.meepApplicationsApi.applicationsGET(null, (error, data, response) => { this.getAppInstancesCb(error, data, response); }); } Loading @@ -995,7 +1039,19 @@ class AppContainer extends Component { return null; } refreshEdgeApps(appInstances) { getSvcInstance(appId, services) { if (services) { for (var i = 0; i < services.length; i++) { let service = services[i]; if (service.appId === appId) { return service; } } } return null; } refreshEdgeApps(appInstances, services) { if (!this.props.edgeApps) { return; } Loading @@ -1017,16 +1073,26 @@ class AppContainer extends Component { // Find matching app instance, if any let appInstance = this.getAppInstance(edgeApp.id, appInstances); let svcInstance = this.getSvcInstance(edgeApp.id, services); // Update app instance ID when available if (appInstance && !edgeApp.appId) { edgeApp.appId = edgeApp.id; updateRequired = true; } // Update service state if (appInstance === null) { if (!appInstance || !svcInstance) { if (edgeApp.enabled) { edgeApp.enabled = false; edgeApp.appId = ''; edgeApp.svcId = ''; updateRequired = true; } } else { if (!edgeApp.enabled) { edgeApp.instance = appInstance.name; edgeApp.svcId = svcInstance.id; edgeApp.enabled = true; updateRequired = true; } Loading @@ -1042,7 +1108,7 @@ class AppContainer extends Component { } } decrementEdgeApps(appInstances) { decrementEdgeApps(appInstances, services) { if (!this.props.edgeApps) { return; } Loading @@ -1068,8 +1134,14 @@ class AppContainer extends Component { // Enable controls immediately after operation is complete if (edgeApp.enableInProgressCount < (EDGE_APP_ENABLE_COUNT_MAX - BLACKOUT_TIME)) { let appInstance = this.getAppInstance(edgeApp.id, appInstances); if (appInstance !== null) { let svcInstance = this.getSvcInstance(edgeApp.id, services); if (appInstance && !edgeApp.appId) { edgeApp.appId = edgeApp.id; } if (appInstance && svcInstance) { edgeApp.instance = appInstance.name; edgeApp.appId = edgeApp.id; edgeApp.svcId = svcInstance.id; edgeApp.enabled = true; edgeApp.enableInProgressCount = -1; } Loading @@ -1080,8 +1152,11 @@ class AppContainer extends Component { // Enable controls immediately after operation is complete if (edgeApp.disableInProgressCount < (EDGE_APP_DISABLE_COUNT_MAX - BLACKOUT_TIME)) { let appInstance = this.getAppInstance(edgeApp.id, appInstances); if (appInstance === null) { let svcInstance = this.getSvcInstance(edgeApp.id, services); if (!appInstance || !svcInstance) { edgeApp.enabled = false; edgeApp.appId = ''; edgeApp.svcId = ''; edgeApp.disableInProgressCount = -1; } } Loading Loading @@ -1114,7 +1189,7 @@ class AppContainer extends Component { } // Edge App counters this.decrementEdgeApps(this.props.appInstanceTable); this.decrementEdgeApps(this.props.appInstanceTable, this.props.svcTable); } renderPage() { Loading @@ -1135,7 +1210,7 @@ class AppContainer extends Component { eventsApi={this.meepEventsApi} metricsApi={this.meepMetricsEngineApi} automationApi={this.meepGisAutomationApi} applicationsApi={this.meepAppInfoApi} applicationsApi={this.meepApplicationsApi} /> ); Loading Loading @@ -1284,6 +1359,7 @@ const mapStateToProps = state => { edgeApps: state.ui.edgeApps, appInstanceTable: state.sbox.appInstanceTable.data, appInstancesSelected: state.ui.appInstancesSelected, svcTable: state.sbox.svcTable.data, updateUeInProgressCount: state.ui.updateUeInProgressCount, updateAppInstancesInProgressCount: state.ui.updateAppInstancesInProgressCount, activationInProgressCount: state.ui.activationInProgressCount, Loading Loading @@ -1327,6 +1403,7 @@ const mapDispatchToProps = dispatch => { changeMapComputeList: list => dispatch(sboxChangeMapComputeList(list)), changeApiTable: value => dispatch(sboxChangeApiTable(value)), changeAppInstanceTable: value => dispatch(sboxChangeAppInstanceTable(value)), changeSvcTable: value => dispatch(sboxChangeSvcTable(value)), changeUpdateUeInProgressCount: count => dispatch(uiSandboxChangeUpdateUeInProgressCount(count)), changeUpdateAutomationInProgressCount: count => dispatch(uiSandboxChangeUpdateAutomationInProgressCount(count)), changeUpdateAppInstancesInProgressCount: count => dispatch(uiSandboxChangeUpdateAppInstancesInProgressCount(count)), Loading
js-apps/frontend/src/js/containers/sandbox/app-instance-info.js +32 −11 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class AppInstanceInfo extends Component { if (checked) { // Send event to enable service var sandboxEvent = { var enableEvent = { name: 'name', type: 'SCENARIO-UPDATE', eventScenarioUpdate: { Loading @@ -49,15 +49,33 @@ class AppInstanceInfo extends Component { } } }; this.props.eventsApi.sendEvent('SCENARIO-UPDATE', sandboxEvent); this.props.eventsApi.sendEvent('SCENARIO-UPDATE', enableEvent); // Enable edge app & start timer to temporarily ignore backend edgeApp.enabled = true; edgeApp.enableInProgressCount = EDGE_APP_ENABLE_COUNT_MAX; } else { // Delete app instance this.props.applicationsApi.applicationsAppInstanceIdDELETE(edgeApp.id, null); // Send event to disable service var disableEvent = { name: 'name', type: 'SCENARIO-UPDATE', eventScenarioUpdate: { action: 'REMOVE', gracePeriod: 10, node: { type: 'EDGE-APP', parent: edgeApp.mepName, nodeDataUnion: { process: { id: edgeApp.id, name: edgeApp.name } } } } }; this.props.eventsApi.sendEvent('SCENARIO-UPDATE', disableEvent); // Disable edge app & start timer to temporarily ignore backend edgeApp.enabled = false; Loading Loading @@ -94,7 +112,7 @@ class AppInstanceInfo extends Component { return ( <> <div style={{ marginTop: 15 }}> <Typography theme="primary" use="body1">MEC service startup in progress...<br/>This operation may take a few seconds.</Typography> <Typography theme="primary" use="body1">MEC Service startup in progress...<br/>This operation takes a few seconds.</Typography> </div> </> ); Loading @@ -104,7 +122,7 @@ class AppInstanceInfo extends Component { return ( <> <div style={{ marginTop: 15 }}> <Typography theme="primary" use="body1">MEC service shutdown in progress...<br/>This operation may take a few seconds.</Typography> <Typography theme="primary" use="body1">MEC Service shutdown in progress...<br/>This operation takes a few seconds.</Typography> </div> </> ); Loading @@ -114,7 +132,7 @@ class AppInstanceInfo extends Component { return ( <> <div style={{ marginTop: 15 }}> <Typography theme="primary" use="body1">This MEC service is currently disabled.</Typography> <Typography theme="primary" use="body1">This MEC Service is currently disabled.</Typography> </div> </> ); Loading @@ -131,19 +149,22 @@ class AppInstanceInfo extends Component { let isMec011 = edgeApp.pseudoName.includes('011'); let disabled = (isMec011 || edgeApp.enableInProgressCount !== -1 || edgeApp.disableInProgressCount !== -1) ? true : false; let mepInfoStr = (isMec011) ? edgeApp.mepName + ' platform API' : edgeApp.instance + ' running on ' + edgeApp.mepName; let appInfoStr = 'appInstanceId: ' + edgeApp.id; let appInfoStr = 'appInstanceId: ' + ((edgeApp.appId) ? edgeApp.appId : 'unavailable'); let svcInfoStr = 'serviceId: ' + ((edgeApp.svcId) ? edgeApp.svcId : 'unavailable'); return ( <> <Grid style={{ marginTop: 0}}> <GridCell title="Enable or disable the selected MEC API" span={12}> <p style={{ marginTop: 5, marginBottom: 10 }}> <Typography theme="primary" use="headline6">Application details</Typography> <Typography theme="primary" use="headline6">MEC Service details</Typography> </p> <Typography className="text-color-main" use="body1"> {mepInfoStr} {!isMec011 && appInfoStr && <br/>} {!isMec011 && <br/>} {!isMec011 && appInfoStr} {!isMec011 && <br/>} {!isMec011 && svcInfoStr} </Typography> </GridCell> </Grid> Loading
js-apps/frontend/src/js/containers/sandbox/app-instance-table.js +1 −1 Original line number Diff line number Diff line Loading @@ -120,7 +120,7 @@ class AppInstanceTable extends Component { /> </TableCell> <TableCell className={classes.tableBodyCellNoWrap} scope="row"> {row.name} running on {row.mepName}<br/> {row.name} running on {row.nodeName}<br/> ID: {row.id} </TableCell> </TableRow> Loading