Browse Source

community menou 1 public/private

master
zeus 3 years ago
parent
commit
e4164c7d66
  1. 4
      src/components/mynetwork/AdhocView.vue
  2. 30
      src/components/mynetwork/availablemicroservicescustom.vue
  3. 35
      src/components/mynetwork/buildermyservices.vue
  4. 31
      src/components/mynetwork/builderservices.vue
  5. 90
      src/components/mynetwork/customservices.vue
  6. 2
      src/components/mynetwork/mytable.vue
  7. 1
      src/store/modules/create_pipelineLLO.js

4
src/components/mynetwork/AdhocView.vue

@ -458,7 +458,7 @@ export default {
}) })
// from runLLO // from runLLO
this.$root.$on('hybrid_log_in', (log) => { this.$root.$on('hybrid_log_in', (log) => {
console.log(log) //console.log(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))
@ -495,7 +495,7 @@ export default {
}) })
// from microservices not view icon // from microservices not view icon
this.$root.$on('hybrid_console_not_view', (v) => { this.$root.$on('hybrid_console_not_view', (v) => {
console.log(v) //console.log(v)
if(v){ if(v){
this.vieconsoleicon = true this.vieconsoleicon = true
}else if (!v){ }else if (!v){

30
src/components/mynetwork/availablemicroservicescustom.vue

@ -456,7 +456,35 @@ export default {
titleClass: 'center aligned', titleClass: 'center aligned',
dataClass: 'left aligned w-25 text-muted', dataClass: 'left aligned w-25 text-muted',
visible:true, visible:true,
width: '35%' width: '25%'
},
{
name: 'visibility',
title: '<span class="orange"></span>Pub',
sortField: 'gitrepoCloneUrl',
dataClass: 'center aligned w-10 text-center',
visible:true,
width: '10%',
callback: function(value) {
//console.log('---- '+ value)
if (value == 'Public') {
var v = ` <span
class="ti-check text-info text-center"
round
>
</span>
`
return v
}else{
var v = ` <span
class="ti-lock text-info"
round
>
</span>
`
return v
}
}
}, },
{ {
name: 'gitrepo', name: 'gitrepo',

35
src/components/mynetwork/buildermyservices.vue

@ -28,6 +28,13 @@
<div class="input-group input-group-sm sm-3"> <div class="input-group input-group-sm sm-3">
<button
class="btn btn-outline-success btn-sm"
round
type="button"
@click="setFilter">
Refresh Table</button>
<input type="text" <input type="text"
class="form-control" class="form-control"
aria-label="Small" aria-describedby="inputGroup-sizing-sm" aria-label="Small" aria-describedby="inputGroup-sizing-sm"
@ -222,6 +229,34 @@ export default {
visible:true, visible:true,
width: '30%' width: '30%'
}, },
{
name: 'visibility',
title: '<span class="orange"></span>Pub',
sortField: 'gitrepoCloneUrl',
dataClass: 'center aligned w-10 text-center',
visible:true,
width: '10%',
callback: function(value) {
//console.log('---- '+ value)
if (value == 'Public') {
var v = ` <span
class="ti-check text-info text-center"
round
>
</span>
`
return v
}else{
var v = ` <span
class="ti-lock text-info"
round
>
</span>
`
return v
}
}
},
{ {
name: '__slot:actions', // <---- name: '__slot:actions', // <----
title: 'Actions', title: 'Actions',

31
src/components/mynetwork/builderservices.vue

@ -30,6 +30,12 @@
</div> </div>
<div class="input-group input-group-sm sm-3"> <div class="input-group input-group-sm sm-3">
<button
class="btn btn-outline-success btn-sm"
round
type="button"
@click="setFilter">
Refresh Table</button>
<input type="text" <input type="text"
class="form-control" class="form-control"
@ -82,6 +88,7 @@
wrapper-class="vuetable-wrapper" wrapper-class="vuetable-wrapper"
loading-class="loading" loading-class="loading"
detail-row-id="id" detail-row-id="id"
@vuetable:row-clicked="rowClicked"
@vuetable:pagination-data="onPaginationData" @vuetable:pagination-data="onPaginationData"
@vuetable:load-success="loadsuccess" @vuetable:load-success="loadsuccess"
@vuetable:load-error="onLoadError" @vuetable:load-error="onLoadError"
@ -92,7 +99,7 @@
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
<button <button
class="ti-cloud-up btn btn-sm" class="ti-cloud-up btn btn-sm"
title="Upload MicroService" title="Select Base MicroService"
round round
@click="onAction('upload-item', props.rowData, props.rowData._id)"> @click="onAction('upload-item', props.rowData, props.rowData._id)">
</button> </button>
@ -229,6 +236,7 @@ export default {
title: 'Actions', title: 'Actions',
titleClass: 'col text-center', titleClass: 'col text-center',
dataClass: 'center aligned', dataClass: 'center aligned',
visible:false,
width: '10%' width: '10%'
}, },
], ],
@ -337,15 +345,15 @@ export default {
} }
}else if(action == 'upload-item' ){ }else if(action == 'upload-item' ){
var log = await store.dispatch("pipelineLLO/getmyservices",{ // var log = await store.dispatch("pipelineLLO/getmyservices",{
token:this.token, // token:this.token,
service:data.swarmlabname // service:data.swarmlabname
}) // })
//console.log(log) //console.log(log)
this.swarmlab=data this.swarmlab=data
var service = { var service = {
data: data, data: data
log: log // log: log
} }
this.$root.$emit('hybrid_build_micro_service', service) this.$root.$emit('hybrid_build_micro_service', service)
} }
@ -361,11 +369,15 @@ export default {
return this.playbookInfo=value return this.playbookInfo=value
}, },
rowClicked(row, event) { rowClicked(row, event) {
console.log(row)
this.onAction('upload-item', row, row._id)
/*
return { return {
html: true, html: true,
title: () => { return 'Hello <b>Popover:</b> ' + (++this.counter) }, title: () => { return 'Hello <b>Popover:</b> ' + (++this.counter) },
content: () => { return 'The date is:<br><em>' + new Date() + '</em>' } content: () => { return 'The date is:<br><em>' + new Date() + '</em>' }
} }
*/
}, },
loadsuccess(response) { loadsuccess(response) {
var data = response.data.data var data = response.data.data
@ -400,6 +412,11 @@ export default {
} }
#idvuetablekeygmybuildservice1 tr td {
color: #2185d0;
cursor: pointer;
}
.flex-fixed-width-item { .flex-fixed-width-item {
flex: 0 0 100px; flex: 0 0 100px;
} }

90
src/components/mynetwork/customservices.vue

@ -9,7 +9,7 @@
<b-container fluid class="bv-example-row"> <b-container fluid class="bv-example-row">
<div class="row text-center"> <div class="row text-center">
<div class="col-12"> <div class="col-12">
<b>View and <span class="text-info">Manage your builds</span></b> <b>View and <span class="text-info">Manage your build</span></b>
</div> </div>
</div> </div>
@ -125,6 +125,9 @@
round round
@click="onAction('form_version')"> @click="onAction('form_version')">
</button> </button>
</div> </div>
</div> </div>
</div> </div>
@ -133,7 +136,7 @@
</ValidationProvider> </ValidationProvider>
<ValidationProvider <ValidationProvider
ref="hybrid_stackversion" ref="hybrid_stackgitrepo"
name="myGitrepo" name="myGitrepo"
rules="required|alpha_num_url" rules="required|alpha_num_url"
v-slot="{ errors, ariaMsg, ariaInput, valid, invalid }" v-slot="{ errors, ariaMsg, ariaInput, valid, invalid }"
@ -171,6 +174,56 @@
<span class="hybrid-field-error">{{ errors[0] }}</span> <span class="hybrid-field-error">{{ errors[0] }}</span>
</ValidationProvider> </ValidationProvider>
<div class="row">
<div class="col-sm-12 sm-12">
<div class="input-group"
v-if="form_visibility == 'Public'"
>
<button
class="btn btn-success btn-sm"
type="radio"
name="options"
v-model="form_visibility"
>
<span class="text-light">Public</span>
</button>
<button
class="btn btn-outline-secondary btn-sm"
type="radio"
name="options"
v-model="form_visibility"
@click="onSwitch('Private')"
>
<span class="text-muted">Private</span>
</button>
</div>
<div class="input-group"
v-if="form_visibility == 'Private'"
>
<button
class="btn btn-outline-secondary btn-sm"
type="radio"
name="options"
v-model="form_visibility"
@click="onSwitch('Public')"
>
<span class="text-muted">Public</span>
</button>
<button
class="btn btn-success btn-sm"
type="radio"
name="options"
v-model="form_visibility"
>
<span class="text-light">Private</span>
</button>
</div>
</div>
</div>
<div class="row" <div class="row"
<b-col class="text-center" cols="12" sm="12" md="12"> <b-col class="text-center" cols="12" sm="12" md="12">
@ -506,6 +559,7 @@ export default {
'form_port3':'', 'form_port3':'',
'form_name3':'', 'form_name3':'',
'form_gitrepo':'', 'form_gitrepo':'',
'form_visibility':'Public',
customservice: { customservice: {
'myservicename':'', 'myservicename':'',
'os':'', 'os':'',
@ -549,7 +603,7 @@ export default {
//console.log('false') //console.log('false')
}) })
this.$root.$on('hybrid_build_micro_service', (service) => { this.$root.$on('hybrid_build_micro_service', (service) => {
//console.log(service); console.log(service)
this.setserviceform2null() this.setserviceform2null()
this.menou = true this.menou = true
this.myservicename = {} this.myservicename = {}
@ -559,7 +613,8 @@ export default {
this.menouselect = false this.menouselect = false
this.customservice.microservice = service.data.swarmlabname this.customservice.microservice = service.data.swarmlabname
this.form_baseservice = service.data.swarmlabname this.form_baseservice = service.data.swarmlabname
this.form_visibility = 'Public'
/*
if( service.log.hasOwnProperty('data')){ if( service.log.hasOwnProperty('data')){
if( service.log.data.hasOwnProperty('data')){ if( service.log.data.hasOwnProperty('data')){
if(service.log.data.data){ if(service.log.data.data){
@ -574,6 +629,7 @@ export default {
//console.log(cc) //console.log(cc)
this.customservice.myservicename = service.log.data.data[cc].service this.customservice.myservicename = service.log.data.data[cc].service
this.customservice.baseservice = service.log.data.data[cc].baseservice this.customservice.baseservice = service.log.data.data[cc].baseservice
this.customservice.visibility = 'Public'
this.customservice.sh = service.log.data.data[cc].sh this.customservice.sh = service.log.data.data[cc].sh
this.customservice.os = service.log.data.data[cc].packages this.customservice.os = service.log.data.data[cc].packages
this.customservice.readme = service.log.data.data[cc].readme this.customservice.readme = service.log.data.data[cc].readme
@ -611,10 +667,12 @@ export default {
var vtmp1 = {"value":this.selected,"text":"Please select an option"} var vtmp1 = {"value":this.selected,"text":"Please select an option"}
Vue.set(this.options, this.selected, vtmp1) Vue.set(this.options, this.selected, vtmp1)
//console.log('options '+ JSON.stringify(this.options)) //console.log('options '+ JSON.stringify(this.options))
*/
}) })
this.$root.$on('hybrid_build_micro_myservice', (service) => { this.$root.$on('hybrid_build_micro_myservice', (service) => {
console.log(service)
this.menou = true this.menou = true
this.myservicename = {} this.myservicename = {}
this.customserviceall = [] this.customserviceall = []
@ -627,6 +685,7 @@ export default {
if(service.log.data.data){ if(service.log.data.data){
this.customservice.myservicename = service.log.data.data.service this.customservice.myservicename = service.log.data.data.service
this.customservice.baseservice = service.log.data.data.baseservice this.customservice.baseservice = service.log.data.data.baseservice
this.customservice.visibility = service.log.data.data.visibility
this.customservice.sh = service.log.data.data.sh this.customservice.sh = service.log.data.data.sh
this.customservice.os = service.log.data.data.packages this.customservice.os = service.log.data.data.packages
this.customservice.readme = service.log.data.data.readme this.customservice.readme = service.log.data.data.readme
@ -674,6 +733,10 @@ export default {
}, },
methods: { methods: {
async onSwitch(value) {
console.log(value)
this.form_visibility = value
},
async onAction(value) { async onAction(value) {
//console.log(value) //console.log(value)
var infotxt = '' var infotxt = ''
@ -764,6 +827,7 @@ export default {
service: this.form_myservicename, service: this.form_myservicename,
readme: this.form_readme, readme: this.form_readme,
baseservice: this.form_baseservice, baseservice: this.form_baseservice,
visibility: this.form_visibility,
sh: this.form_sh, sh: this.form_sh,
packages: this.form_os, packages: this.form_os,
gitrepo: this.form_gitrepo, gitrepo: this.form_gitrepo,
@ -850,6 +914,7 @@ export default {
setserviceform(data) { setserviceform(data) {
this.form_myservicename = data.myservicename this.form_myservicename = data.myservicename
this.form_baseservice = data.baseservice this.form_baseservice = data.baseservice
this.form_visibility = data.visibility
this.form_sh = data.sh this.form_sh = data.sh
this.form_os = data.os this.form_os = data.os
this.form_readme = data.readme this.form_readme = data.readme
@ -900,7 +965,8 @@ export default {
this.customservice.myservicename = this.customserviceall[cc].service this.customservice.myservicename = this.customserviceall[cc].service
this.customservice.baseservice = this.customserviceall[cc].baseservice this.customservice.baseservice = this.customserviceall[cc].baseservice
this.customservice.visibility = this.customserviceall[cc].visibility
this.customservice.sh = this.customserviceall[cc].sh this.customservice.sh = this.customserviceall[cc].sh
this.customservice.os = this.customserviceall[cc].packages this.customservice.os = this.customserviceall[cc].packages
this.customservice.readme = this.customserviceall[cc].readme this.customservice.readme = this.customserviceall[cc].readme
@ -942,7 +1008,7 @@ export default {
} }
} }
else if(f == 'gitrepo'){ else if(f == 'gitrepo'){
var field = await this.$refs.hybrid_stackversion.validate(); var field = await this.$refs.hybrid_stackgitrepo.validate();
if(field.valid == true){ if(field.valid == true){
this.isDeployValid.gitrepo = 1 this.isDeployValid.gitrepo = 1
}else{ }else{
@ -967,6 +1033,18 @@ export default {
<style lang="scss"> <style lang="scss">
.switchsecondary {
background: var(--secondary);
color: #fff;
}
.flex-fixed-width-item { .flex-fixed-width-item {
flex: 0 0 100px; flex: 0 0 100px;

2
src/components/mynetwork/mytable.vue

@ -616,7 +616,7 @@ export default {
//console.log(logdatacustom.data); //console.log(logdatacustom.data);
if(logdatacustom.data && logdatacustom.data.data){ if(logdatacustom.data && logdatacustom.data.data){
this.hybridshowdata_user = JSON.parse(logdatacustom.data.data) this.hybridshowdata_user = JSON.parse(logdatacustom.data.data)
console.log(this.hybridshowdata_user); //console.log(this.hybridshowdata_user);
var urlgeniGUIEDITOR = this.hybridshowdata.Names.split('_'); var urlgeniGUIEDITOR = this.hybridshowdata.Names.split('_');
this.webinterfacegenericedit = true this.webinterfacegenericedit = true
var urlgeniGUI = this.hybridshowdata_user.servicedata.baseservice var urlgeniGUI = this.hybridshowdata_user.servicedata.baseservice

1
src/store/modules/create_pipelineLLO.js

@ -254,6 +254,7 @@ export default {
service: value.service, service: value.service,
readme: value.readme, readme: value.readme,
baseservice: value.baseservice, baseservice: value.baseservice,
visibility: value.visibility,
sh: value.sh, sh: value.sh,
packages: value.packages, packages: value.packages,
gitrepo: value.gitrepo, gitrepo: value.gitrepo,

Loading…
Cancel
Save