This commit is contained in:
lulzette 2021-03-25 21:03:44 +00:00
parent 70ff6022ca
commit e93bf16bf7

29
main.py
View File

@ -15,19 +15,6 @@ def index():
return str(listVDS()) return str(listVDS())
@get('/action') # or @route('/login')
def login():
return '''
<form action="/action" method="post">
VDS Name: <input name="name" type="text" /> <br>
Action (start/stop): <br>
<input type="radio" name="act" value="start"> Start<Br>
<input type="radio" name="act" value="stop"> Stop<Br>
<input type="radio" name="act" value="destroy"> destroy<Br>
<input value="Exec" type="submit" />
</form>
'''
@post('/action') # or @route('/login', method='POST') @post('/action') # or @route('/login', method='POST')
def do_action(): def do_action():
@ -46,5 +33,21 @@ def do_action():
else: else:
return dict(state="error") return dict(state="error")
@get('/action') # or @route('/login')
def login():
return '''
<form action="/action" method="post">
VDS Name: <input name="name" type="text" /> <br>
Action (start/stop): <br>
<input type="radio" name="act" value="start"> Start<Br>
<input type="radio" name="act" value="stop"> Stop<Br>
<input type="radio" name="act" value="destroy"> destroy<Br>
<input value="Exec" type="submit" />
</form>
'''
if __name__ == '__main__': if __name__ == '__main__':
run(host='0.0.0.0', port=5000, debug=True) run(host='0.0.0.0', port=5000, debug=True)