Display quota in user dashboard

Hello, so i create package with quota specific space and bandwith, and i add user to this package. But when i login with user account, i can’t see my quota.

Is there a way to display user quota on their dashboard page? like: use 200MB/5000MB space & 1200Mb/100000MB bandwith.

thanks

2 Likes

is there any way i can change the template to display this?
i need this so my clients can see what limits they are getting

Yes, this is very easy! Just modify the file /usr/local/hestia/web/templates/includes/panel.php

Look for this part on line 36:

<span class="u-text-bold">
<?= humanize_usage_size($panel[$user]["U_DISK"]) ?>
</span>
<?= humanize_usage_measure($panel[$user]["U_DISK"]) ?>

And after that, add a slash (or whatever divider you like) and repeat those lines with “DISK_QUOTA” in place of “U_DISK”, like this:

<span class="u-text-bold">
<?= humanize_usage_size($panel[$user]["U_DISK"]) ?>
</span>
<?= humanize_usage_measure($panel[$user]["U_DISK"]) ?>
/
<span class="u-text-bold">
<?= humanize_usage_size($panel[$user]["DISK_QUOTA"]) ?>
</span>
<?= humanize_usage_measure($panel[$user]["DISK_QUOTA"]) ?>

Now it shows “1.86gb / 10.00gb” at the top of the control panel instead of just “1.86gb” !

Of course, now that you have modified this core file, you will need to remember re-do this change after future updates, as future updates will potentially overwrite this file.

This would be a very nice PR for someone to add to the github so that it becomes an official part of the code. I doubt that anyone would have any good reason for not including the quota for the customer to see there.

1 Like

Feel free to open that PR yourself :wink:

If you don’t use GitHub or don’t know how to open a PR, let me know and I’ll open it on your behalf.

Following @jojo’s code, I’ve also added the bandwidth.

imagen

                                                <span class="top-bar-usage-item">
                                                        <i class="fas fa-hard-drive" title="<?= _("Disk") ?>: <?= humanize_usage_size($panel[$user]["U_DISK"]) ?> <?= humanize_usage_measure($panel[$user]["U_DISK"]) ?>"></i>
                                                        <span class="u-text-bold">
                                                                <?= humanize_usage_size($panel[$user]["U_DISK"]) ?>
                                                        </span>
                                                        <?= humanize_usage_measure($panel[$user]["U_DISK"]) ?>
                                                        /
                                                        <span class="u-text-bold">
                                                        <?= humanize_usage_size($panel[$user]["DISK_QUOTA"]) ?>
                                                        </span>
                                                        <?= humanize_usage_measure($panel[$user]["DISK_QUOTA"]) ?>
                                                </span>
                                                <span class="top-bar-usage-item">
                                                        <i class="fas fa-right-left" title="<?= _("Bandwidth") ?>: <?= humanize_usage_size($panel[$user]["U_BANDWIDTH"]) ?> <?= humanize_usage_measure($panel[$user]["U_BANDWIDTH"]) ?>"></i>
                                                        <span class="u-text-bold">
                                                                <?= humanize_usage_size($panel[$user]["U_BANDWIDTH"]) ?>
                                                        </span>
                                                        <?= humanize_usage_measure($panel[$user]["U_BANDWIDTH"]) ?>
                                                        /
                                                        <span class="u-text-bold">
                                                                <?= humanize_usage_size($panel[$user]["BANDWIDTH"]) ?>
                                                        </span>
                                                        <?= humanize_usage_measure($panel[$user]["BANDWIDTH"]) ?>
                                                </span>

1 Like

Please, go ahead.

Done

2 Likes