From 719cdb9a6b46cf895e6f40b4dd36495c9d4c4c2b Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Tue, 26 Dec 2023 11:26:45 +0100 Subject: [PATCH 01/13] Interlink and change form --- public/callback.html | 1 + src/components/forms/FunctionForm.vue | 218 ++++++++++++++++++-------- src/views/Functions.vue | 107 ++++++++++--- src/views/Info.vue | 56 ++++++- src/views/Invoke.vue | 1 + src/views/Login.vue | 1 + 6 files changed, 294 insertions(+), 90 deletions(-) diff --git a/public/callback.html b/public/callback.html index 894ce4f..d5b2f7f 100644 --- a/public/callback.html +++ b/public/callback.html @@ -104,6 +104,7 @@ localStorage.setItem("authenticated", true); localStorage.setItem("yunikorn_enable",response.data.yunikorn_enable); localStorage.setItem("gpu_available",response.data.gpu_available); + localStorage.setItem("interLink_available",response.data.interLink_available); var url_redirect = window.location.origin + "/#/services" window.location.href = url_redirect }).catch(function (error) { diff --git a/src/components/forms/FunctionForm.vue b/src/components/forms/FunctionForm.vue index 1d45c68..43e60fb 100644 --- a/src/components/forms/FunctionForm.vue +++ b/src/components/forms/FunctionForm.vue @@ -163,8 +163,8 @@
- - + + - + +
+ + + + + + + + + + + + + + + + + +
+ @@ -1377,15 +1428,17 @@ export default { envrequirehost: false, envrequiretoken : false, envrequirespace : false, - envVars:{}, - annotations:{}, - labels:{}, - envVarsAll:{}, + //envVars:{}, + //annotations:{}, + //labels:{}, + //envVarsAll:{}, limits_mem: '', total_mem:'', request_mem: '', initialName:'', - select_logLevel: '', + select_logLevel: 'INFO', + log_level:['CRITICAL','ERROR','WARNING','INFO','DEBUG','NOTSET'], + ONEDATA_DICT:{}, S3_DICT:{}, DCACHE_DICT:{}, @@ -1430,12 +1483,12 @@ export default { nameRules: [ v => !!v || 'Function name is required' ], - envVarskey: "", + /*envVarskey: "", envVarsValue: "", annotkey:"", annotvalue:"", labelskey:"", - labelsvalue:"", + labelsvalue:"",*/ path_in:"", log_level:['CRITICAL','ERROR','WARNING','INFO','DEBUG','NOTSET'], storage_provider_in:"", @@ -1457,18 +1510,19 @@ export default { // space: '' // }, }, - limits_cpu: '', + cpu: '', limits_memory: '', - regAuth: '', + /*regAuth: '', request_cpu: '', request_memory: '', - secrets: '', + secrets: '',*/ script: '', - total_cpu:'', + /*total_cpu:'', total_memory:'', alpine:false, image_prefetch:false, enable_gpu:false, + enable_InterLink:false,*/ expose:{ min_scale:'', max_scale:'', @@ -1574,7 +1628,7 @@ export default { cleanfield(){ this.url="" }, - cleanfieldenv(){ + /*cleanfieldenv(){ this.form.envVarskey="" this.form.envVarsValue="" }, @@ -1585,7 +1639,7 @@ export default { cleanfieldLabels(){ this.form.labelskey="" this.form.labelsvalue="" - }, + },*/ cleanfieldInput(){ this.form.path_in="" this.form.storage_provider_in="" @@ -1692,7 +1746,7 @@ export default { } } }, - includeEnv(){ + /*includeEnv(){ if(this.form.envVarskey != null && this.form.envVarskey != '' && this.form.envVarsValue != null && this.form.envVarsValue != ''){ this.showselectEnv=true var key= this.form.envVarskey.replace(" ", "") @@ -1718,7 +1772,7 @@ export default { this.labels[key]=value this.cleanfieldLabels() } - }, + },*/ includeOneData(){ if(this.onedata.id=='' || this.onedata.oneprovider_host=='' || this.onedata.token=='' || this.onedata.space==''){ this.showErrorOneData = true @@ -1867,7 +1921,7 @@ export default { } return true; }, - removeEnv (key) { + /*removeEnv (key) { this.$delete(this.envVars,key) if (this.isEmpty(this.envVars)) { this.showselectEnv = false @@ -1884,7 +1938,7 @@ export default { if (this.isEmpty(this.labels)) { this.showselectLabel = false } - }, + },*/ removeInput (key) { this.$delete(this.inputs,key) if (this.isEmpty(this.inputs)) { @@ -1921,7 +1975,7 @@ export default { this.showselectSuffixOut = false } }, - collapse(){ + /*collapse(){ this.drawer = (!this.drawer) if (this.drawer == true){ this.expand = "expand_less" @@ -1931,7 +1985,7 @@ export default { this.expand = "expand_more" $("#panel").slideUp("slow"); } - }, + },*/ addFiles () { this.$refs.files.click() }, @@ -2006,12 +2060,12 @@ export default { this.dialog = false this.clear() }, - extend(obj, src) { + /*extend(obj, src) { for (var key in src) { if (src.hasOwnProperty(key)) obj[key] = src[key]; } return obj; - }, + },*/ validate(){ if(this.form.name.length < 3 || this.form.image.length < 3){ return false @@ -2054,16 +2108,16 @@ export default { $("#input_output").removeClass("show active") $("#profile-tab").removeClass("show active") $("#profile").removeClass("show active") - this.select_logLevel = 'INFO' + //this.select_logLevel = 'INFO' this.editScript = false - this.form.limits_cpu='' + this.form.cpu='' this.form.limits_memory='' this.form.image='' this.form.name='' - this.form.expose.min_scale="" + /*this.form.expose.min_scale="" this.form.expose.max_scale="" this.form.expose.port='' - this.form.expose.cpu_threshold='' + this.form.expose.cpu_threshold=''*/ }, clear () { this.files = [] @@ -2131,16 +2185,16 @@ export default { }, prepareFunction(){ if (this.isEmpty(this.MINIO_DICT)==false) { - this.form.storage_provider["minio"]=this.MINIO_DICT + this.form.storage_providers["minio"]=this.MINIO_DICT } if (this.isEmpty(this.S3_DICT)==false){ - this.form.storage_provider["s3"]=this.S3_DICT + this.form.storage_providers["s3"]=this.S3_DICT } if (this.isEmpty(this.ONEDATA_DICT)==false){ - this.form.storage_provider["onedata"]=this.ONEDATA_DICT + this.form.storage_providers["onedata"]=this.ONEDATA_DICT } if (this.isEmpty(this.DCACHE_DICT)==false){ - this.form.storage_provider["webdav"]=this.DCACHE_DICT + this.form.storage_providers["webdav"]=this.DCACHE_DICT } var value = $("#classmemory option:selected").text(); @@ -2167,7 +2221,18 @@ export default { } } - var params = { + this.form.log_level= this.select_logLevel + this.form.script=this.base64String + this.form.memory=this.limits_mem + this.form.input= this.inputs + this.form.output= this.outputs + this.select_logLevel= 'INFO' + if(this.form.expose?.port== 0 || this.form.expose?.port == ""){ + delete this.form.expose + } + return this.form + + /*var params = { 'name': this.form.name, 'image': this.form.image, @@ -2187,6 +2252,7 @@ export default { 'alpine':this.form.alpine, 'image_prefetch':this.form.image_prefetch, 'enable_gpu':this.form.enable_gpu, + 'enable_InterLink':this.form.enable_InterLink, 'expose':{ 'min_scale':parseInt(this.form.expose.min_scale), 'max_scale':parseInt(this.form.expose.max_scale), 'port':parseInt(this.form.expose.port), @@ -2203,7 +2269,7 @@ export default { } - return params + return params*/ }, newFunction () { var params =this.prepareFunction() @@ -2260,13 +2326,13 @@ export default { window.getApp.$emit('FUNC_GET_FUNCTIONS_LIST') window.getApp.$emit('REFRESH_BUCKETS_LIST') }, - addSecret() { + /*addSecret() { var newSecret=document.getElementById('text-secret').value this.form.image_pull_secrets.push(newSecret); }, deleteSecret(newSecret) { this.form.image_pull_secrets.pop(newSecret); - }, + },*/ }, computed: { @@ -2280,27 +2346,35 @@ export default { showSelectedFiles () { return this.files.length > 0 }, - getYunikorn_option () { + /*getYunikorn_option () { return localStorage.getItem('yunikorn_enable') }, getGpu_available() { return localStorage.getItem('gpu_available') }, + getInterLink_available(){ + return localStorage.getItem('interLink_available') + }*/ }, created: function () { - this.select_logLevel = 'INFO'; + //this.select_logLevel = 'INFO'; window.getApp.$on('FUNC_OPEN_MANAGEMENT_DIALOG', (data) => { + console.log(data) this.dialog = true + console.log(this) + + this.form=Object.assign({}, data); + this.editionMode = data.editionMode - this.form.name = data.name + //this.form.name = data.name this.initialName = data.name - this.form.image = data.image - this.form.image_pull_secrets = data.image_pull_secrets ? data.image_pull_secrets : []; + //this.form.image = data.image + //this.form.image_pull_secrets = data.image_pull_secrets ? data.image_pull_secrets : []; this.inputs = data.input this.outputs = data.output - this.form.limits_cpu = data.cpu + ///this.form.limits_cpu = data.cpu var memory_split = [] memory_split = data.memory.match(/[a-z]+|[^a-z]+/gi); this.form.limits_memory = memory_split[0] @@ -2309,9 +2383,12 @@ export default { }else{ var value_select = "2" } - this.form.alpine=data.alpine - this.form.image_prefetch=data.image_prefetch - if( data.expose.min_scale == 0 && data.expose.max_scale==0 && + setTimeout(function(){ + $('#classmemory').val(value_select) + },100) + //this.form.alpine=data.alpine + //this.form.image_prefetch=data.image_prefetch + /*if( data.expose.min_scale == 0 && data.expose.max_scale==0 && data.expose.port==0 && data.expose.cpu_threshold ==0){ this.form.expose.min_scale='' this.form.expose.max_scale='' @@ -2322,14 +2399,17 @@ export default { this.form.expose.max_scale=data.expose.max_scale this.form.expose.port=data.expose.port this.form.expose.cpu_threshold=data.expose.cpu_threshold - } - if(localStorage.getItem('gpu_available')== "true" && data.enable_gpu != undefined ){ + }*/ + /*if(localStorage.getItem('gpu_available')== "true" && data.enable_gpu != undefined ){ this.form.enable_gpu=data.enable_gpu } + if(localStorage.getItem('interLink_available') == "true" && data.enable_InterLink !=''){ + this.form.enable_InterLink=data.enable_InterLink + } if(localStorage.getItem('yunikorn_enable') == "true" && data.total_cpu !=''){ this.form.total_cpu=data.total_cpu - } - if(localStorage.getItem('yunikorn_enable') == "true" && data.total_memory !=undefined){ + }*/ + /*if(localStorage.getItem('yunikorn_enable') == "true" && data.total_memory !=undefined){ if(data.total_memory == ""){ this.form.total_memory = '' var total_value_select = "1" @@ -2347,11 +2427,19 @@ export default { setTimeout(function(){ $('#classmemory').val(value_select) $('#total_classmemory').val(total_value_select) - },100) - var key='' + },100)*/ + /*var key='' var values= '' - key = Object.keys(data.envVars.Variables) - values = Object.values(data.envVars.Variables) + key = Object.keys(data.environment.Variables) + + /////////////////////// + + + + + + + values = Object.values(data.environment.Variables) for (let i = 0; i < key.length; i++) { this.envVars[key[i]]=values[i] } @@ -2374,9 +2462,9 @@ export default { }else{ this.showselectLabel = false; this.labels = {}; - } + }*/ - this.select_logLevel = data.log_Level + this.select_logLevel = data.log_level if (this.isEmpty(this.inputs)) { this.showselectInput = false }else{ @@ -2389,28 +2477,28 @@ export default { } this.base64String = data.script - if(data.storage_provider.minio == undefined){ + if(data.storage_providers.minio == undefined){ this.MINIO_DICT={} }else{ - this.MINIO_DICT=data.storage_provider.minio + this.MINIO_DICT=data.storage_providers.minio } - if(data.storage_provider.onedata == undefined){ + if(data.storage_providers.onedata == undefined){ this.ONEDATA_DICT={} }else{ - this.ONEDATA_DICT=data.storage_provider.onedata + this.ONEDATA_DICT=data.storage_providers.onedata } - if(data.storage_provider.s3 == undefined){ + if(data.storage_providers.s3 == undefined){ this.S3_DICT={} }else{ - this.S3_DICT=data.storage_provider.s3 + this.S3_DICT=data.storage_providers.s3 } - if(data.storage_provider.webdav == undefined){ + if(data.storage_providers.webdav == undefined){ this.DCACHE_DICT={} }else{ - this.DCACHE_DICT=data.storage_provider.webdav + this.DCACHE_DICT=data.storage_providers.webdav } this.storages_all=[] if (this.isEmpty(this.MINIO_DICT)) { @@ -2504,7 +2592,7 @@ export default { height: calc(2.25rem + 3px); width: 100% } - }5 + } /* Extra large devices (large desktops, 1200px and up)*/ @media (min-width: 1200px) { diff --git a/src/views/Functions.vue b/src/views/Functions.vue index 42db232..fe74f0a 100644 --- a/src/views/Functions.vue +++ b/src/views/Functions.vue @@ -19,15 +19,15 @@ :items="services" :loading="loading" class="elevation-1" - item-key="service" + item-key="name" :search="search" :expand="expand" v-show="!show_spinner" > @@ -96,8 +96,8 @@ - Name: {{props.item.service}} - Image: {{props.item.container}} + Name: {{props.item.name}} + Image: {{props.item.image}} Token: + Resources +
    +
  • CPU: {{props.item.cpu}}
  • +
  • Memory: {{props.item.memory}}
  • +
+
+ Yunikorn resources +
    +
  • CPU: {{props.item.total_cpu}}
  • +
  • Memory: {{props.item.total_memory}}
  • +
+
+ Does this service use GPU? +

Yes

+

No

+
+ Is your image base on Alpine? +

Yes

+

No

+
+ Is this service expose? +

Yes

+

No

+
    +
  • min_scale: {{props.item.expose.min_scale}}
  • +
  • max_scale: {{props.item.expose.max_scale}}
  • +
  • port: {{props.item.expose.port}}
  • +
  • cpu_threshold: {{props.item.expose.cpu_threshold}}
  • +
+
+ Does this service use InterLink? +

Yes

+

No

+
+ Environment variables: -

+											

 										
@@ -334,7 +369,9 @@ export default { }, editFunction (func) { const index = this.services.indexOf(func) - let servInfo = { + let servInfo = this.services[index]; + servInfo.editionMode=true + /* { editionMode: true, name: this.services[index].service, image: this.services[index].container, @@ -342,7 +379,7 @@ export default { input: this.services[index].inputs, output: this.services[index].outputs, log_Level: this.services[index].logLevel, - envVars: this.services[index].envVars, + environment: this.services[index].environment, image_pull_secrets: this.services[index].image_pull_secrets, annotations: this.services[index].annotations?this.services[index].annotations:{}, labels: this.services[index].labels?this.services[index].labels:{}, @@ -355,8 +392,9 @@ export default { alpine:this.services[index].alpine, expose:this.services[index].expose, image_prefetch:this.services[index].image_prefetch, - enable_gpu:this.services[index].enable_gpu - } + enable_gpu:this.services[index].enable_gpu, + enable_InterLink:this.services[index].enable_InterLink + }*/ window.getApp.$emit('FUNC_OPEN_MANAGEMENT_DIALOG', servInfo) }, deleteFunction(serv, servName) { @@ -381,8 +419,10 @@ export default { if(response.status == 200){ this.show_spinner = false; this.services = Object.assign(this.services, response.data); + console.log(response.data) this.services = response.data.map((serv) => { - return { + //console.log(serv) + return serv/*{ service: serv.name, container: serv.image, token: serv.token, @@ -393,17 +433,18 @@ export default { annotations: serv.annotations, labels: serv.labels, memory: serv.memory, - inputs: serv.input, - outputs: serv.output, - storage: serv.storage_providers, + input: serv.input, + output: serv.output, + storage_providers: serv.storage_providers, script: serv.script, total_cpu: serv.total_cpu, total_memory: serv.total_memory, alpine: serv.alpine, image_prefetch: serv.image_prefetch, expose:serv.expose, - enable_gpu: serv.enable_gpu - } + enable_gpu: serv.enable_gpu, + enable_InterLink: serv.enable_InterLink + }*/ }) this.loading = false; }else{ @@ -424,8 +465,34 @@ export default { const bottomOfPage = visible + scrollY >= pageHeight return bottomOfPage || pageHeight < visible }, + alpineImage (isAlpine) { + return isAlpine + }, + useInterLink(useInterLink){ + return useInterLink + }, + useGPU(value){ + return value + }, + isServiceExpose(portValue){ + if(portValue != 0){ + return true + } + return false + }, + getInterLink_available(){ + return localStorage.getItem('interLink_available') + } }, + computed: { + getYunikorn_option () { + return localStorage.getItem('yunikorn_enable') + }, + getGpu_available() { + return localStorage.getItem('gpu_available') + }, + }, created: function () { window.getApp.$on('FUNC_GET_FUNCTIONS_LIST', () => { this.listServicesCall(this.listServicesCallback) diff --git a/src/views/Info.vue b/src/views/Info.vue index 59cd2e5..9ee3250 100644 --- a/src/views/Info.vue +++ b/src/views/Info.vue @@ -34,9 +34,30 @@
- useSSL: {{useSSL}} - GPU available: {{gpu_available}} - yunikorn_enable: {{yunikorn_enable}} + + useSSL: +

Yes

+

No

+
+ GPU Available: +

Yes

+

No

+
+ Yunikorn Enable: +

Yes

+

No

+
+ InterLink Available: +

Yes

+

No

+
@@ -96,6 +117,28 @@
  • CPUs: {{ service.cpu }}
  • Memory: {{ service.memory }}
  • Log Level: {{ service.logLevel }}
  • +
  • Does this service use GPU? +

    Yes

    +

    No

    +
  • +
  • Yunikorn Total CPUs: + {{ service.total_cpu }} +
  • +
  • Yunikorn Total Memory: + {{ service.total_memory }} +
  • +
  • Does this service use Interlink? +

    Yes

    +

    No

    +
  • +
  • Does this service use Alpine? +

    Yes

    +

    No

    +
  • +
  • Does this service is exposed? +

    Yes

    +

    No

    +
  • Inputs:
    • @@ -164,6 +207,7 @@ export default { useSSL:localStorage["useSSL"], yunikorn_enable:localStorage["yunikorn_enable"], secretKey:localStorage["secretKey"], + interLink_available:localStorage["interLink_available"], showpassword:false, showpasswordminio:false, buckets: [], @@ -241,10 +285,12 @@ export default { total_cpu: serv.total_cpu, total_memory: serv.total_memory, alpine: serv.alpine, - enable_gpu: serv.enable_gpu + enable_gpu: serv.enable_gpu, + enable_InterLink: serv.enable_InterLink, + expose: serv.expose } }) - + console.log(this.services) this.loading = false; } }, diff --git a/src/views/Invoke.vue b/src/views/Invoke.vue index d729f8e..502600e 100644 --- a/src/views/Invoke.vue +++ b/src/views/Invoke.vue @@ -163,6 +163,7 @@ export default { //document.getElementById("myAudio").appendChild(x); //this.$refs.output.src = window.atob(response.data); }else if(this.outputTypeSelected=='Zip'){ + console.log(response) var element = document.createElement('a'); element.setAttribute('href', 'data:text/zip;base64,' + response.data); element.setAttribute('download', "result.zip"); diff --git a/src/views/Login.vue b/src/views/Login.vue index 0270064..162fe6e 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -181,6 +181,7 @@ export default { localStorage.setItem("password", this.model.password); localStorage.setItem("yunikorn_enable",response.data.yunikorn_enable); localStorage.setItem("gpu_available",response.data.gpu_available); + localStorage.setItem("interLink_available",response.data.interLink_available); }, checkLoginCallback(response){ if(response == 200){ From 9b2e516de99e53371671caec666a86ac804dac4c Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Tue, 26 Dec 2023 11:47:46 +0100 Subject: [PATCH 02/13] Interlink and change form --- src/components/forms/FunctionForm.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/forms/FunctionForm.vue b/src/components/forms/FunctionForm.vue index 43e60fb..00fedbf 100644 --- a/src/components/forms/FunctionForm.vue +++ b/src/components/forms/FunctionForm.vue @@ -1490,7 +1490,7 @@ export default { labelskey:"", labelsvalue:"",*/ path_in:"", - log_level:['CRITICAL','ERROR','WARNING','INFO','DEBUG','NOTSET'], + //log_level:['CRITICAL','ERROR','WARNING','INFO','DEBUG','NOTSET'], storage_provider_in:"", prefix_in:"", suffix_in:"", @@ -2165,7 +2165,7 @@ export default { this.showselectSuffixOut = false this.showselectInput = false this.showselectOutput = false - this.select_logLevel = 'INFO' + //this.select_logLevel = 'INFO' this.editScript = false this.storages_all = [] this.ONEDATA_DICT={} @@ -2226,7 +2226,7 @@ export default { this.form.memory=this.limits_mem this.form.input= this.inputs this.form.output= this.outputs - this.select_logLevel= 'INFO' + if(this.form.expose?.port== 0 || this.form.expose?.port == ""){ delete this.form.expose } @@ -2463,8 +2463,9 @@ export default { this.showselectLabel = false; this.labels = {}; }*/ - - this.select_logLevel = data.log_level + if(this.select_logLevel==''){ + this.select_logLevel= 'INFO' + }else this.select_logLevel = data.log_level if (this.isEmpty(this.inputs)) { this.showselectInput = false }else{ From 42588c4c103d75faa2868fc5db61ea3faeba6e2e Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Fri, 2 Feb 2024 08:32:26 +0100 Subject: [PATCH 03/13] No function multitenant and more services per page --- src/views/Functions.vue | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/views/Functions.vue b/src/views/Functions.vue index fe74f0a..1ab4b70 100644 --- a/src/views/Functions.vue +++ b/src/views/Functions.vue @@ -22,6 +22,7 @@ item-key="name" :search="search" :expand="expand" + :rows-per-page-items="item_per_page" v-show="!show_spinner" > @@ -130,13 +131,13 @@

      No

      Is this service expose? -

      Yes

      -

      No

      -
        -
      • min_scale: {{props.item.expose.min_scale}}
      • -
      • max_scale: {{props.item.expose.max_scale}}
      • -
      • port: {{props.item.expose.port}}
      • -
      • cpu_threshold: {{props.item.expose.cpu_threshold}}
      • +

        Yes

        +

        No

        +
          +
        • min_scale: {{props.item?.expose?.min_scale}}
        • +
        • max_scale: {{props.item?.expose?.max_scale}}
        • +
        • port: {{props.item?.expose?.port}}
        • +
        • cpu_threshold: {{props.item?.expose?.cpu_threshold}}
        Does this service use InterLink? @@ -340,7 +341,8 @@ export default { disable_form: true, disable_storage: true, params_delete: '', - show1:false + show1:false, + item_per_page: [10,25,50,{"text":"$vuetify.dataIterator.rowsPerPageAll","value":-1}], }), methods: { showEnvVars(value){ @@ -417,7 +419,9 @@ export default { }, listServicesCallback(response) { if(response.status == 200){ + this.show_spinner = false; + if (response.data !== null) { this.services = Object.assign(this.services, response.data); console.log(response.data) this.services = response.data.map((serv) => { @@ -446,6 +450,7 @@ export default { enable_InterLink: serv.enable_InterLink }*/ }) + } this.loading = false; }else{ this.show_alert = true; @@ -475,7 +480,7 @@ export default { return value }, isServiceExpose(portValue){ - if(portValue != 0){ + if(portValue !== 0){ return true } return false From 1d2acf844ea3f68a28031459d91e0be2aed04f88 Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Fri, 2 Feb 2024 10:10:03 +0100 Subject: [PATCH 04/13] fix no bucket error --- src/components/AppDrawer.vue | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/AppDrawer.vue b/src/components/AppDrawer.vue index d7f122c..7b60e10 100644 --- a/src/components/AppDrawer.vue +++ b/src/components/AppDrawer.vue @@ -252,18 +252,20 @@ export default { }, getBucketListCallBack(response){ try{ - this.buckets = response.map((bucket) => { - return { - title: bucket.name, - to: `/buckets/${bucket.name}`, - active: false + if(response.status ==200){ + this.buckets = response.map((bucket) => { + return { + title: bucket.name, + to: `/buckets/${bucket.name}`, + active: false + } + }) + this.menus.find((obj) => { + if (obj.title === 'Storage') { + obj.items = this.buckets + } + }) } - }) - this.menus.find((obj) => { - if (obj.title === 'Storage') { - obj.items = this.buckets - } - }) }catch(err) { console.error("ERROR with list buckets "+err); } From 816645678c8cef2b96f912acc991768744b8f0c3 Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Fri, 2 Feb 2024 11:50:24 +0100 Subject: [PATCH 05/13] Fix FDL EGI error --- src/components/forms/FDLForm.vue | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/components/forms/FDLForm.vue b/src/components/forms/FDLForm.vue index 578b0be..6a87a69 100644 --- a/src/components/forms/FDLForm.vue +++ b/src/components/forms/FDLForm.vue @@ -216,15 +216,22 @@ export default { } var params=this.prepareFunction() const response = await fetch(this.api+'/system/services',options); - const json = await response.json(); - let result = json.map(service => service.name); + if (response != null){ + const json = await response.json(); + let result = json.map(service => service.name); + }else{ + options.method="PUT" + var typecall="created" + } for (let index = 0; index < params.length; index++) { - if(result.includes(params[index].name)){ - options.method="PUT" - var typecall="created" - }else{ - options.method="POST" - var typecall="edited" + if (response != null){ + if( result.includes(params[index].name)){ + options.method="PUT" + var typecall="created" + }else{ + options.method="POST" + var typecall="edited" + } } options.body= JSON.stringify(params[index]) const response = await fetch(this.api+'/system/services',options); From fb7437cc841f93d3ad1342bf27af2d02913dba1a Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Fri, 2 Feb 2024 11:57:12 +0100 Subject: [PATCH 06/13] Fix FDL EGI error --- src/components/forms/FDLForm.vue | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/components/forms/FDLForm.vue b/src/components/forms/FDLForm.vue index 6a87a69..c457122 100644 --- a/src/components/forms/FDLForm.vue +++ b/src/components/forms/FDLForm.vue @@ -216,22 +216,19 @@ export default { } var params=this.prepareFunction() const response = await fetch(this.api+'/system/services',options); - if (response != null){ - const json = await response.json(); - let result = json.map(service => service.name); - }else{ - options.method="PUT" - var typecall="created" - } + console.log(response) + const json = await response.json(); + console.log(json) + let result = json.map(service => service.name); + console.log(result) + for (let index = 0; index < params.length; index++) { - if (response != null){ - if( result.includes(params[index].name)){ - options.method="PUT" - var typecall="created" - }else{ - options.method="POST" - var typecall="edited" - } + if(result.includes(params[index].name)){ + options.method="PUT" + var typecall="created" + }else{ + options.method="POST" + var typecall="edited" } options.body= JSON.stringify(params[index]) const response = await fetch(this.api+'/system/services',options); From 28835064af65fb4f670e5bdcba2d8610a727b5b6 Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Fri, 2 Feb 2024 12:09:54 +0100 Subject: [PATCH 07/13] Fix FDL EGI error --- src/components/forms/FDLForm.vue | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/forms/FDLForm.vue b/src/components/forms/FDLForm.vue index c457122..1f67750 100644 --- a/src/components/forms/FDLForm.vue +++ b/src/components/forms/FDLForm.vue @@ -216,19 +216,25 @@ export default { } var params=this.prepareFunction() const response = await fetch(this.api+'/system/services',options); - console.log(response) - const json = await response.json(); - console.log(json) - let result = json.map(service => service.name); + try{ + const json = await response.json(); + let result = json.map(service => service.name); + }catch(err) { + console.error("ERROR with list services "+err); + let result = null + options.method="PUT" + var typecall="created" + } console.log(result) - for (let index = 0; index < params.length; index++) { - if(result.includes(params[index].name)){ + if(result != null){ + if(result.includes(params[index].name)){ options.method="PUT" var typecall="created" - }else{ - options.method="POST" - var typecall="edited" + }else{ + options.method="POST" + var typecall="edited" + } } options.body= JSON.stringify(params[index]) const response = await fetch(this.api+'/system/services',options); From 0bb6e91fd2b5fbd1fc0dbf894b3cc77aaed6bfa9 Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Fri, 2 Feb 2024 12:14:28 +0100 Subject: [PATCH 08/13] Fix FDL EGI error --- src/components/forms/FDLForm.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/forms/FDLForm.vue b/src/components/forms/FDLForm.vue index 1f67750..2b25cf3 100644 --- a/src/components/forms/FDLForm.vue +++ b/src/components/forms/FDLForm.vue @@ -216,6 +216,7 @@ export default { } var params=this.prepareFunction() const response = await fetch(this.api+'/system/services',options); + let result ="" try{ const json = await response.json(); let result = json.map(service => service.name); From 10d48af25f4ef2e494a773ccb12e99451d40589e Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Fri, 2 Feb 2024 12:19:11 +0100 Subject: [PATCH 09/13] Fix FDL EGI error --- src/components/forms/FDLForm.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/forms/FDLForm.vue b/src/components/forms/FDLForm.vue index 2b25cf3..367904b 100644 --- a/src/components/forms/FDLForm.vue +++ b/src/components/forms/FDLForm.vue @@ -219,10 +219,10 @@ export default { let result ="" try{ const json = await response.json(); - let result = json.map(service => service.name); + result = json.map(service => service.name); }catch(err) { console.error("ERROR with list services "+err); - let result = null + result = null options.method="PUT" var typecall="created" } From f4dbbe9793e19149f457ef50b7d94f8dd4db20fc Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Fri, 2 Feb 2024 12:28:27 +0100 Subject: [PATCH 10/13] Fix FDL EGI error --- src/components/forms/FDLForm.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/forms/FDLForm.vue b/src/components/forms/FDLForm.vue index 367904b..c7fb391 100644 --- a/src/components/forms/FDLForm.vue +++ b/src/components/forms/FDLForm.vue @@ -223,7 +223,7 @@ export default { }catch(err) { console.error("ERROR with list services "+err); result = null - options.method="PUT" + options.method="POST" var typecall="created" } console.log(result) @@ -231,10 +231,10 @@ export default { if(result != null){ if(result.includes(params[index].name)){ options.method="PUT" - var typecall="created" + var typecall="edited" }else{ options.method="POST" - var typecall="edited" + var typecall="created" } } options.body= JSON.stringify(params[index]) From 16d2030d404d14ed2650f69da9be299650a54a4b Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Mon, 5 Feb 2024 09:17:48 +0100 Subject: [PATCH 11/13] FDL form fix --- src/components/forms/FDLForm.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/forms/FDLForm.vue b/src/components/forms/FDLForm.vue index c7fb391..ff71a50 100644 --- a/src/components/forms/FDLForm.vue +++ b/src/components/forms/FDLForm.vue @@ -230,8 +230,8 @@ export default { for (let index = 0; index < params.length; index++) { if(result != null){ if(result.includes(params[index].name)){ - options.method="PUT" - var typecall="edited" + options.method="PUT" + var typecall="edited" }else{ options.method="POST" var typecall="created" @@ -248,7 +248,7 @@ export default { this.form.check=false }, 5000); }else{ - window.getApp.$emit('APP_SHOW_SNACKBAR', { text: response, color: 'error' }) + window.getApp.$emit('APP_SHOW_SNACKBAR', { text: response.data, color: 'error' }) this.form.wrong=true setTimeout(() => { this.form.wrong=false From 34f552da193d65bd96a9e00f6da27d3b2aa5b48e Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Mon, 5 Feb 2024 09:22:34 +0100 Subject: [PATCH 12/13] FDL form fix --- src/components/forms/FDLForm.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/forms/FDLForm.vue b/src/components/forms/FDLForm.vue index ff71a50..860f017 100644 --- a/src/components/forms/FDLForm.vue +++ b/src/components/forms/FDLForm.vue @@ -248,6 +248,7 @@ export default { this.form.check=false }, 5000); }else{ + console.log(response) window.getApp.$emit('APP_SHOW_SNACKBAR', { text: response.data, color: 'error' }) this.form.wrong=true setTimeout(() => { From 2a6d1832bb8da449059fa5868229d693cb6a12b7 Mon Sep 17 00:00:00 2001 From: SergioLangaritaBenitez Date: Mon, 5 Feb 2024 09:42:01 +0100 Subject: [PATCH 13/13] FDL form fix --- src/components/forms/FDLForm.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/forms/FDLForm.vue b/src/components/forms/FDLForm.vue index 860f017..251310a 100644 --- a/src/components/forms/FDLForm.vue +++ b/src/components/forms/FDLForm.vue @@ -248,8 +248,7 @@ export default { this.form.check=false }, 5000); }else{ - console.log(response) - window.getApp.$emit('APP_SHOW_SNACKBAR', { text: response.data, color: 'error' }) + window.getApp.$emit('APP_SHOW_SNACKBAR', { text: response, color: 'error' }) this.form.wrong=true setTimeout(() => { this.form.wrong=false