Browse Source

version 1.0

master
zeus 3 years ago
parent
commit
ff307f274e
  1. BIN
      dist/img/warning.31d7a72d.png
  2. BIN
      dist/img/warning.f9cebb9b.png
  3. 2
      dist/index.html
  4. 2
      dist/js/app.4c082a6b.js
  5. 1
      dist/js/app.4c082a6b.js.map
  6. 2
      dist/js/app.6e97b28f.js
  7. 1
      dist/js/app.6e97b28f.js.map
  8. 15
      src-local/llo/new.js
  9. 33
      src/App.vue
  10. BIN
      src/assets/img/warning.png
  11. 655
      src/components/manageservices/join-service.vue
  12. 761
      src/components/manageservices/join-service.vue.backup
  13. 13
      src/components/mynetwork/myconnect-server.vue
  14. 32
      src/store/modules/create_pipelineLLO.js

BIN
dist/img/warning.31d7a72d.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
dist/img/warning.f9cebb9b.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

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.4c082a6b.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.4c082a6b.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.6e97b28f.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.6e97b28f.js"></script></body></html>

2
dist/js/app.4c082a6b.js

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

2
dist/js/app.6e97b28f.js

File diff suppressed because one or more lines are too long

1
dist/js/app.6e97b28f.js.map

File diff suppressed because one or more lines are too long

15
src-local/llo/new.js

@ -1203,6 +1203,21 @@ app.get('/getnetworks', (req, res, next) => {
}
}
var extenderrorm1 = new RegExp('^swlab');
for(var i = 0; i < datajson.length; i++) {
var NET = {}
var servicename1 = datajson[i].Name
if(extenderrorm1.test(servicename1)){
NET.ID = datajson[i].ID
NET.Name = datajson[i].Name
NET.NetworkMode = datajson1
NET.Scope = datajson[i].Scope
NET.Internal = datajson[i].Internal
NET.IPv6 = datajson[i].IPv6
networks.push(NET)
}
}
RES.error = false
RES.error_msg = "ok"
RES.data = networks;

33
src/App.vue

@ -26,7 +26,7 @@
<br>
<br>
To <u>connect to the server</u> please <i>visit the "Profile" Menu and click on "connect".</i>
To <u>connect to the server</u> and built on-demand network environments <i>visit the "https://git.swarmlab.io:3000/swarmlab/venus-client" and install "Venus".</i>
<br>
<br>
@ -121,7 +121,7 @@
<b-nav-item href="https://git.swarmlab.io:3000" target="_swarmlabgit"> Swarmlab_git </b-nav-item>
<b-nav-item href="http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs" target="_swarmlabgit"> Docs </b-nav-item>
<li class="nav-item">
<a class="nav-link" href="#">
-
@ -135,7 +135,9 @@
-
</a>
</li>
<!--
<b-nav-item href="https://gitter.im/swarmlab-hybrid/community" target="_gitter"> Join_us_on_Gitter </b-nav-item>
-->
<b-nav-item href="https://vimeo.com/showcase/7887267" target="_vimeo"> Follow_us_on_Vimeo </b-nav-item>
</ul>
@ -171,6 +173,7 @@
</li>
<!-- --------------- socket connection -->
<!-- --------------- wg connection -->
<!--
<b-nav-item >Server</b-nav-item>
<li class="nav-item"
v-if="isconnect!==true"
@ -192,6 +195,7 @@
>
</a>
</li>
-->
<!-- --------------- wg connection -->
<b-nav-item > </b-nav-item>
</ul>
@ -226,15 +230,18 @@
</b-collapse>
<!-- Menou Settings -->
<!--
<b-list-group-item v-b-toggle.hybrid-profile variant="light" name="Local" class="ti-user list-group-item list-group-item-action" v-on:click="setActive('profile','')" style="cursor: pointer;" :class="{ active: isActive('profile') }" @click="hybrid('connect-server')" > Profile</b-list-group-item>
<b-collapse id="hybrid-profile" class="m-subm" accordion="m-sidebar" role="tabpanel">
-->
<!--
<b-list-group-item variant="light" name="profile" class="ti-pencil-alt m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('profile','profile_profile')" style="cursor: pointer;" :class="{ active: isActiveSub('profile_profile') } " > Local</b-list-group-item>
-->
<!--
<b-list-group-item variant="light" name="Settings" class="ti-pencil-alt m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('settings','profile_settings')" style="cursor: pointer;" :class="{ active: isActiveSub('profile_settings') }" @click="hybrid('connect-server')"> Settings</b-list-group-item>
</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>
@ -243,13 +250,14 @@
</b-collapse>
<!-- Menou hybrid -->
<b-list-group-item v-b-toggle.hybrid-hybrid variant="light" name="Local" class="ti-loop list-group-item list-group-item-action" v-on:click="setActive('hybrid','')" style="cursor: pointer;" :class="{ active: isActive('hybrid') }" @click="hybrid('manage_service')" > Hybrid/Public</b-list-group-item>
<b-list-group-item v-b-toggle.hybrid-hybrid variant="light" name="Local" class="ti-share list-group-item list-group-item-action" v-on:click="setActive('hybrid','')" style="cursor: pointer;" :class="{ active: isActive('hybrid') }" @click="hybrid('manage_service')" > Share</b-list-group-item>
<!--
<b-collapse id="hybrid-hybrid" class="m-subm" accordion="m-sidebar" role="tabpanel">
<b-list-group-item variant="light" name="Hybrid" class="ti-target m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('hybrid','hybrid_instances')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_instances') }" @click="hybrid('manage_service')"> Join</b-list-group-item>
<b-list-group-item variant="light" name="Deploy" class="ti-cloud-up m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('hybrid','hybrid_deploy')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_deploy') }" @click="hybrid('manage_deploy')"> Deploy</b-list-group-item>
</b-collapse>
-->
@ -265,7 +273,7 @@
<!-- 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')" > Builders</b-list-group-item>
<b-list-group-item v-b-toggle.hybrid-builders variant="light" name="Private" class="ti-settings list-group-item list-group-item-action" v-on:click="setActive('builders','')" style="cursor: pointer;" :class="{ active: isActive('builders') }" @click="hybrid('builders')" > Builders</b-list-group-item>
<b-collapse id="hybrid-builders" 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')"> VM</b-list-group-item>
@ -313,12 +321,13 @@
</b-collapse>
<!-- Menou Settings -->
<!--
<b-list-group-item v-b-toggle.hybrid-profile1 variant="light" name="Local" class="ti-user list-group-item list-group-item-action" v-on:click="setActive('profile','')" style="cursor: pointer;" :class="{ active: isActive('profile') }" @click="hybrid('connect-server')" title="Profile" > </b-list-group-item>
<b-collapse id="hybrid-profile1" class="m-subm" accordion="m-sidebar" role="tabpanel">
<b-list-group-item variant="light" name="Settings" class="ti-pencil-alt m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('settings','profile_settings')" style="cursor: pointer;" :class="{ active: isActiveSub('profile_settings') }" @click="hybrid('connect-server')" title="Profile"> </b-list-group-item>
</b-collapse>
-->
<!-- Menou container -->
<b-list-group-item v-b-toggle.hybrid-container1 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')" title="Instances"> </b-list-group-item>
@ -329,13 +338,13 @@
<!-- Menou hybrid -->
<b-list-group-item v-b-toggle.hybrid-hybrid1 variant="light" name="Local" class="ti-loop list-group-item list-group-item-action" v-on:click="setActive('hybrid','')" style="cursor: pointer;" :class="{ active: isActive('hybrid') }" @click="hybrid('manage_service')" title="Hybrid" > </b-list-group-item>
<b-list-group-item v-b-toggle.hybrid-hybrid1 variant="light" name="Local" class="ti-share list-group-item list-group-item-action" v-on:click="setActive('hybrid','')" style="cursor: pointer;" :class="{ active: isActive('hybrid') }" @click="hybrid('manage_service')" title="Share" > </b-list-group-item>
<!--
<b-collapse id="hybrid-hybrid1" class="m-subm" accordion="m-sidebar" role="tabpanel">
<b-list-group-item variant="light" name="Hybrid" class="ti-target m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('hybrid','hybrid_instances')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_instances') }" @click="hybrid('manage_service')" title="Zones"> </b-list-group-item>
<b-list-group-item variant="light" name="Deploy" class="ti-cloud-up m-subm-listgroup list-group-item list-group-item-action" v-on:click="setActive('hybrid','hybrid_deploy')" style="cursor: pointer;" :class="{ active: isActiveSub('hybrid_deploy') }" @click="hybrid('manage_deploy')" title="Deploy"> </b-list-group-item>
</b-collapse>
-->
<!-- Menou private -->
@ -350,7 +359,7 @@
<!-- 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-settings 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-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>
@ -663,7 +672,7 @@ export default {
var info="Status<br>"
info+="Agent is " + socketStatus+"<br>"
info+="Server is " + serverStatus
//info+="Server is " + serverStatus
this.$swal({
type: 'info',

BIN
src/assets/img/warning.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

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

@ -5,290 +5,70 @@
</div>
<v-wait for="myRunInstancetutor">
<template slot="waiting">
<div>
<img src="@/assets/loading.gif" />
Enter Lab_room...
</div>
</template>
</v-wait>
<b-container fluid>
<div class="row text-center">
<div class="col-12">
<b>Swarmlab hybrid Join</b>
</div>
</div>
<br>
<div class="row" >
<div class="col-3 text-info" >
<div class="input-group-prepend">
<button
class="btn btn-outline-success"
round
type="button"
@click="onActionHybrid('stack-start')"
v-if="hybridshowdata.bootstrapstackname && hybridshowdata.status"
>
Start Stack
</button>
</div>
</div>
<div class="col-3 text-info" >
<div class="input-group-prepend">
<button
class="btn btn-outline-danger"
round
type="button"
@click="onActionHybrid('stack-stop')"
v-if="hybridshowdata.bootstrapstackname && hybridshowdata.status"
>
Leave Stack
</button>
</div>
</div>
<div class="col-3 text-info" >
<div class="input-group-prepend">
<!--
<button
class="btn btn-outline-danger"
round
type="button"
@click="onActionHybrid('service-stop')"
v-if="hybridshowdata.bootstrapnameid && hybridshowdata.status"
>
Remove Service
</button>
-->
</div>
</div>
<div class="col-3 text-info" >
<div class="input-group-prepend">
<button
class="btn btn-outline-info"
round
type="button"
v-if="hybridshowdata.bootstrapstackname"
@click="onActionHybrid('service-info')"
>
Service Info
</button>
</div>
</div>
</div> <!-- row -->
<div class="row"
v-if="hybridshowdata.bootstrapstackname"
>
<div class="col-2 text-info"
>
Instances
</div>
<div class="col-3 text-secondary" >
{{ hybridshowdata.Replicas }}
</div>
<div class="col-2 text-info" >
Image
</div>
<div class="col-4 text-secondary" >
{{ hybridshowdata.bootstrapimage }}
</div>
</div> <!-- row -->
<div class="row"
v-if="hybridshowdata.bootstrapstackname"
>
<div class="col-2 text-info" >
Names
</div>
<div class="col-3 text-secondary" >
{{ hybridshowdata.bootstrapname }}
</div>
<div class="col-2 text-info" >
EndAt
</div>
<div class="col-4 text-secondary" >
{{ hybridshowdata.bootstrapdateend }}
</div>
</div> <!-- row -->
<div class="row"
v-if="hybridshowdata.bootstrapstackname"
>
<div class="col-2 text-info" >
Networks
</div>
<div class="col-3 text-secondary" >
{{ hybridshowdata.bootstrapnetwork }}
</div>
<div class="col-2 text-info" >
BeginAt
</div>
<div class="col-4 text-secondary" >
{{ hybridshowdata.bootstrapdatebegin }}
</div>
</div> <!-- row -->
<div class="row"
v-if="hybridshowdata.bootstrapstackname"
>
<div class="col-2 text-info" >
Status
</div>
<div class="col-3 text-secondary"
v-if="hybridshowdata.status"
>
<span class="ti-check text-success"> </span>
</div>
<div class="col-3 text-secondary"
v-else
>
<span> </span>
</div>
<div class="col-2 text-info" >
Ports
</div>
<div class="col-4 text-secondary"
v-if="hybridshowdata.ports!=0"
>
{{ hybridshowdata.ports }}
</div>
<div class="col-4 text-secondary"
v-else
>
</div>
</div> <!-- row -->
</b-container>
<b-container fluid class="bv-example-row">
<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 StackName"
v-model="searchFor"
@keyup.enter="setFilter"
>
<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="vuetablekey1"
: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="actionslocal" slot-scope="props">
<div class="d-flex justify-content-center">
<button
v-if="testactionrowindex[props.rowData.bootstrapnameid]"
class="ti-thumb-up btn btn-info btn-sm"
title="Remove Stack"
disabled
round
>
</button>
<button
v-else
class="ti-thumb-down btn btn-secondary btn-sm"
title="Remove Stack"
disabled
round
>
</button>
</div>
</div>
<div slot="actions" slot-scope="props">
<div class="d-flex justify-content-center">
<button
v-if="actionrowindex == props.rowIndex"
class="ti-more-alt btn btn-secondary btn-sm"
round
@click="onAction('run-more', props.rowData, props.rowIndex)">
</button>
<button
v-else
class="ti-more btn btn-outline-secondary btn-sm"
round
@click="onAction('run-more', props.rowData, props.rowIndex)">
</button>
<div class="card text-center">
<div class="card-header">
</div>
<div class="card-body">
<h2 class="card-title">
share with your friends or clients
</h2>
<br>
<p class="card-text">
<h4>Swarmlab uses VENUS to create virtual networks and ensure your data safety. <br>If you choose to proceed VENUS will have to be installed on your PC.</h4>
</p>
<a href="https://git.swarmlab.io:3000/swarmlab/venus-client" target="newwindow" class="btn btn-primary">Get VENUS here</a>
</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 class="card-footer text-muted">
<b>VENUS is an open source service developed and maintained by the swarmlab team.
</b>
<br>
<br>
<h5>
Safety is ensured using wireguard.
</h5>
</div>
</div>
<div class="row" >
<div class="col-1 text-secondary" >
</div>
</b-container>
<div class="col-10 text-secondary" >
<br>
</div>
<div class="col-1 text-secondary" >
</div>
</div> <!-- row -->
</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
card
},
props: {
},
@ -312,137 +92,11 @@ export default {
},
pipeline:{},
selected: 'hybrid',
options: [
{ text: 'Packages', value: 'packages' },
{ text: 'Images', value: 'images' },
{ text: 'Scripts', value: 'scripts' }
],
showModal: false,
visibility: [],
active:false,
vuetablekey1:0,
fielddata:{},
fields: [
{
name: 'bootstrapname',
title: '<span class="orange"></span>Name',
sortField: 'bootstrapname',
visible:true,
dataClass: 'text-left text-wrap text-break break-word',
width: '15%'
},
{
name: 'bootstrapstackname',
title: '<span class="orange"></span>StackName',
sortField: 'bootstrapstackname',
visible:true,
dataClass: 'left aligned w-25',
width: '10%'
},
{
name: 'bootstrapstackid',
title: '<span class="orange"></span>StackID',
sortField: 'bootstrapstackid',
visible:true,
dataClass: 'left aligned w-25',
width: '15%',
callback: value => {
//console.log(this)
//console.log(this.fielddata)
for(var i = 0; i < this.fielddata.length; i++) {
//call function here
var servicename = this.fielddata[i].bootstrapstackid
//console.log(JSON.stringify(servicename))
if(servicename == value){
var obj = {}
obj.bootstrapnameid = this.fielddata[i].bootstrapnameid
obj.bootstrapstackname = this.fielddata[i].bootstrapstackname
this.checkactionrowindex(obj)
//console.log(JSON.stringify('status '+JSON.stringify(this.fielddata[i])))
}
}
return value
}
},
{
name: '_id',
title: '<span class="orange"></span>mongo',
visible:false
},
{
name: 'bootstrapdatebegin5',
title: '<span class="orange"></span>Begin',
sortField: 'bootstrapdatebegin5',
titleClass: 'center aligned',
visible:true,
width: '10%'
},
{
name: 'bootstrapusersjoin',
title: '<span class="orange"></span>Public',
sortField: 'bootstrapusersjoin',
titleClass: 'center aligned',
visible:true,
width: '5%',
callback: function(value) {
if (value == true) {
var v = '<span class="ti-check text-success"> </span>'
return v
}else{
var v = '<span> </span>'
return v
}
}
},
{
name: 'status',
title: '<span class="orange"></span>Status',
sortField: 'status',
titleClass: 'center aligned',
visible:true,
width: '5%',
callback: function(value) {
if (value == true) {
var v = '<span class="ti-check text-success"> </span>'
return v
}else{
var v = '<span> </span>'
return v
}
}
},
{
name: 'ID',
sortField: 'ID',
titleClass: 'center aligned',
dataClass: 'left aligned w-25',
visible:false,
width: '15%'
},
{
name: '__slot:actionslocal', // <----
title: ' Join',
titleClass: 'center aligned',
dataClass: 'center aligned',
width: '5%',
callback: 'getstatus'
},
{
name: '__slot:actions', // <----
title: 'Actions',
titleClass: 'center aligned',
dataClass: 'center aligned',
width: '5%'
}
],
apiurl:ApiConfig.swarmlab_url_80+"/swarmlabhybridbootstrapservicesall",
//apiurl:ApiConfig.swarmlab_url_80+"/swarmlabhybridservices",
css: CssConfig,
perpage: 10,
searchFor: '',
sortOrder: [{
@ -450,24 +104,9 @@ export default {
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': '',
'type': 'scripts',
'tutor': 'yes'
},
}
},
mounted() {
this.$root.$on('hybrid_refresh_bootstrap_view', () => {
Vue.nextTick( () => this.$refs.vuetable.refresh())
})
},
created() {
var url_string = window.location.href
@ -477,228 +116,12 @@ export default {
},
beforeDestroy () {
this.$root.$off('hybrid_refresh_bootstrap_view')
},
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 checkactionrowindex(data){
var obj = {}
obj.token = this.token
obj.bootstrapnameid = data.bootstrapnameid
obj.bootstrapstackname = data.bootstrapstackname
var res1 = await store.dispatch('pipelineLLO/getserviceshybridstatus', obj)
var index = data.bootstrapnameid
if(res1.data.data == 'yes'){
Vue.set(this.testactionrowindex, data.bootstrapnameid, index)
//console.log('res8 YES '+JSON.stringify(res1.data))
}else{
//console.log('res8 NO '+JSON.stringify(res1.data))
Vue.delete(this.testactionrowindex, data.bootstrapnameid)
}
//console.log('res8 all '+JSON.stringify(this.testactionrowindex))
},
async onActionHybrid(action) {
//var logconfig = await store.getters['pipelineLLO/getconfig'];
this.CONFIG = await store.getters['pipelineLLO/getstatusswarmlab'];
if(this.CONFIG.hybrid == 'Online'){
this.isstatus = true
}else{
this.isstatus = false
}
//console.log('stack-start1 ' + JSON.stringify(this.CONFIG))
//console.log('stack-start3 ' + JSON.stringify(logconfig1))
if(action == 'stack-stop' ){
var info='<h5>This will leave the stack with the name<b> '+ this.hybridshowdata.bootstrapstackname +'</b> </h5>'
this.$swal({
type: 'Info',
title: 'Info!',
icon:'warning',
html: info,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: true,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true,
confirmButtonText: 'Ok!'
}).then((result)=> {
this.onActionHybrid_stackrm(result);
})
}else if(action == 'stack-start' ){
//console.log('stack-start')
if(this.isstatus == '1'){
//console.log(this.isstatus)
var log = await store.dispatch("pipelineLLO/hybrid_join",{
token:this.token,
node:this.CONFIG.swarmlabid,
bootstrapstackid:this.hybridshowdata.bootstrapstackid,
bootstrapnameid:this.hybridshowdata.bootstrapnameid
})
Vue.nextTick( () => this.$refs.vuetable.refresh())
}else{
}
}else if(action == 'service-info' ){
//console.log(JSON.stringify(action))
//console.log('CONFIG '+JSON.stringify(this.hybridshowdata))
var url = this.hybridshowdata.bootstrapurl
var info=`<h5>You will be redirected to the README page of the repository (OUTSIDE Swarmlab-Hybrid)<br>
<a href="${url}" target="new">click here to continue</a>
</h5>
<br>
`
this.$swal({
type: 'Info',
title: 'README',
icon:'info',
html: info,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: false,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true,
confirmButtonText: 'Ok!'
})
}
},
async onActionHybrid_stackrm(action) {
//console.log(JSON.stringify(action))
if(action.isConfirmed){
if(this.isstatus == '1'){
var log = await store.dispatch("pipelineLLO/hybrid_leave",{
token:this.token,
node:this.CONFIG.swarmlabid,
bootstrapstackid:this.hybridshowdata.bootstrapstackid,
bootstrapnameid:this.hybridshowdata.bootstrapnameid
})
Vue.nextTick( () => this.$refs.vuetable.refresh())
}else{
}
}
},
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,
'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 onAction (action, data, index) {
this.actionrowindex = index
//this.$root.$emit('hybrid_show_info',data)
//console.log('index '+this.actionrowindex)
if(action == 'view-item' ){
}else if(action == 'run-more' ){
this.hybridshowdata = data
//console.log('hybrid '+JSON.stringify(data))
}else if(action == 'delete-item' ){
this.$swal({
type: 'info',
html: info+winfo,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: true,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true,
confirmButtonText: 'Yes, Delete it!'
})
}else if(action == 'run-item' ){
}
},
refreshVuetable() {
this.$nextTick(()=>{
this.vuetablekey1 += 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
//console.log('data1 '+JSON.stringify(response))
},
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')
}
}
},

761
src/components/manageservices/join-service.vue.backup

@ -0,0 +1,761 @@
<template>
<card class="card-user" style="max-height:100%">
<div class="author">
<img class="avatar border-white" src="@/assets/img/hybrid-1.png" alt="...">
</div>
<v-wait for="myRunInstancetutor">
<template slot="waiting">
<div>
<img src="@/assets/loading.gif" />
Enter Lab_room...
</div>
</template>
</v-wait>
<b-container fluid>
<div class="row text-center">
<div class="col-12">
<b>Swarmlab hybrid Join</b>
</div>
</div>
<br>
<div class="row" >
<div class="col-3 text-info" >
<div class="input-group-prepend">
<button
class="btn btn-outline-success"
round
type="button"
@click="onActionHybrid('stack-start')"
v-if="hybridshowdata.bootstrapstackname && hybridshowdata.status"
>
Start Stack
</button>
</div>
</div>
<div class="col-3 text-info" >
<div class="input-group-prepend">
<button
class="btn btn-outline-danger"
round
type="button"
@click="onActionHybrid('stack-stop')"
v-if="hybridshowdata.bootstrapstackname && hybridshowdata.status"
>
Leave Stack
</button>
</div>
</div>
<div class="col-3 text-info" >
<div class="input-group-prepend">
<!--
<button
class="btn btn-outline-danger"
round
type="button"
@click="onActionHybrid('service-stop')"
v-if="hybridshowdata.bootstrapnameid && hybridshowdata.status"
>
Remove Service
</button>
-->
</div>
</div>
<div class="col-3 text-info" >
<div class="input-group-prepend">
<button
class="btn btn-outline-info"
round
type="button"
v-if="hybridshowdata.bootstrapstackname"
@click="onActionHybrid('service-info')"
>
Service Info
</button>
</div>
</div>
</div> <!-- row -->
<div class="row"
v-if="hybridshowdata.bootstrapstackname"
>
<div class="col-2 text-info"
>
Instances
</div>
<div class="col-3 text-secondary" >
{{ hybridshowdata.Replicas }}
</div>
<div class="col-2 text-info" >
Image
</div>
<div class="col-4 text-secondary" >
{{ hybridshowdata.bootstrapimage }}
</div>
</div> <!-- row -->
<div class="row"
v-if="hybridshowdata.bootstrapstackname"
>
<div class="col-2 text-info" >
Names
</div>
<div class="col-3 text-secondary" >
{{ hybridshowdata.bootstrapname }}
</div>
<div class="col-2 text-info" >
EndAt
</div>
<div class="col-4 text-secondary" >
{{ hybridshowdata.bootstrapdateend }}
</div>
</div> <!-- row -->
<div class="row"
v-if="hybridshowdata.bootstrapstackname"
>
<div class="col-2 text-info" >
Networks
</div>
<div class="col-3 text-secondary" >
{{ hybridshowdata.bootstrapnetwork }}
</div>
<div class="col-2 text-info" >
BeginAt
</div>
<div class="col-4 text-secondary" >
{{ hybridshowdata.bootstrapdatebegin }}
</div>
</div> <!-- row -->
<div class="row"
v-if="hybridshowdata.bootstrapstackname"
>
<div class="col-2 text-info" >
Status
</div>
<div class="col-3 text-secondary"
v-if="hybridshowdata.status"
>
<span class="ti-check text-success"> </span>
</div>
<div class="col-3 text-secondary"
v-else
>
<span> </span>
</div>
<div class="col-2 text-info" >
Ports
</div>
<div class="col-4 text-secondary"
v-if="hybridshowdata.ports!=0"
>
{{ hybridshowdata.ports }}
</div>
<div class="col-4 text-secondary"
v-else
>
</div>
</div> <!-- row -->
</b-container>
<b-container fluid class="bv-example-row">
<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 StackName"
v-model="searchFor"
@keyup.enter="setFilter"
>
<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="vuetablekey1"
: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="actionslocal" slot-scope="props">
<div class="d-flex justify-content-center">
<button
v-if="testactionrowindex[props.rowData.bootstrapnameid]"
class="ti-thumb-up btn btn-info btn-sm"
title="Remove Stack"
disabled
round
>
</button>
<button
v-else
class="ti-thumb-down btn btn-secondary btn-sm"
title="Remove Stack"
disabled
round
>
</button>
</div>
</div>
<div slot="actions" slot-scope="props">
<div class="d-flex justify-content-center">
<button
v-if="actionrowindex == props.rowIndex"
class="ti-more-alt btn btn-secondary btn-sm"
round
@click="onAction('run-more', props.rowData, props.rowIndex)">
</button>
<button
v-else
class="ti-more btn btn-outline-secondary btn-sm"
round
@click="onAction('run-more', props.rowData, props.rowIndex)">
</button>
</div>
</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{
testactionrowindex:[], // joined
actionrowindex:'',
playbookInfo: {},
hybridshowdata:{},
token: '',
CONFIG: {},
isstatus:'',
playbook: {
'title':'',
'name':'',
'description':''
},
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,
vuetablekey1:0,
fielddata:{},
fields: [
{
name: 'bootstrapname',
title: '<span class="orange"></span>Name',
sortField: 'bootstrapname',
visible:true,
dataClass: 'text-left text-wrap text-break break-word',
width: '15%'
},
{
name: 'bootstrapstackname',
title: '<span class="orange"></span>StackName',
sortField: 'bootstrapstackname',
visible:true,
dataClass: 'left aligned w-25',
width: '10%'
},
{
name: 'bootstrapstackid',
title: '<span class="orange"></span>StackID',
sortField: 'bootstrapstackid',
visible:true,
dataClass: 'left aligned w-25',
width: '15%',
callback: value => {
//console.log(this)
//console.log(this.fielddata)
for(var i = 0; i < this.fielddata.length; i++) {
//call function here
var servicename = this.fielddata[i].bootstrapstackid
//console.log(JSON.stringify(servicename))
if(servicename == value){
var obj = {}
obj.bootstrapnameid = this.fielddata[i].bootstrapnameid
obj.bootstrapstackname = this.fielddata[i].bootstrapstackname
this.checkactionrowindex(obj)
//console.log(JSON.stringify('status '+JSON.stringify(this.fielddata[i])))
}
}
return value
}
},
{
name: '_id',
title: '<span class="orange"></span>mongo',
visible:false
},
{
name: 'bootstrapdatebegin5',
title: '<span class="orange"></span>Begin',
sortField: 'bootstrapdatebegin5',
titleClass: 'center aligned',
visible:true,
width: '10%'
},
{
name: 'bootstrapusersjoin',
title: '<span class="orange"></span>Public',
sortField: 'bootstrapusersjoin',
titleClass: 'center aligned',
visible:true,
width: '5%',
callback: function(value) {
if (value == true) {
var v = '<span class="ti-check text-success"> </span>'
return v
}else{
var v = '<span> </span>'
return v
}
}
},
{
name: 'status',
title: '<span class="orange"></span>Status',
sortField: 'status',
titleClass: 'center aligned',
visible:true,
width: '5%',
callback: function(value) {
if (value == true) {
var v = '<span class="ti-check text-success"> </span>'
return v
}else{
var v = '<span> </span>'
return v
}
}
},
{
name: 'ID',
sortField: 'ID',
titleClass: 'center aligned',
dataClass: 'left aligned w-25',
visible:false,
width: '15%'
},
{
name: '__slot:actionslocal', // <----
title: ' Join',
titleClass: 'center aligned',
dataClass: 'center aligned',
width: '5%',
callback: 'getstatus'
},
{
name: '__slot:actions', // <----
title: 'Actions',
titleClass: 'center aligned',
dataClass: 'center aligned',
width: '5%'
}
],
apiurl:ApiConfig.swarmlab_url_80+"/swarmlabhybridbootstrapservicesall",
//apiurl:ApiConfig.swarmlab_url_80+"/swarmlabhybridservices",
css: CssConfig,
perpage: 10,
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': '',
'type': 'scripts',
'tutor': 'yes'
},
}
},
mounted() {
this.$root.$on('hybrid_refresh_bootstrap_view', () => {
Vue.nextTick( () => this.$refs.vuetable.refresh())
})
},
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_bootstrap_view')
},
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 checkactionrowindex(data){
var obj = {}
obj.token = this.token
obj.bootstrapnameid = data.bootstrapnameid
obj.bootstrapstackname = data.bootstrapstackname
var res1 = await store.dispatch('pipelineLLO/getserviceshybridstatus', obj)
var index = data.bootstrapnameid
if(res1.data.data == 'yes'){
Vue.set(this.testactionrowindex, data.bootstrapnameid, index)
//console.log('res8 YES '+JSON.stringify(res1.data))
}else{
//console.log('res8 NO '+JSON.stringify(res1.data))
Vue.delete(this.testactionrowindex, data.bootstrapnameid)
}
//console.log('res8 all '+JSON.stringify(this.testactionrowindex))
},
async onActionHybrid(action) {
//var logconfig = await store.getters['pipelineLLO/getconfig'];
this.CONFIG = await store.getters['pipelineLLO/getstatusswarmlab'];
if(this.CONFIG.hybrid == 'Online'){
this.isstatus = true
}else{
this.isstatus = false
}
//console.log('stack-start1 ' + JSON.stringify(this.CONFIG))
//console.log('stack-start3 ' + JSON.stringify(logconfig1))
if(action == 'stack-stop' ){
var info='<h5>This will leave the stack with the name<b> '+ this.hybridshowdata.bootstrapstackname +'</b> </h5>'
this.$swal({
type: 'Info',
title: 'Info!',
icon:'warning',
html: info,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: true,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true,
confirmButtonText: 'Ok!'
}).then((result)=> {
this.onActionHybrid_stackrm(result);
})
}else if(action == 'stack-start' ){
//console.log('stack-start')
if(this.isstatus == '1'){
//console.log(this.isstatus)
var log = await store.dispatch("pipelineLLO/hybrid_join",{
token:this.token,
node:this.CONFIG.swarmlabid,
bootstrapstackid:this.hybridshowdata.bootstrapstackid,
bootstrapnameid:this.hybridshowdata.bootstrapnameid
})
Vue.nextTick( () => this.$refs.vuetable.refresh())
}else{
}
}else if(action == 'service-info' ){
//console.log(JSON.stringify(action))
//console.log('CONFIG '+JSON.stringify(this.hybridshowdata))
var url = this.hybridshowdata.bootstrapurl
var info=`<h5>You will be redirected to the README page of the repository (OUTSIDE Swarmlab-Hybrid)<br>
<a href="${url}" target="new">click here to continue</a>
</h5>
<br>
`
this.$swal({
type: 'Info',
title: 'README',
icon:'info',
html: info,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: false,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true,
confirmButtonText: 'Ok!'
})
}
},
async onActionHybrid_stackrm(action) {
//console.log(JSON.stringify(action))
if(action.isConfirmed){
if(this.isstatus == '1'){
var log = await store.dispatch("pipelineLLO/hybrid_leave",{
token:this.token,
node:this.CONFIG.swarmlabid,
bootstrapstackid:this.hybridshowdata.bootstrapstackid,
bootstrapnameid:this.hybridshowdata.bootstrapnameid
})
Vue.nextTick( () => this.$refs.vuetable.refresh())
}else{
}
}
},
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,
'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 onAction (action, data, index) {
this.actionrowindex = index
//this.$root.$emit('hybrid_show_info',data)
//console.log('index '+this.actionrowindex)
if(action == 'view-item' ){
}else if(action == 'run-more' ){
this.hybridshowdata = data
//console.log('hybrid '+JSON.stringify(data))
}else if(action == 'delete-item' ){
this.$swal({
type: 'info',
html: info+winfo,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: true,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true,
confirmButtonText: 'Yes, Delete it!'
})
}else if(action == 'run-item' ){
}
},
refreshVuetable() {
this.$nextTick(()=>{
this.vuetablekey1 += 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
//console.log('data1 '+JSON.stringify(response))
},
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);
}
}
pre {
//background-color: rgb(255, 247, 229);
background-color: #eff0f1;
border: 1px solid blue;
//white-space: pre-line;
}
</style>

13
src/components/mynetwork/myconnect-server.vue

@ -62,14 +62,6 @@
</div>
<div class="input-group-prepend">
<button
class="ti-widget btn btn-outline-info"
round
type="button"
title="Save config"
@click="onAction('vpn')"
> Create vpn
</button>
</div>
</div>
@ -309,11 +301,6 @@ export default {
reverseButtons: true,
focusCancel: true
})
}else if(action == 'vpn'){
var log = await store.dispatch("pipelineLLO/create_vpn",{
value:this.CONFIG
})
console.log('start vpn ' + JSON.stringify(log))
}else if(action == 'save'){
var log = await store.dispatch("pipelineLLO/create_config",{
token:this.token,

32
src/store/modules/create_pipelineLLO.js

@ -1192,38 +1192,6 @@ export default {
}
}
},
async create_vpn ({commit,rootGetters}, value) {
try {
var token = rootGetters['pipelineLLO/gettoken']
var params = {
wg: value.value
}
var options = {
headers: { 'content-type': 'application/x-www-form-urlencoded',Authorization: `Bearer ${token}` },
};
var p = await axios.post('https://api.swarmlab.io/addwghybridiserver',params,options);
if(p.error == "invalid_token"){
console.log(p)
//console.log(JSON.stringify(p))
}else{
}
//console.log(value.token)
//console.log(value.swarmlabname)
//console.log(JSON.stringify(p))
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_servicelog({commit,rootGetters}, value) {
try {
var token = value.token

Loading…
Cancel
Save