mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-11-02 10:52:22 +00:00
fix(oci): services show their address instead of a web link, and applications are not asked for their own
This commit is contained in:
@@ -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'🔌 <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'),
|
||||
|
||||
Reference in New Issue
Block a user