mirror of https://github.com/Aidaho12/haproxy-wi
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.0 KiB
32 lines
1.0 KiB
#!/usr/bin/env python3 |
|
import sys |
|
|
|
import funct |
|
from jinja2 import Environment, FileSystemLoader |
|
env = Environment(loader=FileSystemLoader('templates/'), autoescape=True) |
|
template = env.get_template('nettools.html') |
|
form = funct.form |
|
|
|
print('Content-type: text/html\n') |
|
|
|
try: |
|
user, user_id, role, token, servers, user_services \ |
|
= funct.get_users_params(virt=1) |
|
except Exception: |
|
pass |
|
|
|
try: |
|
funct.check_login(user_id, token) |
|
except Exception as e: |
|
print(f'error {e}') |
|
sys.exit() |
|
|
|
output_from_parsed_template = template.render(h2=1, autorefresh=0, |
|
title="Network tools", |
|
role=role, |
|
user=user, |
|
servers=servers, |
|
versions=funct.versions(), |
|
user_services=user_services, |
|
token=token) |
|
print(output_from_parsed_template)
|
|
|