Browse Source

add instances

master
zeus 4 years ago
parent
commit
7d1c7174b2
  1. 2
      dist/index.html
  2. 2
      dist/js/app.cfdcf3b1.js
  3. 1
      dist/js/app.cfdcf3b1.js.map
  4. 2
      dist/js/app.d3524308.js
  5. 1
      dist/js/app.d3524308.js.map
  6. 23
      src-local/llo/new.js
  7. 10
      src/components/mynetwork/availableservices.vue
  8. 30
      src/store/modules/create_pipelineLLO.js

2
dist/index.html

@ -1 +1 @@
<!DOCTYPE html><html><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.6543e159.css" rel="preload" as="style"><link href="/css/chunk-vendors.8f6b4875.css" rel="preload" as="style"><link href="/js/app.d3524308.js" rel="preload" as="script"><link href="/js/chunk-vendors.07104166.js" rel="preload" as="script"><link href="/css/chunk-vendors.8f6b4875.css" rel="stylesheet"><link href="/css/app.6543e159.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.07104166.js"></script><script src="/js/app.d3524308.js"></script></body></html>
<!DOCTYPE html><html><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.6543e159.css" rel="preload" as="style"><link href="/css/chunk-vendors.8f6b4875.css" rel="preload" as="style"><link href="/js/app.cfdcf3b1.js" rel="preload" as="script"><link href="/js/chunk-vendors.07104166.js" rel="preload" as="script"><link href="/css/chunk-vendors.8f6b4875.css" rel="stylesheet"><link href="/css/app.6543e159.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.07104166.js"></script><script src="/js/app.cfdcf3b1.js"></script></body></html>

2
dist/js/app.cfdcf3b1.js

File diff suppressed because one or more lines are too long

1
dist/js/app.cfdcf3b1.js.map

File diff suppressed because one or more lines are too long

2
dist/js/app.d3524308.js

File diff suppressed because one or more lines are too long

1
dist/js/app.d3524308.js.map

File diff suppressed because one or more lines are too long

23
src-local/llo/new.js

@ -330,6 +330,29 @@ app.get('/getservicesstatus', (req, res, next) => {
});
app.get('/rm_swarmlab', (req, res, next) => {
var mypath = process.cwd()
var RES = new Object();
RES.instance = req.query["instance"]
var services_path = './instance/'+RES.instance
fs.rm(services_path, {
recursive: true,
force: true
}, (error) => {
if (error) {
RES.error = true
RES.error_msg = "no"
res.json(RES)
} else {
RES.error = false
RES.error_msg = "ok"
res.json(RES)
}
});
});
app.get('/get_config', (req, res, next) => {
var mypath = process.cwd()

10
src/components/mynetwork/availableservices.vue

@ -146,6 +146,7 @@
v-if="testactionrowindex[props.rowIndex] == props.rowIndex"
class="ti-trash btn btn-info btn-sm"
title="Remove Lab_Instance"
@click="onAction('rm-install', props.rowData, props.rowIndex)"
round
>
</button>
@ -471,7 +472,15 @@ export default {
confirmButtonText: 'Yes, Delete it!'
})
Vue.nextTick( () => this.$refs.vuetable.refresh())
}else if(action == 'rm-install' ){
this.hybridoptions.swarmlabname = data.swarmlabname
this.$wait.start('myRunInstancetutor');
var res = await store.dispatch('pipelineLLO/rmswarmlablocal', this.hybridoptions.swarmlabname)
this.$wait.end('myRunInstancetutor');
Vue.nextTick( () => this.$refs.vuetable.refresh())
console.log('inf res '+ JSON.stringify(res))
}else if(action == 'run-install' ){
this.$wait.start('myRunInstancetutor');
this.hybridoptions.swarmlabname = data.swarmlabname
this.hybridoptions.index = index
let value = {}
@ -485,6 +494,7 @@ export default {
console.log('inf git 1 '+ JSON.stringify(swarmlab1info))
console.log('inf '+ JSON.stringify(value))
this.$root.$emit('hybrid_install_instance', value)
this.$wait.end('myRunInstancetutor');
}else if(action == 'run-item' ){
this.viewhybridoptions = true

30
src/store/modules/create_pipelineLLO.js

@ -333,6 +333,36 @@ export default {
}
}
},
async rmswarmlablocal({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+'/rm_swarmlab'
var p = await axios.get(sock_server_l,options);
//var p = await axios.get('https://localhost:3000/get_config',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 get_config({commit,rootGetters}, value) {
console.log('value '+JSON.stringify(value))

Loading…
Cancel
Save