Removed cpu/memory
Removed cpu/memory display on JackServerSettingsDialog
This commit is contained in:
@@ -9,6 +9,8 @@ export default class AlsaDeviceInfo {
|
|||||||
this.sampleRates = input.sampleRates as number[];
|
this.sampleRates = input.sampleRates as number[];
|
||||||
this.minBufferSize = input.minBufferSize;
|
this.minBufferSize = input.minBufferSize;
|
||||||
this.maxBufferSize = input.maxBufferSize;
|
this.maxBufferSize = input.maxBufferSize;
|
||||||
|
this.supportsCapture = input.supportsCapture ? true : false;
|
||||||
|
this.supportsPlayback = input.supportsPlayback ? true : false;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
static deserialize_array(input: any): AlsaDeviceInfo[]
|
static deserialize_array(input: any): AlsaDeviceInfo[]
|
||||||
@@ -62,5 +64,7 @@ export default class AlsaDeviceInfo {
|
|||||||
longName: string = "";
|
longName: string = "";
|
||||||
sampleRates: number[] = [];
|
sampleRates: number[] = [];
|
||||||
minBufferSize: number = 0;
|
minBufferSize: number = 0;
|
||||||
maxBufferSize: number = 0;
|
maxBufferSize: number = 0;
|
||||||
|
supportsCapture: boolean = false;
|
||||||
|
supportsPlayback: boolean = false;
|
||||||
};
|
};
|
||||||
@@ -68,7 +68,6 @@ export default class JackHostStatus {
|
|||||||
this.errorMessage = input.errorMessage;
|
this.errorMessage = input.errorMessage;
|
||||||
this.underruns = input.underruns;
|
this.underruns = input.underruns;
|
||||||
this.cpuUsage = input.cpuUsage;
|
this.cpuUsage = input.cpuUsage;
|
||||||
this.memoryUsage = input.memoryUsage;
|
|
||||||
this.msSinceLastUnderrun = input.msSinceLastUnderrun;
|
this.msSinceLastUnderrun = input.msSinceLastUnderrun;
|
||||||
this.temperaturemC = input.temperaturemC;
|
this.temperaturemC = input.temperaturemC;
|
||||||
this.cpuFreqMax = input.cpuFreqMax;
|
this.cpuFreqMax = input.cpuFreqMax;
|
||||||
@@ -85,7 +84,6 @@ export default class JackHostStatus {
|
|||||||
restarting: boolean = false;
|
restarting: boolean = false;
|
||||||
underruns: number = 0;
|
underruns: number = 0;
|
||||||
cpuUsage: number = 0;
|
cpuUsage: number = 0;
|
||||||
memoryUsage: number = 0;
|
|
||||||
msSinceLastUnderrun: number = -5000 * 1000;
|
msSinceLastUnderrun: number = -5000 * 1000;
|
||||||
temperaturemC: number = -1000000;
|
temperaturemC: number = -1000000;
|
||||||
cpuFreqMax: number = 0;
|
cpuFreqMax: number = 0;
|
||||||
@@ -179,11 +177,6 @@ export default class JackHostStatus {
|
|||||||
CPU: {cpuDisplay(status.cpuUsage)}
|
CPU: {cpuDisplay(status.cpuUsage)}
|
||||||
</Typography>
|
</Typography>
|
||||||
</span>
|
</span>
|
||||||
<span style={{ color: underrunError ? RED_COLOR : GREEN_COLOR }}>
|
|
||||||
<Typography variant="caption" color="inherit">
|
|
||||||
MEM: {cpuDisplay(status.memoryUsage)}
|
|
||||||
</Typography>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span style={{ color: GREEN_COLOR }}>
|
<span style={{ color: GREEN_COLOR }}>
|
||||||
<Typography variant="caption" color="inherit">{tempDisplay(status.temperaturemC)}</Typography>
|
<Typography variant="caption" color="inherit">{tempDisplay(status.temperaturemC)}</Typography>
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ import IconButtonEx from './IconButtonEx';
|
|||||||
import RefreshIcon from '@mui/icons-material/Refresh';
|
import RefreshIcon from '@mui/icons-material/Refresh';
|
||||||
import Checkbox from '@mui/material/Checkbox';
|
import Checkbox from '@mui/material/Checkbox';
|
||||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||||
import JackHostStatus from './JackHostStatus';
|
|
||||||
|
|
||||||
import AlsaDeviceInfo from './AlsaDeviceInfo';
|
import AlsaDeviceInfo from './AlsaDeviceInfo';
|
||||||
import ResizeResponsiveComponent from './ResizeResponsiveComponent';
|
import ResizeResponsiveComponent from './ResizeResponsiveComponent';
|
||||||
@@ -88,7 +87,6 @@ interface JackServerSettingsDialogState {
|
|||||||
okEnabled: boolean;
|
okEnabled: boolean;
|
||||||
fullScreen: boolean;
|
fullScreen: boolean;
|
||||||
compactWidth: boolean;
|
compactWidth: boolean;
|
||||||
jackStatus?: JackHostStatus;
|
|
||||||
showDeviceWarning: boolean;
|
showDeviceWarning: boolean;
|
||||||
dontShowWarningAgain: boolean;
|
dontShowWarningAgain: boolean;
|
||||||
}
|
}
|
||||||
@@ -104,10 +102,6 @@ const styles = (theme: Theme) =>
|
|||||||
},
|
},
|
||||||
inputLabel: {
|
inputLabel: {
|
||||||
whiteSpace: "nowrap"
|
whiteSpace: "nowrap"
|
||||||
},
|
|
||||||
cpuStatusColor: {
|
|
||||||
color: theme.palette.text.secondary,
|
|
||||||
opacity: 0.7
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
export interface JackServerSettingsDialogProps extends WithStyles<typeof styles> {
|
export interface JackServerSettingsDialogProps extends WithStyles<typeof styles> {
|
||||||
@@ -314,13 +308,11 @@ const JackServerSettingsDialog = withStyles(
|
|||||||
okEnabled: false,
|
okEnabled: false,
|
||||||
fullScreen: this.getFullScreen(),
|
fullScreen: this.getFullScreen(),
|
||||||
compactWidth: document.documentElement.clientWidth < 600,
|
compactWidth: document.documentElement.clientWidth < 600,
|
||||||
jackStatus: undefined,
|
|
||||||
showDeviceWarning: false,
|
showDeviceWarning: false,
|
||||||
dontShowWarningAgain: false
|
dontShowWarningAgain: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
mounted: boolean = false;
|
mounted: boolean = false;
|
||||||
statusTimer?: number = undefined;
|
|
||||||
|
|
||||||
suppressDeviceWarning: boolean;
|
suppressDeviceWarning: boolean;
|
||||||
/**
|
/**
|
||||||
@@ -364,28 +356,9 @@ const JackServerSettingsDialog = withStyles(
|
|||||||
// Error requesting ALSA info.
|
// Error requesting ALSA info.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
tickStatus() {
|
|
||||||
this.model.getJackStatus()
|
|
||||||
.then(status => {
|
|
||||||
if (this.mounted) {
|
|
||||||
this.setState({ jackStatus: status });
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => { });
|
|
||||||
}
|
|
||||||
startStatusTimer() {
|
|
||||||
if (this.statusTimer) return;
|
|
||||||
this.tickStatus();
|
|
||||||
this.statusTimer = window.setInterval(() => this.tickStatus(), 1000);
|
|
||||||
}
|
|
||||||
stopStatusTimer() {
|
|
||||||
if (this.statusTimer) {
|
|
||||||
clearInterval(this.statusTimer);
|
|
||||||
this.statusTimer = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Persist the current settings to permanent storage. */
|
/** Persist the current settings to permanent storage. */
|
||||||
saveSettings(settings?: JackServerSettings): void {
|
saveSettings(settings?: JackServerSettings): void {
|
||||||
const s = (settings ?? this.state.jackServerSettings).clone();
|
const s = (settings ?? this.state.jackServerSettings).clone();
|
||||||
@@ -496,7 +469,6 @@ const JackServerSettingsDialog = withStyles(
|
|||||||
this.ignoreClose = false;
|
this.ignoreClose = false;
|
||||||
if (this.props.open) {
|
if (this.props.open) {
|
||||||
this.requestAlsaInfo();
|
this.requestAlsaInfo();
|
||||||
this.startStatusTimer();
|
|
||||||
this.saveSettingsTemporary(this.props.jackServerSettings);
|
this.saveSettingsTemporary(this.props.jackServerSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -520,17 +492,14 @@ const JackServerSettingsDialog = withStyles(
|
|||||||
if (!this.state.alsaDevices) {
|
if (!this.state.alsaDevices) {
|
||||||
this.requestAlsaInfo();
|
this.requestAlsaInfo();
|
||||||
}
|
}
|
||||||
this.startStatusTimer();
|
} else if (!this.props.open && oldProps.open) {
|
||||||
} else if (!this.props.open && oldProps.open) {
|
this.originalJackServerSettings = undefined;
|
||||||
this.stopStatusTimer();
|
}
|
||||||
this.originalJackServerSettings = undefined;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
super.componentWillUnmount();
|
super.componentWillUnmount();
|
||||||
this.mounted = false;
|
this.mounted = false;
|
||||||
this.stopStatusTimer();
|
|
||||||
if (this.originalJackServerSettings) {
|
if (this.originalJackServerSettings) {
|
||||||
// Revert any unapplied changes when the dialog is unmounted
|
// Revert any unapplied changes when the dialog is unmounted
|
||||||
this.applySettings(this.originalJackServerSettings);
|
this.applySettings(this.originalJackServerSettings);
|
||||||
@@ -603,7 +572,6 @@ const JackServerSettingsDialog = withStyles(
|
|||||||
handleApply() {
|
handleApply() {
|
||||||
if (this.state.okEnabled) {
|
if (this.state.okEnabled) {
|
||||||
this.applySettings(); // Fire and forget
|
this.applySettings(); // Fire and forget
|
||||||
this.startStatusTimer();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -837,9 +805,6 @@ const JackServerSettingsDialog = withStyles(
|
|||||||
color="textSecondary">
|
color="textSecondary">
|
||||||
Latency: {this.state.latencyText}
|
Latency: {this.state.latencyText}
|
||||||
</Typography>
|
</Typography>
|
||||||
<div className={classes.cpuStatusColor} style={{ paddingLeft: 24 }}>
|
|
||||||
{JackHostStatus.getDisplayViewNoCpu("", this.state.jackStatus)}
|
|
||||||
</div>
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
|
|||||||
Reference in New Issue
Block a user