From 03755f4a62e64f4f27865314f5030d5de7377d56 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 28 Feb 2018 20:02:00 +0100 Subject: [PATCH] UI improvements --- addon/www/index.html | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/addon/www/index.html b/addon/www/index.html index ad56c2f..4434b84 100644 --- a/addon/www/index.html +++ b/addon/www/index.html @@ -309,13 +309,16 @@ along with this program. If not, see . } function format_size(size) { + if (size < 0) { + size = 0; + } if (size > 1024 * 1024 * 1024) { return (parseInt(size)/1024/1024/1024).toFixed(1) + ' GB' } else if (size > 1024 * 1024) { return (parseInt(size)/1024/1024).toFixed(1) + ' MB' } - else { + else { return (parseInt(size)/1024).toFixed(1) + ' KB' } } @@ -348,6 +351,7 @@ along with this program. If not, see . for (var part in parts) { var partition = disks[disk_device].partitions[part]; + var is_sys_partition = (partition.filesystem_label == 'userfs' || partition.filesystem_label == 'bootfs' || partition.filesystem_label == 'rootfs' || partition.filesystem_label == 'rootfs1' || partition.filesystem_label == 'rootfs2') var menu_items = []; var skip_dev = false; @@ -357,10 +361,10 @@ along with this program. If not, see . else if (disks[disk_device].bootfs_on_disk && (partition.partition == 0)) { skip_dev = true; } - else if ((partition.partition > 0) && (partition.filesystem_label == 'bootfs' || partition.filesystem_label == 'rootfs' || partition.filesystem_label == 'rootfs1' || partition.filesystem_label == 'rootfs2')) { + else if (is_sys_partition && (partition.partition > 0)) { skip_dev = true; } - + if (! skip_dev) { var device = partition.disk_device; var label = i18next.t('use_disk_for_userfs'); @@ -412,8 +416,8 @@ along with this program. If not, see . $('') .append($('
' + partition.disk_device + '')), $(''), - $('').append($('')), - $(''), + $('').append($('')), + $(''), $('').append(menu) )); } else { @@ -421,13 +425,15 @@ along with this program. If not, see . if (partition.filesystem_usage && partition.filesystem_usage >= 0) { usage = (parseFloat(partition.filesystem_usage) * 100).toFixed(0) + '%' } - $("#volume-info tbody").append($('').append( + var st = (is_sys_partition) ? 'style="font-weight:bolder"' : ''; + $("#volume-info tbody").append($('').append( $('').append($('')), $('').append($('')), $('').append($('')), $('').append($('')), - $('').append($('')), - $('').append($('')), + $('').append($('')), + $('').append($('')), + $('').append($('')), $('').append(menu) )); } @@ -647,7 +653,8 @@ along with this program. If not, see . filesystem_label: 'Label', mountpoint: 'Mountpoint', size: 'Size', - usage: 'Usage', + used: 'Used', + free: 'Free', use_disk_for_userfs: 'Use whole disk for userfs.', use_partition_for_userfs: 'Use partition for userfs.', move_userfs: 'Move userfs to another device', @@ -724,7 +731,8 @@ along with this program. If not, see . filesystem_label: 'Label', mountpoint: 'Einhängepunkt', size: 'Größe', - usage: 'Belegt', + used: 'Belegt', + free: 'Frei', use_disk_for_userfs: 'Den gesamten Datenträger für das userfs verwenden.', use_partition_for_userfs: 'Die Partition als userfs verwenden.', move_userfs: 'Userfs auf anderen Datenträger verschieben', @@ -873,8 +881,9 @@ along with this program. If not, see . - - + + +