You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/09/23 19:59:58 UTC

[GitHub] [cloudstack] GutoVeronezi commented on pull request #6505: Gives the possibility to redirect to external links when the property is defined

GutoVeronezi commented on PR #6505:
URL: https://github.com/apache/cloudstack/pull/6505#issuecomment-1256620785

   @RodrigoDLopez, I think what @rohityadavcloud means is that in file `/ui/public/config.json` there is a property to define third party plugins in the UI. It does not work exactly the same; however, it is similar. Here is a simple example of how to use the plugins to achieve something similiar to what you proposed: 
    
   - In `config.json` I added the following: 
   ```json 
     ... 
     "plugins": [ 
               {"name": "some testing", "icon": "cloud", "path": "https://cloudstack.apache.org/api/apidocs-4.17/"} 
     ], 
     ... 
   ``` 
    
   Then, `/ui/src/config/router.js` will handle this property, creating a new menu for each entry that will address it in an `IFrame`: 
    
   ``` 
     const plugins = Vue.prototype.$config.plugins 
     if (plugins && plugins.length > 0) { 
       plugins.map(plugin => { 
         routerMap[0].children.push({ 
           path: '/plugins/' + plugin.name, 
           name: plugin.name, 
           component: IFramePlugin, 
           meta: { title: plugin.name, icon: plugin.icon, path: plugin.path } 
         }) 
       }) 
     } 
    
     return routerMap 
   } 
   ``` 
    
   The result is: 
    
   ![image](https://user-images.githubusercontent.com/38945620/192044222-a67cfa71-69aa-4118-b558-7d7e3db0e428.png) 
    
   The [official documentation] has more examples on how to use it. 
    
   I like the result that your proposal generates (a single icon or list of icons redirecting the user). In some cases it can be better aesthetically (and functionally) for the user than a new menu opening the page inside ACS. 
    
   With that said, I think we could extend the `plugins` functionallity to be able to generate the kind of result you proposed instead of creating a new set of properties. What do you think? 
    
    
   [official documentation]: https://docs.cloudstack.apache.org/en/latest/developersguide/plugins.html#third-party-ui-plugins 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org