mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-11-22 09:17:56 +01:00
Decoupled substituted ssid & setting new settings locally again
This commit is contained in:
parent
d432c00336
commit
017020194f
@ -120,8 +120,7 @@ function FormPanel() {
|
|||||||
validated = false;
|
validated = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
settings.substituted_ssid = data.substituted_ssid;
|
if(complete) complete(validated, data);
|
||||||
if(complete) complete(validated);
|
|
||||||
}, function() {
|
}, function() {
|
||||||
console.log("Settings:saveSettings: failed");
|
console.log("Settings:saveSettings: failed");
|
||||||
clearTimeout(_retrySaveSettingsDelay);
|
clearTimeout(_retrySaveSettingsDelay);
|
||||||
|
@ -24,6 +24,7 @@ function NetworkPanel() {
|
|||||||
var _networks = {};
|
var _networks = {};
|
||||||
var _currentNetwork; // the ssid of the network the box is on
|
var _currentNetwork; // the ssid of the network the box is on
|
||||||
var _selectedNetwork; // the ssid of the selected network in the client mode settings
|
var _selectedNetwork; // the ssid of the selected network in the client mode settings
|
||||||
|
var _substituted_ssid; // the substituted ssid (displayed during creation)
|
||||||
var _currentLocalIP = "";
|
var _currentLocalIP = "";
|
||||||
var _currentAP;
|
var _currentAP;
|
||||||
var _currentNetworkStatus;
|
var _currentNetworkStatus;
|
||||||
@ -295,7 +296,7 @@ function NetworkPanel() {
|
|||||||
break;
|
break;
|
||||||
case NetworkAPI.STATUS.CREATING:
|
case NetworkAPI.STATUS.CREATING:
|
||||||
_btnCreate.attr("disabled", true);
|
_btnCreate.attr("disabled", true);
|
||||||
msg = "Creating access point... Reconnect by connecting your device to <b>"+settings.substituted_ssid+"</b> and going to <a href='http://draw.doodle3d.com'>draw.doodle3d.com</a>";
|
msg = "Creating access point... Reconnect by connecting your device to <b>"+_substituted_ssid+"</b> and going to <a href='http://draw.doodle3d.com'>draw.doodle3d.com</a>";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//console.log(" ap display msg: ",msg);
|
//console.log(" ap display msg: ",msg);
|
||||||
@ -306,7 +307,7 @@ function NetworkPanel() {
|
|||||||
//console.log("NetworkPanel:connectToNetwork");
|
//console.log("NetworkPanel:connectToNetwork");
|
||||||
if(_selectedNetwork == undefined) return;
|
if(_selectedNetwork == undefined) return;
|
||||||
// save network related settings and on complete, connect to network
|
// save network related settings and on complete, connect to network
|
||||||
_form.saveSettings(_form.readForm(),function(validated) {
|
_form.saveSettings(_form.readForm(),function(validated, data) {
|
||||||
if(!validated) return;
|
if(!validated) return;
|
||||||
updateClientModeUI(NetworkAPI.STATUS.CONNECTING,"");
|
updateClientModeUI(NetworkAPI.STATUS.CONNECTING,"");
|
||||||
_api.associate(_selectedNetwork,_passwordField.val(),true);
|
_api.associate(_selectedNetwork,_passwordField.val(),true);
|
||||||
@ -321,8 +322,9 @@ function NetworkPanel() {
|
|||||||
this.createAP = function() {
|
this.createAP = function() {
|
||||||
//console.log("createAP");
|
//console.log("createAP");
|
||||||
// save network related settings and on complete, create access point
|
// save network related settings and on complete, create access point
|
||||||
_form.saveSettings(_form.readForm(),function(success) {
|
_form.saveSettings(_form.readForm(),function(validated, data) {
|
||||||
if(!success) return;
|
if(!validated) return;
|
||||||
|
_substituted_ssid = data.substituted_ssid;
|
||||||
updateAPModeUI(NetworkAPI.STATUS.CREATING,"");
|
updateAPModeUI(NetworkAPI.STATUS.CREATING,"");
|
||||||
_api.openAP();
|
_api.openAP();
|
||||||
|
|
||||||
|
@ -108,8 +108,10 @@ function SettingsWindow() {
|
|||||||
_btnOK.attr("disabled",true);
|
_btnOK.attr("disabled",true);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
_form.saveSettings(_form.readForm(),function(success){
|
var newSettings = _form.readForm();
|
||||||
if(success) {
|
_form.saveSettings(newSettings,function(validated, data){
|
||||||
|
if(validated) {
|
||||||
|
settings = newSettings; // store new settings in global settings
|
||||||
settingsPopup.close();
|
settingsPopup.close();
|
||||||
self.signin();
|
self.signin();
|
||||||
}
|
}
|
||||||
@ -128,14 +130,6 @@ function SettingsWindow() {
|
|||||||
_networkPanel.update();
|
_networkPanel.update();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.saveSettings = function(newSettings,complete) {
|
|
||||||
settings = newSettings; // store new settings in global settings
|
|
||||||
_form.saveSettings(newSettings,function(validated) {
|
|
||||||
//TODO: settings.substituted_ssid = data.substituted_ssid;
|
|
||||||
if(complete) complete(validated);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.resetSettings = function() {
|
this.resetSettings = function() {
|
||||||
console.log("resetSettings");
|
console.log("resetSettings");
|
||||||
self.btnRestoreSettings.attr("disabled", true);
|
self.btnRestoreSettings.attr("disabled", true);
|
||||||
|
Loading…
Reference in New Issue
Block a user