summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-05-07 14:45:27 +0500
committerilotterytea <iltsu@alright.party>2025-05-07 14:45:27 +0500
commit2d06d465e80d9d115641f2ed1ff9ed294da0b38c (patch)
tree08968bc9a7cd6ab7020d05f2b9ff19332488319a /public
parent71937e5897c3dea1c418e4ebbd5ebd4c9f762b89 (diff)
feat: show active content size
Diffstat (limited to 'public')
-rw-r--r--public/index.php20
-rw-r--r--public/static/style.css4
2 files changed, 21 insertions, 3 deletions
diff --git a/public/index.php b/public/index.php
index ba0be34..c86dd46 100644
--- a/public/index.php
+++ b/public/index.php
@@ -47,10 +47,24 @@ authorize_user();
?>
</div>
- <p style="font-size:12px;">
- Serving <?php echo $count ?> gorillion emotes -
- Running
+ <p class="font-small">
<?php
+ // cv pasted from https://gist.github.com/eusonlito/5099936
+ function size($dir)
+ {
+ $size = 0;
+
+ foreach (glob(rtrim($dir, '/') . '/*') as $each) {
+ $size += is_file($each) ? filesize($each) : size($each);
+ }
+
+ return $size;
+ }
+
+ echo "Serving $count gorillion emotes and ";
+
+ echo sprintf("%.2f", size("./static/userdata") / 1024 / 1024) . 'MB of active content - Running ';
+
echo '<a href="' . TINYEMOTES_LINK . '">';
echo sprintf("%s v%s", TINYEMOTES_NAME, TINYEMOTES_VERSION);
echo '</a> ';
diff --git a/public/static/style.css b/public/static/style.css
index f39fc2c..1398a34 100644
--- a/public/static/style.css
+++ b/public/static/style.css
@@ -489,4 +489,8 @@ a.box:hover {
.center {
justify-content: center;
align-items: center;
+}
+
+.font-small {
+ font-size: 12px;
} \ No newline at end of file