mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-04-09 03:44:19 +00:00
sync
This commit is contained in:
parent
9ff12d042b
commit
067bc60ec8
7
web/dist/assets/fun_mode-14669a57.svg
vendored
Normal file
7
web/dist/assets/fun_mode-14669a57.svg
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg fill="#000000" width="800px" height="800px" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
|
||||
<g data-name="Layer 5" id="Layer_5">
|
||||
<path d="M47,33H17a1,1,0,0,0-1,1c0,9.93,7.18,18,16,18s16-8.07,16-18A1,1,0,0,0,47,33ZM18,35H46a18,18,0,0,1-.67,4H18.71A18,18,0,0,1,18,35ZM26.7,48.8a6.42,6.42,0,0,1,10.6,0,12.3,12.3,0,0,1-10.6,0Zm12.34-1A8.81,8.81,0,0,0,32,44a8.81,8.81,0,0,0-7,3.81A15.56,15.56,0,0,1,19.43,41H44.57A15.56,15.56,0,0,1,39,47.81ZM36,22a1.1,1.1,0,0,1,0-.18,1.17,1.17,0,0,1,.06-.2s0-.05,0-.07a.28.28,0,0,1,.07-.09.71.71,0,0,1,.28-.28s.06-.06.09-.07l10-5a1,1,0,1,1,.9,1.78L39.24,22l8.21,4.11a1,1,0,0,1,.44,1.34A1,1,0,0,1,47,28a.93.93,0,0,1-.45-.11l-10-5h0a1.18,1.18,0,0,1-.28-.22l0-.06a.65.65,0,0,1-.1-.15s0-.05,0-.07a1.17,1.17,0,0,1-.06-.2A1.1,1.1,0,0,1,36,22ZM16.55,26.11,24.76,22l-8.21-4.11a1,1,0,1,1,.9-1.78l10,5s.06.05.09.07a.71.71,0,0,1,.28.28.28.28,0,0,1,.07.09s0,.05,0,.07a1.17,1.17,0,0,1,.06.2.82.82,0,0,1,0,.36,1.17,1.17,0,0,1-.06.2s0,.05,0,.07a.65.65,0,0,1-.1.15.21.21,0,0,0,0,.06,1.18,1.18,0,0,1-.28.22h0l-10,5A.93.93,0,0,1,17,28a1,1,0,0,1-.89-.55A1,1,0,0,1,16.55,26.11ZM60.66,36.45A29.69,29.69,0,0,0,61,32,29,29,0,0,0,3,32a29.69,29.69,0,0,0,.34,4.45,4.65,4.65,0,0,0,2.39,7.82,29,29,0,0,0,52.54,0,4.65,4.65,0,0,0,2.39-7.82ZM4.78,41.58a2.91,2.91,0,0,1-.24-.27A2.62,2.62,0,0,1,4,39.71a.61.61,0,0,1,0-.14,2.58,2.58,0,0,1,.77-1.73,4.38,4.38,0,0,1,.74-.55C7,36.38,10,34.9,12.69,33.67c-1.52,3.3-3.42,7.17-4.17,7.91a2.59,2.59,0,0,1-1.47.72A2.66,2.66,0,0,1,4.78,41.58ZM32,59A27,27,0,0,1,7.92,44.18a4.56,4.56,0,0,0,2-1.18c1.48-1.49,5-9.36,5.66-10.92a1,1,0,0,0-1.32-1.32c-.78.34-3.14,1.39-5.49,2.53-1.29.63-2.58,1.29-3.6,1.88A25.58,25.58,0,0,1,5,32a27,27,0,0,1,54,0,25.58,25.58,0,0,1-.19,3.17c-2.88-1.66-7.88-3.88-9.09-4.41a1,1,0,0,0-1.32,1.32c.69,1.56,4.18,9.43,5.66,10.92a4.56,4.56,0,0,0,2,1.18A27,27,0,0,1,32,59ZM59.46,41.31a2.91,2.91,0,0,1-.24.27A2.66,2.66,0,0,1,57,42.3a2.59,2.59,0,0,1-1.47-.72c-.75-.74-2.65-4.61-4.17-7.91,1.65.76,3.44,1.61,4.91,2.37.91.47,1.7.9,2.26,1.25a4.38,4.38,0,0,1,.74.55A2.58,2.58,0,0,1,60,39.57a.61.61,0,0,1,0,.14A2.62,2.62,0,0,1,59.46,41.31Z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
8
web/dist/assets/index-2aa3235a.css
vendored
Normal file
8
web/dist/assets/index-2aa3235a.css
vendored
Normal file
File diff suppressed because one or more lines are too long
8
web/dist/assets/index-90cddd3e.css
vendored
8
web/dist/assets/index-90cddd3e.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
44
web/dist/assets/normal_mode-f539f08d.svg
vendored
Normal file
44
web/dist/assets/normal_mode-f539f08d.svg
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg fill="#000000" height="800px" width="800px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
viewBox="0 0 512.001 512.001" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M256.001,0C114.841,0,0,114.841,0,256.001s114.841,256.001,256.001,256.001S512.001,397.16,512.001,256.001
|
||||
S397.16,0,256.001,0z M256.001,493.701c-131.069,0-237.702-106.631-237.702-237.7S124.932,18.299,256.001,18.299
|
||||
s237.702,106.632,237.702,237.702S387.068,493.701,256.001,493.701z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M371.284,296.658H138.275c-5.054,0-9.15,4.097-9.15,9.15s4.095,9.15,9.15,9.15h233.008c5.054,0,9.15-4.097,9.15-9.15
|
||||
C380.433,300.754,376.337,296.658,371.284,296.658z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M297.481,330.816h-85.403c-5.054,0-9.15,4.097-9.15,9.15s4.095,9.15,9.15,9.15h85.403c5.054,0,9.15-4.097,9.15-9.15
|
||||
S302.534,330.816,297.481,330.816z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M146.725,192.982c-18.666,0-33.852,15.186-33.852,33.852c0,18.666,15.186,33.852,33.852,33.852
|
||||
c18.666,0,33.852-15.186,33.852-33.852C180.577,208.168,165.391,192.982,146.725,192.982z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path d="M365.275,192.982c-18.666,0-33.852,15.186-33.852,33.852c0,18.666,15.186,33.852,33.852,33.852
|
||||
s33.852-15.186,33.852-33.852C399.128,208.168,383.942,192.982,365.275,192.982z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<circle cx="155.969" cy="219.735" r="9.15"/>
|
||||
<circle cx="374.338" cy="219.735" r="9.15"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
4
web/dist/index.html
vendored
4
web/dist/index.html
vendored
@ -6,8 +6,8 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LoLLMS WebUI - Welcome</title>
|
||||
<script type="module" crossorigin src="/assets/index-a480e6c0.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-90cddd3e.css">
|
||||
<script type="module" crossorigin src="/assets/index-a6a61709.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-2aa3235a.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
@ -2,39 +2,49 @@
|
||||
<!-- LIST OF MOUNTED PERSONALITIES -->
|
||||
|
||||
|
||||
<div class="w-fit select-none">
|
||||
|
||||
<div class="flex -space-x-4 " v-if="mountedPersArr.length > 1">
|
||||
<div class="w-fit flex select-none">
|
||||
<div class="w-8 h-8 group relative" >
|
||||
<img :src="bUrl + mountedPers.avatar" @error="personalityImgPlacehodler"
|
||||
class="w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-secondary cursor-pointer"
|
||||
:title="'Active personality: '+mountedPers.name" @click="onSettingsPersonality(mountedPers)">
|
||||
class="w-8 h-8 rounded-full object-fill text-red-700 border-2 hover:scale-150 active:scale-90 hover:z-50 hover:-translate-y-2 duration-150 border-secondary cursor-pointer"
|
||||
:title="'Active personality: '+mountedPers.name" @click="onSettingsPersonality(mountedPers)">
|
||||
<div class="opacity-0 group-hover:opacity-100">
|
||||
<button @click.prevent="remount_personality()" v-if="personalityHoveredIndex === index">
|
||||
<span
|
||||
class="-top-1 -right-8 border-gray-500 absolute active:scale-90 w-7 h-7 hover:scale-150 transition bg-bg-light dark:bg-bg-dark rounded-full border-2"
|
||||
title="Talk">
|
||||
<!-- UNMOUNT BUTTON -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="top-1 left-1 relative w-4 h-4 text-red-600 hover:text-red-500 " viewBox="0 0 30 30" width="2" height="2" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
|
||||
<g id="surface1">
|
||||
<path style=" " d="M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z "/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
</span>
|
||||
</button>
|
||||
|
||||
|
||||
<button @click.prevent="handleOnTalk()" v-if="personalityHoveredIndex === index">
|
||||
<span
|
||||
class="-top-1 -left-8 border-gray-500 active:scale-90 absolute items-center w-7 h-7 hover:scale-150 transition text-red-200 absolute active:scale-90 bg-bg-light dark:bg-bg-dark rounded-full border-2"
|
||||
title="Talk">
|
||||
<!-- UNMOUNT BUTTON -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="top-1 left-1 relative w-4 h-4 text-red-600 hover:text-red-500 " viewBox="0 0 24 24" width="2" height="2" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
|
||||
<line x1="22" y1="2" x2="11" y2="13"></line>
|
||||
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
|
||||
</svg>
|
||||
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<div class="flex items-center justify-center w-8 h-8 cursor-pointer text-xs font-medium bg-bg-light dark:bg-bg-dark border-2 hover:border-secondary rounded-full hover:bg-bg-light-tone dark:hover:bg-bg-dark-tone dark:border-gray-800 hover:z-20 hover:-translate-y-2 duration-150 active:scale-90"
|
||||
@click.stop="toggleShowPersList" title="Click to show more">+{{ mountedPersArr.length - 1 }}</div>
|
||||
</div>
|
||||
<div class="flex -space-x-4 " v-if="mountedPersArr.length == 1">
|
||||
<img :src="bUrl + this.$store.state.mountedPers.avatar" @error="personalityImgPlacehodler"
|
||||
class="w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 cursor-pointer border-secondary"
|
||||
:title="'Active personality: '+this.$store.state.mountedPers.name" @click.stop="toggleShowPersList" >
|
||||
</div>
|
||||
<div v-if="mountedPersArr.length == 0" title="Loading personalities">
|
||||
<!-- SPINNER -->
|
||||
<div role="status">
|
||||
<svg aria-hidden="true" class="w-6 h-6 animate-spin fill-secondary"
|
||||
viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
||||
fill="currentColor" />
|
||||
<path
|
||||
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
||||
fill="currentFill" />
|
||||
</svg>
|
||||
<span class="sr-only">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex -space-x-4 " v-if="mountedPersArr.length > 1">
|
||||
<div class="flex items-center justify-center w-8 h-8 cursor-pointer text-xs font-medium bg-bg-light dark:bg-bg-dark border-2 hover:border-secondary rounded-full hover:bg-bg-light-tone dark:hover:bg-bg-dark-tone dark:border-gray-800 hover:z-50 hover:-translate-y-2 duration-150 active:scale-90"
|
||||
@click.stop="toggleShowPersList" title="Click to show more">+{{ mountedPersArr.length - 1 }}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<UniversalForm ref="universalForm" class="z-20" />
|
||||
<UniversalForm ref="universalForm" class="z-50" />
|
||||
</template>
|
||||
<Toast ref="toast">
|
||||
</Toast>
|
||||
@ -50,6 +60,7 @@ import { computed } from 'vue'; // Import the computed function
|
||||
import { watch, ref } from 'vue';
|
||||
|
||||
import feather from 'feather-icons'
|
||||
import socket from '@/services/websocket.js'
|
||||
|
||||
const bUrl = import.meta.env.VITE_LOLLMS_API_BASEURL
|
||||
axios.defaults.baseURL = import.meta.env.VITE_LOLLMS_API_BASEURL
|
||||
@ -121,6 +132,62 @@ export default {
|
||||
|
||||
},
|
||||
methods: {
|
||||
async handleOnTalk(){
|
||||
const pers = this.mountedPers
|
||||
this.isGenerating = true;
|
||||
this.setDiscussionLoading(this.currentDiscussion.id, this.isGenerating);
|
||||
let res = await axios.get('/get_generation_status', {})
|
||||
if (res) {
|
||||
//console.log(res.data.status);
|
||||
if (!res.data.status) {
|
||||
const id = this.$store.state.config.personalities.findIndex(item => item === pers.full_path)
|
||||
const obj = {
|
||||
client_id:this.$store.state.client_id,
|
||||
id: id
|
||||
}
|
||||
res = await axios.post('/select_personality', obj);
|
||||
|
||||
console.log('Generating message from ',res.data.status);
|
||||
socket.emit('generate_msg_from', { id: -1 });
|
||||
}
|
||||
else {
|
||||
console.log("Already generating");
|
||||
}
|
||||
}
|
||||
},
|
||||
async remount_personality() {
|
||||
const pers = this.mountedPers
|
||||
console.log("Remounting personality ", pers)
|
||||
if (!pers) { return { 'status': false, 'error': 'no personality - mount_personality' } }
|
||||
try {
|
||||
console.log("before")
|
||||
const obj = {
|
||||
client_id: this.$store.state.client_id,
|
||||
category: pers.category,
|
||||
folder: pers.folder,
|
||||
language: pers.language
|
||||
}
|
||||
console.log("after")
|
||||
const res = await axios.post('/remount_personality', obj);
|
||||
console.log("Remounting personality executed:",res)
|
||||
|
||||
|
||||
if (res) {
|
||||
console.log("Remounting personality res")
|
||||
this.$store.state.toast.showToast("Personality remounted", 4, true)
|
||||
|
||||
return res.data
|
||||
|
||||
}
|
||||
else{
|
||||
console.log("failed remount_personality")
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error.message, 'remount_personality - settings')
|
||||
return
|
||||
}
|
||||
|
||||
},
|
||||
onSettingsPersonality(persEntry) {
|
||||
try {
|
||||
|
||||
|
@ -97,6 +97,13 @@
|
||||
@click="showNews()">
|
||||
<img :src="static_info">
|
||||
</div>
|
||||
<div v-if="is_fun_mode" title="fun mode is on press to turn off" class="text-green-500 cursor-pointer" @click="fun_mode_off()">
|
||||
<img class="w-5 h-5" :src="fun_mode">
|
||||
</div>
|
||||
<div v-else title="fun mode is off press to turn on" class="text-red-500 cursor-pointer" @click="fun_mode_on()">
|
||||
<img class="w-5 h-5" :src="normal_mode">
|
||||
</div>
|
||||
|
||||
<div class="language-selector relative" style="position: relative;">
|
||||
<button @click="toggleLanguageMenu" class="bg-transparent text-black dark:text-white py-1 px-1 rounded font-bold uppercase transition-colors duration-300 hover:bg-blue-500">
|
||||
{{ $store.state.language.slice(0, 2) }}
|
||||
@ -169,6 +176,8 @@ import static_info from "../assets/static_info.svg"
|
||||
import animated_info from "../assets/animated_info.svg"
|
||||
import { useRouter } from 'vue-router'
|
||||
import storeLogo from '@/assets/logo.png'
|
||||
import fun_mode from "../assets/fun_mode.svg"
|
||||
import normal_mode from "../assets/normal_mode.svg"
|
||||
|
||||
import axios from 'axios';
|
||||
</script>
|
||||
@ -216,7 +225,16 @@ export default {
|
||||
|
||||
loading_infos(){
|
||||
return this.$store.state.loading_infos;
|
||||
},
|
||||
},
|
||||
is_fun_mode(){
|
||||
try{
|
||||
return this.$store.state.config.fun_mode
|
||||
}
|
||||
catch(error){
|
||||
console.error("Oopsie! Looks like we hit a snag: ", error);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
isModelOK(){
|
||||
return this.$store.state.isModelOk;
|
||||
},
|
||||
@ -238,7 +256,11 @@ export default {
|
||||
PopupViewer
|
||||
},
|
||||
watch:{
|
||||
isConnected(){
|
||||
'$store.state.config.fun_mode': function(newVal, oldVal) {
|
||||
console.log(`Fun mode changed from ${oldVal} to ${newVal}! 🎉`);
|
||||
this.updateIcon();
|
||||
},
|
||||
'$store.state.isConnected': function(newVal, oldVal) {
|
||||
if (!this.isConnected){
|
||||
this.$store.state.messageBox.showBlockingMessage("Server suddenly disconnected. Please reboot the server to recover the connection")
|
||||
this.is_first_connection = false
|
||||
@ -270,6 +292,8 @@ export default {
|
||||
isLanguageMenuVisible: false,
|
||||
static_info: static_info,
|
||||
animated_info: animated_info,
|
||||
normal_mode:normal_mode,
|
||||
fun_mode:fun_mode,
|
||||
is_first_connection:true,
|
||||
discord:discord,
|
||||
FastAPI:FastAPI,
|
||||
@ -284,6 +308,10 @@ export default {
|
||||
moonIcon: document.querySelector(".moon"),
|
||||
userTheme: localStorage.getItem("theme"),
|
||||
systemTheme: window.matchMedia("prefers-color-scheme: dark").matches,
|
||||
posts_headers : {
|
||||
'accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
@ -378,6 +406,38 @@ export default {
|
||||
// }
|
||||
|
||||
// },
|
||||
applyConfiguration() {
|
||||
this.isLoading = true;
|
||||
console.log(this.$store.state.config)
|
||||
axios.post('/apply_settings', {"client_id":this.$store.state.client_id, "config":this.$store.state.config}, {headers: this.posts_headers}).then((res) => {
|
||||
this.isLoading = false;
|
||||
//console.log('apply-res',res)
|
||||
if (res.data.status) {
|
||||
|
||||
this.$store.state.toast.showToast("Configuration changed successfully.", 4, true)
|
||||
this.settingsChanged = false
|
||||
//this.save_configuration()
|
||||
} else {
|
||||
|
||||
this.$store.state.toast.showToast("Configuration change failed.", 4, false)
|
||||
|
||||
}
|
||||
nextTick(() => {
|
||||
feather.replace()
|
||||
|
||||
})
|
||||
})
|
||||
},
|
||||
fun_mode_on(){
|
||||
console.log("Turning on fun mode")
|
||||
this.$store.state.config.fun_mode=true;
|
||||
this.applyConfiguration()
|
||||
},
|
||||
fun_mode_off(){
|
||||
console.log("Turning off fun mode")
|
||||
this.$store.state.config.fun_mode=false;
|
||||
this.applyConfiguration()
|
||||
},
|
||||
showNews(){
|
||||
this.$store.state.news.show()
|
||||
},
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 98bb9b1bc4859139e6d62f031f390caf2c1b2a6c
|
||||
Subproject commit 73a713546c5b2a0b4ab5cf8bcf3ac7eb513d21be
|
Loading…
x
Reference in New Issue
Block a user