Fixers in manager_apache
This commit is contained in:
parent
8231aa715c
commit
592ad67719
5 changed files with 66 additions and 49 deletions
17
admin/app.py
17
admin/app.py
|
|
@ -82,6 +82,7 @@ def options_options(row_id, row):
|
|||
#
|
||||
#arr_options.append('<a href="{}">{}</a>'.format(url_for('admin_app.ports', webserver_id=row_id), _('HTTP Ports')))
|
||||
#arr_options.append('<a href="{}">{}</a>'.format("", _('Edit')))
|
||||
arr_options.append('<a href="{}">{}</a>'.format(url_for('admin_app.webservers_edit_languages', webserver_id=row_id), _('Languages')))
|
||||
arr_options.append('<a href="{}">{}</a>'.format(url_for('admin_app.delete_webserver', webserver_id=row_id), _('Delete')))
|
||||
|
||||
return '<br />'.join(arr_options)
|
||||
|
|
@ -628,7 +629,7 @@ def edit_virtualhost(virtualhost_id):
|
|||
virtual=VirtualHost(db)
|
||||
|
||||
#arr_vhost=virtual.select_a_row(virtualhost_id, [], True)
|
||||
with virtual.query('select virtualhost.*, webserver.id, serverdbtask.distro from virtualhost, webserver, serverdbtask WHERE virtualhost.id=%s AND virtualhost.webserver_id=webserver.id AND webserver.server_id=serverdbtask.id', [virtualhost_id]) as cursor:
|
||||
with virtual.query('select virtualhost.*, webserver.id, serverdbtask.distro, serverdbtask.id from virtualhost, webserver, serverdbtask WHERE virtualhost.id=%s AND virtualhost.webserver_id=webserver.id AND webserver.server_id=serverdbtask.id', [virtualhost_id]) as cursor:
|
||||
|
||||
arr_vhost=cursor.fetchone()
|
||||
|
||||
|
|
@ -676,11 +677,23 @@ def edit_virtualhost(virtualhost_id):
|
|||
|
||||
virtual.fields['php'].label=_('PHP support')
|
||||
virtual.fields['php'].name_form=SelectForm
|
||||
"""
|
||||
if arr_vhost['distro']!='arch':
|
||||
virtual.fields['php'].extra_parameters=[{'': 'No php support', '7.4': 'PHP 7.4', '8.0': 'PHP 8.0', '8.1': 'PHP 8.1', '8.2': 'PHP 8.2', '8.3': 'PHP 8.3'}]
|
||||
else:
|
||||
virtual.fields['php'].extra_parameters=[{'': 'No php support', '8.1': 'PHP 8.1 (On Arch, php-legacy for maximum compatibility)'}]
|
||||
"""
|
||||
with db.query('select * from phpserver where server_id=%s', [arr_vhost['serverdbtask.id']]) as cursor:
|
||||
arr_php=cursor.fetchall()
|
||||
|
||||
#print(arr_php)
|
||||
|
||||
virtual.fields['php'].extra_parameters=[{'': 'No php support'}]
|
||||
|
||||
for p in arr_php:
|
||||
#print(p['version'])
|
||||
virtual.fields['php'].extra_parameters[0][p['version']]='PHP '+p['version']
|
||||
|
||||
virtual.fields['php'].help=_('Add support to php to virtualhost. You can choose ophp version that you prefer')
|
||||
|
||||
#'port', 'ssl_port',
|
||||
|
|
@ -829,7 +842,7 @@ def save_edit_virtualhost():
|
|||
php=request.form.get('php', '')
|
||||
|
||||
if php!='':
|
||||
if php!='7.4' and php!='8.0' and php!='8.1' and php!='8.2' and php!='8.3':
|
||||
if php!='8.2' and php!='8.3' and php!='8.4':
|
||||
php=''
|
||||
|
||||
task_id=0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue