Add localhost setup feedback and remove UI issues (#587)
parent
abd596ff4a
commit
1cc582636d
|
|
@ -437,6 +437,11 @@
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.help-text.error {
|
||||||
|
color: rgba(255, 80, 80, 1);
|
||||||
|
-unity-font-style: bold;
|
||||||
|
}
|
||||||
|
|
||||||
.path-override-controls {
|
.path-override-controls {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
||||||
|
|
@ -435,16 +435,24 @@ namespace MCPForUnity.Editor.Windows.Components.Connection
|
||||||
|
|
||||||
if (!isLocalHttpUrl)
|
if (!isLocalHttpUrl)
|
||||||
{
|
{
|
||||||
httpServerCommandField.value = string.Empty;
|
httpServerCommandField.value = "<Invalid Localhost URL>";
|
||||||
httpServerCommandField.tooltip = string.Empty;
|
httpServerCommandField.tooltip = "The command cannot be generated because the URL is not a local address.";
|
||||||
|
httpServerCommandSection.EnableInClassList("invalid-url", true);
|
||||||
if (httpServerCommandHint != null)
|
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);
|
copyHttpServerCommandButton?.SetEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
httpServerCommandSection.EnableInClassList("invalid-url", false);
|
||||||
|
if (httpServerCommandHint != null)
|
||||||
|
{
|
||||||
|
httpServerCommandHint.RemoveFromClassList("error");
|
||||||
|
}
|
||||||
|
|
||||||
if (MCPServiceLocator.Server.TryGetLocalHttpServerCommand(out var command, out var error))
|
if (MCPServiceLocator.Server.TryGetLocalHttpServerCommand(out var command, out var error))
|
||||||
{
|
{
|
||||||
httpServerCommandField.value = command;
|
httpServerCommandField.value = command;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue