Browse Source

hybrid join

master
zeus 3 years ago
parent
commit
215b05a424
  1. 64
      src/components/manageservices/deploy-bootstrap.vue
  2. 32
      src/components/manageservices/join-service.vue

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

@ -223,6 +223,43 @@
</b-row>
<!-- --------------------------------------------------------- -->
<!-- -------- lab url ----------------------------------- -->
<!-- --------------------------------------------------------- -->
<b-row>
<b-col cols="12">
<ValidationProvider
ref="hybrid_url"
name="Url"
rules="required|alpha_url"
v-slot="{ errors, ariaMsg, ariaInput, valid, invalid }"
>
<div class="input-group input-group-sm sm-3">
<input type="text"
class="form-control"
v-bind:class="{'is-valid': isDeployValid.url == 1, 'is-invalid': isDeployValid.url == 2}"
name="Url"
aria-label="Small"
aria-describedby="inputGroup-sizing-sm"
placeholder="link to README file (see info button for more)"
v-model="deploy.url"
v-on:keyup="isValid('url')"
>
<div class="input-group-append">
<button
class="ti-info btn btn-outline-secondary"
round
type="button"
@click="showInfo('url')"
>
</button>
</div>
</div>
<span class="hybrid-field-error">{{ errors[0] }}</span>
</ValidationProvider>
</b-col>
</b-row>
<!-- --------------------------------------------------------- -->
<!-- -------- lab startdate ----------------------------------- -->
<!-- --------------------------------------------------------- -->
@ -402,6 +439,15 @@ extend('alpha_num_memory', value => {
return 'The {_field_} field may contain numbers e.g 500'
});
extend('alpha_url', value => {
var regex = new RegExp(/https?:\/\/(git\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/,'i');
//var regex = new RegExp(/^[0-9]+$/, 'i');
if(regex.test(value)){
return true;
}
return 'The {_field_} field may contain url'
});
// Override the default message.
extend('required', {
...required,
@ -434,6 +480,7 @@ export default {
"stackname":3,
"network":3,
//"networkport":3,
"url":3,
"cpu":3,
"memory":3
},
@ -541,6 +588,16 @@ Services running inside any of this networks containers have access (not limited
<br>
The field may contain alphabetic characters and numbers
`
}else if(action == 'url'){
var info=`<h5><b>Git Repo url </b></h5>
<br> The location of the file describing your service. (most comonly README)</br>
<br>
</br>
</h5>
<br>
<br>
The field may contain any valid url BUT it must be under https://git.swarmlab.io
`
}else if(action == 'networkport'){
var info=`<h5><b>Network Port </b></h5>
@ -645,6 +702,13 @@ This name is only for your own use. The system completely disregards it!
}else{
this.isDeployValid.network = 2
}
}else if(f == 'url'){
var field = await this.$refs.hybrid_url.validate();
if(field.valid == true){
this.isDeployValid.url = 1
}else{
this.isDeployValid.url = 2
}
}else if(f == 'networkport'){
var field = await this.$refs.hybrid_networkport.validate();
console.log('port '+JSON.stringify(field))

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

@ -64,8 +64,8 @@
class="btn btn-outline-info"
round
type="button"
v-if="hybridshowdata.bootstrapstackname"
@click="onActionHybrid('service-info')"
v-if="hybridshowdata.bootstrapnameid && hybridshowdata.status"
>
Service Info
</button>
@ -539,14 +539,28 @@ export default {
}
}else if(action == 'service-info' ){
console.log(JSON.stringify(action))
/*
var log = await store.dispatch("pipelineLLO/hybrid_servicerm",{
token:this.token,
bootstrapstackid:this.hybridshowdata.bootstrapstackid,
bootstrapnameid:this.hybridshowdata.bootstrapnameid
})
Vue.nextTick( () => this.$refs.vuetable.refresh())
*/
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!'
})
}
},

Loading…
Cancel
Save