Update background.ts and settings.json

This commit is contained in:
n4ze3m 2024-03-31 16:36:27 +05:30
parent 9ced6469ce
commit e29cea82f5
6 changed files with 121 additions and 56 deletions

View File

@ -17,11 +17,6 @@
"light": "Light",
"dark": "Dark"
}
},
"deleteChatHistory": {
"label": "Delete Chat History",
"button": "Delete",
"confirm": "Are you sure you want to delete your chat history? This action cannot be undone."
}
},
"webSearch": {
@ -37,6 +32,25 @@
"label": "Total Search Results",
"placeholder": "Enter Total Search Results"
}
},
"system": {
"heading": "System Settings",
"deleteChatHistory": {
"label": "Delete Chat History",
"button": "Delete",
"confirm": "Are you sure you want to delete your chat history? This action cannot be undone."
},
"export": {
"label": "Export Chat History, Settings, and Prompts",
"button": "Export Data",
"success": "Export Success"
},
"import": {
"label": "Import Chat History, Settings, and Prompts",
"button": "Import Data",
"success": "Import Success",
"error": "Import Error"
}
}
},
"manageModels": {

View File

@ -20,11 +20,6 @@
},
"searchMode": {
"label": "簡易インターネット検索を実行"
},
"deleteChatHistory": {
"label": "チャット履歴を削除",
"button": "削除",
"confirm": "チャット履歴を削除してもよろしいですか?この操作は元に戻せません。"
}
},
"webSearch": {
@ -40,6 +35,25 @@
"label": "合計検索結果",
"placeholder": "合計検索結果を入力する"
}
},
"system": {
"heading": "システム設定",
"deleteChatHistory": {
"label": "チャット履歴を削除する",
"button": "削除",
"confirm": "チャット履歴を削除してもよろしいですか?この操作は元に戻せません。"
},
"export": {
"label": "チャット履歴、設定、プロンプトをエクスポートする",
"button": "データをエクスポート",
"success": "エクスポート成功"
},
"import": {
"label": "チャット履歴、設定、プロンプトをインポートする",
"button": "データをインポート",
"success": "インポート成功",
"error": "インポートエラー"
}
}
},
"manageModels": {

View File

@ -20,11 +20,6 @@
},
"searchMode": {
"label": "സാധാരണ ഇന്റർനെറ്റ് അന്വേഷണം നടത്തുക"
},
"deleteChatHistory": {
"label": "ചാറ്റ് ചരിത്രം ഇല്ലാതാക്കുക",
"button": "ഇല്ലാതാക്കുക",
"confirm": "നിങ്ങളുടെ ചാറ്റ് ചരിത്രം ഇല്ലാതാക്കണമെന്ന് തീർച്ചയാണോ? ഈ പ്രവർത്തനം പിന്നീട് പിൻവലിക്കാനാകില്ല."
}
},
"webSearch": {
@ -40,6 +35,25 @@
"label": "ആകെ തിരച്ചിൽ ഫലങ്ങൾ",
"placeholder": "ആകെ തിരച്ചിൽ ഫലങ്ങളുടെ എണ്ണം നൽകുക"
}
},
"system": {
"heading": "സിസ്റ്റം ക്രമീകരണങ്ങൾ",
"deleteChatHistory": {
"label": "ചാറ്റ് ചരിത്രം ഇല്ലാതാക്കുക",
"button": "ഇല്ലാതാക്കുക",
"confirm": "നിങ്ങളുടെ ചാറ്റ് ചരിത്രം ഇല്ലാതാക്കണമെന്ന് ഉറപ്പാണോ? ഈ പ്രവർത്തനം പിന്നീട് പിന്വലിക്കാനാവില്ല."
},
"export": {
"label": "ചാറ്റ് ചരിത്രം, ക്രമീകരണങ്ങൾ, പ്രോംപ്റ്റുകൾ എക്സ്പോർട്ട് ചെയ്യുക",
"button": "ഡാറ്റ എക്സ്പോർട്ട് ചെയ്യുക",
"success": "എക്സ്പോർട്ട് വിജയകരമായി"
},
"import": {
"label": "ചാറ്റ് ചരിത്രം, ക്രമീകരണങ്ങൾ, പ്രോംപ്റ്റുകൾ ഇമ്പോർട്ട് ചെയ്യുക",
"button": "ഡാറ്റ ഇമ്പോർട്ട് ചെയ്യുക",
"success": "ഇമ്പോർട്ട് വിജയകരമായി",
"error": "ഇമ്പോർട്ട് പരാജയപ്പെട്ടു"
}
}
},
"manageModels": {

View File

@ -20,11 +20,6 @@
},
"searchMode": {
"label": "使用简化的互联网搜索"
},
"deleteChatHistory": {
"label": "删除聊天历史记录",
"button": "删除",
"confirm": "您确定要删除聊天历史记录吗?这个操作不能撤销。"
}
},
"webSearch": {
@ -40,6 +35,25 @@
"label": "总搜索结果",
"placeholder": "输入总搜索结果"
}
},
"system": {
"heading": "系统设置",
"deleteChatHistory": {
"label": "删除聊天记录",
"button": "删除",
"confirm": "您确定要删除聊天记录吗?此操作无法撤销。"
},
"export": {
"label": "导出聊天记录、设置和提示",
"button": "导出数据",
"success": "导出成功"
},
"import": {
"label": "导入聊天记录、设置和提示",
"button": "导入数据",
"success": "导入成功",
"error": "导入错误"
}
}
},
"manageModels": {

View File

@ -89,15 +89,22 @@ export const SettingOther = () => {
</button>
</div>
<SearchModeSettings />
<div>
<div className="mb-5">
<h2 className="text-base font-semibold leading-7 text-gray-900 dark:text-white">
{t("generalSettings.system.heading")}
</h2>
<div className="border border-b border-gray-200 dark:border-gray-600 mt-3"></div>
</div>
<div className="flex flex-row justify-between">
<span className="text-gray-500 dark:text-neutral-50 ">
{t("generalSettings.settings.deleteChatHistory.label")}
{t("generalSettings.system.deleteChatHistory.label")}
</span>
<button
onClick={async () => {
const confirm = window.confirm(
t("generalSettings.settings.deleteChatHistory.confirm")
t("generalSettings.system.deleteChatHistory.confirm")
)
if (confirm) {
@ -110,9 +117,10 @@ export const SettingOther = () => {
}
}}
className="bg-red-500 dark:bg-red-600 text-white dark:text-gray-200 px-4 py-2 rounded-md">
{t("generalSettings.settings.deleteChatHistory.button")}
{t("generalSettings.system.deleteChatHistory.button")}
</button>
</div>
</div>
</dl>
)
}

View File

@ -81,7 +81,8 @@ export default defineBackground({
chrome.tabs.query({ active: true, currentWindow: true }, async (tabs) => {
const tab = tabs[0]
chrome.sidePanel.open({
tabId: tab.id!
// tabId: tab.id!,
windowId: tab.windowId!,
})
})
} else if (message.type === "pull_model") {
@ -113,7 +114,7 @@ export default defineBackground({
chrome.tabs.query({ active: true, currentWindow: true }, async (tabs) => {
const tab = tabs[0]
chrome.sidePanel.open({
tabId: tab.id!
windowId: tab.windowId!
})
})
break
@ -133,7 +134,7 @@ export default defineBackground({
chrome.tabs.query({ active: true, currentWindow: true }, async (tabs) => {
const tab = tabs[0]
await chrome.sidePanel.open({
tabId: tab.id!
windowId: tab.windowId!,
})
})
}