mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
1. 优化重启按钮,在环境变量CONTAINER_NAME未设置时不显示
This commit is contained in:
@@ -131,6 +131,12 @@ def restart_container(request):
|
||||
res = scraper.get('https://gitee.com/ngfchl/ptools/raw/master/update.md')
|
||||
update_notes = markdown.markdown(res.text, extensions=['tables'])
|
||||
print(update_notes)
|
||||
restart = 'false'
|
||||
if os.environ.get('CONTAINER_NAME'):
|
||||
restart = 'true'
|
||||
return render(request, 'auto_pt/restart.html',
|
||||
context={'update_notes': update_notes}
|
||||
context={
|
||||
'update_notes': update_notes,
|
||||
'restart': restart
|
||||
}
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<span>更新日志</span>
|
||||
<span style="float: right;margin-top: -10px">
|
||||
<el-button type="success" @click="do_update">更新</el-button>
|
||||
<el-button type="danger" @click="do_restart">重启</el-button>
|
||||
<el-button type="danger" @click="do_restart" v-if="restart">重启</el-button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="text item">
|
||||
@@ -39,7 +39,8 @@
|
||||
// element: 指定用vue来管理页面中的哪个标签区域
|
||||
el: '#app',
|
||||
data: {
|
||||
update_note: ['请先拉取更新哦']
|
||||
update_note: ['请先拉取更新哦'],
|
||||
restart:{{ restart }},
|
||||
},
|
||||
methods: {
|
||||
do_restart() {
|
||||
|
||||
Reference in New Issue
Block a user