Version 5 Development > Plugin Design
DiskUsage plugin (jQuery test) 0.0.0.4
mvdzwaan:
I've written my first unRAID plugin.
Unzip the attached file to /usr/local/webGui/
images/* : Contains some images I quickly made to have transparent disk usage icons
js/* : Contains jquery 1.4.2 and a jquery plugin to attach the visual disk usage behaviour to a div, including live updates
DiskUsage.page : To show up on the utils page
DiskUsage.php : Based on the main screen of Tom, but with a usage icon. Also includes a 30 second timer with jQuery ajax update to update the usage %
DiskUsageAjax.php : Stripped down version of DiskUsage.php with just the javascript to update the icons.
Note : Only drives which are OK are show...
Note2 : Version 0.0.0.1 should say enough.
Main goals of this plugin are :
*) Writing my first plugin
*) Testing usage of jQuery on plugin pages
*) Testing usage of Ajax on plugin pages
0.0.0.2 Update : Percentage is 100x not 10x (duh)
0.0.0.3 bubbaUtils fix (thankis to bubbaQ)
0.0.0.4 Update : Show percentage in bar
mvdzwaan:
I'm using VMWare with unraid 5, with 2 virtual 8Gb disks. Currently transferring data to it, but see attachment for a screenshot
* Firefox does not scale the used images pretty, so screenshot is from 'another browser'
* Color of usage bar wil turn orange/red at 75%,90%
* Mouseover shows percentage as text
Joe L.:
Disk percentages are all being reported incorrectly. But other than that, looks like a good start.
When I hover over the disk image:
Disk1 is actually 12% free, yet it shows as 9% (2TB drive, 247Gig free).
Disk2 is actually 24% free, yet shows as 8% (2TB drive, 492Gig free)
Disk3 is actually 32% free, yet shows as 7% (1.5TB drive, 502Gig free)
Disk4 is actually 60% free, yet shows as 4% (1.5TB drive, 909Gig free)
Disk5 is actually 53% free, yet shows as 5% (1.5TB drive, 797Gig free)
mvdzwaan:
I was focussing too much on getting everything working ;)
* 0.0.0.2 fixes the percentage, I did the divide and multiplied by 10 instead of 100
* I use $usage=round(100 * (1.0- ($disk['fsFree'] / $disk['size']))); this should be ok
mvdzwaan:
--- Quote from: Joe L. on July 21, 2010, 11:43:59 AM ---Disk percentages are all being reported incorrectly. But other than that, looks like a good start.
Disk4 is actually 60% free, yet shows as 4% (1.5TB drive, 909Gig free)
--- End quote ---
I'm showing used ;)
So 909 free, means 591 used = 39% used. The drive icons fill up to down.
Navigation
[0] Message Index
[#] Next page
Go to full version