Bugs
pull/21/head
Aidaho12 2018-07-07 15:43:31 +06:00
parent 2c6eb8d37d
commit 00aaa0a481
9 changed files with 36 additions and 10 deletions

View File

@ -22,7 +22,7 @@ try:
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE")) cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
user_id = cookie.get('uuid') user_id = cookie.get('uuid')
user = sql.get_user_name_by_uuid(user_id.value) user = sql.get_user_name_by_uuid(user_id.value)
servers = sql.get_dick_permit() servers = sql.get_dick_permit(disable=0)
token = sql.get_token(user_id.value) token = sql.get_token(user_id.value)
except: except:
pass pass

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
import sql import sql
import http import http, cgi
import funct import funct
import sql import sql
from jinja2 import Environment, FileSystemLoader from jinja2 import Environment, FileSystemLoader
@ -10,6 +10,7 @@ template = env.get_template('runtimeapi.html')
print('Content-type: text/html\n') print('Content-type: text/html\n')
funct.check_login() funct.check_login()
form = cgi.FieldStorage()
try: try:
cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE")) cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE"))
@ -17,6 +18,7 @@ try:
user = sql.get_user_name_by_uuid(user_id.value) user = sql.get_user_name_by_uuid(user_id.value)
servers = sql.get_dick_permit(virt=1) servers = sql.get_dick_permit(virt=1)
token = sql.get_token(user_id.value) token = sql.get_token(user_id.value)
servbackend = form.getvalue('servbackend')
except: except:
pass pass
@ -27,5 +29,6 @@ output_from_parsed_template = template.render(h2 = 1,
onclick = "showRuntime()", onclick = "showRuntime()",
select_id = "serv", select_id = "serv",
selects = servers, selects = servers,
token = token) token = token,
servbackend = servbackend)
print(output_from_parsed_template) print(output_from_parsed_template)

View File

@ -6,6 +6,11 @@
<li><a href="#frontend">Frontend</a></li> <li><a href="#frontend">Frontend</a></li>
<li><a href="#backend">Backend</a></li> <li><a href="#backend">Backend</a></li>
<li><a href="#ssl">SSL certificates</a></li> <li><a href="#ssl">SSL certificates</a></li>
{% if user %}
<a href=/app/login.py?logout=logout title="Logout, user name: {{ user }}" class="login"> Logout</a>
{% else %}
<a href=/app/login.py title="Login" class="login"> Login</a>
{% endif %}
</ul> </ul>
<div id="listen"> <div id="listen">
<form name="add-listner" action="/app/add.py"> <form name="add-listner" action="/app/add.py">

View File

@ -11,6 +11,11 @@
<li><a href="#servers">Servers</a></li> <li><a href="#servers">Servers</a></li>
<li><a href="#roles">Roles</a></li> <li><a href="#roles">Roles</a></li>
<li><a href="#ssh">SSH credentials</a></li> <li><a href="#ssh">SSH credentials</a></li>
{% if user %}
<a href=/app/login.py?logout=logout title="Logout, user name: {{ user }}" class="login"> Logout</a>
{% else %}
<a href=/app/login.py title="Login" class="login"> Login</a>
{% endif %}
</ul> </ul>
<div id="users"> <div id="users">
<table class="overview" id="ajax-users"> <table class="overview" id="ajax-users">

View File

@ -10,8 +10,8 @@
</tr> </tr>
<tr> <tr>
<td class="padding10 first-collumn" style="width: 25%;"> <td class="padding10 first-collumn" style="width: 25%;">
<form action= {{ action }} method="get"> <form action="{{ action }}" method="get">
<select autofocus required id="{{ select_id }}"> <select autofocus required id="{{ select_id }}" name="{{ select_id }}">
<option disabled>Choose server</option> <option disabled>Choose server</option>
{% for select in selects %} {% for select in selects %}
<option value="{{ select.2 }}">{{ select.1 }}</option> <option value="{{ select.2 }}">{{ select.1 }}</option>
@ -30,7 +30,7 @@
</select> </select>
</td> </td>
<td> <td>
<input type="text" name="servbackend" id="servbackend" size=35 title="Frontend, backend/server, show: info, pools or help" required class="form-control"> <input type="text" name="servbackend" id="servbackend" size=35 title="Frontend, backend/server, show: info, pools or help" required class="form-control" value="{{ servbackend }}">
</td> </td>
<td> <td>
{% if role <= 2 %} {% if role <= 2 %}
@ -43,4 +43,9 @@
</form> </form>
</tr> </tr>
</table> </table>
<script>
if($('#servbackend').val()) {
window.onload = {{ onclick }}
}
</script>
{% endblock %} {% endblock %}

View File

@ -8,6 +8,11 @@
<ul> <ul>
<li><a href="#servers">Servers</a></li> <li><a href="#servers">Servers</a></li>
<li><a href="#ssh">SSH credentials</a></li> <li><a href="#ssh">SSH credentials</a></li>
{% if user %}
<a href=/app/login.py?logout=logout title="Logout, user name: {{ user }}" class="login"> Logout</a>
{% else %}
<a href=/app/login.py title="Login" class="login"> Login</a>
{% endif %}
</ul> </ul>
<div id="servers"> <div id="servers">

View File

@ -30,7 +30,7 @@
position: fixed; position: fixed;
z-index: 1031; z-index: 1031;
top: 15px; top: 15px;
right: 175px; right: 285px;
} }
#nprogress .spinner-icon { #nprogress .spinner-icon {
width: 18px; width: 18px;

View File

@ -419,7 +419,8 @@ pre {
color: #fff !important; color: #fff !important;
} }
.ui-tabs-nav { .ui-tabs-nav {
padding-left: 20px !important; border-radius: 0 !important;
padding-left: 25px !important;
} }
.ui-tabs .ui-tabs-panel { .ui-tabs .ui-tabs-panel {
padding: 0 !important; padding: 0 !important;
@ -427,6 +428,8 @@ pre {
} }
.ui-tabs { .ui-tabs {
padding-left: 0 !important; padding-left: 0 !important;
margin-top: -5px !important;
margin-left: -2px;
} }
.ui-widget-header { .ui-widget-header {
background: #5d9ceb !important; background: #5d9ceb !important;

View File

@ -57,7 +57,7 @@ else
yum -y install epel-release yum -y install epel-release
fi fi
yum -y install git nmap-ncat net-tools lshw python34 dos2unix python34-pip httpd mod_ssl gcc python34-devel yum -y install git nmap-ncat net-tools lshw python34 dos2unix python34-pip httpd mod_ssl python34-devel
HTTPD_CONFIG="/etc/httpd/conf/httpd.conf" HTTPD_CONFIG="/etc/httpd/conf/httpd.conf"
HAPROXY_WI_VHOST_CONF="/etc/httpd/conf.d/haproxy-wi.conf" HAPROXY_WI_VHOST_CONF="/etc/httpd/conf.d/haproxy-wi.conf"
HTTPD_NAME="httpd" HTTPD_NAME="httpd"