mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-14 23:31:13 -07:00
Co-authored-by: Allen Hutchison <adh@google.com>
This commit is contained in:
@@ -40,6 +40,13 @@ describe('McpStatus', () => {
|
||||
blockedServers: [],
|
||||
serverStatus: () => MCPServerStatus.CONNECTED,
|
||||
authStatus: {},
|
||||
enablementState: {
|
||||
'server-1': {
|
||||
enabled: true,
|
||||
isSessionDisabled: false,
|
||||
isPersistentDisabled: false,
|
||||
},
|
||||
},
|
||||
discoveryInProgress: false,
|
||||
connectingServers: [],
|
||||
showDescriptions: true,
|
||||
|
||||
@@ -25,6 +25,7 @@ interface McpStatusProps {
|
||||
blockedServers: Array<{ name: string; extensionName: string }>;
|
||||
serverStatus: (serverName: string) => MCPServerStatus;
|
||||
authStatus: HistoryItemMcpStatus['authStatus'];
|
||||
enablementState: HistoryItemMcpStatus['enablementState'];
|
||||
discoveryInProgress: boolean;
|
||||
connectingServers: string[];
|
||||
showDescriptions: boolean;
|
||||
@@ -39,6 +40,7 @@ export const McpStatus: React.FC<McpStatusProps> = ({
|
||||
blockedServers,
|
||||
serverStatus,
|
||||
authStatus,
|
||||
enablementState,
|
||||
discoveryInProgress,
|
||||
connectingServers,
|
||||
showDescriptions,
|
||||
@@ -104,23 +106,35 @@ export const McpStatus: React.FC<McpStatusProps> = ({
|
||||
let statusText = '';
|
||||
let statusColor = theme.text.primary;
|
||||
|
||||
switch (status) {
|
||||
case MCPServerStatus.CONNECTED:
|
||||
statusIndicator = '🟢';
|
||||
statusText = 'Ready';
|
||||
statusColor = theme.status.success;
|
||||
break;
|
||||
case MCPServerStatus.CONNECTING:
|
||||
statusIndicator = '🔄';
|
||||
statusText = 'Starting... (first startup may take longer)';
|
||||
statusColor = theme.status.warning;
|
||||
break;
|
||||
case MCPServerStatus.DISCONNECTED:
|
||||
default:
|
||||
statusIndicator = '🔴';
|
||||
statusText = 'Disconnected';
|
||||
statusColor = theme.status.error;
|
||||
break;
|
||||
// Check enablement state
|
||||
const serverEnablement = enablementState[serverName];
|
||||
const isDisabled = serverEnablement && !serverEnablement.enabled;
|
||||
|
||||
if (isDisabled) {
|
||||
statusIndicator = '⏸️';
|
||||
statusText = serverEnablement.isSessionDisabled
|
||||
? 'Disabled (session)'
|
||||
: 'Disabled';
|
||||
statusColor = theme.text.secondary;
|
||||
} else {
|
||||
switch (status) {
|
||||
case MCPServerStatus.CONNECTED:
|
||||
statusIndicator = '🟢';
|
||||
statusText = 'Ready';
|
||||
statusColor = theme.status.success;
|
||||
break;
|
||||
case MCPServerStatus.CONNECTING:
|
||||
statusIndicator = '🔄';
|
||||
statusText = 'Starting... (first startup may take longer)';
|
||||
statusColor = theme.status.warning;
|
||||
break;
|
||||
case MCPServerStatus.DISCONNECTED:
|
||||
default:
|
||||
statusIndicator = '🔴';
|
||||
statusText = 'Disconnected';
|
||||
statusColor = theme.status.error;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let serverDisplayName = serverName;
|
||||
|
||||
Reference in New Issue
Block a user