11<template >
22 <div >
33 <RouterMenu />
4- <LayoutContent :title =" $t('aiTools.agents.agentList')" >
4+ <DockerStatus v-model:isActive =" isActive" v-model:isExist =" isExist" />
5+ <LayoutContent
6+ v-loading =" loading"
7+ v-if =" isExist"
8+ :class =" { mask: !isActive }"
9+ :title =" $t('aiTools.agents.agentList')"
10+ >
511 <template #leftToolBar >
612 <el-button type =" primary" @click =" openCreate" >{{ $t('aiTools.agents.createAgent') }}</el-button >
713 </template >
2127 </template >
2228 </el-table-column >
2329 <el-table-column :label =" $t('aiTools.agents.bridgePort')" prop =" bridgePort" width =" 120" />
24- <el-table-column :label =" $t('aiTools.agents.provider')" prop =" provider" width =" 120" />
30+ <el-table-column :label =" $t('aiTools.agents.provider')" prop =" provider" width =" 120" >
31+ <template #default =" { row } " >
32+ {{ getProviderLabel(row.provider) }}
33+ </template >
34+ </el-table-column >
2535 <el-table-column :label =" $t('aiTools.model.model')" prop =" model" min-width =" 180" />
2636 <el-table-column :label =" $t('aiTools.agents.token')" width =" 120" >
2737 <template #default =" { row } " >
4252 />
4353 <fu-table-operations
4454 :buttons =" buttons"
45- min-width =" 300 "
55+ min-width =" 200 "
4656 :label =" $t('commons.table.operate')"
4757 fixed =" right"
48- :ellipsis =" 5 "
58+ :ellipsis =" 2 "
4959 />
5060 </ComplexTable >
5161 </template >
@@ -75,17 +85,42 @@ import ComposeLogs from '@/components/log/compose/index.vue';
7585import TerminalDialog from ' @/views/container/container/terminal/index.vue' ;
7686import i18n from ' @/lang' ;
7787import PortJumpDialog from ' @/components/port-jump/index.vue' ;
88+ import DockerStatus from ' @/views/container/docker-status/index.vue' ;
7889
7990const items = ref <AI .AgentItem []>([]);
91+ const loading = ref (false );
8092const addRef = ref ();
8193const taskLogRef = ref ();
8294const deleteRef = ref ();
8395const composeLogRef = ref ();
8496const dialogTerminalRef = ref ();
8597const dialogPortJumpRef = ref ();
98+ const isActive = ref (false );
99+ const isExist = ref (false );
86100const searchName = ref (' ' );
101+ const providerLabelMap: Record <string , string > = {
102+ openai: ' OpenAI' ,
103+ ollama: ' Ollama' ,
104+ minimax: ' MiniMax' ,
105+ qwen: ' Qwen' ,
106+ deepseek: ' DeepSeek' ,
107+ anthropic: ' Anthropic' ,
108+ gemini: ' Gemini' ,
109+ };
110+
111+ const getProviderLabel = (value : string ) => {
112+ return providerLabelMap [value ] || value ;
113+ };
87114
88115const buttons = [
116+ {
117+ label: i18n .global .t (' menu.terminal' ),
118+ click : (row : AI .AgentItem ) => openTerminal (row ),
119+ },
120+ {
121+ label: i18n .global .t (' commons.button.log' ),
122+ click : (row : AI .AgentItem ) => openLog (row ),
123+ },
89124 {
90125 label: i18n .global .t (' commons.operate.start' ),
91126 click : (row : AI .AgentItem ) => onOperate (row , ' start' ),
@@ -100,14 +135,6 @@ const buttons = [
100135 label: i18n .global .t (' commons.operate.restart' ),
101136 click : (row : AI .AgentItem ) => onOperate (row , ' restart' ),
102137 },
103- {
104- label: i18n .global .t (' commons.button.log' ),
105- click : (row : AI .AgentItem ) => openLog (row ),
106- },
107- {
108- label: i18n .global .t (' menu.terminal' ),
109- click : (row : AI .AgentItem ) => openTerminal (row ),
110- },
111138 {
112139 label: i18n .global .t (' commons.button.delete' ),
113140 click : (row : AI .AgentItem ) => onDelete (row ),
@@ -121,14 +148,19 @@ const paginationConfig = reactive({
121148});
122149
123150const search = async () => {
124- const req: SearchWithPage = {
125- page: paginationConfig .currentPage ,
126- pageSize: paginationConfig .pageSize ,
127- info: searchName .value || ' ' ,
128- };
129- const res = await pageAgents (req );
130- items .value = res .data .items || [];
131- paginationConfig .total = res .data .total || 0 ;
151+ loading .value = true ;
152+ try {
153+ const req: SearchWithPage = {
154+ page: paginationConfig .currentPage ,
155+ pageSize: paginationConfig .pageSize ,
156+ info: searchName .value || ' ' ,
157+ };
158+ const res = await pageAgents (req );
159+ items .value = res .data .items || [];
160+ paginationConfig .total = res .data .total || 0 ;
161+ } finally {
162+ loading .value = false ;
163+ }
132164};
133165
134166const openCreate = () => {
0 commit comments