aboutsummaryrefslogtreecommitdiff
path: root/server/src/ui/admin/mod.rs
blob: 6119b74e53c78dd112d53452b83f9fb26ff92994 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
    This file is part of jellything (https://codeberg.org/metamuffin/jellything)
    which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
    Copyright (C) 2026 metamuffin <metamuffin.org>
*/

pub mod import;
pub mod log;
pub mod users;

use super::error::MyResult;
use crate::request_info::RequestInfo;
use jellyui::components::admin::AdminDashboard;
use rocket::{get, response::content::RawHtml};

#[get("/admin/dashboard")]
pub async fn r_admin_dashboard(ri: RequestInfo<'_>) -> MyResult<RawHtml<String>> {
    ri.require_admin()?;

    // let mut db_debug = String::new();
    // ri.state.database.transaction(&mut |txn| {
    //     db_debug = txn.debug_info()?;
    //     Ok(())
    // })?;

    Ok(ri.respond_ui(&AdminDashboard {
        ri: &ri.render_info(),
    }))
}