Upgraded ui

This commit is contained in:
Saifeddine ALOUI 2023-12-10 23:19:24 +01:00
parent e3e7ec27ad
commit b0a030f132
7 changed files with 85 additions and 67 deletions

View File

@ -230,13 +230,13 @@ class LoLLMsAPI(LollmsApplication):
def stop_webcam_video_stream():
self.webcam.stop_capture()
@socketio.on('start_webcam_video_stream')
def start_webcam_video_stream():
self.webcam.start_capture()
@socketio.on('start_audio_stream')
def start_audio_stream():
self.audio_cap.start_recording()
@socketio.on('stop_webcam_video_stream')
def stop_webcam_video_stream():
self.webcam.stop_capture()
@socketio.on('stop_audio_stream')
def stop_audio_stream():
self.audio_cap.stop_recording()
@socketio.on('upgrade_vectorization')

14
app.py
View File

@ -630,12 +630,19 @@ try:
"""Opens code folder in vs code."""
data = request.get_json()
code = data["code"]
discussion_id = data.get("discussion_id","unknown_discussion")
message_id = data.get("message_id","unknown_message")
language = data.get("language","python")
ASCIIColors.info("Opening folder:")
# Create a temporary file.
root_folder = self.lollms_paths.personal_outputs_path/"discussions"/f"d_{discussion_id}"
root_folder.mkdir(parents=True,exist_ok=True)
tmp_file = root_folder/f"ai_code_{message_id}.py"
with open(tmp_file,"w") as f:
f.write(code)
os.system('code ' + str(root_folder))
return {"output": "OK", "execution_time": 0}
@ -645,11 +652,18 @@ try:
data = request.get_json()
discussion_id = data.get("discussion_id","unknown_discussion")
message_id = data.get("message_id","")
code = data["code"]
discussion_id = data.get("discussion_id","unknown_discussion")
message_id = data.get("message_id","unknown_message")
language = data.get("language","python")
ASCIIColors.info("Opening folder:")
# Create a temporary file.
root_folder = self.lollms_paths.personal_outputs_path/"discussions"/f"d_{discussion_id}"/f"{message_id}.py"
root_folder.mkdir(parents=True,exist_ok=True)
tmp_file = root_folder/f"ai_code_{message_id}.py"
with open(tmp_file,"w") as f:
f.write(code)
os.system('code ' + str(root_folder))
return {"output": "OK", "execution_time": 0}

@ -1 +1 @@
Subproject commit 7f12658b7ab61b9727c90e08f049cbf270bdaabc
Subproject commit d250265cb07dfdd8fc3cecb8c73e618ae32038d7

File diff suppressed because one or more lines are too long

2
web/dist/index.html vendored
View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI - Welcome</title>
<script type="module" crossorigin src="/assets/index-f369a711.js"></script>
<script type="module" crossorigin src="/assets/index-121a39f1.js"></script>
<link rel="stylesheet" href="/assets/index-3789d6b8.css">
</head>
<body>

View File

@ -153,7 +153,7 @@ export default {
});
},
openFolderVsCode(){
const json = JSON.stringify({ 'discussion_id': this.discussion_id })
const json = JSON.stringify({ 'code': this.code, 'discussion_id': this.discussion_id, 'message_id': this.message_id, 'language': this.language})
console.log(json)
fetch(`${this.host}/open_code_in_vs_code`, {
method: 'POST',
@ -173,7 +173,7 @@ export default {
});
},
openVsCode() {
const json = JSON.stringify({ 'discussion_id': this.discussion_id, 'message_id': this.message_id, 'language': this.language })
const json = JSON.stringify({ 'code': this.code, 'discussion_id': this.discussion_id, 'message_id': this.message_id, 'language': this.language })
console.log(json)
fetch(`${this.host}/open_code_folder_in_vs_code`, {
method: 'POST',

View File

@ -8,6 +8,7 @@
Personality does not have an avatar.
</div>
<FloatingFrame />
<AudioFrame />
<div class="floating-frame2">
<div v-html="htmlContent"></div>
</div>
@ -21,6 +22,8 @@
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { TextureLoader } from 'three';
import FloatingFrame from '@/components/FloatingFrame.vue';
import AudioFrame from '@/components/AudioFrame.vue';
export default {
data(){
@ -35,7 +38,8 @@
},
},
components: {
FloatingFrame
FloatingFrame,
AudioFrame
},
computed: {
isReady:{