add display for man entries + config files
This commit is contained in:
parent
6c1ca1e8c0
commit
bf9813b7a4
2 changed files with 38 additions and 0 deletions
|
@ -192,6 +192,24 @@ impl Package {
|
|||
Some(base)
|
||||
}
|
||||
|
||||
pub fn man_entries(&self) -> Vec<String> {
|
||||
let files = self.file_list();
|
||||
files
|
||||
.into_iter()
|
||||
.filter(|x| x.starts_with("usr/share/man"))
|
||||
.map(|x| {
|
||||
x.trim_start_matches("usr/share/man/")
|
||||
.trim_end_matches(".gz")
|
||||
.to_string()
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn etc_entries(&self) -> Vec<String> {
|
||||
let files = self.file_list();
|
||||
files.into_iter().filter(|x| x.starts_with("etc")).collect()
|
||||
}
|
||||
|
||||
pub fn systemd_units(&self) -> Vec<String> {
|
||||
// TODO : Extract unit infos
|
||||
list_tar_file(&self.base_path().join(self.file_name()))
|
||||
|
|
|
@ -36,6 +36,8 @@ pub async fn pkg_ui(
|
|||
let systemd_units = pkg.systemd_units();
|
||||
let pacman_hooks = pkg.pacman_hooks();
|
||||
let binaries = pkg.binaries();
|
||||
let man_entries = pkg.man_entries();
|
||||
let etc_entries = pkg.etc_entries();
|
||||
let mut pkginfo = pkg.pkginfo();
|
||||
|
||||
let content = Div().vanish()
|
||||
|
@ -216,6 +218,24 @@ pub async fn pkg_ui(
|
|||
ListElements(&binaries)
|
||||
)
|
||||
)
|
||||
)
|
||||
.push_if(!man_entries.is_empty(),
|
||||
|| InfoCard(
|
||||
Div().vanish()
|
||||
.push(CardTitle("Man Entries"))
|
||||
.push(
|
||||
ListElements(&man_entries)
|
||||
)
|
||||
)
|
||||
)
|
||||
.push_if(!etc_entries.is_empty(),
|
||||
|| InfoCard(
|
||||
Div().vanish()
|
||||
.push(CardTitle("Config Files"))
|
||||
.push(
|
||||
ListElements(&etc_entries)
|
||||
)
|
||||
)
|
||||
)
|
||||
.push(
|
||||
InfoCard(
|
||||
|
|
Loading…
Add table
Reference in a new issue