revert
This commit is contained in:
13
app.py
13
app.py
@@ -105,5 +105,18 @@ def display_logs():
|
||||
parsed_entries = parse_log_file(log_file_path)
|
||||
return render_template('logs.html', entries=parsed_entries)
|
||||
|
||||
|
||||
@main_bp.route('/home')
|
||||
@requires_auth
|
||||
def home():
|
||||
frontend_count, backend_count, acl_count, layer7_count, layer4_count = count_frontends_and_backends()
|
||||
return render_template('home.html',
|
||||
frontend_count=frontend_count,
|
||||
backend_count=backend_count,
|
||||
acl_count=acl_count,
|
||||
layer7_count=layer7_count,
|
||||
layer4_count=layer4_count)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='::', port=5000, ssl_context=ssl_context, debug=True)
|
||||
@@ -4,6 +4,8 @@ from utils.haproxy_config import update_haproxy_config, is_frontend_exist, count
|
||||
|
||||
main_bp = Blueprint('main', __name__)
|
||||
|
||||
|
||||
|
||||
@main_bp.route('/', methods=['GET', 'POST'])
|
||||
@requires_auth
|
||||
def index():
|
||||
@@ -14,9 +16,10 @@ def index():
|
||||
lb_method = request.form['lb_method']
|
||||
protocol = request.form['protocol']
|
||||
backend_name = request.form['backend_name']
|
||||
add_header = 'add_header' in request.form if 'add_header' in request.form else ''
|
||||
header_name = request.form['header_name']
|
||||
header_value = request.form['header_value']
|
||||
add_header = 'add_header' in request.form
|
||||
header_name = request.form.get('header_name', '') if add_header else ''
|
||||
header_value = request.form.get('header_value', '') if add_header else ''
|
||||
|
||||
|
||||
# Get all backend servers data
|
||||
backend_server_names = request.form.getlist('backend_server_names[]')
|
||||
@@ -99,13 +102,3 @@ def index():
|
||||
|
||||
return render_template('index.html')
|
||||
|
||||
@main_bp.route('/home')
|
||||
@requires_auth
|
||||
def home():
|
||||
frontend_count, backend_count, acl_count, layer7_count, layer4_count = count_frontends_and_backends()
|
||||
return render_template('home.html',
|
||||
frontend_count=frontend_count,
|
||||
backend_count=backend_count,
|
||||
acl_count=acl_count,
|
||||
layer7_count=layer7_count,
|
||||
layer4_count=layer4_count)
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
<body class="bg-body">
|
||||
<header class="header1" id="header1">
|
||||
<div class="container d-flex align-items-center justify-content-between flex-wrap gap-2 py-2">
|
||||
<a href="{{ url_for('main.index') }}" class="d-flex align-items-center text-decoration-none logo text-reset">
|
||||
<a href="{{ url_for('home') }}" class="d-flex align-items-center text-decoration-none logo text-reset">
|
||||
<h3 class="m-0 d-flex align-items-center gap-2">
|
||||
<i class="fas fa-globe"></i><span>HAProxy Configurator</span>
|
||||
</h3>
|
||||
</a>
|
||||
<nav class="menu d-flex align-items-center gap-1 flex-wrap">
|
||||
<a href="{{ url_for('main.index') }}" class="menu-link {{ 'active' if request.path.startswith('/home') else '' }}"><i class="bi bi-speedometer"></i> Dashboard</a>
|
||||
<a href="{{ url_for('home') }}" class="menu-link {{ 'active' if request.path.startswith('/home') else '' }}"><i class="bi bi-speedometer"></i> Dashboard</a>
|
||||
<a href="{{ url_for('main.index') }}" class="menu-link {{ 'active' if request.path == '/' else '' }}"><i class="bi bi-plus-circle"></i> Add FE/BE</a>
|
||||
<a href="{{ url_for('edit.edit_haproxy_config') }}" class="menu-link {{ 'active' if request.path.startswith('/edit') else '' }}"><i class="bi bi-pencil-square"></i> Edit Configuration</a>
|
||||
<a href="{{ url_for('display_logs') }}" class="menu-link {{ 'active' if request.path.startswith('/logs') else '' }}"><i class="bi bi-shield-lock"></i> Logs</a>
|
||||
|
||||
Reference in New Issue
Block a user