diff options
author | metamuffin <metamuffin@disroot.org> | 2025-05-04 15:11:11 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-05-04 15:11:11 +0200 |
commit | 3cbe45e24355396645b9a721fdca6d5116bd1c36 (patch) | |
tree | ecc5e61167c47362c49375e542bf6752aad12b09 /server | |
parent | 0a5c23757c2a0fc8784ea1b5a3ad5b0cba0709e0 (diff) | |
download | jellything-3cbe45e24355396645b9a721fdca6d5116bd1c36.tar jellything-3cbe45e24355396645b9a721fdca6d5116bd1c36.tar.bz2 jellything-3cbe45e24355396645b9a721fdca6d5116bd1c36.tar.zst |
fix live log
Diffstat (limited to 'server')
-rw-r--r-- | server/src/ui/admin/mod.rs | 58 |
1 files changed, 8 insertions, 50 deletions
diff --git a/server/src/ui/admin/mod.rs b/server/src/ui/admin/mod.rs index 9bf85b5..a03d09b 100644 --- a/server/src/ui/admin/mod.rs +++ b/server/src/ui/admin/mod.rs @@ -13,8 +13,12 @@ use super::{ use crate::{helper::A, locale::AcceptLanguage}; use anyhow::{anyhow, Context}; use jellycommon::routes::u_admin_dashboard; -use jellyimport::{asset_token::AssetInner, import_wrap, is_importing, IMPORT_ERRORS}; -use jellylogic::{session::AdminSession, Database}; +use jellyimport::{asset_token::AssetInner, import_wrap, is_importing}; +use jellylogic::{ + admin::{get_import_errors, list_invites}, + session::AdminSession, + Database, +}; use jellyui::{ admin::AdminDashboardPage, render_page, @@ -37,10 +41,10 @@ pub async fn r_admin_dashboard( lang: AcceptLanguage, ) -> MyResult<RawHtml<String>> { let AcceptLanguage(lang) = lang; - let invites = database.list_invites()?; let flash = None; - let last_import_err = IMPORT_ERRORS.read().await.to_owned(); + let invites = list_invites(&session.0, database)?; + let last_import_err = get_import_errors(&session.0).await; let busy = if is_importing() { Some("An import is currently running.") @@ -181,49 +185,3 @@ pub async fn r_admin_transcode_posters( // .await Ok(Redirect::temporary(u_admin_dashboard())) } - -// fn db_stats(_db: &Database) -> anyhow::Result<DynRender> { -// // TODO -// // let txn = db.inner.begin_read()?; -// // let stats = [ -// // ("node", txn.open_table(T_NODE)?.stats()?), -// // ("user", txn.open_table(T_USER_NODE)?.stats()?), -// // ("user-node", txn.open_table(T_USER_NODE)?.stats()?), -// // ("invite", txn.open_table(T_INVITE)?.stats()?), -// // ]; - -// // let cache_stats = db.node_index.reader.searcher().doc_store_cache_stats(); -// // let ft_total_docs = db.node_index.reader.searcher().total_num_docs()?; - -// Ok(markup::new! { -// // h3 { "Key-Value-Store Statistics" } -// // table.border { -// // tbody { -// // tr { -// // th { "table name" } -// // th { "tree height" } -// // th { "stored bytes" } -// // th { "metadata bytes" } -// // th { "fragmented bytes" } -// // th { "branch pages" } -// // th { "leaf pages" } -// // } -// // @for (name, stats) in &stats { tr { -// // td { @name } -// // td { @stats.tree_height() } -// // td { @format_size(stats.stored_bytes(), DECIMAL) } -// // td { @format_size(stats.metadata_bytes(), DECIMAL) } -// // td { @format_size(stats.fragmented_bytes(), DECIMAL) } -// // td { @stats.branch_pages() } -// // td { @stats.leaf_pages() } -// // }} -// // } -// // } -// // h3 { "Search Engine Statistics" } -// // ul { -// // li { "Total documents: " @ft_total_docs } -// // li { "Cache misses: " @cache_stats.cache_misses } -// // li { "Cache hits: " @cache_stats.cache_hits } -// // } -// }) -// } |