mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: embed common client requests into the template html (#8076)
This should reduce the number of API requests a client makes when loading the dashboard dramatically!
This commit is contained in:
+2
-1
@@ -17,6 +17,7 @@ import (
|
||||
"cdr.dev/slog"
|
||||
"github.com/coder/coder/coderd/audit"
|
||||
"github.com/coder/coder/coderd/database"
|
||||
"github.com/coder/coder/coderd/database/db2sdk"
|
||||
"github.com/coder/coder/coderd/httpapi"
|
||||
"github.com/coder/coder/coderd/httpmw"
|
||||
"github.com/coder/coder/coderd/rbac"
|
||||
@@ -193,7 +194,7 @@ func (api *API) convertAuditLog(ctx context.Context, dblog database.GetAuditLogs
|
||||
|
||||
for _, roleName := range dblog.UserRoles {
|
||||
rbacRole, _ := rbac.RoleByName(roleName)
|
||||
user.Roles = append(user.Roles, convertRole(rbacRole))
|
||||
user.Roles = append(user.Roles, db2sdk.Role(rbacRole))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user