Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(control-ui): refresh connector detail view

Josué54c8c1281aaa
diff --git a/control-ui/app/constants/connectorDetail.ts b/control-ui/app/constants/connectorDetail.ts
new file mode 100644
index 000000000..2aea41287
--- /dev/null
+++ b/control-ui/app/constants/connectorDetail.ts
@@ -0,0 +1,10 @@
+export const CONNECTOR_DETAIL_DEFAULT_TAB = 'configuration'
+
+export const CONNECTOR_DETAIL_TABS = ['configuration', 'runtime'] as const
+
+export type ConnectorDetailTab = (typeof CONNECTOR_DETAIL_TABS)[number]
+
+export const CONNECTOR_DETAIL_TAB_LABELS: Record<ConnectorDetailTab, string> = {
+ configuration: 'Configuration',
+ runtime: 'Runtime status',
+}
diff --git a/control-ui/app/constants/routes.ts b/control-ui/app/constants/routes.ts
index 8528a930b..b14216769 100644
--- a/control-ui/app/constants/routes.ts
+++ b/control-ui/app/constants/routes.ts
@@ -37,6 +37,7 @@ export const CONTROL_ROUTES = {
new: '/connectors/new',
remoteNew: '/connectors/remote/new',
detail: (name: string) => `/connectors/${segment(name)}`,
+ detailTab: (name: string, tab: string) => `/connectors/${segment(name)}/${segment(tab)}`,
edit: (name: string) => `/connectors/${segment(name)}/edit`,
editTab: (name: string, tab: string) => `/connectors/${segment(name)}/edit/${segment(tab)}`,
},
diff --git a/control-ui/app/globals.css b/control-ui/app/globals.css
index 8d28f18b3..c0f62a48f 100644
--- a/control-ui/app/globals.css
+++ b/control-ui/app/globals.css
@@ -5828,6 +5828,61 @@ td.cu-registry-description {
margin-top: auto;
}
+.cu-connector-detail__grid {
+ align-items: start;
+}
+
+.cu-connector-detail__field--wide {
+ grid-column: 1 / -1;
+}
+
+.cu-connector-detail__value {
+ min-width: 0;
+ align-items: flex-start;
+ overflow-wrap: anywhere;
+ white-space: pre-wrap;
+}
+
+.cu-connector-detail__value--code,
+.cu-connector-detail__value--code code {
+ font-family: var(--cu-font-mono);
+}
+
+.cu-connector-detail__conditions {
+ display: grid;
+ gap: var(--cu-space-2);
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.cu-connector-detail__condition {
+ display: grid;
+ gap: var(--cu-space-1);
+ min-width: 0;
+ padding: var(--cu-space-3);
+ border: 1px solid var(--cu-border-subtle);
+ border-radius: var(--cu-radius-sm);
+ background: var(--cu-bg-elevated);
+}
+
+.cu-connector-detail__condition-header {
+ display: flex;
+ justify-content: space-between;
+ gap: var(--cu-space-2);
+ color: var(--cu-text);
+}
+
+.cu-connector-detail__condition-header > span {
+ color: var(--cu-text-muted);
+}
+
+.cu-connector-detail__condition-message {
+ margin: 0;
+ color: var(--cu-text-soft);
+ overflow-wrap: anywhere;
+}
+
.cu-agent-create-panel.cu-detail-flow-panel + .cu-card,
.cu-agent-create-panel.cu-detail-flow-panel + .cu-banner + .cu-card,
.cu-agent-create-panel.cu-detail-flow-panel + .cu-banner + .cu-banner + .cu-card,
diff --git a/control-ui/app/mcp-servers/[name]/[tab]/page.tsx b/control-ui/app/mcp-servers/[name]/[tab]/page.tsx
new file mode 100644
index 000000000..80ff64792
--- /dev/null
+++ b/control-ui/app/mcp-servers/[name]/[tab]/page.tsx
@@ -0,0 +1,16 @@
+import { notFound } from 'next/navigation'
+import { CONNECTOR_DETAIL_TABS, type ConnectorDetailTab } from '@constants/connectorDetail'
+import McpServerDetailPage from '../page'
+
+interface ConnectorDetailTabPageProps {
+ params: Promise<{ tab: string }>
+}
+
+export default async function ConnectorDetailTabPage({ params }: ConnectorDetailTabPageProps) {
+ const { tab } = await params
+ if (!CONNECTOR_DETAIL_TABS.includes(tab as ConnectorDetailTab)) {
+ notFound()
+ }
+
+ return <McpServerDetailPage />
+}
diff --git a/control-ui/app/mcp-servers/[name]/page.tsx b/control-ui/app/mcp-servers/[name]/page.tsx
index 4434c7d41..0ade104ac 100644
--- a/control-ui/app/mcp-servers/[name]/page.tsx
+++ b/control-ui/app/mcp-servers/[name]/page.tsx
@@ -6,17 +6,89 @@ import { AuthGate } from '@components/AuthGate'
import { DetailPageShell } from '@components/DetailPageShell'
import { IconCable } from '@components/Sidebar/icons'
import { IconRefresh } from '@components/icons'
+import { Button, FormSection } from '@components/ui'
+import {
+ CONNECTOR_DETAIL_DEFAULT_TAB,
+ CONNECTOR_DETAIL_TABS,
+ CONNECTOR_DETAIL_TAB_LABELS,
+ type ConnectorDetailTab,
+} from '@constants/connectorDetail'
import { CONTROL_ROUTES } from '@constants/routes'
-import { type McpServerResource, getMcpServer, isSilentApiError } from '@lib/api'
+import {
+ type McpServerCondition,
+ type McpServerResource,
+ getMcpServer,
+ isSilentApiError,
+} from '@lib/api'
function text(value: unknown, fallback = '—'): string {
return typeof value === 'string' && value.trim() ? value : fallback
}
+function parseConnectorDetailTab(value: string | string[] | undefined): ConnectorDetailTab {
+ const candidate = Array.isArray(value) ? value[0] : value
+ return CONNECTOR_DETAIL_TABS.find(tab => tab === candidate) ?? CONNECTOR_DETAIL_DEFAULT_TAB
+}
+
+function ConnectorReadOnlyField({
+ code = false,
+ label,
+ value,
+ wide = false,
+}: {
+ code?: boolean
+ label: string
+ value: string
+ wide?: boolean
+}) {
+ return (
+ <div className={wide ? 'cu-field cu-connector-detail__field--wide' : 'cu-field'}>
+ <span className="cu-field__label">{label}</span>
+ <div
+ className={
+ code
+ ? 'cu-readonly-field cu-connector-detail__value cu-connector-detail__value--code'
+ : 'cu-readonly-field cu-connector-detail__value'
+ }
+ >
+ {code ? <code>{value}</code> : value}
+ </div>
+ </div>
+ )
+}
+
+function ConnectorRuntimeStatus({ conditions }: { conditions: McpServerCondition[] }) {
+ return (
+ <FormSection
+ title="Runtime status"
+ description="Current status reported by the connector runtime."
+ >
+ {conditions.length ? (
+ <ul className="cu-connector-detail__conditions" aria-label="Connector runtime conditions">
+ {conditions.map(condition => (
+ <li className="cu-connector-detail__condition" key={condition.type}>
+ <div className="cu-connector-detail__condition-header">
+ <strong>{condition.type}</strong>
+ <span>{condition.status}</span>
+ </div>
+ {condition.message ? (
+ <p className="cu-connector-detail__condition-message">{condition.message}</p>
+ ) : null}
+ </li>
+ ))}
+ </ul>
+ ) : (
+ <p className="cu-muted">No runtime conditions have been reported.</p>
+ )}
+ </FormSection>
+ )
+}
+
export default function McpServerDetailPage() {
const router = useRouter()
- const params = useParams<{ name: string }>()
+ const params = useParams<{ name: string; tab?: string | string[] }>()
const name = decodeURIComponent(params?.name ?? '')
+ const activeTab = parseConnectorDetailTab(params?.tab)
const [server, setServer] = useState<McpServerResource | null>(null)
const [loading, setLoading] = useState(true)
const [error, setError] = useState('')
@@ -35,6 +107,14 @@ export default function McpServerDetailPage() {
}
}, [name])
+ function selectTab(next: ConnectorDetailTab) {
+ if (next === CONNECTOR_DETAIL_DEFAULT_TAB) {
+ router.replace(CONTROL_ROUTES.connectors.detail(name))
+ } else {
+ router.replace(CONTROL_ROUTES.connectors.detailTab(name, next))
+ }
+ }
+
useEffect(() => {
if (name) void load()
}, [load, name])
@@ -50,96 +130,92 @@ export default function McpServerDetailPage() {
<AuthGate>
<DetailPageShell
icon={<IconCable />}
- title={loading ? 'Connector details' : name}
- subtitle="Review connector configuration and runtime status before making changes."
+ title={loading ? 'Connector details' : `Connector: ${name}`}
+ subtitle="Review connector configuration and runtime status. Edit this connector to make changes."
backLabel="Back to connectors"
onBack={() => router.push(CONTROL_ROUTES.connectors.root)}
+ activeTab={activeTab}
+ onTabChange={selectTab}
+ tabAriaLabel="Connector detail sections"
+ tabs={CONNECTOR_DETAIL_TABS.map(tab => ({
+ value: tab,
+ label: CONNECTOR_DETAIL_TAB_LABELS[tab],
+ href:
+ tab === CONNECTOR_DETAIL_DEFAULT_TAB
+ ? CONTROL_ROUTES.connectors.detail(name)
+ : CONTROL_ROUTES.connectors.detailTab(name, tab),
+ }))}
+ contentMode="plain"
+ contentClassName="cu-detail-content-stack--panel-continuation"
actions={
<>
- <button
- type="button"
- className="cu-btn cu-btn--icon cu-btn--toolbar"
+ <Button
+ icon
+ toolbar
+ variant="secondary"
aria-label={loading ? 'Refreshing connector' : 'Refresh connector'}
disabled={loading}
onClick={() => void load()}
>
<IconRefresh className={loading ? 'cu-spin' : undefined} width={18} height={18} />
- </button>
- <button
- type="button"
- className="cu-btn cu-btn--primary cu-btn--sm"
+ </Button>
+ <Button
+ size="sm"
+ variant="primary"
disabled={loading || !server}
onClick={() => router.push(CONTROL_ROUTES.connectors.edit(name))}
>
Edit connector
- </button>
+ </Button>
</>
}
error={error || undefined}
>
{loading ? (
- <div className="cu-body-loading-skeleton" aria-label="Loading connector details">
- Loading connector details…
- </div>
- ) : server ? (
- <div className="cu-form-stack">
- <section className="cu-form-section" aria-labelledby="connector-summary-title">
- <h2 id="connector-summary-title" className="cu-form-section__title">
- Configuration
- </h2>
- <dl className="cu-detail-grid">
- <div>
- <dt>Name</dt>
- <dd>{name}</dd>
- </div>
- <div>
- <dt>Namespace</dt>
- <dd>{text(server.metadata?.namespace, 'default')}</dd>
- </div>
- <div>
- <dt>Description</dt>
- <dd>{text(spec.description)}</dd>
- </div>
- <div>
- <dt>Image</dt>
- <dd>{text(spec.image)}</dd>
- </div>
- <div>
- <dt>Managed</dt>
- <dd>{spec.managed === false ? 'No' : 'Yes'}</dd>
- </div>
- <div>
- <dt>Enabled</dt>
- <dd>{spec.enabled === false ? 'No' : 'Yes'}</dd>
- </div>
- <div>
- <dt>Transport</dt>
- <dd>{text(transport.type)}</dd>
- </div>
- <div>
- <dt>Endpoint</dt>
- <dd>{text(transport.url)}</dd>
- </div>
- </dl>
- </section>
- <section className="cu-form-section" aria-labelledby="connector-status-title">
- <h2 id="connector-status-title" className="cu-form-section__title">
- Runtime status
- </h2>
- {conditions.length ? (
- <ul className="cu-detail-list">
- {conditions.map(condition => (
- <li key={condition.type}>
- <strong>{condition.type}</strong>: {condition.status}
- {condition.message ? ` — ${condition.message}` : ''}
- </li>
- ))}
- </ul>
- ) : (
- <p className="cu-muted">No runtime conditions have been reported.</p>
- )}
+ <div
+ className="cu-body-loading-skeleton"
+ role="status"
+ aria-busy="true"
+ aria-label="Loading connector details"
+ >
+ <section className="cu-body-loading-skeleton__section">
+ <span className="cu-skeleton cu-body-loading-skeleton__heading" />
+ <span className="cu-skeleton cu-body-loading-skeleton__line" />
+ <div className="cu-body-loading-skeleton__fields">
+ <span className="cu-skeleton cu-body-loading-skeleton__field" />
+ <span className="cu-skeleton cu-body-loading-skeleton__field" />
+ </div>
</section>
</div>
+ ) : server ? (
+ activeTab === 'configuration' ? (
+ <FormSection
+ title="Configuration"
+ description="Connector settings are shown here for review. Use Edit connector to change them."
+ >
+ <div className="cu-form-grid cu-form-grid--2 cu-connector-detail__grid">
+ <ConnectorReadOnlyField label="Name" value={name} />
+ <ConnectorReadOnlyField
+ label="Namespace"
+ value={text(server.metadata?.namespace, 'default')}
+ />
+ <ConnectorReadOnlyField label="Description" value={text(spec.description)} wide />
+ <ConnectorReadOnlyField code label="Image" value={text(spec.image)} wide />
+ <ConnectorReadOnlyField
+ label="Managed"
+ value={spec.managed === false ? 'No' : 'Yes'}
+ />
+ <ConnectorReadOnlyField
+ label="Enabled"
+ value={spec.enabled === false ? 'No' : 'Yes'}
+ />
+ <ConnectorReadOnlyField label="Transport" value={text(transport.type)} />
+ <ConnectorReadOnlyField code label="Endpoint" value={text(transport.url)} wide />
+ </div>
+ </FormSection>
+ ) : (
+ <ConnectorRuntimeStatus conditions={conditions} />
+ )
) : null}
</DetailPageShell>
</AuthGate>
diff --git a/control-ui/components/__tests__/McpServerDetailPage.test.tsx b/control-ui/components/__tests__/McpServerDetailPage.test.tsx
index 018debed5..ca92cf7ad 100644
--- a/control-ui/components/__tests__/McpServerDetailPage.test.tsx
+++ b/control-ui/components/__tests__/McpServerDetailPage.test.tsx
@@ -3,11 +3,15 @@ import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/re
import McpServerDetailPage from '../../app/mcp-servers/[name]/page'
import * as api from '../../lib/api'
-const navigation = vi.hoisted(() => ({ push: vi.fn(), params: { name: 'search' } }))
+const navigation = vi.hoisted(() => ({
+ push: vi.fn(),
+ replace: vi.fn(),
+ params: { name: 'search' } as { name: string; tab?: string },
+}))
vi.mock('next/navigation', () => ({
useParams: () => navigation.params,
- useRouter: () => ({ push: navigation.push }),
+ useRouter: () => ({ push: navigation.push, replace: navigation.replace }),
}))
vi.mock('@components/AuthGate', () => ({
AuthGate: ({ children }: { children: React.ReactNode }) => <>{children}</>,
@@ -23,10 +27,11 @@ vi.mock('../../lib/api', async importOriginal => ({
afterEach(() => {
cleanup()
vi.clearAllMocks()
+ navigation.params = { name: 'search' }
})
describe('McpServerDetailPage', () => {
- it('renders non-secret configuration and links to the existing edit route', async () => {
+ it('renders non-secret configuration in route-backed, read-only fields and links to edit', async () => {
vi.mocked(api.getMcpServer).mockResolvedValue({
metadata: { name: 'search', namespace: 'mcp-server' },
spec: {
@@ -51,21 +56,62 @@ describe('McpServerDetailPage', () => {
})
render(<McpServerDetailPage />)
- expect(await screen.findByRole('heading', { name: 'search' })).toBeVisible()
+ expect(await screen.findByRole('heading', { name: 'Connector: search' })).toBeVisible()
+ expect(screen.getByRole('tab', { name: 'Configuration' })).toHaveAttribute(
+ 'aria-current',
+ 'page'
+ )
+ expect(screen.getByRole('tab', { name: 'Runtime status' })).toHaveAttribute(
+ 'href',
+ '/connectors/search/runtime'
+ )
expect(screen.getByText('Search the public web')).toBeVisible()
expect(screen.getByText('https://search.example/mcp')).toBeVisible()
expect(screen.queryByText('search-credentials')).not.toBeInTheDocument()
expect(screen.queryByText('token')).not.toBeInTheDocument()
+ expect(screen.queryByRole('textbox')).not.toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: /save/i })).not.toBeInTheDocument()
fireEvent.click(screen.getByRole('button', { name: 'Edit connector' }))
expect(navigation.push).toHaveBeenCalledWith('/connectors/search/edit')
})
+ it('shows runtime status on the route-backed runtime tab without rendering editable controls', async () => {
+ navigation.params = { name: 'search', tab: 'runtime' }
+ vi.mocked(api.getMcpServer).mockResolvedValue({
+ metadata: { name: 'search' },
+ spec: {},
+ status: {
+ conditions: [
+ {
+ type: 'Ready',
+ status: 'True',
+ reason: 'Available',
+ message: 'Connector is ready.',
+ lastTransitionTime: '2026-09-23T00:00:00Z',
+ },
+ ],
+ },
+ })
+ render(<McpServerDetailPage />)
+
+ expect(await screen.findByRole('heading', { name: 'Runtime status' })).toBeVisible()
+ expect(screen.getByRole('tab', { name: 'Runtime status' })).toHaveAttribute(
+ 'aria-current',
+ 'page'
+ )
+ expect(screen.getByText('Ready')).toBeVisible()
+ expect(screen.getByText('True')).toBeVisible()
+ expect(screen.getByText('Connector is ready.')).toBeVisible()
+ expect(screen.queryByRole('textbox')).not.toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: /save/i })).not.toBeInTheDocument()
+ })
+
it('refreshes in place and keeps failures on the detail page', async () => {
vi.mocked(api.getMcpServer)
.mockResolvedValueOnce({ metadata: { name: 'search' }, spec: {} })
.mockRejectedValueOnce(new Error('Connector search was not found.'))
render(<McpServerDetailPage />)
- await screen.findByRole('heading', { name: 'search' })
+ await screen.findByRole('heading', { name: 'Connector: search' })
fireEvent.click(screen.getByRole('button', { name: 'Refresh connector' }))
await waitFor(() => expect(screen.getByRole('alert')).toHaveTextContent('was not found'))
expect(navigation.push).not.toHaveBeenCalled()
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 5a7ae44ef..d9687a302 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.718",
+ "version": "0.1.719",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.718",
+ "version": "0.1.719",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index 7a0c43a3f..7b0d7da53 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.718",
+ "version": "0.1.719",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",