@ -14,10 +14,18 @@
Enter Lab_room ...
Enter Lab_room ...
< / div >
< / div >
< / template >
< / template >
< / v - w a i t >
< v -wait for = "myRunInstancetutorremove" >
< template slot = "waiting" >
< div >
< img src = "@/assets/loading.gif" / >
Remove ...
< / div >
< / template >
< / v - w a i t >
< / v - w a i t >
< div class = "row text-center" >
< div class = "row text-center" >
< div class = "col-12" >
< div class = "col-12" >
< b > Swarmlab < span class = "text-info" > MicroServices < / span > Deploy - Local < / b >
< b > < span class = "text-muted" > Swarmlab < / span > < span class = "text-info" > MicroServices < / span > - < span class = "text-muted" > Deploy @ Home < / span > < / b >
< / div >
< / div >
< / div >
< / div >
@ -55,21 +63,34 @@
< div class = "row"
< div class = "row"
v - if = "viewhybridoptions"
v - if = "viewhybridoptions"
>
>
< b -col class = "text-center" cols = "12" sm = "12" md = "12" >
< b -col class = "text-center" cols = "12" sm = "12" >
< span >
< span class = "text-muted" >
< b > Lab Service Options < / b >
< b > Lab Service Options < / b >
< / span >
< / span >
< / b - c o l >
< / b - c o l >
< / div >
< / div >
< div class = "input-group-append"
< div class = "input-group-append input-group input-group-sm sm-3 "
v - if = "viewhybridoptions"
v - if = "viewhybridoptions && up_name "
>
>
< button class = "btn btn-outline-secondary"
< button class = "btn btn-success btn-sm"
v - if = "startservice"
round
round
type = "button"
type = "button"
@ click = "setHybridoptions"
>
>
Instances < / button >
Start < / button >
< button class = "btn btn-warning btn-sm"
v - else
round
type = "button"
@ click = "stopservice"
>
Stop < / button >
< input type = "text"
< input type = "text"
class = "form-control text-info"
class = "form-control text-info"
aria - label = "Small" aria - describedby = "inputGroup-sizing-sm"
aria - label = "Small" aria - describedby = "inputGroup-sizing-sm"
@ -78,7 +99,7 @@
v - model = "up_name"
v - model = "up_name"
>
>
<!--
<!--
< button class = "btn btn-outline-secondary"
< button class = "btn btn-outline-secondary btn-sm "
round
round
type = "button"
type = "button"
>
>
@ -93,30 +114,30 @@
< div class = "text-info" > { { up_name } } < / div >
< div class = "text-info" > { { up_name } } < / div >
-- >
-- >
< button class = "btn btn-outline-info"
< button class = "btn btn-outline-info btn-sm "
v - if = "viewhybridoptions"
v - if = "viewhybridoptions && up_name && actionrowindex "
round
round
type = "button"
type = "button"
@ click = "backup"
@ click = "backup"
>
>
Backup < / button >
Backup < / button >
< button class = "btn btn-outline-dark"
< button class = "btn btn-outline-dark btn-sm "
v - if = "viewhybridoptions"
v - if = "viewhybridoptions && up_name && actionrowindex "
round
round
type = "button"
type = "button"
@ click = "backupview"
@ click = "backupview"
>
>
BackupView < / button >
BackupView < / button >
< button class = "btn btn-outline-primary"
< button class = "btn btn-outline-primary btn-sm "
v - if = "viewhybridoptions && customedit && custommenouopen != true"
v - if = "viewhybridoptions && customedit && custommenouopen != true && up_name && actionrowindex "
round
round
type = "button"
type = "button"
@ click = "setcustom"
@ click = "setcustom"
>
>
Custom < / button >
Custom < / button >
< button class = "btn btn-outline-secondary"
< button class = "btn btn-outline-secondary btn-sm "
v - if = "viewhybridoptions && customedit && custommenouopen === true"
v - if = "viewhybridoptions && customedit && custommenouopen === true && up_name && actionrowindex "
round
round
disabled
disabled
type = "button"
type = "button"
@ -124,27 +145,46 @@
>
>
Custom : < / button >
Custom : < / button >
< button class = "btn btn-outline-warning"
< button class = "btn btn-outline-warning btn-sm "
v - if = "viewhybridoptions && customedit && custommenouopen"
v - if = "viewhybridoptions && customedit && custommenouopen && up_name && actionrowindex "
round
round
type = "button"
type = "button"
@ click = "setcustomcancel"
@ click = "setcustomcancel"
>
>
Cancel < / button >
Cancel < / button >
< button class = "btn btn-outline-info"
< button class = "btn btn-outline-info btn-sm "
v - if = "viewhybridoptions && customedit && custommenouopen"
v - if = "viewhybridoptions && customedit && custommenouopen && up_name && actionrowindex "
round
round
type = "button"
type = "button"
@ click = "setcustomsave"
@ click = "setcustomsave"
>
>
Save < / button >
Save < / button >
< button
< button class = "btn btn-outline-success"
class = " btn btn-outline-danger btn-sm"
round
title = "Remove Lab_Instance"
type = "button"
@ click = "onActionstopcheck()"
@ click = "setHybridoptions"
round
>
>
Up < / button >
Remove
< / button >
< button
v - if = "actionrowindexmore"
class = "ti-more btn btn-info btn-sm"
title = "More Actions..."
@ click = "onActionmore()"
round
>
< / button >
< button
v - else
class = "ti-more btn btn-secondary btn-sm"
title = "More Actions..."
@ click = "onActionmoreclose()"
round
>
< / button >
< / div >
< / div >
< div class = "input-group-append"
< div class = "input-group-append"
@ -152,7 +192,7 @@
>
>
< div class = "row"
< div class = "row"
< b -col class = "text-center" cols = "5" sm = "5" md = "5" >
< b -col class = "text-center" cols = "5" sm = "5" >
< div class = "form-group" >
< div class = "form-group" >
< label for = "custompackages" class = "text-dark" > Add Extrapackages < br >
< label for = "custompackages" class = "text-dark" > Add Extrapackages < br >
< span class = "text-success" >
< span class = "text-success" >
@ -191,7 +231,7 @@
< / div >
< / div >
< div class = "white h-100 flex-fixed-width-item"
< div class = "white h-100 flex-fixed-width-item"
< vuetable
< vuetable id = "idvuetablekeyg"
ref = "vuetable"
ref = "vuetable"
: key = "vuetablekeyg"
: key = "vuetablekeyg"
: api - url = 'apiurl'
: api - url = 'apiurl'
@ -209,52 +249,36 @@
wrapper - class = "vuetable-wrapper"
wrapper - class = "vuetable-wrapper"
loading - class = "loading"
loading - class = "loading"
detail - row - id = "id"
detail - row - id = "id"
@ vuetable : row - clicked = "rowClicked"
@ vuetable : pagination - data = "onPaginationData"
@ vuetable : pagination - data = "onPaginationData"
@ vuetable : load - success = "loadsuccess"
@ vuetable : load - success = "loadsuccess"
@ vuetable : load - error = "onLoadError"
@ vuetable : load - error = "onLoadError"
: css = "css.table"
: css = "css.table"
>
>
<!--
< div slot = "actionsenabled" slot -scope = " props "
EDO
: key = "vuetablekeygslotnew"
props . rowData . _id gia to pagination problem
>
pass props . rowData . _id as index
allagi tou vuetablerefresh
< button
class = "ti-cloud-down btn btn-outline-secondary btn-sm"
title = "Download Lab_Instance"
round
@ click = "checkactionrowindex(props.rowData,props.rowData._id)" >
update < / button >
-- >
< div slot = "actionsenabled" slot -scope = " props " >
< div class = "d-flex justify-content-center" >
< div class = "d-flex justify-content-center" >
< button
< button
v - if = "testtest[props.rowData.swarmlabname] != props.rowData.swarmlabname && testtestdir[props.rowData.swarmlabname] == props.rowData.swarmlabname"
class = " btn btn-sm text-muted"
class = "ti-thumb-down btn btn-secondary btn-sm"
title = "Start Lab_Instance"
round
round
@ click = "onAction('run-item', props.rowData, props.rowData._id)"
>
< / button >
< button
v - if = "testtest[props.rowData.swarmlabname] == props.rowData.swarmlabname && testtestdir[props.rowData.swarmlabname] == props.rowData.swarmlabname"
v - if = "testtest[props.rowData.swarmlabname] == props.rowData.swarmlabname && testtestdir[props.rowData.swarmlabname] == props.rowData.swarmlabname"
class = "ti-thumb-up btn btn-info btn-sm"
> < span class = "text-success" > Running ... < / span > < / button >
title = "Stop Lab_Instance"
< button
v - else
class = " btn btn-sm text-muted"
round
round
@ click = "onAction('down-item', props.rowData, props.rowData._id)"
> < span class = "text-success" > & nbsp ; < / span > < / button >
>
< / button >
< / div >
< / div >
< / div >
< / div >
< div slot = "actionslocal" slot -scope = " props " actionslocal
< div slot = "actionslocal" slot -scope = " props " actionslocal
: key = "vuetablekeygslot" >
: key = "vuetablekeygslot" >
< div class = "d-flex justify-content-center" >
< div class = "d-flex justify-content-center" >
< button
< button
v - if = "testtest[props.rowData.swarmlabname] != props.rowData.swarmlabname && testtestdir[props.rowData.swarmlabname] == props.rowData.swarmlabname"
v - if = "testtestdir[props.rowData.swarmlabname] == props.rowData.swarmlabname"
class = "ti-trash btn btn-info btn-sm"
class = "ti-check btn btn-sm text-success"
title = "Remove Lab_Instance"
@ click = "onAction('rm-install', props.rowData, props.rowData._id)"
round
round
>
>
< / button >
< / button >
@ -263,14 +287,15 @@ allagi tou vuetablerefresh
< div slot = "actions" slot -scope = " props " >
< div slot = "actions" slot -scope = " props " >
< div class = "d-flex justify-content-center" >
< div class = "d-flex justify-content-center" >
< button
< button
class = "ti-cloud-down btn btn-outline-secondary btn-sm"
class = "ti-cloud-down btn btn-sm"
title = "Download Lab_Instance"
title = "Download Lab_Instance"
round
round
@ click = "onAction('run-install', props.rowData, props.rowData._id)" >
@ click = "onAction('run-install', props.rowData, props.rowData._id)" >
< / button >
< / button >
< button
< button
class = "ti-info btn btn-outline-secondary btn-sm"
class = "ti-info btn btn-sm"
title = "Lab_Instance Info"
title = "Lab_Instance Info"
name = "Lab_Instance_microservice_Info"
round
round
@ click = "onAction('view-item', props.rowData, props.rowData._id)" >
@ click = "onAction('view-item', props.rowData, props.rowData._id)" >
< / button >
< / button >
@ -318,6 +343,10 @@ export default {
} ,
} ,
data ( ) {
data ( ) {
return {
return {
startservice : true ,
actionrowindex : false ,
actionrowindexmore : true ,
swarmlabinfonow : false ,
testactionrowindex : [ ] , / / d o w n l o a d e d u s e d i n i n s t a l l e d
testactionrowindex : [ ] , / / d o w n l o a d e d u s e d i n i n s t a l l e d
teststatusindex : [ ] , / / s t a t u s s t o p r u n u s e d i n s t a t u s
teststatusindex : [ ] , / / s t a t u s s t o p r u n u s e d i n s t a t u s
testtest : [ ] , / / u p o r d o w n s e r v i c e s
testtest : [ ] , / / u p o r d o w n s e r v i c e s
@ -365,15 +394,34 @@ export default {
active : false ,
active : false ,
vuetablekeyg : 0 ,
vuetablekeyg : 0 ,
vuetablekeygslot : 0 ,
vuetablekeygslot : 0 ,
vuetablekeygslotnew : 0 ,
fielddata : { } ,
fielddata : { } ,
fields : [
fields : [
{
name : '__slot:actionslocal' , / / < - - - -
title : '' ,
titleClass : 'center' ,
dataClass : 'center aligned' ,
width : '3%'
} ,
{
{
name : 'swarmlabname' ,
name : 'swarmlabname' ,
title : '<span class="orange"></span>Name' ,
title : '<span class="orange"></span>Microservic e' ,
sortField : 'swarmlabname' ,
sortField : 'swarmlabname' ,
visible : true ,
visible : true ,
dataClass : 'left aligned col-3' ,
dataClass : 'left aligned col-3' ,
width : '68%'
width : '68%' ,
callback : function ( value ) {
console . log ( '---- ' + value )
if ( value ) {
var tmp = value . split ( '-' )
var v = ` <span class="text-muted"> ${ tmp [ 1 ] } </span> <span class="text-muted"></span> `
return v
} else {
var v = '<span> </span>'
return v
}
}
} ,
} ,
{
{
name : '_id' ,
name : '_id' ,
@ -403,13 +451,6 @@ export default {
dataClass : 'center aligned' ,
dataClass : 'center aligned' ,
width : '5%'
width : '5%'
} ,
} ,
{
name : '__slot:actionslocal' , / / < - - - -
title : 'Installed' ,
titleClass : 'center' ,
dataClass : 'center aligned' ,
width : '5%'
} ,
{
{
name : '__slot:actions' , / / < - - - -
name : '__slot:actions' , / / < - - - -
title : 'Download' ,
title : 'Download' ,
@ -479,12 +520,21 @@ export default {
} ,
} ,
methods : {
methods : {
onActionmore ( ) {
this . actionrowindex = true
this . actionrowindexmore = false
} ,
onActionmoreclose ( ) {
this . actionrowindex = false
this . actionrowindexmore = true
} ,
onError ( type , description ) {
onError ( type , description ) {
var winfo = description
var winfo = description
var info = '<h5>Bootstrap ' + type + '</h5>'
var info = '<h5>Bootstrap ' + type + '</h5>'
this . $swal ( {
this . $swal ( {
type : type ,
type : type ,
html : info + winfo ,
html : info + winfo ,
icon : 'info' ,
showCloseButton : true ,
showCloseButton : true ,
showLoaderOnConfirm : false ,
showLoaderOnConfirm : false ,
allowOutsideClick : false ,
allowOutsideClick : false ,
@ -625,20 +675,23 @@ export default {
} ,
} ,
async onAction ( action , data , index ) {
async onAction ( action , data , index ) {
if ( action == 'view-item' ) {
if ( action == 'view-item' ) {
this . swarmlabinfonow = true
this . swarmlab = data
this . swarmlab = data
var container = this . swarmlab
var container = this . swarmlab
var res = await store . dispatch ( 'pipelineLLO/getswarmlabmicroserviceinfo' , container . swarmlabname )
/ / v a r r e s = a w a i t s t o r e . d i s p a t c h ( ' p i p e l i n e L L O / g e t s w a r m l a b m i c r o s e r v i c e i n f o ' , c o n t a i n e r . s w a r m l a b n a m e )
var swarmlab1 = JSON . stringify ( res . data . swarmlab , null , 2 )
/ / v a r s w a r m l a b 1 = J S O N . s t r i n g i f y ( r e s . d a t a . s w a r m l a b , n u l l , 2 )
var swarmlab1info = JSON . stringify ( res . data . swarmlabinfo , null , 2 )
/ / v a r s w a r m l a b 1 i n f o = J S O N . s t r i n g i f y ( r e s . d a t a . s w a r m l a b i n f o , n u l l , 2 )
var swarmlab1info = res . data . swarmlabinfo
/ / v a r s w a r m l a b 1 i n f o = r e s . d a t a . s w a r m l a b i n f o
var description = '<div style="height: 250px; overflow-y: scroll;"><p><pre><code class="codeblock">' + swarmlab1 + '</code></pre></p></div>'
/ / v a r d e s c r i p t i o n = ' < d i v s t y l e = " h e i g h t : 2 5 0 p x ; o v e r f l o w - y : s c r o l l ; " > < p > < p r e > < c o d e c l a s s = " c o d e b l o c k " > ' + s w a r m l a b 1 + ' < / c o d e > < / p r e > < / p > < / d i v > '
if ( res . data . error25 == "ok" ) {
/ / i f ( r e s . d a t a . e r r o r 2 5 = = " o k " ) {
var winfo = ''
/ / v a r w i n f o = ' '
var swarmlab1info = ` https://git.swarmlab.io:3000/swarmlab/ ${ container . swarmlabname } `
var info = '<h5>Swarmlab Service <a href="' + swarmlab1info + '" target="_blank" >Info</a></h5>(Open page in new window)'
var info = '<h5>Swarmlab Service <a href="' + swarmlab1info + '" target="_blank" >Info</a></h5>(Open page in new window)'
this . $swal ( {
this . $swal ( {
type : 'info' ,
type : 'info' ,
html : info + winfo ,
html : info ,
icon : 'info' ,
showCloseButton : true ,
showCloseButton : true ,
showLoaderOnConfirm : false ,
showLoaderOnConfirm : false ,
allowOutsideClick : false ,
allowOutsideClick : false ,
@ -646,7 +699,7 @@ export default {
reverseButtons : true ,
reverseButtons : true ,
focusCancel : true
focusCancel : true
} )
} )
}
/ / }
} else if ( action == 'delete-item' ) {
} else if ( action == 'delete-item' ) {
@ -704,6 +757,7 @@ export default {
this . refreshVuetable ( )
this . refreshVuetable ( )
this . $root . $emit ( 'hybrid_refresh_info_deploy_local' )
this . $root . $emit ( 'hybrid_refresh_info_deploy_local' )
} else if ( action == 'run-install' ) {
} else if ( action == 'run-install' ) {
this . swarmlabinfonow = true
this . $wait . start ( 'myRunInstancetutor' ) ;
this . $wait . start ( 'myRunInstancetutor' ) ;
this . hybridoptions . swarmlabname = data . swarmlabname
this . hybridoptions . swarmlabname = data . swarmlabname
this . hybridoptions . index = index
this . hybridoptions . index = index
@ -737,8 +791,10 @@ export default {
this . heavy = false
this . heavy = false
this . heavytext = ''
this . heavytext = ''
this . up_name = data . swarmlabname
/ / n e w V E R S I O N
/ / t h i s . u p _ n a m e = d a t a . s w a r m l a b n a m e
this . up_name = this . hybridoptions . swarmlabname
/ / c o n s o l e . l o g ( ' R U N - - - - - - - - - - - - ' + J S O N . s t r i n g i f y ( d a t a ) )
/ / c o n s o l e . l o g ( ' R U N - - - - - - - - - - - - ' + J S O N . s t r i n g i f y ( d a t a ) )
@ -747,25 +803,35 @@ export default {
var filterju = ` microservice-jupyter `
var filterju = ` microservice-jupyter `
var grepju = new RegExp ( filterju ) ;
var grepju = new RegExp ( filterju ) ;
if ( grepju . test ( data . swarmlabname ) ) {
/ / n e w V E R S I O N
/ / i f ( g r e p j u . t e s t ( d a t a . s w a r m l a b n a m e ) ) {
if ( grepju . test ( this . hybridoptions . swarmlabname ) ) {
this . viewhybridoptions = false
this . viewhybridoptions = false
let value = { }
let value = { }
value . swarmlabname = data . swarmlabname
/ / n e w V E R S I O N
/ / v a l u e . s w a r m l a b n a m e = d a t a . s w a r m l a b n a m e
value . swarmlabname = this . hybridoptions . swarmlabname
value . index = index
value . index = index
value . size = this . hybridoptions . size
value . size = this . hybridoptions . size
value . port = this . hybridoptions . port
value . port = this . hybridoptions . port
this . $root . $emit ( 'hybrid_start_instance' , value )
this . $root . $emit ( 'hybrid_start_instance' , value )
/ / V u e . s e t ( t h i s . t e s t a c t i o n r o w i n d e x , v a l u e . s w a r m l a b n a m e , v a l u e . i n d e x )
/ / V u e . s e t ( t h i s . t e s t a c t i o n r o w i n d e x , v a l u e . s w a r m l a b n a m e , v a l u e . i n d e x )
/ / V u e . s e t ( t h i s . t e s t a c t i o n r o w i n d e x , v a l u e . i n d e x , v a l u e . s w a r m l a b n a m e )
/ / V u e . s e t ( t h i s . t e s t a c t i o n r o w i n d e x , v a l u e . i n d e x , v a l u e . s w a r m l a b n a m e )
} else if ( grepmicrosoft . test ( data . swarmlabname ) ) {
/ / n e w V E R S I O N
/ / } e l s e i f ( g r e p m i c r o s o f t . t e s t ( d a t a . s w a r m l a b n a m e ) ) {
} else if ( grepmicrosoft . test ( this . hybridoptions . swarmlabname ) ) {
this . viewhybridoptions = true
this . viewhybridoptions = true
this . heavy = true
this . heavy = true
this . heavytext = 'Note that this image is somewhat heavy (~2GB) since they embed some of the kernel debug symbols for Microsoft Windows. It can take some time to build the Instance'
this . heavytext = 'Note that this image is somewhat heavy (~2GB) since they embed some of the kernel debug symbols for Microsoft Windows. It can take some time to build the Instance'
this . hybridoptions . swarmlabname = data . swarmlabname
/ / n e w V E R S I O N
/ / t h i s . h y b r i d o p t i o n s . s w a r m l a b n a m e = d a t a . s w a r m l a b n a m e
this . hybridoptions . swarmlabname = this . hybridoptions . swarmlabname
this . hybridoptions . index = index
this . hybridoptions . index = index
} else {
} else {
this . viewhybridoptions = true
this . viewhybridoptions = true
this . hybridoptions . swarmlabname = data . swarmlabname
/ / n e w V E R S I O N
/ / t h i s . h y b r i d o p t i o n s . s w a r m l a b n a m e = d a t a . s w a r m l a b n a m e
this . hybridoptions . swarmlabname = this . hybridoptions . swarmlabname
this . hybridoptions . index = index
this . hybridoptions . index = index
for ( var i = 0 ; i < ApiConfigWEB . length ; i ++ ) {
for ( var i = 0 ; i < ApiConfigWEB . length ; i ++ ) {
var obWEB = ApiConfigWEB [ i ] ;
var obWEB = ApiConfigWEB [ i ] ;
@ -808,12 +874,14 @@ export default {
this . refreshVuetable ( )
this . refreshVuetable ( )
} else if ( action == 'down-item' ) {
} else if ( action == 'down-item' ) {
this . up_name = ''
this . up_name = ''
this . hybridoptions . swarmlabname = data . swarmlabnam e
/ / t h i s . h y b r i d o p t i o n s . s w a r m l a b n a m e = d a t a . s w a r m l a b n a m e
this . hybridoptions . index = index
this . hybridoptions . index = index
var info = "Stop and remove containers, networks, images, and volumes"
var info = ` <h5> Microservice: <b> ${ this . hybridoptions . swarmlabname } </b> </h5> `
info += "<br>Stop and remove containers, networks, images, and volumes"
this . $swal ( {
this . $swal ( {
type : 'info' ,
type : 'info' ,
html : info ,
html : info ,
icon : 'info' ,
showCloseButton : true ,
showCloseButton : true ,
showLoaderOnConfirm : false ,
showLoaderOnConfirm : false ,
allowOutsideClick : false ,
allowOutsideClick : false ,
@ -984,11 +1052,13 @@ info +=' <b>Click on hyperlink opens Directory in new tab</b></p>'
/ / c o n s o l e . l o g ( ' c h o w n ' + J S O N . s t r i n g i f y ( t h i s . h y b r i d o p t i o n s . s w a r m l a b n a m e ) )
/ / c o n s o l e . l o g ( ' c h o w n ' + J S O N . s t r i n g i f y ( t h i s . h y b r i d o p t i o n s . s w a r m l a b n a m e ) )
/ / c o n s o l e . l o g ( ' c h o w n l o g ' + J S O N . s t r i n g i f y ( l o g ) )
/ / c o n s o l e . l o g ( ' c h o w n l o g ' + J S O N . s t r i n g i f y ( l o g ) )
this . $root . $emit ( 'hybrid_start_instance' , value )
this . $root . $emit ( 'hybrid_start_instance' , value )
/ / p r o b l e m r e l o a d a s t o e t s i m e c h r i n a v r e i s g i a t i
/ / t h i s . $ r o o t . $ e m i t ( ' h y b r i d _ s t a r t _ i n s t a n c e _ s h o w _ c o n s o l e ' , ' o p e n ' )
/ / V u e . s e t ( t h i s . t e s t a c t i o n r o w i n d e x , v a l u e . s w a r m l a b n a m e , v a l u e . i n d e x )
/ / V u e . s e t ( t h i s . t e s t a c t i o n r o w i n d e x , v a l u e . s w a r m l a b n a m e , v a l u e . i n d e x )
/ / V u e . s e t ( t h i s . t e s t a c t i o n r o w i n d e x , v a l u e . i n d e x , v a l u e . s w a r m l a b n a m e )
/ / V u e . s e t ( t h i s . t e s t a c t i o n r o w i n d e x , v a l u e . i n d e x , v a l u e . s w a r m l a b n a m e )
/ / V u e . n e x t T i c k ( ( ) = > t h i s . $ r e f s . v u e t a b l e . r e f r e s h ( ) )
/ / V u e . n e x t T i c k ( ( ) = > t h i s . $ r e f s . v u e t a b l e . r e f r e s h ( ) )
/ / V u e . n e x t T i c k ( ( ) = > t h i s . $ r e f s . v u e t a b l e . r e f r e s h ( ) )
/ / V u e . n e x t T i c k ( ( ) = > t h i s . $ r e f s . v u e t a b l e . r e f r e s h ( ) )
this . refreshVuetable ( )
await this . refreshVuetable ( )
/ / c o n s o l e . l o g ( ' R U N 1 ' + J S O N . s t r i n g i f y ( t h i s . h y b r i d o p t i o n s ) )
/ / c o n s o l e . l o g ( ' R U N 1 ' + J S O N . s t r i n g i f y ( t h i s . h y b r i d o p t i o n s ) )
@ -1006,24 +1076,11 @@ info +=' <b>Click on hyperlink opens Directory in new tab</b></p>'
this . custom . sh = ''
this . custom . sh = ''
} ,
} ,
async refreshVuetable ( ) {
async refreshVuetable ( ) {
/ / t h i s . v u e t a b l e k e y g + = 1
/ / E D O
/ / e c h o t a d a t a p o u e x e i e p i l e x e i o u s e r
/ / k a i e t s i a l a z o s e a f t a t i n k a t a s t a s s i
/ / a f e r o t a $ n e x t T i c k
/ / k a i a l l a z o a p o r e f r e s h e d o s e a f t o t o a c t i o n
/ / r e f r e s h o n l y s t a t u s
/ / * * * * * * * * * r e f r e s h s l o t e i n a i i l i s s i * * *
/ / t h i s . d a t a s e l e c t = d a t a
/ / t h i s . i n d e x s e l e c t = i n d e x
/ / c o n s o l e . l o g ( ' e r r o r 2 a ' + J S O N . s t r i n g i f y ( t h i s . d a t a s e l e c t ) )
/ / c o n s o l e . l o g ( ' e r r o r 2 b ' + J S O N . s t r i n g i f y ( t h i s . i n d e x s e l e c t ) )
/ / t h i s v e r s i o n w i t h t h i s . c h e c k a c t i o n r o w i n d e x d o n t w o r k
/ / r e n d e r h a n g s
/ / a w a i t t h i s . c h e c k a c t i o n r o w i n d e x ( t h i s . d a t a s e l e c t , t h i s . i n d e x s e l e c t )
await this . checkactionrowindexall ( )
await this . checkactionrowindexall ( )
this . $nextTick ( ( ) => {
this . vuetablekeygslot += 1
this . vuetablekeygslot += 1
/ / } )
this . vuetablekeygslotnew += 1
} )
} ,
} ,
playbookinfoShow ( value ) {
playbookinfoShow ( value ) {
return this . visibility [ value ] = true
return this . visibility [ value ] = true
@ -1031,12 +1088,184 @@ info +=' <b>Click on hyperlink opens Directory in new tab</b></p>'
playbookinfo ( value ) {
playbookinfo ( value ) {
return this . playbookInfo = value
return this . playbookInfo = value
} ,
} ,
rowClicked ( row , event ) {
async onActionstopcheck ( ) {
var info = ` <h5> Microservice: <b> ${ this . hybridoptions . swarmlabname } </b> </h5> `
info += "<br>Remove containers, networks, images, and volumes"
this . $swal ( {
type : 'info' ,
html : info ,
icon : 'info' ,
showCloseButton : true ,
showLoaderOnConfirm : false ,
allowOutsideClick : false ,
cancelButtonText : 'No, cancel!' ,
showCancelButton : true ,
showLoaderOnConfirm : false ,
reverseButtons : true ,
focusCancel : false ,
confirmButtonText : 'Yes!'
} ) . then ( ( result ) => {
this . onActionstop ( result ) ;
} )
} ,
async onActionstop ( result ) {
if ( result . isConfirmed ) {
this . $wait . start ( 'myRunInstancetutorremove' ) ;
console . log ( 'yes delete' )
/ / v - i f = " t e s t t e s t [ p r o p s . r o w D a t a . s w a r m l a b n a m e ] ! = p r o p s . r o w D a t a . s w a r m l a b n a m e & & t e s t t e s t d i r [ p r o p s . r o w D a t a . s w a r m l a b n a m e ] = = p r o p s . r o w D a t a . s w a r m l a b n a m e "
/ / t i t l e = " R e m o v e L a b _ I n s t a n c e "
/ / @ c l i c k = " o n A c t i o n ( ' r m - i n s t a l l ' , p r o p s . r o w D a t a , p r o p s . r o w D a t a . _ i d ) "
console . log ( this . hybridoptions )
this . resetcustom ( )
this . $wait . start ( 'myRunInstancetutor' ) ;
var res = await store . dispatch ( 'pipelineLLO/rmswarmlablocal' , this . hybridoptions . swarmlabname )
this . $wait . end ( 'myRunInstancetutor' ) ;
var obj = { }
obj . token = this . token
obj . instance = this . hybridoptions . swarmlabname
var res2 = await store . dispatch ( 'pipelineLLO/getservicesinfo' , obj )
if ( res2 . data . data == 'yes' ) {
if ( res2 . data . data == 'yes' ) {
var winfo = '<h6 class="text-warning"> swarmlab encountered a problem while deleting your labroom files. <br> This propably means that you have created some files while operating the labroom. <br> To remove those files please run the following command as root. </h6> <h5><i>Copy-and-run-command </i></h5><br> '
winfo += '<span class="text-success">sudo rm -rf ' + res . data . path + '/instance/' + data . swarmlabname + ' </span><br><br>'
winfo += '<span class="text-secondary"> You can back up content using: </span><br>'
winfo += '<span class="text-warning">sudo tar -zcvf /home/\$USER/swarmlabbackup_' + data . swarmlabname + '.tar.gz ' + res . data . path + '/instance/' + data . swarmlabname + ' </span>'
var info = '<h5>Labroom remove</h5>'
this . $swal ( {
type : 'info' ,
html : info + winfo ,
icon : 'info' ,
showCloseButton : true ,
showLoaderOnConfirm : false ,
allowOutsideClick : false ,
cancelButtonText : 'No, cancel!' ,
showCancelButton : false ,
showLoaderOnConfirm : false ,
reverseButtons : true ,
focusCancel : true ,
confirmButtonText : 'Ok!'
} )
}
}
this . refreshVuetable ( )
this . $root . $emit ( 'hybrid_refresh_info_deploy_local' )
this . $wait . end ( 'myRunInstancetutorremove' ) ;
} else {
console . log ( 'no' )
}
} ,
async rowClicked ( row , event ) {
/ / t h i s . $ r o o t . $ e m i t ( ' h y b r i d _ s h o w _ i n f o ' , r o w )
/ / t h i s . r o w v a c t i o n r o w i n d e x = r o w . N a m e s
/ / t h i s . o n A c t i o n ( a c t i o n , d a t a , i n d e x )
/ *
/ / r e m o v e
< button
v - if = "testtest[props.rowData.swarmlabname] != props.rowData.swarmlabname && testtestdir[props.rowData.swarmlabname] == props.rowData.swarmlabname"
class = "ti-check btn btn-sm"
title = "Remove Lab_Instance"
@ click = "onAction('rm-install', props.rowData, props.rowData._id)"
round
>
< / button >
* /
console . log ( row )
console . log ( event )
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / c h e c k s t a t u s r u n s t a r t i t
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ( this . testtest [ row . swarmlabname ] != row . swarmlabname && this . testtestdir [ row . swarmlabname ] == row . swarmlabname ) {
if ( ! this . swarmlabinfonow ) {
this . hybridoptions = row
console . log ( 'start ' + row . swarmlabname )
this . startservice = true
this . onAction ( 'run-item' , row , row . _id )
}
} else if ( this . testtest [ row . swarmlabname ] == row . swarmlabname && this . testtestdir [ row . swarmlabname ] == row . swarmlabname ) {
if ( ! this . swarmlabinfonow ) {
this . hybridoptions = row
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / c h e c k s t a t u s r u n i s r u n n i n g s t o p i t
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
console . log ( 'stop ' + row . swarmlabname )
this . hybridoptions = row
this . startservice = false
this . onAction ( 'run-item' , row , row . _id )
/ / a w a i t t h i s . o n A c t i o n ( ' d o w n - i t e m ' , r o w , r o w . _ i d )
}
} else if ( this . testtest [ row . swarmlabname ] != row . swarmlabname && this . testtestdir [ row . swarmlabname ] != row . swarmlabname ) {
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / c h e c k i n s t a l l e d d o w n l o a d i t
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ( ! this . swarmlabinfonow ) {
var info = ` <h5> Microservice ${ row . swarmlabname } is Not Installed </h5> <br>
< b > Use < / b >
< br >
< br >
< div class = "row" >
< div class = "col-1" >
< button
class = "ti-cloud-down btn btn-outline-secondary btn-sm"
round
>
< / button >
< / div >
< div class = "col-4" >
To Install
< / div >
< div class = "col-1" >
< button
class = "ti-info btn btn-outline-secondary btn-sm"
round
>
< / button >
< / div >
< div class = "col-6" >
For More Information
< / div >
< / div >
`
this . $swal ( {
type : 'info' ,
html : info ,
icon : 'info' ,
showCloseButton : true ,
showLoaderOnConfirm : false ,
allowOutsideClick : false ,
cancelButtonText : 'No, cancel!' ,
showCancelButton : false ,
showLoaderOnConfirm : false ,
reverseButtons : true ,
focusCancel : false ,
confirmButtonText : 'Yes!'
} )
/ / c o n s o l e . l o g ( ' n o t i n s t a l l e d ' + r o w . s w a r m l a b n a m e )
/ / c o n s o l e . l o g ( t h i s . t e s t t e s t d i r )
}
}
/ *
return {
return {
html : true ,
html : true ,
title : ( ) => { return 'Hello <b>Popover:</b> ' + ( ++ this . counter ) } ,
title : ( ) => { return 'Hello <b>Popover:</b> ' + ( ++ this . counter ) } ,
content : ( ) => { return 'The date is:<br><em>' + new Date ( ) + '</em>' }
content : ( ) => { return 'The date is:<br><em>' + new Date ( ) + '</em>' }
}
}
* /
this . swarmlabinfonow = false
} ,
async stopservice ( ) {
this . startservice = false
await this . onAction ( 'down-item' , this . hybridoptions , this . hybridoptions . _id )
} ,
} ,
loadsuccess ( response ) {
loadsuccess ( response ) {
var data = response . data . data
var data = response . data . data
@ -1073,6 +1302,18 @@ info +=' <b>Click on hyperlink opens Directory in new tab</b></p>'
} ;
} ;
< / script >
< / script >
< style >
< style >
# idvuetablekeyg tr : hover {
color : # 2185 d0 ;
cursor : pointer ;
}
# idvuetablekeyg tr td {
border - left : 0 px solid ;
border - right : 0 px solid ;
padding : 0 px ;
}
. flex - fixed - width - item {
. flex - fixed - width - item {
flex : 0 0 100 px ;
flex : 0 0 100 px ;
}
}