Skip to content

Commit c64ae57

Browse files
Option to display free bytes instead of free % (#2890)
Co-authored-by: Roman <a@bc.de>
1 parent f4a0865 commit c64ae57

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

plugins/diskspace/conf.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
$notifySpaceLimit = 512; // in Mb
55
$partitionDirectory = null; // if null, then we will check rtorrent download directory (or $topDirectory if rtorrent is unavailable)
66
// otherwise, set this to the absolute path for checked partition.
7+
$freeBytesInMeter = false; // show free space instead of %

plugins/diskspace/init.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ plugin.setValue = function( full, free )
88
percent = 100;
99
$("#meter-disk-value").width( percent+"%" ).css( { "background-color": (new RGBackground()).setGradient(this.prgStartColor,this.prgEndColor,percent).getColor(),
1010
visibility: !percent ? "hidden" : "visible" } );
11-
$("#meter-disk-text").text(percent+'%');
11+
if(plugin.freeBytesInMeter) $("#meter-disk-text").text(theConverter.bytes(free));
12+
else $("#meter-disk-text").text(percent+'%');
1213
$("#meter-disk-pane").prop("title", theConverter.bytes(free)+"/"+theConverter.bytes(full));
1314

1415
if($.noty && plugin.allStuffLoaded)

plugins/diskspace/init.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
else
2222
{
2323
$jResult.="plugin.interval = ".$diskUpdateInterval."; plugin.notifySpaceLimit = ".($notifySpaceLimit*1024*1024).";";
24+
$jResult.="plugin.freeBytesInMeter = ".($freeBytesInMeter ? 1 : 0).";";
2425
$theSettings->registerPlugin($plugin["name"],$pInfo["perms"]);
2526
}

0 commit comments

Comments
 (0)