Fixes in links of progress mysql task
This commit is contained in:
parent
b950f48245
commit
033deddf79
1 changed files with 7 additions and 48 deletions
|
|
@ -5,8 +5,10 @@ from modules.pastafari2.libraries.task import Task
|
|||
from paramecio2.libraries.db import coreforms
|
||||
from paramecio2.libraries.db.extrafields.ipfield import IpField
|
||||
from paramecio2.libraries.formsutils import show_form
|
||||
from paramecio2.libraries.urls import make_url
|
||||
from collections import OrderedDict
|
||||
from modules.pastafari2.models.pastafari2 import ServerDbTask
|
||||
from paramecio2.libraries.i18n import I18n
|
||||
try:
|
||||
from modules.mariadb.models.mariadb import DbServerMariaDb
|
||||
server_db=True
|
||||
|
|
@ -47,6 +49,8 @@ class ServerTask(Task):
|
|||
|
||||
self.arr_form=OrderedDict()
|
||||
|
||||
self.links='<p><a href="{}">{}</a></p>'.format(make_url('mariadbservers/servers'), I18n.lang('mariadbservers', 'mariadbservers_list', 'MariaDB servers list'))
|
||||
|
||||
#self.commands_to_execute=[['modules/pastafari/scripts/servers/databases/mariadb/install_mariadb.py', '--password=%s' % self.data['mysql_password']]]
|
||||
|
||||
def post_task(self):
|
||||
|
|
@ -76,53 +80,8 @@ class ServerTask(Task):
|
|||
|
||||
self.commands_to_execute=[['modules/mariadb/scripts/update_mariadb.py', '%s' % (ip_option)]]
|
||||
|
||||
#self.links='<p><a href="{}">{}</a> >> <a href="{}">{}</a> >> <a href="{}">{}</a>'.format(make_url('webservers/servers'), I18n.lang('webservers', 'webservers_list', 'Webservers list'), make_url('webservers/virtualhost/'+str(self.webserver_id)), I18n.lang('webservers', 'websites', 'Websites'), make_url('webapps/'+str(self.data['virtualhost_id'])), I18n.lang('webservers', 'webapps', 'Webapps'))
|
||||
|
||||
|
||||
return True
|
||||
|
||||
"""
|
||||
def form(self, t, yes_error=False, pass_values=False, values={}):
|
||||
|
||||
#Here load the form for it task
|
||||
|
||||
return '<h2>Mariadb/MySQL configuration</h2>'+show_form(values, self.arr_form, t, yes_error, pass_values)
|
||||
|
||||
def check_form(self, post):
|
||||
|
||||
error=False
|
||||
|
||||
if 'mysql_password' in post and 'repeat_mysql_password' in post:
|
||||
|
||||
if post['mysql_password'].strip()!='' and post['mysql_password']==post['repeat_mysql_password']:
|
||||
|
||||
self.data['mysql_password']=post['mysql_password'].strip()
|
||||
|
||||
else:
|
||||
|
||||
self.arr_form['mysql_password'].error=True
|
||||
self.arr_form['mysql_password'].txt_error='Passwords doesn\'t match'
|
||||
error=True
|
||||
|
||||
if 'access_localhost' in post:
|
||||
ip_check=IpField('ip')
|
||||
|
||||
ip_host=post['access_localhost'].strip()
|
||||
|
||||
if ip_host!='':
|
||||
|
||||
ip_host=ip_check.check(ip_host)
|
||||
|
||||
if ip_host!='':
|
||||
self.data['ip']=ip_host
|
||||
|
||||
if ip_check.error:
|
||||
|
||||
self.arr_form['access_localhost'].error=True
|
||||
self.arr_form['access_localhost'].txt_error='Wrong ip format'
|
||||
error=True
|
||||
|
||||
|
||||
if error:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
"""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue