async componentDidMount() {
        const values = queryString.parse(this.props.location.search)
        console.log(values.code);
        console.log(values.state);
        var Code = values.code;
        if (typeof(values.code) !== 'undefined' && values.code != null && values.state !== 'undefined' && values.state != null && values.state =='JkVRNYhB3OpfD6btsqCwhWfLA8mJZ2ur') {
     } else {
            window.location= '/LoginScreen';
   }
       try {
            setInterval(async () => {
                fetch('http://52.172.36.138/api/authorize/access_token',{
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded',
                    },
                    body :  qs.stringify({
                        'client_id' : 'cbBVF0wO6fnwg65L1qRD3QxwBxxqk4WETD4Po9YP',
                        'client_secret' : 'Dtj0al4xTYMSuO7htOtdX3ToNsBk5nUZZNPzYSJZCGW93iIw4yKM9Iei3PPds689uXlNNhvtSQdmDmrELXmUEd7DBCw9IuLWrLKDP7XogxThbiidxVahXnNdSqEpRLyHaVVHUnO8hQywKUAwPvZA3rpMr7g9eLMLjo5OZ10sOmK6Ytn8COGeSuMkW4zZG3ocyp7RHCVdIoQf5UkatChe7AwujvlfG9m101NCF1ShNoLPTW6DD9lP0t3qKCbYlO',
                        'grant_type' : 'client_credentials',
                    })
                }).then((response) => response.json()).then((jsonData) => {
                    console.log(jsonData);
                    access_token =  jsonData.access_token
                    console.log(this.props.match.params.session);
                    var x = this.props.match.params;
                    console.log(x);
                    console.log(access_token)
                    fetch('http://52.172.36.138/api/display',{
                        method: 'GET',
                        headers: {
                            Accept: 'application/json',
                            'Content-Type': 'application/json',
                            'Authorization':'Bearer '+access_token,
                        },
                    }).then((response) => response.json()).then((jsonResponse) => {
                        console.log(jsonResponse);
                            this.setState({
                                cluster:jsonResponse
                            })
                    })
                        .catch((error) => {
                            console.error(error);
                        });
                })
                .catch((error) => {
                    console.error(error);
                });
            },5000);
        }
        catch(e) {
            console.log(e);
          }
    }
/***************************** Start Code Start List of function for getting access token and fetching list of display ****************************/
Start Code Start List of function for getting access token and fetching list of display
Start Code Start List of function for getting access token and fetching list of display
async componentDidMount() {
        const values = queryString.parse(this.props.location.search)
        console.log(values.code);
        console.log(values.state);
        var Code = values.code;
        if (typeof(values.code) !== 'undefined' && values.code != null && values.state !== 'undefined' && values.state != null && values.state =='JkVRNYhB3OpfD6btsqCwhWfLA8mJZ2ur') {
     } else {
            window.location= '/LoginScreen';
   }
       try {
            setInterval(async () => {
                fetch('http://52.172.36.138/api/authorize/access_token',{
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded',
                    },
                    body :  qs.stringify({
                        'client_id' : 'cbBVF0wO6fnwg65L1qRD3QxwBxxqk4WETD4Po9YP',
                        'client_secret' : 'Dtj0al4xTYMSuO7htOtdX3ToNsBk5nUZZNPzYSJZCGW93iIw4yKM9Iei3PPds689uXlNNhvtSQdmDmrELXmUEd7DBCw9IuLWrLKDP7XogxThbiidxVahXnNdSqEpRLyHaVVHUnO8hQywKUAwPvZA3rpMr7g9eLMLjo5OZ10sOmK6Ytn8COGeSuMkW4zZG3ocyp7RHCVdIoQf5UkatChe7AwujvlfG9m101NCF1ShNoLPTW6DD9lP0t3qKCbYlO',
                        'grant_type' : 'client_credentials',
                    })
                }).then((response) => response.json()).then((jsonData) => {
                    console.log(jsonData);
                    access_token =  jsonData.access_token
                    console.log(this.props.match.params.session);
                    var x = this.props.match.params;
                    console.log(x);
                    console.log(access_token)
                    fetch('http://52.172.36.138/api/display',{
                        method: 'GET',
                        headers: {
                            Accept: 'application/json',
                            'Content-Type': 'application/json',
                            'Authorization':'Bearer '+access_token,
                        },
                    }).then((response) => response.json()).then((jsonResponse) => {
                        console.log(jsonResponse);
                            this.setState({
                                cluster:jsonResponse
                            })
                    })
                        .catch((error) => {
                            console.error(error);
                        });
                })
                .catch((error) => {
                    console.error(error);
                });
            },5000);
        }
        catch(e) {
            console.log(e);
          }
    }
async componentDidMount ( ) { const values = queryString . parse ( this . props . location . search ) console . log ( values . code ) ; console . log ( values . state ) ; var Code = values . code ; if ( typeof ( values . code ) !== 'undefined' && values . code != null && values . state !== 'undefined' && values . state != null && values . state == 'JkVRNYhB3OpfD6btsqCwhWfLA8mJZ2ur' ) { } else { window . location = '/LoginScreen' ; } try { setInterval ( async ( ) => { fetch ( 'http://52.172.36.138/api/authorize/access_token' , { method : 'POST' , headers : { 'Content-Type' : 'application/x-www-form-urlencoded' , } , body : qs . stringify ( { 'client_id' : 'cbBVF0wO6fnwg65L1qRD3QxwBxxqk4WETD4Po9YP' , 'client_secret' : 'Dtj0al4xTYMSuO7htOtdX3ToNsBk5nUZZNPzYSJZCGW93iIw4yKM9Iei3PPds689uXlNNhvtSQdmDmrELXmUEd7DBCw9IuLWrLKDP7XogxThbiidxVahXnNdSqEpRLyHaVVHUnO8hQywKUAwPvZA3rpMr7g9eLMLjo5OZ10sOmK6Ytn8COGeSuMkW4zZG3ocyp7RHCVdIoQf5UkatChe7AwujvlfG9m101NCF1ShNoLPTW6DD9lP0t3qKCbYlO' , 'grant_type' : 'client_credentials' , } ) } ) . then ( ( response ) => response . json ( ) ) . then ( ( jsonData ) => { console . log ( jsonData ) ; access_token = jsonData . access_token console . log ( this . props . match . params . session ) ; var x = this . props . match . params ; console . log ( x ) ; console . log ( access_token ) fetch ( 'http://52.172.36.138/api/display' , { method : 'GET' , headers : { Accept : 'application/json' , 'Content-Type' : 'application/json' , 'Authorization' : 'Bearer ' + access_token , } , } ) . then ( ( response ) => response . json ( ) ) . then ( ( jsonResponse ) => { console . log ( jsonResponse ) ; this . setState ( { cluster : jsonResponse } ) } ) . catch ( ( error ) => { console . error ( error ) ; } ) ; } ) . catch ( ( error ) => { console . error ( error ) ; } ) ; } , 5000 ) ; } catch ( e ) { console . log ( e ) ; } }
Start Code Start List of function for getting access token and fetching list of display
Start Code Start List of function for getting access token and fetching list of display