support multi-node log view

This commit is contained in:
Marvin Zhang
2019-03-06 15:43:14 +08:00
parent a9f555d9b9
commit 1fb09e4d1f
8 changed files with 102 additions and 59 deletions

View File

@@ -133,10 +133,7 @@ export default {
this.$store.commit('dialogView/SET_DIALOG_VISIBLE', false)
})
} else if (this.dialogType === 'spiderRun') {
this.$store.dispatch('spider/crawlSpider', {
id: this.spiderForm._id.$oid,
nodeId: this.activeNode._id
})
this.$store.dispatch('spider/crawlSpider', this.spiderForm._id.$oid)
.then(() => {
this.$message.success(`Spider "${this.spiderForm.name}" started to run on node "${this.activeNode._id}"`)
})

View File

@@ -42,7 +42,7 @@
</el-row>
<el-row class="button-container" v-if="!isView">
<el-button type="danger" @click="onRun">Run</el-button>
<!--<el-button type="primary" @click="onDeploy">Deploy</el-button>-->
<el-button type="primary" @click="onDeploy">Deploy</el-button>
<el-button type="success" @click="onSave">Save</el-button>
</el-row>
</div>
@@ -78,12 +78,12 @@ export default {
const row = this.spiderForm
this.$refs['spiderForm'].validate(res => {
if (res) {
this.$confirm('Are you sure to run this spider', 'Notice', {
this.$confirm('Are you sure to run this spider?', 'Notice', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel'
})
.then(() => {
this.$store.dispatch('spider/crawlSpider', { id: row._id.$oid })
this.$store.dispatch('spider/crawlSpider', row._id.$oid)
.then(() => {
this.$message.success(`Running spider "${row._id.$oid}" has been scheduled`)
})
@@ -92,8 +92,21 @@ export default {
})
},
onDeploy () {
this.$store.commit('dialogView/SET_DIALOG_VISIBLE', true)
this.$store.commit('dialogView/SET_DIALOG_TYPE', 'spiderDeploy')
const row = this.spiderForm
this.$refs['spiderForm'].validate(res => {
if (res) {
this.$confirm('Are you sure to deploy this spider?', 'Notice', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel'
})
.then(() => {
this.$store.dispatch('spider/crawlSpider', row._id.$oid)
.then(() => {
this.$message.success(`Spider "${row._id.$oid}" has been deployed`)
})
})
}
})
},
onSave () {
this.$refs['spiderForm'].validate(res => {