1. 更新启动脚本

2. 优化更新界面
3. 优化项目结构
This commit is contained in:
ngfchl
2022-08-25 12:03:01 +08:00
parent 2b61751c2c
commit 24bcba7463
3 changed files with 14 additions and 11 deletions

View File

@@ -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(

View File

@@ -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'
}, ]
}]

View File

@@ -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