Created toggle for hotspot in admin settings. User needs sudo privileges.

This commit is contained in:
Roland 2022-02-04 09:41:08 -07:00
parent bc22fb6a6c
commit f27e9fdf63
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
8 changed files with 398 additions and 6 deletions

View file

@ -24,6 +24,22 @@ import {
import TimezoneSelect from 'react-timezone-select';
import {PageContainer, secondsToDate, secondsToFrequency, TabLinks, textEllipsis, WROLModeMessage} from "./Common";
import {Route} from "react-router-dom";
import {useHotspot} from "../hooks/customHooks";
function HotspotToggle() {
let {on, setHotspot} = useHotspot();
return (
<>
<Checkbox toggle
label='Toggle the WiFi Hotspot. Only supported on Raspberry Pi.'
disabled={on === null}
defaultIndeterminate={on === null}
checked={on === true}
onChange={(e, data) => setHotspot(data.checked)}
/>
</>
);
}
class Settings extends React.Component {
@ -78,6 +94,12 @@ class Settings extends React.Component {
return (
<Container fluid>
<WROLModeMessage content='Settings are disabled because WROL Mode is enabled.'/>
<p>
<HotspotToggle/>
</p>
<Divider/>
<p>
The global settings for your server.
</p>