mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Created toggle for hotspot in admin settings. User needs sudo privileges.
This commit is contained in:
parent
bc22fb6a6c
commit
f27e9fdf63
8 changed files with 398 additions and 6 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue