ForcePilot/web/src/views/AgentView.vue

811 lines
20 KiB
Vue
Raw Normal View History

2025-03-25 05:40:07 +08:00
<template>
2025-03-31 23:02:05 +08:00
<div class="agent-view">
2025-04-02 00:00:04 +08:00
<!-- 左侧智能体列表侧边栏 -->
2025-04-01 22:16:07 +08:00
<div class="sidebar" :class="{ 'is-open': state.isSidebarOpen }">
<h2 class="sidebar-title">
智能体列表
2025-04-02 13:00:25 +08:00
<div class="toggle-sidebar" @click="toggleSidebar">
<img src="@/assets/icons/sidebar_left.svg" class="iconfont icon-20" alt="设置" />
</div>
2025-04-01 22:16:07 +08:00
</h2>
<div class="agent-info">
<a-select
v-model:value="selectedAgentId"
class="agent-list"
style="width: 100%"
@change="selectAgent"
>
<a-select-option
v-for="(agent, name) in agents"
:key="name"
:value="name"
>
2025-05-02 23:56:59 +08:00
<div class="agent-option">
{{ agent.name }}
<StarFilled v-if="name === defaultAgentId" class="default-icon" />
</div>
2025-04-01 22:16:07 +08:00
</a-select-option>
</a-select>
<p style="padding: 0 4px;">
{{ agents[selectedAgentId]?.description }}
</p>
2025-05-04 21:04:01 +08:00
<!-- 添加配置按钮 TODO 这里的配置修改还无法影响到独立接口的对话-->
2025-04-05 02:23:32 +08:00
<div class="agent-action-buttons">
<a-button
class="action-button"
@click="openConfigModal"
>
<template #icon><SettingOutlined /></template>
智能体配置
</a-button>
2025-05-04 21:04:01 +08:00
<a-button
class="action-button"
@click="goToAgentPage"
v-if="selectedAgentId"
>
<template #icon><LinkOutlined /></template>
打开独立页面
</a-button>
2025-05-02 23:56:59 +08:00
<a-button
class="action-button primary-action"
@click="setAsDefaultAgent"
v-if="selectedAgentId && userStore.isAdmin"
:disabled="isDefaultAgent"
>
<template #icon><StarOutlined /></template>
{{ isDefaultAgent ? '当前为默认智能体' : '设为默认智能体' }}
</a-button>
2025-04-05 02:23:32 +08:00
</div>
2025-04-01 22:16:07 +08:00
<!-- 添加requirements显示部分 -->
2025-04-02 13:00:25 +08:00
<div v-if="agents[selectedAgentId]?.requirements && agents[selectedAgentId]?.requirements.length > 0" class="info-section">
2025-04-01 22:16:07 +08:00
<h3>所需环境变量:</h3>
<div class="requirements-list">
<a-tag v-for="req in agents[selectedAgentId].requirements" :key="req">
{{ req }}
</a-tag>
2025-03-31 23:02:05 +08:00
</div>
</div>
2025-04-02 13:00:25 +08:00
<!-- 添加all_tools显示部分 -->
<div v-if="agents[selectedAgentId]?.all_tools && agents[selectedAgentId]?.all_tools.length > 0" class="info-section">
<h3>可用工具:</h3>
<div class="all-tools-list">
<a-tag v-for="tool in agents[selectedAgentId].all_tools" :key="tool">
{{ tool }}
</a-tag>
</div>
</div>
2025-03-31 23:02:05 +08:00
</div>
</div>
2025-04-02 00:00:04 +08:00
<!-- 中间内容区域 -->
2025-03-31 23:02:05 +08:00
<div class="content">
2025-04-02 00:00:04 +08:00
<AgentChatComponent
:agent-id="selectedAgentId"
:config="agentConfig"
2025-04-02 13:00:25 +08:00
:state="state"
2025-04-02 00:00:04 +08:00
@open-config="toggleConfigSidebar(true)"
>
2025-04-01 22:16:07 +08:00
<template #header-left>
<div class="toggle-sidebar nav-btn" @click="toggleSidebar" v-if="!state.isSidebarOpen">
<img src="@/assets/icons/sidebar_left.svg" class="iconfont icon-20" alt="设置" />
</div>
</template>
2025-04-05 02:23:32 +08:00
<!-- <template #header-right>
2025-04-02 00:00:04 +08:00
<div class="toggle-sidebar nav-btn" @click="toggleConfigSidebar()">
<SettingOutlined class="iconfont icon-20" />
<span class="text">配置</span>
</div>
2025-04-05 02:23:32 +08:00
</template> -->
2025-04-01 22:16:07 +08:00
</AgentChatComponent>
2025-03-31 23:02:05 +08:00
</div>
2025-04-02 00:00:04 +08:00
<!-- 右侧配置侧边栏 -->
<div class="config-sidebar" :class="{ 'is-open': state.isConfigSidebarOpen }">
<h2 class="sidebar-title">
2025-04-02 13:00:25 +08:00
<div class="sidebar-title-text" @click="toggleDebugMode">智能体配置</div>
2025-04-02 00:00:04 +08:00
<div class="toggle-sidebar" @click="toggleConfigSidebar(false)">
<CloseOutlined class="iconfont icon-20" />
</div>
</h2>
2025-04-03 16:02:14 +08:00
<div v-if="selectedAgentId" class="config-form">
2025-04-05 02:23:32 +08:00
<!-- 已将按钮移至左侧边栏 -->
2025-04-03 16:02:14 +08:00
</div>
<div v-else class="no-agent-selected">
请先选择一个智能体
</div>
2025-04-05 02:23:32 +08:00
<p>你好智能体</p>
2025-04-03 16:02:14 +08:00
</div>
2025-04-05 02:23:32 +08:00
2025-04-03 16:02:14 +08:00
<!-- 配置弹窗 -->
<a-modal
2025-04-05 02:23:32 +08:00
v-model:open="state.configModalVisible"
2025-04-03 16:02:14 +08:00
title="智能体配置"
width="650px"
:footer="null"
@cancel="closeConfigModal"
>
<div v-if="selectedAgentId && configSchema" class="config-modal-content">
2025-04-02 00:00:04 +08:00
<!-- 配置表单 -->
<a-form :model="agentConfig" layout="vertical">
<div class="empty-config" v-if="state.isEmptyConfig">
<a-alert type="warning" message="该智能体没有配置项" show-icon/>
</div>
2025-04-02 13:00:25 +08:00
<!-- 统一显示所有配置项 -->
<template v-for="(value, key) in configurableItems" :key="key">
2025-04-02 00:00:04 +08:00
<a-form-item
2025-04-02 13:00:25 +08:00
:label="getConfigLabel(key, value)"
2025-04-02 00:00:04 +08:00
:name="key"
2025-04-02 13:00:25 +08:00
class="config-item"
2025-04-02 00:00:04 +08:00
>
2025-04-02 13:00:25 +08:00
<p v-if="value.description" class="description">{{ value.description }}</p>
<a-switch
v-if="typeof agentConfig[key] === 'boolean'"
v-model:checked="agentConfig[key]"
/>
<a-textarea
v-else-if="key === 'system_prompt'"
v-model:value="agentConfig[key]"
:rows="4"
:placeholder="getPlaceholder(key, value)"
/>
<a-select
v-else-if="value?.options"
v-model:value="agentConfig[key]"
>
<a-select-option v-for="option in value.options" :key="option" :value="option"></a-select-option>
</a-select>
2025-04-02 00:00:04 +08:00
<a-input
2025-04-02 13:00:25 +08:00
v-else
v-model:value="agentConfig[key]"
:placeholder="getPlaceholder(key, value)"
2025-04-02 00:00:04 +08:00
/>
</a-form-item>
2025-04-02 13:00:25 +08:00
</template>
2025-04-02 00:00:04 +08:00
<!-- 添加工具选择部分 -->
<a-form-item label="可用工具" name="tools" class="config-item">
<p class="description">选择要启用的工具retrieve 工具仅展现了与当前向量模型匹配的知识库详情请查看 docker 日志</p>
<a-form-item-rest>
<div class="tools-switches">
<div v-for="tool in availableTools" :key="tool" class="tool-switch-item">
<span class="tool-name">{{ tool }}</span>
<a-switch
size="small"
:checked="isToolActive(tool)"
@change="(checked) => toggleTool(tool, checked)"
/>
</div>
</div>
</a-form-item-rest>
</a-form-item>
2025-04-03 16:02:14 +08:00
<!-- 弹窗底部按钮 -->
2025-04-02 00:00:04 +08:00
<div class="form-actions" v-if="!state.isEmptyConfig">
<a-button type="primary" @click="saveConfig">保存配置</a-button>
<a-button @click="resetConfig">重置</a-button>
2025-04-03 16:02:14 +08:00
<a-button @click="closeConfigModal">取消</a-button>
2025-04-02 00:00:04 +08:00
</div>
</a-form>
</div>
2025-04-03 16:02:14 +08:00
</a-modal>
2025-04-03 20:45:58 +08:00
2025-03-25 05:40:07 +08:00
</div>
</template>
2025-03-31 23:02:05 +08:00
<script setup>
2025-04-02 00:00:04 +08:00
import { ref, onMounted, reactive, watch, computed, h } from 'vue';
2025-04-05 02:23:32 +08:00
import { useRouter } from 'vue-router';
2025-04-02 00:00:04 +08:00
import {
RobotOutlined,
MenuFoldOutlined,
MenuUnfoldOutlined,
CloseOutlined,
2025-04-05 02:23:32 +08:00
SettingOutlined,
KeyOutlined,
2025-05-02 23:56:59 +08:00
LinkOutlined,
StarOutlined,
StarFilled
2025-04-02 00:00:04 +08:00
} from '@ant-design/icons-vue';
import { message } from 'ant-design-vue';
2025-03-31 23:02:05 +08:00
import AgentChatComponent from '@/components/AgentChatComponent.vue';
2025-05-02 23:56:59 +08:00
import { useUserStore } from '@/stores/user';
import { chatApi } from '@/apis/auth_api';
import { systemConfigApi } from '@/apis/admin_api';
2025-03-31 23:02:05 +08:00
2025-04-05 02:23:32 +08:00
// 路由
const router = useRouter();
2025-05-02 23:56:59 +08:00
const userStore = useUserStore();
2025-04-05 02:23:32 +08:00
2025-03-31 23:02:05 +08:00
// 状态
const agents = ref({});
const selectedAgentId = ref(null);
const availableTools = ref([]); // 存储所有可用的工具列表
2025-05-02 23:56:59 +08:00
const defaultAgentId = ref(null); // 存储默认智能体ID
2025-04-01 22:16:07 +08:00
const state = reactive({
2025-04-02 13:00:25 +08:00
debug_mode: false,
2025-04-01 22:16:07 +08:00
isSidebarOpen: JSON.parse(localStorage.getItem('agent-sidebar-open') || 'true'),
2025-04-02 00:00:04 +08:00
isConfigSidebarOpen: false,
2025-04-03 16:02:14 +08:00
configModalVisible: false,
2025-04-02 13:00:25 +08:00
isEmptyConfig: computed(() =>
!selectedAgentId.value ||
Object.keys(configurableItems.value).length === 0
)
2025-04-01 22:16:07 +08:00
});
2025-04-02 00:00:04 +08:00
const configSchema = computed(() => agents.value[selectedAgentId.value]?.config_schema || {});
2025-04-02 13:00:25 +08:00
const configurableItems = computed(() => configSchema.value.configurable_items || {});
2025-04-02 00:00:04 +08:00
// 配置状态
2025-04-02 13:00:25 +08:00
const agentConfig = ref({});
2025-04-02 00:00:04 +08:00
2025-05-02 23:56:59 +08:00
// 检查是否为默认智能体
const isDefaultAgent = computed(() => {
return selectedAgentId.value === defaultAgentId.value;
});
2025-04-03 16:02:14 +08:00
2025-05-02 23:56:59 +08:00
// 设置为默认智能体
const setAsDefaultAgent = async () => {
if (!selectedAgentId.value || !userStore.isAdmin) return;
2025-04-03 16:02:14 +08:00
2025-05-02 23:56:59 +08:00
try {
await systemConfigApi.setDefaultAgent(selectedAgentId.value);
defaultAgentId.value = selectedAgentId.value;
message.success('已将当前智能体设为默认');
} catch (error) {
console.error('设置默认智能体错误:', error);
message.error(error.message || '设置默认智能体时发生错误');
}
2025-04-03 20:45:58 +08:00
};
2025-05-02 23:56:59 +08:00
// 获取默认智能体ID
const fetchDefaultAgent = async () => {
try {
const data = await chatApi.getDefaultAgent();
defaultAgentId.value = data.default_agent_id;
console.log("Default agent ID:", defaultAgentId.value);
} catch (error) {
console.error('获取默认智能体错误:', error);
}
2025-04-03 20:45:58 +08:00
};
// 获取智能体列表
const fetchAgents = async () => {
try {
2025-05-02 23:56:59 +08:00
const data = await chatApi.getAgents();
// 将数组转换为对象
agents.value = data.agents.reduce((acc, agent) => {
acc[agent.name] = agent;
return acc;
}, {});
// console.log("agents", agents.value);
// 加载当前选中智能体的配置
if (selectedAgentId.value) {
loadAgentConfig();
}
} catch (error) {
console.error('获取智能体错误:', error);
}
};
// 获取所有可用工具
const fetchTools = async () => {
try {
2025-05-02 23:56:59 +08:00
const data = await chatApi.getTools();
availableTools.value = data.tools;
console.log("Available tools:", availableTools.value);
} catch (error) {
console.error('获取工具列表错误:', error);
}
};
2025-04-02 00:00:04 +08:00
// 根据选中的智能体加载配置
const loadAgentConfig = () => {
2025-04-02 13:00:25 +08:00
// BUG: 目前消息重置有问题,需要重置消息
2025-04-02 00:00:04 +08:00
if (!selectedAgentId.value || !agents.value[selectedAgentId.value]) return;
const agent = agents.value[selectedAgentId.value];
2025-04-02 13:00:25 +08:00
const schema = agent.config_schema || {};
const items = schema.configurable_items || {};
2025-04-02 00:00:04 +08:00
// 重置配置
2025-04-02 13:00:25 +08:00
agentConfig.value = {};
// 初始化基础配置项
if (schema.system_prompt) {
agentConfig.value.system_prompt = schema.system_prompt;
}
if (schema.model) {
agentConfig.value.model = schema.model;
}
if (schema.tools) {
agentConfig.value.tools = schema.tools;
}
2025-04-02 13:00:25 +08:00
// 初始化可配置项
Object.keys(items).forEach(key => {
const item = items[key];
2025-04-02 00:00:04 +08:00
2025-04-02 13:00:25 +08:00
// 根据类型设置默认值
if (typeof item.default === 'boolean') {
agentConfig.value[key] = item.default;
} else {
agentConfig.value[key] = item.default || '';
}
});
2025-04-02 00:00:04 +08:00
// 加载存储的配置
const savedConfig = JSON.parse(localStorage.getItem(`agent-config-${selectedAgentId.value}`) || '{}');
// 合并已保存的配置
if (savedConfig) {
2025-04-02 13:00:25 +08:00
Object.keys(savedConfig).forEach(key => {
if (key in agentConfig.value) {
agentConfig.value[key] = savedConfig[key];
}
});
2025-04-02 00:00:04 +08:00
}
};
// 保存配置
const saveConfig = () => {
// 保存配置到本地存储
2025-04-02 13:00:25 +08:00
localStorage.setItem(`agent-config-${selectedAgentId.value}`, JSON.stringify(agentConfig.value));
2025-04-02 00:00:04 +08:00
// 提示保存成功
message.success('配置已保存');
console.log("agentConfig.value", agentConfig.value);
2025-04-03 16:02:14 +08:00
closeConfigModal();
2025-04-02 00:00:04 +08:00
};
// 重置配置
const resetConfig = () => {
2025-04-02 13:00:25 +08:00
// 清除本地存储中的配置
localStorage.removeItem(`agent-config-${selectedAgentId.value}`);
// 重新加载默认配置
2025-04-02 00:00:04 +08:00
loadAgentConfig();
message.info('配置已重置');
};
2025-04-01 22:16:07 +08:00
// 监听侧边栏状态变化并保存到localStorage
watch(
() => state.isSidebarOpen,
(newValue) => {
localStorage.setItem('agent-sidebar-open', JSON.stringify(newValue));
}
);
2025-03-31 23:02:05 +08:00
2025-04-02 00:00:04 +08:00
// 监听智能体选择变化
watch(
() => selectedAgentId.value,
() => {
loadAgentConfig();
}
);
// 切换左侧侧边栏
2025-04-01 22:16:07 +08:00
const toggleSidebar = () => {
state.isSidebarOpen = !state.isSidebarOpen;
};
2025-04-02 00:00:04 +08:00
// 切换配置侧边栏
const toggleConfigSidebar = (forceOpen) => {
if (forceOpen !== undefined) {
state.isConfigSidebarOpen = forceOpen;
} else {
state.isConfigSidebarOpen = !state.isConfigSidebarOpen;
}
};
2025-03-31 23:02:05 +08:00
// 选择智能体
const selectAgent = (agentId) => {
selectedAgentId.value = agentId;
// 保存选择到本地存储
localStorage.setItem('last-selected-agent', agentId);
2025-04-02 00:00:04 +08:00
// 加载该智能体的配置
loadAgentConfig();
2025-03-31 23:02:05 +08:00
};
// 初始化
onMounted(async () => {
2025-05-02 23:56:59 +08:00
// 获取默认智能体
await fetchDefaultAgent();
2025-03-31 23:02:05 +08:00
// 获取智能体列表
await fetchAgents();
// 获取工具列表
await fetchTools();
2025-03-31 23:02:05 +08:00
// 恢复上次选择的智能体
const lastSelectedAgent = localStorage.getItem('last-selected-agent');
if (lastSelectedAgent && agents.value[lastSelectedAgent]) {
selectedAgentId.value = lastSelectedAgent;
2025-05-02 23:56:59 +08:00
} else if (defaultAgentId.value && agents.value[defaultAgentId.value]) {
// 如果有默认智能体,优先选择默认智能体
selectedAgentId.value = defaultAgentId.value;
2025-03-31 23:02:05 +08:00
} else if (Object.keys(agents.value).length > 0) {
// 默认选择第一个智能体
selectedAgentId.value = Object.keys(agents.value)[0];
}
2025-04-02 00:00:04 +08:00
// 加载配置
loadAgentConfig();
2025-03-31 23:02:05 +08:00
});
2025-04-02 13:00:25 +08:00
// 获取配置标签
const getConfigLabel = (key, value) => {
// 根据配置项属性选择合适的显示文本
if (value.description) {
return `${value.name}${key}`;
}
return key;
};
// 获取占位符
const getPlaceholder = (key, value) => {
// 返回描述作为占位符
return `(默认: ${value.default}` ;
};
2025-04-05 02:23:32 +08:00
// 跳转到独立智能体页面
const goToAgentPage = () => {
if (selectedAgentId.value) {
window.open(`/agent/${selectedAgentId.value}`, '_blank');
}
};
// 检查工具是否激活
const isToolActive = (tool) => {
if (!agentConfig.value.tools) {
agentConfig.value.tools = [];
}
return agentConfig.value.tools.includes(tool);
};
// 切换工具状态
const toggleTool = (tool, checked) => {
if (!agentConfig.value.tools) {
agentConfig.value.tools = [];
}
if (checked) {
// 添加工具到列表
if (!agentConfig.value.tools.includes(tool)) {
agentConfig.value.tools.push(tool);
}
} else {
// 从列表中移除工具
agentConfig.value.tools = agentConfig.value.tools.filter(item => item !== tool);
}
};
2025-05-02 23:56:59 +08:00
// 调试模式
const toggleDebugMode = () => {
state.debug_mode = !state.debug_mode;
};
// 打开配置弹窗
const openConfigModal = () => {
state.configModalVisible = true;
};
// 关闭配置弹窗
const closeConfigModal = () => {
state.configModalVisible = false;
};
2025-03-31 23:02:05 +08:00
</script>
<style lang="less" scoped>
.agent-view {
display: flex;
width: 100%;
height: 100vh;
overflow: hidden;
2025-04-06 02:53:27 +08:00
--agent-sidebar-width: 300px;
2025-04-02 00:00:04 +08:00
--config-sidebar-width: 350px;
2025-03-31 23:02:05 +08:00
}
.sidebar {
2025-04-01 22:16:07 +08:00
width: 0;
max-width: var(--agent-sidebar-width);
2025-03-31 23:02:05 +08:00
border-right: 1px solid var(--main-light-3);
background-color: var(--bg-sider);
2025-04-01 22:16:07 +08:00
box-sizing: content-box;
2025-03-31 23:02:05 +08:00
overflow-y: auto;
2025-04-01 22:16:07 +08:00
transition: width 0.3s ease;
overflow: hidden;
&.is-open {
width: var(--agent-sidebar-width);
}
2025-03-31 23:02:05 +08:00
}
2025-04-02 00:00:04 +08:00
// 配置侧边栏样式
.config-sidebar {
width: 0;
max-width: var(--config-sidebar-width);
border-left: 1px solid var(--main-light-3);
background-color: var(--bg-sider);
box-sizing: content-box;
overflow-y: auto;
transition: width 0.3s ease;
overflow: hidden;
position: relative;
z-index: 100;
&.is-open {
width: var(--config-sidebar-width);
}
.config-form {
padding: 16px;
min-width: calc(var(--config-sidebar-width) - 16px);
overflow-y: auto;
max-height: calc(100vh - 100px);
}
.no-agent-selected {
padding: 16px;
color: var(--gray-500);
text-align: center;
margin-top: 20px;
}
}
2025-03-31 23:02:05 +08:00
.sidebar-title {
2025-04-06 02:53:27 +08:00
height: var(--header-height);
2025-03-31 23:02:05 +08:00
font-weight: bold;
user-select: none;
white-space: nowrap;
overflow: hidden;
padding-bottom: 1rem;
font-size: 1rem;
border-bottom: 1px solid var(--main-light-3);
2025-04-01 22:16:07 +08:00
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px;
margin: 0;
}
.toggle-sidebar {
cursor: pointer;
&.nav-btn {
height: 2.5rem;
display: flex;
justify-content: center;
align-items: center;
border-radius: 8px;
color: var(--gray-900);
cursor: pointer;
font-size: 15px;
width: auto;
padding: 0.5rem 1rem;
transition: background-color 0.3s;
overflow: hidden;
.text {
margin-left: 10px;
}
&:hover {
background-color: var(--main-light-3);
}
.nav-btn-icon {
width: 1.5rem;
height: 1.5rem;
}
}
2025-03-31 23:02:05 +08:00
}
.agent-list {
display: flex;
flex-direction: column;
gap: 8px;
2025-04-01 22:16:07 +08:00
margin-bottom: 1rem;
2025-03-31 23:02:05 +08:00
}
.agent-item {
display: flex;
align-items: center;
padding: 12px;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s;
&:hover {
background-color: var(--main-light-4);
}
&.active {
background-color: var(--main-light-3);
}
}
.agent-info {
2025-04-01 22:16:07 +08:00
padding: 16px;
min-width: calc(var(--agent-sidebar-width) - 16px);
2025-04-05 02:23:32 +08:00
overflow-y: auto;
max-height: calc(100vh - 60px); /* 减去标题栏的高度 */
scrollbar-width: thin;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar-thumb {
background-color: var(--main-light-4);
border-radius: 4px;
}
2025-03-31 23:02:05 +08:00
}
.agent-name {
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.agent-desc {
font-size: 12px;
color: #666;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.content {
flex: 1;
overflow: hidden;
}
2025-04-01 22:16:07 +08:00
// 添加requirements相关样式
2025-04-02 13:00:25 +08:00
.info-section {
2025-04-01 22:16:07 +08:00
margin-top: 16px;
border-top: 1px solid var(--main-light-3);
padding-top: 12px;
h3 {
font-size: 14px;
margin-bottom: 8px;
font-weight: 500;
}
}
.requirements-list {
display: flex;
flex-wrap: wrap;
gap: 8px;
.ant-tag {
user-select: all;
}
}
@media (max-width: 520px) {
.sidebar {
position: absolute;
z-index: 101;
width: 0;
height: 100%;
border-radius: 0 16px 16px 0;
box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.05);
&.is-open {
width: var(--agent-sidebar-width);
padding: 16px;
}
}
2025-04-02 00:00:04 +08:00
.config-sidebar {
position: absolute;
z-index: 101;
right: 0;
width: 0;
height: 100%;
border-radius: 16px 0 0 16px;
box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.05);
&.is-open {
width: 90%;
max-width: var(--config-sidebar-width);
}
}
2025-04-01 22:16:07 +08:00
}
2025-04-03 16:02:14 +08:00
.config-modal-content {
max-height: 70vh;
overflow-y: auto;
.description {
font-size: 12px;
color: var(--gray-700);
}
.form-actions {
display: flex;
justify-content: space-between;
margin-top: 20px;
gap: 10px;
}
}
2025-04-05 02:23:32 +08:00
// 添加新按钮的样式
.agent-action-buttons {
margin-top: 16px;
display: flex;
flex-direction: column;
gap: 8px;
}
.action-button {
background-color: white;
border: 1px solid var(--main-light-3);
text-align: left;
height: auto;
padding: 8px 12px;
&:hover {
background-color: var(--main-light-4);
}
2025-05-02 23:56:59 +08:00
&.primary-action {
color: var(--main-color);
border-color: var(--main-color);
&:disabled {
color: var(--main-600);
background-color: var(--main-light-4);
cursor: not-allowed;
opacity: 0.7;
}
}
2025-04-05 02:23:32 +08:00
.anticon {
margin-right: 8px;
}
}
2025-05-02 23:56:59 +08:00
.agent-option {
display: flex;
justify-content: space-between;
align-items: center;
.default-icon {
color: #faad14;
font-size: 14px;
}
}
.tools-switches {
display: flex;
flex-direction: column;
gap: 12px;
.tool-switch-item {
display: flex;
align-items: center;
justify-content: space-between;
.tool-name {
margin-left: 10px;
}
}
}
2025-03-31 23:02:05 +08:00
</style>
2025-03-29 17:34:02 +08:00