完善截图和分析流程

This commit is contained in:
Zylan
2025-03-06 14:45:52 +08:00
parent 33cf23d462
commit 80d79375de
8 changed files with 1352 additions and 685 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -136,11 +136,20 @@ class SettingsManager {
}
getSettings() {
const language = this.languageInput.value || '中文';
const basePrompt = this.systemPromptInput.value || '';
// 检查系统提示词是否已包含语言设置
let systemPrompt = basePrompt;
if (!basePrompt.includes('Please respond in') && !basePrompt.includes('请用') && !basePrompt.includes('使用')) {
systemPrompt = `${basePrompt}\n\n请务必使用${language}回答。`;
}
return {
model: this.modelSelect.value,
temperature: this.temperatureInput.value,
language: this.languageInput.value,
systemPrompt: this.systemPromptInput.value + ` Please respond in ${this.languageInput.value}.`,
language: language,
systemPrompt: systemPrompt,
proxyEnabled: this.proxyEnabledInput.checked,
proxyHost: this.proxyHostInput.value,
proxyPort: this.proxyPortInput.value,

View File

@@ -47,6 +47,16 @@ class UIManager {
}
showToast(message, type = 'success') {
// 检查是否已经存在相同内容的提示
const existingToasts = this.toastContainer.querySelectorAll('.toast');
for (const existingToast of existingToasts) {
const existingMessage = existingToast.querySelector('span').textContent;
if (existingMessage === message) {
// 已经存在相同的提示,不再创建新的
return;
}
}
const toast = document.createElement('div');
toast.className = `toast ${type}`;
toast.innerHTML = `
@@ -55,10 +65,13 @@ class UIManager {
`;
this.toastContainer.appendChild(toast);
// 为不同类型的提示设置不同的显示时间
const displayTime = message === '截图成功' ? 1500 : 3000;
setTimeout(() => {
toast.style.opacity = '0';
setTimeout(() => toast.remove(), 300);
}, 3000);
}, displayTime);
}
closeAllPanels() {

File diff suppressed because it is too large Load Diff