Skip to content

Commit 81fa325

Browse files
authored
Dark mode UI/UX changes (#460)
Signed-off-by: Mohan Lakshmaiah <[email protected]>
1 parent 1584846 commit 81fa325

File tree

3 files changed

+293
-102
lines changed

3 files changed

+293
-102
lines changed

mcpgateway/static/admin.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,7 +2537,7 @@ function createParameterForm(parameterCount) {
25372537
header.className = "flex justify-between items-center";
25382538

25392539
const title = document.createElement("span");
2540-
title.className = "font-semibold text-gray-800";
2540+
title.className = "font-semibold text-gray-800 dark:text-gray-200";
25412541
title.textContent = `Parameter ${parameterCount}`;
25422542

25432543
const deleteBtn = document.createElement("button");
@@ -2558,7 +2558,8 @@ function createParameterForm(parameterCount) {
25582558
// Parameter name field with validation
25592559
const nameGroup = document.createElement("div");
25602560
const nameLabel = document.createElement("label");
2561-
nameLabel.className = "block text-sm font-medium text-gray-700";
2561+
nameLabel.className =
2562+
"block text-sm font-medium text-gray-700 dark:text-gray-300";
25622563
nameLabel.textContent = "Parameter Name";
25632564

25642565
const nameInput = document.createElement("input");
@@ -2586,7 +2587,8 @@ function createParameterForm(parameterCount) {
25862587
// Type field
25872588
const typeGroup = document.createElement("div");
25882589
const typeLabel = document.createElement("label");
2589-
typeLabel.className = "block text-sm font-medium text-gray-700";
2590+
typeLabel.className =
2591+
"block text-sm font-medium text-gray-700 dark:text-gray-300";
25902592
typeLabel.textContent = "Type";
25912593

25922594
const typeSelect = document.createElement("select");
@@ -2621,7 +2623,8 @@ function createParameterForm(parameterCount) {
26212623
descGroup.className = "mt-4";
26222624

26232625
const descLabel = document.createElement("label");
2624-
descLabel.className = "block text-sm font-medium text-gray-700";
2626+
descLabel.className =
2627+
"block text-sm font-medium text-gray-700 dark:text-gray-300";
26252628
descLabel.textContent = "Description";
26262629

26272630
const descTextarea = document.createElement("textarea");
@@ -2646,7 +2649,8 @@ function createParameterForm(parameterCount) {
26462649
"h-4 w-4 text-indigo-600 border border-gray-300 rounded";
26472650

26482651
const requiredLabel = document.createElement("label");
2649-
requiredLabel.className = "ml-2 text-sm font-medium text-gray-700";
2652+
requiredLabel.className =
2653+
"ml-2 text-sm font-medium text-gray-700 dark:text-gray-300";
26502654
requiredLabel.textContent = "Required";
26512655

26522656
requiredGroup.appendChild(requiredInput);
@@ -2979,7 +2983,8 @@ async function testTool(toolId) {
29792983
// Field label - use textContent to avoid double escaping
29802984
const label = document.createElement("label");
29812985
label.textContent = keyValidation.value;
2982-
label.className = "block text-sm font-medium text-gray-700";
2986+
label.className =
2987+
"block text-sm font-medium text-gray-700 dark:text-gray-300";
29832988
fieldDiv.appendChild(label);
29842989

29852990
// Description help text - use textContent
@@ -2997,15 +3002,15 @@ async function testTool(toolId) {
29973002
input.required =
29983003
schema.required && schema.required.includes(key);
29993004
input.className =
3000-
"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 dark:text-gray-300 dark:border-gray-700 dark:focus:border-indigo-400 dark:focus:ring-indigo-400";
3005+
"mt-1 block w-full rounded-md border border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:bg-gray-900 text-gray-700 dark:text-gray-300 dark:border-gray-700 dark:focus:border-indigo-400 dark:focus:ring-indigo-400";
30013006

30023007
// Add validation based on type
30033008
if (prop.type === "number") {
30043009
input.type = "number";
30053010
} else if (prop.type === "boolean") {
30063011
input.type = "checkbox";
30073012
input.className =
3008-
"mt-1 h-4 w-4 text-indigo-600 border-gray-300 rounded";
3013+
"mt-1 h-4 w-4 text-indigo-600 dark:text-indigo-200 border border-gray-300 rounded";
30093014
}
30103015

30113016
fieldDiv.appendChild(input);
@@ -3595,7 +3600,7 @@ async function viewTool(toolId) {
35953600
// Create annotation badges safely - NO ESCAPING since we're using textContent
35963601
const renderAnnotations = (annotations) => {
35973602
if (!annotations || Object.keys(annotations).length === 0) {
3598-
return '<p><strong>Annotations:</strong> <span class="text-gray-500">None</span></p>';
3603+
return '<p><strong>Annotations:</strong> <span class="text-gray-600 dark:text-gray-300">None</span></p>';
35993604
}
36003605

36013606
const badges = [];
@@ -3645,7 +3650,7 @@ async function viewTool(toolId) {
36453650
) {
36463651
const value = annotations[key];
36473652
badges.push(
3648-
`<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 mr-1 mb-1 custom-annotation" data-key="${key}" data-value="${value}"></span>`,
3653+
`<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-600 dark:text-gray-200 mr-1 mb-1 custom-annotation" data-key="${key}" data-value="${value}"></span>`,
36493654
);
36503655
}
36513656
});
@@ -3664,7 +3669,7 @@ async function viewTool(toolId) {
36643669
if (toolDetailsDiv) {
36653670
// Create structure safely without double-escaping
36663671
const safeHTML = `
3667-
<div class="space-y-2 dark:bg-gray-900 dark:text-gray-100">
3672+
<div class="space-y-2 dark:bg-gray-800 dark:text-gray-300">
36683673
<p><strong>Name:</strong> <span class="tool-name"></span></p>
36693674
<p><strong>URL:</strong> <span class="tool-url"></span></p>
36703675
<p><strong>Type:</strong> <span class="tool-type"></span></p>
@@ -3674,11 +3679,11 @@ async function viewTool(toolId) {
36743679
${renderAnnotations(tool.annotations)}
36753680
<div>
36763681
<strong>Headers:</strong>
3677-
<pre class="mt-1 bg-gray-100 p-2 rounded dark:bg-gray-800 dark:text-gray-100 tool-headers"></pre>
3682+
<pre class="mt-1 bg-gray-100 p-2 rounded dark:bg-gray-800 dark:text-gray-200 tool-headers"></pre>
36783683
</div>
36793684
<div>
36803685
<strong>Input Schema:</strong>
3681-
<pre class="mt-1 bg-gray-100 p-2 rounded dark:bg-gray-800 dark:text-gray-100 tool-schema"></pre>
3686+
<pre class="mt-1 bg-gray-100 p-2 rounded dark:bg-gray-800 dark:text-gray-200 tool-schema"></pre>
36823687
</div>
36833688
<div>
36843689
<strong>Metrics:</strong>

0 commit comments

Comments
 (0)