From e9e908939efbd95db0227d983a7ca6db33e3f449 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 30 Jul 2024 15:56:12 +0200 Subject: [PATCH] Demo Change --- controllers/resource.go | 16 ++++++++-------- demo.json | 38 +++++++++++++++++++------------------- go.mod | 2 +- go.sum | 4 ++++ 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/controllers/resource.go b/controllers/resource.go index 2a4df32..c2a417b 100644 --- a/controllers/resource.go +++ b/controllers/resource.go @@ -21,10 +21,10 @@ func (o *ResourceController) GetAll() { if d.Code != 200 || len(d.Data) == 0 { results[resource.String()] = []interface{}{} } else { - results[resource.String()] = d + results[resource.String()] = d.Data } } - o.Data["json"] = results + o.Data["json"] = map[string]interface{}{"data": results, "code": 200, "error": ""} o.ServeJSON() } @@ -41,10 +41,10 @@ func (o *ResourceController) Search() { if d.Code != 200 || len(d.Data) == 0 { results[resource.String()] = []interface{}{} } else { - results[resource.String()] = d + results[resource.String()] = d.Data } } - o.Data["json"] = results + o.Data["json"] = map[string]interface{}{"data": results, "code": 200, "error": ""} o.ServeJSON() } @@ -62,10 +62,10 @@ func (o *ResourceController) Get() { if d.Code != 200 { results[resource.String()] = nil } else { - results[resource.String()] = d + results[resource.String()] = d.Data } } - o.Data["json"] = results + o.Data["json"] = map[string]interface{}{"data": results, "code": 200, "error": ""} o.ServeJSON() } @@ -82,9 +82,9 @@ func (o *ResourceController) Delete() { if d.Code != 200 { results[resource.String()] = nil } else { - results[resource.String()] = d + results[resource.String()] = d.Data } } - o.Data["json"] = results + o.Data["json"] = map[string]interface{}{"data": results, "code": 200, "error": ""} o.ServeJSON() } diff --git a/demo.json b/demo.json index 02bbe44..b1a011e 100644 --- a/demo.json +++ b/demo.json @@ -5,7 +5,7 @@ { "name": "Mundi Sentienl 3 SRAL Images", "short_description": "Mundi Sentinels 3 SAR Altiemter image", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/Mundi Sentienl 3 SRAL Images.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Mundi Sentienl 3 SRAL Images.png", "description": "A very long description of what this data is", "owner": "Mundi Web", "example": "string", @@ -15,7 +15,7 @@ { "name": "Mundi Sentienl 3 OLCI Images", "short_description": "Mundi Sentinels 3 Ocean and land color Altiemter image", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/Mundi Sentienl 3 OLCI Images.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Mundi Sentienl 3 OLCI Images.png", "description": "A very long description of what this data is", "owner": "Mundi Web", "example": "string", @@ -25,7 +25,7 @@ { "name": "Meteo-France forecasts", "short_description": "Meteo France weather forecasts", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/Meteo-France forecasts.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Meteo-France forecasts.png", "description": "A very long description of what this data is", "owner": "Meteo-France", "example": "string", @@ -35,7 +35,7 @@ { "name": "Meteo-France wind archive", "short_description": "Meteo France wind archive", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/Meteo-France wind archive.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Meteo-France wind archive.png", "description": "A very long description of what this data is", "owner": "Meteo-France", "example": "string", @@ -50,7 +50,7 @@ { "name": "SAR High points", "short_description": "SAR Altimeter High points extraction Software", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/SAR High points.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/SAR High points.png", "description": "A very long description of what this data is", "owner": "IRT", "price": 300, @@ -120,7 +120,7 @@ { "name": "Flammable vegetation slicer", "short_description": "Analyze land cover and define optimum vegetation slices to prevent fire propagation", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/Flammable vegetation slicer.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Flammable vegetation slicer.png", "description": "A very long description of what this data is", "cpus": [{ "cores": 8, @@ -140,7 +140,7 @@ { "name": "Long term fire risk mitigation planner", "short_description": "Long term fire risk mitigation planner : provides list of actions to be performed to mitigate fire propagation", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/Long term fire risk mitigation planner.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Long term fire risk mitigation planner.png", "description": "A very long description of what this data is", "cpus": [{ "cores": 8, @@ -159,7 +159,7 @@ { "name": "Fire propagation simulator", "short_description": "Fire propagation simulator", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/Fire propagation simulator.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Fire propagation simulator.png", "description": "A very long description of what this data is", "cpus": [{ "cores": 8, @@ -187,7 +187,7 @@ { "name": "Environment builder", "short_description": "build simulated environment from real environmental data and fire mitigation rules ", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/Environment builder.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Environment builder.png", "description": "A very long description of what this data is", "cpus": [{ "cores": 8, @@ -240,7 +240,7 @@ "name": "CURL", "image" : "curlimages/curl:7.88.1", "short_description": "Transfer or retrieve information from or to a server ", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/curl-logo.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/curl-logo.png", "description": "curl is a tool for transferring data from or to a server. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.", "owner": "IRT", "price": 300, @@ -311,7 +311,7 @@ "name": "alpine", "image" : "alpine:3.7", "short_description": "A minimal Docker image ", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/alpine-logo.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/alpine-logo.png", "description": "Alpine Linux is a Linux distribution built around musl libc and BusyBox. The image is only 5 MB in size and has access to a package repository that is much more complete than other BusyBox based images. This makes Alpine Linux a great image base for utilities and even production applications", "owner": "IRT", "price": 300, @@ -382,7 +382,7 @@ "name": "alpr", "image" : "openalpr/openalpr", "short_description": "Open source Automatic License Plate Recognition library.", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/alpr-logo.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/alpr-logo.png", "description": "Deploy license plate and vehicle recognition with Rekorā€™s OpenALPR suite of solutions designed to provide invaluable vehicle intelligence which enhances business capabilities, automates tasks, and increases overall community safety!", "owner": "IRT", "price": 300, @@ -453,7 +453,7 @@ "name": "imagemagic", "image" : "dpokidov/imagemagick:7.1.0-62-2", "short_description": "ImageMagickĀ® is a free, open-source software suite, used for editing and manipulating digital images.", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/imagemagic-logo.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/imagemagic-logo.png", "description": "Use ImageMagick to create, edit, compose, and convert digital images. Resize an image, crop it, change its shades and colors, add captions, and more.", "owner": "IRT", "price": 300, @@ -523,7 +523,7 @@ { "name": "Mosquito server", "short_description": "open source message broker that implements the MQTT protocol versions 5.0, 3.1.1 and 3.1.", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/mosquitto-logo.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/mosquitto-logo.png", "description": "A very long description of what this storage is", "owner": "IRT", "price": 300, @@ -598,7 +598,7 @@ { "name": "IRT risk database", "short_description": "IRT Database instance", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/IRT risk database.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/IRT risk database.png", "owner": "IRT", "description": "A very long description of what this storage is", "type": "database", @@ -613,7 +613,7 @@ { "name": "IRT local file storage", "short_description": "S3 compliant IRT file storage", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/IRT local file storage.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/IRT local file storage.png", "description": "A very long description of what this storage is", "owner": "IRT", "acronym": "DC_myDC", @@ -637,7 +637,7 @@ "oc-catalog:49618" ], "short_description": "Mundi Opencloud Instance", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/Mundi datacenter.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Mundi datacenter.png", "description": "A very long description of what this data is", "type": "datacenter", "bookingPrice": 650, @@ -669,7 +669,7 @@ "dc1:49618" ], "short_description": "CNES Opencloud Instance", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/CNES datacenter.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/CNES datacenter.png", "description": "A very long description of what this data is", "type": "datacenter", "bookingPrice": 650, @@ -694,7 +694,7 @@ "dc2:49618" ], "short_description": "Meteo France Opencloud Instance", - "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/src/branch/main/scripts/local_imgs/Meteo France datacenter.png", + "logo": "https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Meteo France datacenter.png", "description": "A very long description of what this data is", "type": "datacenter", "bookingPrice": 650, diff --git a/go.mod b/go.mod index e627e77..db67ade 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( ) require ( - cloud.o-forge.io/core/oc-lib v0.0.0-20240730072752-250fefd0d85e // indirect + cloud.o-forge.io/core/oc-lib v0.0.0-20240730124133-b06193add2fe // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/beego/bee/v2 v2.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/go.sum b/go.sum index 86ccdc5..7d15993 100644 --- a/go.sum +++ b/go.sum @@ -116,6 +116,10 @@ cloud.o-forge.io/core/oc-lib v0.0.0-20240730065931-4730d5b4d401 h1:kp1sHyrRIoa4i cloud.o-forge.io/core/oc-lib v0.0.0-20240730065931-4730d5b4d401/go.mod h1:V5EL+NV2s9P1/BcFm3/icfLeBYVVMLl1Z0F0eecJZGo= cloud.o-forge.io/core/oc-lib v0.0.0-20240730072752-250fefd0d85e h1:1rBqh6/cGgCukaRhj0I5Ypb6ydA9/EHUsH/pw+1yJQ4= cloud.o-forge.io/core/oc-lib v0.0.0-20240730072752-250fefd0d85e/go.mod h1:V5EL+NV2s9P1/BcFm3/icfLeBYVVMLl1Z0F0eecJZGo= +cloud.o-forge.io/core/oc-lib v0.0.0-20240730120827-e784216584c5 h1:bLfJQlQpOy6U7tX6NNwkNH3Baj7BlZ18ITG1+7cZB6M= +cloud.o-forge.io/core/oc-lib v0.0.0-20240730120827-e784216584c5/go.mod h1:V5EL+NV2s9P1/BcFm3/icfLeBYVVMLl1Z0F0eecJZGo= +cloud.o-forge.io/core/oc-lib v0.0.0-20240730124133-b06193add2fe h1:dAA8GotTauJxVzs0tq1Ltu6JvorgnQ3rsH0yVmtmJkY= +cloud.o-forge.io/core/oc-lib v0.0.0-20240730124133-b06193add2fe/go.mod h1:V5EL+NV2s9P1/BcFm3/icfLeBYVVMLl1Z0F0eecJZGo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=