Feat: props table instead of form

This commit is contained in:
Grail Finder
2025-12-03 13:29:57 +03:00
parent e5eaba1d5a
commit cec10210c2
4 changed files with 321 additions and 5 deletions

View File

@@ -152,10 +152,16 @@ func setLogLevel(sl string) {
func listRolesWithUser() []string {
roles := chatBody.ListRoles()
if !strInSlice(cfg.UserRole, roles) {
roles = append(roles, cfg.UserRole)
// Remove user role if it exists in the list (to avoid duplicates and ensure it's at position 0)
filteredRoles := make([]string, 0, len(roles))
for _, role := range roles {
if role != cfg.UserRole {
filteredRoles = append(filteredRoles, role)
}
}
return roles
// Prepend user role to the beginning of the list
result := append([]string{cfg.UserRole}, filteredRoles...)
return result
}
func loadImage() {