Skip to content

Commit

Permalink
Merge pull request #78 from bupd/project-view
Browse files Browse the repository at this point in the history
feat: add ID to `list` table.
  • Loading branch information
Vad1mo authored Jun 10, 2024
2 parents 24b2bd4 + 3137386 commit bb70d52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/views/project/list/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
)

var columns = []table.Column{
{Title: "ID", Width: 6},
{Title: "Project Name", Width: 12},
{Title: "Access Level", Width: 12},
{Title: "Type", Width: 12},
Expand All @@ -35,6 +36,7 @@ func ListProjects(projects []*models.Project) {
}
createdTime, _ := utils.FormatCreatedTime(project.CreationTime.String())
rows = append(rows, table.Row{
strconv.FormatInt(int64(project.ProjectID), 10), // ProjectID
project.Name, // Project Name
accessLevel, // Access Level
projectType, // Type
Expand Down
3 changes: 3 additions & 0 deletions pkg/views/user/list/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package list
import (
"fmt"
"os"
"strconv"

"github.com/charmbracelet/bubbles/table"
tea "github.com/charmbracelet/bubbletea"
Expand All @@ -12,6 +13,7 @@ import (
)

var columns = []table.Column{
{Title: "ID", Width: 6},
{Title: "Name", Width: 16},
{Title: "Administrator", Width: 16},
{Title: "Email", Width: 20},
Expand All @@ -27,6 +29,7 @@ func ListUsers(users []*models.UserResp) {
}
createdTime, _ := utils.FormatCreatedTime(user.CreationTime.String())
rows = append(rows, table.Row{
strconv.FormatInt(int64(user.UserID), 10), // UserID
user.Username,
isAdmin,
user.Email,
Expand Down

0 comments on commit bb70d52

Please sign in to comment.