Commit 98e7c569 authored by Nikhil Doifode's avatar Nikhil Doifode
Browse files

Fixes from code review

parent a84b58fd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -94,7 +94,8 @@ const styles = {
  },
  content: {
    paddingLeft: 25,
    paddingRight: 30
    paddingRight: 30,
    overflow: 'hidden'
  },
  actions: {
    marginTop: 20
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ class MeepTopBar extends Component {
        <Toolbar>
          <Elevation z={4}>
            <ToolbarRow>
              <ToolbarSection alignStart>
              <ToolbarSection alignStart style={{display:'contents'}}>
                <img
                  id='idcc-logo'
                  className='idcc-toolbar-menu mdc-top-app-bar__navigation-icon'
+18 −17
Original line number Diff line number Diff line
@@ -45,11 +45,11 @@ class LoginPageContainer extends Component {
  updateLoginBox() {
    let elevation = document.getElementById('elevationTag');
    if (this.props.signInStatus !== STATUS_SIGNED_OUT) {
      elevation.style.width = '53%';
      elevation.style.marginLeft = '25%';
      elevation.style.width = '50%';
      elevation.style.marginLeft = '23%';
    } else {
      elevation.style.width = '80%';
      elevation.style.marginLeft = '10%';
      elevation.style.width = '75%';
      elevation.style.marginLeft = '11%';
    }
  }

@@ -68,7 +68,7 @@ class LoginPageContainer extends Component {
          />
          <Elevation z={3} style={styles.elevation} id='elevationTag'>
            <Grid style={ signedOut ? styles.gridLine : null}>
              <GridCell span={signedOut ? 8 : 12}>
              <GridCell span={signedOut ? 8 : 12} style={{paddingRight:'10px'}}>
                <span style={styles.text}>
                  <p> AdvantEDGE is a Mobile Edge Emulation Platform (MEEP) that runs on Docker & Kubernetes.</p>
                  <p>
@@ -126,27 +126,27 @@ class LoginPageContainer extends Component {
                <GridCell span="10">
                  <GridInner>
                    <GridCell span="2">
                      <a href="https://github.com/InterDigitalInc/AdvantEDGE/wiki" style={styles.headerText}>
                      <a href="https://github.com/InterDigitalInc/AdvantEDGE/wiki" target="_blank" style={styles.headerText}>
                        Wiki
                      </a>
                    </GridCell>
                    <GridCell span="2">
                      <a href="https://github.com/InterDigitalInc/AdvantEDGE" style={styles.headerText}>
                      <a href="https://github.com/InterDigitalInc/AdvantEDGE" target="_blank" style={styles.headerText}>
                        Github
                      </a>
                    </GridCell>
                    <GridCell span="2">
                      <a href="https://github.com/InterDigitalInc/AdvantEDGE/discussions" style={styles.headerText}>
                      <a href="https://github.com/InterDigitalInc/AdvantEDGE/discussions" target="_blank" style={styles.headerText}>
                        Discussions
                      </a>
                    </GridCell>
                    <GridCell span="2">
                      <a href="https://github.com/InterDigitalInc/AdvantEDGE/blob/master/LICENSE" style={styles.headerText}>
                      <a href="https://github.com/InterDigitalInc/AdvantEDGE/blob/master/LICENSE" target="_blank" style={styles.headerText}>
                        License
                      </a>
                    </GridCell>
                    <GridCell span="2">
                      <a href="https://github.com/InterDigitalInc/AdvantEDGE/blob/master/CONTRIBUTING.md" style={styles.headerText}>
                      <a href="https://github.com/InterDigitalInc/AdvantEDGE/blob/master/CONTRIBUTING.md" target="_blank" style={styles.headerText}>
                        Contributing
                      </a>
                    </GridCell>
@@ -178,15 +178,16 @@ const styles = {
  },
  elevation: {
    padding: '30px',
    width: '80%',
    marginLeft: '10%',
    marginTop: '3%',
    width: '75%',
    marginLeft: '11%',
    marginTop: '2%',
    background: 'white'
  },
  logo: {
    height: 120,
    width: 500,
    marginLeft: '40%'
    width: '25%',
    marginLeft: '37.5%',
    marginTop: '1%',
  },
  headerText: {
    fontFamily: 'sans-serif',
@@ -195,9 +196,9 @@ const styles = {
    fontSize: '1.3rem'
  },
  footer: {
    marginTop: '9%',
    marginTop: '8%',
    marginLeft: '15%',
    width: '75%'
    width: '70%'
  },
  gridLine: {
    background: 'linear-gradient(#9d9d9d,#9d9d9d) center/2px 100% no-repeat',
+28 −0
Original line number Diff line number Diff line
@@ -114,11 +114,14 @@ meepGisEngineRestApiClient.ApiClient.instance.basePath = basepathGisEngine.repla
var basepathAuthSvc = HOST_PATH + '/auth/v1';
meepAuthSvcRestApiClient.ApiClient.instance.basePath = basepathAuthSvc.replace(/\/+$/,'');

const SESSION_KEEPALIVE_INTERVAL = 600000; // 10 min

class MeepContainer extends Component {
  constructor(props) {
    super(props);
    autoBind(this);

    this.sessionKeepaliveTimer = null;
    this.platformRefreshIntervalTimer = null;
    this.execPageRefreshIntervalTimer = null;
    this.replayStatusRefreshIntervalTimer = null;
@@ -151,6 +154,7 @@ class MeepContainer extends Component {
          this.props.changeSignInStatus(STATUS_SIGNED_IN);
        } else {
          this.props.changeSignInStatus(STATUS_SIGNED_OUT);
          this.logout();
        }
      });
    }
@@ -166,6 +170,7 @@ class MeepContainer extends Component {
        this.props.changeSignInStatus(STATUS_SIGNED_IN);
        this.props.changeCurrentPage(PAGE_CONFIGURE);
        this.props.changeTabIndex(PAGE_CONFIGURE_INDEX);
        this.startSessionKeepaliveTimer();
      } else {
        // Sign in failed
        this.logout();
@@ -184,6 +189,7 @@ class MeepContainer extends Component {
    this.stopReplayStatusRefresh();
    this.stopExecPageRefresh();
    this.stopPlatformRefresh();
    this.stopSessionKeepaliveTimer()
  }

  // Platform refresh
@@ -695,6 +701,27 @@ class MeepContainer extends Component {
    }
  }

  // Session Keep-alive
  startSessionKeepaliveTimer() {
    if (!this.sessionKeepaliveTimer) {
      this.meepAuthApi.triggerWatchdog();

      // Start keepalive timer
      this.sessionKeepaliveTimer = setInterval(() => {
          this.meepAuthApi.triggerWatchdog();
        },
        SESSION_KEEPALIVE_INTERVAL
      );
    }
  }

  stopSessionKeepaliveTimer() {
    if (this.sessionKeepaliveTimer) {
      clearInterval(this.sessionKeepaliveTimer);
      this.sessionKeepaliveTimer = null;
    }
  }

  /**
   * Callback function to receive the result of the logout operation.
   * @callback module:api/AuthenticationApi~logout
@@ -711,6 +738,7 @@ class MeepContainer extends Component {
  }

  logout() {
    this.stopSessionKeepaliveTimer();
    this.meepAuthApi.logout((error, data, response) => {
      this.logoutCb(error, data, response);
    });