From 924d6d4072c7e5c17a28d272c50b3a9b8f1f8fda Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Tue, 10 Nov 2020 10:54:30 +0100 Subject: [PATCH] prune sim: show count for rule and rename 'all zero' to 'keep-all' to make it consistent with the prune dialog in PBS. Signed-off-by: Fabian Ebner --- docs/prune-simulator/prune-simulator.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/prune-simulator/prune-simulator.js b/docs/prune-simulator/prune-simulator.js index c2076dcf..85c2a7b2 100644 --- a/docs/prune-simulator/prune-simulator.js +++ b/docs/prune-simulator/prune-simulator.js @@ -152,7 +152,12 @@ Ext.onReady(function() { dataIndex: 'mark', renderer: function(value, metaData, record) { if (record.data.mark === 'keep') { - return 'keep (' + record.data.keepName + ')'; + if (record.data.keepCount) { + return 'keep (' + record.data.keepName + + ': ' + record.data.keepCount + ')'; + } else { + return 'keep (' + record.data.keepName + ')'; + } } else { return value; } @@ -213,7 +218,11 @@ Ext.onReady(function() { if (backup.data.mark === 'remove') { html += `${text}`; } else { - text += ` (${backup.data.keepName})`; + if (backup.data.keepCount) { + text += ` (${backup.data.keepName}: ${backup.data.keepCount})`; + } else { + text += ` (${backup.data.keepName})`; + } if (me.useColors) { let bgColor = COLORS[backup.data.keepName]; let textColor = TEXT_COLORS[backup.data.keepName]; @@ -470,6 +479,7 @@ Ext.onReady(function() { newlyIncludedCount++; backup.mark = 'keep'; backup.keepName = keepName; + backup.keepCount = newlyIncludedCount; } else { backup.mark = 'remove'; } @@ -488,7 +498,7 @@ Ext.onReady(function() { Number(keepParams['keep-yearly']) === 0) { backups.forEach(function(backup) { backup.mark = 'keep'; - backup.keepName = 'all zero'; + backup.keepName = 'keep-all'; }); return;