添加初始化Xpath功能,请在更新页面食用

This commit is contained in:
ngfchl
2022-11-23 10:11:49 +08:00
parent 46f47603c2
commit b2210382df
3 changed files with 79 additions and 8 deletions

View File

@@ -38,6 +38,15 @@
v-if="update">更新
</el-button>
</el-popover>
<el-popover
placement="top-start"
title="友情提示"
width="300"
trigger="hover"
content="如果提示更新失败可以使用本功能初始化Xpath">
<el-button slot="reference" type="warning" @click="do_xpath">初始化Xpath
</el-button>
</el-popover>
<el-popover
placement="top-start"
title="友情提示"
@@ -219,7 +228,41 @@
});
});
},
do_xpath() {
this.$confirm('初始化Xpath, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
axios.get(
"{% url "do_xpath" %}", {
params: {
cid: this.cid
}
}).then(res => {
if (res.data.code === 0) {
this.$message({
type: 'success',
message: res.data.msg
});
this.time = 15
setInterval(this.timeDown, 1000)
} else {
console.log(res)
this.$message({
type: 'warning',
message: res.data.msg
});
}
})
}).catch(res => {
{#console.log(res)#}
this.$message({
type: 'info',
message: '已取消重启'
});
});
},
do_update() {
this.$confirm('此操作会拉取代码并更新软件,是否继续?', '提示', {
confirmButtonText: '确定',