Demo Change

This commit is contained in:
mr 2024-07-30 15:56:12 +02:00
parent 1bb89db5c8
commit e9e908939e
4 changed files with 32 additions and 28 deletions

View File

@ -21,10 +21,10 @@ func (o *ResourceController) GetAll() {
if d.Code != 200 || len(d.Data) == 0 { if d.Code != 200 || len(d.Data) == 0 {
results[resource.String()] = []interface{}{} results[resource.String()] = []interface{}{}
} else { } 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() o.ServeJSON()
} }
@ -41,10 +41,10 @@ func (o *ResourceController) Search() {
if d.Code != 200 || len(d.Data) == 0 { if d.Code != 200 || len(d.Data) == 0 {
results[resource.String()] = []interface{}{} results[resource.String()] = []interface{}{}
} else { } 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() o.ServeJSON()
} }
@ -62,10 +62,10 @@ func (o *ResourceController) Get() {
if d.Code != 200 { if d.Code != 200 {
results[resource.String()] = nil results[resource.String()] = nil
} else { } 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() o.ServeJSON()
} }
@ -82,9 +82,9 @@ func (o *ResourceController) Delete() {
if d.Code != 200 { if d.Code != 200 {
results[resource.String()] = nil results[resource.String()] = nil
} else { } 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() o.ServeJSON()
} }

View File

@ -5,7 +5,7 @@
{ {
"name": "Mundi Sentienl 3 SRAL Images", "name": "Mundi Sentienl 3 SRAL Images",
"short_description": "Mundi Sentinels 3 SAR Altiemter image", "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", "description": "A very long description of what this data is",
"owner": "Mundi Web", "owner": "Mundi Web",
"example": "string", "example": "string",
@ -15,7 +15,7 @@
{ {
"name": "Mundi Sentienl 3 OLCI Images", "name": "Mundi Sentienl 3 OLCI Images",
"short_description": "Mundi Sentinels 3 Ocean and land color Altiemter image", "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", "description": "A very long description of what this data is",
"owner": "Mundi Web", "owner": "Mundi Web",
"example": "string", "example": "string",
@ -25,7 +25,7 @@
{ {
"name": "Meteo-France forecasts", "name": "Meteo-France forecasts",
"short_description": "Meteo France weather 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", "description": "A very long description of what this data is",
"owner": "Meteo-France", "owner": "Meteo-France",
"example": "string", "example": "string",
@ -35,7 +35,7 @@
{ {
"name": "Meteo-France wind archive", "name": "Meteo-France wind archive",
"short_description": "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", "description": "A very long description of what this data is",
"owner": "Meteo-France", "owner": "Meteo-France",
"example": "string", "example": "string",
@ -50,7 +50,7 @@
{ {
"name": "SAR High points", "name": "SAR High points",
"short_description": "SAR Altimeter High points extraction Software", "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", "description": "A very long description of what this data is",
"owner": "IRT", "owner": "IRT",
"price": 300, "price": 300,
@ -120,7 +120,7 @@
{ {
"name": "Flammable vegetation slicer", "name": "Flammable vegetation slicer",
"short_description": "Analyze land cover and define optimum vegetation slices to prevent fire propagation", "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", "description": "A very long description of what this data is",
"cpus": [{ "cpus": [{
"cores": 8, "cores": 8,
@ -140,7 +140,7 @@
{ {
"name": "Long term fire risk mitigation planner", "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", "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", "description": "A very long description of what this data is",
"cpus": [{ "cpus": [{
"cores": 8, "cores": 8,
@ -159,7 +159,7 @@
{ {
"name": "Fire propagation simulator", "name": "Fire propagation simulator",
"short_description": "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", "description": "A very long description of what this data is",
"cpus": [{ "cpus": [{
"cores": 8, "cores": 8,
@ -187,7 +187,7 @@
{ {
"name": "Environment builder", "name": "Environment builder",
"short_description": "build simulated environment from real environmental data and fire mitigation rules ", "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", "description": "A very long description of what this data is",
"cpus": [{ "cpus": [{
"cores": 8, "cores": 8,
@ -240,7 +240,7 @@
"name": "CURL", "name": "CURL",
"image" : "curlimages/curl:7.88.1", "image" : "curlimages/curl:7.88.1",
"short_description": "Transfer or retrieve information from or to a server ", "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.", "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", "owner": "IRT",
"price": 300, "price": 300,
@ -311,7 +311,7 @@
"name": "alpine", "name": "alpine",
"image" : "alpine:3.7", "image" : "alpine:3.7",
"short_description": "A minimal Docker image ", "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", "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", "owner": "IRT",
"price": 300, "price": 300,
@ -382,7 +382,7 @@
"name": "alpr", "name": "alpr",
"image" : "openalpr/openalpr", "image" : "openalpr/openalpr",
"short_description": "Open source Automatic License Plate Recognition library.", "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 Rekors OpenALPR suite of solutions designed to provide invaluable vehicle intelligence which enhances business capabilities, automates tasks, and increases overall community safety!", "description": "Deploy license plate and vehicle recognition with Rekors OpenALPR suite of solutions designed to provide invaluable vehicle intelligence which enhances business capabilities, automates tasks, and increases overall community safety!",
"owner": "IRT", "owner": "IRT",
"price": 300, "price": 300,
@ -453,7 +453,7 @@
"name": "imagemagic", "name": "imagemagic",
"image" : "dpokidov/imagemagick:7.1.0-62-2", "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.", "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.", "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", "owner": "IRT",
"price": 300, "price": 300,
@ -523,7 +523,7 @@
{ {
"name": "Mosquito server", "name": "Mosquito server",
"short_description": "open source message broker that implements the MQTT protocol versions 5.0, 3.1.1 and 3.1.", "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", "description": "A very long description of what this storage is",
"owner": "IRT", "owner": "IRT",
"price": 300, "price": 300,
@ -598,7 +598,7 @@
{ {
"name": "IRT risk database", "name": "IRT risk database",
"short_description": "IRT Database instance", "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", "owner": "IRT",
"description": "A very long description of what this storage is", "description": "A very long description of what this storage is",
"type": "database", "type": "database",
@ -613,7 +613,7 @@
{ {
"name": "IRT local file storage", "name": "IRT local file storage",
"short_description": "S3 compliant IRT 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", "description": "A very long description of what this storage is",
"owner": "IRT", "owner": "IRT",
"acronym": "DC_myDC", "acronym": "DC_myDC",
@ -637,7 +637,7 @@
"oc-catalog:49618" "oc-catalog:49618"
], ],
"short_description": "Mundi Opencloud Instance", "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", "description": "A very long description of what this data is",
"type": "datacenter", "type": "datacenter",
"bookingPrice": 650, "bookingPrice": 650,
@ -669,7 +669,7 @@
"dc1:49618" "dc1:49618"
], ],
"short_description": "CNES Opencloud Instance", "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", "description": "A very long description of what this data is",
"type": "datacenter", "type": "datacenter",
"bookingPrice": 650, "bookingPrice": 650,
@ -694,7 +694,7 @@
"dc2:49618" "dc2:49618"
], ],
"short_description": "Meteo France Opencloud Instance", "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", "description": "A very long description of what this data is",
"type": "datacenter", "type": "datacenter",
"bookingPrice": 650, "bookingPrice": 650,

2
go.mod
View File

@ -11,7 +11,7 @@ require (
) )
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 filippo.io/edwards25519 v1.1.0 // indirect
github.com/beego/bee/v2 v2.1.0 // indirect github.com/beego/bee/v2 v2.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect

4
go.sum
View File

@ -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-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 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-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= 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 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=