Terminal
parent
8f39dc4768
commit
e6d087f148
21
app.py
21
app.py
|
@ -216,6 +216,27 @@ def consolelxc():
|
||||||
flash('Error starting Terminal :'+str(e), category='danger')
|
flash('Error starting Terminal :'+str(e), category='danger')
|
||||||
return redirect(url_for('state'))
|
return redirect(url_for('state'))
|
||||||
|
|
||||||
|
@app.route('/ter',methods=['GET','POST',"DELETE"])
|
||||||
|
@login_required
|
||||||
|
def ter_connect():
|
||||||
|
if request.method=='GET':
|
||||||
|
resp = requests.get('http://localhost:5008/')
|
||||||
|
excluded_headers = ['content-encoding', 'content-length', 'transfer-encoding', 'connection']
|
||||||
|
headers = [(name, value) for (name, value) in resp.raw.headers.items() if name.lower() not in excluded_headers]
|
||||||
|
response = Response(resp.content, resp.status_code, headers)
|
||||||
|
return response
|
||||||
|
elif request.method=='POST':
|
||||||
|
resp = requests.post('http://localhost:5008/',json=request.get_json())
|
||||||
|
excluded_headers = ['content-encoding', 'content-length', 'transfer-encoding', 'connection']
|
||||||
|
headers = [(name, value) for (name, value) in resp.raw.headers.items() if name.lower() not in excluded_headers]
|
||||||
|
response = Response(resp.content, resp.status_code, headers)
|
||||||
|
return response
|
||||||
|
elif request.method=='DELETE':
|
||||||
|
resp = requests.delete('http://localhost:5008/').content
|
||||||
|
response = Response(resp.content, resp.status_code, headers)
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
@app.route('/console_vm',methods=['POST'])
|
@app.route('/console_vm',methods=['POST'])
|
||||||
@login_required
|
@login_required
|
||||||
def consolevm():
|
def consolevm():
|
||||||
|
|
Loading…
Reference in New Issue