Commit 28d877b1 authored by 金凯强's avatar 金凯强 🎨

日志

parent 9c592e24
Pipeline #21123 passed with stage
in 25 seconds
...@@ -42,3 +42,12 @@ class InfoAPI(ApiController): ...@@ -42,3 +42,12 @@ class InfoAPI(ApiController):
''' '''
args = request.args args = request.args
return InfoService().get_upgrade_log_dtl(log_id, args) return InfoService().get_upgrade_log_dtl(log_id, args)
@api('logs')
def get_install_logs_info(self):
'''
获取日志信息
:return:
'''
return InfoService().get_install_logs()
\ No newline at end of file
...@@ -140,8 +140,8 @@ values ...@@ -140,8 +140,8 @@ values
获取升级历史信息 获取升级历史信息
:return: :return:
''' '''
per_page = args.get('per_page',10) per_page = args.get('per_page', 10)
page = args.get('page',1) page = args.get('page', 1)
offset = (int(page) - 1) * int(per_page) offset = (int(page) - 1) * int(per_page)
sql = '''select A.*,(select count(*) from app_upgrade_log_dtl where log_id=A.id) as count sql = '''select A.*,(select count(*) from app_upgrade_log_dtl where log_id=A.id) as count
...@@ -176,8 +176,8 @@ order by A.default_version desc, A.upgrade_time desc ...@@ -176,8 +176,8 @@ order by A.default_version desc, A.upgrade_time desc
:param log_id: :param log_id:
:return: :return:
''' '''
per_page = args.get('per_page',10) per_page = args.get('per_page', 10)
page = args.get('page',1) page = args.get('page', 1)
offset = (int(page) - 1) * int(per_page) offset = (int(page) - 1) * int(per_page)
sql = f'''select A.* sql = f'''select A.*
...@@ -204,3 +204,11 @@ where A.log_id={log_id}''' ...@@ -204,3 +204,11 @@ where A.log_id={log_id}'''
} }
return page_data return page_data
def get_install_logs(self):
'''
获取升级日志
:return:
'''
logs = docker_client.logs('install_api')
return logs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment