Browse Source

add build

master
zeus 2 years ago
parent
commit
7bee42653f
  1. 2
      dist/index.html
  2. 2
      dist/js/app.21fd4f4b.js
  3. 1
      dist/js/app.21fd4f4b.js.map
  4. 2
      dist/js/app.82dc7c9c.js
  5. 1
      dist/js/app.82dc7c9c.js.map
  6. 155
      src-local/llo/new.js
  7. 43
      src-local/swarmlab_backup_src_instanche_user.sh
  8. 12
      src/App.vue
  9. 2
      src/components/manageservices/join-service.vue
  10. 4
      src/components/mynetwork.vue
  11. 59
      src/components/mynetwork/availablemicroservicescustom.vue
  12. 2
      src/components/mynetwork/builderservices.vue
  13. 149
      src/components/mynetwork/customservices.vue
  14. 2
      src/components/mynetwork/mytable.vue
  15. 91
      src/store/modules/create_pipelineLLO.js

2
dist/index.html

@ -1 +1 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vue App</title><link href="/css/app.389c85c2.css" rel="preload" as="style"><link href="/css/chunk-vendors.e469b508.css" rel="preload" as="style"><link href="/js/app.82dc7c9c.js" rel="preload" as="script"><link href="/js/chunk-vendors.d8d18fe6.js" rel="preload" as="script"><link href="/css/chunk-vendors.e469b508.css" rel="stylesheet"><link href="/css/app.389c85c2.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.d8d18fe6.js"></script><script src="/js/app.82dc7c9c.js"></script></body></html>
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vue App</title><link href="/css/app.389c85c2.css" rel="preload" as="style"><link href="/css/chunk-vendors.e469b508.css" rel="preload" as="style"><link href="/js/app.21fd4f4b.js" rel="preload" as="script"><link href="/js/chunk-vendors.d8d18fe6.js" rel="preload" as="script"><link href="/css/chunk-vendors.e469b508.css" rel="stylesheet"><link href="/css/app.389c85c2.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.d8d18fe6.js"></script><script src="/js/app.21fd4f4b.js"></script></body></html>

2
dist/js/app.21fd4f4b.js

File diff suppressed because one or more lines are too long

1
dist/js/app.21fd4f4b.js.map

File diff suppressed because one or more lines are too long

2
dist/js/app.82dc7c9c.js

File diff suppressed because one or more lines are too long

1
dist/js/app.82dc7c9c.js.map

File diff suppressed because one or more lines are too long

155
src-local/llo/new.js

@ -2102,6 +2102,46 @@ app.get('/getcustom', (req, res, next) => {
}
});
app.get('/getcustomuser', (req, res, next) => {
var RES = new Object();
var mypath1 = process.cwd()
var runuser = process.env.USER || ""
var value = JSON.parse(req.query["instance"])
//console.log(value)
//console.log(value.instance.user)
var baseservicetmp1 = value.instance.user.split('@')
var service = `${baseservicetmp1[0]}-${value.instance.service}`
var myservice = `${value.instance.user}_${value.instance.service}_${value.instance.baseservice}`
RES.error = false
RES.error_msg = "ok"
var instancedir = `./community/${myservice}/${service}/custom`
//console.log(instancedir)
if (fs.existsSync(instancedir)) {
var extrapackages = `${instancedir}/extrapackages1`
var extrash = `${instancedir}/custom1.sh`
try {
const extrapackagestext = fs.readFileSync(extrapackages, {encoding:'utf8', flag:'r'});
const extrashtext = fs.readFileSync(extrash, {encoding:'utf8', flag:'r'});
RES.error = false
RES.error_msg = 'ok'
RES.extrapackagestext = extrapackagestext
RES.extrashtext = extrashtext
res.json(RES)
} catch (error) {
//console.log('Error:', error);
RES.error = false
RES.error_msg = 'ok'
RES.data = 'nofile'
res.json(RES)
}
}else{
RES.error = false
RES.error_msg = 'nodir'
RES.data = 'no'
res.json(RES)
}
});
app.get('/savecustom', (req, res, next) => {
var RES = new Object();
var mypath1 = process.cwd()
@ -2138,6 +2178,48 @@ app.get('/savecustom', (req, res, next) => {
}
});
app.get('/savecustomuser', (req, res, next) => {
var RES = new Object();
var mypath1 = process.cwd()
var runuser = process.env.USER || ""
var value = JSON.parse(req.query["instance"])
//console.log(value)
//console.log(value.instance.user)
var baseservicetmp1 = value.instance.user.split('@')
var service = `${baseservicetmp1[0]}-${value.instance.service}`
var myservice = `${value.instance.user}_${value.instance.service}_${value.instance.baseservice}`
RES.package = req.query["package"]
RES.sh = req.query["sh"]
RES.error = false
RES.error_msg = "ok"
var instancedir = `./community/${myservice}/${service}/custom`
if (fs.existsSync(instancedir)) {
var extrapackages = `${instancedir}/extrapackages1`
var extrash = `${instancedir}/custom1.sh`
try {
const extrapackagestext = fs.writeFileSync(extrapackages, RES.package, {encoding:'utf8'});
const extrashtext = fs.writeFileSync(extrash, RES.sh, {encoding:'utf8'});
RES.error = false
RES.error_msg = 'ok'
RES.extrapackagestext = extrapackagestext
RES.extrashtext = extrapackagestext
res.json(RES)
} catch (error) {
//console.log('Error:', error);
RES.error = true
RES.error_msg = error
RES.data = 'no'
res.json(RES)
}
}else{
RES.error = false
RES.error_msg = 'nodir'
RES.data = 'no'
res.json(RES)
}
});
app.get('/runbackup', (req, res, next) => {
var RES = new Object();
var mypath = process.cwd()
@ -2269,6 +2351,79 @@ try {
});
app.get('/runbackupinstanceuser', (req, res, next) => {
var RES = new Object();
var mypath = process.cwd()
var value = JSON.parse(req.query["instance"])
var baseservicetmp1 = value.instance.user.split('@')
var service = `${baseservicetmp1[0]}-${value.instance.service}`
var myservice = `${value.instance.user}_${value.instance.service}_${value.instance.baseservice}`
//var instancedir = `./community/${myservice}/${service}`
RES.error = false
RES.error_msg = "ok"
RES.error_msg0 = ""
RES.data = "All_services_are_running";
var showexec = `./swarmlab_backup_src_instanche_user.sh ${service} ${myservice}`
//console.log('exec tarinstance :', showexec);
var runpath = `${mypath}`
var buildoutdir = `${runpath}/logs/tar-backup-out.log`
var builderrdir = `${runpath}/logs/tar-backup-out.log`
try {
const buildout = fs.openSync(buildoutdir, 'a');
const builderr = fs.openSync(builderrdir, 'a');
//console.log('buildout :', buildout);
var buildimage = `echo "EXEC PID: $$"; ${showexec}`
const run_buildimage = spawn(buildimage, {
detached: true,
shell: true,
stdio: [ 'ignore', buildout, builderr ],
cwd: runpath
});
var n = {}
n.pid = run_buildimage.pid
io.emit('build_set_buildpid', n);
n.data = 'start ...'
io.emit('message_out', n);
n.data = 'Your backup might take a long time, depending on the number of files to back up. '
io.emit('message_out', n);
run_buildimage.on('exit', (data) => {
var n = {}
n.data = 'exit!'
io.emit('message_close', n);
});
run_buildimage.on('close', (data) => {
var n = {}
n.data = 'close!'
io.emit('message_close', n);
n.name = `${value.instance.service}`
n.dir = `${runpath}`
io.emit('message_close_build', n);
});
console.log(run_buildimage.pid);
run_buildimage.unref();
} catch (error) {
console.log('Error:', error);
RES.error = true
RES.error_msg = error
RES.data = 'no'
res.json(RES)
}
});
app.get('/getbuildstatus', (req, res, next) => {
var RES = new Object();
RES.instance = req.query["instance"]

43
src-local/swarmlab_backup_src_instanche_user.sh

@ -0,0 +1,43 @@
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
TARGET="$(readlink "$SOURCE")"
if [[ $TARGET == /* ]]; then
SOURCE="$TARGET"
else
DIR="$( dirname "$SOURCE" )"
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
SRPATH="$( dirname "$SOURCE" )"
SFPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
if [ "$SFPATH" != "$SRPATH" ]; then
RDIR=$SRPATH # relativ path directory
fi
cwdir=$PWD
wdir=$SFPATH
if [[ $# -eq 0 ]] ; then
echo 'no service'
exit 1
fi
if [[ -z "$1" ]] ; then
echo 'no service'
exit 1
fi
service=$1 #services name with user
servicedir=$2 # service dir
#servicebase=$(echo $service | cut -d'_' -f1)
instanche4backup="community/${servicedir}"
date=$(date '+%Y-%m-%d-%H-%M')
docker run --rm -v $SFPATH/mybackups:/backup -v $SFPATH/$instanche4backup:/community alpine /bin/sh -c "mkdir -p /backup/${service}; tar -zcvf /backup/${service}/${service}.${date}.tar.gz /community;"

12
src/App.vue

@ -243,7 +243,7 @@
</b-collapse>
-->
<!-- Menou container -->
<b-list-group-item v-b-toggle.hybrid-container variant="light" name="Local" class="ti-package list-group-item list-group-item-action" v-on:click="setActive('container','')" style="cursor: pointer;" :class="{ active: isActive('container') }" @click="hybrid('bootstrap')" > Instances</b-list-group-item>
<b-list-group-item v-b-toggle.hybrid-container variant="light" name="Local" class="ti-package list-group-item list-group-item-action" v-on:click="setActive('container','')" style="cursor: pointer;" :class="{ active: isActive('container') }" @click="hybrid('bootstrap')" > RunningInstances</b-list-group-item>
<b-collapse id="hybrid-container" class="m-subm" accordion="m-sidebar" role="tabpanel">
<b-list-group-item variant="light" name="Container" class="ti-harddrives m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('container','hybrid_container')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_container') }" @click="hybrid('bootstrap')"> Container</b-list-group-item>
@ -262,7 +262,7 @@
<!-- Menou private -->
<b-list-group-item v-b-toggle.hybrid-private variant="light" name="Private" class="ti-home list-group-item list-group-item-action" v-on:click="setActive('private','hybrid_microservice')" style="cursor: pointer;" :class="{ active: isActive('private') }" @click="hybrid('microservice')" > Private/Local</b-list-group-item>
<b-list-group-item v-b-toggle.hybrid-private variant="light" name="Private" class="ti-home list-group-item list-group-item-action" v-on:click="setActive('private','hybrid_microservice')" style="cursor: pointer;" :class="{ active: isActive('private') }" @click="hybrid('microservice')" > Labs@Home</b-list-group-item>
<b-collapse id="hybrid-private" class="m-subm" accordion="m-sidebar" role="tabpanel">
<b-list-group-item variant="light" name="Container" class="ti-harddrive m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('private','hybrid_private')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_private') }" @click="hybrid('services')"> LabRoom</b-list-group-item>
@ -289,12 +289,13 @@
<!-- Menou llo -->
<!--
<b-list-group-item v-b-toggle.hybrid-llo variant="light" name="Llo" class="ti-book list-group-item list-group-item-action" v-on:click="setActive('llo','')" style="cursor: pointer;" :class="{ active: isActive('llo') }" @click="hybrid('llo')" > LearningObjects</b-list-group-item>
<b-collapse id="hybrid-llo" class="m-subm" accordion="m-sidebar" role="tabpanel">
<b-list-group-item variant="light" name="Container" class="ti-view-list m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('llo','hybrid_llo')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_llo') }" @click="hybrid('llo')"> Courses</b-list-group-item>
</b-collapse>
-->
<!-- Menou close -->
<b-list-group-item variant="light" name="menou-min" class="ti-angle-double-left list-group-item list-group-item-action" v-on:click="onActionMenu('min')" style="cursor: pointer;" :class="{ active: isActive('menou-min') }" title="Minimize"></b-list-group-item>
@ -357,7 +358,7 @@
<b-list-group-item variant="light" name="Storage" class="ti-server m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('private','hybrid_storage')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_storage') }" @click="hybrid('storage')" title="Storage"> </b-list-group-item>
<b-list-group-item variant="light" name="Microservice" class="ti-cloud m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('private','hybrid_microservice')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_microservice') }" @click="hybrid('microservice')" title="Microservices"> </b-list-group-item>
<b-list-group-item variant="light" name="Proof_of_concept" class="ti-light-bulb m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('private','hybrid_proofofconcept')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_proofofconcept') }" @click="hybrid('proofofconcept')" title="Proof_of_concept"> </b-list-group-item>
<b-list-group-item variant="light" name="communityMicroservice" class="ti-user m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('private','hybrid_mymicroservice')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_mymicroservice') }" @click="hybrid('mymicroservice')" title="Microservices"> </b-list-group-item>
<b-list-group-item variant="light" name="communityMicroservice" class="ti-user m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('private','hybrid_mymicroservice')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_mymicroservice') }" @click="hybrid('mymicroservice')" title="Users Microservices"> </b-list-group-item>
</b-collapse>
@ -381,12 +382,13 @@
<!-- Menou llo -->
<!--
<b-list-group-item v-b-toggle.hybrid-llo1 variant="light" name="Llo" class="ti-book list-group-item list-group-item-action" v-on:click="setActive('llo','')" style="cursor: pointer;" :class="{ active: isActive('llo') }" @click="hybrid('llo')" title="LearningObjects" > </b-list-group-item>
<b-collapse id="hybrid-llo1" class="m-subm" accordion="m-sidebar" role="tabpanel">
<b-list-group-item variant="light" name="Container" class="ti-view-list m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('llo','hybrid_llo')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_llo') }" @click="hybrid('llo')" title="Courses"> </b-list-group-item>
</b-collapse>
-->
<!-- Menou close -->
<b-list-group-item variant="light" name="menou-max" class="ti-angle-double-right list-group-item list-group-item-action" v-on:click="onActionMenu('max')" style="cursor: pointer;" title="Maximize"></b-list-group-item>

2
src/components/manageservices/join-service.vue

@ -20,7 +20,7 @@
</div>
<div class="card-body">
<h2 class="card-title">
share with your friends or clients
share with your friends
</h2>
<br>
<p class="card-text">

4
src/components/mynetwork.vue

@ -15,7 +15,7 @@
<hr>
<div class="row text-center">
<div class="col-12">
<b>View and Manage your local system</b>
<b>View and Manage your local system <span class="text-info">(Docker Images, Containers and Volumes)</span></b>
</div>
</div>
<hr>
@ -29,7 +29,7 @@
<hr>
<div class="row text-center">
<div class="col-12">
<b>View and Manage your local networks</b>
<b>View and Manage your local <span class="text-info"> Docker networks</span></b>
</div>
</div>
<hr>

59
src/components/mynetwork/availablemicroservicescustom.vue

@ -536,7 +536,7 @@ export default {
}
for (let index = 0; index < al; ++index) {
var el = res1.data.data[index];
console.log('resall-run--> '+JSON.stringify(el))
//console.log('resall-run--> '+JSON.stringify(el))
/*
var atmp1a = el.split('@');
if(atmp1a[1]){
@ -551,10 +551,10 @@ export default {
let indexiuser = el1[0].lastIndexOf('-');
indexiuser++
var restuser = el1[0].substring(indexiuser)
console.log(restuser)
//console.log(restuser)
//Vue.set(this.testtest, el1[0], el1[0])
Vue.set(this.testtest, restuser, restuser)
console.log(this.testtest)
//console.log(this.testtest)
}
}
@ -563,17 +563,17 @@ export default {
for (var arrayIndex in this.testtestdir) {
Vue.delete(this.testtestdir, this.testtestdir[arrayIndex])
}
console.log('elnames user all ' + JSON.stringify(this.hybridoptions))
//console.log('elnames user all ' + JSON.stringify(this.hybridoptions))
var all = res2.data.data.length;
for (let index = 0; index < all; ++index) {
var el1a = res2.data.data[index];
console.log('elnames1' + el1a)
//console.log('elnames1' + el1a)
// for multiuser must xx = false
var xx = false
if(xx){
var struser = `${this.hybridoptions.user}_`
var strbase = `_${this.hybridoptions.baseservice}`
console.log('elnames user ' + struser)
//console.log('elnames user ' + struser)
var sRegExInput = new RegExp(struser, 'g');
var a = el1a.replace(sRegExInput ,'');
@ -581,30 +581,30 @@ export default {
var a1 = a.replace(sRegExInput1 ,'');
//var a = el1a.replace('struser',"");
console.log('elnames -a1 ' + a1)
console.log('elnames -a ' + a)
//console.log('elnames -a1 ' + a1)
//console.log('elnames -a ' + a)
Vue.set(this.testtestdir, a1, a1)
}else{
var atmp1 = el1a.split('@');
if(atmp1[1]){
console.log('resall---> atmp1 a '+JSON.stringify(atmp1))
//console.log('resall---> atmp1 a '+JSON.stringify(atmp1))
var atmp2 = atmp1[1].split('_');
console.log('resall---> atmp1 '+JSON.stringify(atmp1))
console.log('resall---> atmp2 '+JSON.stringify(atmp2[1]))
console.log('resall---> 2222 '+JSON.stringify(atmp2))
//console.log('resall---> atmp1 '+JSON.stringify(atmp1))
//console.log('resall---> atmp2 '+JSON.stringify(atmp2[1]))
//console.log('resall---> 2222 '+JSON.stringify(atmp2))
Vue.set(this.testtestdir, atmp2[1], atmp2[1])
var servicecustomuser = `${atmp1[0]}@${atmp2[0]}`
Vue.set(this.testtestdiruser, atmp2[1], servicecustomuser)
console.log(this.testtestdir)
console.log(this.testtestdiruser)
//console.log(this.testtestdir)
//console.log(this.testtestdiruser)
//Vue.set(this.testtestuser, el1[0], el1[0])
}
}
}
}
console.log('resall1---> '+JSON.stringify(res2.data.data))
console.log('resall--->> '+JSON.stringify(this.testtestdir))
//console.log('resall1---> '+JSON.stringify(res2.data.data))
//console.log('resall--->> '+JSON.stringify(this.testtestdir))
//console.log(this.testtestdir)
},
setFilter () {
@ -646,7 +646,7 @@ export default {
if(action == 'view-item' ){
this.swarmlab=data
var container=this.swarmlab.readme
console.log('inf '+ JSON.stringify(data))
//console.log('inf '+ JSON.stringify(data))
//console.log('infi '+ JSON.stringify(index))
var description='<div style="height: 250px; overflow-y: scroll;"><p>'+container+'</p></div>'
@ -801,7 +801,7 @@ export default {
this.up_name = data.swarmlabname
console.log('RUN------------ '+ JSON.stringify(data))
//console.log('RUN------------ '+ JSON.stringify(data))
var filtermicrosfot = `microservice-volatilitywindows`
var grepmicrosoft = new RegExp(filtermicrosfot);
@ -848,7 +848,7 @@ export default {
//console.log('RUN base '+ JSON.stringify(this.hybridoptions))
if(obWEB.hasOwnProperty('custom')){
if(obWEB.custom != 'no'){
console.log(obWEB.custom)
//console.log(obWEB.custom)
this.customedit = true
this.custom.os = obWEB.customos
this.custom.sh = obWEB.customsh
@ -924,25 +924,26 @@ export default {
async setcustomsave(){
let value = {}
value.swarmlabname = this.hybridoptions.swarmlabname
var log = await store.dispatch("pipelineLLO/savecustom",{
var log = await store.dispatch("pipelineLLO/savecustomuser",{
token:this.token,
instance:this.hybridoptions.swarmlabname,
instance:this.hybridoptions,
package:this.custom.os,
sh:this.custom.sh
})
this.custommenouopen = false
this.custommenou = false
console.log('chown ok '+ JSON.stringify(log.data))
//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",{
var log = await store.dispatch("pipelineLLO/getcustomuser",{
token:this.token,
instance:this.hybridoptions.swarmlabname
instance:this.hybridoptions
})
//console.log(log)
if(log.data.error === false){
if(log.data.error_msg == 'nodir'){
//console.log('chown reload')
@ -974,8 +975,8 @@ export default {
//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))
//console.log('chown extrapackages1 '+ JSON.stringify(this.custom.os))
//console.log('chown sh1 '+ JSON.stringify(this.custom.sh))
}
}else{
@ -1002,9 +1003,9 @@ export default {
//console.log('chown sh '+ JSON.stringify(this.custom.sh))
},
async backup(){
var log = await store.dispatch("pipelineLLO/runbackupinstance",{
var log = await store.dispatch("pipelineLLO/runbackupinstanceuser",{
token:this.token,
instance: this.hybridoptions.swarmlabname
instance: this.hybridoptions
})
},
async backupview(){
@ -1048,7 +1049,7 @@ info +=' <b>Click on hyperlink opens Directory in new tab</b></p>'
service:this.hybridoptions.service,
baseservice:this.hybridoptions.baseservice
})
console.log('data '+ JSON.stringify(this.hybridoptions))
//console.log('data '+ JSON.stringify(this.hybridoptions))
//this.$root.$emit('hybrid_start_instance_custom', value)
this.$root.$emit('hybrid_start_instance_custom', this.hybridoptions)
//Vue.set(this.testactionrowindex, value.swarmlabname, value.index)

2
src/components/mynetwork/builderservices.vue

@ -17,7 +17,7 @@
<div class="row text-center">
<div class="col-12">
<b>Swarmlab <span class="text-info">Base MicroServices</span></b>
<b>Select a <span class="text-info"> Base image</span></b>
</div>
</div>

149
src/components/mynetwork/customservices.vue

@ -9,7 +9,7 @@
<b-container fluid class="bv-example-row">
<div class="row text-center">
<div class="col-12">
<b>View and Manage your builds</b>
<b>View and <span class="text-info">Manage your builds</span></b>
</div>
</div>
@ -38,6 +38,14 @@
disabled
aria-describedby="validationTooltipUsernamePrepend1"
>
<div class="input-group-prepend">
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
round
@click="onAction('form_baseservice')">
</button>
</div>
</div>
</div>
</div>
@ -71,6 +79,14 @@
data-vv-name="form_myservicename"
>
<div class="input-group-prepend">
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
round
@click="onAction('form_myservicename')">
</button>
</div>
</div>
</div>
</div>
@ -102,6 +118,14 @@
v-on:change="isValid('stackversion')"
v-on:focus="isValid('stackversion')"
>
<div class="input-group-prepend">
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
round
@click="onAction('form_version')">
</button>
</div>
</div>
</div>
</div>
@ -121,6 +145,14 @@
name="validationTooltipUsername"
aria-describedby="validationTooltipUsernamePrepend"
>
<div class="input-group-prepend">
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
round
@click="onAction('form_gitrepo')">
</button>
</div>
</div>
</div>
</div>
@ -129,7 +161,13 @@
<div class="row"
<b-col class="text-center" cols="12" sm="12" md="12">
<div class="form-group">
<label for="customreadme" class="text-dark"> <b>README </b> <br>
<label for="customreadme" class="text-dark"> <b> <span class="text-info">README </span></b> <br>
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
round
@click="onAction('form_readme')">
</button>
</label>
<textarea class="form-control" name="customreadme" rows="8"
v-model="form_readme"
@ -144,7 +182,13 @@
<div class="row"
<b-col class="text-center" cols="12" sm="12" md="12">
<div class="form-group">
<label for="custompackages" class="text-dark"><b>Add Extrapackages</b> <br>
<label for="custompackages" class="text-dark"><b> <span class="text-info">Add Extrapackages</span></b> <br>
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
round
@click="onAction('form_os')">
</button>
<span class="text-success">
{{ customostext }}
</span >
@ -162,7 +206,13 @@
<div class="row"
<b-col class="text-center" cols="12" sm="12" md="12">
<div class="form-group">
<label for="customshell" class="text-dark"><b>Custom sh script</b> <br>
<label for="customshell" class="text-dark"><b><span class="text-info">Custom sh script </span></b> <br>
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
round
@click="onAction('form_sh')">
</button>
<span class="text-success">
{{ customshtext }}
</span >
@ -178,6 +228,16 @@
</div>
<div class="row">
<div class="col-sm-12 sm-12">
<div class="text-center">
<button
class="ti-info btn btn-outline-secondary btn-sm align-center"
title="Info"
round
@click="onAction('port')">
</button>
</div>
</div>
<div class="col-sm-3 sm-3">
<div class="input-group">
<div class="input-group-prepend">
@ -320,7 +380,13 @@
<div class="row"
<b-col class="text-center" cols="12" sm="12" md="12">
<div class="form-group">
<label for="rclocal" class="text-dark"><b>rc.local</b> <br>
<label for="rclocal" class="text-dark"><b><span class="text-info">rc.local</span></b> <br>
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="Info"
round
@click="onAction('form_rclocal')">
</button>
<span class="text-success">
{{ customshtext }}
</span >
@ -585,6 +651,79 @@ export default {
},
methods: {
async onAction(value) {
console.log(value)
var infotxt = ''
var info='<h5></h5>'
if(value == "form_myservicename"){
info='<h5 class="text-info">Service Name</h5>'
infotxt += `The <b>myServicename</b> field may contain alphabetic characters and numbers Service Version.
`
}else if(value == "form_version"){
info='<h5 class="text-info">Service Version</h5>'
infotxt += `The <b>Version</b> field may contain alphabetic characters and numbers Service Version.
`
}else if(value == "form_baseservice"){
info='<h5 class="text-info">Docker base image</h5>'
infotxt += `<br>
A base image is the image that is used to create all of your container images. <br>`
}else if(value == "form_gitrepo"){
info='<h5 class="text-info">Git-repo</h5>'
infotxt += `<b>A string that contains a valid URL</b> URL, is
`
}else if(value == "form_rclocal"){
info='<h5 class="text-info">rc.local</h5>'
infotxt += `<b>Define startup scripts or additional services to start.</b><br><br> It is executed after all build processes are finished.`
}else if(value == "form_sh"){
info='<h5 class="text-info">Custom sh script </h5>'
infotxt += `<b>A sh script intended to be run after a fresh installation in order to automate system update, extra software installation and a couple configuration files setup. </b> <br><br> It is executed after "Add Extrapackages" are finished.`
}else if(value == "form_os"){
info='<h5 class="text-info">Add Extrapackages </h5>'
infotxt += `<b>sh script to install packages on Base system.</b> <br>
<br>
<br><b>Examples</b>
<br>
<br>
apt update && apt install -y vim
<br>
<a href="https://help.ubuntu.com/community/AptGet/Howto?action=show&redirect=AptGetHowto" target="_blank">Info</a>
<br>
<br>
OR
<br>
<br>
apk update && apk add --no-cache vim
<br>
<a href="https://wiki.alpinelinux.org/wiki/Package_management" target="_blank">Info</a>
`
}else if(value == "port"){
info='<h5 class="text-info">Port - URI - Name </h5>'
infotxt += `<b>Published ports</b>
<br>
<br>
By default, when you create or run a container, it does not publish any of its ports to the outside world.
<br><br>
To make a port available to services outside of Docker, or to Docker containers which are not connected to the containers network, use the "Port" field.
`
}
info += infotxt
this.$swal({
html: info,
icon: 'info',
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true
})
},
async save() {
(async () => {
var isAllValid = true

2
src/components/mynetwork/mytable.vue

@ -16,7 +16,7 @@
<b-container fluid class="bv-example-row">
<div class="row text-center">
<div class="col-12">
<b>View and Manage your running Containers</b>
<b>View and Manage your <span class="text-info">Running Instances</span></b>
</div>
</div>

91
src/store/modules/create_pipelineLLO.js

@ -501,6 +501,37 @@ export default {
return R;
}
}
},
async getcustomuser({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value))
try {
var token = value.token
var params = {
instance: value
}
var options = {
params: params,
headers: { 'content-type': 'application/x-www-form-urlencoded',Authorization: `Bearer ${token}` },
};
var sock_server_l = ApiConfig.url_80+'/getcustomuser'
var p = await axios.get(sock_server_l,options);
//var p = await axios.get('https://localhost:3000/getservicesinfo',options);
return p
//console.log(JSON.stringify(p))
//console.log(value.token)
//console.log(value.swarmlabname)
} catch (e) {
if(e.message == "Request failed with status code 401" || /401/i.test(e.message)){
//console.log('error '+JSON.stringify(e))
window.location.href = 'https://api-login.swarmlab.io:8089';
}else{
var R = {
ERROR_str: e,
ERROR: 'yes'
}
return R;
}
}
},
async savecustom({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value))
@ -534,6 +565,39 @@ export default {
return R;
}
}
},
async savecustomuser({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value))
try {
var token = value.token
var params = {
instance: value,
package: value.package,
sh: value.sh
}
var options = {
params: params,
headers: { 'content-type': 'application/x-www-form-urlencoded',Authorization: `Bearer ${token}` },
};
var sock_server_l = ApiConfig.url_80+'/savecustomuser'
var p = await axios.get(sock_server_l,options);
//var p = await axios.get('https://localhost:3000/getservicesinfo',options);
return p
//console.log(JSON.stringify(p))
//console.log(value.token)
//console.log(value.swarmlabname)
} catch (e) {
if(e.message == "Request failed with status code 401" || /401/i.test(e.message)){
//console.log('error '+JSON.stringify(e))
window.location.href = 'https://api-login.swarmlab.io:8089';
}else{
var R = {
ERROR_str: e,
ERROR: 'yes'
}
return R;
}
}
},
async runeditor({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value))
@ -776,6 +840,33 @@ export default {
return R;
}
}
},
async runbackupinstanceuser({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value))
try {
var token = value.token
var params = {
instance: value
}
var options = {
params: params,
headers: { 'content-type': 'application/x-www-form-urlencoded',Authorization: `Bearer ${token}` },
};
var sock_server_l = ApiConfig.url_80+'/runbackupinstanceuser'
var p = await axios.get(sock_server_l,options);
return p
} catch (e) {
if(e.message == "Request failed with status code 401" || /401/i.test(e.message)){
//console.log('error '+JSON.stringify(e))
window.location.href = 'https://api-login.swarmlab.io:8089';
}else{
var R = {
ERROR_str: e,
ERROR: 'yes'
}
return R;
}
}
},
async hybrid_rmimage({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value))

Loading…
Cancel
Save