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)
|
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> {
|
pub fn systemd_units(&self) -> Vec<String> {
|
||||||
// TODO : Extract unit infos
|
// TODO : Extract unit infos
|
||||||
list_tar_file(&self.base_path().join(self.file_name()))
|
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 systemd_units = pkg.systemd_units();
|
||||||
let pacman_hooks = pkg.pacman_hooks();
|
let pacman_hooks = pkg.pacman_hooks();
|
||||||
let binaries = pkg.binaries();
|
let binaries = pkg.binaries();
|
||||||
|
let man_entries = pkg.man_entries();
|
||||||
|
let etc_entries = pkg.etc_entries();
|
||||||
let mut pkginfo = pkg.pkginfo();
|
let mut pkginfo = pkg.pkginfo();
|
||||||
|
|
||||||
let content = Div().vanish()
|
let content = Div().vanish()
|
||||||
|
@ -217,6 +219,24 @@ pub async fn pkg_ui(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
.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(
|
.push(
|
||||||
InfoCard(
|
InfoCard(
|
||||||
Div().vanish().push(
|
Div().vanish().push(
|
||||||
|
|
Loading…
Add table
Reference in a new issue