mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2024-11-29 09:38:39 +00:00
add all
admin query command for appservices
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
d90ac11603
commit
906057dd8d
|
@ -13,7 +13,20 @@ pub(super) async fn appservice(subcommand: Appservice) -> Result<RoomMessageEven
|
|||
let results = services()
|
||||
.appservice
|
||||
.db
|
||||
.get_registration(appservice_id.as_ref())?;
|
||||
.get_registration(appservice_id.as_ref());
|
||||
let query_time = timer.elapsed();
|
||||
|
||||
Ok(RoomMessageEventContent::text_html(
|
||||
format!("Query completed in {query_time:?}:\n\n```\n{:?}```", results),
|
||||
format!(
|
||||
"<p>Query completed in {query_time:?}:</p>\n<pre><code>{:?}\n</code></pre>",
|
||||
results
|
||||
),
|
||||
))
|
||||
},
|
||||
Appservice::All => {
|
||||
let timer = tokio::time::Instant::now();
|
||||
let results = services().appservice.db.all();
|
||||
let query_time = timer.elapsed();
|
||||
|
||||
Ok(RoomMessageEventContent::text_html(
|
||||
|
|
|
@ -85,6 +85,9 @@ pub(crate) enum Appservice {
|
|||
/// Appservice registration ID
|
||||
appservice_id: Box<str>,
|
||||
},
|
||||
|
||||
/// - Gets all appservice registrations with their ID and registration info
|
||||
All,
|
||||
}
|
||||
|
||||
#[cfg_attr(test, derive(Debug))]
|
||||
|
|
Loading…
Reference in a new issue