22 lines
702 B
Python
22 lines
702 B
Python
"""Edit HAProxy configuration"""
|
|
|
|
from flask import Blueprint, render_template, request, jsonify, session, redirect, url_for
|
|
from routes.auth_routes import login_required
|
|
from database.models import VirtualHost
|
|
import logging
|
|
|
|
edit_bp = Blueprint('edit', __name__, url_prefix='/edit')
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
@edit_bp.route('/')
|
|
@login_required
|
|
def edit_haproxy_config():
|
|
"""Edit configuration page"""
|
|
try:
|
|
vhosts = VirtualHost.query.all()
|
|
return render_template('edit.html', vhosts=vhosts)
|
|
except Exception as e:
|
|
logger.error(f"[EDIT] Error: {e}", flush=True)
|
|
return render_template('edit.html', vhosts=[], error=str(e))
|