mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-02-21 17:36:39 +00:00
Added loads of functionalities
This commit is contained in:
parent
ac5889c964
commit
cfcb925f58
@ -51,6 +51,7 @@ if not PackageManager.check_package_installed("requests"):
|
|||||||
if not PackageManager.check_package_installed("bs4"):
|
if not PackageManager.check_package_installed("bs4"):
|
||||||
PackageManager.install_package("beautifulsoup4")
|
PackageManager.install_package("beautifulsoup4")
|
||||||
import requests
|
import requests
|
||||||
|
from flask_socketio import SocketIO
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
|
|
||||||
@ -132,10 +133,10 @@ def parse_requirements_file(requirements_path):
|
|||||||
|
|
||||||
|
|
||||||
class LoLLMsAPI(LollmsApplication):
|
class LoLLMsAPI(LollmsApplication):
|
||||||
def __init__(self, config:LOLLMSConfig, socketio, config_file_path:str, lollms_paths: LollmsPaths) -> None:
|
def __init__(self, config:LOLLMSConfig, socketio:SocketIO, config_file_path:str, lollms_paths: LollmsPaths) -> None:
|
||||||
|
|
||||||
self.socketio = socketio
|
self.socketio = socketio
|
||||||
super().__init__("Lollms_webui",config, lollms_paths, callback=self.process_chunk)
|
super().__init__("Lollms_webui",config, lollms_paths, callback=self.process_chunk, socketio=socketio)
|
||||||
|
|
||||||
|
|
||||||
self.busy = False
|
self.busy = False
|
||||||
@ -1152,6 +1153,7 @@ class LoLLMsAPI(LollmsApplication):
|
|||||||
else:
|
else:
|
||||||
if output["text"].lower()=="lollms":
|
if output["text"].lower()=="lollms":
|
||||||
self.summoned = True
|
self.summoned = True
|
||||||
|
|
||||||
def scrape_and_save(self, url, file_path):
|
def scrape_and_save(self, url, file_path):
|
||||||
# Send a GET request to the URL
|
# Send a GET request to the URL
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
|
2
app.py
2
app.py
@ -1116,7 +1116,7 @@ try:
|
|||||||
per.model = self.model
|
per.model = self.model
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
trace_exception(ex)
|
trace_exception(ex)
|
||||||
self.InfoMessage("It looks like you we couldn't load the model.\nThis can hapen when you don't have enough VRAM. Please restart the program.",duration=30)
|
self.InfoMessage(f"It looks like you we couldn't load the model.\nHere is the error message:\n{ex}",duration=30)
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 26c1b62f04db6405b7d6ff5f495e70caeeff62be
|
Subproject commit 91093246d27c4c8ba98a718b8cae6ea0c8af6cfd
|
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
4
web/dist/index.html
vendored
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>LoLLMS WebUI - Welcome</title>
|
<title>LoLLMS WebUI - Welcome</title>
|
||||||
<script type="module" crossorigin src="/assets/index-2ca0499e.js"></script>
|
<script type="module" crossorigin src="/assets/index-eb3c4aa9.js"></script>
|
||||||
<link rel="stylesheet" href="/assets/index-5d2d92a4.css">
|
<link rel="stylesheet" href="/assets/index-00b65516.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
@ -94,6 +94,8 @@
|
|||||||
<p class="text-2xl animate-pulse mt-2 text-white">{{ loading_infos }} ...</p>
|
<p class="text-2xl animate-pulse mt-2 text-white">{{ loading_infos }} ...</p>
|
||||||
</div>
|
</div>
|
||||||
<UniversalForm ref="universalForm" class="z-20" />
|
<UniversalForm ref="universalForm" class="z-20" />
|
||||||
|
<YesNoDialog ref="yesNoDialog" class="z-20" />
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@ -107,6 +109,7 @@ import Toast from '../components/Toast.vue'
|
|||||||
import MessageBox from "@/components/MessageBox.vue";
|
import MessageBox from "@/components/MessageBox.vue";
|
||||||
import ProgressBar from "@/components/ProgressBar.vue";
|
import ProgressBar from "@/components/ProgressBar.vue";
|
||||||
import UniversalForm from '../components/UniversalForm.vue';
|
import UniversalForm from '../components/UniversalForm.vue';
|
||||||
|
import YesNoDialog from './YesNoDialog.vue';
|
||||||
|
|
||||||
|
|
||||||
import { RouterLink } from 'vue-router'
|
import { RouterLink } from 'vue-router'
|
||||||
@ -139,6 +142,7 @@ export default {
|
|||||||
MessageBox,
|
MessageBox,
|
||||||
ProgressBar,
|
ProgressBar,
|
||||||
UniversalForm,
|
UniversalForm,
|
||||||
|
YesNoDialog
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
isConnected(){
|
isConnected(){
|
||||||
@ -170,6 +174,8 @@ export default {
|
|||||||
this.$store.state.toast = this.$refs.toast
|
this.$store.state.toast = this.$refs.toast
|
||||||
this.$store.state.messageBox = this.$refs.messageBox
|
this.$store.state.messageBox = this.$refs.messageBox
|
||||||
this.$store.state.universalForm = this.$refs.universalForm
|
this.$store.state.universalForm = this.$refs.universalForm
|
||||||
|
this.$store.state.yesNoDialog = this.$refs.yesNoDialog
|
||||||
|
|
||||||
this.sunIcon = document.querySelector(".sun");
|
this.sunIcon = document.querySelector(".sun");
|
||||||
this.moonIcon = document.querySelector(".moon");
|
this.moonIcon = document.querySelector(".moon");
|
||||||
this.userTheme = localStorage.getItem("theme");
|
this.userTheme = localStorage.getItem("theme");
|
||||||
|
126
web/src/main.js
126
web/src/main.js
@ -24,6 +24,7 @@ export const store = createStore({
|
|||||||
state () {
|
state () {
|
||||||
return {
|
return {
|
||||||
// count: 0,
|
// count: 0,
|
||||||
|
yesNoDialog:null,
|
||||||
universalForm:null,
|
universalForm:null,
|
||||||
toast:null,
|
toast:null,
|
||||||
messageBox:null,
|
messageBox:null,
|
||||||
@ -506,47 +507,100 @@ app.mixin({
|
|||||||
this.$store.state.api_get_req = api_get_req
|
this.$store.state.api_get_req = api_get_req
|
||||||
actionsExecuted = true;
|
actionsExecuted = true;
|
||||||
console.log("Calling")
|
console.log("Calling")
|
||||||
this.$store.state.loading_infos = "Loading Configuration"
|
|
||||||
this.$store.state.loading_progress = 10
|
|
||||||
try{
|
try{
|
||||||
|
this.$store.state.loading_infos = "Loading Configuration"
|
||||||
|
this.$store.state.loading_progress = 10
|
||||||
|
await this.$store.dispatch('refreshConfig');
|
||||||
|
console.log("Config ready")
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
|
||||||
}
|
}
|
||||||
catch
|
try{
|
||||||
await this.$store.dispatch('refreshConfig');
|
this.$store.state.loading_infos = "Loading Database"
|
||||||
console.log("Config ready")
|
this.$store.state.loading_progress = 20
|
||||||
this.$store.state.loading_infos = "Loading Database"
|
await this.$store.dispatch('refreshDatabase');
|
||||||
this.$store.state.loading_progress = 20
|
}
|
||||||
await this.$store.dispatch('refreshDatabase');
|
catch{
|
||||||
|
|
||||||
this.$store.state.loading_infos = "Getting version"
|
|
||||||
this.$store.state.loading_progress = 30
|
|
||||||
await this.$store.dispatch('getVersion');
|
|
||||||
this.$store.state.loading_infos = "Getting Bindings list"
|
|
||||||
this.$store.state.loading_progress = 40
|
|
||||||
await this.$store.dispatch('refreshBindings');
|
|
||||||
await refreshHardwareUsage(this.$store);
|
|
||||||
this.$store.state.loading_infos = "Getting extensions zoo"
|
|
||||||
this.$store.state.loading_progress = 50
|
|
||||||
await this.$store.dispatch('refreshExtensionsZoo');
|
|
||||||
this.$store.state.loading_infos = "Getting mounted extensions"
|
|
||||||
this.$store.state.loading_progress = 60
|
|
||||||
await this.$store.dispatch('refreshmountedExtensions');
|
|
||||||
|
|
||||||
this.$store.state.loading_infos = "Getting personalities zoo"
|
|
||||||
this.$store.state.loading_progress = 70
|
|
||||||
await this.$store.dispatch('refreshPersonalitiesZoo')
|
|
||||||
this.$store.state.loading_infos = "Getting mounted personalities"
|
|
||||||
this.$store.state.loading_progress = 80
|
|
||||||
await this.$store.dispatch('refreshMountedPersonalities');
|
|
||||||
|
|
||||||
this.$store.state.loading_infos = "Getting models zoo"
|
}
|
||||||
this.$store.state.loading_progress = 90
|
|
||||||
await this.$store.dispatch('refreshModelsZoo');
|
|
||||||
this.$store.state.loading_infos = "Getting active models"
|
|
||||||
this.$store.state.loading_progress = 100
|
|
||||||
await this.$store.dispatch('refreshModels');
|
|
||||||
await this.$store.dispatch('refreshModelStatus');
|
|
||||||
|
|
||||||
|
try{
|
||||||
|
this.$store.state.loading_infos = "Getting version"
|
||||||
|
this.$store.state.loading_progress = 30
|
||||||
|
await this.$store.dispatch('getVersion');
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
|
this.$store.state.loading_infos = "Getting Bindings list"
|
||||||
|
this.$store.state.loading_progress = 40
|
||||||
|
await this.$store.dispatch('refreshBindings');
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
this.$store.state.loading_infos = "Getting Hardware usage"
|
||||||
|
await refreshHardwareUsage(this.$store);
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
this.$store.state.loading_infos = "Getting extensions zoo"
|
||||||
|
this.$store.state.loading_progress = 50
|
||||||
|
await this.$store.dispatch('refreshExtensionsZoo');
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
this.$store.state.loading_infos = "Getting mounted extensions"
|
||||||
|
this.$store.state.loading_progress = 60
|
||||||
|
await this.$store.dispatch('refreshmountedExtensions');
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
|
this.$store.state.loading_infos = "Getting personalities zoo"
|
||||||
|
this.$store.state.loading_progress = 70
|
||||||
|
await this.$store.dispatch('refreshPersonalitiesZoo')
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
this.$store.state.loading_infos = "Getting mounted personalities"
|
||||||
|
this.$store.state.loading_progress = 80
|
||||||
|
await this.$store.dispatch('refreshMountedPersonalities');
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try{
|
||||||
|
this.$store.state.loading_infos = "Getting models zoo"
|
||||||
|
this.$store.state.loading_progress = 90
|
||||||
|
await this.$store.dispatch('refreshModelsZoo');
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
this.$store.state.loading_infos = "Getting active models"
|
||||||
|
this.$store.state.loading_progress = 100
|
||||||
|
await this.$store.dispatch('refreshModels');
|
||||||
|
await this.$store.dispatch('refreshModelStatus');
|
||||||
|
}
|
||||||
|
catch{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.$store.state.ready = true;
|
this.$store.state.ready = true;
|
||||||
}
|
}
|
||||||
|
@ -1226,6 +1226,11 @@ export default {
|
|||||||
else if(notif.display_type==1){
|
else if(notif.display_type==1){
|
||||||
this.$store.state.messageBox.showMessage(notif.content)
|
this.$store.state.messageBox.showMessage(notif.content)
|
||||||
}
|
}
|
||||||
|
else if(notif.display_type==2){
|
||||||
|
this.$store.state.yesNoDialog.askQuestion(notif.content, 'Yes', 'Cancel').then(yesRes => {
|
||||||
|
socket.emit("yesNoRes",{yesRes:yesRes})
|
||||||
|
})
|
||||||
|
}
|
||||||
this.chime.play()
|
this.chime.play()
|
||||||
},
|
},
|
||||||
streamMessageContent(msgObj) {
|
streamMessageContent(msgObj) {
|
||||||
|
@ -1683,7 +1683,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<YesNoDialog ref="yesNoDialog" class="z-20" />
|
|
||||||
<AddModelDialog ref="addmodeldialog" />
|
<AddModelDialog ref="addmodeldialog" />
|
||||||
<ChoiceDialog class="z-20"
|
<ChoiceDialog class="z-20"
|
||||||
:show="variantSelectionDialogVisible"
|
:show="variantSelectionDialogVisible"
|
||||||
@ -1779,7 +1778,6 @@ import filesize from '../plugins/filesize'
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import feather from 'feather-icons'
|
import feather from 'feather-icons'
|
||||||
import { nextTick, TransitionGroup } from 'vue'
|
import { nextTick, TransitionGroup } from 'vue'
|
||||||
import YesNoDialog from "@/components/YesNoDialog.vue";
|
|
||||||
import ModelEntry from '@/components/ModelEntry.vue';
|
import ModelEntry from '@/components/ModelEntry.vue';
|
||||||
import PersonalityViewer from '@/components/PersonalityViewer.vue';
|
import PersonalityViewer from '@/components/PersonalityViewer.vue';
|
||||||
import PersonalityEntry from "@/components/PersonalityEntry.vue";
|
import PersonalityEntry from "@/components/PersonalityEntry.vue";
|
||||||
@ -1807,7 +1805,6 @@ axios.defaults.baseURL = import.meta.env.VITE_LOLLMS_API_BASEURL
|
|||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
AddModelDialog,
|
AddModelDialog,
|
||||||
YesNoDialog,
|
|
||||||
ModelEntry,
|
ModelEntry,
|
||||||
// eslint-disable-next-line vue/no-unused-components
|
// eslint-disable-next-line vue/no-unused-components
|
||||||
PersonalityViewer,
|
PersonalityViewer,
|
||||||
@ -2552,7 +2549,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onUninstall(model_object) {
|
onUninstall(model_object) {
|
||||||
|
|
||||||
this.$refs.yesNoDialog.askQuestion("Are you sure you want to delete this model?\n [" + model_object.name + "]", 'Yes', 'Cancel').then(yesRes => {
|
this.$store.state.yesNoDialog.askQuestion("Are you sure you want to delete this model?\n [" + model_object.name + "]", 'Yes', 'Cancel').then(yesRes => {
|
||||||
if (yesRes) {
|
if (yesRes) {
|
||||||
console.log("uninstalling model...")
|
console.log("uninstalling model...")
|
||||||
const progressListener = (response) => {
|
const progressListener = (response) => {
|
||||||
@ -2623,7 +2620,7 @@ export default {
|
|||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
|
|
||||||
if (binding_object.disclaimer){
|
if (binding_object.disclaimer){
|
||||||
this.$refs.yesNoDialog.askQuestion(binding_object.disclaimer, 'Proceed', 'Cancel')
|
this.$store.state.yesNoDialog.askQuestion(binding_object.disclaimer, 'Proceed', 'Cancel')
|
||||||
}
|
}
|
||||||
axios.post('/install_binding', { name: binding_object.binding.folder }).then((res) => {
|
axios.post('/install_binding', { name: binding_object.binding.folder }).then((res) => {
|
||||||
|
|
||||||
@ -3200,7 +3197,7 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
reset_configuration() {
|
reset_configuration() {
|
||||||
this.$refs.yesNoDialog.askQuestion("Are you sure?\nThis will delete all your configurations and get back to default configuration.").then(response => {
|
this.$store.state.yesNoDialog.askQuestion("Are you sure?\nThis will delete all your configurations and get back to default configuration.").then(response => {
|
||||||
if (response) {
|
if (response) {
|
||||||
// User clicked Yes
|
// User clicked Yes
|
||||||
axios.post('/reset_settings', {})
|
axios.post('/reset_settings', {})
|
||||||
@ -4237,7 +4234,7 @@ export default {
|
|||||||
// console.log('did settings?',this.settingsChanged)
|
// console.log('did settings?',this.settingsChanged)
|
||||||
await this.$router.isReady()
|
await this.$router.isReady()
|
||||||
if (this.settingsChanged) {
|
if (this.settingsChanged) {
|
||||||
const res = await this.$refs.yesNoDialog.askQuestion("Did You forget to apply changes?\nYou need to apply changes before you leave, or else.", 'Apply configuration', 'Cancel')
|
const res = await this.$store.state.yesNoDialog.askQuestion("Did You forget to apply changes?\nYou need to apply changes before you leave, or else.", 'Apply configuration', 'Cancel')
|
||||||
if (res) {
|
if (res) {
|
||||||
this.applyConfiguration()
|
this.applyConfiguration()
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 5f12891d580f71b2fa7613897f2e545c5c7804d4
|
Subproject commit c98cb1098bd3d05049f557563b37fdb1ceebe8cc
|
Loading…
x
Reference in New Issue
Block a user