mirror of
https://github.com/Zippland/Snap-Solver.git
synced 2026-01-19 09:41:15 +08:00
完善截图和分析流程
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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,
|
||||
|
||||
@@ -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() {
|
||||
|
||||
764
static/style.css
764
static/style.css
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user