Subscription.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /* * ********************************************************************
  3. * ProxmoxAddon product developed. (Aug 14, 2018)
  4. * *
  5. *
  6. * CREATED BY MODULESGARDEN -> http://modulesgarden.com
  7. * CONTACT -> contact@modulesgarden.com
  8. *
  9. *
  10. * This software is furnished under a license and may be used and copied
  11. * only in accordance with the terms of such license and with the
  12. * inclusion of the above copyright notice. This software or any other
  13. * copies thereof may not be provided or otherwise made available to any
  14. * other person. No title to and ownership of the software is hereby
  15. * transferred.
  16. *
  17. *
  18. * ******************************************************************** */
  19. namespace ModulesGarden\ProxmoxAddon\App\UI\NodeDetail\Pages;
  20. use MGProvision\Proxmox\v2\models\Node;
  21. use ModulesGarden\ProxmoxAddon\App\Services\BaseService;
  22. use ModulesGarden\ProxmoxAddon\Core\UI\Interfaces\AdminArea;
  23. use ModulesGarden\ProxmoxAddon\Core\UI\Interfaces\AjaxElementInterface;
  24. use ModulesGarden\ProxmoxAddon\Core\UI\ResponseTemplates\RawDataJsonResponse;
  25. class Subscription extends Summary implements AdminArea, AjaxElementInterface
  26. {
  27. use BaseService;
  28. protected $id = 'mg-subscription';
  29. protected $name = 'mg-subscription-name';
  30. protected $title = 'mg-subscription-title';
  31. protected $vueComponent = true;
  32. protected $defaultVueComponentName = 'mg-subscription';
  33. public function initContent()
  34. {
  35. }
  36. public function returnAjaxData()
  37. {
  38. $data = [];
  39. $this->setServerId($this->getRequestValue('serverId'))
  40. ->getApi()
  41. ->setInstance();
  42. $node = new Node($this->getRequestValue('id'));
  43. $this->customTplVars['subscription'] = $node->getSubscription();
  44. $data['subscription'] = $node->getSubscription();
  45. return (new RawDataJsonResponse(['data' => $data]));
  46. }
  47. }