更新 index.html

master
钟进 6 years ago
parent 78792de453
commit e93d33f207

@ -160,40 +160,6 @@
var attempts = 0;
var ignoreDialog = 0;
function getComPorts(actualValue) {
var timeout = setTimeout(function () {
getComPorts(actualValue);
}, 2000);
sendTo(null, 'listUart', null, function (list) {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
if (!list || !list.length) {
attempts++;
if (attempts < 10) {
setTimeout(function () {
getComPorts(actualValue);
}, 1000);
}
return;
}
var $comName = $('#modbus_comName');
var text = '<option value="">' + _('Select port') + '</option>';
for (var j = 0; j < list.length; j++) {
if (list[j].comName === 'Not available') {
text = '<option value="" selected>' + _('Not available') + '</option>';
$comName.prop('disabled', true);
break;
} else {
text += '<option value="' + list[j].comName + '" ' + ((actualValue === list[j].comName) ? 'selected' : '') + '>' + list[j].comName + '</option>';
}
}
$comName.html(text);
});
}
function getExport(data, id, delimiter) {
delimiter = delimiter || '\t';
var text = '';
@ -913,7 +879,7 @@
getIsAdapterAlive(function (isAlive) {
if (isAlive || common.enabled) {
getComPorts(settings.params.comName);
//
}
});

Loading…
Cancel
Save