Simplified Step-by-Step Guide
- Locate the File to Modify
- Go to
modules/servers/ProxmoxCloudVps/app/UI/
. - Navigate to the folder that matches your element’s category, type, and name. For example, if you are modifying
VmsDataTable
, the path is:modules/servers/ProxmoxCloudVps/app/UI/Vms/Pages/VmsDataTable.php
- Identify the Namespace
- Open your browser’s DevTools (F12).
- Go to the Network tab.
- Find the request related to the element you want to modify.
- Look for the “Namespace” parameter in that request to confirm the correct file.
- Create the Templates Folder
- Go back to the category folder (e.g.,
Vms
). - Create a folder named
Templates
inside it. - Inside
Templates
, create another folder with the same name as the element type, starting with a lowercase letter. For example:modules/servers/ProxmoxCloudVps/app/UI/Vms/Templates/pages
- Create the Template File
- In the
pages
folder, create a file named{element_name}.tpl
with a lowercase letter. ForVmsDataTable
, it will be:vmsDataTable.tpl
- Copy contents from an existing template file:
- Open the original template file (e.g.,
VmsDataTable.tpl
). - Find the line with
extends
. - Copy the content from the relevant template file it extends from, like:
modules/servers/ProxmoxCloudVps/templates/client/default/ui/core/default/widget/dataTable/dataTable.tpl
- Paste it into your new file (
vmsDataTable.tpl
).
- Open the original template file (e.g.,
- Create Additional Files for Vue Components
- If your new
.tpl
file contains a Vue component tag:- Create
{element_name}_components.tpl
, e.g.:vmsDataTable_components.tpl
- Copy content from the corresponding
_components.tpl
file. - Create
{element_name}_components.js
, e.g.:vmsDataTable_components.js
- Copy content from the corresponding
.js
file.
- Create
- Modify the Component Name
- In the original PHP file (e.g.,
VmsDataTable.php
), add a line to set a custom name:mg-{lowercase_element_name}
Example:php protected $name = 'mg-vmsdatatable';
- Edit the Component Files
- In
{element_name}_components.tpl
, update the tag name:html <script type="text/x-template" id="t-mg-vmsdatatable">
- In
{element_name}_components.js
, update the component name in two places to match.
Example
For VmsDataTable
:
- Locate:
modules/servers/ProxmoxCloudVps/app/UI/Vms/Pages/VmsDataTable.php
- Identify Namespace via DevTools.
- Create Folders:
modules/servers/ProxmoxCloudVps/app/UI/Vms/Templates/pages
- Create
vmsDataTable.tpl
:
- Copy content from:
modules/servers/ProxmoxCloudVps/templates/client/default/ui/core/default/widget/dataTable/dataTable.tpl
- Create Vue Component Files:
- Create
vmsDataTable_components.tpl
and copy fromdataTable_components.tpl
. - Create
vmsDataTable_components.js
and copy fromdataTable.js
.
- Modify Component Name in
VmsDataTable.php
:
protected $name = 'mg-vmsdatatable';
- Edit Component Files:
- Update ID in
vmsDataTable_components.tpl
:html <script type="text/x-template" id="t-mg-vmsdatatable">
- Update component name in
vmsDataTable_components.js
.
Now you can edit the HTML and JS as needed. If you need more help with any specific step, just let me know!