pull/19/head
Aidaho12 2018-04-23 12:37:23 +06:00
parent f81f6d980f
commit 23cdc92940
3 changed files with 29 additions and 7 deletions

View File

@ -30,7 +30,24 @@ $ cd haproxy-wi/cgi-bin
$ chmod +x *.py $ chmod +x *.py
``` ```
For Apache do virtualhost with cgi-bin. For Apache do virtualhost with cgi-bin. Like this:
```
<VirtualHost *:80>
ServerName haproxy-wi
ErrorLog /var/log/httpd/haproxy-wi.error.log
CustomLog /var/log/httpd/haproxy-wi.access.log combined
DocumentRoot /var/www/haproxy-wi
ScriptAlias /cgi-bin/ "/var/www/haproxy-wi/cgi-bin/"
<Directory /var/www/haproxy-wi>
Options +ExecCGI
AddHandler cgi-script .py
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
```
![alt text](image/haproxy-wi-overview.jpeg "Overview page") ![alt text](image/haproxy-wi-overview.jpeg "Overview page")

View File

@ -51,7 +51,6 @@ for users in USERS:
need_id_group = "usergroup-%s" % users[0] need_id_group = "usergroup-%s" % users[0]
sql.get_groups_select(need_id_group, selected=users[5]) sql.get_groups_select(need_id_group, selected=users[5])
print('</td>') print('</td>')
#print('<td><a class="update-row" onclick="updateUser(%s)" style="cursor: pointer;"></a></td>' % users[0])
print('<td><a class="delete" onclick="removeUser(%s)" style="cursor: pointer;"></a></td>' % users[0]) print('<td><a class="delete" onclick="removeUser(%s)" style="cursor: pointer;"></a></td>' % users[0])
print('</tr>') print('</tr>')
print('</table>' print('</table>'
@ -86,12 +85,18 @@ print('</div><div id="groups">'
'<td></td>' '<td></td>'
'<td></td>' '<td></td>'
'</tr>') '</tr>')
i = 0
for group in GROUPS: for group in GROUPS:
i = i + 1
print('<tr id="group-%s">' % group[0]) print('<tr id="group-%s">' % group[0])
print('<td class="padding10 first-collumn"><input type="text" id="name-%s" value="%s" class="form-control"></td>' % (group[0], group[1])) if i == 1:
print('<td><input type="text" id="descript-%s" value="%s" class="form-control" size="100"></td>' % (group[0], group[2])) print('<td class="padding10 first-collumn">%s</td>' % (group[1]))
#print('<td><a class="update-row" onclick="updateGroup(%s)" style="cursor: pointer;"></a></td>' % group[0]) print('<td>%s</td>' % (group[2]))
print('<td><a class="delete" onclick="removeGroup(%s)" style="cursor: pointer;"></a></td>' % group[0]) print('<td></td>')
else:
print('<td class="padding10 first-collumn"><input type="text" id="name-%s" value="%s" class="form-control"></td>' % (group[0], group[1]))
print('<td><input type="text" id="descript-%s" value="%s" class="form-control" size="100"></td>' % (group[0], group[2]))
print('<td><a class="delete" onclick="removeGroup(%s)" style="cursor: pointer;"></a></td>' % group[0])
print('</tr>') print('</tr>')
print('</table>' print('</table>'
'<br /><span class="add-button" title="Add group" id="add-group-button">+ Add</span>') '<br /><span class="add-button" title="Add group" id="add-group-button">+ Add</span>')

View File

@ -29,7 +29,7 @@ print('<script src="/inc/users.js"></script>'
'<select id="viewlogs">' '<select id="viewlogs">'
'<option disabled selected>Choose log</option>') '<option disabled selected>Choose log</option>')
for files in sorted(glob.glob('*.log')): for files in sorted(glob.glob('*.log'), reverse=True):
if files == viewlog: if files == viewlog:
selected = 'selected' selected = 'selected'
else: else: