'use strict'; import 'whatwg-fetch'; import React from 'react'; export default class InfoStep extends React.Component { constructor (props) { super(props); this.state = { loading: true, info: {} }; } componentDidMount () { let interval; let done = false; let deviceinfo = () => { window.fetch(`${this.props.baseApi}/device-info`).then((res) => { if (res.ok && !done) { done = true; window.clearInterval(interval); return res.json(); } }).then((json) => { this.setState({ loading: false, info: json }); }); }; interval = window.setInterval(deviceinfo, 5 * 1000); deviceinfo(); } handleNextButton (e) { e.preventDefault(); this.props.nextStep(); } render () { return (
Here are some information about the device you are about to configure:
ID | Type |
---|---|
{ node.id } | { node.type } |