use markdown for list-database-files command
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
50ce87161b
commit
1ccdba8921
2 changed files with 5 additions and 2 deletions
|
@ -95,7 +95,8 @@ pub(super) async fn list_database_files(_body: Vec<&str>) -> Result<RoomMessageE
|
||||||
}
|
}
|
||||||
|
|
||||||
let result = services().globals.db.file_list()?;
|
let result = services().globals.db.file_list()?;
|
||||||
Ok(RoomMessageEventContent::notice_html(String::new(), result))
|
|
||||||
|
Ok(RoomMessageEventContent::notice_markdown(result))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) async fn admin_notice(_body: Vec<&str>, message: Vec<String>) -> Result<RoomMessageEventContent> {
|
pub(super) async fn admin_notice(_body: Vec<&str>, message: Vec<String>) -> Result<RoomMessageEventContent> {
|
||||||
|
|
|
@ -238,10 +238,12 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
|
||||||
Err(e) => Ok(String::from(e)),
|
Err(e) => Ok(String::from(e)),
|
||||||
Ok(files) => {
|
Ok(files) => {
|
||||||
let mut res = String::new();
|
let mut res = String::new();
|
||||||
|
writeln!(res, "| lev | sst | keys | dels | size | column |").expect("written to string buffer");
|
||||||
|
writeln!(res, "| ---: | :--- | ---: | ---: | ---: | :--- |").expect("written to string buffer");
|
||||||
for file in files {
|
for file in files {
|
||||||
writeln!(
|
writeln!(
|
||||||
res,
|
res,
|
||||||
"<code>L{} {:<13} {:7}+ {:4}- {:9}</code> {}<br>",
|
"| {} | {:<13} | {:7}+ | {:4}- | {:9} | {} |",
|
||||||
file.level, file.name, file.num_entries, file.num_deletions, file.size, file.column_family_name,
|
file.level, file.name, file.num_entries, file.num_deletions, file.size, file.column_family_name,
|
||||||
)
|
)
|
||||||
.expect("should be able to writeln to string buffer");
|
.expect("should be able to writeln to string buffer");
|
||||||
|
|
Loading…
Add table
Reference in a new issue