From 7113d72a7c3d7756f7cf0ca70f5d3627a18ae2d4 Mon Sep 17 00:00:00 2001 From: ovosimpatico Date: Fri, 29 Aug 2025 04:06:40 -0300 Subject: [PATCH] Add about page the the AI assistant and conditional loading --- config/locales/ar.json | 8 +++ config/locales/bn.json | 8 +++ config/locales/de.json | 8 +++ config/locales/en.json | 8 +++ config/locales/es.json | 8 +++ config/locales/fr.json | 8 +++ config/locales/hi.json | 8 +++ config/locales/it.json | 8 +++ config/locales/ja.json | 8 +++ config/locales/ko.json | 8 +++ config/locales/pl.json | 8 +++ config/locales/pt.json | 8 +++ config/locales/romaji.json | 8 +++ config/locales/ru.json | 8 +++ config/locales/tr.json | 8 +++ config/locales/zh.json | 8 +++ server.js | 5 ++ views/pages/about.ejs | 99 ++++++++++++++++++++++++++++++-------- views/pages/index.ejs | 10 ++++ 19 files changed, 222 insertions(+), 20 deletions(-) diff --git a/config/locales/ar.json b/config/locales/ar.json index 2bd2ef0..2174ac2 100644 --- a/config/locales/ar.json +++ b/config/locales/ar.json @@ -55,6 +55,14 @@ "disabled": "تم تعطيل وظيفة المحاكي على الويب من قبل المسؤول.", "contact": "تواصل مع المسؤول أو قم بإنشاء نسختك الخاصة من Myrient Search." }, + "ai": { + "title": "مساعد الذكاء الاصطناعي", + "description": "يحتوي هذا الموقع على مساعد مدعوم بالذكاء الاصطناعي يمكنه مساعدتك في العثور على الألعاب وتقديم التوصيات والإجابة على الأسئلة حول الألعاب التقليدية.", + "provider_info": "مدعوم بواسطة {{provider}} باستخدام نموذج {{model}}.", + "privacy_note": "المساعد الذكي مدعوم بخدمة خارجية. يرجى الرجوع إلى سياسة الخصوصية للخدمة للحصول على مزيد من المعلومات.", + "disabled": "تم تعطيل وظيفة المساعد الذكي من قبل المسؤول.", + "contact": "تواصل مع المسؤول أو قم بإنشاء نسختك الخاصة من Myrient Search." + }, "credits": { "created_by": "تم إنشاء محرك البحث بواسطة", "view_github": "عرض المشروع على GitHub" diff --git a/config/locales/bn.json b/config/locales/bn.json index fa57eb8..cb3b48a 100644 --- a/config/locales/bn.json +++ b/config/locales/bn.json @@ -55,6 +55,14 @@ "disabled": "ওয়েব এমুলেটর কার্যকারিতা অ্যাডমিনিস্ট্রেটর দ্বারা নিষ্ক্রিয় করা হয়েছে।", "contact": "অ্যাডমিনিস্ট্রেটরের সাথে যোগাযোগ করুন অথবা আপনার নিজের Myrient Search ইনস্ট্যান্স সেট আপ করুন।" }, + "ai": { + "title": "AI সহায়ক", + "description": "এই ওয়েবসাইটে একটি AI-চালিত সহায়ক রয়েছে যা আপনাকে গেম খুঁজতে, সুপারিশ প্রদান করতে এবং রেট্রো গেমিং সম্পর্কে প্রশ্নের উত্তর দিতে সাহায্য করতে পারে।", + "provider_info": "{{provider}} দ্বারা চালিত {{model}} মডেল ব্যবহার করে।", + "privacy_note": "AI সহায়ক একটি বাহ্যিক সেবা দ্বারা চালিত। আরো তথ্যের জন্য সেবার গোপনীয়তা নীতি দেখুন।", + "disabled": "AI সহায়ক কার্যকারিতা প্রশাসক দ্বারা নিষ্ক্রিয় করা হয়েছে।", + "contact": "প্রশাসকের সাথে যোগাযোগ করুন অথবা Myrient Search এর আপনার নিজস্ব ইনস্ট্যান্স চালু করুন।" + }, "credits": { "created_by": "সার্চ ইঞ্জিন তৈরি করেছেন", "view_github": "GitHub-এ প্রকল্প দেখুন" diff --git a/config/locales/de.json b/config/locales/de.json index 4a6c38e..067e024 100644 --- a/config/locales/de.json +++ b/config/locales/de.json @@ -55,6 +55,14 @@ "disabled": "Die Webemulator-Funktion wurde vom Administrator deaktiviert.", "contact": "Kontaktieren Sie den Administrator oder starten Sie Ihre eigene Instanz von Myrient Search." }, + "ai": { + "title": "KI-Assistent", + "description": "Diese Website verfügt über einen KI-gestützten Assistenten, der Ihnen beim Finden von Spielen, bei Empfehlungen und bei der Beantwortung von Fragen zum Retro-Gaming helfen kann.", + "provider_info": "Bereitgestellt von {{provider}} mit dem {{model}}-Modell.", + "privacy_note": "Der KI-Assistent wird von einem externen Dienst betrieben. Weitere Informationen finden Sie in der Datenschutzrichtlinie des Dienstes.", + "disabled": "Die KI-Assistenten-Funktionalität wurde vom Administrator deaktiviert.", + "contact": "Kontaktieren Sie den Administrator oder starten Sie Ihre eigene Instanz von Myrient Search." + }, "credits": { "created_by": "Suchmaschine entwickelt von", "view_github": "Projekt auf GitHub ansehen" diff --git a/config/locales/en.json b/config/locales/en.json index 1ba7588..16a9887 100644 --- a/config/locales/en.json +++ b/config/locales/en.json @@ -55,6 +55,14 @@ "disabled": "Web Emulator functionality was disabled by the administrator.", "contact": "Contact the administrator or spin up your own instance of Myrient Search." }, + "ai": { + "title": "AI Assistant", + "description": "This website features an AI-powered assistant that can help you find games, provide recommendations, and answer questions about retro gaming.", + "provider_info": "Powered by {{provider}} using the {{model}} model.", + "privacy_note": "The AI assistant is powered by an external service. Please refer to the service's privacy policy for more information.", + "disabled": "AI Assistant functionality was disabled by the administrator.", + "contact": "Contact the administrator or spin up your own instance of Myrient Search." + }, "credits": { "created_by": "Search engine created by", "view_github": "View project on GitHub" diff --git a/config/locales/es.json b/config/locales/es.json index 56157a8..8f34baa 100644 --- a/config/locales/es.json +++ b/config/locales/es.json @@ -55,6 +55,14 @@ "disabled": "La función del emulador web ha sido desactivada por el administrador.", "contact": "Contacta con el administrador o lanza tu propia instancia de Myrient Search." }, + "ai": { + "title": "Asistente de IA", + "description": "Esta web incluye un asistente potenciado por IA que puede ayudarte a encontrar juegos, proporcionar recomendaciones y responder preguntas sobre juegos retro.", + "provider_info": "Potenciado por {{provider}} usando el modelo {{model}}.", + "privacy_note": "El asistente de IA está potenciado por un servicio externo. Por favor, consulta la política de privacidad del servicio para más información.", + "disabled": "La funcionalidad del Asistente de IA ha sido desactivada por el administrador.", + "contact": "Contacta con el administrador o lanza tu propia instancia de Myrient Search." + }, "credits": { "created_by": "Buscador creado por", "view_github": "Ver proyecto en GitHub" diff --git a/config/locales/fr.json b/config/locales/fr.json index 67429e2..2cbd7a1 100644 --- a/config/locales/fr.json +++ b/config/locales/fr.json @@ -55,6 +55,14 @@ "disabled": "La fonctionnalité d'émulation web a été désactivée par l'administrateur.", "contact": "Contactez l'administrateur ou lancez votre propre instance de Myrient Search." }, + "ai": { + "title": "Assistant IA", + "description": "Ce site web dispose d'un assistant alimenté par l'IA qui peut vous aider à trouver des jeux, fournir des recommandations et répondre aux questions sur le gaming rétro.", + "provider_info": "Alimenté par {{provider}} utilisant le modèle {{model}}.", + "privacy_note": "L'assistant IA est alimenté par un service externe. Veuillez vous référer à la politique de confidentialité du service pour plus d'informations.", + "disabled": "La fonctionnalité Assistant IA a été désactivée par l'administrateur.", + "contact": "Contactez l'administrateur ou lancez votre propre instance de Myrient Search." + }, "credits": { "created_by": "Moteur de recherche créé par", "view_github": "Voir le projet sur GitHub" diff --git a/config/locales/hi.json b/config/locales/hi.json index d9da728..1c68e23 100644 --- a/config/locales/hi.json +++ b/config/locales/hi.json @@ -55,6 +55,14 @@ "disabled": "वेब एमुलेटर फंक्शनैलिटी एडमिनिस्ट्रेटर द्वारा अक्षम की गई है।", "contact": "एडमिनिस्ट्रेटर से संपर्क करें या अपना खुद का Myrient Search इंस्टेंस स्थापित करें।" }, + "ai": { + "title": "AI सहायक", + "description": "इस वेबसाइट में एक AI-संचालित सहायक है जो आपको गेम खोजने, सिफारिशें प्रदान करने और रेट्रो गेमिंग के बारे में प्रश्नों का उत्तर देने में मदद कर सकता है।", + "provider_info": "{{provider}} द्वारा संचालित {{model}} मॉडल का उपयोग करके।", + "privacy_note": "AI सहायक एक बाहरी सेवा द्वारा संचालित है। अधिक जानकारी के लिए कृपया सेवा की गोपनीयता नीति देखें।", + "disabled": "AI सहायक कार्यक्षमता प्रशासक द्वारा अक्षम कर दी गई है।", + "contact": "प्रशासक से संपर्क करें या Myrient Search का अपना उदाहरण चलाएं।" + }, "credits": { "created_by": "खोज इंजन किसके द्वारा बनाया गया:", "view_github": "GitHub पर प्रोजेक्ट देखें" diff --git a/config/locales/it.json b/config/locales/it.json index 0c91363..b4fbccc 100644 --- a/config/locales/it.json +++ b/config/locales/it.json @@ -55,6 +55,14 @@ "disabled": "La funzionalità dell'emulatore web è stata disabilitata dall'amministratore.", "contact": "Contatta l'amministratore o avvia la tua istanza di Myrient Search." }, + "ai": { + "title": "Assistente IA", + "description": "Questo sito web dispone di un assistente potenziato dall'IA che può aiutarti a trovare giochi, fornire raccomandazioni e rispondere a domande sul gaming retrò.", + "provider_info": "Alimentato da {{provider}} utilizzando il modello {{model}}.", + "privacy_note": "L'assistente IA è alimentato da un servizio esterno. Si prega di fare riferimento alla politica sulla privacy del servizio per ulteriori informazioni.", + "disabled": "La funzionalità Assistente IA è stata disabilitata dall'amministratore.", + "contact": "Contatta l'amministratore o avvia la tua istanza di Myrient Search." + }, "credits": { "created_by": "Motore di ricerca creato da", "view_github": "Visualizza progetto su GitHub" diff --git a/config/locales/ja.json b/config/locales/ja.json index a72e61a..99344a9 100644 --- a/config/locales/ja.json +++ b/config/locales/ja.json @@ -55,6 +55,14 @@ "disabled": "ウェブエミュレータ機能は管理者によって無効化されています。", "contact": "管理者にお問い合わせいただくか、ご自身でMyrient Searchのインスタンスを立ち上げてください。" }, + "ai": { + "title": "AIアシスタント", + "description": "このウェブサイトには、ゲームを見つけたり、おすすめを提供したり、レトロゲームに関する質問に答えたりできるAI搭載アシスタントが搭載されています。", + "provider_info": "{{model}}モデルを使用した{{provider}}によって提供されています。", + "privacy_note": "AIアシスタントは外部サービスによって提供されています。詳細については、サービスのプライバシーポリシーをご参照ください。", + "disabled": "AIアシスタント機能は管理者によって無効化されています。", + "contact": "管理者にお問い合わせいただくか、独自のMyrient Searchインスタンスを立ち上げてください。" + }, "credits": { "created_by": "検索エンジン開発者:", "view_github": "GitHubでプロジェクトを見る" diff --git a/config/locales/ko.json b/config/locales/ko.json index c92226f..c288d92 100644 --- a/config/locales/ko.json +++ b/config/locales/ko.json @@ -55,6 +55,14 @@ "disabled": "웹 에뮬레이터 기능이 관리자에 의해 비활성화되었습니다.", "contact": "관리자에게 문의하거나 직접 Myrient Search 인스턴스를 설치해 보세요." }, + "ai": { + "title": "AI 어시스턴트", + "description": "이 웹사이트는 게임을 찾고, 추천을 제공하며, 레트로 게임에 대한 질문에 답할 수 있는 AI 기반 어시스턴트를 제공합니다.", + "provider_info": "{{model}} 모델을 사용하는 {{provider}}에 의해 구동됩니다.", + "privacy_note": "AI 어시스턴트는 외부 서비스에 의해 구동됩니다. 자세한 정보는 해당 서비스의 개인정보 보호정책을 참조하세요.", + "disabled": "AI 어시스턴트 기능이 관리자에 의해 비활성화되었습니다.", + "contact": "관리자에게 문의하거나 자신만의 Myrient Search 인스턴스를 실행하세요." + }, "credits": { "created_by": "검색 엔진 개발자:", "view_github": "GitHub에서 프로젝트 보기" diff --git a/config/locales/pl.json b/config/locales/pl.json index fa179c0..9d68585 100644 --- a/config/locales/pl.json +++ b/config/locales/pl.json @@ -55,6 +55,14 @@ "disabled": "Funkcja emulatora internetowego została wyłączona przez administratora.", "contact": "Skontaktuj się z administratorem lub uruchom własną instancję Myrient Search." }, + "ai": { + "title": "Asystent AI", + "description": "Ta strona internetowa posiada asystenta zasilanego przez AI, który może pomóc w znalezieniu gier, dostarczaniu rekomendacji i odpowiadaniu na pytania dotyczące retro gamingu.", + "provider_info": "Zasilany przez {{provider}} używający modelu {{model}}.", + "privacy_note": "Asystent AI jest zasilany przez zewnętrzną usługę. Aby uzyskać więcej informacji, zapoznaj się z polityką prywatności usługi.", + "disabled": "Funkcjonalność Asystenta AI została wyłączona przez administratora.", + "contact": "Skontaktuj się z administratorem lub uruchom własną instancję Myrient Search." + }, "credits": { "created_by": "Wyszukiwarka stworzona przez", "view_github": "Zobacz projekt na GitHub" diff --git a/config/locales/pt.json b/config/locales/pt.json index 2faf75e..d9e2320 100644 --- a/config/locales/pt.json +++ b/config/locales/pt.json @@ -55,6 +55,14 @@ "disabled": "A funcionalidade do emulador web foi desativada pelo administrador.", "contact": "Entre em contato com o administrador ou crie sua própria instância do Myrient Search." }, + "ai": { + "title": "Assistente de IA", + "description": "Este site possui um assistente de IA que pode ajudá-lo a encontrar jogos, fornecer recomendações e responder perguntas sobre jogos retrô.", + "provider_info": "O assistente é alimentado por {{provider}} usando o modelo {{model}}.", + "privacy_note": "O assistente de IA é fornecido por um serviço externo. Por favor, consulte a política de privacidade do serviço para mais informações.", + "disabled": "A funcionalidade do assistente de IA foi desabilitada pelo administrador.", + "contact": "Entre em contato com o administrador ou execute sua própria instância do Myrient Search." + }, "credits": { "created_by": "Buscador criado por", "view_github": "Ver projeto no GitHub" diff --git a/config/locales/romaji.json b/config/locales/romaji.json index 646e1ee..e251b78 100644 --- a/config/locales/romaji.json +++ b/config/locales/romaji.json @@ -55,6 +55,14 @@ "disabled": "Webu emyurēta kinō wa kanrisha ni yotte mukouka sareteimasu.", "contact": "Kanrisha ni otoiawase itadaku ka, go jishin de Myrient Search no insutansu wo tachiagetekudasai." }, + "ai": { + "title": "AI Ashisutanto", + "description": "Kono websaito ni wa, geemu wo mitsukete, osusume wo teikyou shite, retoro geemu ni kansuru shitsumon ni kotaeru koto ga dekiru AI-shihaisha ga tousai sarete imasu.", + "provider_info": "{{model}} moderu wo shiyou shita {{provider}} ni yotte teikyou sarete imasu.", + "privacy_note": "AI ashisutanto wa gaibu saabisu ni yotte teikyou sarete imasu. Shousai ni tsuite wa, saabisu no puraibashii porishii wo go-sanshou kudasai.", + "disabled": "AI ashisutanto kinou wa kanrisha ni yotte mukouka sarete imasu.", + "contact": "Kanrisha ni otoiawase itadaku ka, dokuji no Myrient Search insutansu wo tachiagete kudasai." + }, "credits": { "created_by": "Kensaku enjin kaihatsusha:", "view_github": "GitHub de purojekuto wo miru" diff --git a/config/locales/ru.json b/config/locales/ru.json index 7040264..40f7c96 100644 --- a/config/locales/ru.json +++ b/config/locales/ru.json @@ -55,6 +55,14 @@ "disabled": "Функция веб-эмулятора отключена администратором.", "contact": "Свяжитесь с администратором или запустите собственный экземпляр Myrient Search." }, + "ai": { + "title": "ИИ Помощник", + "description": "Этот веб-сайт оснащен ИИ-помощником, который может помочь вам находить игры, предоставлять рекомендации и отвечать на вопросы о ретро-играх.", + "provider_info": "Работает на базе {{provider}} с использованием модели {{model}}.", + "privacy_note": "ИИ-помощник работает на базе внешнего сервиса. Пожалуйста, обратитесь к политике конфиденциальности сервиса для получения дополнительной информации.", + "disabled": "Функциональность ИИ-помощника была отключена администратором.", + "contact": "Свяжитесь с администратором или запустите собственный экземпляр Myrient Search." + }, "credits": { "created_by": "Поисковая система создана", "view_github": "Посмотреть проект на GitHub" diff --git a/config/locales/tr.json b/config/locales/tr.json index b409e84..7392e23 100644 --- a/config/locales/tr.json +++ b/config/locales/tr.json @@ -55,6 +55,14 @@ "disabled": "Web Emülatörü işlevi yönetici tarafından devre dışı bırakıldı.", "contact": "Yöneticiyle iletişime geçin veya kendi Myrient Search örneğinizi kurun." }, + "ai": { + "title": "AI Asistanı", + "description": "Bu web sitesi, oyun bulmanıza, öneriler sunmanıza ve retro oyunlar hakkındaki sorularınızı yanıtlamanıza yardımcı olabilecek AI destekli bir asistana sahiptir.", + "provider_info": "{{model}} modelini kullanan {{provider}} tarafından desteklenmektedir.", + "privacy_note": "AI asistanı harici bir hizmet tarafından desteklenmektedir. Daha fazla bilgi için lütfen hizmetin gizlilik politikasına bakın.", + "disabled": "AI Asistanı işlevselliği yönetici tarafından devre dışı bırakılmıştır.", + "contact": "Yönetici ile iletişime geçin veya kendi Myrient Search örneğinizi çalıştırın." + }, "credits": { "created_by": "Arama motoru şu kişi tarafından oluşturuldu:", "view_github": "Projeyi GitHub'da görüntüle" diff --git a/config/locales/zh.json b/config/locales/zh.json index b595c14..2f061f5 100644 --- a/config/locales/zh.json +++ b/config/locales/zh.json @@ -55,6 +55,14 @@ "disabled": "网页模拟器功能已被管理员禁用。", "contact": "请联系管理员或自行部署Myrient Search实例。" }, + "ai": { + "title": "AI助手", + "description": "该网站配备了AI助手,可以帮助您查找游戏、提供推荐并回答有关复古游戏的问题。", + "provider_info": "由{{provider}}提供支持,使用{{model}}模型。", + "privacy_note": "AI助手由外部服务提供支持。更多信息请参阅服务的隐私政策。", + "disabled": "AI助手功能已被管理员禁用。", + "contact": "请联系管理员或运行您自己的Myrient Search实例。" + }, "credits": { "created_by": "搜索引擎开发者:", "view_github": "在GitHub上查看项目" diff --git a/server.js b/server.js index 8237ff3..6a3293f 100644 --- a/server.js +++ b/server.js @@ -150,6 +150,11 @@ let defaultOptions = { isEmulatorCompatible: isEmulatorCompatible, isNonGameContent: isNonGameContent, nonGameTerms: nonGameTerms, + aiEnabled: process.env.AI_ENABLED === 'true', + aiConfig: { + apiUrl: process.env.AI_API_URL || 'https://example.com', + model: process.env.AI_MODEL || 'default', + }, }; function updateDefaults() { diff --git a/views/pages/about.ejs b/views/pages/about.ejs index 7961ed5..3838a2a 100644 --- a/views/pages/about.ejs +++ b/views/pages/about.ejs @@ -24,40 +24,99 @@
<%= __('about.emulator.title') %>
<% if (process.env.EMULATOR_ENABLED === 'true') { %> -

<%= __('about.emulator.description') %>

-

<%= __('about.emulator.compatibility') %>

+

<%= __('about.emulator.description') %>

+

<%= __('about.emulator.compatibility') %>

-

<%= __('about.emulator.browser_tip') %>

+

<%= __('about.emulator.browser_tip') %>

-

- - - <%= __('about.emulator.save_states') %> - -
- - - <%= __('about.emulator.limitations') %> - -

+

+ + + <%= __('about.emulator.save_states') %> + +
+ + + <%= __('about.emulator.limitations') %> + +

<% } else { %> -

<%= __('about.emulator.disabled') %>

-

<%= __('about.emulator.contact') %>

+

<%= __('about.emulator.disabled') %>

+

<%= __('about.emulator.contact') %>

+ <% } %> +
+ +
+
<%= __('about.ai.title') %>
+ <% if (aiEnabled) { %> + <% + // Extract provider from API URL + let provider = 'Unknown'; + if (aiConfig.apiUrl.includes('api.groq.com')) { + provider = 'Groq'; + } else if (aiConfig.apiUrl.includes('api.openai.com')) { + provider = 'OpenAI'; + } else if (aiConfig.apiUrl.includes('api.anthropic.com')) { + provider = 'Anthropic'; + } else if (aiConfig.apiUrl.includes('generativelanguage.googleapis.com')) { + provider = 'Google Gemini'; + } else if (aiConfig.apiUrl.includes('api.perplexity.ai')) { + provider = 'Perplexity'; + } else if (aiConfig.apiUrl.includes('api.cohere.ai')) { + provider = 'Cohere'; + } else if (aiConfig.apiUrl.includes('api.mistral.ai')) { + provider = 'Mistral'; + } else if (aiConfig.apiUrl.includes('localhost') || aiConfig.apiUrl.includes('127.0.0.1') || aiConfig.apiUrl.includes('0.0.0.0')) { + provider = 'Local LLM'; + } else { + // Try to extract domain from URL + try { + const url = new URL(aiConfig.apiUrl); + const hostname = url.hostname; + if (hostname.startsWith('api.')) { + provider = hostname.substring(4).split('.')[0]; + } else { + provider = hostname.split('.')[0]; + } + provider = provider.charAt(0).toUpperCase() + provider.slice(1); + } catch (e) { + provider = 'Custom Provider'; + } + } + %> +

<%= __('about.ai.description') %>

+

<%- __('about.ai.provider_info', {provider: provider, model: aiConfig.model}) %>

+ +

+ + + <%= __('about.ai.privacy_note') %> + +

+ + <% } else { %> +

<%= __('about.ai.disabled') %>

+

<%= __('about.ai.contact') %>

<% } %>
-

<%= __('about.credits.created_by') %> Alexankitty

+

<%= __('about.credits.created_by') %> Alexankitty +

-

<%= __('about.credits.view_github') %>

+

<%= __('about.credits.view_github') %> +

Buy Me a Coffee at ko-fi.com + src='/proxy-image?url=<%= encodeURIComponent("https://storage.ko-fi.com/cdn/kofi5.png?v=3") %>' + alt='Buy Me a Coffee at ko-fi.com' />
diff --git a/views/pages/index.ejs b/views/pages/index.ejs index 6d980a4..563dfce 100644 --- a/views/pages/index.ejs +++ b/views/pages/index.ejs @@ -21,6 +21,7 @@ <%- include('../partials/footer'); %> +<% if (aiEnabled) { %> +<% } %> +<% if (aiEnabled) { %> +<% } %> + +<% if (aiEnabled) { %> +<% } %> +<% if (aiEnabled) { %> +<% } %> \ No newline at end of file