mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
This reverts commit 145faf4400
.
This commit is contained in:
@ -219,26 +219,12 @@ func convertAuditLog(dblog database.GetAuditLogsOffsetRow) codersdk.AuditLog {
|
||||
}
|
||||
}
|
||||
|
||||
type WorkspaceResourceInfo struct {
|
||||
WorkspaceName string
|
||||
}
|
||||
|
||||
func auditLogDescription(alog database.GetAuditLogsOffsetRow) string {
|
||||
str := fmt.Sprintf("{user} %s %s",
|
||||
codersdk.AuditAction(alog.Action).FriendlyString(),
|
||||
codersdk.ResourceType(alog.ResourceType).FriendlyString(),
|
||||
)
|
||||
|
||||
// Strings for build updates follow the below format:
|
||||
// "{user} started workspace build for workspace {target}"
|
||||
// where target is a workspace instead of the workspace build
|
||||
if alog.ResourceType == database.ResourceTypeWorkspaceBuild {
|
||||
workspaceBytes := []byte(alog.AdditionalFields)
|
||||
var workspaceResourceInfo WorkspaceResourceInfo
|
||||
_ = json.Unmarshal(workspaceBytes, &workspaceResourceInfo)
|
||||
str += " for workspace " + workspaceResourceInfo.WorkspaceName
|
||||
}
|
||||
|
||||
// We don't display the name for git ssh keys. It's fairly long and doesn't
|
||||
// make too much sense to display.
|
||||
if alog.ResourceType != database.ResourceTypeGitSshKey {
|
||||
@ -302,8 +288,6 @@ func resourceTypeFromString(resourceTypeString string) string {
|
||||
return resourceTypeString
|
||||
case codersdk.ResourceTypeWorkspace:
|
||||
return resourceTypeString
|
||||
case codersdk.ResourceTypeWorkspaceBuild:
|
||||
return resourceTypeString
|
||||
case codersdk.ResourceTypeGitSSHKey:
|
||||
return resourceTypeString
|
||||
case codersdk.ResourceTypeAPIKey:
|
||||
|
Reference in New Issue
Block a user