mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-09-07 10:07:39 +02:00
Update to v8.21.0
This commit is contained in:
@@ -315,7 +315,7 @@ class databaseBase:
|
||||
if get.type == 'redis':
|
||||
arrs = ['db_host', 'db_port', 'db_password', 'db_ps', 'type']
|
||||
cRet = self.check_cloud_args(get, arrs)
|
||||
if isinstance(cRet, dict):
|
||||
if cRet['status'] != 0:
|
||||
return cRet
|
||||
|
||||
get['db_name'] = None
|
||||
@@ -422,7 +422,7 @@ class databaseBase:
|
||||
arrs = ['db_host', 'db_port', 'db_password', 'db_ps', 'type']
|
||||
|
||||
cRet = self.check_cloud_args(get, arrs)
|
||||
if isinstance(cRet, dict):
|
||||
if cRet['status'] != 0:
|
||||
return cRet
|
||||
|
||||
get['db_name'] = None
|
||||
|
||||
@@ -455,19 +455,18 @@ class main(databaseBase):
|
||||
|
||||
for key in arrs:
|
||||
if key not in get:
|
||||
return public.returnMsg(False, 'Parameter passing error, missing parameter{}!'.format(key))
|
||||
return public.fail_v2(public.lang('Parameter passing error, missing parameter {}!'.format(key)))
|
||||
|
||||
id = int(get.id)
|
||||
get['db_port'] = int(get['db_port'])
|
||||
db_find = public.M('database_servers').where('id=?', (id,)).find()
|
||||
if not db_find: return public.returnMsg(False, 'Specifies that the remote server does not exist!')
|
||||
if not db_find: return public.fail_v2(public.lang('Specifies that the remote server does not exist!'))
|
||||
_modify = False
|
||||
if db_find['db_host'] != get['db_host'] or db_find['db_port'] != get['db_port']:
|
||||
_modify = True
|
||||
if public.M('database_servers').where('db_host=? AND db_port=?', (get['db_host'], get['db_port'])).count():
|
||||
return public.returnMsg(False,
|
||||
'Specifies that the server already exists: [{}:{}]'.format(get['db_host'],
|
||||
get['db_port']))
|
||||
return public.fail_v2(public.lang(
|
||||
'Specifies that the server already exists: [{}:{}]'.format(get['db_host'], get['db_port'])))
|
||||
|
||||
if db_find['db_user'] != get['db_user'] or db_find['db_password'] != get['db_password']:
|
||||
_modify = True
|
||||
@@ -488,8 +487,8 @@ class main(databaseBase):
|
||||
'Database management',
|
||||
'Modifying a Remote MySQL Server[{}:{}]'.format(get['db_host'], get['db_port'])
|
||||
)
|
||||
return public.returnMsg(True, 'Modified successfully!')
|
||||
return public.returnMsg(False, 'Modification Failure: {}'.format(result))
|
||||
return public.success_v2(public.lang('Modified successfully!'))
|
||||
return public.fail_v2(public.lang('Modification Failure: {}'.format(result)))
|
||||
|
||||
def set_auth_status(self, get):
|
||||
"""
|
||||
|
||||
@@ -1277,7 +1277,7 @@ class main(databaseBase, panelPgsql):
|
||||
status, err_msg = pgsql_obj.connect()
|
||||
if status is False:
|
||||
return public.fail_v2(public.lang("Remote database connection failed!"))
|
||||
return public.success_v2(status)
|
||||
return status
|
||||
except:
|
||||
return public.fail_v2(public.lang("Remote database connection failed!"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user