Browse Source

add builders 2

master
zeus 4 years ago
parent
commit
8218b31c96
  1. 2
      dist/index.html
  2. 2
      dist/js/app.4e119b7b.js
  3. 1
      dist/js/app.4e119b7b.js.map
  4. 2
      dist/js/app.de882020.js
  5. 1
      dist/js/app.de882020.js.map
  6. 39
      src-local/llo/new.js
  7. 4
      src/App.vue
  8. 588
      src/components/manageservices/llo-search-backup.vue
  9. 1444
      src/components/manageservices/llo-search-backup1.vue
  10. 6
      src/components/manageservices/llo-search.vue
  11. 6
      src/components/manageservices/manage-service.vue
  12. 6
      src/components/manageservices/view-service.vue
  13. 12
      src/components/mynetwork/AdhocView.vue
  14. 8
      src/components/mynetwork/availablemicroservices.vue
  15. 8
      src/components/mynetwork/availableservices.vue
  16. 15
      src/components/mynetwork/availablestorage.vue
  17. 101
      src/components/mynetwork/builderservices.vue
  18. 6
      src/components/mynetwork/dockerservices.vue
  19. 3
      src/components/mynetwork/mybuilder.vue
  20. 4
      src/components/mynetwork/mytable.vue
  21. 56
      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.10423c10.css" rel="preload" as="style"><link href="/css/chunk-vendors.e469b508.css" rel="preload" as="style"><link href="/js/app.de882020.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.10423c10.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.d8d18fe6.js"></script><script src="/js/app.de882020.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.10423c10.css" rel="preload" as="style"><link href="/css/chunk-vendors.e469b508.css" rel="preload" as="style"><link href="/js/app.4e119b7b.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.10423c10.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.d8d18fe6.js"></script><script src="/js/app.4e119b7b.js"></script></body></html>

2
dist/js/app.4e119b7b.js

File diff suppressed because one or more lines are too long

1
dist/js/app.4e119b7b.js.map

File diff suppressed because one or more lines are too long

2
dist/js/app.de882020.js

File diff suppressed because one or more lines are too long

1
dist/js/app.de882020.js.map

File diff suppressed because one or more lines are too long

39
src-local/llo/new.js

@ -886,6 +886,45 @@ app.get('/getservicesstatus', (req, res, next) => {
}); });
app.get('/rmbuildstatus', (req, res, next) => {
var RES = new Object();
RES.instance = req.query["instance"]
var showfile = `./builders/bento-swarmlab/builds/${RES.instance}.virtualbox.box`
//console.log(showfile)
var found = 'no';
try {
found = 'yes';
fs.unlinkSync(showfile)
RES.error = false
RES.error_msg = "ok"
RES.data = found;
res.json(RES)
} catch (e) {
found = 'no';
RES.error = false
RES.error_msg = "ok"
RES.data = found;
res.json(RES)
}
});
app.get('/getbuildstatus', (req, res, next) => {
var RES = new Object();
RES.instance = req.query["instance"]
var showfile = `./builders/bento-swarmlab/builds/${RES.instance}.virtualbox.box`
//console.log(showfile)
var found = 'no';
if (fs.existsSync(showfile)) {
found = 'yes';
}else{
found = 'no';
}
RES.error = false
RES.error_msg = "ok"
RES.data = found;
res.json(RES)
});
app.get('/getstoragestatus', (req, res, next) => { app.get('/getstoragestatus', (req, res, next) => {
var RES = new Object(); var RES = new Object();

4
src/App.vue

@ -349,7 +349,7 @@
<!-- Menou builders --> <!-- Menou builders -->
<b-list-group-item v-b-toggle.hybrid-builders variant="light" name="Private" class="ti-layers-alt list-group-item list-group-item-action" v-on:click="setActive('builders','')" style="cursor: pointer;" :class="{ active: isActive('builders') }" @click="hybrid('builders')" title="Builders" > </b-list-group-item> <b-list-group-item v-b-toggle.hybrid-builders variant="light" name="Private" class="ti-layers-alt list-group-item list-group-item-action" v-on:click="setActive('builders','')" style="cursor: pointer;" :class="{ active: isActive('builders') }" @click="hybrid('builders')" title="Builders" > </b-list-group-item>
<b-collapse id="hybrid-builders" class="m-subm" accordion="m-sidebar" role="tabpanel"> <b-collapse id="hybrid-builders1" class="m-subm" accordion="m-sidebar" role="tabpanel">
<b-list-group-item variant="light" name="build_vmware" class=" ti-folder m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('builders','hybrid_builders')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_builders') }" @click="hybrid('builders')" title="Build VM"> </b-list-group-item> <b-list-group-item variant="light" name="build_vmware" class=" ti-folder m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('builders','hybrid_builders')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_builders') }" @click="hybrid('builders')" title="Build VM"> </b-list-group-item>
<b-list-group-item variant="light" name="build_docker" class="ti-harddrive m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('builders','hybrid_docker')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_docker') }" @click="hybrid('build_docker')" title="Build Docker"> </b-list-group-item> <b-list-group-item variant="light" name="build_docker" class="ti-harddrive m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('builders','hybrid_docker')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_docker') }" @click="hybrid('build_docker')" title="Build Docker"> </b-list-group-item>
</b-collapse> </b-collapse>
@ -581,6 +581,7 @@ import "@/assets/css/themify-icons.css";
import store from '@/store/index' import store from '@/store/index'
import {mapState, mapGetters, mapActions,dispatch} from 'vuex' import {mapState, mapGetters, mapActions,dispatch} from 'vuex'
import Vue from 'vue' import Vue from 'vue'
import card from '@/components/Card.vue'
import ConnectServer from "./components/myconnect-server.vue"; import ConnectServer from "./components/myconnect-server.vue";
import NetworkTable from "./components/mynetwork.vue"; import NetworkTable from "./components/mynetwork.vue";
import ServicesTable from "./components/myservices.vue"; import ServicesTable from "./components/myservices.vue";
@ -595,6 +596,7 @@ import ViewDashboard from "./components/dashboard.vue";
export default { export default {
name: 'app', name: 'app',
components: { components: {
card,
NetworkTable, NetworkTable,
ViewDashboard, ViewDashboard,
ServicesTable, ServicesTable,

588
src/components/manageservices/llo-search-backup.vue

@ -1,588 +0,0 @@
<template>
<card class="card-user" style="max-height:100%">
<div class="author">
<img class="avatar border-white" src="@/assets/img/academy.png" alt="..."
v-if="datadir"
>
<img class="avatar border-white" src="@/assets/img/library.png" alt="..."
v-else
>
</div>
<v-wait for="myRunInstancetutor1">
<template slot="waiting">
<div>
<img src="@/assets/loading.gif" />
Enter Lab_room...
</div>
</template>
</v-wait>
<b-container fluid class="bv-example-row"
v-show="datadir"
>
<div class="list-group myscrool"
>
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start"
v-for="(course, i) in courses"
@click="viewllo(course,i)"
:class="{ active: i === activeItem}"
>
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{course.title}}</h5>
<small
:class="checkClass(course)"
> {{ course.type }}
<small class="ti-shortcode"
v-if="course.type=='asciinema'"
> </small>
<small class="ti-video-camera"
v-if="course.type=='video'"
> </small>
<small class="ti-book"
v-if="course.type=='asciidoc'"
> </small>
<small class="ti-help-alt text-exercise"
v-if="course.type=='exercise'"
> </small>
</small>
</div>
<!--
<p class="mb-1">{{ course.subtitle }}</p>
-->
<small>{{ course.desc}}</small>
</a>
</div>
</b-container>
<br>
<b-container fluid class="bv-example-row">
<div class="progress"
v-show="datadir"
>
<div class="progress-bar progress-bar-striped bg-secondary" role="progressbar" :style="getprogress(datadir)" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100">{{ progress }}</div>
</div>
<div class="input-group input-group-sm sm-3">
<input type="text"
class="form-control"
aria-label="Small" aria-describedby="inputGroup-sizing-sm"
placeholder="Search by Name"
v-model="searchFor"
@keyup.enter="setFilter"
>
<div class="input-group-prepend">
<select
class="custom-select custom-select-sm" v-model="searchcourselevel">
<option value="0" selected>Level...</option>
<option value="1">Elementary</option>
<option value="2">Intermediate</option>
<option value="3">Advanced</option>
<option value="4">Expert</option>
<option value="5">Guru</option>
</select>
</div>
<div class="input-group-append">
<button
class="btn btn-outline-primary"
round
type="button"
@click="setFilter">
Go</button>
</div>
<div class="input-group-append">
<button class="btn btn-outline-secondary"
round
type="button"
@click="resetFilter">
Reset</button>
</div>
</div>
<div class="white h-100 flex-fixed-width-item"
<vuetable
ref="vuetable"
:key="vuetablekey"
:api-url='apiurl'
:api-mode="true"
:http-options="httpOptions"
:fields="fields"
:item-actions="itemActions"
:sort-order="sortOrder"
:show-sort-icons="true"
:multi-sort="multiSort"
:per-page="perpage"
pagination-path="links.pagination"
:pagination-component="paginationComponent"
:append-params="moreParams"
wrapper-class="vuetable-wrapper"
loading-class="loading"
detail-row-id="id"
@vuetable:pagination-data="onPaginationData"
@vuetable:load-success="loadsuccess"
@vuetable:load-error="onLoadError"
:css="css.table"
>
<div slot="actions" slot-scope="props">
<button
v-if="actionrowindex == props.rowIndex"
class="ti-more-alt btn btn-secondary btn-sm"
title="View Course Details"
round
@click="onAction('run-more', props.rowData, props.rowIndex)">
</button>
<button
v-else
class="ti-more btn btn-outline-secondary btn-sm"
title="View Course Details"
round
@click="onAction('run-more', props.rowData, props.rowIndex)">
</button>
<button
class="ti-info btn btn-outline-secondary btn-sm"
title="View Course Info"
round
@click="onAction('run-info', props.rowData, props.rowIndex)">
</button>
</div>
</vuetable>
<div class="vuetable-pagination ui basic segment grid">
<vuetable-pagination-info
ref="paginationInfo"
:css="css.paginationInfo"
>
</vuetable-pagination-info>
<vuetable-pagination
:css="css.pagination"
ref="pagination"
@vuetable-pagination:change-page="onChangePage"
>
</vuetable-pagination>
</div>
</div>
</b-container>
</card>
</template>
<script>
import store from '@/store/index'
import {mapState, mapGetters, mapActions,dispatch} from 'vuex'
import Vue from 'vue'
import {Vuetable, VuetablePaginationDropdown} from 'vuetable-2'
import VuetablePaginationInfo from 'vuetable-2/src/components/VuetablePaginationInfo'
import VuetablePagination from 'vuetable-2/src/components/VuetablePagination'
import CssConfig from 'vuetable-2/src/components/VuetableCssConfig.js'
import card from '@/components/Card.vue'
import {ApiConfig} from "@/config/index";
export default {
components: {
card,
Vuetable,
VuetablePagination,
VuetablePaginationInfo,
VuetablePaginationDropdown
},
props: {
},
data() {
return{
actionrowindex:'',
activeItem: null,
playbookInfo: {},
token: '',
playbook: {
'title':'',
'name':'',
'description':''
},
datadir:'',
progress:0,
searchcourselevel:0,
courses:[],
courseshow:false,
container:{
name:'',
view:0
},
pipeline:{},
selected: 'hybrid',
options: [
{ text: 'Packages', value: 'packages' },
{ text: 'Images', value: 'images' },
{ text: 'Scripts', value: 'scripts' }
],
showModal: false,
visibility: [],
active:false,
vuetablekey:0,
fielddata:{},
fields: [
{
name: 'title',
title: '<span class="orange"></span>Name',
sortField: 'title',
visible:true,
dataClass: 'text-left text-wrap text-break break-word',
width: '20%'
},
{
name: 'subtitle',
title: '<span class="orange"></span>Course',
sortField: 'subtitle',
visible:true,
dataClass: 'left aligned w-25',
width: '25%'
},
{
name: '_id',
title: '<span class="orange"></span>mongo',
visible:false
},
{
name: 'desc',
title: '<span class="orange"></span>Description',
sortField: 'desc',
titleClass: 'center aligned',
visible:true,
width: '40%'
},
{
name: 'ID',
sortField: 'ID',
titleClass: 'center aligned',
dataClass: 'left aligned w-25',
visible:false,
width: '15%'
},
{
name: '__slot:actions', // <----
title: '<span class="d-flex justify-content-center">Actions</span>',
titleClass: 'center aligned',
dataClass: 'text-center',
width: '15%'
}
],
apiurl:ApiConfig.url_80+"/get_llo",
//apiurl:ApiConfig.swarmlab_url_80+"/swarmlabhybridservices",
css: CssConfig,
perpage: 5,
searchFor: '',
sortOrder: [{
field: 'pipelinename',
direction: 'asc'
}],
multiSort: true,
paginationComponent: 'vuetable-pagination',
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"} },
{ name: 'delete-item', label: '', icon: 'glyphicon glyphicon-remove', class: 'btn btn-danger', extra: {title: 'Delete', 'data-toggle':"tooltip", 'data-placement': "right" } }
],
moreParams: {
'filter': '',
'level': '',
'type': 'scripts',
'tutor': 'yes'
},
}
},
mounted() {
this.$root.$on('hybrid_refresh_dockerservices', () => {
Vue.nextTick( () => this.$refs.vuetable.refresh())
})
//refresh from socket mytable
this.$root.$on('hybrid_refresh_table', (v) => {
this.$nextTick(function () {
Vue.nextTick( () => this.$refs.vuetable.refresh())
this.viewhybridoptions = false
})
})
},
created() {
var url_string = window.location.href
var url = new URL(url_string);
this.token = url.searchParams.get("token");
console.log("token "+ this.token);
},
beforeDestroy () {
this.$root.$off('hybrid_refresh_dockerservices')
this.$root.$off('hybrid_refresh_table')
},
computed: {
httpOptions() {
var token = this.token
var p="headers: {Authorization: token}}"; //table props -> :http-options="httpOptions"
return {headers: {Authorization: 'Bearer ' + token}} //table props -> :http-options="httpOptions"
},
},
methods: {
async getprogress(course){
console.log('course '+course)
var value1 = {}
value1.course = this.datadir
var llo = await store.dispatch('pipelineLLO/get_progress', value1)
console.log('asciidoc '+JSON.stringify(llo))
this.progress = 35
return `width: ${this.progress}%;`
},
checkClass(course){
if(course.type == 'video'){
return 'text-primary'
} else if(course.type == 'asciidoc'){
return 'text-success'
} else if(course.type == 'asciinema'){
return 'text-info'
} else if(course.type == 'exercise'){
return 'text-warning'
}else{
return 'text-secondary'
}
},
onError (type,description) {
var winfo=description
var info='<h5>Bootstrap '+type+'</h5>'
this.$swal({
type: type,
html: info+winfo,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: false,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true,
confirmButtonText: 'Ok!'
})
},
setFilter () {
this.moreParams = {
'filter': this.searchFor,
'level': this.searchcourselevel,
'type': this.selected
}
Vue.nextTick( () => this.$refs.vuetable.refresh())
},
resetFilter () {
this.moreParams = {}
this.searchFor = ''
Vue.nextTick( () => this.$refs.vuetable.refresh())
},
onPaginationData (paginationData) {
this.$refs.pagination.setPaginationData(paginationData)
this.$refs.paginationInfo.setPaginationData(paginationData)
},
onChangePage (page) {
this.$refs.vuetable.changePage(page)
},
editRow(rowData) {
alert("You clicked edit on"+ JSON.stringify(rowData));
},
async viewllo (course,i) {
console.log(JSON.stringify(i))
this.courseshow = true
if(course.type == 'video' ){
console.log(JSON.stringify(course))
var value = {}
value.type = course.type
value.course = course.file
value.llo = this.datadir
this.$root.$emit('hybrid_llo_viecourse',value)
}else if(course.type == 'asciidoc' ){
var value1 = {}
value1.dir = this.datadir
value1.file = course.file
//console.log('asciidoc '+JSON.stringify(value1))
var llo = await store.dispatch('pipelineLLO/get_llo_course_ascii', value1)
console.log('asciidoc '+JSON.stringify(llo))
//this.courses = JSON.parse(llo.data)
var value = {}
value.type = course.type
value.code = llo.data.data
value.course = course.file
value.llo = this.datadir
this.$root.$emit('hybrid_llo_viecourse',value)
}else if(course.type == 'asciinema' ){
console.log(JSON.stringify(course))
var value = {}
value.type = course.type
value.course = course.file
value.llo = this.datadir
this.$root.$emit('hybrid_llo_viecourse',value)
}
this.activeItem = i;
},
async onAction (action, data, index) {
//console.log('index '+this.actionrowindex)
if(action == 'run-more' ){
this.actionrowindex = index
this.datadir = data.dir
var llo = await store.dispatch('pipelineLLO/get_llo_course', data.dir)
this.courses = llo.data
//this.courses = JSON.parse(llo.data)
//console.log(JSON.stringify(llo.data))
//console.log(JSON.stringify(this.courses[0].type))
}else if(action == 'run-info' ){
console.log(JSON.stringify(data))
// {"title":"linux","subtitle":"Basics","level":"Intermediate","desc":"description","dir":"hybrid-linux"}
var info = `
<table class="table table-hover table-sm text-left">
<tbody>
<tr>
<th ><b>Title</b></th>
<td>${data.title}</td>
</tr>
<tr>
<td><b>Subtitle</b></td>
<td>${data.subtitle}</td>
</tr>
<tr>
<th ><b>Level</b></th>
<td>${data.level}</td>
</tr>
<tr>
<td ><b>Description</b></td>
<td>${data.desc}</td>
</tr>
</tbody>
</table>`
this.$swal({
type: 'Info',
title: 'Course Info!',
icon:'info',
html: info,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: false,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true,
confirmButtonText: 'Ok!'
})
}
},
refreshVuetable() {
this.$nextTick(()=>{
this.vuetablekey += 1
})
},
playbookinfoShow(value) {
return this.visibility[value]=true
},
playbookinfo(value) {
return this.playbookInfo=value
},
rowClicked(row, event) {
return {
html: true,
title: () => { return 'Hello <b>Popover:</b> ' + (++this.counter) },
content: () => { return 'The date is:<br><em>' + new Date() + '</em>' }
}
},
loadsuccess(response) {
var data = response.data.data
this.fielddata=data
var n = data.length
n=n-1
},
onLoadError(payload) {
/*
//error2 "invalid_token" join-service.vue:684
//error2 "The access token provided has expired" join-service.vue:685
//error2 "Unauthorized" join-service.vue:686
//error2 401
console.log('error2 '+JSON.stringify(payload.response.data.error))
console.log('error2 '+JSON.stringify(payload.response.data.error_description))
console.log('error2 '+JSON.stringify(payload.response.statusText))
console.log('error2 '+JSON.stringify(payload.response.status))
*/
if(payload.response.status == '401'){
window.location.href = 'https://api-login.swarmlab.io:8089';
Vue.nextTick( () => window.location.href = 'https://api-login.swarmlab.io:8089')
}
}
},
actions: {
}
};
</script>
<style>
.flex-fixed-width-item {
flex: 0 0 100px;
}
.modalinfo {
z-index: 10000000 !important;
position:fixed;
}
/* a container with flex-direction column */
.vue-notifyjs.notifications{
.alert{
z-index: 100;
}
.list-move {
transition: transform 0.3s, opacity 0.4s;
}
.list-item {
display: inline-block;
margin-right: 10px;
}
.list-enter-active {
transition: transform 0.2s ease-in, opacity 0.4s ease-in;
}
.list-leave-active {
transition: transform 1s ease-out, opacity 0.4s ease-out;
}
.list-enter {
opacity: 0;
transform: scale(1.1);
}
.list-leave-to {
opacity: 0;
transform: scale(1.2, 0.7);
}
}
.myscrool {
height: 280px;
max-height: 280px;
overflow-y: auto;
//margin-bottom: 10px;
-webkit-overflow-scrolling: touch;
}
pre {
//background-color: rgb(255, 247, 229);
background-color: #eff0f1;
border: 1px solid blue;
//white-space: pre-line;
}
</style>

1444
src/components/manageservices/llo-search-backup1.vue

File diff suppressed because it is too large

6
src/components/manageservices/llo-search.vue

@ -312,7 +312,7 @@ v-for="(course, i) in courses"
<div class="white h-100 flex-fixed-width-item" <div class="white h-100 flex-fixed-width-item"
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:key="vuetablekey" :key="vuetablekeyf"
:api-url='apiurl' :api-url='apiurl'
:api-mode="true" :api-mode="true"
:http-options="httpOptions" :http-options="httpOptions"
@ -427,7 +427,7 @@ export default {
showModal: false, showModal: false,
visibility: [], visibility: [],
active:false, active:false,
vuetablekey:0, vuetablekeyf:0,
fielddata:{}, fielddata:{},
fields: [ fields: [
{ {
@ -792,7 +792,7 @@ export default {
}, },
refreshVuetable() { refreshVuetable() {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.vuetablekey += 1 this.vuetablekeyf += 1
}) })
}, },
playbookinfoShow(value) { playbookinfoShow(value) {

6
src/components/manageservices/manage-service.vue

@ -184,7 +184,7 @@
<div class="white h-100 flex-fixed-width-item" <div class="white h-100 flex-fixed-width-item"
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:key="vuetablekey" :key="vuetablekeyc"
:api-url='apiurl' :api-url='apiurl'
:api-mode="true" :api-mode="true"
:http-options="httpOptions" :http-options="httpOptions"
@ -312,7 +312,7 @@ export default {
showModal: false, showModal: false,
visibility: [], visibility: [],
active:false, active:false,
vuetablekey:0, vuetablekeyc:0,
fielddata:{}, fielddata:{},
fields: [ fields: [
{ {
@ -599,7 +599,7 @@ export default {
}, },
refreshVuetable() { refreshVuetable() {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.vuetablekey += 1 this.vuetablekeyc += 1
}) })
}, },
playbookinfoShow(value) { playbookinfoShow(value) {

6
src/components/manageservices/view-service.vue

@ -211,7 +211,7 @@
<div class="white h-100 flex-fixed-width-item" <div class="white h-100 flex-fixed-width-item"
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:key="vuetablekey" :key="vuetablekeyd"
:api-url='apiurl' :api-url='apiurl'
:api-mode="true" :api-mode="true"
:http-options="httpOptions" :http-options="httpOptions"
@ -313,7 +313,7 @@ export default {
showModal: false, showModal: false,
visibility: [], visibility: [],
active:false, active:false,
vuetablekey:0, vuetablekeyd:0,
fielddata:{}, fielddata:{},
fields: [ fields: [
{ {
@ -611,7 +611,7 @@ export default {
}, },
refreshVuetable() { refreshVuetable() {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.vuetablekey += 1 this.vuetablekeyd += 1
}) })
}, },
playbookinfoShow(value) { playbookinfoShow(value) {

12
src/components/mynetwork/AdhocView.vue

@ -380,13 +380,11 @@ export default {
}) })
// from runLLO // from runLLO
this.$root.$on('hybrid_log_in', (log) => { this.$root.$on('hybrid_log_in', (log) => {
//this.code += JSON.stringify(log) //this.code += log.data
//this.code += log.data //this.code += "\n"
//this.code += "\n" //console.log(" form socket log "+JSON.stringify(this.code))
//console.log(" form socket log "+JSON.stringify(this.code))
var doc = this.$refs.myCm.codemirror.getDoc(); var doc = this.$refs.myCm.codemirror.getDoc();
var cursor = doc.getCursor(); // gets the line number in the cursor position var cursor = doc.getCursor(); // gets the line number in the cursor position
//console.log(" form socket log "+JSON.stringify(cursor))
var line = doc.getLine(cursor.line); // get the line contents var line = doc.getLine(cursor.line); // get the line contents
var pos = { // create a new object to avoid mutation of the original selection var pos = { // create a new object to avoid mutation of the original selection
line: cursor.line, line: cursor.line,
@ -395,17 +393,15 @@ export default {
doc.replaceRange(log.data, pos); // adds a new line doc.replaceRange(log.data, pos); // adds a new line
doc.replaceRange("\n", pos); // adds a new line doc.replaceRange("\n", pos); // adds a new line
this.$refs.myCm.codemirror.setCursor(this.$refs.myCm.codemirror.lineCount(), 0); this.$refs.myCm.codemirror.setCursor(this.$refs.myCm.codemirror.lineCount(), 0);
//var extenderror = /hello/;
var extenderror = new RegExp('max depth exceeded'); var extenderror = new RegExp('max depth exceeded');
if(extenderror.test(log.data)){ if(extenderror.test(log.data)){
this.extenderror = true this.extenderror = true
//console.log('find');
}else{ }else{
console.log('not find'); console.log('not find');
} }
this.tryConsole=true this.tryConsole=true
}) })
// from mytable.vue and socket // from mytable.vue and socket
this.$root.$on('SERVER_hybrid_table_start', (v) => { this.$root.$on('SERVER_hybrid_table_start', (v) => {
this.$nextTick(function () { this.$nextTick(function () {

8
src/components/mynetwork/availablemicroservices.vue

@ -98,7 +98,7 @@
<div class="white h-100 flex-fixed-width-item" <div class="white h-100 flex-fixed-width-item"
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:key="vuetablekey" :key="vuetablekeyg"
:api-url='apiurl' :api-url='apiurl'
:api-mode="true" :api-mode="true"
:http-options="httpOptions" :http-options="httpOptions"
@ -241,7 +241,7 @@ export default {
showModal: false, showModal: false,
visibility: [], visibility: [],
active:false, active:false,
vuetablekey:0, vuetablekeyg:0,
fielddata:{}, fielddata:{},
fields: [ fields: [
{ {
@ -406,7 +406,7 @@ export default {
//console.log('resiiiiiiii yes '+JSON.stringify(this.testactionrowindex[index])) //console.log('resiiiiiiii yes '+JSON.stringify(this.testactionrowindex[index]))
}else{ }else{
//Vue.delete(this.testactionrowindex, index) //Vue.delete(this.testactionrowindex, index)
console.log('resi NO '+JSON.stringify(res)) console.log('resi NO2 '+JSON.stringify(res))
} }
} }
}, },
@ -603,7 +603,7 @@ export default {
}, },
refreshVuetable() { refreshVuetable() {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.vuetablekey += 1 this.vuetablekeyg += 1
}) })
}, },
playbookinfoShow(value) { playbookinfoShow(value) {

8
src/components/mynetwork/availableservices.vue

@ -98,7 +98,7 @@
<div class="white h-100 flex-fixed-width-item" <div class="white h-100 flex-fixed-width-item"
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:key="vuetablekey" :key="vuetablekeya"
:api-url='apiurl' :api-url='apiurl'
:api-mode="true" :api-mode="true"
:http-options="httpOptions" :http-options="httpOptions"
@ -241,7 +241,7 @@ export default {
showModal: false, showModal: false,
visibility: [], visibility: [],
active:false, active:false,
vuetablekey:0, vuetablekeya:0,
fielddata:{}, fielddata:{},
fields: [ fields: [
{ {
@ -406,7 +406,7 @@ export default {
//console.log('resiiiiiiii yes '+JSON.stringify(this.testactionrowindex[index])) //console.log('resiiiiiiii yes '+JSON.stringify(this.testactionrowindex[index]))
}else{ }else{
//Vue.delete(this.testactionrowindex, index) //Vue.delete(this.testactionrowindex, index)
console.log('resi NO '+JSON.stringify(res)) console.log('resi NO data '+JSON.stringify(res))
} }
} }
}, },
@ -603,7 +603,7 @@ export default {
}, },
refreshVuetable() { refreshVuetable() {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.vuetablekey += 1 this.vuetablekeya += 1
}) })
}, },
playbookinfoShow(value) { playbookinfoShow(value) {

15
src/components/mynetwork/availablestorage.vue

@ -364,39 +364,26 @@ export default {
obj.token = this.token obj.token = this.token
obj.instance = data.swarmlabname obj.instance = data.swarmlabname
var res1 = await store.dispatch('pipelineLLO/getstoragestatus', obj) var res1 = await store.dispatch('pipelineLLO/getstoragestatus', obj)
//console.log('res8 all '+JSON.stringify(res1))
if(res1.data.data == 'yes'){ if(res1.data.data == 'yes'){
Vue.set(this.testactionrowindex, data.swarmlabname, index) Vue.set(this.testactionrowindex, data.swarmlabname, index)
//console.log('res8 YES '+JSON.stringify(res1.data))
}else{ }else{
//console.log('res8 NO '+JSON.stringify(res1.data))
Vue.delete(this.testactionrowindex, data.swarmlabname) Vue.delete(this.testactionrowindex, data.swarmlabname)
} }
//console.log('is set '+index)
}else{ }else{
//console.log('not set '+index)
var obj = {} var obj = {}
obj.token = this.token obj.token = this.token
obj.instance = data.swarmlabname obj.instance = data.swarmlabname
var res = await store.dispatch('pipelineLLO/getservicesinfo', obj) var res = await store.dispatch('pipelineLLO/getservicesinfo', obj)
if(res.data.data == 'yes'){ if(res.data.data == 'yes'){
//console.log('resi YES '+JSON.stringify(res))
Vue.set(this.testactionrowindex, index, index) Vue.set(this.testactionrowindex, index, index)
var res1 = await store.dispatch('pipelineLLO/getstoragestatus', obj) var res1 = await store.dispatch('pipelineLLO/getstoragestatus', obj)
//console.log('res8 alli--- '+JSON.stringify(res1))
if(res1.data.data == 'yes'){ if(res1.data.data == 'yes'){
Vue.set(this.testactionrowindex, data.swarmlabname, index) Vue.set(this.testactionrowindex, data.swarmlabname, index)
//console.log('res8 YES '+JSON.stringify(res1.data))
}else{ }else{
//console.log('res8 NO '+JSON.stringify(res1.data))
Vue.delete(this.testactionrowindex, data.swarmlabname) Vue.delete(this.testactionrowindex, data.swarmlabname)
} }
//console.log('resiiiiiiii yes '+JSON.stringify(this.testactionrowindex[index]))
}else{ }else{
//Vue.delete(this.testactionrowindex, index) console.log('resi NO1 '+JSON.stringify(res))
console.log('resi NO '+JSON.stringify(res))
} }
} }
}, },

101
src/components/mynetwork/builderservices.vue

@ -51,7 +51,7 @@
<div class="white h-100 flex-fixed-width-item" <div class="white h-100 flex-fixed-width-item"
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:key="vuetablekey" :key="vuetablekeyl"
:api-url='apiurl' :api-url='apiurl'
:api-mode="true" :api-mode="true"
:http-options="httpOptions" :http-options="httpOptions"
@ -90,13 +90,15 @@
<div slot="actionslocal" slot-scope="props"> <div slot="actionslocal" slot-scope="props">
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center"
v-if="checkbuildrowindex(props.rowData,props.rowIndex)"
>
<button <button
v-if="build_file[props.rowData.name] == props.rowData.name" v-if="testactionrowindex[props.rowData.name] == props.rowIndex"
class="ti-trash btn btn-info btn-sm" class="ti-trash btn btn-info btn-sm"
title="Remove Lab_Instance" title="Remove Box_Instance"
@click="onAction('view-item', props.rowData, props.rowIndex)"
round round
@click="onAction('delete-item', props.rowData, props.rowIndex)"
> >
</button> </button>
</div> </div>
@ -146,6 +148,7 @@ export default {
playbookInfo: {}, playbookInfo: {},
token: '', token: '',
build_file :{}, build_file :{},
testactionrowindex:[], // downloaded used in installed
playbook: { playbook: {
'title':'', 'title':'',
'name':'', 'name':'',
@ -165,7 +168,8 @@ export default {
showModal: false, showModal: false,
visibility: [], visibility: [],
active:false, active:false,
vuetablekey:0, rmbox:{},
vuetablekeyl:0,
fielddata:{}, fielddata:{},
fields: [ fields: [
{ {
@ -371,6 +375,7 @@ export default {
}, },
async onAction (action, data, index) { async onAction (action, data, index) {
this.actionrowindex = index this.actionrowindex = index
this.rmbox = data
var obj = {} var obj = {}
obj.name = data.name obj.name = data.name
obj.dir = data.dir obj.dir = data.dir
@ -383,25 +388,81 @@ export default {
console.log('index '+JSON.stringify(index)) console.log('index '+JSON.stringify(index))
console.log('build info '+JSON.stringify(this.build_file)) console.log('build info '+JSON.stringify(this.build_file))
}else if(action == 'delete-item' ){ }else if(action == 'delete-item' ){
this.$swal({ var info = `
type: 'info', <b-container fluid>
html: info+winfo, <div class="row text-center">
showCloseButton: true, <div class="col-12">
showLoaderOnConfirm: false, <p class="mb-1 list-group-item list-group-item-success">
allowOutsideClick: false, Remove
cancelButtonText: 'No, cancel!', </p>
showCancelButton: true, </div> <!-- col -->
showLoaderOnConfirm: false, </div> <!-- row -->
reverseButtons: true, </b-container fluid>
focusCancel: true, `
confirmButtonText: 'Yes, Delete it!' this.$swal({
}) type: 'info',
html: info,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: true,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: false,
confirmButtonText: 'Remove the box! '
}).then((result)=> {
this.removeAndClose(result);
})
console.log('data da1 '+JSON.stringify(data))
}else if(action == 'run-item' ){ }else if(action == 'run-item' ){
} }
}, },
async removeAndClose(result){
var obj = {}
obj.instance = this.rmbox.name
obj.dir = this.rmbox.dir
obj.config = this.rmbox.config
if (result.isConfirmed) {
//console.log('value obj11111111111111111111111 '+ JSON.stringify(result))
var res1 = await store.dispatch('pipelineLLO/rmbuildstatus', obj)
console.log('value objdata111111111111111111 '+ JSON.stringify(res1))
if(res1.data.data == 'yes'){
Vue.delete(this.testactionrowindex, data.name)
Vue.nextTick( () => this.$refs.vuetable.refresh())
}
}else {
console.log('no')
}
},
async checkbuildrowindex(data,index){
if(this.testactionrowindex[index] == index){
var obj = {}
obj.token = this.token
obj.instance = data.name
var res1 = await store.dispatch('pipelineLLO/getbuildstatus', obj)
if(res1.data.data == 'yes'){
Vue.set(this.testactionrowindex, data.name, index)
}else{
Vue.delete(this.testactionrowindex, data.name)
}
console.log('resi NO3 '+JSON.stringify(this.testactionrowindex))
}else{
var obj = {}
obj.token = this.token
obj.instance = data.name
var res = await store.dispatch('pipelineLLO/getbuildstatus', obj)
if(res.data.data == 'yes'){
Vue.set(this.testactionrowindex, index, index)
}else{
Vue.delete(this.testactionrowindex, data.name)
}
console.log('resi NO2 '+JSON.stringify(this.testactionrowindex))
}
},
refreshVuetable() { refreshVuetable() {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.vuetablekey += 1 this.vuetablekeyl += 1
}) })
}, },
playbookinfoShow(value) { playbookinfoShow(value) {

6
src/components/mynetwork/dockerservices.vue

@ -51,7 +51,7 @@
<div class="white h-100 flex-fixed-width-item" <div class="white h-100 flex-fixed-width-item"
<vuetable <vuetable
ref="vuetable" ref="vuetable"
:key="vuetablekey" :key="vuetablekeyb"
:api-url='apiurl' :api-url='apiurl'
:api-mode="true" :api-mode="true"
:http-options="httpOptions" :http-options="httpOptions"
@ -149,7 +149,7 @@ export default {
showModal: false, showModal: false,
visibility: [], visibility: [],
active:false, active:false,
vuetablekey:0, vuetablekeyb:0,
fielddata:{}, fielddata:{},
fields: [ fields: [
{ {
@ -347,7 +347,7 @@ export default {
}, },
refreshVuetable() { refreshVuetable() {
this.$nextTick(()=>{ this.$nextTick(()=>{
this.vuetablekey += 1 this.vuetablekeyb += 1
}) })
}, },
playbookinfoShow(value) { playbookinfoShow(value) {

3
src/components/mynetwork/mybuilder.vue

@ -275,8 +275,6 @@ export default {
} }
}, },
beforeMount () { beforeMount () {
this.socketopen();
this.socketauthenticate()
//console.log('send') //console.log('send')
}, },
mounted() { mounted() {
@ -305,7 +303,6 @@ export default {
var log = store.dispatch("pipelineLLO/settoken",{ var log = store.dispatch("pipelineLLO/settoken",{
token:this.token token:this.token
}) })
this.socketopen();
}, },
beforeDestroy () { beforeDestroy () {

4
src/components/mynetwork/mytable.vue

@ -837,7 +837,7 @@ info +='This permits the docker user on the local machine to connect to X window
//this.hybridshowdata = {} //this.hybridshowdata = {}
}, },
async message_out(val) { async message_out(val) {
//console.log(" socket out "+JSON.stringify(val)) console.log(" socket out "+JSON.stringify(val))
this.$root.$emit('hybrid_log_in',val) this.$root.$emit('hybrid_log_in',val)
// refresh adhocview.vue on console await // refresh adhocview.vue on console await
this.$root.$emit('SERVER_hybrid_table_start') this.$root.$emit('SERVER_hybrid_table_start')
@ -849,7 +849,7 @@ info +='This permits the docker user on the local machine to connect to X window
this.$root.$emit('hybrid_log_in',val) this.$root.$emit('hybrid_log_in',val)
}, },
async message_close(val) { async message_close(val) {
//console.log(" socket close "+JSON.stringify(val)) console.log(" socket close "+JSON.stringify(val))
this.$root.$emit('hybrid_log_in',val) this.$root.$emit('hybrid_log_in',val)
// refresh table availableservices // refresh table availableservices
this.$root.$emit('hybrid_refresh_table') this.$root.$emit('hybrid_refresh_table')

56
src/store/modules/create_pipelineLLO.js

@ -518,6 +518,62 @@ export default {
return R; return R;
} }
} }
},
async rmbuildstatus({commit,rootGetters}, value) {
//console.log('valuei22222222222222222222222222222222 '+JSON.stringify(value))
try {
var token = value.token
var params = {
instance: value.instance
}
var options = {
params: params,
headers: { 'content-type': 'application/x-www-form-urlencoded',Authorization: `Bearer ${token}` },
};
var sock_server_l = ApiConfig.url_80+'/rmbuildstatus'
var p = await axios.get(sock_server_l,options);
//var p = await axios.get('https://localhost:3000/getservicesstatus',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 getbuildstatus({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value))
try {
var token = value.token
var params = {
instance: value.instance
}
var options = {
params: params,
headers: { 'content-type': 'application/x-www-form-urlencoded',Authorization: `Bearer ${token}` },
};
var sock_server_l = ApiConfig.url_80+'/getbuildstatus'
var p = await axios.get(sock_server_l,options);
//var p = await axios.get('https://localhost:3000/getservicesstatus',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 getstoragestatus({commit,rootGetters}, value) { async getstoragestatus({commit,rootGetters}, value) {
//console.log('value '+JSON.stringify(value)) //console.log('value '+JSON.stringify(value))

Loading…
Cancel
Save