Bugs
pull/30/head
Aidaho12 2018-07-31 08:20:23 +06:00
parent 2715ecab29
commit 01fc3c49be
2 changed files with 13 additions and 6 deletions

View File

@ -11,9 +11,17 @@ from configparser import ConfigParser, ExtendedInterpolation
form = cgi.FieldStorage()
serv = form.getvalue('serv')
def get_app_dir():
d = sys.path[0]
d = d.split('/')[-1]
if d == "app":
return sys.path[0]
else:
return os.path.dirname(sys.path[0])
def get_config_var(sec, var):
try:
path_config = "haproxy-webintarface.config"
path_config = get_app_dir()+"/haproxy-webintarface.config"
config = ConfigParser(interpolation=ExtendedInterpolation())
config.read(path_config)
except:

View File

@ -1,11 +1,10 @@
#!/usr/bin/env python3
import os
import sql
import os, sys
import http, cgi
import funct
import sql
import glob
import datetime
import funct
import sql
from jinja2 import Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('templates/'))
template = env.get_template('logs.html')
@ -52,7 +51,7 @@ except:
def get_files():
file = []
for files in glob.glob(os.path.join(log_path,'*.log')):
for files in glob.glob(os.path.join(log_path,'*.log*')):
file += [(files.split('/')[5], files.split('/')[5])]
return sorted(file, reverse=True)