Commit cb146964 authored by Kevin Di Lallo's avatar Kevin Di Lallo Committed by GitHub Enterprise
Browse files

Merge pull request #28 from wbu-tep/kd_sp37_fix_ams

Integration fixes
parents dfaa0be7 18c8adb2
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -970,6 +970,7 @@ class AppContainer extends Component {
    const isArrayEqual = (x, y) => _.isEmpty(_.xorWith(x, y, _.isEqual));
    if (!isArrayEqual(this.props.appInstanceTable,appInstances)) {
      this.props.changeAppInstanceTable(appInstances);

      // Update Edge App states
      this.refreshEdgeApps(appInstances);
    }
@@ -981,11 +982,11 @@ class AppContainer extends Component {
    });
  }

  getAppInstance(name, appInstances) {
  getAppInstance(id, appInstances) {
    if (appInstances) {
      for (var i = 0; i < appInstances.length; i++) {
        let appInstance = appInstances[i];
        if (appInstance.name === name) {
        if (appInstance.id === id) {
          return appInstance;
        }
      }
@@ -1014,7 +1015,7 @@ class AppContainer extends Component {
      }

      // Find matching app instance, if any
      let appInstance = this.getAppInstance(edgeApp.name, appInstances);
      let appInstance = this.getAppInstance(edgeApp.id, appInstances);

      // Update service state
      if (appInstance === null) {
@@ -1024,6 +1025,7 @@ class AppContainer extends Component {
        }
      } else {
        if (!edgeApp.enabled) {
          edgeApp.instance = appInstance.name;
          edgeApp.enabled = true;
          updateRequired = true;
        }
@@ -1064,8 +1066,9 @@ class AppContainer extends Component {
        edgeApp.enableInProgressCount--;
        // Enable controls immediately after operation is complete
        if (edgeApp.enableInProgressCount < (EDGE_APP_ENABLE_COUNT_MAX - BLACKOUT_TIME)) {
          let appInstance = this.getAppInstance(edgeApp.name, appInstances);
          let appInstance = this.getAppInstance(edgeApp.id, appInstances);
          if (appInstance !== null) {
            edgeApp.instance = appInstance.name;
            edgeApp.enabled = true;
            edgeApp.enableInProgressCount = -1;
          }
@@ -1075,7 +1078,7 @@ class AppContainer extends Component {
        edgeApp.disableInProgressCount--;
        // Enable controls immediately after operation is complete
        if (edgeApp.disableInProgressCount < (EDGE_APP_DISABLE_COUNT_MAX - BLACKOUT_TIME)) {
          let appInstance = this.getAppInstance(edgeApp.name, appInstances);
          let appInstance = this.getAppInstance(edgeApp.id, appInstances);
          if (appInstance === null) {
            edgeApp.enabled = false;
            edgeApp.disableInProgressCount = -1;
+0 −21
Original line number Diff line number Diff line
@@ -25,27 +25,6 @@ class ApiPane extends Component {
    super(props);
  }

  isEdgeAppRunning(edgeApp) {
    if (!edgeApp) {
      return false;
    }

    // mec011 is always running
    if (edgeApp.img.includes('meep-app-enablement')) {
      return true;
    }

    // Check if edge app instance is running
    if (this.props.appInstanceTable) {
      for (var i = 0; i < this.props.appInstanceTable.length; i++) {
        if (edgeApp.name === this.props.appInstanceTable[i].name) {
          return true;
        }
      }
    }
    return false;
  }

  getSelectedEdgeApp() {
    if (this.props.mecApiSelected && this.props.edgeApps) {
      for (var i = 0; i < this.props.edgeApps.length; i++) {
+3 −3
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ class AppInstanceInfo extends Component {
    // Loop through edge apps
    for (var i = 0; i < this.props.edgeApps.length; i++) {
      // Add new edge app if match found; otherwise add old edge app
      if (this.props.edgeApps[i].name === edgeApp.name) {
      if (this.props.edgeApps[i].id === edgeApp.id) {
        edgeApps.push(edgeApp);
      } else {
        edgeApps.push(updateObject(this.props.edgeApps[i], {}));
@@ -130,13 +130,13 @@ class AppInstanceInfo extends Component {
    let edgeApp = this.props.edgeApp;
    let isMec011 = edgeApp.pseudoName.includes('011');
    let disabled = (isMec011 || edgeApp.enableInProgressCount !== -1 || edgeApp.disableInProgressCount !== -1) ? true : false;
    let mepInfoStr = edgeApp.name + ' running on ' + edgeApp.mepName;
    let mepInfoStr = ((edgeApp.instance) ? edgeApp.instance + ' running on ' : 'Running on ') + edgeApp.mepName;
    let appInfoStr = isMec011 ? 'ID: not applicable' : 'ID: ' + edgeApp.id;

    return (
      <>
        <Grid style={{ marginTop: 0}}>
          <GridCell title="Use URL in your client to exercise selected MEC API" span={12}>
          <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>
            </p>
+3 −3
Original line number Diff line number Diff line
@@ -300,11 +300,11 @@ class ConfigPane extends Component {
    }
  }

  getEdgeApp(name, edgeApps) {
  getEdgeApp(id, edgeApps) {
    if (edgeApps) {
      for (var i = 0; i < edgeApps.length; i++) {
        let edgeApp = edgeApps[i];
        if (edgeApp.name === name) {
        if (edgeApp.id === id) {
          return edgeApp;
        }
      }
@@ -329,7 +329,7 @@ class ConfigPane extends Component {
      }

      // If Edge App already exists, use existing state
      let edgeAppInstance = this.getEdgeApp(edgeApp.name, this.props.edgeApps);
      let edgeAppInstance = this.getEdgeApp(edgeApp.id, this.props.edgeApps);
      if (edgeAppInstance !== null) {
        edgeApp.enabled = edgeAppInstance.enabled;
        edgeApp.enableInProgressCount = edgeAppInstance.enableInProgressCount;
+2 −3
Original line number Diff line number Diff line
@@ -506,9 +506,8 @@ class MapInfo extends Component {

  // UE Marker Event Handler
  updateComputePopup(marker) {
    if (marker) {
      // Retrieve state 
    var table = this.getTable();
    if (marker && table && table.entries) {
      const networkName = getElemFieldVal(table.entries[marker.options.meep.compute.id], FIELD_DATA_NETWORK_NAME);
      const edgeProvider = getElemFieldVal(table.entries[marker.options.meep.compute.id], FIELD_EDGE_COMPUTE_PROVIDER);
      const ladn = getElemFieldVal(table.entries[marker.options.meep.compute.id], FIELD_DN_LADN);
Loading