From 88bbadc5afeda22b1f16516342de634f2e8f1fb5 Mon Sep 17 00:00:00 2001 From: fendly2 Date: Sat, 4 Jul 2026 00:36:00 +0800 Subject: [PATCH] feat: bump version to v3.7.0, auto-fill default model and endpoint on test key import --- CHANGELOG.md | 8 ++++++++ manifest.json | 2 +- popup.js | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d21dc0..b5b4fc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. +## [3.7.0] - 2026-07-04 + +### Added +- One-click import test key: added an "导入测试密钥" button next to the API Key field to quickly populate default working configurations (API Key, Endpoint, and Model) for a frictionless setup. Includes remote fetch from GitHub and local base64 fallback. + +### Fixed +- Fixed datalist autocomplete: resolved issue #13 by clearing the model input on click/focus to show all presets, and restoring the previous value on blur if left empty. + ## [3.6.1] - 2026-07-03 ### Added diff --git a/manifest.json b/manifest.json index a525d07..5e147c2 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "AI-based Translator", - "version": "3.6.1", + "version": "3.7.0", "description": "Chinese, English, Japanese, and Korean AI translation assistant", "permissions": ["storage"], "background": { diff --git a/popup.js b/popup.js index 5c68cc4..47bfa87 100644 --- a/popup.js +++ b/popup.js @@ -502,6 +502,8 @@ document.addEventListener('DOMContentLoaded', () => { const data = await response.json(); if (data && typeof data.key === 'string' && data.key.trim()) { apiKeyInput.value = atob(data.key.trim()); + if (apiEndpointInput) apiEndpointInput.value = DEFAULT_API_ENDPOINT; + if (modelInput) modelInput.value = DEFAULT_MODEL; showToast('导入测试密钥成功!请保存设置。', 'success'); } else { throw new Error('格式无效。'); @@ -512,6 +514,8 @@ document.addEventListener('DOMContentLoaded', () => { try { const localKey = atob(kPart1 + kPart2); apiKeyInput.value = localKey; + if (apiEndpointInput) apiEndpointInput.value = DEFAULT_API_ENDPOINT; + if (modelInput) modelInput.value = DEFAULT_MODEL; showToast('从本地备份导入密钥成功!请保存设置。', 'success'); } catch (localError) { showToast('导入失败,请手动配置。', 'error');