mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-08 08:30:47 -09:00
support/scripts/pkg-stats: format upstream URL info consistently in HTML
Use only one of the classes for "error" or "warning" status so they
look different, and format the error/warning text for both. Do not
make the text a link if the URL is None.
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
(cherry picked from commit 7961bd10b9)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
committed by
Thomas Perale
parent
54a7730033
commit
056588171d
@@ -1057,14 +1057,19 @@ def dump_html_pkg(f, pkg):
|
||||
div_class = ["centered upstream_url data"]
|
||||
div_class.append(f'_{pkg_css_class}')
|
||||
url_str = pkg.status['url'][1]
|
||||
if pkg.status['url'][0] in ("error", "warning"):
|
||||
div_class.append("missing_url")
|
||||
if pkg.status['url'][0] == "error":
|
||||
div_class.append("invalid_url")
|
||||
url_str = f"""<a href="{pkg.url}">{pkg.status['url'][1]}</a>"""
|
||||
else:
|
||||
if pkg.status['url'][0] == "ok":
|
||||
div_class.append("good_url")
|
||||
url_str = f'<a href="{pkg.url}">Link</a>'
|
||||
else:
|
||||
if pkg.status['url'][0] == "warning":
|
||||
div_class.append("missing_url")
|
||||
else:
|
||||
# "error" status
|
||||
div_class.append("invalid_url")
|
||||
if pkg.url is not None:
|
||||
url_str = f"""<a href="{pkg.url}">{pkg.status['url'][1]}</a>"""
|
||||
else:
|
||||
url_str = pkg.status['url'][1]
|
||||
f.write(f' <div id="{data_field_id}" class="{" ".join(div_class)}">{url_str}</div>\n')
|
||||
|
||||
# CVEs
|
||||
|
||||
Reference in New Issue
Block a user