mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-05 06:09:57 -05:00
Combining install scripts into a new repair script. Removing create_db script in favor of repair script.
This commit is contained in:
parent
b817534c37
commit
6e0f9a999c
57 changed files with 785 additions and 724 deletions
|
|
@ -902,23 +902,50 @@ export function UnsupportedModal(header, message, icon) {
|
|||
export function HotspotStatusIcon() {
|
||||
const {on, setHotspot, dockerized} = useHotspot();
|
||||
const {modal, doOpen} = UnsupportedModal('Unsupported on Docker', 'You cannot toggle the hotspot on Docker.');
|
||||
const [confirmOpen, setConfirmOpen] = React.useState(false);
|
||||
|
||||
const toggleHotspot = (e) => {
|
||||
e.preventDefault();
|
||||
if (dockerized) {
|
||||
doOpen();
|
||||
}
|
||||
if (on != null) {
|
||||
setHotspot(!on);
|
||||
const handleConfirm = (e) => {
|
||||
if (e) {
|
||||
e.preventDefault()
|
||||
}
|
||||
setConfirmOpen(false);
|
||||
setHotspot(false);
|
||||
}
|
||||
|
||||
return <>
|
||||
<a href='#' onClick={toggleHotspot}>
|
||||
if (dockerized === false && on === true) {
|
||||
return <>
|
||||
<Confirm
|
||||
open={confirmOpen}
|
||||
onCancel={() => setConfirmOpen(false)}
|
||||
onClose={() => setConfirmOpen(false)}
|
||||
onConfirm={handleConfirm}
|
||||
header='Disable the hotspot'
|
||||
content='You will be disconnected when using the hotspot. Are you sure?'
|
||||
confirmButton='Disable'
|
||||
/>
|
||||
<a href='#' onClick={() => setConfirmOpen(true)}>
|
||||
<IconGroup size='large'>
|
||||
<Icon name='wifi' disabled={on !== true}/>
|
||||
{on === false && <Icon corner name='x'/>}
|
||||
{on === null && <Icon corner name='question'/>}
|
||||
</IconGroup>
|
||||
</a>
|
||||
</>
|
||||
} else if (dockerized === false && on === false) {
|
||||
return <a href='#' onClick={() => setHotspot(true)}>
|
||||
<IconGroup size='large'>
|
||||
<Icon name='wifi' disabled={on !== true}/>
|
||||
{on === false && <Icon corner name='x'/>}
|
||||
{on === null && <Icon corner name='question'/>}
|
||||
<Icon name='wifi' disabled/>
|
||||
<Icon corner name='x'/>
|
||||
</IconGroup>
|
||||
</a>
|
||||
}
|
||||
|
||||
// Hotspot is not available, or, status has not yet been fetched.
|
||||
return <>
|
||||
<a href='#' onClick={doOpen}>
|
||||
<IconGroup size='large'>
|
||||
<Icon name='wifi' disabled/>
|
||||
<Icon corner name='question'/>
|
||||
</IconGroup>
|
||||
</a>
|
||||
{modal}
|
||||
|
|
@ -929,7 +956,7 @@ export function CPUTemperatureIcon({size = 'large'}) {
|
|||
// Returns an Icon only if temperature is too high.
|
||||
const {temperature, high_temperature, critical_temperature} = useCPUTemperature();
|
||||
|
||||
if (temperature < high_temperature) {
|
||||
if (temperature === null || temperature < high_temperature) {
|
||||
// Temperature is not a problem.
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class Downloader extends React.Component {
|
|||
submitDownload = async () => {
|
||||
let {urls, downloader, destination, tagNames} = this.state;
|
||||
if (urls) {
|
||||
urls = urls.split(/\r?\n/);
|
||||
this.setState({pending: true, submitted: false});
|
||||
try {
|
||||
let response = await postDownload(urls, downloader, null, null, null, destination, tagNames);
|
||||
|
|
@ -195,7 +196,7 @@ class ChannelDownload extends React.Component {
|
|||
this.setState({error: 'URL is required'});
|
||||
return;
|
||||
}
|
||||
let response = await postDownload(url, 'video_channel', frequency,
|
||||
let response = await postDownload([url], 'video_channel', frequency,
|
||||
null, null, destination);
|
||||
if (response.status === 204) {
|
||||
this.setState({pending: false, disabled: false, success: true, url: '', ready: false});
|
||||
|
|
@ -456,6 +457,7 @@ class ScrapeDownloader extends Downloader {
|
|||
depth = parseInt(depth);
|
||||
max_pages = parseInt(max_pages);
|
||||
if (urls) {
|
||||
urls = urls.split(/\r?\n/);
|
||||
this.setState({pending: true, submitted: false});
|
||||
try {
|
||||
let response = await postDownload(
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ export function CPUUsageProgress({percent, label}) {
|
|||
|
||||
export function MemoryUsageProgress({percent, label}) {
|
||||
if (percent === null) {
|
||||
return <Progress progress={0} color='grey' label='Memory Usage' disabled/>
|
||||
return <Progress progress={0} color='grey' label='RAM Usage' disabled/>
|
||||
}
|
||||
|
||||
let color = 'black';
|
||||
|
|
@ -176,6 +176,7 @@ export function StatusPage() {
|
|||
let drives = [];
|
||||
let disk_bandwidth = [];
|
||||
let memoryPercent;
|
||||
let memorySize;
|
||||
|
||||
if (status && status['cpu_info']) {
|
||||
const {cpu_info, load, memory_stats} = status;
|
||||
|
|
@ -194,6 +195,7 @@ export function StatusPage() {
|
|||
disk_bandwidth = status['disk_bandwidth'];
|
||||
|
||||
memoryPercent = Math.round(memory_stats['used'] / memory_stats['total'] * 100);
|
||||
memorySize = humanFileSize(memory_stats['total'], 0);
|
||||
}
|
||||
|
||||
const SizedHeader = ({children}) => {
|
||||
|
|
@ -203,11 +205,14 @@ export function StatusPage() {
|
|||
</div>
|
||||
}
|
||||
|
||||
const cpuProgress = <CPUUsageProgress percent={percent} label={`CPU Usage (${cores} cores)`}/>;
|
||||
const memoryUsageProgress = <MemoryUsageProgress percent={memoryPercent} label={`RAM Usage (${memorySize})`}/>;
|
||||
|
||||
return <>
|
||||
<Media at='mobile'>
|
||||
<Segment>
|
||||
<CPUUsageProgress percent={percent} label='CPU Usage'/>
|
||||
<MemoryUsageProgress percent={memoryPercent} label='RAM Usage'/>
|
||||
{cpuProgress}
|
||||
{memoryUsageProgress}
|
||||
<StatisticGroup>
|
||||
<CPUTemperatureStatistic
|
||||
temperature={temperature}
|
||||
|
|
@ -222,8 +227,8 @@ export function StatusPage() {
|
|||
</Media>
|
||||
<Media greaterThanOrEqual='tablet'>
|
||||
<Segment>
|
||||
<CPUUsageProgress percent={percent} label='CPU Usage'/>
|
||||
<MemoryUsageProgress percent={memoryPercent} label='RAM Usage'/>
|
||||
{cpuProgress}
|
||||
{memoryUsageProgress}
|
||||
<StatisticGroup size='mini'>
|
||||
<CPUTemperatureStatistic
|
||||
temperature={temperature}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue