mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-13 22:20:58 +00:00
feat: show adapters' label in card
This commit is contained in:
@@ -3,8 +3,8 @@ kind: MessagePlatformAdapter
|
|||||||
metadata:
|
metadata:
|
||||||
name: aiocqhttp
|
name: aiocqhttp
|
||||||
label:
|
label:
|
||||||
en_US: OneBot v11 Adapter
|
en_US: OneBot v11
|
||||||
zh_CN: OneBot v11 适配器
|
zh_CN: OneBot v11
|
||||||
description:
|
description:
|
||||||
en_US: OneBot v11 Adapter
|
en_US: OneBot v11 Adapter
|
||||||
zh_CN: OneBot v11 适配器,请查看文档了解使用方式
|
zh_CN: OneBot v11 适配器,请查看文档了解使用方式
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import BotForm from '@/app/home/bots/components/bot-form/BotForm';
|
|||||||
import BotCard from '@/app/home/bots/components/bot-card/BotCard';
|
import BotCard from '@/app/home/bots/components/bot-card/BotCard';
|
||||||
import CreateCardComponent from '@/app/infra/basic-component/create-card-component/CreateCardComponent';
|
import CreateCardComponent from '@/app/infra/basic-component/create-card-component/CreateCardComponent';
|
||||||
import { httpClient } from '@/app/infra/http/HttpClient';
|
import { httpClient } from '@/app/infra/http/HttpClient';
|
||||||
import { Bot } from '@/app/infra/api/api-types';
|
import { Bot, Adapter } from '@/app/infra/api/api-types';
|
||||||
|
|
||||||
export default function BotConfigPage() {
|
export default function BotConfigPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -41,7 +41,17 @@ export default function BotConfigPage() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBotList() {
|
async function getBotList() {
|
||||||
|
setIsLoading(true);
|
||||||
|
|
||||||
|
const adapterListResp = await httpClient.getAdapters();
|
||||||
|
const adapterList = adapterListResp.adapters.map((adapter: Adapter) => {
|
||||||
|
return {
|
||||||
|
label: adapter.label.zh_CN,
|
||||||
|
value: adapter.name,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
httpClient
|
httpClient
|
||||||
.getBots()
|
.getBots()
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
@@ -51,7 +61,7 @@ export default function BotConfigPage() {
|
|||||||
iconURL: httpClient.getAdapterIconURL(bot.adapter),
|
iconURL: httpClient.getAdapterIconURL(bot.adapter),
|
||||||
name: bot.name,
|
name: bot.name,
|
||||||
description: bot.description,
|
description: bot.description,
|
||||||
adapterLabel: bot.adapter,
|
adapterLabel: adapterList.find((item) => item.value === bot.adapter)?.label || bot.adapter.substring(0, 10),
|
||||||
usePipelineName: bot.use_pipeline_name || '',
|
usePipelineName: bot.use_pipeline_name || '',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user