Add checkbox to filter experimental fw versions

This commit is contained in:
Jan Schneider 2020-02-22 23:40:43 +01:00
parent 1c4d91b445
commit 33a0b6a061
1 changed files with 13 additions and 2 deletions

View File

@ -319,10 +319,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
var experimental = (fw.experimental ? 'checked=""' : '')
var downloaded = (fw.image ? 'checked=""' : '')
var cls = '';
var style = '';
if (fw.installed) cls = ' class="warning"';
if (fw.experimental) cls = ' class="error"';
if (fw.experimental) { cls = ' class="error"'; style = 'visibility: collapse;' }
if (fw.latest) cls = ' class="positive"';
$("#firmware-info tbody").append($('<tr' + cls + '>').append(
$("#firmware-info tbody").append($('<tr' + cls + ' style="' + style + '">').attr('data-experimental', fw.experimental).append(
$('<td>').append($('<a>', {text: fw.version, title: i18next.t('open_release_info'), href: fw.info_url, target: "_blank"})),
$('<td class="center aligned">').append($('<div class="ui disabled checkbox">').append($('<input type="checkbox" disabled="disabled" '+available+'>'),$('<label></label>'))),
$('<td class="center aligned">').append($('<div class="ui disabled checkbox">').append($('<input type="checkbox" disabled="disabled" '+experimental+'>'),$('<label></label>'))),
@ -352,6 +353,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
});
}
function show_experimental_firmware(show) {
$('tr[data-experimental="true"]').css('visibility', show ? '' : 'collapse');
}
function get_system_info() {
rest("GET", "/get_system_info", null, function(data) {
$("#system-info").empty();
@ -789,6 +794,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
delete: 'Delete',
partiton_table_deleted: 'Partiton table deleted.',
firmwares: 'Firmwares',
show_experimental_fw: 'Show experimental versions',
current_installed_version: 'Current installed version',
latest_available_version: 'Latest available version',
loading: 'Loading',
@ -876,6 +882,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
delete: 'Löschen',
partiton_table_deleted: 'Partitionstabelle gelöscht.',
firmwares: 'Firmwares',
show_experimental_fw: 'Experimentelle Versionen anzeigen',
current_installed_version: 'Momentan installierte Version',
latest_available_version: 'Aktuellste verfügbare Version',
loading: 'Lade',
@ -1059,6 +1066,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
install
</button>
</div>
<div class="ui checkbox" style="margin-top: 20px;">
<input id="show-experimental-fw" type="checkbox" onchange="show_experimental_firmware(this.checked);">
<label data-i18n="show_experimental_fw"></label>
</div>
<table id="firmware-info" class="ui celled stackable table">
<thead>
<tr>