fix wifi modals
This commit is contained in:
parent
9831046592
commit
db394ea201
@ -3,9 +3,6 @@
|
||||
iface=$(iw dev | awk '$1=="Interface"{print $2}' | grep '^wlan')
|
||||
file="/etc/wpa_supplicant/wpa_supplicant-monopoly.conf"
|
||||
|
||||
sleep 5
|
||||
echo "!!ok"
|
||||
exit 0
|
||||
|
||||
sudo ip addr flush dev $iface
|
||||
sudo killall wpa_supplicant
|
||||
@ -16,8 +13,9 @@ declare -i i=0
|
||||
declare -i timeout=8
|
||||
while [ $i -le $timeout ]; do
|
||||
if grep -iq 'CTRL-EVENT-CONNECTED' /tmp/wifi_connection_status.txt; then
|
||||
sudo dhclient wlan0
|
||||
exit 2
|
||||
sudo dhclient $iface
|
||||
echo "!!ok"
|
||||
exit 0
|
||||
elif grep -iq '4-Way Handshake failed' /tmp/wifi_connection_status.txt; then
|
||||
exit 2
|
||||
fi
|
||||
@ -25,5 +23,5 @@ while [ $i -le $timeout ]; do
|
||||
(( i++ ))
|
||||
sleep 1
|
||||
done
|
||||
echo "!!ok"
|
||||
exit 0
|
||||
echo "!!nok"
|
||||
exit -1
|
@ -23,7 +23,6 @@ interface StartupState {
|
||||
showStartBtn: boolean,
|
||||
isConnected: boolean,
|
||||
isConnectionIssue: boolean,
|
||||
openWifiQuestion: boolean,
|
||||
startCounter: number,
|
||||
}
|
||||
|
||||
@ -36,7 +35,6 @@ export default class Startup extends Component<{}, StartupState> {
|
||||
showStartBtn: false,
|
||||
isConnected: false,
|
||||
isConnectionIssue: false,
|
||||
openWifiQuestion: false,
|
||||
startCounter: 10,
|
||||
};
|
||||
}
|
||||
@ -50,7 +48,7 @@ export default class Startup extends Component<{}, StartupState> {
|
||||
openCloudConnectModal: true,
|
||||
statusTxt: "Möchten Sie CloudConnect+ nutzen?"
|
||||
}));
|
||||
this.cloudDecision(true).then();
|
||||
//this.cloudDecision(true).then();
|
||||
}, 1)
|
||||
}
|
||||
|
||||
@ -88,7 +86,6 @@ export default class Startup extends Component<{}, StartupState> {
|
||||
async cloudDecision(decision: boolean) {
|
||||
this.setState((prevState) => ({
|
||||
...prevState,
|
||||
openWifiQuestion: false,
|
||||
openCloudConnectModal: false,
|
||||
isConnectionIssue: false,
|
||||
isConnected: false,
|
||||
@ -107,8 +104,8 @@ export default class Startup extends Component<{}, StartupState> {
|
||||
if (!status.hasInternet) {
|
||||
this.setState((prevState) => ({
|
||||
...prevState,
|
||||
openWifiQuestion: true, // Weiterleiten auf WiFiFrage
|
||||
statusTxt: "Warten auf Netzwerkkonfiguration..."
|
||||
isConnectionIssue: true, // Weiterleiten auf Fehlermodal
|
||||
statusTxt: "Warten auf Netzwerk..."
|
||||
}));
|
||||
} else {
|
||||
this.setState((prevState) => ({
|
||||
@ -161,31 +158,6 @@ export default class Startup extends Component<{}, StartupState> {
|
||||
|
||||
render() {
|
||||
return <div className="startup">
|
||||
<Dialog
|
||||
open={this.state.openWifiQuestion}
|
||||
onClose={null}
|
||||
aria-labelledby="alert-dialog-title"
|
||||
aria-describedby="alert-dialog-description"
|
||||
>
|
||||
<DialogTitle id="alert-dialog-title">
|
||||
Keine Internetverbindung!
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText id="alert-dialog-description">
|
||||
Es wurde keine Internetverbindung erkannt.<br/><br/>
|
||||
<strong>Möchten Sie eine WLAN-Verbindung einrichten?</strong>
|
||||
<br/><i>Andernfalls können Sie SmartMonopoly offline nutzen.</i>
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => this.cloudDecision(false)}>
|
||||
Offline nutzen
|
||||
</Button>
|
||||
<Button onClick={() => {
|
||||
window.app.toggleWiFiSettings(true)
|
||||
}} autoFocus>Einrichten</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
<Dialog
|
||||
open={this.state.isConnectionIssue}
|
||||
onClose={null}
|
||||
|
Loading…
x
Reference in New Issue
Block a user