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
5 changes: 5 additions & 0 deletions MCPForUnity/Editor/Windows/Components/Common.uss
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,11 @@
margin-bottom: 4px;
}

.help-text.error {
color: rgba(255, 80, 80, 1);
-unity-font-style: bold;
}

.path-override-controls {
flex-direction: row;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,16 +413,24 @@ public void UpdateHttpServerCommandDisplay()

if (!isLocalHttpUrl)
{
httpServerCommandField.value = string.Empty;
httpServerCommandField.tooltip = string.Empty;
httpServerCommandField.value = "<Invalid Localhost URL>";
httpServerCommandField.tooltip = "The command cannot be generated because the URL is not a local address.";
httpServerCommandSection.EnableInClassList("invalid-url", true);
if (httpServerCommandHint != null)
{
httpServerCommandHint.text = "HTTP Local requires a localhost URL (localhost/127.0.0.1/0.0.0.0/::1).";
httpServerCommandHint.text = "⚠ HTTP Local requires a localhost URL (localhost/127.0.0.1/0.0.0.0/::1).";
httpServerCommandHint.AddToClassList("error");
}
copyHttpServerCommandButton?.SetEnabled(false);
return;
}

httpServerCommandSection.EnableInClassList("invalid-url", false);
if (httpServerCommandHint != null)
{
httpServerCommandHint.RemoveFromClassList("error");
}

if (MCPServiceLocator.Server.TryGetLocalHttpServerCommand(out var command, out var error))
{
httpServerCommandField.value = command;
Expand Down