diff --git a/web/static/i18n/en-US.json b/web/static/i18n/en-US.json index 3720484a..a477b1ef 100644 --- a/web/static/i18n/en-US.json +++ b/web/static/i18n/en-US.json @@ -595,7 +595,11 @@ "knowledge": "Knowledge base", "robots": "Bots", "terminal": "Terminal", - "security": "Security" + "security": "Security", + "infocollect": "Recon" + }, + "infocollect": { + "title": "Reconnaissance" }, "knowledge": { "title": "Knowledge base" @@ -1256,6 +1260,9 @@ "openaiBaseUrlPlaceholder": "https://api.openai.com/v1", "openaiApiKeyPlaceholder": "Enter OpenAI API Key", "modelPlaceholder": "gpt-4", + "maxTotalTokens": "Max Context Tokens", + "maxTotalTokensPlaceholder": "120000", + "maxTotalTokensHint": "Shared by memory compression and attack chain building. Default: 120000", "fofaBaseUrlPlaceholder": "https://fofa.info/api/v1/search/all (optional)", "fofaBaseUrlHint": "Leave empty for default.", "email": "Email", diff --git a/web/static/i18n/zh-CN.json b/web/static/i18n/zh-CN.json index 22c0586f..6d448740 100644 --- a/web/static/i18n/zh-CN.json +++ b/web/static/i18n/zh-CN.json @@ -595,7 +595,11 @@ "knowledge": "知识库", "robots": "机器人设置", "terminal": "终端", - "security": "安全设置" + "security": "安全设置", + "infocollect": "信息收集" + }, + "infocollect": { + "title": "信息收集" }, "knowledge": { "title": "知识库设置" @@ -1256,6 +1260,9 @@ "openaiBaseUrlPlaceholder": "https://api.openai.com/v1", "openaiApiKeyPlaceholder": "输入OpenAI API Key", "modelPlaceholder": "gpt-4", + "maxTotalTokens": "最大上下文 Token 数", + "maxTotalTokensPlaceholder": "120000", + "maxTotalTokensHint": "内存压缩和攻击链构建共用此配置,默认 120000", "fofaBaseUrlPlaceholder": "https://fofa.info/api/v1/search/all(可选)", "fofaBaseUrlHint": "留空则使用默认地址。", "email": "Email", diff --git a/web/static/js/settings.js b/web/static/js/settings.js index 70d4cb8c..0428b9da 100644 --- a/web/static/js/settings.js +++ b/web/static/js/settings.js @@ -109,6 +109,10 @@ async function loadConfig(loadTools = true) { document.getElementById('openai-api-key').value = currentConfig.openai.api_key || ''; document.getElementById('openai-base-url').value = currentConfig.openai.base_url || ''; document.getElementById('openai-model').value = currentConfig.openai.model || ''; + const maxTokensEl = document.getElementById('openai-max-total-tokens'); + if (maxTokensEl) { + maxTokensEl.value = currentConfig.openai.max_total_tokens || 120000; + } // 填充FOFA配置 const fofa = currentConfig.fofa || {}; @@ -829,7 +833,8 @@ async function applySettings() { provider: provider, api_key: apiKey, base_url: baseUrl, - model: model + model: model, + max_total_tokens: parseInt(document.getElementById('openai-max-total-tokens')?.value) || 120000 }, fofa: { email: document.getElementById('fofa-email')?.value.trim() || '', diff --git a/web/templates/index.html b/web/templates/index.html index 7f5825a5..a9eddc2e 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -1338,6 +1338,9 @@
基本设置
+
+ 信息收集 +
知识库
@@ -1384,6 +1387,11 @@ +
+ + + 内存压缩和攻击链构建共用此配置,默认 120000 +
测试连接 @@ -1391,27 +1399,6 @@
- -
-

FOFA 配置

-
-
- - - 留空则使用默认地址。 -
-
- - -
-
- - - 仅保存在服务器配置中(`config.yaml`)。 -
-
-
-

Agent 配置

@@ -1451,6 +1438,34 @@
+ +
+
+

信息收集

+
+ + +
+

FOFA 配置

+
+
+ + + 留空则使用默认地址。 +
+
+ + +
+
+ + + 仅保存在服务器配置中(`config.yaml`)。 +
+
+
+
+