From 0cf5051cf8147b98a93efc64583ab5f4e25b0ebd Mon Sep 17 00:00:00 2001 From: Paul Stenius Date: Mon, 3 Mar 2025 20:08:01 -0500 Subject: [PATCH] feat: show size of DB on the about page --- internal/locale/translations/de_DE.json | 17 +++++++++-------- internal/locale/translations/el_EL.json | 17 +++++++++-------- internal/locale/translations/en_US.json | 1 + internal/locale/translations/es_ES.json | 17 +++++++++-------- internal/locale/translations/fi_FI.json | 17 +++++++++-------- internal/locale/translations/fr_FR.json | 17 +++++++++-------- internal/locale/translations/hi_IN.json | 17 +++++++++-------- internal/locale/translations/id_ID.json | 15 ++++++++------- internal/locale/translations/it_IT.json | 17 +++++++++-------- internal/locale/translations/ja_JP.json | 15 ++++++++------- .../locale/translations/nan_Latn_pehoeji.json | 15 ++++++++------- internal/locale/translations/nl_NL.json | 17 +++++++++-------- internal/locale/translations/pl_PL.json | 19 ++++++++++--------- internal/locale/translations/pt_BR.json | 17 +++++++++-------- internal/locale/translations/ru_RU.json | 19 ++++++++++--------- internal/locale/translations/tr_TR.json | 17 +++++++++-------- internal/locale/translations/uk_UA.json | 19 ++++++++++--------- internal/locale/translations/zh_CN.json | 1 + internal/locale/translations/zh_TW.json | 15 ++++++++------- internal/storage/storage.go | 12 ++++++++++++ internal/template/templates/views/about.html | 1 + internal/ui/about.go | 8 ++++++++ 22 files changed, 175 insertions(+), 135 deletions(-) diff --git a/internal/locale/translations/de_DE.json b/internal/locale/translations/de_DE.json index 7940fbff..7d3db07e 100644 --- a/internal/locale/translations/de_DE.json +++ b/internal/locale/translations/de_DE.json @@ -401,6 +401,7 @@ "page.about.author": "Autor:", "page.about.build_date": "Datum der Kompilierung:", "page.about.credits": "Urheberrechte", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Globale Konfigurationsoptionen", "page.about.go_version": "Go-Version:", "page.about.license": "Lizenz:", @@ -420,10 +421,6 @@ "page.api_keys.table.last_used_at": "Zuletzt verwendeten", "page.api_keys.table.token": "Zeichen", "page.api_keys.title": "API-Schlüssel", - "page.categories_count": [ - "%d Kategorie", - "%d Kategorien" - ], "page.categories.entries": "Artikel", "page.categories.feed_count": [ "Es gibt %d Abonnement.", @@ -432,6 +429,10 @@ "page.categories.feeds": "Abonnements", "page.categories.no_feed": "Kein Abonnement.", "page.categories.title": "Kategorien", + "page.categories_count": [ + "%d Kategorie", + "%d Kategorien" + ], "page.category_label": "Kategorie: %s", "page.edit_category.title": "Kategorie bearbeiten: %s", "page.edit_feed.etag_header": "ETag-Kopfzeile:", @@ -537,25 +538,25 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "Hauptschlüssel registrieren", "page.settings.webauthn.register.error": "Hauptschlüssel kann nicht registriert werden", + "page.shared_entries.title": "Geteilte Artikel", "page.shared_entries_count": [ "%d geteilter Artikel", "%d geteilte Artikel" ], - "page.shared_entries.title": "Geteilte Artikel", + "page.starred.title": "Lesezeichen", "page.starred_entry_count": [ "%d Lesezeichen", "%d Lesezeichen" ], - "page.starred.title": "Lesezeichen", "page.total_entry_count": [ "%d Artikel insgesamt", "%d Artikel insgesamt" ], + "page.unread.title": "Ungelesen", "page.unread_entry_count": [ "%d ungelesener Artikel", "%d ungelesene Artikel" ], - "page.unread.title": "Ungelesen", "page.users.actions": "Aktionen", "page.users.admin.no": "Nein", "page.users.admin.yes": "Ja", @@ -602,4 +603,4 @@ "time_elapsed.yesterday": "gestern", "tooltip.keyboard_shortcuts": "Tastenkürzel: %s", "tooltip.logged_user": "Angemeldet als %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/el_EL.json b/internal/locale/translations/el_EL.json index 2dddc71d..40b09ad3 100644 --- a/internal/locale/translations/el_EL.json +++ b/internal/locale/translations/el_EL.json @@ -401,6 +401,7 @@ "page.about.author": "Συγγραφέας:", "page.about.build_date": "Ημερομηνία Κατασκευής:", "page.about.credits": "Συνεισφέροντες", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Γενικές ρυθμίσεις", "page.about.go_version": "Έκδοση Go:", "page.about.license": "Άδεια:", @@ -420,10 +421,6 @@ "page.api_keys.table.last_used_at": "Τελευταία Χρήση", "page.api_keys.table.token": "Token", "page.api_keys.title": "Κλειδιά API", - "page.categories_count": [ - "%d category", - "%d categories" - ], "page.categories.entries": "Άρθρα", "page.categories.feed_count": [ "Υπάρχει μία %d ροή.", @@ -432,6 +429,10 @@ "page.categories.feeds": "Συνδρομές", "page.categories.no_feed": "Καμία ροή.", "page.categories.title": "Κατηγορίες", + "page.categories_count": [ + "%d category", + "%d categories" + ], "page.category_label": "Category: %s", "page.edit_category.title": "Επεξεργασία κατηγορίας: % s", "page.edit_feed.etag_header": "Κεφαλίδα ETag:", @@ -537,25 +538,25 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "Εγγραφή κωδικού πρόσβασης", "page.settings.webauthn.register.error": "Δεν είναι δυνατή η εγγραφή του κωδικού πρόσβασης", + "page.shared_entries.title": "Κοινόχρηστες Καταχωρήσεις", "page.shared_entries_count": [ "%d shared entry", "%d shared entries" ], - "page.shared_entries.title": "Κοινόχρηστες Καταχωρήσεις", + "page.starred.title": "Αγαπημένo", "page.starred_entry_count": [ "%d starred entry", "%d starred entries" ], - "page.starred.title": "Αγαπημένo", "page.total_entry_count": [ "%d entry in total", "%d entries in total" ], + "page.unread.title": "Μη αναγνωσμένα", "page.unread_entry_count": [ "%d unread entry", "%d unread entries" ], - "page.unread.title": "Μη αναγνωσμένα", "page.users.actions": "Eνέργειες", "page.users.admin.no": "Όχι", "page.users.admin.yes": "Ναι.", @@ -602,4 +603,4 @@ "time_elapsed.yesterday": "χθες", "tooltip.keyboard_shortcuts": "Συντόμευση πληκτρολογίου: % s", "tooltip.logged_user": "Συνδεδεμένος/η ως %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/en_US.json b/internal/locale/translations/en_US.json index e5d21459..26fcf685 100644 --- a/internal/locale/translations/en_US.json +++ b/internal/locale/translations/en_US.json @@ -401,6 +401,7 @@ "page.about.author": "Author:", "page.about.build_date": "Build Date:", "page.about.credits": "Credits", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Global configuration options", "page.about.go_version": "Go version:", "page.about.license": "License:", diff --git a/internal/locale/translations/es_ES.json b/internal/locale/translations/es_ES.json index dd968a6c..014a4cc5 100644 --- a/internal/locale/translations/es_ES.json +++ b/internal/locale/translations/es_ES.json @@ -401,6 +401,7 @@ "page.about.author": "Autor:", "page.about.build_date": "Fecha de compilación:", "page.about.credits": "Créditos", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Opciones de configuración global", "page.about.go_version": "Go versión:", "page.about.license": "Licencia:", @@ -420,10 +421,6 @@ "page.api_keys.table.last_used_at": "Último utilizado", "page.api_keys.table.token": "simbólico", "page.api_keys.title": "Claves API", - "page.categories_count": [ - "%d categoría", - "%d categorías" - ], "page.categories.entries": "Artículos", "page.categories.feed_count": [ "Hay %d fuente.", @@ -432,6 +429,10 @@ "page.categories.feeds": "Fuentes", "page.categories.no_feed": "Sin fuente.", "page.categories.title": "Categorías", + "page.categories_count": [ + "%d categoría", + "%d categorías" + ], "page.category_label": "Categoría: %s", "page.edit_category.title": "Editar categoría: %s", "page.edit_feed.etag_header": "Cabecera de ETag:", @@ -537,25 +538,25 @@ "page.settings.webauthn.passkeys": "Claves de acceso", "page.settings.webauthn.register": "Registrar clave de acceso", "page.settings.webauthn.register.error": "No se puede registrar la clave de acceso", + "page.shared_entries.title": "Artículos compartidos", "page.shared_entries_count": [ "%d artículo compartido", "%d artículos compartidos" ], - "page.shared_entries.title": "Artículos compartidos", + "page.starred.title": "Marcadores", "page.starred_entry_count": [ "%d artículo marcado", "%d artículos marcados" ], - "page.starred.title": "Marcadores", "page.total_entry_count": [ "%d artículo en total", "%d artículos en total" ], + "page.unread.title": "No leídos", "page.unread_entry_count": [ "%d artículo no leído", "%d artículos no leídos" ], - "page.unread.title": "No leídos", "page.users.actions": "Acciones", "page.users.admin.no": "No", "page.users.admin.yes": "Sí", @@ -602,4 +603,4 @@ "time_elapsed.yesterday": "ayer", "tooltip.keyboard_shortcuts": "Atajo de teclado: %s", "tooltip.logged_user": "Registrado como %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/fi_FI.json b/internal/locale/translations/fi_FI.json index 44ec8e5c..2c094fb0 100644 --- a/internal/locale/translations/fi_FI.json +++ b/internal/locale/translations/fi_FI.json @@ -401,6 +401,7 @@ "page.about.author": "Tekijä:", "page.about.build_date": "Valmistuspäivä:", "page.about.credits": "Kiitokset", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Yleiset asetukset", "page.about.go_version": "Go-versio:", "page.about.license": "Lisenssi:", @@ -420,10 +421,6 @@ "page.api_keys.table.last_used_at": "Viimeksi käytetty", "page.api_keys.table.token": "Tunnus", "page.api_keys.title": "API-avaimet", - "page.categories_count": [ - "%d category", - "%d categories" - ], "page.categories.entries": "Artikkelit", "page.categories.feed_count": [ "On %d syöte.", @@ -432,6 +429,10 @@ "page.categories.feeds": "Tilaukset", "page.categories.no_feed": "Ei syötettä.", "page.categories.title": "Kategoriat", + "page.categories_count": [ + "%d category", + "%d categories" + ], "page.category_label": "Category: %s", "page.edit_category.title": "Muokkaa kategoria: %s", "page.edit_feed.etag_header": "ETag-otsikko:", @@ -537,25 +538,25 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "Rekisteröi salasana", "page.settings.webauthn.register.error": "Salasanaa ei voi rekisteröidä", + "page.shared_entries.title": "Jaetut artikkelit", "page.shared_entries_count": [ "%d shared entry", "%d shared entries" ], - "page.shared_entries.title": "Jaetut artikkelit", + "page.starred.title": "Suosikit", "page.starred_entry_count": [ "%d starred entry", "%d starred entries" ], - "page.starred.title": "Suosikit", "page.total_entry_count": [ "%d entry in total", "%d entries in total" ], + "page.unread.title": "Lukemattomat", "page.unread_entry_count": [ "%d unread entry", "%d unread entries" ], - "page.unread.title": "Lukemattomat", "page.users.actions": "Toiminnot", "page.users.admin.no": "Ei", "page.users.admin.yes": "Kyllä", @@ -602,4 +603,4 @@ "time_elapsed.yesterday": "eilen", "tooltip.keyboard_shortcuts": "Pikanäppäin: %s", "tooltip.logged_user": "Kirjautunut %s-käyttäjänä" -} \ No newline at end of file +} diff --git a/internal/locale/translations/fr_FR.json b/internal/locale/translations/fr_FR.json index f75b876a..d58a80b8 100644 --- a/internal/locale/translations/fr_FR.json +++ b/internal/locale/translations/fr_FR.json @@ -401,6 +401,7 @@ "page.about.author": "Auteur :", "page.about.build_date": "Date de la compilation :", "page.about.credits": "Crédits", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Options de configuration globales", "page.about.go_version": "Version de Go :", "page.about.license": "Licence :", @@ -420,10 +421,6 @@ "page.api_keys.table.last_used_at": "Dernière utilisation", "page.api_keys.table.token": "Jeton", "page.api_keys.title": "Clés d'API", - "page.categories_count": [ - "%d catégorie", - "%d catégories" - ], "page.categories.entries": "Articles", "page.categories.feed_count": [ "Il y a %d abonnement.", @@ -432,6 +429,10 @@ "page.categories.feeds": "Abonnements", "page.categories.no_feed": "Aucun abonnement.", "page.categories.title": "Catégories", + "page.categories_count": [ + "%d catégorie", + "%d catégories" + ], "page.category_label": "Catégorie : %s", "page.edit_category.title": "Modification de la catégorie : %s", "page.edit_feed.etag_header": "En-tête ETag :", @@ -537,25 +538,25 @@ "page.settings.webauthn.passkeys": "Clés d’accès", "page.settings.webauthn.register": "Enregister une nouvelle clé d’accès", "page.settings.webauthn.register.error": "Impossible d'enregistrer la clé d’accès", + "page.shared_entries.title": "Articles partagés", "page.shared_entries_count": [ "%d article partagé", "%d articles partagés" ], - "page.shared_entries.title": "Articles partagés", + "page.starred.title": "Favoris", "page.starred_entry_count": [ "%d favori", "%d favoris" ], - "page.starred.title": "Favoris", "page.total_entry_count": [ "%d article au total", "%d articles au total" ], + "page.unread.title": "Non lus", "page.unread_entry_count": [ "%d article non lu", "%d articles non lus" ], - "page.unread.title": "Non lus", "page.users.actions": "Actions", "page.users.admin.no": "Non", "page.users.admin.yes": "Oui", @@ -602,4 +603,4 @@ "time_elapsed.yesterday": "hier", "tooltip.keyboard_shortcuts": "Raccourci clavier : %s", "tooltip.logged_user": "Connecté en tant que %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/hi_IN.json b/internal/locale/translations/hi_IN.json index 21276e62..52994d48 100644 --- a/internal/locale/translations/hi_IN.json +++ b/internal/locale/translations/hi_IN.json @@ -401,6 +401,7 @@ "page.about.author": "रचयिता:", "page.about.build_date": "बनाने की तिथि:", "page.about.credits": "आभार सूची", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "वैश्विक विन्यास विकल्प", "page.about.go_version": "गो संस्करण:", "page.about.license": "अनुज्ञा:", @@ -420,10 +421,6 @@ "page.api_keys.table.last_used_at": "आखरी इस्त्तमाल किया गया", "page.api_keys.table.token": "टोकन", "page.api_keys.title": "एपीआई कुंजी", - "page.categories_count": [ - "%d category", - "%d categories" - ], "page.categories.entries": "विषयवस्तुया", "page.categories.feed_count": [ "%d फ़ीड बाकी है।", @@ -432,6 +429,10 @@ "page.categories.feeds": "सदस्यता ले", "page.categories.no_feed": "कोई फ़ीड नहीं है।", "page.categories.title": "श्रेणियाँ", + "page.categories_count": [ + "%d category", + "%d categories" + ], "page.category_label": "Category: %s", "page.edit_category.title": "%s श्रेणी संपाद करे", "page.edit_feed.etag_header": "ईटाग हैडर:", @@ -537,25 +538,25 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "रजिस्टर पासकी", "page.settings.webauthn.register.error": "पासकी पंजीकृत करने में असमर्थ", + "page.shared_entries.title": "साझा किया हुआ प्रविष्टि", "page.shared_entries_count": [ "%d shared entry", "%d shared entries" ], - "page.shared_entries.title": "साझा किया हुआ प्रविष्टि", + "page.starred.title": "तारांकित", "page.starred_entry_count": [ "%d starred entry", "%d starred entries" ], - "page.starred.title": "तारांकित", "page.total_entry_count": [ "%d entry in total", "%d entries in total" ], + "page.unread.title": "अपठित", "page.unread_entry_count": [ "%d unread entry", "%d unread entries" ], - "page.unread.title": "अपठित", "page.users.actions": "कार्रवाई", "page.users.admin.no": "नहीं", "page.users.admin.yes": "हां", @@ -602,4 +603,4 @@ "time_elapsed.yesterday": "कल", "tooltip.keyboard_shortcuts": "कुंजीपटल संक्षिप्त रीति: %s", "tooltip.logged_user": "%s के रूप में लॉग इन किया" -} \ No newline at end of file +} diff --git a/internal/locale/translations/id_ID.json b/internal/locale/translations/id_ID.json index 4b884157..a377b32d 100644 --- a/internal/locale/translations/id_ID.json +++ b/internal/locale/translations/id_ID.json @@ -399,6 +399,7 @@ "page.about.author": "Pengembang:", "page.about.build_date": "Tanggal Penyusunan:", "page.about.credits": "Pengembang", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Pengaturan Konfigurasi Global", "page.about.go_version": "Versi Go:", "page.about.license": "Lisensi:", @@ -418,9 +419,6 @@ "page.api_keys.table.last_used_at": "Terakhir Digunakan", "page.api_keys.table.token": "Token", "page.api_keys.title": "Kunci API", - "page.categories_count": [ - "%d category" - ], "page.categories.entries": "Artikel", "page.categories.feed_count": [ "Ada %d umpan." @@ -428,6 +426,9 @@ "page.categories.feeds": "Langganan", "page.categories.no_feed": "Tidak ada umpan.", "page.categories.title": "Kategori", + "page.categories_count": [ + "%d category" + ], "page.category_label": "Category: %s", "page.edit_category.title": "Sunting Kategori: %s", "page.edit_feed.etag_header": "Tajuk ETag:", @@ -530,21 +531,21 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "Register passkey", "page.settings.webauthn.register.error": "Unable to register passkey", + "page.shared_entries.title": "Entri yang Dibagikan", "page.shared_entries_count": [ "%d shared entry" ], - "page.shared_entries.title": "Entri yang Dibagikan", + "page.starred.title": "Markah", "page.starred_entry_count": [ "%d starred entry" ], - "page.starred.title": "Markah", "page.total_entry_count": [ "%d entry in total" ], + "page.unread.title": "Belum Dibaca", "page.unread_entry_count": [ "%d unread entry" ], - "page.unread.title": "Belum Dibaca", "page.users.actions": "Tindakan", "page.users.admin.no": "Tidak", "page.users.admin.yes": "Ya", @@ -585,4 +586,4 @@ "time_elapsed.yesterday": "kemarin", "tooltip.keyboard_shortcuts": "Pintasan Papan Tik: %s", "tooltip.logged_user": "Masuk sebagai %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/it_IT.json b/internal/locale/translations/it_IT.json index 637ef890..5a66eb51 100644 --- a/internal/locale/translations/it_IT.json +++ b/internal/locale/translations/it_IT.json @@ -401,6 +401,7 @@ "page.about.author": "Autore:", "page.about.build_date": "Data della build:", "page.about.credits": "Crediti", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Opzioni di configurazione globali", "page.about.go_version": "Go versione:", "page.about.license": "Licenza:", @@ -420,10 +421,6 @@ "page.api_keys.table.last_used_at": "Ultimo uso", "page.api_keys.table.token": "Gettone", "page.api_keys.title": "Chiavi API", - "page.categories_count": [ - "%d category", - "%d categories" - ], "page.categories.entries": "Articoli", "page.categories.feed_count": [ "C'è %d feed.", @@ -432,6 +429,10 @@ "page.categories.feeds": "Abbonamenti", "page.categories.no_feed": "Nessun feed.", "page.categories.title": "Categorie", + "page.categories_count": [ + "%d category", + "%d categories" + ], "page.category_label": "Category: %s", "page.edit_category.title": "Modifica categoria: %s", "page.edit_feed.etag_header": "Header ETag:", @@ -537,25 +538,25 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "Registra la chiave di accesso", "page.settings.webauthn.register.error": "Impossibile registrare la passkey", + "page.shared_entries.title": "Voci condivise", "page.shared_entries_count": [ "%d shared entry", "%d shared entries" ], - "page.shared_entries.title": "Voci condivise", + "page.starred.title": "Preferiti", "page.starred_entry_count": [ "%d starred entry", "%d starred entries" ], - "page.starred.title": "Preferiti", "page.total_entry_count": [ "%d entry in total", "%d entries in total" ], + "page.unread.title": "Da leggere", "page.unread_entry_count": [ "%d unread entry", "%d unread entries" ], - "page.unread.title": "Da leggere", "page.users.actions": "Azioni", "page.users.admin.no": "No", "page.users.admin.yes": "Sì", @@ -602,4 +603,4 @@ "time_elapsed.yesterday": "ieri", "tooltip.keyboard_shortcuts": "Scorciatoia da tastiera: %s", "tooltip.logged_user": "Autenticato come %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/ja_JP.json b/internal/locale/translations/ja_JP.json index 301ac7f8..65ff5b61 100644 --- a/internal/locale/translations/ja_JP.json +++ b/internal/locale/translations/ja_JP.json @@ -399,6 +399,7 @@ "page.about.author": "作者:", "page.about.build_date": "ビルド日時:", "page.about.credits": "著作権表示", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "グローバル構成オプション", "page.about.go_version": "Go バージョン:", "page.about.license": "ライセンス:", @@ -418,9 +419,6 @@ "page.api_keys.table.last_used_at": "最終使用", "page.api_keys.table.token": "トークン", "page.api_keys.title": "API キー", - "page.categories_count": [ - "%d category" - ], "page.categories.entries": "記事一覧", "page.categories.feed_count": [ "%d 件のフィードがあります。" @@ -428,6 +426,9 @@ "page.categories.feeds": "フィード一覧", "page.categories.no_feed": "フィードはありません。", "page.categories.title": "カテゴリ", + "page.categories_count": [ + "%d category" + ], "page.category_label": "Category: %s", "page.edit_category.title": "カテゴリを編集: %s", "page.edit_feed.etag_header": "ETag ヘッダー:", @@ -530,21 +531,21 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "パスキーを登録する", "page.settings.webauthn.register.error": "パスキーを登録できません", + "page.shared_entries.title": "共有エントリ", "page.shared_entries_count": [ "%d shared entry" ], - "page.shared_entries.title": "共有エントリ", + "page.starred.title": "星付き", "page.starred_entry_count": [ "%d starred entry" ], - "page.starred.title": "星付き", "page.total_entry_count": [ "%d entry in total" ], + "page.unread.title": "未読", "page.unread_entry_count": [ "%d unread entry" ], - "page.unread.title": "未読", "page.users.actions": "アクション", "page.users.admin.no": "非管理者", "page.users.admin.yes": "管理者", @@ -585,4 +586,4 @@ "time_elapsed.yesterday": "昨日", "tooltip.keyboard_shortcuts": "キーボードショートカット: %s", "tooltip.logged_user": "%s としてログイン中" -} \ No newline at end of file +} diff --git a/internal/locale/translations/nan_Latn_pehoeji.json b/internal/locale/translations/nan_Latn_pehoeji.json index 606add45..1016ad62 100644 --- a/internal/locale/translations/nan_Latn_pehoeji.json +++ b/internal/locale/translations/nan_Latn_pehoeji.json @@ -399,6 +399,7 @@ "page.about.author": "Chok-chiá: ", "page.about.build_date": "Kiàn-tì li̍t-kî:", "page.about.credits": "Pán-koân", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Choân-he̍k siat-tēng soán-hāng", "page.about.go_version": "Go pán-pún:", "page.about.license": "Pàng-koân:", @@ -418,9 +419,6 @@ "page.api_keys.table.last_used_at": "Siōng-bóe pái sú-iōng", "page.api_keys.table.token": "Só-sî", "page.api_keys.title": "API só-sî", - "page.categories_count": [ - "%d ê lūi-pia̍t" - ], "page.categories.entries": "Siau-sit", "page.categories.feed_count": [ "Ū %d ê Siau-sit lâi-goân" @@ -428,6 +426,9 @@ "page.categories.feeds": "Siau-sit lâi-goân", "page.categories.no_feed": "Ah-bô siau-sit lâi-goân", "page.categories.title": "Lūi-pia̍t", + "page.categories_count": [ + "%d ê lūi-pia̍t" + ], "page.category_label": "Lūi-pia̍t: %s", "page.edit_category.title": "Pian-chi̍p lūi-pia̍t: %s", "page.edit_feed.etag_header": "ETag piau-thâu:", @@ -530,21 +531,21 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "Chù-chheh Passkey", "page.settings.webauthn.register.error": "Bô-hoat-tō͘ chù-chheh Passkey", + "page.shared_entries.title": "Hun-hióng kè ê siau-sit", "page.shared_entries_count": [ "Í-keng hun-hióng %d ê siau-sit" ], - "page.shared_entries.title": "Hun-hióng kè ê siau-sit", + "page.starred.title": "Siu-chông", "page.starred_entry_count": [ "%d ê siu-chông ê siau-sit" ], - "page.starred.title": "Siu-chông", "page.total_entry_count": [ "Lóng-chóng %d ê siau-sit" ], + "page.unread.title": "Ah-bōe tha̍k", "page.unread_entry_count": [ "%d ê siau-sit ah-bōe tha̍k" ], - "page.unread.title": "Ah-bōe tha̍k", "page.users.actions": "chhau-chok", "page.users.admin.no": "Hóⁿ", "page.users.admin.yes": "Sī", @@ -585,4 +586,4 @@ "time_elapsed.yesterday": "cha-hng", "tooltip.keyboard_shortcuts": "Khoài-sok khí:%s", "tooltip.logged_user": "Chit-má teng-lo̍k--ê: %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/nl_NL.json b/internal/locale/translations/nl_NL.json index ede96196..8e1c5958 100644 --- a/internal/locale/translations/nl_NL.json +++ b/internal/locale/translations/nl_NL.json @@ -401,6 +401,7 @@ "page.about.author": "Auteur:", "page.about.build_date": "Compilatiedatum:", "page.about.credits": "Credits", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Globale Configuratie Opties", "page.about.go_version": "Go versie:", "page.about.license": "Licentie:", @@ -420,10 +421,6 @@ "page.api_keys.table.last_used_at": "Laatst gebruikt", "page.api_keys.table.token": "Token", "page.api_keys.title": "API-sleutels", - "page.categories_count": [ - "%d categorie", - "%d categorieën" - ], "page.categories.entries": "Artikelen", "page.categories.feed_count": [ "Er is %d feed.", @@ -432,6 +429,10 @@ "page.categories.feeds": "Feeds", "page.categories.no_feed": "Geen feed.", "page.categories.title": "Categorieën", + "page.categories_count": [ + "%d categorie", + "%d categorieën" + ], "page.category_label": "Categorie: %s", "page.edit_category.title": "Bewerk categorie: %s", "page.edit_feed.etag_header": "ETAG header:", @@ -537,25 +538,25 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "Passkey registreren", "page.settings.webauthn.register.error": "Kan passkey niet registreren", + "page.shared_entries.title": "Gedeelde artikelen", "page.shared_entries_count": [ "%d gedeeld artikel", "%d gedeelde artikelen" ], - "page.shared_entries.title": "Gedeelde artikelen", + "page.starred.title": "Favorieten", "page.starred_entry_count": [ "%d favoriet artikel", "%d favoriete artikelen" ], - "page.starred.title": "Favorieten", "page.total_entry_count": [ "%d artikel totaal", "%d artikelen totaal" ], + "page.unread.title": "Ongelezen", "page.unread_entry_count": [ "%d ongelezen artikel", "%d ongelezen artikelen" ], - "page.unread.title": "Ongelezen", "page.users.actions": "Acties", "page.users.admin.no": "Nee", "page.users.admin.yes": "Ja", @@ -602,4 +603,4 @@ "time_elapsed.yesterday": "gisteren", "tooltip.keyboard_shortcuts": "Sneltoets: %s", "tooltip.logged_user": "Ingelogd als %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/pl_PL.json b/internal/locale/translations/pl_PL.json index 1f4488e7..84beeeca 100644 --- a/internal/locale/translations/pl_PL.json +++ b/internal/locale/translations/pl_PL.json @@ -403,6 +403,7 @@ "page.about.author": "Autor:", "page.about.build_date": "Data opracowania:", "page.about.credits": "Prawa autorskie", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Globalne opcje konfiguracji", "page.about.go_version": "Wersja Go:", "page.about.license": "Licencja:", @@ -422,11 +423,6 @@ "page.api_keys.table.last_used_at": "Ostatnio używane", "page.api_keys.table.token": "Token", "page.api_keys.title": "Klucze API", - "page.categories_count": [ - "%d kategoria", - "%d kategorie", - "%d kategorii" - ], "page.categories.entries": "Wpisy", "page.categories.feed_count": [ "Jest %d kanał.", @@ -436,6 +432,11 @@ "page.categories.feeds": "Kanały", "page.categories.no_feed": "Brak kanałów.", "page.categories.title": "Kategorie", + "page.categories_count": [ + "%d kategoria", + "%d kategorie", + "%d kategorii" + ], "page.category_label": "Kategoria: %s", "page.edit_category.title": "Edytuj kategorię: %s", "page.edit_feed.etag_header": "Nagłówek ETag:", @@ -544,29 +545,29 @@ "page.settings.webauthn.passkeys": "Klucze dostępu", "page.settings.webauthn.register": "Zarejestruj klucz dostępu", "page.settings.webauthn.register.error": "Nie można zarejestrować klucza dostępu", + "page.shared_entries.title": "Udostępnione wpisy", "page.shared_entries_count": [ "%d udostępniony wpis", "%d udostępnione wpisy", "%d udostępnionych wpisów" ], - "page.shared_entries.title": "Udostępnione wpisy", + "page.starred.title": "Ulubione", "page.starred_entry_count": [ "%d ulubiony wpis", "%d ulubione wpisy", "%d ulubionych wpisów" ], - "page.starred.title": "Ulubione", "page.total_entry_count": [ "%d wpis łącznie", "%d wpisy łącznie", "%d wpisów łącznie" ], + "page.unread.title": "Nieprzeczytane", "page.unread_entry_count": [ "%d nieprzeczytany wpis", "%d nieprzeczytane wpisy", "%d nieprzeczytanych wpisów" ], - "page.unread.title": "Nieprzeczytane", "page.users.actions": "Działania", "page.users.admin.no": "Nie", "page.users.admin.yes": "Tak", @@ -619,4 +620,4 @@ "time_elapsed.yesterday": "wczoraj", "tooltip.keyboard_shortcuts": "Skróty klawiszowe: %s", "tooltip.logged_user": "Zalogowany jako %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/pt_BR.json b/internal/locale/translations/pt_BR.json index dd983a39..fbf5c07b 100644 --- a/internal/locale/translations/pt_BR.json +++ b/internal/locale/translations/pt_BR.json @@ -401,6 +401,7 @@ "page.about.author": "Autor:", "page.about.build_date": "Compilado em:", "page.about.credits": "Créditos", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "opções de configuração global", "page.about.go_version": "Go versão:", "page.about.license": "Licença:", @@ -420,10 +421,6 @@ "page.api_keys.table.last_used_at": "Ultima utilização", "page.api_keys.table.token": "Token", "page.api_keys.title": "Chaves de API", - "page.categories_count": [ - "%d category", - "%d categories" - ], "page.categories.entries": "Itens", "page.categories.feed_count": [ "Existe %d fonte.", @@ -432,6 +429,10 @@ "page.categories.feeds": "Inscrições", "page.categories.no_feed": "Sem fonte.", "page.categories.title": "Categorias", + "page.categories_count": [ + "%d category", + "%d categories" + ], "page.category_label": "Category: %s", "page.edit_category.title": "Editar categoria: %s", "page.edit_feed.etag_header": "Cabeçalho 'ETag':", @@ -537,25 +538,25 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "Registrar senha", "page.settings.webauthn.register.error": "Não foi possível registrar a senha", + "page.shared_entries.title": "Itens compartilhados", "page.shared_entries_count": [ "%d shared entry", "%d shared entries" ], - "page.shared_entries.title": "Itens compartilhados", + "page.starred.title": "Favoritos", "page.starred_entry_count": [ "%d starred entry", "%d starred entries" ], - "page.starred.title": "Favoritos", "page.total_entry_count": [ "%d entry in total", "%d entries in total" ], + "page.unread.title": "Não lidos", "page.unread_entry_count": [ "%d unread entry", "%d unread entries" ], - "page.unread.title": "Não lidos", "page.users.actions": "Ações", "page.users.admin.no": "Não", "page.users.admin.yes": "Sim", @@ -602,4 +603,4 @@ "time_elapsed.yesterday": "ontem", "tooltip.keyboard_shortcuts": "Atalho do teclado: %s", "tooltip.logged_user": "Autenticado como %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/ru_RU.json b/internal/locale/translations/ru_RU.json index 728799bb..49785c9e 100644 --- a/internal/locale/translations/ru_RU.json +++ b/internal/locale/translations/ru_RU.json @@ -403,6 +403,7 @@ "page.about.author": "Автор:", "page.about.build_date": "Дата сборки:", "page.about.credits": "Авторы", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Глобальные параметры конфигурации", "page.about.go_version": "Версия Go:", "page.about.license": "Лицензия:", @@ -422,11 +423,6 @@ "page.api_keys.table.last_used_at": "Последнее использование", "page.api_keys.table.token": "Токен", "page.api_keys.title": "API-ключи", - "page.categories_count": [ - "%d category", - "%d categories", - "%d categories" - ], "page.categories.entries": "Cтатьи", "page.categories.feed_count": [ "Есть %d подписка.", @@ -436,6 +432,11 @@ "page.categories.feeds": "Подписки", "page.categories.no_feed": "Нет подписок.", "page.categories.title": "Категории", + "page.categories_count": [ + "%d category", + "%d categories", + "%d categories" + ], "page.category_label": "Category: %s", "page.edit_category.title": "Изменить категорию: %s", "page.edit_feed.etag_header": "Заголовок ETag:", @@ -544,29 +545,29 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "Зарегистрировать пароль", "page.settings.webauthn.register.error": "Не удается зарегистрировать пароль", + "page.shared_entries.title": "Общедоступные статьи", "page.shared_entries_count": [ "%d shared entry", "%d shared entries", "%d shared entries" ], - "page.shared_entries.title": "Общедоступные статьи", + "page.starred.title": "Избранное", "page.starred_entry_count": [ "%d starred entry", "%d starred entries", "%d starred entries" ], - "page.starred.title": "Избранное", "page.total_entry_count": [ "%d entry in total", "%d entries in total", "%d entries in total" ], + "page.unread.title": "Непрочитанное", "page.unread_entry_count": [ "%d unread entry", "%d unread entries", "%d unread entries" ], - "page.unread.title": "Непрочитанное", "page.users.actions": "Действия", "page.users.admin.no": "Нет", "page.users.admin.yes": "Да", @@ -619,4 +620,4 @@ "time_elapsed.yesterday": "вчера", "tooltip.keyboard_shortcuts": "Сочетания клавиш: %s", "tooltip.logged_user": "Авторизован как %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/tr_TR.json b/internal/locale/translations/tr_TR.json index 852bbd89..0486035c 100644 --- a/internal/locale/translations/tr_TR.json +++ b/internal/locale/translations/tr_TR.json @@ -401,6 +401,7 @@ "page.about.author": "Yazar:", "page.about.build_date": "Oluşturulma Tarihi:", "page.about.credits": "Katkıda Bulunanlar", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Global yapılandırma seçenekleri", "page.about.go_version": "Go sürümü:", "page.about.license": "Lisans:", @@ -420,10 +421,6 @@ "page.api_keys.table.last_used_at": "Son Kullanılma", "page.api_keys.table.token": "Token", "page.api_keys.title": "API Anahtarları", - "page.categories_count": [ - "%d kategori", - "%d kategori" - ], "page.categories.entries": "Makaleler", "page.categories.feed_count": [ "%d besleme var.", @@ -432,6 +429,10 @@ "page.categories.feeds": "Beslemeler", "page.categories.no_feed": "Besleme yok.", "page.categories.title": "Kategoriler", + "page.categories_count": [ + "%d kategori", + "%d kategori" + ], "page.category_label": "Kategori: %s", "page.edit_category.title": "Kategoriyi Düzenle: %s", "page.edit_feed.etag_header": "ETag başlığı:", @@ -537,25 +538,25 @@ "page.settings.webauthn.passkeys": "Passkeyler", "page.settings.webauthn.register": "Passkey'i kaydet", "page.settings.webauthn.register.error": "Passkey kaydedilemiyor", + "page.shared_entries.title": "Paylaşılan makaleler", "page.shared_entries_count": [ "%d paylaşılan makaleler", "%d paylaşılan makaleler" ], - "page.shared_entries.title": "Paylaşılan makaleler", + "page.starred.title": "Yıldızlı", "page.starred_entry_count": [ "%d yıldızlanmış makale", "%d yıldızlanmış makale" ], - "page.starred.title": "Yıldızlı", "page.total_entry_count": [ "Toplamda %d makale", "Toplamda %d makale" ], + "page.unread.title": "Okunmadı", "page.unread_entry_count": [ "Toplamda %d okunmamış makale", "Toplamda %d okunmamış makale" ], - "page.unread.title": "Okunmadı", "page.users.actions": "Eylemler", "page.users.admin.no": "Hayır", "page.users.admin.yes": "Evet", @@ -602,4 +603,4 @@ "time_elapsed.yesterday": "dün", "tooltip.keyboard_shortcuts": "Klavye Kısayolu: %s", "tooltip.logged_user": "%s olarak giriş yapıldı" -} \ No newline at end of file +} diff --git a/internal/locale/translations/uk_UA.json b/internal/locale/translations/uk_UA.json index 6468a780..983a91b6 100644 --- a/internal/locale/translations/uk_UA.json +++ b/internal/locale/translations/uk_UA.json @@ -403,6 +403,7 @@ "page.about.author": "Автор:", "page.about.build_date": "Дата побудови:", "page.about.credits": "Титри", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "Параметри глобальної конфігурації", "page.about.go_version": "Версія Go:", "page.about.license": "Ліцензія:", @@ -422,11 +423,6 @@ "page.api_keys.table.last_used_at": "Дата останнього використання", "page.api_keys.table.token": "Токен", "page.api_keys.title": "Ключі API", - "page.categories_count": [ - "%d category", - "%d categories", - "%d categories" - ], "page.categories.entries": "Статті", "page.categories.feed_count": [ "Містить %d стрічку.", @@ -436,6 +432,11 @@ "page.categories.feeds": "Підписки", "page.categories.no_feed": "Немає стрічки.", "page.categories.title": "Категорії", + "page.categories_count": [ + "%d category", + "%d categories", + "%d categories" + ], "page.category_label": "Категорія: %s", "page.edit_category.title": "Редагування категорії: %s", "page.edit_feed.etag_header": "Заголовок ETag:", @@ -544,29 +545,29 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "Зареєструвати пароль", "page.settings.webauthn.register.error": "Не вдалося зареєструвати ключ доступу", + "page.shared_entries.title": "Спільні записи", "page.shared_entries_count": [ "%d shared entry", "%d shared entries", "%d shared entries" ], - "page.shared_entries.title": "Спільні записи", + "page.starred.title": "З зірочкою", "page.starred_entry_count": [ "%d starred entry", "%d starred entries", "%d starred entries" ], - "page.starred.title": "З зірочкою", "page.total_entry_count": [ "%d entry in total", "%d entries in total", "%d entries in total" ], + "page.unread.title": "Непрочитане", "page.unread_entry_count": [ "%d unread entry", "%d unread entries", "%d unread entries" ], - "page.unread.title": "Непрочитане", "page.users.actions": "Дії", "page.users.admin.no": "Ні", "page.users.admin.yes": "Так", @@ -619,4 +620,4 @@ "time_elapsed.yesterday": "вчора", "tooltip.keyboard_shortcuts": "Комбінація клавіш: %s", "tooltip.logged_user": "Здійснено вхід як %s" -} \ No newline at end of file +} diff --git a/internal/locale/translations/zh_CN.json b/internal/locale/translations/zh_CN.json index 1a7e2d3b..209f722f 100644 --- a/internal/locale/translations/zh_CN.json +++ b/internal/locale/translations/zh_CN.json @@ -399,6 +399,7 @@ "page.about.author": "作者:", "page.about.build_date": "构建日期:", "page.about.credits": "版权", + "page.about.db_usage": "数据库容量", "page.about.global_config_options": "全局配置选项", "page.about.go_version": "Go 版本号:", "page.about.license": "协议:", diff --git a/internal/locale/translations/zh_TW.json b/internal/locale/translations/zh_TW.json index 860fcff2..feccdacc 100644 --- a/internal/locale/translations/zh_TW.json +++ b/internal/locale/translations/zh_TW.json @@ -399,6 +399,7 @@ "page.about.author": "作者:", "page.about.build_date": "建構日期:", "page.about.credits": "版權", + "page.about.db_usage": "Database size:", "page.about.global_config_options": "全域設定選項", "page.about.go_version": "Go 版本:", "page.about.license": "授權:", @@ -418,9 +419,6 @@ "page.api_keys.table.last_used_at": "最後使用", "page.api_keys.table.token": "金鑰", "page.api_keys.title": "API 金鑰", - "page.categories_count": [ - "%d 個分類" - ], "page.categories.entries": "檢視內容", "page.categories.feed_count": [ "有 %d 個 Feed" @@ -428,6 +426,9 @@ "page.categories.feeds": "檢視 Feeds", "page.categories.no_feed": "沒有 Feed", "page.categories.title": "分類", + "page.categories_count": [ + "%d 個分類" + ], "page.category_label": "分類:%s", "page.edit_category.title": "編輯分類 : %s", "page.edit_feed.etag_header": "ETag 標頭:", @@ -530,21 +531,21 @@ "page.settings.webauthn.passkeys": "Passkeys", "page.settings.webauthn.register": "註冊 Passkey", "page.settings.webauthn.register.error": "無法註冊 Passkey", + "page.shared_entries.title": "已分享的文章", "page.shared_entries_count": [ "已分享 %d 篇文章" ], - "page.shared_entries.title": "已分享的文章", + "page.starred.title": "收藏", "page.starred_entry_count": [ "%d 篇收藏文章" ], - "page.starred.title": "收藏", "page.total_entry_count": [ "總共 %d 篇文章" ], + "page.unread.title": "未讀", "page.unread_entry_count": [ "%d 篇未讀文章" ], - "page.unread.title": "未讀", "page.users.actions": "操作", "page.users.admin.no": "否", "page.users.admin.yes": "是", @@ -585,4 +586,4 @@ "time_elapsed.yesterday": "昨天", "tooltip.keyboard_shortcuts": "快捷鍵:%s", "tooltip.logged_user": "目前登入 %s" -} \ No newline at end of file +} diff --git a/internal/storage/storage.go b/internal/storage/storage.go index d0cff3fc..ffae9692 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -42,3 +42,15 @@ func (s *Storage) Ping() error { func (s *Storage) DBStats() sql.DBStats { return s.db.Stats() } + +// DBSize returns how much size the database is using in a pretty way. +func (s *Storage) DBSize() (string, error) { + var size string + + err := s.db.QueryRow("SELECT pg_size_pretty(pg_database_size(current_database()))").Scan(&size) + if err != nil { + return "", err + } + + return size, nil +} diff --git a/internal/template/templates/views/about.html b/internal/template/templates/views/about.html index 007aa2ea..1c6b67ae 100644 --- a/internal/template/templates/views/about.html +++ b/internal/template/templates/views/about.html @@ -18,6 +18,7 @@
  • {{ t "page.about.build_date" }} {{ .build_date }}
  • {{ if .user.IsAdmin }}
  • {{ t "page.about.postgres_version" }} {{ .postgres_version }}
  • {{ end }}
  • {{t "page.about.go_version" }} {{ .go_version }}
  • + {{ if .user.IsAdmin }}
  • {{t "page.about.db_usage" }} {{ .db_usage }}
  • {{ end }} diff --git a/internal/ui/about.go b/internal/ui/about.go index 762e84dc..d22ee32d 100644 --- a/internal/ui/about.go +++ b/internal/ui/about.go @@ -22,6 +22,8 @@ func (h *handler) showAboutPage(w http.ResponseWriter, r *http.Request) { return } + dbSize, dbErr := h.store.DBSize() + sess := session.New(h.store, request.SessionID(r)) view := view.New(h.tpl, r, sess) view.Set("version", version.Version) @@ -35,5 +37,11 @@ func (h *handler) showAboutPage(w http.ResponseWriter, r *http.Request) { view.Set("postgres_version", h.store.DatabaseVersion()) view.Set("go_version", runtime.Version()) + if dbErr != nil { + view.Set("db_usage", dbErr) + } else { + view.Set("db_usage", dbSize) + } + html.OK(w, r, view.Render("about")) }