admin/settings: maintenance page, show database size
This commit is contained in:
parent
3dfcd542bf
commit
ff6c910b2f
13 changed files with 203 additions and 0 deletions
|
|
@ -9,3 +9,4 @@ id = { path = "../id" }
|
|||
thiserror = { workspace = true }
|
||||
chrono = { workspace = true }
|
||||
url = { workspace = true }
|
||||
human_bytes = { version = "0.4.1", default-features = false }
|
||||
|
|
@ -2,6 +2,7 @@ use crate::error::Error;
|
|||
use crate::Settings;
|
||||
use database::sqlx::SqliteExecutor;
|
||||
use database::Settings as DatabaseSettings;
|
||||
use human_bytes::human_bytes;
|
||||
use id::UserID;
|
||||
use url::Url;
|
||||
|
||||
|
|
@ -34,6 +35,12 @@ impl Settings {
|
|||
Ok(DatabaseSettings::get(conn).await.map(Self::from)?)
|
||||
}
|
||||
|
||||
pub async fn database_size(conn: impl SqliteExecutor<'_>) -> Result<Option<String>, Error> {
|
||||
Ok(DatabaseSettings::database_size(conn)
|
||||
.await?
|
||||
.map(human_bytes))
|
||||
}
|
||||
|
||||
pub async fn set_business_name(
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
business_name: &str,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue