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 Management
menu in the left navigation bar, choose the respective project, and click theTemplate
tab. - Global Template: Click on the
Operations Hub
menu in the navigation bar and go to theTemplate
tab.
- Project Template: Click on the
Adding Templates
Navigate to the template list page.
- Project Template: Click on the
Application Management
menu in the left navigation bar, choose the respective project, and click theTemplate
tab. - Global Template: Click on the
Operations Hub
menu in the navigation bar and go to theTemplate
tab.
- Project Template: Click on the
Enter the template list page.
Click the
New Template
button.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
Confirm
button.
Editing a Template
- Enter the
Template
tab.- Project Template: Click on
Application Management
in the navigation bar and select the corresponding project, then click on theTemplate
tab. - Global Template: Click on
Operations Hub
in the navigation bar and enter theTemplate
tab.
- 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
OK
button.
Deleting a Template
- Enter the
Template
tab.- Project Template: Click on
Application Management
in the navigation bar and select the corresponding project, then click on theTemplate
tab. - Global Template: Click on
Operations Hub
in the navigation bar and enter theTemplate
tab.
- Project Template: Click on
- Select the template you need to delete.
- Click the "Delete" button.
- In the delete confirmation prompt, click the
OK
button.
Edit Template UI Styles
- Navigate to the template list page.
- Project Template: Click on the
Application Management
menu in the left navigation bar, choose the respective project, and click theTemplate
tab. - Global Template: Click on the
Operations Hub
menu in the navigation bar and go to theTemplate
tab.
- 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
Edit
option, and modify the corresponding UI styles as needed. ClickPreview
to see the effects. - Click the
Save
button.
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 Hub
in the navigation bar and enter theTemplate
tab. - 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
Generate
button.
Explaining the Functionality of Template Code
- Click on
Operations Hub
in the navigation bar and enter theTemplate
tab. - Click the
AI Write Template
button. - After generating/writing the template code in the text box via AI, click the "Explain" button.
- Click the
OK
button to close the template explanation popup.
Correcting Template Code
- Click on
Operations Hub
in the navigation bar and enter theTemplate
tab. - Click the
AI Write Template
button. - After generating/writing the template code in the text box via AI, click the
Correct
button. - Review the repair instructions and consider the suggested repairs.
- Click
Accept Repair
in 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 Hub
in the navigation bar and enter theTemplate
tab. - After generating/writing the template code in the text box via AI, click the
Create PR
button. - 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
Save
button.