1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 14:25:14 +03:00

visual notify for open/close serial port error

This commit is contained in:
cTn 2013-11-08 18:31:19 +01:00
parent 4fcd47b7e3
commit e532edc748
4 changed files with 17 additions and 1 deletions

View file

@ -190,6 +190,11 @@ a:hover {
border-top: 1px solid #7d7d79;
background-color: #bfbeb5;
}
#status-bar .notify {
float: right;
}
#status-bar .notify span {
}
/* tab specific sections */
.tab-initial_setup {

View file

@ -83,3 +83,11 @@ $(document).ready(function() {
tab_initialize_default();
});
function notify(message, color) {
$('span.notify').html('<span style="color: ' + color + '">' + message + '</span>');+
$('span.notify span').fadeOut(5000, function() {
$(this).remove();
});
}

View file

@ -280,6 +280,7 @@ function onOpen(openInfo) {
}, connection_delay * 1000);
} else {
console.log('Failed to open serial port');
notify('Failed to open serial port', 'red');
$('div#port-picker a.connect').text('Connect');
$('div#port-picker a.connect').removeClass('active');
@ -302,6 +303,7 @@ function onClosed(result) {
} else { // Something went wrong
if (connectionId > 0) {
console.log('There was an error that happened during "connection-close" procedure.');
notify('Failed to close serial port', 'red');
}
}
}

View file

@ -105,6 +105,7 @@
Port utilization: <span class="port-usage">0%</span> |
Firmware Version: <span class="software-version">0.00</span> |
Cycle Time: <span class="cycle-time">0</span>
<span class="notify"></span>
</div>
</div>
</body>