From a3d74d84a1920daebbb51584e1e8d5ef3a17a0f1 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 4 Sep 2023 20:47:56 +0200 Subject: [PATCH] mvc / uibootgrid - add bytes format to standard formatters list. --- src/opnsense/www/js/opnsense_bootgrid_plugin.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/opnsense/www/js/opnsense_bootgrid_plugin.js b/src/opnsense/www/js/opnsense_bootgrid_plugin.js index 7a249509e..bba563726 100644 --- a/src/opnsense/www/js/opnsense_bootgrid_plugin.js +++ b/src/opnsense/www/js/opnsense_bootgrid_plugin.js @@ -173,26 +173,32 @@ $.fn.UIBootgrid = function (params) { return html.join('\n'); }, - "commandsWithInfo": function(column, row) { + commandsWithInfo: function(column, row) { return ' ' + '' + '' + ''; }, - "rowtoggle": function (column, row) { + rowtoggle: function (column, row) { if (parseInt(row[column.id], 2) === 1) { return ''; } else { return ''; } }, - "boolean": function (column, row) { + boolean: function (column, row) { if (parseInt(row[column.id], 2) === 1) { return ""; } else { return ""; } }, + bytes: function(column, row) { + if (row[column.id] && row[column.id] > 0) { + return byteFormat(row[column.id], 2); + } + return ''; + }, }, onBeforeRenderDialog: null };