mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
添加初始化Xpath功能,请在更新页面食用
This commit is contained in:
@@ -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: '确定',
|
||||
|
||||
Reference in New Issue
Block a user