Fix for SocketIO in Colab

This commit is contained in:
ebolam
2022-08-19 12:00:04 -04:00
parent 58f0cf8f88
commit 611150e906
5 changed files with 17 additions and 12 deletions

View File

@@ -252,7 +252,7 @@ app.secret_key = secrets.token_hex()
app.config['SESSION_TYPE'] = 'filesystem'
app.config['TEMPLATES_AUTO_RELOAD'] = True
Session(app)
socketio = SocketIO(app, async_method="eventlet", manage_session=False)
socketio = SocketIO(app, async_method="eventlet", manage_session=False, cors_allowed_origins='*')
#socketio = SocketIO(app, async_method="eventlet", logger=True, engineio_logger=True, manage_session=False)
koboldai_vars = koboldai_settings.koboldai_vars(session, socketio)
@@ -7347,7 +7347,12 @@ def UI_2_load_aidg_club(data):
#==================================================================#
@socketio.on('theme_change')
def UI_2_theme_change(data):
print("Theme Changed: {}".format(data))
with open("themes/user.css", "w") as f:
f.write(":root {")
for var in data:
f.write("\t{}: {};\n".format(var[0], var[1].replace(";", "")))
f.write("}")
print("Theme Saved")
#==================================================================#