mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-03 05:09:58 -05:00
CPU can be throttled in UI.
This commit is contained in:
parent
703f916c53
commit
1222a39867
8 changed files with 199 additions and 5 deletions
|
|
@ -21,6 +21,7 @@ import {
|
|||
secondsToFrequency,
|
||||
TabLinks,
|
||||
textEllipsis,
|
||||
ThrottleToggle,
|
||||
WROLModeMessage
|
||||
} from "./Common";
|
||||
import {Route} from "react-router-dom";
|
||||
|
|
@ -80,6 +81,8 @@ class Settings extends React.Component {
|
|||
<WROLModeMessage content='Settings are disabled because WROL Mode is enabled.'/>
|
||||
|
||||
<HotspotToggle/>
|
||||
<br/>
|
||||
<ThrottleToggle style={{marginTop: '0.5em'}}/>
|
||||
|
||||
<Divider/>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import Button from "semantic-ui-react/dist/commonjs/elements/Button";
|
|||
import Grid from "semantic-ui-react/dist/commonjs/collections/Grid";
|
||||
import Message from "semantic-ui-react/dist/commonjs/collections/Message";
|
||||
import {getConfig} from "../api";
|
||||
import {useDownloaders, useHotspot} from "../hooks/customHooks";
|
||||
import {useDownloaders, useHotspot, useThrottle} from "../hooks/customHooks";
|
||||
|
||||
export const API_URI = `http://${window.location.host}/api`;
|
||||
export const VIDEOS_API = `${API_URI}/videos`;
|
||||
|
|
@ -645,9 +645,9 @@ export function CardGroupCentered(props) {
|
|||
)
|
||||
}
|
||||
|
||||
export function HotspotToggle() {
|
||||
export function HotspotToggle(props) {
|
||||
let {on, setHotspot} = useHotspot();
|
||||
return <Checkbox toggle
|
||||
return <Checkbox toggle {...props}
|
||||
label='WiFi Hotspot'
|
||||
disabled={on === null}
|
||||
checked={on === true}
|
||||
|
|
@ -655,6 +655,16 @@ export function HotspotToggle() {
|
|||
/>;
|
||||
}
|
||||
|
||||
export function ThrottleToggle(props) {
|
||||
let {on, setThrottle} = useThrottle();
|
||||
return <Checkbox toggle {...props}
|
||||
label='CPU Power-save'
|
||||
disabled={on === null}
|
||||
checked={on === true}
|
||||
onChange={(e, data) => setThrottle(data.checked)}
|
||||
/>;
|
||||
}
|
||||
|
||||
export function DisableDownloadsToggle() {
|
||||
let {on, setDownloads} = useDownloaders();
|
||||
return <Checkbox toggle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue