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')
|
iface=$(iw dev | awk '$1=="Interface"{print $2}' | grep '^wlan')
|
||||||
file="/etc/wpa_supplicant/wpa_supplicant-monopoly.conf"
|
file="/etc/wpa_supplicant/wpa_supplicant-monopoly.conf"
|
||||||
|
|
||||||
sleep 5
|
|
||||||
echo "!!ok"
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
sudo ip addr flush dev $iface
|
sudo ip addr flush dev $iface
|
||||||
sudo killall wpa_supplicant
|
sudo killall wpa_supplicant
|
||||||
@ -16,8 +13,9 @@ declare -i i=0
|
|||||||
declare -i timeout=8
|
declare -i timeout=8
|
||||||
while [ $i -le $timeout ]; do
|
while [ $i -le $timeout ]; do
|
||||||
if grep -iq 'CTRL-EVENT-CONNECTED' /tmp/wifi_connection_status.txt; then
|
if grep -iq 'CTRL-EVENT-CONNECTED' /tmp/wifi_connection_status.txt; then
|
||||||
sudo dhclient wlan0
|
sudo dhclient $iface
|
||||||
exit 2
|
echo "!!ok"
|
||||||
|
exit 0
|
||||||
elif grep -iq '4-Way Handshake failed' /tmp/wifi_connection_status.txt; then
|
elif grep -iq '4-Way Handshake failed' /tmp/wifi_connection_status.txt; then
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
@ -25,5 +23,5 @@ while [ $i -le $timeout ]; do
|
|||||||
(( i++ ))
|
(( i++ ))
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
echo "!!ok"
|
echo "!!nok"
|
||||||
exit 0
|
exit -1
|
@ -23,7 +23,6 @@ interface StartupState {
|
|||||||
showStartBtn: boolean,
|
showStartBtn: boolean,
|
||||||
isConnected: boolean,
|
isConnected: boolean,
|
||||||
isConnectionIssue: boolean,
|
isConnectionIssue: boolean,
|
||||||
openWifiQuestion: boolean,
|
|
||||||
startCounter: number,
|
startCounter: number,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +35,6 @@ export default class Startup extends Component<{}, StartupState> {
|
|||||||
showStartBtn: false,
|
showStartBtn: false,
|
||||||
isConnected: false,
|
isConnected: false,
|
||||||
isConnectionIssue: false,
|
isConnectionIssue: false,
|
||||||
openWifiQuestion: false,
|
|
||||||
startCounter: 10,
|
startCounter: 10,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -50,7 +48,7 @@ export default class Startup extends Component<{}, StartupState> {
|
|||||||
openCloudConnectModal: true,
|
openCloudConnectModal: true,
|
||||||
statusTxt: "Möchten Sie CloudConnect+ nutzen?"
|
statusTxt: "Möchten Sie CloudConnect+ nutzen?"
|
||||||
}));
|
}));
|
||||||
this.cloudDecision(true).then();
|
//this.cloudDecision(true).then();
|
||||||
}, 1)
|
}, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +86,6 @@ export default class Startup extends Component<{}, StartupState> {
|
|||||||
async cloudDecision(decision: boolean) {
|
async cloudDecision(decision: boolean) {
|
||||||
this.setState((prevState) => ({
|
this.setState((prevState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
openWifiQuestion: false,
|
|
||||||
openCloudConnectModal: false,
|
openCloudConnectModal: false,
|
||||||
isConnectionIssue: false,
|
isConnectionIssue: false,
|
||||||
isConnected: false,
|
isConnected: false,
|
||||||
@ -107,8 +104,8 @@ export default class Startup extends Component<{}, StartupState> {
|
|||||||
if (!status.hasInternet) {
|
if (!status.hasInternet) {
|
||||||
this.setState((prevState) => ({
|
this.setState((prevState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
openWifiQuestion: true, // Weiterleiten auf WiFiFrage
|
isConnectionIssue: true, // Weiterleiten auf Fehlermodal
|
||||||
statusTxt: "Warten auf Netzwerkkonfiguration..."
|
statusTxt: "Warten auf Netzwerk..."
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
this.setState((prevState) => ({
|
this.setState((prevState) => ({
|
||||||
@ -161,31 +158,6 @@ export default class Startup extends Component<{}, StartupState> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <div className="startup">
|
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
|
<Dialog
|
||||||
open={this.state.isConnectionIssue}
|
open={this.state.isConnectionIssue}
|
||||||
onClose={null}
|
onClose={null}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user