import { Component } from 'react'; import { Typography, Box, List, ListItem, ListItemText, Link, ListItemAvatar } from '@material-ui/core'; import { SectionContent } from '../components'; import CommentIcon from '@material-ui/icons/CommentTwoTone'; import MenuBookIcon from '@material-ui/icons/MenuBookTwoTone'; import GitHubIcon from '@material-ui/icons/GitHub'; import StarIcon from '@material-ui/icons/Star'; import DownloadIcon from '@material-ui/icons/GetApp'; import { FormButton } from '../components'; import { API_ENDPOINT_ROOT } from '../api'; import { redirectingAuthorizedFetch } from '../authentication'; class EMSESPHelp extends Component { onDownload = (endpoint: string) => { redirectingAuthorizedFetch(API_ENDPOINT_ROOT + 'system/' + endpoint) .then((response) => { if (response.status === 200) { return response.json(); } throw Error( 'Device returned unexpected response code: ' + response.status ); }) .then((json) => { const a = document.createElement('a'); const filename = 'emsesp_system_' + endpoint + '.txt'; a.href = URL.createObjectURL( new Blob([JSON.stringify(json, null, 2)], { type: 'text/plain' }) ); a.setAttribute('download', filename); document.body.appendChild(a); a.click(); document.body.removeChild(a); }); }; render() { return ( For help and information on the latest updates visit the{' '} {'online documentation'} For live community chat join our{' '} {'Discord'} server To report an issue or request a feature go to{' '} {'GitHub'} } variant="contained" color="primary" onClick={() => this.onDownload('info')} > download system info } variant="contained" color="primary" onClick={() => this.onDownload('settings')} > download all settings EMS-ESP is free and open-source.

Please consider supporting this project by giving it a{' '} on our{' '} {'GitHub page'} .


); } } export default EMSESPHelp;