Announcement

  •  » Requests
  •  » Dashboard: Show free space left (nice to have)

#1 2023-11-12 15:17:00

matthys
Member
2014-04-02
188

Dashboard: Show free space left (nice to have)

On the Dashboard I see Storage with Photos and Cache. But I really would like to see the free space left on the data location. I think it should not be that difficult, right?

Just my request for 'nice to have' ....

Thanks,
Matthijs

PS .. I did a search on "free space" but was not really helpful :-(

Offline

 

#2 2023-11-12 23:15:18

erAck
Only trying to help
2015-09-06
2043

Re: Dashboard: Show free space left (nice to have)

Determining free and available storage space isn't as easy, if possible at all; think of shared hosting, 12TB free disk space but limited to 50GB in your hosting plan, for example. And no, that's not in ulimit nor in PHP limits.

Of course, if you're interested in the raw free disk capacity then you could add the return value of PHP

disk_free_space($conf['data_location'])

somewhere near the end of admin/intro.php and pass it to the admin/themes/default/template/intro.tpl template similar to what is done for STORAGE_TOTAL and add output code for that to the template.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2023-11-13 05:18:16

matthys
Member
2014-04-02
188

Re: Dashboard: Show free space left (nice to have)

Yes, and therefore editing the admin template via LocalFiles Editor would be 'nice to have' as well :-)

Thought I do not see the problem with shared hosting, as the space limit is there in the first place (as volume assigned).

Offline

 

#4 2023-11-13 15:13:29

erAck
Only trying to help
2015-09-06
2043

Re: Dashboard: Show free space left (nice to have)

With your shared hosting maybe, I looked at two different providers and there's no hard volume limit nor a dedicated volume assigned.

You can use this

Code:

<?php
echo php_uname() . "\n";
echo "Disk: " . disk_free_space('./') . "\n";
echo system('ulimit -a') . "\n";
print_r(posix_getrlimit());
echo "\n";
?>

PHP code to display your limits from either command line or HTML (then looks better (with linefeeds) when the result is viewed as source..).


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2023-11-13 15:41:26

matthys
Member
2014-04-02
188

Re: Dashboard: Show free space left (nice to have)

I have cloud shared hosting and it's just a virtual machine with 1 volume, your code gives:

Code:

Linux xxxxxxx 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64
Disk: 19084845056
time(seconds)        unlimited
file(blocks)         unlimited
data(kbytes)         unlimited
stack(kbytes)        8192
coredump(blocks)     0
memory(kbytes)       unlimited
locked memory(kbytes) 245216
process              7480
nofiles              1024
vmemory(kbytes)      unlimited
locks                unlimited
rtprio               0
rtprio               0
Array
(
    [soft core] => 0
    [hard core] => 0
    [soft data] => unlimited
    [hard data] => unlimited
    [soft stack] => 8388608
    [hard stack] => unlimited
    [soft totalmem] => unlimited
    [hard totalmem] => unlimited
    [soft rss] => unlimited
    [hard rss] => unlimited
    [soft maxproc] => 7480
    [hard maxproc] => 7480
    [soft memlock] => 251101184
    [hard memlock] => 251101184
    [soft cpu] => unlimited
    [hard cpu] => unlimited
    [soft filesize] => unlimited
    [hard filesize] => unlimited
    [soft openfiles] => 1024
    [hard openfiles] => 1048576
)

And indeed I have 19 GB free disk space at the moment...


(removed hostname from the output above)

Last edited by matthys (2023-11-13 15:42:47)

Offline

 

#6 2023-12-22 07:23:53

noramila
Member
India
2023-08-29
8

Re: Dashboard: Show free space left (nice to have)

Look for an option free space or disk usage. If this option isn't readily visible, consider exploring settings and you can see from there.

Offline

 
  •  » Requests
  •  » Dashboard: Show free space left (nice to have)

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact