From 0f8f826b14eb20bfceaae4c448aae83319ed136d Mon Sep 17 00:00:00 2001
From: qwertyforce <44163887+qwertyforce@users.noreply.github.com>
Date: Wed, 16 Sep 2020 16:18:20 +0300
Subject: [PATCH] more stats
---
pages/stats.tsx | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/pages/stats.tsx b/pages/stats.tsx
index c0e858d..4b70cd0 100644
--- a/pages/stats.tsx
+++ b/pages/stats.tsx
@@ -10,7 +10,9 @@ export default function Index(props: any) {
Total Images: {props.number_of_images}
Total Authors: {props.number_of_authors}
- Total tags: {props.number_of_tags}
+ Total Tags: {props.number_of_tags}
+ Images deleted: {props.number_of_deleted}
+ ID of the last image: {props.last_image_id}
);
}
@@ -19,6 +21,7 @@ export const getStaticProps: GetStaticProps = async () => {
const imgs = await db_ops.image_ops.get_all_images()
const authors = new Set()
const tags = new Set()
+ const id_of_last_image=imgs[imgs.length-1].id
for (const img of imgs) {
authors.add(img.author)
for (const tag of img.tags) {
@@ -30,6 +33,8 @@ export const getStaticProps: GetStaticProps = async () => {
number_of_images: imgs.length,
number_of_authors: authors.size,
number_of_tags: tags.size,
+ number_of_deleted:id_of_last_image-imgs.length,
+ last_image_id:id_of_last_image
},
revalidate:5*60 //5 min
}