Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 478d49c

Browse files
BrunoQuaresmabpmct
andauthored
docs: Custom resource icon (#4041)
* Fix missed unresolved conflict * docs: Custom resource icons * Fix title * Apply suggestions from code review Co-authored-by: Ben Potter <[email protected]> Co-authored-by: Ben Potter <[email protected]>
1 parent 0552c36 commit 478d49c

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

docs/templates.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,9 @@ resource "kubernetes_pod" "podName" {
225225

226226
### Delete templates
227227

228-
<<<<<<< HEAD
229228
You can delete a template using both the coder CLI and UI. Only
230229
[template admins and owners](./admin/users.md) can delete a template, and the template
231230
must not have any running workspaces associated to it.
232-
=======
233-
You can delete a template using both the Coder CLI and UI. Only
234-
[template admins and owners](./admin/users.md) can delete a template.
235-
>>>>>>> 0407c2294c5c7321071c17013f2e39bd70568165
236231

237232
Using the CLI, login to Coder and run the following command to delete a template:
238233

@@ -322,7 +317,7 @@ We recommend source controlling your templates as you would other code.
322317
CI is as simple as running `coder templates push` with the appropriate
323318
credentials.
324319

325-
326320
## Next Steps
321+
327322
- Learn about [Authentication & Secrets](templates/authentication.md)
328323
- Learn about [Workspaces](workspaces.md)

docs/templates/resource-metadata.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,32 @@ resource "coder_metadata" "hide_serviceaccount" {
7171
}
7272
```
7373

74+
## Using custom resource icon
75+
76+
To use custom icons on your resources, use the `icon` attribute (must be a valid path or URL):
77+
78+
```hcl
79+
resource "coder_metadata" "resource_with_icon" {
80+
count = data.coder_workspace.me.start_count
81+
resource_id = kubernetes_service_account.user_data.id
82+
icon = "/icon/database.svg"
83+
item {
84+
key = "name"
85+
value = kubernetes_deployment.coder[0].metadata[0].name
86+
}
87+
}
88+
```
89+
90+
To make easier for you to customize your resource we added some built-in icons:
91+
92+
- Folder `/icon/folder.svg`
93+
- Memory `/icon/memory.svg`
94+
- Image `/icon/image.svg`
95+
- Widgets `/icon/widgets.svg`
96+
- Database `/icon/database.svg`
97+
98+
We also have other icons related to the IDEs. You can see all the icons [here](https://github.com/coder/coder/tree/main/site/static/icon).
99+
74100
## Up next
75101

76102
- Learn about [secrets](../secrets.md)

0 commit comments

Comments
 (0)