sonata-nfv / tng-portal

The 5GTANGO (web) Portal
Apache License 2.0
1 stars 7 forks source link

[SDK] Show generated descriptors #269

Closed anapolg closed 5 years ago

anapolg commented 5 years ago

As soon as you've got the number of VNFs and the general information form is completed (all the first step is completed correctly) you need to send a request to generate the skeleton of the descriptors to the SDK (tng-sdk-project). The information retrieved will be included in the description boxes displayed in the second step for NSD and VNFDs.

stefanbschneider commented 5 years ago

Once the tng-sdk-project REST API exposes the generated files, it should be easy to display them (read-only) in the portal. Depends on this: https://github.com/sonata-nfv/tng-sdk-project/issues/83

stefanbschneider commented 5 years ago

Display descriptors inside frontend: https://stackoverflow.com/a/57292853/2745116

Showing the descriptors in an iframe works in Chrome. In Firefox, it directly downloads the descriptors rather than displaying them. Just put a placeholder there for now.

anapolg commented 5 years ago

Please check https://pre-int-sp-ath.5gtango.eu/service-management/network-services/network-service-instances/ea97e082-a304-4dab-b750-b69d05f4c441 Try to open one of the table entries in the bottom of the page. If what you want is something similar you can try to reuse some of the code from that component.

stefanbschneider commented 5 years ago

Thanks. This looks to me like tables right? My plan was to directly display the whole content of the descriptors. Do you have anything implemented for displaying text files (eg, descriptors) already?

But I'm putting this on hold for now and focusing on the next issue #273

anapolg commented 5 years ago

Yes, that one is a table and if you click any entry it gets opened while displaying more info.

For just displaying texts I have this usually: image https://pre-int-sp-ath.5gtango.eu/settings/vim/88888888-2222-3333-4444-888888888888

Styles of that box are general to all the app under the class name "description". If you search in that component (or you search the string ' class="description" ') you will find a couple examples on how to use it.

If you just want to display text, use a simpler example of the description boxes, like the one below. The previous includes logic to display JSON or text (editable JSON) in case you want to modify the JSON variable displayed. This one below just displays a text coming from a variable. No edition no nothing extra.

image https://pre-int-sp-ath.5gtango.eu/service-management/network-services/services/6a21d937-97af-4cdc-9678-e7ca511e10e2

stefanbschneider commented 5 years ago

Nice, thanks! I'll have a look. I don't need editing. Some kind of syntax highlighting would be nice, but not mandatory.

Also, I just remembered, I previously used Google prettify to show generated descriptors in my old, pure JS descriptor generator.

Also, check again this new answer: https://stackoverflow.com/a/57293556/2745116

I'll just check the option and go with the one that looks best and is easiest :)