Add audit links/kira pilot (#5156)

* got links working

* added translations

* fixed translation

* added translation for unavailable ip

* added support for group, template, user links

* cleaned up string

* added deleted label

* querying for workspace id

* remove prints

* fix/write tests

* PR feedback pt 1

* PR feedback part 2
This commit is contained in:
Kira Pilot
2022-12-02 15:14:45 -05:00
committed by GitHub
parent fa641554e8
commit 65407462d1
12 changed files with 298 additions and 99 deletions

View File

@ -38,7 +38,9 @@ func (r ResourceType) FriendlyString() string {
case ResourceTypeWorkspace:
return "workspace"
case ResourceTypeWorkspaceBuild:
return "workspace build"
// workspace builds have a unique friendly string
// see coderd/audit.go:298 for explanation
return "workspace"
case ResourceTypeGitSSHKey:
return "git ssh key"
case ResourceTypeAPIKey:
@ -102,6 +104,8 @@ type AuditLog struct {
StatusCode int32 `json:"status_code"`
AdditionalFields json.RawMessage `json:"additional_fields"`
Description string `json:"description"`
ResourceLink string `json:"resource_link"`
IsDeleted bool `json:"is_deleted"`
User *User `json:"user"`
}