Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mcpgateway/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,7 @@ async def admin_ui(
gateways = [gateway.model_dump(by_alias=True) for gateway in await gateway_service.list_gateways(db, include_inactive=include_inactive)]
roots = [root.model_dump(by_alias=True) for root in await root_service.list_roots()]
root_path = settings.app_root_path
max_name_length = settings.validation_max_name_length
response = request.app.state.templates.TemplateResponse(
request,
"admin.html",
Expand All @@ -1339,6 +1340,7 @@ async def admin_ui(
"roots": roots,
"include_inactive": include_inactive,
"root_path": root_path,
"max_name_length": max_name_length,
"gateway_tool_name_separator": settings.gateway_tool_name_separator,
},
)
Expand Down
4 changes: 2 additions & 2 deletions mcpgateway/static/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ function validateInputName(name, type = "input") {
return { valid: false, error: `${type} name cannot be empty` };
}

if (cleaned.length > 100) {
if (cleaned.length > window.MAX_NAME_LENGTH) {
return {
valid: false,
error: `${type} name must be 100 characters or less`,
error: `${type} name must be ${window.MAX_NAME_LENGTH} characters or less`,
};
}

Expand Down
1 change: 1 addition & 0 deletions mcpgateway/templates/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -3308,6 +3308,7 @@ <h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">

window.ROOT_PATH = {{ root_path | tojson }};
window.GATEWAY_TOOL_NAME_SEPARATOR = {{ gateway_tool_name_separator | tojson }};
window.MAX_NAME_LENGTH = {{ max_name_length | tojson }};
</script>
</body>
</html>
Loading