Port queue page to maud
This commit is contained in:
parent
b3f8c6390c
commit
5d4232ac6b
6 changed files with 131 additions and 159 deletions
|
|
@ -70,3 +70,15 @@ pub fn format_value(value: f64) -> String {
|
|||
format!("{value:.2}")
|
||||
}
|
||||
}
|
||||
|
||||
pub fn truncate(text: &str, width: usize) -> String {
|
||||
let truncate = text.chars().take(width + 1).count() > width;
|
||||
if truncate {
|
||||
text.chars()
|
||||
.take(80 - 3)
|
||||
.chain("...".chars())
|
||||
.collect::<String>()
|
||||
} else {
|
||||
text.to_string()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue