fix(oci): services show their address instead of a web link, and applications are not asked for their own

This commit is contained in:
MacRimi
2026-10-11 15:57:05 +02:00
parent 873a3cd8e2
commit 69b76116fd
27 changed files with 407 additions and 18 deletions
+7
View File
@@ -87,6 +87,13 @@ def render(template, digest, instance_id, ip=''):
item = f'🌐 {link(str(endpoint.get("label") or "Web UI"), url)}: {link(url, url)}'
if item:
access.append(item)
if not access:
# With no web address, the application is reached on its ports.
for item in (template.get('container_contract') or {}).get('ports') or []:
port = item.get('container_port')
if isinstance(port, int) and 1 <= port <= 65535:
protocol = '/udp' if item.get('protocol') == 'udp' else ''
access.append(f'&#128268; <code>{address}:{port}{protocol}</code>')
badges = (
('Docs', DOCS, 'https://img.shields.io/badge/%F0%9F%93%9A_Docs-blue'),
('Code', CODE, 'https://img.shields.io/badge/%F0%9F%92%BB_Code-green'),