|
|
@ -120,22 +120,28 @@ |
|
|
|
:css="css.table" |
|
|
|
> |
|
|
|
|
|
|
|
<!-- |
|
|
|
EDO |
|
|
|
props.rowData._id gia to pagination problem |
|
|
|
pass props.rowData._id as index |
|
|
|
allagi tou vuetablerefresh |
|
|
|
--> |
|
|
|
<div slot="actionsenabled" slot-scope="props"> |
|
|
|
<div class="d-flex justify-content-center"> |
|
|
|
<button |
|
|
|
v-if="testactionrowindex[props.rowData.swarmlabname] == props.rowIndex" |
|
|
|
v-if="testactionrowindex[props.rowData.swarmlabname] == props.rowData._id" |
|
|
|
class="ti-thumb-up btn btn-info btn-sm" |
|
|
|
title="Stop Lab_Instance" |
|
|
|
round |
|
|
|
@click="onAction('down-item', props.rowData, props.rowIndex)" |
|
|
|
@click="onAction('down-item', props.rowData, props.rowData._id)" |
|
|
|
> |
|
|
|
</button> |
|
|
|
<button |
|
|
|
v-if="testactionrowindex[props.rowData.swarmlabname] != props.rowIndex && testactionrowindex[props.rowIndex] == props.rowIndex" |
|
|
|
v-if="testactionrowindex[props.rowData.swarmlabname] != props.rowData._id && testactionrowindex[props.rowData._id] == props.rowData._id" |
|
|
|
class="ti-thumb-down btn btn-secondary btn-sm" |
|
|
|
title="Start Lab_Instance" |
|
|
|
round |
|
|
|
@click="onAction('run-item', props.rowData, props.rowIndex)" |
|
|
|
@click="onAction('run-item', props.rowData, props.rowData._id)" |
|
|
|
> |
|
|
|
</button> |
|
|
|
</div> |
|
|
@ -143,10 +149,10 @@ |
|
|
|
<div slot="actionslocal" slot-scope="props"> |
|
|
|
<div class="d-flex justify-content-center"> |
|
|
|
<button |
|
|
|
v-if="testactionrowindex[props.rowIndex] == props.rowIndex && testactionrowindex[props.rowData.swarmlabname] != props.rowIndex" |
|
|
|
v-if="testactionrowindex[props.rowData._id] == props.rowData._id && testactionrowindex[props.rowData.swarmlabname] != props.rowData._id" |
|
|
|
class="ti-trash btn btn-info btn-sm" |
|
|
|
title="Remove Lab_Instance" |
|
|
|
@click="onAction('rm-install', props.rowData, props.rowIndex)" |
|
|
|
@click="onAction('rm-install', props.rowData, props.rowData._id)" |
|
|
|
round |
|
|
|
> |
|
|
|
</button> |
|
|
@ -155,17 +161,17 @@ |
|
|
|
<div slot="actions" slot-scope="props"> |
|
|
|
<div class="d-flex justify-content-center"> |
|
|
|
<button |
|
|
|
v-if="checkactionrowindex(props.rowData,props.rowIndex)" |
|
|
|
v-if="checkactionrowindex(props.rowData,props.rowData._id)" |
|
|
|
class="ti-cloud-down btn btn-outline-secondary btn-sm" |
|
|
|
title="Download Lab_Instance" |
|
|
|
round |
|
|
|
@click="onAction('run-install', props.rowData, props.rowIndex)"> |
|
|
|
@click="onAction('run-install', props.rowData, props.rowData._id)"> |
|
|
|
</button> |
|
|
|
<button |
|
|
|
class="ti-info btn btn-outline-secondary btn-sm" |
|
|
|
title="Lab_Instance Info" |
|
|
|
round |
|
|
|
@click="onAction('view-item', props.rowData, props.rowIndex)"> |
|
|
|
@click="onAction('view-item', props.rowData, props.rowData._id)"> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -305,6 +311,10 @@ export default { |
|
|
|
}], |
|
|
|
multiSort: true, |
|
|
|
paginationComponent: 'vuetable-pagination', |
|
|
|
currentpage:'1', |
|
|
|
currentpagepaginationData: {}, |
|
|
|
dataselect:'', |
|
|
|
indexselect:'', |
|
|
|
itemActions: [ |
|
|
|
{ name: 'view-item', label: '', icon: 'glyphicon glyphicon-zoom-in', class: 'btn btn-info', extra: {'title': 'View', 'data-toggle':"tooltip", 'data-placement': "left"} }, |
|
|
|
{ name: 'edit-item', label: '', icon: 'glyphicon glyphicon-pencil', class: 'btn btn-warning', extra: {title: 'Edit', 'data-toggle':"tooltip", 'data-placement': "top"} }, |
|
|
@ -319,12 +329,14 @@ export default { |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$root.$on('hybrid_refresh_availableservices', () => { |
|
|
|
Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
//Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
Vue.nextTick( () => this.refreshVuetable()) |
|
|
|
}) |
|
|
|
//refresh from socket mytable |
|
|
|
this.$root.$on('hybrid_refresh_table', (v) => { |
|
|
|
this.$nextTick(function () { |
|
|
|
Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
//Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
this.refreshVuetable() |
|
|
|
this.viewhybridoptions = false |
|
|
|
}) |
|
|
|
}) |
|
|
@ -368,36 +380,38 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
async checkactionrowindex(data,index){ |
|
|
|
this.dataselect=data |
|
|
|
this.indexselect=index |
|
|
|
if(this.testactionrowindex[index] == index){ |
|
|
|
|
|
|
|
var obj = {} |
|
|
|
obj.token = this.token |
|
|
|
obj.instance = data.swarmlabname |
|
|
|
var res1 = await store.dispatch('pipelineLLO/getservicesstatus', obj) |
|
|
|
//console.log('res8 all '+JSON.stringify(res1)) |
|
|
|
//console.log('res8--- all '+JSON.stringify(data)) |
|
|
|
if(res1.data.data == 'yes'){ |
|
|
|
//EDO |
|
|
|
Vue.set(this.testactionrowindex, data.swarmlabname, index) |
|
|
|
//console.log('res8 YES '+JSON.stringify(res1.data)) |
|
|
|
//Vue.set(this.testactionrowindex, data.swarmlabname, data.swarmlabname) |
|
|
|
}else{ |
|
|
|
//console.log('res8 NO '+JSON.stringify(res1.data)) |
|
|
|
Vue.delete(this.testactionrowindex, data.swarmlabname) |
|
|
|
} |
|
|
|
|
|
|
|
//console.log('is set '+index) |
|
|
|
}else{ |
|
|
|
//console.log('not set '+index) |
|
|
|
|
|
|
|
var obj = {} |
|
|
|
obj.token = this.token |
|
|
|
obj.instance = data.swarmlabname |
|
|
|
var res = await store.dispatch('pipelineLLO/getservicesinfo', obj) |
|
|
|
if(res.data.data == 'yes'){ |
|
|
|
//console.log('resi YES '+JSON.stringify(res)) |
|
|
|
if(res.data.data == 'yes'){ |
|
|
|
//EDO |
|
|
|
Vue.set(this.testactionrowindex, index, index) |
|
|
|
var res1 = await store.dispatch('pipelineLLO/getservicesstatus', obj) |
|
|
|
//console.log('res8 all '+JSON.stringify(res1)) |
|
|
|
if(res1.data.data == 'yes'){ |
|
|
|
//EDO |
|
|
|
Vue.set(this.testactionrowindex, data.swarmlabname, index) |
|
|
|
//Vue.set(this.testactionrowindex, data.swarmlabname, data.swarmlabname) |
|
|
|
//console.log('res8 YES '+JSON.stringify(res1.data)) |
|
|
|
}else{ |
|
|
|
//console.log('res8 NO '+JSON.stringify(res1.data)) |
|
|
@ -409,24 +423,31 @@ export default { |
|
|
|
console.log('resi NO2 '+JSON.stringify(res)) |
|
|
|
} |
|
|
|
} |
|
|
|
//console.log('string YES '+JSON.stringify(this.testactionrowindex)) |
|
|
|
}, |
|
|
|
setFilter () { |
|
|
|
this.moreParams = { |
|
|
|
'filter': this.searchFor, |
|
|
|
'type': this.selected |
|
|
|
} |
|
|
|
Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
//Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
Vue.nextTick( () => this.refreshVuetable()) |
|
|
|
//this.refreshVuetable() |
|
|
|
}, |
|
|
|
resetFilter () { |
|
|
|
this.moreParams = {} |
|
|
|
this.searchFor = '' |
|
|
|
Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
//Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
Vue.nextTick( () => this.refreshVuetable()) |
|
|
|
//this.refreshVuetable() |
|
|
|
}, |
|
|
|
onPaginationData (paginationData) { |
|
|
|
this.$refs.pagination.setPaginationData(paginationData) |
|
|
|
this.$refs.paginationInfo.setPaginationData(paginationData) |
|
|
|
this.currentpagepaginationData = paginationData |
|
|
|
}, |
|
|
|
onChangePage (page) { |
|
|
|
this.currentpage = page |
|
|
|
this.$refs.vuetable.changePage(page) |
|
|
|
}, |
|
|
|
editRow(rowData) { |
|
|
@ -473,7 +494,8 @@ export default { |
|
|
|
confirmButtonText: 'Yes, Delete it!' |
|
|
|
}) |
|
|
|
//Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
this.refreshVuetable() |
|
|
|
Vue.nextTick( () => this.refreshVuetable()) |
|
|
|
//this.refreshVuetable() |
|
|
|
}else if(action == 'rm-install' ){ |
|
|
|
this.hybridoptions.swarmlabname = data.swarmlabname |
|
|
|
this.$wait.start('myRunInstancetutor'); |
|
|
@ -507,7 +529,7 @@ export default { |
|
|
|
focusCancel: true, |
|
|
|
confirmButtonText: 'Ok!' |
|
|
|
}) |
|
|
|
console.log('inf res11111111111 '+ JSON.stringify(res.data.path)) |
|
|
|
//console.log('inf res11111111111 '+ JSON.stringify(res.data.path)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -548,7 +570,7 @@ export default { |
|
|
|
value.port = this.hybridoptions.port |
|
|
|
this.$root.$emit('hybrid_start_instance', value) |
|
|
|
Vue.set(this.testactionrowindex, value.swarmlabname, value.index) |
|
|
|
console.log('inf git 2 '+ JSON.stringify(data.swarmlabname)) |
|
|
|
//console.log('inf git 2 '+ JSON.stringify(data.swarmlabname)) |
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
|
@ -556,7 +578,7 @@ export default { |
|
|
|
this.viewhybridoptions = true |
|
|
|
this.hybridoptions.swarmlabname = data.swarmlabname |
|
|
|
this.hybridoptions.index = index |
|
|
|
console.log('inf git 1 '+ JSON.stringify(this.hybridoptions)) |
|
|
|
//console.log(this.$refs.pagination) |
|
|
|
/* |
|
|
|
console.log('RUN 1 '+ JSON.stringify(data.swarmlabname)) |
|
|
|
// run on mytable.vue |
|
|
@ -565,7 +587,9 @@ export default { |
|
|
|
Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
*/ |
|
|
|
} |
|
|
|
Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
//Vue.nextTick( () => this.$refs.vuetable.reload()) |
|
|
|
//EDO |
|
|
|
this.refreshVuetable() |
|
|
|
}else if(action == 'down-item' ){ |
|
|
|
this.hybridoptions.swarmlabname = data.swarmlabname |
|
|
|
this.hybridoptions.index = index |
|
|
@ -587,7 +611,8 @@ export default { |
|
|
|
}) |
|
|
|
|
|
|
|
//console.log('RUN 1 '+ JSON.stringify(data.swarmlabname)) |
|
|
|
Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
//Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
this.refreshVuetable() |
|
|
|
} |
|
|
|
}, |
|
|
|
async rmAndClose(result){ |
|
|
@ -599,7 +624,7 @@ export default { |
|
|
|
var value = this.hybridoptions.swarmlabname |
|
|
|
this.$root.$emit('hybrid_stop_instance', value) |
|
|
|
Vue.delete(this.testactionrowindex, this.hybridoptions.index) |
|
|
|
Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
//Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
}else { |
|
|
|
console.log('no') |
|
|
|
} |
|
|
@ -617,13 +642,30 @@ export default { |
|
|
|
value.port = this.hybridoptions.port |
|
|
|
this.$root.$emit('hybrid_start_instance', value) |
|
|
|
Vue.set(this.testactionrowindex, value.swarmlabname, value.index) |
|
|
|
Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
//Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
//Vue.nextTick( () => this.$refs.vuetable.refresh()) |
|
|
|
this.refreshVuetable() |
|
|
|
|
|
|
|
}, |
|
|
|
refreshVuetable() { |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.vuetablekeyg += 1 |
|
|
|
}) |
|
|
|
//this.vuetablekeyg += 1 |
|
|
|
// EDO |
|
|
|
// echo ta data pou exei epilexei o user |
|
|
|
// kai etsi alazo se afta tin katastassi |
|
|
|
// afero ta $nextTick |
|
|
|
// kai allazo apo refresh edo se afto to action |
|
|
|
// refresh only status |
|
|
|
//this.dataselect=data |
|
|
|
//this.indexselect=index |
|
|
|
this.checkactionrowindex(this.dataselect, this.indexselect) |
|
|
|
this.$refs.pagination.loadPage(this.currentpage) |
|
|
|
//this.$nextTick(()=>{ |
|
|
|
//this.vuetablekeyg += 1 |
|
|
|
//this.onPaginationData(this.currentpagepaginationData) |
|
|
|
//this.onChangePage(this.currentpage) |
|
|
|
//this.$refs.pagination.loadPage() |
|
|
|
// console.log("----------------------------------------------", this.currentpage) |
|
|
|
//}) |
|
|
|
}, |
|
|
|
playbookinfoShow(value) { |
|
|
|
return this.visibility[value]=true |
|
|
|