<div data-role="content">
<div id="connman_tethering_technologies"></div>
- <label for="input_wifi_tethering_id">Tethering Identifier:</label>
+ <label for="input_wifi_tethering_id">WiFi Tethering Identifier:</label>
<input type="text" name="name" id="input_wifi_tethering_id" value="" />
- <label for="input_wifi_tethering_passphrase">Tethering Passphrase:</label>
+ <label for="input_wifi_tethering_passphrase">WiFi Tethering Passphrase:</label>
<input type="password" name="name" id="input_wifi_tethering_passphrase" value="" />
</div>
</div>
function connmanTetheringPageReload() {
$('#connman_tethering_technologies').html('');
+ $('#connman_wifi_tethering_options').hide();
+ $('#input_wifi_tethering_id').textinput('enable');
+ $('#input_wifi_tethering_passphrase').textinput('enable');
+
settings.connman.getTechnologies(function(technologies) {
for (var i = 0; i < technologies.length; i++) {
var technology = technologies[i];
console.log('Connman technology ' + technology.prop.Type + ' is tethered: ' + technology.prop.Tethering);
if (technology.prop.Powered === true) {
+ /* WiFi-only options */
+ if (technology.prop.Type === 'wifi') {
+ $('#connman_wifi_tethering_options').show();
+ if (technology.prop.TetheringIdentifier) {
+ $('#input_wifi_tethering_id').val(technology.prop.TetheringIdentifier);
+ }
+ if (technology.prop.TetheringPassphrase) {
+ $('#input_wifi_tethering_passphrase').val(technology.prop.TetheringPassphrase);
+ }
+
+ if (technology.prop.Tethering === true) {
+ $('#input_wifi_tethering_id').textinput('disable');
+ $('#input_wifi_tethering_passphrase').textinput('disable');
+ }
+ }
+
if (technology.prop.Tethering === true) {
$('#toggle_tethering_' + technology.prop.Type).val('on').slider('refresh');
- $('#input_wifi_tethering_id').textinput('disable');
- $('#input_wifi_tethering_passphrase').textinput('disable');
- /* WiFi-only options */
- if (technology.prop.Type === 'wifi') {
- $('#connman_wifi_tethering_options').show();
- if (technology.prop.TetheringIdentifier) {
- $('#input_wifi_tethering_id').val(technology.prop.TetheringIdentifier);
- }
- if (technology.prop.TetheringPassphrase) {
- $('#input_wifi_tethering_passphrase').val(technology.prop.TetheringPassphrase);
- }
- }
} else {
$('#toggle_tethering_' + technology.prop.Type).val('off').slider('refresh');
}
} else {
+ /* WiFi-only options */
if (technology.prop.Type === 'wifi') {
$('#input_wifi_tethering_id').textinput('disable');
$('#input_wifi_tethering_passphrase').textinput('disable');
}
+
$('#toggle_tethering_' + technology.prop.Type).slider('disable');
$('#toggle_tethering_' + technology.prop.Type).slider('refresh');
}
technology.setTethering(false, '', '', function() {
/* success */
console.log('Successfully untethered connman technology ' + technology.prop.Type);
- connmanTetheringPageReload();
+ setTimeout(function() {
+ connmanTetheringPageReload();
+ }, 2000);
}, function(e) {
/* error */
connmanTetheringPageReload();