mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Remove flaskwebgui (Conflicts with our threading)
This commit is contained in:
11
aiserver.py
11
aiserver.py
@ -383,7 +383,6 @@ class vars:
|
|||||||
actionmode = 1
|
actionmode = 1
|
||||||
dynamicscan = False
|
dynamicscan = False
|
||||||
host = False
|
host = False
|
||||||
flaskwebgui = False
|
|
||||||
nopromptgen = False
|
nopromptgen = False
|
||||||
rngpersist = False
|
rngpersist = False
|
||||||
nogenmod = False
|
nogenmod = False
|
||||||
@ -2774,10 +2773,8 @@ def load_model(use_gpu=True, gpu_layers=None, disk_layers=None, initial_load=Fal
|
|||||||
def index():
|
def index():
|
||||||
if args.no_ui:
|
if args.no_ui:
|
||||||
return redirect('/api/latest')
|
return redirect('/api/latest')
|
||||||
if 'new_ui' in request.args:
|
|
||||||
return render_template('index_new.html', hide_ai_menu=args.noaimenu)
|
|
||||||
else:
|
else:
|
||||||
return render_template('index.html', hide_ai_menu=args.noaimenu, flaskwebgui=vars.flaskwebgui)
|
return render_template('index.html', hide_ai_menu=args.noaimenu)
|
||||||
@app.route('/api', strict_slashes=False)
|
@app.route('/api', strict_slashes=False)
|
||||||
def api():
|
def api():
|
||||||
return redirect('/api/latest')
|
return redirect('/api/latest')
|
||||||
@ -10094,12 +10091,6 @@ if __name__ == "__main__":
|
|||||||
vars.serverstarted = True
|
vars.serverstarted = True
|
||||||
socketio.run(app, port=port, host='0.0.0.0')
|
socketio.run(app, port=port, host='0.0.0.0')
|
||||||
else:
|
else:
|
||||||
try:
|
|
||||||
from flaskwebgui import FlaskUI
|
|
||||||
vars.serverstarted = True
|
|
||||||
vars.flaskwebgui = True
|
|
||||||
FlaskUI(app, socketio=socketio, start_server="flask-socketio", maximized=True, close_server_on_exit=True).run()
|
|
||||||
except:
|
|
||||||
if not args.no_ui:
|
if not args.no_ui:
|
||||||
try:
|
try:
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
async function getRequest(url='') {
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
cache: 'no-cache'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
|
||||||
|
|
||||||
let url = document.location
|
|
||||||
let route = "/flaskwebgui-keep-server-alive";
|
|
||||||
let interval_request = 3 * 1000; //sec
|
|
||||||
|
|
||||||
function keep_alive_server(){
|
|
||||||
getRequest(url + route);
|
|
||||||
}
|
|
||||||
|
|
||||||
setInterval(keep_alive_server, interval_request);
|
|
||||||
|
|
||||||
})
|
|
@ -20,9 +20,6 @@
|
|||||||
<script src="static/rangy-core.min.js"></script>
|
<script src="static/rangy-core.min.js"></script>
|
||||||
<script src="static/application.js?ver=1.18.1e"></script>
|
<script src="static/application.js?ver=1.18.1e"></script>
|
||||||
<script src="static/favicon.js"></script>
|
<script src="static/favicon.js"></script>
|
||||||
{% if flaskwebgui %}
|
|
||||||
<script src="static/flask_web_gui.js"></script>
|
|
||||||
{% endif %}
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<input type="file" id="remote-save-select" accept="application/json" style="display:none">
|
<input type="file" id="remote-save-select" accept="application/json" style="display:none">
|
||||||
|
Reference in New Issue
Block a user