diff --git a/main/manager-web/src/components/ContextProviderDialog.vue b/main/manager-web/src/components/ContextProviderDialog.vue
new file mode 100644
index 00000000..770c6ef4
--- /dev/null
+++ b/main/manager-web/src/components/ContextProviderDialog.vue
@@ -0,0 +1,301 @@
+
+
+
+
+ 添加
+
+
+
+
+
+
+ 接口地址
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/main/manager-web/src/views/roleConfig.vue b/main/manager-web/src/views/roleConfig.vue
index a0baf371..9f1ab92f 100644
--- a/main/manager-web/src/views/roleConfig.vue
+++ b/main/manager-web/src/views/roleConfig.vue
@@ -55,10 +55,24 @@
+
+
+
+ 已成功添加 {{ currentContextProviders.length }} 个源。如何部署上下文源
+
+
+ 编辑源
+
+
+
+
@@ -275,14 +294,16 @@ import Api from "@/apis/api";
import { getServiceUrl } from "@/apis/api";
import RequestService from "@/apis/httpRequest";
import FunctionDialog from "@/components/FunctionDialog.vue";
+import ContextProviderDialog from "@/components/ContextProviderDialog.vue";
import HeaderBar from "@/components/HeaderBar.vue";
import i18n from "@/i18n";
export default {
name: "RoleConfigPage",
- components: { HeaderBar, FunctionDialog },
+ components: { HeaderBar, FunctionDialog, ContextProviderDialog },
data() {
return {
+ showContextProviderDialog: false,
form: {
agentCode: "",
agentName: "",
@@ -320,6 +341,7 @@ export default {
voiceDetails: {}, // 保存完整的音色信息
showFunctionDialog: false,
currentFunctions: [],
+ currentContextProviders: [],
allFunctions: [],
originalFunctions: [],
playingVoice: false,
@@ -356,6 +378,7 @@ export default {
paramInfo: item.params,
};
}),
+ contextProviders: this.currentContextProviders,
};
Api.agent.updateAgentConfig(this.$route.query.agentId, configData, ({ data }) => {
if (data.code === 0) {
@@ -472,6 +495,9 @@ export default {
};
// 后端只给了最小映射:[{ id, agentId, pluginId }, ...]
const savedMappings = data.data.functions || [];
+
+ // 加载上下文配置
+ this.currentContextProviders = data.data.contextProviders || [];
// 先保证 allFunctions 已经加载(如果没有,则先 fetchAllFunctions)
const ensureFuncs = this.allFunctions.length
@@ -646,6 +672,12 @@ export default {
this.showFunctionDialog = true;
}
},
+ openContextProviderDialog() {
+ this.showContextProviderDialog = true;
+ },
+ handleUpdateContext(providers) {
+ this.currentContextProviders = providers;
+ },
handleUpdateFunctions(selected) {
this.currentFunctions = selected;
},
@@ -1345,4 +1377,18 @@ export default {
height: 32px;
margin-left: 8px;
}
+
+.context-provider-item ::v-deep .el-form-item__label {
+ line-height: 42px !important;
+}
+
+.doc-link {
+ color: #1677ff;
+ text-decoration: none;
+ margin-left: 4px;
+
+ &:hover {
+ text-decoration: underline;
+ }
+}