haproxy-wi/app/edit.py

52 lines
1.6 KiB
Python
Raw Normal View History

2018-01-15 06:16:04 +00:00
#!/usr/bin/env python3
import html
import cgi
import funct
import sql
2018-01-15 06:16:04 +00:00
form = cgi.FieldStorage()
serv = form.getvalue('serv')
2018-04-10 03:58:56 +00:00
funct.head("Runtime API")
funct.check_login()
2018-04-04 08:44:45 +00:00
funct.check_config()
2018-01-15 06:16:04 +00:00
print('<h2>Runtime API</h2>'
2018-04-04 08:44:45 +00:00
'<table class="overview">'
'<tr class="overviewHead">'
'<td class="padding10 first-collumn">Server</td>'
2018-04-04 08:44:45 +00:00
'<td>Disable/Enable server or output any information</td>'
'<td class="padding10">Command</td>'
'<td>Save change</td>'
'<td></td>'
'</tr>'
'<tr>'
'<td class="padding10 first-collumn" style="width: 25%;">'
2018-04-04 08:44:45 +00:00
'<form action="edit.py" method="get">'
2018-04-10 03:58:56 +00:00
'<select required name="serv" id="serv">'
2018-04-04 08:44:45 +00:00
'<option disabled selected>Choose server</option>')
funct.choose_only_select(serv, virt=1)
2018-04-04 08:44:45 +00:00
print('</select></td>'
'<td style="width: 30%;">'
2018-04-10 03:58:56 +00:00
'<select required name="servaction" id="servaction">'
2018-04-04 08:44:45 +00:00
'<option disabled selected>Choose action</option>')
2018-04-05 03:34:17 +00:00
if funct.is_admin():
2018-04-10 03:58:56 +00:00
print('<option value="disable">Disable</option>')
print('<option value="enable">Enable</option>')
print('<option value="set">Set</option>')
print('<option value="show">Show</option>'
'</select></td>'
'<td>'
'<input type="text" name="servbackend" id="servbackend" size=35 title="Frontend, backend/server, show: info, pools or help" required class="form-control">'
'</td><td>'
2018-04-26 04:24:23 +00:00
'<label for="save"></label><input type="checkbox" name="save" id="save" value="123">'
2018-04-10 03:58:56 +00:00
'</td><td>'
2018-04-11 03:30:46 +00:00
'<a class="ui-button ui-widget ui-corner-all" id="show" title="Enter" onclick="showRuntime()">Enter</a>'
2018-04-10 03:58:56 +00:00
'</td></form>'
'</tr></table>'
'<div id="ajax">'
'</div>')
2018-01-15 06:16:04 +00:00
funct.footer()