feat(dashboard): Channels page — set up every gateway messaging channel from the browser (#37211)

The /api/messaging/platforms endpoints (catalog, configure, test) shipped
with the desktop app but never got a dashboard UI; the recent admin-panel
PRs covered MCP/webhooks/hooks/system but skipped messaging channels. This
adds the missing page so all 20+ channels (Telegram, Discord, Slack, Matrix,
Mattermost, WhatsApp, Signal, BlueBubbles, Email, SMS, DingTalk, Feishu,
WeCom, WeChat, QQ Bot, Yuanbao, plugin platforms, etc.) can be configured,
enabled/disabled, tested, and connected entirely from the browser.

- web/src/pages/ChannelsPage.tsx: per-platform list with live status, enable
  Switch, Test, and a Configure modal that renders each platform's exact
  setup fields (secrets masked, required validated, redacted display).
- web/src/lib/api.ts: MessagingPlatform types + get/update/test client fns.
- web/src/App.tsx: /channels route + nav tab (Radio icon, after MCP).
- docs: Channels section + REST endpoints + screenshot.

Frontend-only — reuses the existing env-write + config-enable backend, which
auto-enables a platform once its required env vars are present and the
gateway restarts. No core changes, no new tool schema.
This commit is contained in:
Teknium
2026-06-01 23:41:35 -07:00
committed by GitHub
parent 15cb4e2279
commit 3c1d066a8a
5 changed files with 514 additions and 1 deletions
+62
View File
@@ -460,6 +460,24 @@ export const api = {
);
},
// Messaging platforms (gateway channels)
getMessagingPlatforms: () =>
fetchJSON<{ platforms: MessagingPlatform[] }>("/api/messaging/platforms"),
updateMessagingPlatform: (id: string, body: MessagingPlatformUpdate) =>
fetchJSON<{ ok: boolean; platform: string }>(
`/api/messaging/platforms/${encodeURIComponent(id)}`,
{
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
},
),
testMessagingPlatform: (id: string) =>
fetchJSON<MessagingPlatformTestResult>(
`/api/messaging/platforms/${encodeURIComponent(id)}/test`,
{ method: "POST" },
),
// Gateway / update actions
restartGateway: () =>
fetchJSON<ActionResponse>("/api/gateway/restart", { method: "POST" }),
@@ -838,6 +856,50 @@ export interface McpTestResult {
tools: Array<{ name: string; description: string }>;
}
export interface MessagingPlatformEnvVar {
key: string;
required: boolean;
is_set: boolean;
redacted_value: string | null;
description: string;
prompt: string;
url: string | null;
is_password: boolean;
advanced: boolean;
}
export interface MessagingPlatform {
id: string;
name: string;
description: string;
docs_url: string;
enabled: boolean;
configured: boolean;
gateway_running: boolean;
/**
* "connected" | "disabled" | "not_configured" | "pending_restart" |
* "gateway_stopped" | "disconnected" | "fatal" | string
*/
state: string;
error_code: string | null;
error_message: string | null;
updated_at: string | null;
home_channel: { platform: string; chat_id: string; name: string; thread_id?: string } | null;
env_vars: MessagingPlatformEnvVar[];
}
export interface MessagingPlatformUpdate {
enabled?: boolean;
env?: Record<string, string>;
clear_env?: string[];
}
export interface MessagingPlatformTestResult {
ok: boolean;
state: string;
message: string;
}
export interface PairingUser {
platform: string;
user_id: string;