Skip to content

Commit a203289

Browse files
authored
Added semantic versioning to UI (#370)
Signed-off-by: Mihai Criveti <[email protected]>
1 parent 6f2f0d1 commit a203289

File tree

2 files changed

+42
-30
lines changed

2 files changed

+42
-30
lines changed

mcpgateway/templates/version_info_partial.html

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,54 @@
11
<!-- htmlhint doctype-first:false -->
22
<div class="space-y-6">
3-
<!-- Application Overview Card (Similar to System Summary) -->
4-
<div class="bg-gradient-to-r from-blue-500 to-purple-600 rounded-lg shadow-lg p-6 text-white">
5-
<h2 class="text-2xl font-bold mb-4 flex items-center">
6-
<svg class="h-8 w-8 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none"
7-
viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
8-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
9-
d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"/>
10-
</svg>
11-
Application Information
12-
</h2>
3+
<!-- Application Overview Card (Similar to System Summary) -->
4+
<div class="bg-gradient-to-r from-blue-500 to-purple-600 rounded-lg shadow-lg p-6 text-white">
5+
<h2 class="text-2xl font-bold mb-4 flex items-center">
6+
<svg class="h-8 w-8 mr-3" xmlns="http://www.w3.org/2000/svg" fill="none"
7+
viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
8+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
9+
d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"/>
10+
</svg>
11+
Application Information
12+
</h2>
1313

14-
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
15-
<div class="text-center">
16-
<div class="text-2xl font-bold">{{ payload.app.name }}</div>
17-
<div class="text-blue-100 text-sm">Application</div>
18-
</div>
19-
<div class="text-center">
20-
<div class="text-2xl font-bold">{{ payload.app.mcp_protocol_version }}</div>
21-
<div class="text-blue-100 text-sm">MCP Protocol</div>
22-
</div>
23-
<div class="text-center">
24-
<div class="text-2xl font-bold">{{ payload.uptime_seconds }}s</div>
25-
<div class="text-blue-100 text-sm">Uptime</div>
26-
</div>
27-
<div class="text-center">
28-
<div class="text-2xl font-bold">{{ payload.host }}</div>
29-
<div class="text-blue-100 text-sm">Host</div>
30-
</div>
14+
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
15+
<div class="text-center">
16+
<div class="text-2xl font-bold">{{ payload.app.name }}</div>
17+
<div class="text-blue-100 text-sm">Application</div>
3118
</div>
19+
<div class="text-center">
20+
<div class="text-2xl font-bold">{{ payload.host }}</div>
21+
<div class="text-blue-100 text-sm">Host</div>
22+
</div>
23+
<div class="text-center">
24+
<div class="text-2xl font-bold">{{ payload.app.mcp_protocol_version }}</div>
25+
<div class="text-blue-100 text-sm">MCP Protocol</div>
26+
</div>
27+
<div class="text-center">
28+
<div class="text-2xl font-bold">{{ payload.uptime_seconds }}s</div>
29+
<div class="text-blue-100 text-sm">Uptime</div>
30+
</div>
31+
</div>
3232

33-
{% if payload.app.git_revision %}
34-
<div class="mt-4 pt-4 border-t border-blue-300">
33+
{% if payload.app.version or payload.app.git_revision %}
34+
<div class="mt-4 pt-4 border-t border-blue-300">
35+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
36+
{% if payload.app.version %}
37+
<div class="text-center">
38+
<div class="text-lg font-medium">Version</div>
39+
<div class="text-blue-100 font-mono text-sm">{{ payload.app.version }}</div>
40+
</div>
41+
{% endif %}
42+
{% if payload.app.git_revision %}
3543
<div class="text-center">
3644
<div class="text-lg font-medium">Git Revision</div>
3745
<div class="text-blue-100 font-mono text-sm">{{ payload.app.git_revision }}</div>
3846
</div>
47+
{% endif %}
3948
</div>
40-
{% endif %}
4149
</div>
50+
{% endif %}
51+
</div>
4252

4353
<!-- Platform & Runtime Card -->
4454
<div class="bg-white rounded-lg shadow p-6 dark:bg-gray-800">

mcpgateway/version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from sqlalchemy import text
3838

3939
# First-Party
40+
from mcpgateway import __version__
4041
from mcpgateway.config import settings
4142
from mcpgateway.db import engine
4243
from mcpgateway.utils.verify_credentials import require_auth
@@ -258,6 +259,7 @@ def _build_payload(
258259
"uptime_seconds": int(time.time() - START_TIME),
259260
"app": {
260261
"name": settings.app_name,
262+
"version": __version__,
261263
"mcp_protocol_version": settings.protocol_version,
262264
"git_revision": _git_revision(),
263265
},

0 commit comments

Comments
 (0)