Various small layout changes

smaller font size;
show less detailed date times by default;
redirect the index to the queue;
add a category for pacakge states so they can be differently styled;
This commit is contained in:
Christoph Reiter
2021-02-06 08:21:52 +01:00
parent 766aa1ded1
commit fbdb4249f5
7 changed files with 76 additions and 31 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,9 @@
<li class="nav-item">
<a class="nav-link {{ 'active' if is_endpoint('updates') else '' }}" href="{{ url_for('updates') }}">Repo Updates</a>
</li>
<li class="nav-item">
<a class="nav-link {{ 'active' if is_endpoint('queue') else '' }}" href="{{ url_for('queue') }}">Pending Updates</a>
</li>
<li class="nav-item">
<a class="nav-link {{ 'active' if is_endpoint('updates') else '' }}" href="{{ url_for('updates') }}">Repo Updates</a>
</li>
<li class="nav-item">
<a class="nav-link {{ 'active' if is_endpoint('outofdate') else '' }}" href="{{ url_for('outofdate') }}">Outdated Packages</a>
</li>

View File

@@ -22,21 +22,26 @@
<table class="table table-hover table-sm">
<thead>
<tr>
<th>Update Date</th>
<th>Base Package</th>
<th>MSYS2 Version</th>
<th>Repo Version</th>
<th></th>
<th>New Version</th>
<th>Update Date</th>
</tr>
</thead>
<tbody>
{% for (s, myver, gitver, ver, url, date) in to_update %}
<tr>
<td class="mytooltip">
{{ (date|timestamp).split()[0] if date else '' }}
<template class="mytooltip-content">
{% if date %}{{ date|timestamp }} <span class="text-muted">(UTC)</span>{% endif %}
</template>
</td>
<td><a href="{{ url_for('base', base_name=s.name) }}">{{ s.name }}</a></td>
<td>{{ myver }}{% if gitver %} <span class="text-muted small px-2">({{ gitver }} in git)</span>{% endif %}</td>
<td></td>
<td><a href="{{ url }}">{{ ver }}</a></td>
<td>{{ date|timestamp if date else '' }}</td>
</tr>
{% endfor %}
</tbody>

View File

@@ -14,7 +14,7 @@
<p class="text-muted">
Packages get automatically built via <a
href="https://github.com/msys2/msys2-autobuild#automated-build-process">msys2-autobuild</a>.
href="https://github.com/msys2/msys2-autobuild#automated-build-process">msys2-autobuild</a>.<br>
They still get manually signed and uploaded to the pacman repo after
they are built, so please be patient :)
</p>
@@ -22,7 +22,7 @@
<table class="table table-hover table-sm">
<thead>
<tr>
<th>Git Change Date</th>
<th>Update Date</th>
<th>Base Package</th>
<th>Repo Version</th>
<th></th>
@@ -33,7 +33,12 @@
<tbody>
{% for (srcpkg, s, p, status) in updates %}
<tr>
<td><a href="{{ srcpkg.history_url }}">{{ srcpkg.date }}</a></td>
<td class="mytooltip">
<a href="{{ srcpkg.history_url }}">{{ srcpkg.date.split()[0] }}</a>
<template class="mytooltip-content">
{{ srcpkg.date }} <span class="text-muted">(UTC)</span>
</template>
</td>
{% if s %}
<td><a href="{{ url_for('base', base_name=s.name) }}">{{ s.name }}</a></td>
<td>{{ p.version }}</td>
@@ -43,19 +48,15 @@
{% endif %}
<td></td>
<td>{{ srcpkg.build_version }}</td>
<td class="mytooltip">
{% if status[0].url %}
<a href="{{ status[0].url }}">{{ status[0].status }}</a>
{% else %}
{{ status[0].status }}
{% endif %}
<td class="mytooltip text-{{ status[0].category or 'muted' }}">
{{ status[0].status }}{% if status[0].url %}: <a href="{{ status[0].url }}">Logs</a>{% endif %}
<template class="mytooltip-content">
<dl>
{% for s in status %}
<dt>{{ s.type }}</dt>
<dd>{{ s.status }}
<dt>{{ s.type }}: <span class="text-{{ s.category or 'muted' }}">{{ s.status }}</span></dt>
<dd>
{% if s.details %}
<br>{{ s.details }}
{{ s.details }}
{% endif %}</dd>
{% endfor %}
</dl>
@@ -80,7 +81,7 @@
<table class="table table-hover table-sm">
<thead>
<tr>
<th>Git Change Date</th>
<th>Update Date</th>
<th>Repo</th>
<th>Package</th>
<th>Status</th>
@@ -89,10 +90,15 @@
<tbody>
{% for s, p in removals %}
<tr>
<td><a href="{{ s.history_url }}">{{ p.builddate|timestamp }}</a></td>
<td class="mytooltip">
<a href="{{ s.history_url }}">{{ (p.builddate|timestamp).split()[0] }}</a>
<template class="mytooltip-content">
{{ p.builddate|timestamp }} <span class="text-muted">(UTC)</span>
</template>
</td>
<td>{{ p.repo }}</td>
<td><a href="{{ package_url(p) }}">{{ p.name }}</a></td>
<td>Ready for removal</td>
<td class="text-success">Ready for removal</td>
</tr>
{% endfor %}
</tbody>

View File

@@ -26,7 +26,12 @@
<tbody>
{% for p in packages %}
<tr>
<td>{{ p.builddate|timestamp }}</td>
<td class="mytooltip">
{{ (p.builddate|timestamp).split()[0] }}
<template class="mytooltip-content">
{{ p.builddate|timestamp }} <span class="text-muted">(UTC)</span>
</template>
</td>
<td>{{ p.repo }}</td>
<td><a href="{{ package_url(p) }}">{{ package_name(p) }}</a></td>
<td>{{ p.version }}</td>

View File

@@ -43,6 +43,7 @@ PackageBuildStatus = NamedTuple('PackageBuildStatus', [
('status', str),
('details', str),
('url', str),
('category', str),
])
@@ -148,7 +149,7 @@ async def repos(request: Request, response: Response) -> Response:
@router.get('/', dependencies=[Depends(Etag(get_etag))])
async def index(request: Request, response: Response) -> Response:
return RedirectResponse(request.url_for('updates'), headers=dict(response.headers))
return RedirectResponse(request.url_for('queue'), headers=dict(response.headers))
@router.get('/base', dependencies=[Depends(Etag(get_etag))])
@@ -307,6 +308,24 @@ def get_status_text(key: str) -> str:
return key
def get_status_category(key: str) -> str:
SUCCESS = "success"
DANGER = "danger"
try:
status = PackageStatus(key)
except ValueError:
return DANGER
if status == PackageStatus.FINISHED:
return SUCCESS
elif status in (PackageStatus.FINISHED_BUT_BLOCKED, PackageStatus.FINISHED_BUT_INCOMPLETE,
PackageStatus.WAITING_FOR_BUILD, PackageStatus.WAITING_FOR_DEPENDENCIES):
return ""
else:
return DANGER
def get_status_priority(key: str) -> Tuple[int, str]:
"""We want to show the most important status as the primary one"""
@@ -330,15 +349,18 @@ def get_status_priority(key: str) -> Tuple[int, str]:
def get_build_status(srcinfo: SrcInfoPackage) -> List[PackageBuildStatus]:
build_status = state.build_status
if srcinfo.pkgbase not in build_status:
return [PackageBuildStatus("unknown", get_status_text("unknown"), "", "")]
key = "unknown"
return [PackageBuildStatus(key, get_status_text(key), "", "", get_status_category(key))]
all_status = build_status[srcinfo.pkgbase]
results = []
for build_type, status in sorted(all_status.items(), key=lambda i: get_status_priority(i[1]["status"]), reverse=True):
status_key = status.get("status", "unknown")
results.append(
PackageBuildStatus(
build_type, get_status_text(status.get("status", "")),
status.get("desc", ""), status.get("url", ""))
build_type, get_status_text(status_key),
status.get("desc", ""), status.get("url", ""),
get_status_category(status_key))
)
return results

View File

@@ -9,6 +9,7 @@ a {
:root {
--bs-font-sans-serif: 'Roboto',sans-serif;
font-size: 15px;
}
.file-list {
@@ -69,15 +70,21 @@ body {
top: 5rem;
}
@include media-breakpoint-down(xxl) {
:root {
font-size: 14px;
}
}
@include media-breakpoint-down(xl) {
html {
font-size: 0.9em;
:root {
font-size: 13px;
}
}
@include media-breakpoint-down(md) {
html {
font-size: 0.8em;
:root {
font-size: 12px;
}
}