Template Management
Walrus provides the following two levels of templates:
- Project Template: Applied to a specific project, project templates can be used within the current project.
- Global Template: A template that can be applied to all projects, global templates can be used across all projects.
View Template List
- Walrus has a built-in template library, and the template list includes all templates from the library as well as independently added templates.
- Navigate to the template list page.
- Project Template: Click on the
Application Managementmenu in the left navigation bar, choose the respective project, and click theTemplatetab. - Global Template: Click on the
Operations Hubmenu in the navigation bar and go to theTemplatetab.
- Project Template: Click on the
Adding Templates
Navigate to the template list page.
- Project Template: Click on the
Application Managementmenu in the left navigation bar, choose the respective project, and click theTemplatetab. - Global Template: Click on the
Operations Hubmenu in the navigation bar and go to theTemplatetab.
- Project Template: Click on the
Enter the template list page.
Click the
New Templatebutton.Enter the template's name, description, and source. Where,
- Source: Compatible address with Terraform git-type module sources, refer to documentation. Examples:
You can specify a version through the ref parameter, and the specified version must be a tag or branch existing in the git repository. You can import templates from subdirectories by appending a subdirectory path after the repository URL.
Click the
Confirmbutton.
Editing a Template
- Enter the
Templatetab.- Project Template: Click on
Application Managementin the navigation bar and select the corresponding project, then click on theTemplatetab. - Global Template: Click on
Operations Hubin the navigation bar and enter theTemplatetab.
- Project Template: Click on
- Find the template you need to edit.
- Click the more operations button indicated by the thumbnail and select `edit``.
- Modify the corresponding attribute values as per your need.
- Click the
OKbutton.
Deleting a Template
- Enter the
Templatetab.- Project Template: Click on
Application Managementin the navigation bar and select the corresponding project, then click on theTemplatetab. - Global Template: Click on
Operations Hubin the navigation bar and enter theTemplatetab.
- Project Template: Click on
- Select the template you need to delete.
- Click the "Delete" button.
- In the delete confirmation prompt, click the
OKbutton.
Edit Template UI Styles
- Navigate to the template list page.
- Project Template: Click on the
Application Managementmenu in the left navigation bar, choose the respective project, and click theTemplatetab. - Global Template: Click on the
Operations Hubmenu in the navigation bar and go to theTemplatetab.
- Project Template: Click on the
- Find the template for which you want to edit the styles.
- Click on the template name to enter the details page. In the details page, select
UI Schema. - Click on the ellipsis (three dots) representing additional actions, choose the
Editoption, and modify the corresponding UI styles as needed. ClickPreviewto see the effects. - Click the
Savebutton.
AI-assisted Template Creation
Walrus can use OpenAI's GPT large language model capabilities to assist you in writing and submitting templates.
Note: Before using this feature, you first need to:
- Obtain OpenAI's API token and configure it in Walrus's system settings.
- Create a version control connector.
Generating Templates Based on Natural Language Descriptions
- Click on
Operations Hubin the navigation bar and enter theTemplatetab. - Click the `AI Write Template`` button.
- In the text box, use natural language to describe the functionality of the template you need. You can select an example from the instance list in the top right corner.
- Click the
Generatebutton.
Explaining the Functionality of Template Code
- Click on
Operations Hubin the navigation bar and enter theTemplatetab. - Click the
AI Write Templatebutton. - After generating/writing the template code in the text box via AI, click the "Explain" button.
- Click the
OKbutton to close the template explanation popup.
Correcting Template Code
- Click on
Operations Hubin the navigation bar and enter theTemplatetab. - Click the
AI Write Templatebutton. - After generating/writing the template code in the text box via AI, click the
Correctbutton. - Review the repair instructions and consider the suggested repairs.
- Click
Accept Repairin the top left corner to apply the repair suggestion, or "Abort Repair" to discard the repair suggestion.
Submitting Written Template Code to Git Repository
- Click on
Operations Hubin the navigation bar and enter theTemplatetab. - After generating/writing the template code in the text box via AI, click the
Create PRbutton. - Select an available version control connector.
- Select a code repository.
- Select the target branch.
- Enter the submission path, that is, the folder path in the code repository where this template is stored.
- Click the
Savebutton.