webmin / authentic-theme

Official theme for the best server management panel of the 21st Century
https://authentic-theme.com
MIT License
947 stars 163 forks source link

Quotas Bar Charts Incorrect #110

Closed clawrie closed 9 years ago

clawrie commented 9 years ago

Bars for disk quotas in System Information are not accurate. Please refer to attached image. quotas

iliajie commented 9 years ago

Thanks for reporting. Help me out to solve this. I need to see the array, that is transformed to those wrong % numbers.

Just do the following:

  1. Open authentic-theme/authentic-lib.cgi (it's in Webmin directory, usually /usr/libexec/webmin).
  2. Find foreach my $t ( @{ $info->{'chart'} } ) { (about the line 296)
  3. Right under this line, hit enter to start a new line and add this prt($t);
  4. Save the file and go to browser.
  5. Click View Frame source, while right clicking with your mouse on right frame on the theme (where quotas are) (In case you're using Firefox, you can find this (View Frame Source) under drop down)
  6. Open source of sysinfo.cgi page and click refresh (CTRL+R or F5)
  7. Then find printed VAR1.

I need that content that will contain numbers about the charts. Please send it to me and I will provide fix as soon as possible.

clawrie commented 9 years ago

I'll try to do this tonight for you .. at college until 9PM :(

On Tue, Feb 17, 2015 at 6:13 PM, Ilia Rostovtsev notifications@github.com wrote:

Thanks for reporting. Help me out to solve this. I need to see that array that is transformed to that numbers.

Just do the following:

  1. Open authentic-theme/authentic-lib.cgi (it's in Webmin directory, usually /usr/libexec/webmin).
  2. Find foreach my $t ( @{ $info->{'chart'} } ) { (about the line 296)
  3. Right under this line, hit enter to start a new line and add this prt($t);
  4. Save the file and go to browser.
  5. Click View Frame source, while right clicking with your mouse on right frame on the theme (where quotas are) (In case you're using Firefox, you can find this (View Frame Source) under drop down)
  6. Open source of sysinfo.cgi page and click refresh (CTRL+R or F5)
  7. Then find printed VAR1.

I need that content that will contain numbers about the charts. Please send it to me and I will provide fix as soon as possible.

— Reply to this email directly or view it on GitHub https://github.com/qooob/authentic-theme/issues/110#issuecomment-74628659 .

iliajie commented 9 years ago

I see. Alright!

iliajie commented 9 years ago

You might need to install CPAN module Data::Dumper by going to Webmin->Other->Perl Modules

iliajie commented 9 years ago

So can you help me out? Quotas doesn't work on my system for some reasons.. If you don't want to install anything there is another way..

clawrie commented 9 years ago

I'll be able to do this today on our teat server. On 19/02/2015 5:23 am, "Ilia Rostovtsev" notifications@github.com wrote:

So can you help me out? Quotas doesn't work on my system for some reasons.. If you don't want to install anything there is another way..

— Reply to this email directly or view it on GitHub https://github.com/qooob/authentic-theme/issues/110#issuecomment-74923578 .

clawrie commented 9 years ago

Test server that is :( On 19/02/2015 6:47 am, "Craig Lawrie" ehswares@gmail.com wrote:

I'll be able to do this today on our teat server. On 19/02/2015 5:23 am, "Ilia Rostovtsev" notifications@github.com wrote:

So can you help me out? Quotas doesn't work on my system for some reasons.. If you don't want to install anything there is another way..

— Reply to this email directly or view it on GitHub https://github.com/qooob/authentic-theme/issues/110#issuecomment-74923578 .

iliajie commented 9 years ago

Any server where quotas are working. If you do it on different machine, please attach a screenshot again. It should only take few minutes really.

clawrie commented 9 years ago

Hi

Here is the info... (the test server only has two sites so only two sets of data - hope that's enough).

$VAR1 = { 'chart' => [ '1073741824', 110587904, 10125312 ],

$VAR1 = { 'chart' => [ '1073741824', 409600, 8192 ],

[image: Inline image 1]

I can create a webmin user account for you if you would like to take a look and experiment. The server is pretty slow though - just a 'tiny' Amazon web server instance for testing things out.

Craig

On Thu, Feb 19, 2015 at 8:46 AM, Ilia Rostovtsev notifications@github.com wrote:

Any server where quotas are working. If you do it on different machine, please attach a screenshot again. It should only take few minutes really.

— Reply to this email directly or view it on GitHub https://github.com/qooob/authentic-theme/issues/110#issuecomment-74960305 .

iliajie commented 9 years ago

Thanks. Great. No need for test login. Could you please take a screenshot. What are the numbers on the right?

clawrie commented 9 years ago

There's a partial screen capture in my previous message. Are the numbers on the right the 115.12 MB of 1024 MB and 408kB of 1024MB?? I can't see any other numbers. If so, it's used vs allocated disk space.

On Thu, Feb 19, 2015 at 4:52 PM, Ilia Rostovtsev notifications@github.com wrote:

Thanks. Great. No need for test login. Could you please take a screenshot. What are the numbers on the right?

— Reply to this email directly or view it on GitHub https://github.com/qooob/authentic-theme/issues/110#issuecomment-75004500 .

dreamrae commented 9 years ago

Hi! I'm experiencing the same issue. Below is the requested information:

$VAR1 = { 'value' => '612.75 MB of 5 GB', 'chart' => [ '5368709120', 642482176, 32768 ], 'desc' => 'tld_domain.dns' }; $VAR1 = { 'desc' => 'tld_domain.dns2', 'chart' => [ '5368709120', 212992, 32768 ], 'value' => '240 kB of 1024 MB' }; $VAR1 = { 'desc' => 'tld_domain.dns3', 'chart' => [ '5368709120', 196608, 32768 ], 'value' => '224 kB of 1024 MB' }; $VAR1 = { 'desc' => 'tld_domain.dns4', 'chart' => [ '5368709120', 204800, 8192 ], 'value' => '208 kB of 1024 MB' };

quotas

iliajie commented 9 years ago

Alright, guys! Seems like I got it. Please test it. Replace authentic-lib.cgi in with the updated one: https://rostovtsev.ru/pub/src/authentic/9.5.0-patches/authentic-lib.cgi

dreamrae commented 9 years ago

So glad I could help! Thank you Mr. Rostovtsev!

iliajie commented 9 years ago

Could you please test it? It should display correct information now. Is it?

dreamrae commented 9 years ago

Tested - It is working!

quotas

iliajie commented 9 years ago

Ohh, yeah!! :) Now let's see what @clawrie says! I think it should also work fine!

Great, thank you guys!

clawrie commented 9 years ago

Hi Ilia

That looks to have fixed the issue - thanks very much.

Craig

On Fri, Feb 20, 2015 at 5:16 AM, Ilia Rostovtsev notifications@github.com wrote:

Ohh, yeah!! :) Now let's see what @clawrie https://github.com/clawrie says! I think it should also work fine!

Great, thank you guys!

— Reply to this email directly or view it on GitHub https://github.com/qooob/authentic-theme/issues/110#issuecomment-75111173 .

iliajie commented 9 years ago

Great! Thanks for reporting!

7starsone commented 9 years ago

to me is wrong yet... 168.40 MB of 2 GB reports as 0% while it should be at least 8%

iliajie commented 9 years ago

Print an array please.

7starsone commented 9 years ago

$VAR1 = { 'chart' => [ '137438953472', 3525713920, 6193991680 ], 'value' => '9.05 GB', 'desc' => '<a class=\'ui_link\' href=\'/virtual-server/edit_domain.cgi?dom=141676138110898\'>domain.tld' };

$VAR1 = { 'chart' => [ '137438953472', 4671164416, 8192 ], 'value' => '4.35 GB', 'desc' => '<a class=\'ui_link\' href=\'/virtual-server/edit_domain.cgi?dom=14167606569562\'>domain2.tld' };

$VAR1 = { 'chart' => [ '137438953472', 176570368, 8192 ], 'value' => '168.40 MB of 2 GB', 'desc' => '<a class=\'ui_link\' href=\'/virtual-server/edit_domain.cgi?dom=141341030325393\'>domain3.tld' }; $VAR1 = { 'chart' => [ '137438953472', 171589632, 1536000 ], 'value' => '165.11 MB of 128 GB', 'desc' => '<a class=\'ui_link\' href=\'/virtual-server/edit_domain.cgi?dom=141676097010212\'>domain4.tld' }; $VAR1 = { 'chart' => [ '137438953472', 56614912, 839680 ], 'value' => '54.79 MB of 2 GB', 'desc' => '<a class=\'ui_link\' href=\'/virtual-server/edit_domain.cgi?dom=141328307217527\'>domain5.tld' };

$VAR1 = { 'chart' => [ '137438953472', 479232, 118784 ], 'value' => '584 kB of 4 GB', 'desc' => '<a class=\'ui_link\' href=\'/virtual-server/edit_domain.cgi?dom=14235034509552\'>domain6.tld' };

.....

iliajie commented 9 years ago

Look:

$VAR1 = {
'chart' => [
'137438953472',
479232,
118784
],
'value' => '584 kB of 4 GB',
'desc' => 'domain6.tld'
};

It's totally wrong. Total value (the first one) is never right? I will report it to Webmin developers.

7starsone commented 9 years ago

I don't know... 137438953472 is the total value of what? are they bytes? I have 7 account plans (one of which is the default plan with everything Unlimited, for my personal domain(s) ) and the max plan for users is a 128GB disk quota, instead... but what has this to do with that total value? or isn't related?

iliajie commented 9 years ago

Where do you see of 4 GB on the array. It's not there.. What default theme shows?

7starsone commented 9 years ago

Virtualmin framed theme reports the same: 584 kB of 4 GB

iliajie commented 9 years ago

I would call it a bug. Will see what Jamie says.

iliajie commented 9 years ago

@7starsone I reported it to Webmin. Please join the conversation above to report your operation system version and probably other info if Jamie asks.

iliajie commented 9 years ago

@7starsone Alright, could you please open sysinfo.cgi of Authentic Theme and replace &list_combined_system_info() with &list_combined_system_info({'qshow', 1})

7starsone commented 9 years ago

done, nothing changed... 0% yet (cleared the cookies, recollected system status...)

iliajie commented 9 years ago

Hmm.. Let's wait what Jamie says. Thanks!

iliajie commented 9 years ago

Do you mount anything to /home folder or anywhere else?

7starsone commented 9 years ago

Image of filesystem

iliajie commented 9 years ago

I will fix it very soon in version 10.0.0.

clawrie commented 9 years ago

Great. Looking forward to it.

iliajie commented 9 years ago

@7starsone I think the reason for the bandwidth problem is in Virtualmin 4.14. I tested it with Virtualmin pre-release 4.15 and all was fine. Let's please wait. I think it will fix the problem.. but I would like to see the screenshot for the bandwidth, as I never seen it on the System Information Page.

7starsone commented 9 years ago

ok, the first domain has bandwidth _unlimited_ Image of bandw

iliajie commented 9 years ago

How does it show in Virtualmin theme? I would guess the same? If so, please report it to Webmin thread right now.

iliajie commented 9 years ago

Ahh, OK. No. It's gonna be fixed in Virtualmin 4.15, I think it's out today. ;)

7starsone commented 9 years ago

I don't see bandwidth on 4.14 Virtualmin framed theme... when it comes to Quota i get this error

Error - Perl execution failed
Illegal division by zero at /usr/libexec/webmin/virtual-server-theme/newright.cgi line 104.

is it related?

iliajie commented 9 years ago

No worries. It will be fixed in Virtualmin 4.15. I will report a bug for you to Virtualmin.

7starsone commented 9 years ago

still issues with 4.15, now I see _not unlimited_ domains only (and this is _good_...) _BUT_... Image of q15 Image of b15

iliajie commented 9 years ago

Restarted Webmin? ;)

iliajie commented 9 years ago

...and 170mb out of 2gb = ~8% - where is the problem here?

7starsone commented 9 years ago

yes and.. no, the problems are all the 2% values.... not always correct

iliajie commented 9 years ago

Yes, actually it is.. Hmm.. Ok, can you print the array again? That is wierd.. It's all correct on my server..

7starsone commented 9 years ago

e.g.

$VAR1 = {
          'chart' => [
                       100,
                       0,
                       0
                     ],
          'value' => '165.11 MB&nbsp;of&nbsp;128 GB',
          'desc' => '<a class=\'ui_link\' href=\'/virtual-server/edit_domain.cgi?dom=141676097010212\'>domain.net</a>'
        };
7starsone commented 9 years ago

that should be correct and i don't understand... i cleared cache and restarted webmin.. there's something still to be fixed

7starsone commented 9 years ago
[root@myhost ~]# quota thatuser
Disk quotas for user thatuser (uid 506):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
       /dev/md2  167836  134217728 134217728            4533       0       0
iliajie commented 9 years ago

authentic-lib.cgi, line 340

replace $chart_percent

with $t->{'chart'}[1]

Does it work?