From d7f420dd1795ab2e6b4a39cd4609425b61397e54 Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 8 Apr 2025 22:22:50 +0200 Subject: [PATCH] Add CORS warning messages and permission request buttons for OpenAI and Ollama APIs. see #330 and #331 --- _locales/en/messages.json | 20 ++++++++++++++++++++ options/mzta-options.html | 16 ++++++++++++++++ options/mzta-options.js | 15 +++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 24bb89b5..abed0189 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1250,5 +1250,25 @@ "hyprland_warning": { "message": "If you're having trouble opening the AI chat window, try setting the height and width values to 0. This issue can occur on linux in certain environments, for example, when using Hyprland.", "description": "" + }, + "remember_CORS": { + "message": "Remember, you need to set up the CORS settings!", + "description": "" + }, + "maybe_CORS_openai_comp": { + "message": "Using OpenAI Compatible API may require setting up CORS settings.", + "description": "" + }, + "CORS_alternative_1": { + "message": "Problems setting CORS?", + "description": "" + }, + "CORS_alternative_2": { + "message": "Press the button below to give the permission to avoid any CORS problem.", + "description": "" + }, + "CORS_give_allurls_perm": { + "message": "Give \"all URLs\" permission", + "description": "" } } \ No newline at end of file diff --git a/options/mzta-options.html b/options/mzta-options.html index 5a67764c..0423168f 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -242,6 +242,14 @@ + + + __MSG_remember_CORS__ [__MSG_customPrompts_managePrompts_help__] +

__MSG_CORS_alternative_1__ +
__MSG_CORS_alternative_2__ +

+ + + + + __MSG_maybe_CORS_openai_comp__ [__MSG_customPrompts_managePrompts_help__] +

__MSG_CORS_alternative_1__ +
__MSG_CORS_alternative_2__ +

+ +