Fixed cors problem

This commit is contained in:
Saifeddine ALOUI 2023-11-30 01:38:25 +01:00
parent e18832492b
commit 8ed9cf5c0d
6 changed files with 15 additions and 8 deletions

3
app.py
View File

@ -65,7 +65,7 @@ try:
from lollms.paths import LollmsPaths, gptqlora_repo
from lollms.extension import LOLLMSExtension, ExtensionBuilder
from flask_cors import CORS
from api.db import Discussion
from flask import (
Flask,
@ -149,6 +149,7 @@ try:
log.setLevel(logging.ERROR)
app = Flask("Lollms-WebUI", static_url_path="/static", static_folder="static")
CORS(app)
from flask_compress import Compress
# async_mode='gevent', ping_timeout=1200, ping_interval=120,
socketio = SocketIO(app, cors_allowed_origins="*", async_mode='gevent', ping_timeout=1200, ping_interval=120)

@ -1 +1 @@
Subproject commit 504c9362887fdaf7d656543e6078f8b3c1be1268
Subproject commit 14897de85a2b53d0064d6341baf2b2b2e8164cb9

@ -1 +1 @@
Subproject commit 9c67a1e14704b361dfa4b0b950c72bdf6fa00cb7
Subproject commit a33dc5014bfc12a012d063068482f53c1168a14b

View File

@ -166,9 +166,15 @@ export const store = createStore({
},
actions: {
async getVersion(){
let res = await axios.get('/get_lollms_webui_version', {});
if (res) {
this.state.version = res.data.version
try{
let res = await axios.get('/get_lollms_webui_version', {});
if (res) {
this.state.version = res.data.version
}
}
catch{
console.log("Coudln't get version")
}
},
async refreshConfig({ commit }) {

@ -1 +1 @@
Subproject commit c1e4e210883cd2601825edb36e830e505f557752
Subproject commit 0b234253ce3a696070f9f501d40d529a1b5cb77b

@ -1 +1 @@
Subproject commit a45459880d616b6d263c0c42cae0be75467be6f8
Subproject commit b021c1f465851666aed59a042d1c6b4b38b1aaf1