mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
1. 更新启动脚本
2. 优化更新界面 3. 优化项目结构
This commit is contained in:
@@ -92,7 +92,7 @@ def do_restart(request):
|
||||
msg='重启指令发送成功!!'
|
||||
).to_dict(), safe=False)
|
||||
return JsonResponse(data=CommonResponse.error(
|
||||
msg='未配置CONTAINER_NAME(容器名称)环境变量!!'
|
||||
msg='未配置CONTAINER_NAME(容器名称)环境变量,请自行重启容器!!'
|
||||
).to_dict(), safe=False)
|
||||
except Exception as e:
|
||||
return JsonResponse(data=CommonResponse.error(
|
||||
@@ -108,14 +108,17 @@ def do_update(request):
|
||||
|
||||
p = subprocess.Popen('./update.sh', shell=True, stdout=subprocess.PIPE, bufsize=1)
|
||||
p.wait()
|
||||
# result = []
|
||||
# for i in p.stdout.readlines():
|
||||
# print(i)
|
||||
# result.append(i)
|
||||
out = p.stdout.readlines()
|
||||
result = []
|
||||
for i in out:
|
||||
result.append(i.decode('utf8'))
|
||||
print(result)
|
||||
return JsonResponse(data=CommonResponse.success(
|
||||
msg='更新成功!!', data={
|
||||
'p': str(p.stdout.readlines())
|
||||
}
|
||||
msg='更新成功!!',
|
||||
data=result
|
||||
# data={
|
||||
# # 'p': str(p.stdout.readlines()).strip("'").strip('[').strip(']').strip()
|
||||
# }
|
||||
).to_dict(), safe=False)
|
||||
except Exception as e:
|
||||
return JsonResponse(data=CommonResponse.error(
|
||||
|
||||
@@ -204,10 +204,10 @@ SIMPLEUI_CONFIG = {
|
||||
}, {
|
||||
'app': 'update',
|
||||
'name': '更新',
|
||||
'icon': 'fas fa-shield',
|
||||
'icon': 'fas fa-code',
|
||||
'models': [{
|
||||
'name': '重启更新',
|
||||
'icon': 'fa fa-refresh',
|
||||
'icon': 'far fa-surprise',
|
||||
'url': '/tasks/restart'
|
||||
}, ]
|
||||
}]
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
).then(res => {
|
||||
if (res.data.code === 0) {
|
||||
console.log(res, 1)
|
||||
this.update_note = res.data.data.p.split(',')
|
||||
this.update_note = res.data.data
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.data.msg
|
||||
|
||||
Reference in New Issue
Block a user