This commit is contained in:
saloui 2024-01-24 12:08:07 +01:00
parent c8b5dc815b
commit 164239936f
4 changed files with 42 additions and 41 deletions

11
app.py
View File

@ -175,17 +175,6 @@ if __name__ == "__main__":
#webbrowser.open(f"http://{config['host']}:{6523}") # needed for debug (to be removed in production) #webbrowser.open(f"http://{config['host']}:{6523}") # needed for debug (to be removed in production)
uvicorn.run(app, host=config.host, port=config.port) uvicorn.run(app, host=config.host, port=config.port)
if sio.reboot:
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info(" ╔══════════════════════════════════════════════════╗")
ASCIIColors.info(" ║ Restarting backend ║")
ASCIIColors.info(" ╚══════════════════════════════════════════════════╝")
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info("")
lollmsElfServer.run_restart_script(args)
except Exception as ex: except Exception as ex:
trace_exception(ex) trace_exception(ex)

View File

@ -35,12 +35,23 @@ async def get_lollms_webui_version():
@router.get("/restart_program") @router.get("/restart_program")
async def restart_program(): async def restart_program():
"""Restart the program.""" """Restart the program."""
lollmsElfServer.ShowBlockingMessage("Restarting program.\nPlease stand by...")
# Stop the socketIO server # Stop the socketIO server
run_async(lollmsElfServer.sio.shutdown) run_async(lollmsElfServer.sio.shutdown)
# Sleep for 1 second before rebooting # Sleep for 1 second before rebooting
time.sleep(1) time.sleep(1)
lollmsElfServer.HideBlockingMessage()
# Reboot the program # Reboot the program
lollmsElfServer.sio.reboot = True ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info(" ╔══════════════════════════════════════════════════╗")
ASCIIColors.info(" ║ Restarting backend ║")
ASCIIColors.info(" ╚══════════════════════════════════════════════════╝")
ASCIIColors.info("")
ASCIIColors.info("")
ASCIIColors.info("")
lollmsElfServer.run_restart_script(lollmsElfServer.args)
@router.get("/update_software") @router.get("/update_software")
async def update_software(): async def update_software():

View File

@ -106,8 +106,9 @@ async def text2Audio(request: Request):
@router.get("/install_xtts") @router.get("/install_xtts")
def install_xtts(): def install_xtts():
try: try:
from lollms.services.xtts.lollms_xtts import install_xtts
lollmsElfServer.ShowBlockingMessage("Installing xTTS api server\nPlease stand by") lollmsElfServer.ShowBlockingMessage("Installing xTTS api server\nPlease stand by")
PackageManager.install_package("xtts-api-server") install_xtts(lollmsElfServer)
lollmsElfServer.HideBlockingMessage() lollmsElfServer.HideBlockingMessage()
return {"status":True} return {"status":True}
except Exception as ex: except Exception as ex:

@ -1 +1 @@
Subproject commit 1e1fd5444c92e4e5dccd93061c01cbe677f30404 Subproject commit f4e5aa3d7af0cd20f3af69fa1fae16bbe0342f2f