From 8736e8c25de3c78467177b92d65c5b9ef27a9efc Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 12 Nov 2020 15:04:41 +0100 Subject: [PATCH] storage tooltip format storage in the tooltip in the dashboard storage bar, now looks like the size above , MB with 0 decimals and if more than 1 gb then in GB with 2 decimals --- admin/themes/default/template/intro.tpl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/template/intro.tpl b/admin/themes/default/template/intro.tpl index 21f719b6a..b6f45e34a 100644 --- a/admin/themes/default/template/intro.tpl +++ b/admin/themes/default/template/intro.tpl @@ -69,8 +69,19 @@ $(window).on('resize', function(){ tooltip.css('left', left+"px") }); }); - +let size = 0; +let str_size_type = "MB"; +let size_nb = 0; +let str_size = ""; {/literal} +{foreach from=$STORAGE_CHART_DATA key=type item=value} + size = {$value}; + str_size_type = size > 1000000 ? "GB" : "MB"; + size_nb = size > 1000000 ? (size / 1000000).toFixed(2) : (size / 1000).toFixed(0); + str_size = " : " + size_nb.toString() + " " + str_size_type; + $("#storage-{$type}").html("" + str_size); + $("#storage-{$type} b").html("{$type}"); +{/foreach} {/footer_script} {html_style} @@ -229,7 +240,7 @@ $(window).on('resize', function(){
{foreach from=$STORAGE_CHART_DATA key=type item=value} -

{$type} : {$value/1000} MB

+

{$type}

{/foreach}