upgraded ui

This commit is contained in:
Saifeddine ALOUI 2024-02-26 19:29:37 +01:00
parent 510d511104
commit c29daa233d
9 changed files with 279 additions and 222 deletions

View File

@ -89,6 +89,7 @@ def add_events(sio:socketio):
@sio.on('take_picture')
def take_picture(sid):
try:
client = lollmsElfServer.session.get_client(sid)
lollmsElfServer.info("Loading camera")
if not PackageManager.check_package_installed("cv2"):
PackageManager.install_package("opencv-python")
@ -101,7 +102,7 @@ def add_events(sio:socketio):
_, frame = cap.read()
cap.release()
lollmsElfServer.info("Shot taken")
cam_shot_path = lollmsElfServer.lollms_paths.personal_uploads_path/"camera_shots"
cam_shot_path = client.discussion.discussion_images_folder
cam_shot_path.mkdir(parents=True, exist_ok=True)
filename = find_first_available_file_index(cam_shot_path, "cam_shot_", extension=".png")
save_path = cam_shot_path/f"cam_shot_{filename}.png" # Specify the desired folder path
@ -110,13 +111,13 @@ def add_events(sio:socketio):
cv2.imwrite(str(save_path), frame)
if not lollmsElfServer.personality.processor is None:
lollmsElfServer.info("Sending file to scripted persona")
lollmsElfServer.personality.processor.add_file(save_path, partial(lollmsElfServer.process_chunk, client_id = sid))
lollmsElfServer.personality.processor.add_file(save_path, client, partial(lollmsElfServer.process_chunk, client_id = sid))
# File saved successfully
run_async(partial(sio.emit,'picture_taken', {'status':True, 'progress': 100}))
lollmsElfServer.info("File sent to scripted persona")
else:
lollmsElfServer.info("Sending file to persona")
lollmsElfServer.personality.add_file(save_path, partial(lollmsElfServer.process_chunk, client_id = sid))
lollmsElfServer.personality.add_file(save_path, client, partial(lollmsElfServer.process_chunk, client_id = sid))
# File saved successfully
run_async(partial(sio.emit,'picture_taken', {'status':True, 'progress': 100}))
lollmsElfServer.info("File sent to persona")

@ -1 +1 @@
Subproject commit ac5d2b6df038f6eee03cfae351a753221b819ad5
Subproject commit 895f54b422476aaf62e72b8bb0439db94ae15437

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,41 @@
<?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 299.92 299.92" xml:space="preserve">
<g>
<g>
<g>
<path d="M293.4,65.2H6.52C2.914,65.2,0,68.114,0,71.72v117.36c0,3.606,2.914,6.52,6.52,6.52h6.52v32.6
c0,3.606,2.914,6.52,6.52,6.52h260.8c3.606,0,6.52-2.914,6.52-6.52v-32.6h6.52c3.606,0,6.52-2.914,6.52-6.52V71.72
C299.92,68.114,297.006,65.2,293.4,65.2z M273.84,221.68h-19.56H228.2h-26.08h-26.08h-26.08h-26.08H97.8H71.72H45.64H26.08V195.6
h19.56h26.08H97.8h26.08h26.08h26.08h26.08h26.08h26.08h19.56V221.68z M286.88,182.56h-6.52H19.56h-6.52V78.24h273.84V182.56z"/>
<path d="M32.6,169.52h39.12c3.606,0,6.52-2.914,6.52-6.52V97.8c0-3.606-2.914-6.52-6.52-6.52H32.6c-3.606,0-6.52,2.914-6.52,6.52
V163C26.08,166.606,28.994,169.52,32.6,169.52z M39.12,104.32H65.2v52.16H39.12V104.32z"/>
<path d="M97.8,169.52h39.12c3.606,0,6.52-2.914,6.52-6.52V97.8c0-3.606-2.914-6.52-6.52-6.52H97.8c-3.606,0-6.52,2.914-6.52,6.52
V163C91.28,166.606,94.194,169.52,97.8,169.52z M104.32,104.32h26.08v52.16h-26.08V104.32z"/>
<path d="M163,169.52h39.12c3.606,0,6.52-2.914,6.52-6.52V97.8c0-3.606-2.914-6.52-6.52-6.52H163c-3.606,0-6.52,2.914-6.52,6.52
V163C156.48,166.606,159.394,169.52,163,169.52z M169.52,104.32h26.08v52.16h-26.08V104.32z"/>
<path d="M228.2,169.52h39.12c3.606,0,6.52-2.914,6.52-6.52V97.8c0-3.606-2.914-6.52-6.52-6.52H228.2
c-3.606,0-6.52,2.914-6.52,6.52V163C221.68,166.606,224.594,169.52,228.2,169.52z M234.72,104.32h26.08v52.16h-26.08V104.32z"/>
<path d="M52.16,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52
C49.246,221.68,52.16,218.766,52.16,215.16z"/>
<path d="M78.24,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52
C75.326,221.68,78.24,218.766,78.24,215.16z"/>
<path d="M104.32,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52
C101.406,221.68,104.32,218.766,104.32,215.16z"/>
<path d="M130.4,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52
C127.486,221.68,130.4,218.766,130.4,215.16z"/>
<path d="M156.48,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52s-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52
S156.48,218.766,156.48,215.16z"/>
<path d="M182.56,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52
C179.646,221.68,182.56,218.766,182.56,215.16z"/>
<path d="M208.64,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52
C205.726,221.68,208.64,218.766,208.64,215.16z"/>
<path d="M234.72,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52
C231.806,221.68,234.72,218.766,234.72,215.16z"/>
<path d="M260.8,215.16v-13.04c0-3.606-2.914-6.52-6.52-6.52c-3.606,0-6.52,2.914-6.52,6.52v13.04c0,3.606,2.914,6.52,6.52,6.52
C257.886,221.68,260.8,218.766,260.8,215.16z"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

4
web/dist/index.html vendored
View File

@ -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-3b1245a1.js"></script>
<link rel="stylesheet" href="/assets/index-9198ccfe.css">
<script type="module" crossorigin src="/assets/index-5d77d38a.js"></script>
<link rel="stylesheet" href="/assets/index-e91c42de.css">
</head>
<body>
<div id="app"></div>

View File

@ -278,6 +278,7 @@
<div class="pointer-events-none absolute -top-10 left-1/2 w-max -translate-x-1/2 rounded-md bg-gray-100 p-2 opacity-0 transition-opacity group-hover:opacity-100 dark:bg-gray-800"><p class="max-w-sm text-sm text-gray-800 dark:text-gray-200">New empty ai message.</p></div>
</div>
</div>
<div class="ml-auto gap-2">
@ -326,8 +327,9 @@ import MountedPersonalities from '@/components/MountedPersonalities.vue'
import MountedPersonalitiesList from '@/components/MountedPersonalitiesList.vue'
import PersonalitiesCommands from '@/components/PersonalitiesCommands.vue';
import socket from '@/services/websocket.js'
import UniversalForm from '../components/UniversalForm.vue';
import UniversalForm from '@/components/UniversalForm.vue';
import modelImgPlaceholder from "../assets/default_model.png"
import loader_v0 from "../assets/loader_v0.svg"
console.log("modelImgPlaceholder:",modelImgPlaceholder)
@ -358,6 +360,7 @@ export default {
data() {
return {
loader_v0:loader_v0,
memory_icon:memory_icon,
modelImgPlaceholder:modelImgPlaceholder,
bUrl:bUrl,
message: "",

View File

@ -93,7 +93,14 @@
type="button" @click.stop="save_configuration()">
<i data-feather="check"></i>
</button>
</div>
</div>
<div class="group relative w-max">
<button v-if="!loading" type="button" @click.stop="addToMemory" title="Add this discussion content to skills database"
class=" w-6 text-blue-400 hover:text-secondary duration-75 active:scale-90">
<img :src="memory_icon">
</button>
</div>
<div v-if="loading" title="Loading.." class="flex flex-row flex-grow justify-end">
<!-- SPINNER -->
<div role="status">
@ -361,6 +368,7 @@
import SVGRedBrain from '@/assets/brain_red.svg';
import SVGOrangeBrain from '@/assets/brain_orange.svg';
import SVGGreenBrain from '@/assets/brain_green.svg';
import memory_icon from "../assets/memory_icon.svg"
export default {
@ -369,6 +377,7 @@ export default {
data() {
return {
memory_icon:memory_icon,
posts_headers : {
'accept': 'application/json',
'Content-Type': 'application/json'
@ -440,6 +449,9 @@ export default {
}
},
methods: {
addToMemory(){
this.$store.state.messageBox.showMessage("This functionality is being developed. Please be patient")
},
add_webpage(){
console.log("addWebLink received")
this.$refs.web_url_input_box.showPanel();

@ -1 +1 @@
Subproject commit f941e8d231533370b8786dbe2987b399498caecc
Subproject commit 707b72d65845e00b40080d26108390e8aea03305