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.
haproxy-wi/app/nettools.py

33 lines
1.2 KiB

#!/usr/bin/env python3
import sys
import modules.common.common as common
import modules.roxywi.roxy as roxywi_mod
import modules.roxywi.auth as roxywi_auth
import modules.roxywi.common as roxywi_common
from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('templates/'), autoescape=True)
template = env.get_template('nettools.html')
form = common.form
print('Content-type: text/html\n')
user_params = roxywi_common.get_users_params(virt=1)
try:
roxywi_auth.check_login(user_params['user_uuid'], user_params['token'])
except Exception as e:
print(f'error {e}')
sys.exit()
output_from_parsed_template = template.render(h2=1, autorefresh=0,
role=user_params['role'],
user=user_params['user'],
servers=user_params['servers'],
versions=roxywi_mod.versions(),
user_services=user_params['user_services'],
token=user_params['token'],
lang=user_params['lang'])
print(output_from_parsed_template)