Browse Source

v2.0.3

pull/19/head
Aidaho12 7 years ago
parent
commit
23cdc92940
  1. 19
      README.md
  2. 9
      cgi-bin/users.py
  3. 2
      cgi-bin/viewlogs.py

19
README.md

@ -30,7 +30,24 @@ $ cd haproxy-wi/cgi-bin
$ 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")

9
cgi-bin/users.py

@ -51,7 +51,6 @@ for users in USERS:
need_id_group = "usergroup-%s" % users[0]
sql.get_groups_select(need_id_group, selected=users[5])
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('</tr>')
print('</table>'
@ -86,11 +85,17 @@ print('</div><div id="groups">'
'<td></td>'
'<td></td>'
'</tr>')
i = 0
for group in GROUPS:
i = i + 1
print('<tr id="group-%s">' % group[0])
if i == 1:
print('<td class="padding10 first-collumn">%s</td>' % (group[1]))
print('<td>%s</td>' % (group[2]))
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="update-row" onclick="updateGroup(%s)" style="cursor: pointer;"></a></td>' % group[0])
print('<td><a class="delete" onclick="removeGroup(%s)" style="cursor: pointer;"></a></td>' % group[0])
print('</tr>')
print('</table>'

2
cgi-bin/viewlogs.py

@ -29,7 +29,7 @@ print('<script src="/inc/users.js"></script>'
'<select id="viewlogs">'
'<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:
selected = 'selected'
else:

Loading…
Cancel
Save