VDC Control Panel Code

The source code for the VDC Control Panel is available on GitHub: https://github.com/0-complexity/G8VDC

Also see the GitBook for the VDC Control Panel

In the WHMCS reference implementation an iframe is used to display the VDC Control Panel:

<iframe id="vdc" src="/whmcs/templates/itsyouonline/vdc_control/index.html?jwt={$jwt}&vdc_id={$vdc_id}"></iframe>

This iframe is defined in the file vdc.tpl which gets installed together with vdc.php as part of the Cockpit Add-on Module:

  • vdc.tpl can be found under templates/itsyouonline - or any other template folder that is current for you setup where you use the VDC Control Panel
  • vdc.php can be found in the root directory of your WHMCS setup

This iframe tag takes two attribute values:

  • id: an identifier for your iframe
  • src: address/location of the VDC Control Panel source files in your WHMCS setup + a query string

The query string part of the src attribute has two fields:

  • jwt: the JSON web token, received from and signed by ItsYou.online, in order to securily interact with the G8 node
  • vdc_id: id of the virtual datacenter as know on the G8 node where the virtual datacenter is hosted

Both query string field values are fetched as template variables, which were set previously:

  • The jwt value was set in step 5 of the "authorization code" grant type flow as implemented
  • The vdc_id value was set in vdc.php where the user is redirected to when clicking the VDC Control Panel in the Client Area
    • This happens through the cockpit_vdc() function that is called when the user clicks the VDC Control Panel, as implemented in the Cockpit Add-on Module, and documented here
    • In vdc.php we first load the blueprint of the VDC, from which we then get the address of the hosting G8 node and id of the VDC

results matching ""

    No results matching ""