Feat/perf dashboard (#770)

This commit is contained in:
paisley
2026-04-07 11:04:57 +08:00
committed by GitHub
Unverified
parent 413244522e
commit d8750e135b
9 changed files with 135 additions and 39 deletions

View File

@@ -966,8 +966,7 @@ function channelHasAnyAccount(channelSection: ChannelConfigData): boolean {
return false;
}
export async function listConfiguredChannels(): Promise<string[]> {
const config = await readOpenClawConfig();
export async function listConfiguredChannelsFromConfig(config: OpenClawConfig): Promise<string[]> {
const channels: string[] = [];
if (config.channels) {
@@ -1005,13 +1004,17 @@ export async function listConfiguredChannels(): Promise<string[]> {
return channels;
}
export async function listConfiguredChannels(): Promise<string[]> {
const config = await readOpenClawConfig();
return listConfiguredChannelsFromConfig(config);
}
export interface ConfiguredChannelAccounts {
defaultAccountId: string;
accountIds: string[];
}
export async function listConfiguredChannelAccounts(): Promise<Record<string, ConfiguredChannelAccounts>> {
const config = await readOpenClawConfig();
export function listConfiguredChannelAccountsFromConfig(config: OpenClawConfig): Record<string, ConfiguredChannelAccounts> {
const result: Record<string, ConfiguredChannelAccounts> = {};
if (!config.channels) {
@@ -1059,6 +1062,11 @@ export async function listConfiguredChannelAccounts(): Promise<Record<string, Co
return result;
}
export async function listConfiguredChannelAccounts(): Promise<Record<string, ConfiguredChannelAccounts>> {
const config = await readOpenClawConfig();
return listConfiguredChannelAccountsFromConfig(config);
}
export async function setChannelDefaultAccount(channelType: string, accountId: string): Promise<void> {
return withConfigLock(async () => {
const resolvedChannelType = resolveStoredChannelType(channelType);