|
|
@ -92,6 +92,29 @@ |
|
|
|
> |
|
|
|
<div class="text-info">{{ up_name }}</div> |
|
|
|
--> |
|
|
|
|
|
|
|
<button class="btn btn-outline-info" |
|
|
|
v-if="viewhybridoptions && customedit " |
|
|
|
round |
|
|
|
type="button" |
|
|
|
@click="setcustom" |
|
|
|
> |
|
|
|
Custom</button> |
|
|
|
<button class="btn btn-outline-warning" |
|
|
|
v-if="viewhybridoptions && customedit && custommenouopen" |
|
|
|
round |
|
|
|
type="button" |
|
|
|
@click="setcustomcancel" |
|
|
|
> |
|
|
|
Cancel</button> |
|
|
|
<button class="btn btn-outline-primary" |
|
|
|
v-if="viewhybridoptions && customedit && custommenouopen" |
|
|
|
round |
|
|
|
type="button" |
|
|
|
@click="setcustomsave" |
|
|
|
> |
|
|
|
Save</button> |
|
|
|
|
|
|
|
<button class="btn btn-outline-success" |
|
|
|
round |
|
|
|
type="button" |
|
|
@ -100,6 +123,43 @@ |
|
|
|
Up</button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="input-group-append" |
|
|
|
v-if="viewhybridoptions && custommenou" |
|
|
|
> |
|
|
|
|
|
|
|
<div class="row" |
|
|
|
<b-col class="text-center" cols="5" sm="5" md="5"> |
|
|
|
<div class="form-group"> |
|
|
|
<label for="custompackages" class="text-dark">Add Extrapackages <br> |
|
|
|
<span class="text-success"> |
|
|
|
{{ customostext }} |
|
|
|
</span > |
|
|
|
</label> |
|
|
|
<textarea class="form-control" id="custompackages" rows="8" |
|
|
|
v-model="custom.os" |
|
|
|
> |
|
|
|
{{ custom.os }} |
|
|
|
</textarea> |
|
|
|
</div> |
|
|
|
</b-col> |
|
|
|
<b-col class="text-center" cols="7" sm="7" md="7"> |
|
|
|
<div class="form-group"> |
|
|
|
<label for="customshell" class="text-dark">Custom sh script <br> |
|
|
|
<span class="text-success"> |
|
|
|
{{ customshtext }} |
|
|
|
</span > |
|
|
|
</label> |
|
|
|
<textarea class="form-control" id="customshell" rows="8" |
|
|
|
v-model="custom.sh" |
|
|
|
> |
|
|
|
{{ custom.sh }} |
|
|
|
</textarea> |
|
|
|
</div> |
|
|
|
</b-col> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="input-group-append" |
|
|
|
v-if="viewhybridoptions && heavy" |
|
|
|
> |
|
|
@ -247,6 +307,15 @@ export default { |
|
|
|
viewhybridoptions: false, |
|
|
|
heavy: false, |
|
|
|
heavytext: '', |
|
|
|
customedit: false, |
|
|
|
custommenouopen: false, |
|
|
|
custommenou: false, |
|
|
|
custom: { |
|
|
|
'os':'', |
|
|
|
'sh':'' |
|
|
|
}, |
|
|
|
customostext: '', |
|
|
|
customshtext: '', |
|
|
|
up_name:'', |
|
|
|
swarmlab:{}, |
|
|
|
playbookInfo: {}, |
|
|
@ -440,6 +509,7 @@ export default { |
|
|
|
//console.log(this.testtestdir) |
|
|
|
}, |
|
|
|
async checkactionrowindex(data,index){ |
|
|
|
this.resetcustom() |
|
|
|
if(data._id == index) { |
|
|
|
this.dataselect=data |
|
|
|
this.indexselect=index |
|
|
@ -522,6 +592,7 @@ export default { |
|
|
|
this.currentpagepaginationData = paginationData |
|
|
|
}, |
|
|
|
onChangePage (page) { |
|
|
|
this.resetcustom() |
|
|
|
this.currentpage = page |
|
|
|
this.$refs.vuetable.changePage(page) |
|
|
|
}, |
|
|
@ -572,6 +643,7 @@ export default { |
|
|
|
Vue.nextTick( () => this.refreshVuetable()) |
|
|
|
//this.refreshVuetable() |
|
|
|
}else if(action == 'rm-install' ){ |
|
|
|
this.resetcustom() |
|
|
|
this.hybridoptions.swarmlabname = data.swarmlabname |
|
|
|
this.$wait.start('myRunInstancetutor'); |
|
|
|
//console.log(this.hybridoptions.swarmlabname) |
|
|
@ -632,6 +704,13 @@ export default { |
|
|
|
this.refreshVuetable() |
|
|
|
|
|
|
|
}else if(action == 'run-item' ){ |
|
|
|
this.resetcustom() |
|
|
|
//this.customedit = false |
|
|
|
//this.custommenouopen = false |
|
|
|
//this.custommenou = false |
|
|
|
//this.custom.os = '' |
|
|
|
//this.custom.sh = '' |
|
|
|
|
|
|
|
this.heavy = false |
|
|
|
this.heavytext = '' |
|
|
|
|
|
|
@ -666,15 +745,32 @@ export default { |
|
|
|
this.hybridoptions.index = index |
|
|
|
for(var i = 0; i < ApiConfigWEB.length; i++) { |
|
|
|
var obWEB = ApiConfigWEB[i]; |
|
|
|
|
|
|
|
//-------------- |
|
|
|
if(obWEB.name == this.hybridoptions.swarmlabname){ |
|
|
|
if(obWEB.hasOwnProperty('large')){ |
|
|
|
if(obWEB.large != 'no'){ |
|
|
|
console.log(obWEB.large) |
|
|
|
// console.log(obWEB.large) |
|
|
|
this.heavy = true |
|
|
|
this.heavytext = obWEB.large |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// ------------------------- |
|
|
|
if(obWEB.name == this.hybridoptions.swarmlabname){ |
|
|
|
if(obWEB.hasOwnProperty('custom')){ |
|
|
|
if(obWEB.custom != 'no'){ |
|
|
|
console.log(obWEB.custom) |
|
|
|
this.customedit = true |
|
|
|
this.custom.os = obWEB.customos |
|
|
|
this.custom.sh = obWEB.customsh |
|
|
|
this.customostext = obWEB.customostext |
|
|
|
this.customshtext = obWEB.customshtext |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// ------------------------- |
|
|
|
|
|
|
|
} |
|
|
|
/* |
|
|
|
console.log('RUN 1 '+ JSON.stringify(data.swarmlabname)) |
|
|
@ -732,8 +828,93 @@ export default { |
|
|
|
}else { |
|
|
|
console.log('no') |
|
|
|
} |
|
|
|
}, |
|
|
|
async setcustomcancel(){ |
|
|
|
this.custommenouopen = false |
|
|
|
this.custommenou = false |
|
|
|
}, |
|
|
|
async setcustomsave(){ |
|
|
|
let value = {} |
|
|
|
value.swarmlabname = this.hybridoptions.swarmlabname |
|
|
|
var log = await store.dispatch("pipelineLLO/savecustom",{ |
|
|
|
token:this.token, |
|
|
|
instance:this.hybridoptions.swarmlabname, |
|
|
|
package:this.custom.os, |
|
|
|
sh:this.custom.sh |
|
|
|
}) |
|
|
|
this.custommenouopen = false |
|
|
|
this.custommenou = false |
|
|
|
console.log('chown ok '+ JSON.stringify(log.data)) |
|
|
|
}, |
|
|
|
async setcustom(){ |
|
|
|
let value = {} |
|
|
|
value.swarmlabname = this.hybridoptions.swarmlabname |
|
|
|
this.custommenouopen = true |
|
|
|
this.custommenou = true |
|
|
|
var log = await store.dispatch("pipelineLLO/getcustom",{ |
|
|
|
token:this.token, |
|
|
|
instance:this.hybridoptions.swarmlabname |
|
|
|
}) |
|
|
|
if(log.data.error === false){ |
|
|
|
if(log.data.error_msg == 'nodir'){ |
|
|
|
//console.log('chown reload') |
|
|
|
var info=`<h5><b> Please redownload Microservice and try launching the module again </b><br> |
|
|
|
</h5> |
|
|
|
` |
|
|
|
this.$swal({ |
|
|
|
type: 'Info', |
|
|
|
icon:'info', |
|
|
|
html: info, |
|
|
|
showCloseButton: true, |
|
|
|
showLoaderOnConfirm: false, |
|
|
|
allowOutsideClick: false, |
|
|
|
cancelButtonText: 'No, cancel!', |
|
|
|
showCancelButton: false, |
|
|
|
showLoaderOnConfirm: false, |
|
|
|
reverseButtons: true, |
|
|
|
focusCancel: true, |
|
|
|
confirmButtonText: 'Ok!' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
if(log.data.error_msg == 'ok'){ |
|
|
|
if(log.data.extrapackagestext != ''){ |
|
|
|
//this.custom.os = log.data.extrapackagestext |
|
|
|
Vue.set(this.custom, 'os', log.data.extrapackagestext) |
|
|
|
} |
|
|
|
if(log.data.extrashtext != ''){ |
|
|
|
//this.custom.sh = log.data.extrashtext |
|
|
|
Vue.set(this.custom, 'sh', log.data.extrashtext) |
|
|
|
} |
|
|
|
console.log('chown extrapackages1 '+ JSON.stringify(this.custom.os)) |
|
|
|
console.log('chown sh1 '+ JSON.stringify(this.custom.sh)) |
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
var info=`<h5><b> Please remove and download Microservice and try launching the module again </b><br> |
|
|
|
</h5> |
|
|
|
` |
|
|
|
this.$swal({ |
|
|
|
type: 'Info', |
|
|
|
icon:'info', |
|
|
|
html: info, |
|
|
|
showCloseButton: true, |
|
|
|
showLoaderOnConfirm: false, |
|
|
|
allowOutsideClick: false, |
|
|
|
cancelButtonText: 'No, cancel!', |
|
|
|
showCancelButton: false, |
|
|
|
showLoaderOnConfirm: false, |
|
|
|
reverseButtons: true, |
|
|
|
focusCancel: true, |
|
|
|
confirmButtonText: 'Ok!' |
|
|
|
}) |
|
|
|
} |
|
|
|
//console.log('chownlog '+ JSON.stringify(log)) |
|
|
|
//console.log('chown extrapackages '+ JSON.stringify(this.custom.os)) |
|
|
|
//console.log('chown sh '+ JSON.stringify(this.custom.sh)) |
|
|
|
}, |
|
|
|
async setHybridoptions(){ |
|
|
|
this.resetcustom() |
|
|
|
//console.log(JSON.stringify(this.hybridoptions)) |
|
|
|
|
|
|
|
// run on mytable.vue |
|
|
@ -763,6 +944,13 @@ export default { |
|
|
|
this.vuetablekeyg += 1 |
|
|
|
}) |
|
|
|
}, |
|
|
|
async resetcustom() { |
|
|
|
this.customedit = false |
|
|
|
this.custommenouopen = false |
|
|
|
this.custommenou = false |
|
|
|
this.custom.os = '' |
|
|
|
this.custom.sh = '' |
|
|
|
}, |
|
|
|
async refreshVuetable() { |
|
|
|
//this.vuetablekeyg += 1 |
|
|
|
// EDO |
|
|
|