0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 09:17:56 +01:00
# By peteruithoven
# Via peteruithoven
* 'master' of https://github.com/Doodle3D/doodle3d-client:
  Network ui tweaks
This commit is contained in:
Adriaan Wormgoor 2013-09-07 16:07:18 +02:00
commit df8c202ad8

View File

@ -51,7 +51,7 @@ function SettingsWindow() {
// because the webserver needs time to switch // because the webserver needs time to switch
// this time is multiplied 3 times after access point creation // this time is multiplied 3 times after access point creation
this.retrieveNetworkStatusDelay; // setTimout delay this.retrieveNetworkStatusDelay; // setTimout delay
this.retrieveNetworkStatusDelayTime = 3000; this.retrieveNetworkStatusDelayTime = 4000;
// Events // Events
SettingsWindow.SETTINGS_LOADED = "settingsLoaded"; SettingsWindow.SETTINGS_LOADED = "settingsLoaded";
@ -320,10 +320,13 @@ function SettingsWindow() {
dataType: 'json', dataType: 'json',
timeout: self.timeoutTime, timeout: self.timeoutTime,
success: function(response){ success: function(response){
console.log("Settings:updateNetworkStatus response: ",response); console.log("Settings:retrieveNetworkStatus response: ",response);
if(response.status == "error") { if(response.status == "error" || response.data.ssid == "") {
clearTimeout(self.retryRetrieveNetworkStatusDelay); //clearTimeout(self.retryRetrieveNetworkStatusDelay);
self.retryRetrieveNetworkStatusDelay = setTimeout(function() { self.retrieveNetworkStatus() },self.retryDelay); // retry after delay //self.retryRetrieveNetworkStatusDelay = setTimeout(function() { self.retrieveNetworkStatus() },self.retryDelay); // retry after delay
self.setClientModeState(SettingsWindow.NOT_CONNECTED);
} else { } else {
var data = response.data; var data = response.data;
switch(data.mode) { switch(data.mode) {
@ -363,7 +366,7 @@ function SettingsWindow() {
} }
} }
}).fail(function() { }).fail(function() {
console.log("Settings:updateNetworkStatus: failed"); console.log("Settings:retrieveNetworkStatus: failed");
clearTimeout(self.retryRetrieveNetworkStatusDelay); clearTimeout(self.retryRetrieveNetworkStatusDelay);
self.retryRetrieveNetworkStatusDelay = setTimeout(function() { self.retrieveNetworkStatus() },self.retryDelay); // retry after delay self.retryRetrieveNetworkStatusDelay = setTimeout(function() { self.retrieveNetworkStatus() },self.retryDelay); // retry after delay
}); });
@ -419,7 +422,8 @@ function SettingsWindow() {
if(self.selectedNetwork == undefined) return; if(self.selectedNetwork == undefined) return;
postData = { postData = {
ssid:self.selectedNetwork, ssid:self.selectedNetwork,
phrase:self.form.find("#password").val() phrase:self.form.find("#password").val(),
recreate:true
} }
console.log(" postData: ",postData); console.log(" postData: ",postData);
if (communicateWithWifibox) { if (communicateWithWifibox) {