add all
admin query command for appservices
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
d90ac11603
commit
906057dd8d
2 changed files with 17 additions and 1 deletions
|
@ -13,7 +13,20 @@ pub(super) async fn appservice(subcommand: Appservice) -> Result<RoomMessageEven
|
||||||
let results = services()
|
let results = services()
|
||||||
.appservice
|
.appservice
|
||||||
.db
|
.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();
|
let query_time = timer.elapsed();
|
||||||
|
|
||||||
Ok(RoomMessageEventContent::text_html(
|
Ok(RoomMessageEventContent::text_html(
|
||||||
|
|
|
@ -85,6 +85,9 @@ pub(crate) enum Appservice {
|
||||||
/// Appservice registration ID
|
/// Appservice registration ID
|
||||||
appservice_id: Box<str>,
|
appservice_id: Box<str>,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/// - Gets all appservice registrations with their ID and registration info
|
||||||
|
All,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(test, derive(Debug))]
|
#[cfg_attr(test, derive(Debug))]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue