Browse Source

service restart

master
zeus 3 years ago
parent
commit
fef5444677
  1. 2
      dist/index.html
  2. 2
      dist/js/app.99375462.js
  3. 1
      dist/js/app.99375462.js.map
  4. 2
      dist/js/app.eeab6a61.js
  5. 1
      dist/js/app.eeab6a61.js.map
  6. 25
      src/components/manageservices/deploy-bootstrap.vue
  7. 33
      src/components/manageservices/view-service.vue
  8. 33
      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.cfbfbafa.css" rel="preload" as="style"><link href="/css/chunk-vendors.8f6b4875.css" rel="preload" as="style"><link href="/js/app.99375462.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.cfbfbafa.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.07104166.js"></script><script src="/js/app.99375462.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.cfbfbafa.css" rel="preload" as="style"><link href="/css/chunk-vendors.8f6b4875.css" rel="preload" as="style"><link href="/js/app.eeab6a61.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.cfbfbafa.css" rel="stylesheet"></head><body><div id="app"></div><script src="/js/chunk-vendors.07104166.js"></script><script src="/js/app.eeab6a61.js"></script></body></html>

2
dist/js/app.99375462.js

File diff suppressed because one or more lines are too long

1
dist/js/app.99375462.js.map

File diff suppressed because one or more lines are too long

2
dist/js/app.eeab6a61.js

File diff suppressed because one or more lines are too long

1
dist/js/app.eeab6a61.js.map

File diff suppressed because one or more lines are too long

25
src/components/manageservices/deploy-bootstrap.vue

@ -501,7 +501,7 @@ export default {
var url_string = window.location.href
var url = new URL(url_string);
this.token = url.searchParams.get("token");
console.log("token "+ this.token);
//console.log("token "+ this.token);
},
beforeDestroy () {
@ -532,7 +532,7 @@ export default {
(async () => {
var isAllValid = true
for (const [key, value] of Object.entries(this.isDeployValid)) {
console.log(`${key}: ${value}`);
//console.log(`${key}: ${value}`);
if(value != 1){
isAllValid = false
}
@ -543,6 +543,23 @@ export default {
deploy:this.deploy
})
this.$root.$emit('hybrid_refresh_bootstrap_view')
console.log('ok')
var info = '<h5>The deploy process is started</h5> Please wait for it to finish before trying again! <br><br>See also in "Manage your deployments" table'
this.$swal({
type: 'Info',
title: 'Info!',
icon:'info',
html: info,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: false,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true,
confirmButtonText: 'Ok!'
})
}else{
var info = "Missing required fields"
this.$swal({
@ -686,7 +703,7 @@ This name is only for your own use. The system completely disregards it!
// validate
// ------------
if(f == 'image'){
console.log(this.deploy.image)
//console.log(this.deploy.image)
var field = await this.$refs.hybrid_image.validate();
if(field.valid == true){
this.isDeployValid.image = 1
@ -718,7 +735,7 @@ This name is only for your own use. The system completely disregards it!
}
}else if(f == 'networkport'){
var field = await this.$refs.hybrid_networkport.validate();
console.log('port '+JSON.stringify(field))
//console.log('port '+JSON.stringify(field))
if(field.valid == true){
this.isDeployValid.networkport = 1
}else{

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

@ -39,6 +39,7 @@
</div>
<div class="col-3 text-info" >
<div class="input-group-prepend">
<!--
<button
class="btn btn-outline-warning"
round
@ -48,6 +49,7 @@
>
Restart Stack
</button>
-->
</div>
</div>
<div class="col-3 text-info" >
@ -444,8 +446,37 @@ export default {
bootstrapnameid:this.hybridshowdata.bootstrapnameid
})
Vue.nextTick( () => this.$refs.vuetable.refresh())
}
}else if(action == 'service-restart' ){
var log = await store.dispatch("pipelineLLO/hybrid_servicerestart",{
token:this.token,
bootstrapnameid:this.hybridshowdata.bootstrapnameid
})
Vue.nextTick( () => this.$refs.vuetable.refresh())
var info =''
if(log.data.data.errorexec_msg == 'ok'){
info ='<h5>Update existing service: ok!</h5>'
}else{
info ='<h5>Update existing service: error!</h5>'
}
this.$swal({
type: 'Info',
title: 'INFO',
icon:'info',
html: info,
showCloseButton: true,
showLoaderOnConfirm: false,
allowOutsideClick: false,
cancelButtonText: 'No, cancel!',
showCancelButton: false,
showLoaderOnConfirm: false,
reverseButtons: true,
focusCancel: true,
confirmButtonText: 'Ok!'
})
console.log('stackid '+this.hybridshowdata.bootstrapnameid)
}
},
async onActionHybrid_stackrm(action) {
if(action.isConfirmed){

33
src/store/modules/create_pipelineLLO.js

@ -555,6 +555,39 @@ export default {
}
}
},
async hybrid_servicerestart({commit,rootGetters}, value) {
try {
var token = value.token
var params = {
bootstrapnameid: value.bootstrapnameid,
action: 'stackrestart'
}
var options = {
headers: { 'content-type': 'application/x-www-form-urlencoded',Authorization: `Bearer ${token}` },
};
var p = await axios.post('https://api.swarmlab.io/swarmlabhybridrestartservice',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 swarmlabhybridjoin({commit,rootGetters}, value) {
try {
var token = value.token

Loading…
Cancel
Save