Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DiskUsage plugin (jQuery test) 0.0.0.4

Featured Replies

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

DiskUsage.0.0.0.4.zip

  • Author

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

diskusage.gif.bb1d956601f02ccb25615c723828c0d9.gif

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)

  • Author

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

 

 

 

 

  • Author

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)

 

I'm showing used ;)

 

So 909 free, means 591 used = 39% used. The drive icons fill up to down.

I knew someone would throw jQuery in there soon.

 

I'm working on getting AjaxExplorer working now.

  • Author

I find it a lightweight very powerfull and almost essential way of writing javascript. Especially not working with document.getElementByID etc. anymore.

 

I'm guessing you'll be using it as well ?

I'm guessing you'll be using it as well ?

 

Gawd no... I fscking hate jQuery specifically because it hides the real stuff.... stuff like jQuery makes for very, very bad programming habits IMHO.

  • Author

Bad programming can be done using any language... ;)

 

I just rather write

 

$('#element').html('test').show();

 

than

 

document.getElementByID('element').innerHTML='test';

document.getElementByID('element').style.display='block';

 

I'd rather use pure JavaScript or write the function myself so anyone who knows JavaScript can read it, and not have to know some made-up pseudo-language most people have never heard of. ;)

 

 

 

I'd rather use pure JavaScript or write the function myself so anyone who knows JavaScript can read it, and not have to know some made-up pseudo-language most people have never heard of. ;)

Me too.    (perhaps that is why I never really loved working with .NET)

I'd rather use pure JavaScript or write the function myself so anyone who knows JavaScript can read it, and not have to know some made-up pseudo-language most people have never heard of. ;)

 

Either I'm not sensing the sarcasm in there or I'm misreading it. What 'web developer' who knows how to use Javascript has never heard of perhaps the current most popular library available?

 

I used to be of the minimalist/N.I.H. mindset, but then after re-inventing the wheel way too many times I embraced the use of solid and useful third party libraries.

What 'web developer' who knows how to use Javascript has never heard of perhaps the current most popular library available?

 

Depends on what you mean by "web developer" and "heard" of it.  I had "heard" of jQuery a long, long time before I ever came across any code that used it, and it confused the hell out of me, and was cursing that developer for weeks.

 

I never actually looked at its codebase until 18 months or so ago.

 

There are a bajillion people out there writing JavaScript... and they are "developers" even though all they are doing is hacking away on their own home page and nothing more, with a small subset of JavaScript capabilities and doing simple stuff.

 

It is not nearly as popular as you think it is.

 

 

I meant "web developer" as someone who's mainly paid to work on web sites or web-related projects, especially those who work on enterprise solutions. Not the typical Jill or Bob who run a blog or update Facebook/Myspace/YourHole/GeoCities/Twatter sites.

 

<offtopic tangent comic relief>

 

I kid you not about the following horrors.

 

I guess I've been burned too often in a corporate environment by 'hack developers' (cheapest offshore solution and even some local in-house), where it was my job to fix the issues or add new features to it.  Not a single part of the site used include files. The javascript was copied and pasted into each individual page. There were often bugs in behavior where functionality would work on one page but not the next. They'd update one page but not the rest. Upon closer examination of what was done, even the pages which "worked", didn't work under all conditions and broke worse when browser engines were updated.

 

I've also been on a project where Python and Javascript was utilized for an attempted online Points project. After 3 years of failed attempts at making it work, they gave up and continued outsourcing it to Visa. Everything was done in those two scripting languages, and I mean everything. The only thing not done in there was the external interface layers. They had a J2EE layer for remote calls. It would read in the parameters and then shuttle through a Python or Javascript layer. They even did their database access and database batch updates in the scripting language. Their biggest downfall was having the system be batch process oriented. Their offline update window was 3 hours. At one point they were delivered an Oracle PL/SQL batch process that functioned perfectly fine and fit well within the offline window constraints. They took it upon themselves to rewrite it all in Javascript/Python. Their version of the database batch processing took 20 hours to run on twice the hardware too!

 

I guess I've had too much pain having to deal with idiots who would insist on reinventing solutions to already solved areas. I'd rather spend my time using a dependable known solution than having to rely on questionable quality from others.

 

I'm sure I'd have no issues with the Javascript you or the other big-names on this forum produce.

WOW Brit, that's a heavy duty story. Sometimes I have a similar conversation with my group.

They want to use Java, but I cannot see it fitting with what I do, which is mainly ksh/bash, perl, C.

I would use whatever language works if I felt it was appropriate for the group/task and it performed well.

I'm just now debating to myself about python and the merits of it for some tasks, but I like small tight concise code as close to the system as possible.

Interesting story.

I used to code in 19 different languages and specialized in data conversions and application rewrites.  I used to get most of my work cleaning up messes left by others.  Now I just say "no thanks, you don't have enough money."

 

I've seen people with giant macros using Lotus as a word processor.  If the only tool in your toolbox is a hammer, everything looks like a nail.

 

 

In the Navy we used to carry a big wrench and its nickname was "The Cresent Hammer"

It wasn't adjustable, it wasn't made by Cresent and it was not intended for hammering, but guess what. ;)

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.