This commit is contained in:
Saifeddine ALOUI 2025-01-13 23:43:32 +01:00
parent 8c92c3056b
commit 95a265db4d
6 changed files with 531 additions and 615 deletions

File diff suppressed because one or more lines are too long

8
web/dist/assets/index-D0hRKIH3.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
web/dist/index.html vendored
View File

@ -6,8 +6,8 @@
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI</title>
<script type="module" crossorigin src="/assets/index-CF61mWQQ.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-WwR15mI_.css">
<script type="module" crossorigin src="/assets/index-Bq0XZKQz.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D0hRKIH3.css">
</head>
<body>
<div id="app"></div>

View File

@ -27,88 +27,7 @@
</svg>
</button>
<Navigation></Navigation>
<div class="toolbar-button" @mouseleave="hideInfosMenu">
<div class="relative inline-block">
<!-- Infos menu positioned above the button -->
<div v-if="isInfosMenuVisible" @mouseenter="showInfosMenu" class="absolute context-menu m-0 p-0 z-50 top-full right-0 transform rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2">
<div class="p-4 container flex flex-col lg:flex-row items-center gap-2">
<!-- SYSTEM STATUS -->
<div class="flex gap-3 flex-1 items-center justify-end">
<div v-if="isModelOK" title="Model is ok" class="btn-on cursor-pointer transition-transform hover:scale-110">
<svg class="w-8 h-8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9 12L11 14L15 10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div v-else title="Model is not ok" class="btn-off cursor-pointer transition-transform hover:scale-110">
<svg class="w-8 h-8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M15 9L9 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9 9L15 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div v-if="!isGenerating" title="Text is not being generated. Ready to generate" class="btn-on cursor-pointer transition-transform hover:scale-110">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"></path>
</svg>
</div>
<div v-else title="Generation in progress..." class="svg-button cursor-pointer transition-transform hover:scale-110">
<svg class="w-6 h-6 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
</svg>
</div>
<div v-if="isConnected" title="Connection status: Connected" class="btn-on cursor-pointer transition-transform hover:scale-110">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
</div>
<div v-else title="Connection status: Not connected" class="btn-off cursor-pointer transition-transform hover:scale-110">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"></path>
</svg>
</div>
</div>
<div class="flex items-center space-x-4">
<ActionButton @click="restartProgram" icon="power" title="restart program" />
<ActionButton @click="refreshPage" icon="refresh-ccw" title="refresh page" />
<ActionButton href="/docs" icon="file-text" title="Fast API doc" />
</div>
<!-- SOCIALS -->
<SocialIcon href="https://github.com/ParisNeo/lollms-webui" icon="github" />
<SocialIcon href="https://www.youtube.com/channel/UCJzrg0cyQV2Z30SQ1v2FdSQ" icon="youtube" />
<SocialIcon href="https://x.com/ParisNeo_AI" icon="x" />
<SocialIcon href="https://discord.com/channels/1092918764925882418" icon="discord" />
<div class="relative group" title="Lollms News">
<div @click="showNews()" class="text-2xl w-8 h-8 cursor-pointer transition-colors duration-300 svg-button">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-full h-full">
<path d="M19 20H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1m2 13a2 2 0 0 1-2-2V7m2 13a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"></path>
</svg>
</div>
<span class="absolute hidden group-hover:block text-xs rounded py-1 px-2 top-full left-1/2 transform -translate-x-1/2 mt-2 whitespace-nowrap">
Lollms News
</span>
</div>
</div>
</div>
<!-- Info Button -->
<div @mouseenter="showInfosMenu" class="infos-hover-area">
<button class="w-6 h-6">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="w-full h-full">
<!-- Circle background -->
<circle cx="12.5" cy="12.5" r="11.25" fill="#3498db"/>
<!-- "i" stem -->
<rect x="11.25" y="10" width="2.5" height="8.75" fill="white"/>
<!-- "i" dot -->
<circle cx="12.5" cy="6.25" r="1.25" fill="white"/>
</svg>
</button>
</div>
</div>
</div>
<div style="margin: 20px;">
<div>
<a
href="https://github.com/ParisNeo/lollms-webui"
target="_blank"
@ -125,34 +44,60 @@
<span class="font-medium" v-if="starCount">{{ starCount }}</span>
</a>
</div>
<div v-if="is_fun_mode"
title="Fun mode is on, press to turn off"
class="w-8 h-8 cursor-pointer btn-on transition-colors duration-300"
@click="fun_mode_off()"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-full h-full animate-bounce">
<circle cx="12" cy="12" r="10"></circle>
<path d="M8 14s1.5 2 4 2 4-2 4-2"></path>
<line x1="9" y1="9" x2="9.01" y2="9"></line>
<line x1="15" y1="9" x2="15.01" y2="9"></line>
</svg>
</div>
<div
v-else
title="Fun mode is off, press to turn on"
class="w-8 h-8 cursor-pointer btn-off transition-colors duration-300"
@click="fun_mode_on()"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-full h-full">
<circle cx="12" cy="12" r="10"></circle>
<line x1="8" y1="15" x2="16" y2="15"></line>
<line x1="9" y1="9" x2="9.01" y2="9"></line>
<line x1="15" y1="9" x2="15.01" y2="9"></line>
</svg>
</div>
<span class="absolute hidden group-hover:block text-xs rounded py-1 px-2 top-full left-1/2 transform -translate-x-1/2 mb-2 whitespace-nowrap">
{{ is_fun_mode ? 'Turn off fun mode' : 'Turn on fun mode' }}
</span>
<div class="relative">
<div v-if="is_fun_mode"
title="Fun mode is on, press to turn off"
class="w-10 h-10 cursor-pointer transform transition-all duration-300
hover:scale-110 active:scale-95 bg-yellow-400 rounded-full p-1
hover:bg-yellow-300 dark:hover:bg-yellow-500"
@click="fun_mode_off()"
>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
class="w-full h-full text-white animate-bounce"
>
<circle cx="12" cy="12" r="10" stroke="black" stroke-width="1.5"/>
<path d="M7 14c0 3 4 4 5 4s5-1 5-4M9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm8 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"
stroke="black" stroke-width="1.5"/>
</svg>
</div>
<div
v-else
title="Fun mode is off, press to turn on"
class="w-10 h-10 cursor-pointer rounded-full
hover:bg-gray-100 dark:hover:bg-gray-800
transform transition-all duration-300
hover:scale-110 active:scale-95 p-1"
@click="fun_mode_on()"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2.5"
class="w-full h-full transition-colors duration-300"
>
<circle cx="12" cy="12" r="10"/>
<line x1="8" y1="14" x2="16" y2="14"/>
<circle cx="9" cy="9" r="1"/>
<circle cx="15" cy="9" r="1"/>
</svg>
</div>
<!-- Enhanced Tooltip -->
<div
class="absolute pointer-events-none opacity-0 group-hover:opacity-100
transition-opacity duration-200 -bottom-12 left-1/2 transform
-translate-x-1/2 bg-gray-900 text-white px-3 py-1.5 rounded-lg
text-sm whitespace-nowrap shadow-xl z-50"
>
<div class="absolute -top-2 left-1/2 transform -translate-x-1/2
border-solid border-4 border-transparent border-b-gray-900"/>
{{ is_fun_mode ? 'Disable fun mode' : 'Enable fun mode' }}
</div>
</div>
<div v-if="isDarkMode" class="text-2xl svg-button hover:text-primary duration-150 cursor-pointer w-50 h-50 ml-2" title="Switch to Light theme" @click="themeSwitch()">
<i data-feather="sun"></i>
</div>
@ -311,7 +256,88 @@
</div>
</transition>
</div>
<div class="toolbar-button" @mouseleave="hideInfosMenu">
<div class="relative inline-block">
<!-- Infos menu positioned above the button -->
<div v-if="isInfosMenuVisible" @mouseenter="showInfosMenu" class="absolute context-menu m-0 p-0 z-50 top-full right-0 transform rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none transition-all duration-300 ease-out mb-2">
<div class="p-4 container flex flex-col lg:flex-row items-center gap-2">
<!-- SYSTEM STATUS -->
<div class="flex gap-3 flex-1 items-center justify-end">
<div v-if="isModelOK" title="Model is ok" class="btn-on cursor-pointer transition-transform hover:scale-110">
<svg class="w-8 h-8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9 12L11 14L15 10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div v-else title="Model is not ok" class="btn-off cursor-pointer transition-transform hover:scale-110">
<svg class="w-8 h-8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M15 9L9 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9 9L15 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div v-if="!isGenerating" title="Text is not being generated. Ready to generate" class="btn-on cursor-pointer transition-transform hover:scale-110">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"></path>
</svg>
</div>
<div v-else title="Generation in progress..." class="svg-button cursor-pointer transition-transform hover:scale-110">
<svg class="w-6 h-6 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
</svg>
</div>
<div v-if="isConnected" title="Connection status: Connected" class="btn-on cursor-pointer transition-transform hover:scale-110">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
</svg>
</div>
<div v-else title="Connection status: Not connected" class="btn-off cursor-pointer transition-transform hover:scale-110">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"></path>
</svg>
</div>
</div>
<div class="flex items-center space-x-4">
<ActionButton @click="restartProgram" icon="power" title="restart program" />
<ActionButton @click="refreshPage" icon="refresh-ccw" title="refresh page" />
<ActionButton href="/docs" icon="file-text" title="Fast API doc" />
</div>
<!-- SOCIALS -->
<SocialIcon href="https://github.com/ParisNeo/lollms-webui" icon="github" />
<SocialIcon href="https://www.youtube.com/channel/UCJzrg0cyQV2Z30SQ1v2FdSQ" icon="youtube" />
<SocialIcon href="https://x.com/ParisNeo_AI" icon="x" />
<SocialIcon href="https://discord.com/channels/1092918764925882418" icon="discord" />
<div class="relative group" title="Lollms News">
<div @click="showNews()" class="text-2xl w-8 h-8 cursor-pointer transition-colors duration-300 svg-button">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-full h-full">
<path d="M19 20H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1m2 13a2 2 0 0 1-2-2V7m2 13a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"></path>
</svg>
</div>
<span class="absolute hidden group-hover:block text-xs rounded py-1 px-2 top-full left-1/2 transform -translate-x-1/2 mt-2 whitespace-nowrap">
Lollms News
</span>
</div>
</div>
</div>
<!-- Info Button -->
<div @mouseenter="showInfosMenu" class="infos-hover-area">
<button class="w-6 h-6">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="w-full h-full">
<!-- Circle background -->
<circle cx="12.5" cy="12.5" r="11.25" fill="#3498db"/>
<!-- "i" stem -->
<rect x="11.25" y="10" width="2.5" height="8.75" fill="white"/>
<!-- "i" dot -->
<circle cx="12.5" cy="6.25" r="1.25" fill="white"/>
</svg>
</button>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -2008,293 +2008,182 @@
</Card>
<Card title="Lollms service" :is_shrunk="true" :is_subcard="true" class="pb-2 m-2">
<table class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
<tr>
<td style="min-width: 200px;">
<label for="host" class="text-sm font-bold" style="margin-right: 1rem;">Host:</label>
</td>
<td style="width: 100%;">
<input
type="text"
id="host"
required
v-model="configFile.host"
@change="settingsChanged=true"
class="w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="lollms_access_keys" class="text-sm font-bold" style="margin-right: 1rem;">Access keys:</label>
</td>
<td style="width: 100%;">
<StringListManager
v-model="configFile.lollms_access_keys"
@change="settingsChanged = true"
placeholder="Enter access key"
/>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="port" class="text-sm font-bold" style="margin-right: 1rem;">Port:</label>
</td>
<td style="width: 100%;">
<input
type="number"
step="1"
id="port"
required
v-model="configFile.port"
@change="settingsChanged=true"
class="w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="headless_server_mode" class="text-sm font-bold" style="margin-right: 1rem;">Activate headless server mode:</label>
</td>
<td style="width: 100%;">
<input
type="checkbox"
id="headless_server_mode"
required
v-model="configFile.headless_server_mode"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="activate_lollms_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms server:</label>
</td>
<td style="width: 100%;">
<div class="grid gap-4 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg shadow-md">
<div class="grid grid-cols-[200px,1fr] items-center gap-4">
<label for="host" class="font-semibold text-gray-700 dark:text-gray-200">Host:</label>
<input
type="checkbox"
id="activate_lollms_server"
type="text"
id="host"
required
v-model="configFile.activate_lollms_server"
v-model="configFile.host"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
class="input-field"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="activate_lollms_rag_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms RAG server:</label>
</td>
<td style="width: 100%;">
<input
type="checkbox"
id="activate_lollms_rag_server"
required
v-model="configFile.activate_lollms_rag_server"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="activate_lollms_tts_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms TTS server:</label>
</td>
<td style="width: 100%;">
<input
type="checkbox"
id="activate_lollms_tts_server"
required
v-model="configFile.activate_lollms_tts_server"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="activate_lollms_stt_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms STT server:</label>
</td>
<td style="width: 100%;">
<input
type="checkbox"
id="activate_lollms_stt_server"
required
v-model="configFile.activate_lollms_stt_server"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="activate_lollms_tti_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms TTI server:</label>
</td>
<td style="width: 100%;">
<input
type="checkbox"
id="activate_lollms_tti_server"
required
v-model="configFile.activate_lollms_tti_server"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="activate_lollms_itt_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms ITT server:</label>
</td>
<td style="width: 100%;">
<input
type="checkbox"
id="activate_lollms_itt_server"
required
v-model="configFile.activate_lollms_itt_server"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="activate_lollms_ttm_server" class="text-sm font-bold" style="margin-right: 1rem;">Activate lollms TTM server:</label>
</td>
<td style="width: 100%;">
<input
type="checkbox"
id="activate_lollms_ttm_server"
required
v-model="configFile.activate_lollms_ttm_server"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
</div>
<div class="grid grid-cols-[200px,1fr] items-center gap-4">
<label for="lollms_access_keys" class="font-semibold text-gray-700 dark:text-gray-200">Access keys:</label>
<StringListManager
v-model="configFile.lollms_access_keys"
@change="settingsChanged = true"
placeholder="Enter access key"
/>
</div>
<div class="grid grid-cols-[200px,1fr] items-center gap-4">
<label for="port" class="font-semibold text-gray-700 dark:text-gray-200">Port:</label>
<input
type="number"
step="1"
id="port"
required
v-model="configFile.port"
@change="settingsChanged=true"
class="input-field"
>
</div>
<div class="grid grid-cols-[200px,1fr] items-center gap-4">
<span class="font-semibold text-gray-700 dark:text-gray-200">Server Configuration:</span>
<div class="space-y-3">
<label class="flex items-center space-x-2 cursor-pointer">
<input
type="checkbox"
v-model="configFile.headless_server_mode"
@change="settingsChanged=true"
class="w-4 h-4 rounded accent-blue-500"
>
<span class="text-sm text-gray-600 dark:text-gray-300">Headless Server Mode</span>
</label>
<label class="flex items-center space-x-2 cursor-pointer">
<input
type="checkbox"
v-model="configFile.activate_lollms_server"
@change="settingsChanged=true"
class="w-4 h-4 rounded accent-blue-500"
>
<span class="text-sm text-gray-600 dark:text-gray-300">LoLLMS Server</span>
</label>
<!-- LoLLMS Services -->
<div class="pl-6 space-y-2 border-l-2 border-gray-200 dark:border-gray-600">
<label v-for="service in ['rag', 'tts', 'stt', 'tti', 'itt', 'ttm']"
:key="service"
class="flex items-center space-x-2 cursor-pointer">
<input
type="checkbox"
:id="`activate_lollms_${service}_server`"
v-model="configFile[`activate_lollms_${service}_server`]"
@change="settingsChanged=true"
class="w-4 h-4 rounded accent-blue-500"
>
<span class="text-sm text-gray-600 dark:text-gray-300">{{ service.toUpperCase() }} Server</span>
</label>
</div>
</div>
</div>
<div class="grid grid-cols-[200px,1fr] items-center gap-4">
<span class="font-semibold text-gray-700 dark:text-gray-200">Emulators:</span>
<div class="space-y-3">
<label v-for="emulator in ['ollama', 'openai', 'mistralai']"
:key="emulator"
class="flex items-center space-x-2 cursor-pointer">
<input
type="checkbox"
:id="`activate_${emulator}_emulator`"
v-model="configFile[`activate_${emulator}_emulator`]"
@change="settingsChanged=true"
class="w-4 h-4 rounded accent-blue-500"
>
<span class="text-sm text-gray-600 dark:text-gray-300">{{ emulator.charAt(0).toUpperCase() + emulator.slice(1) }} Emulator</span>
</label>
</div>
</div>
</div>
<tr>
<td style="min-width: 200px;">
<label for="activate_ollama_emulator" class="text-sm font-bold" style="margin-right: 1rem;">Activate ollama server emulator:</label>
</td>
<td style="width: 100%;">
<input
type="checkbox"
id="activate_ollama_emulator"
required
v-model="configFile.activate_ollama_emulator"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="activate_openai_emulator" class="text-sm font-bold" style="margin-right: 1rem;">Activate openai server emulator:</label>
</td>
<td style="width: 100%;">
<input
type="checkbox"
id="activate_openai_emulator"
required
v-model="configFile.activate_openai_emulator"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="activate_mistralai_emulator" class="text-sm font-bold" style="margin-right: 1rem;">Activate mistral ai server emulator:</label>
</td>
<td style="width: 100%;">
<input
type="checkbox"
id="activate_mistralai_emulator"
required
v-model="configFile.activate_mistralai_emulator"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
</table>
</Card>
<Card title="STT services" :is_shrunk="true" :is_subcard="true" class="pb-2 m-2">
<Card title="Browser Audio STT" :is_subcard="true" class="pb-2 m-2">
<table class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
<tr>
<td style="min-width: 200px;">
<label for="activate_audio_infos" class="text-sm font-bold" style="margin-right: 1rem;">Activate audio infos:</label>
</td>
<td>
<div class="flex flex-row">
<input
type="checkbox"
id="activate_audio_infos"
required
v-model="configFile.activate_audio_infos"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</div>
</td>
</tr>
<div class="space-y-6 p-6 bg-white dark:bg-gray-800 rounded-lg shadow-md">
<!-- Activate Audio Infos -->
<div class="flex items-center justify-between">
<label for="activate_audio_infos" class="text-sm font-medium text-gray-700 dark:text-gray-200">
Activate audio infos
</label>
<label class="relative inline-flex items-center cursor-pointer">
<input
type="checkbox"
id="activate_audio_infos"
v-model="configFile.activate_audio_infos"
@change="settingsChanged=true"
class="sr-only peer"
>
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
</label>
</div>
<tr>
<td style="min-width: 200px;">
<label for="audio_auto_send_input" class="text-sm font-bold" style="margin-right: 1rem;">Send audio input automatically:</label>
</td>
<td>
<div class="flex flex-row">
<input
type="checkbox"
id="audio_auto_send_input"
required
v-model="configFile.audio_auto_send_input"
@change="settingsChanged=true"
class="mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
<!-- Auto Send Audio Input -->
<div class="flex items-center justify-between">
<label for="audio_auto_send_input" class="text-sm font-medium text-gray-700 dark:text-gray-200">
Send audio input automatically
</label>
<label class="relative inline-flex items-center cursor-pointer">
<input
type="checkbox"
id="audio_auto_send_input"
v-model="configFile.audio_auto_send_input"
@change="settingsChanged=true"
class="sr-only peer"
>
<div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"></div>
</label>
</div>
<!-- Silence Timer -->
<div class="space-y-2">
<label for="audio_silenceTimer" class="text-sm font-medium text-gray-700 dark:text-gray-200">
Audio silence timer (ms): {{ configFile.audio_silenceTimer }}ms
</label>
<div class="flex flex-col gap-4">
<input
id="audio_silenceTimer"
v-model="configFile.audio_silenceTimer"
@change="settingsChanged=true"
type="range"
min="0"
max="10000"
step="1"
class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 accent-blue-600"
>
<input
v-model="configFile.audio_silenceTimer"
@change="settingsChanged=true"
type="number"
class="w-full px-3 py-2 bg-gray-50 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
>
</div>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="audio_silenceTimer" class="text-sm font-bold" style="margin-right: 1rem;">audio in silence timer (ms):</label>
</td>
<td>
<input id="audio_silenceTimer" v-model="configFile.audio_silenceTimer"
@change="settingsChanged=true"
type="range" min="0" max="10000" step="1"
class="flex-none h-2 mt-14 mb-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500">
<input v-model="configFile.audio_silenceTimer"
@change="settingsChanged=true"
class="w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
>
</td>
</tr>
<tr>
<td style="min-width: 200px;">
<label for="audio_in_language" class="text-sm font-bold" style="margin-right: 1rem;">Input Audio Language:</label>
</td>
<td>
<!-- Select element for choosing the input audio language -->
</div>
<!-- Input Audio Language -->
<div class="space-y-2">
<label for="audio_in_language" class="text-sm font-medium text-gray-700 dark:text-gray-200">
Input Audio Language
</label>
<select
id="audio_in_language"
v-model="configFile.audio_in_language"
@change="settingsChanged=true"
class="w-full mt-1 px-2 py-1 border border-gray-300 rounded dark:bg-gray-600"
class="w-full px-3 py-2 bg-gray-50 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
>
<!-- Options with language codes and corresponding language names -->
<option v-for="language in audioLanguages" :key="language.code" :value="language.code">
{{ language.name }}
{{ language.name }}
</option>
</select>
</td>
</tr>
</table>
</div>
</div>
</Card>
<Card title="Whisper audio transcription" :is_subcard="true" class="pb-2 m-2">
@ -4200,7 +4089,9 @@
/>
</template>
<style scoped>
.input-field {
@apply w-full px-3 py-2 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent dark:text-white transition-colors duration-200;
}
.heartbeat-text {
font-size: 24px;
animation: pulsate 1.5s infinite;
@ -7185,4 +7076,3 @@ export default {
},
}
</script>