Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions cmd/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,19 @@ type DatasetStatsData struct {
}

type DatasetListItem struct {
Name string
Name string
Type string
LastIngested time.Time
}

func (item *DatasetListItem) Render() string {
bullet := SelectedStyle.Render("•")
name := StandardStyle.Render(item.Name)
return ItemOuter.Render(fmt.Sprintf("%s %s", bullet, name))
datasetType := StandardStyle.Render(item.Type)
if datasetType == "" {
return ItemOuter.Render(fmt.Sprintf("%s %s", bullet, name))
}
return ItemOuter.Render(fmt.Sprintf("%s %s [%s]", bullet, name, datasetType))
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

// DatasetRetentionData is the data structure for dataset retention
Expand Down Expand Up @@ -459,7 +465,7 @@ func init() {
}

var RemoveDatasetCmd = &cobra.Command{
Use: "remove dataset-name",
Use: "remove|rm dataset-name",
Aliases: []string{"rm"},
Example: " pb dataset remove backend_logs\n pb dataset remove backend_logs --type logs",
Short: "Delete a dataset",
Expand Down Expand Up @@ -546,7 +552,7 @@ func init() {

// ListDatasetCmd is the list command for datasets
var ListDatasetCmd = &cobra.Command{
Use: "list",
Use: "list|ls",
Aliases: []string{"ls"},
Example: " pb dataset list",
Short: "List all datasets",
Expand Down Expand Up @@ -577,7 +583,7 @@ var ListDatasetCmd = &cobra.Command{
}

for _, dataset := range items {
fmt.Println((&DatasetListItem{Name: dataset.Title}).Render())
fmt.Println((&DatasetListItem{Name: dataset.Title, Type: dataset.DatasetType}).Render())
}
return nil
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ var AddProfileCmd = &cobra.Command{
}

var RemoveProfileCmd = &cobra.Command{
Use: "remove profile-name",
Use: "remove|rm profile-name",
Aliases: []string{"rm"},
Example: " pb profile remove local_parseable",
Args: cobra.ExactArgs(1),
Expand Down Expand Up @@ -328,7 +328,7 @@ var UpdateProfileCmd = &cobra.Command{
}

var ListProfileCmd = &cobra.Command{
Use: "list profiles",
Use: "list|ls profiles",
Aliases: []string{"ls"},
Short: "List all added profiles",
Example: " pb profile list",
Expand Down
2 changes: 1 addition & 1 deletion cmd/queryList.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
)

var SavedQueryList = &cobra.Command{
Use: "list",
Use: "list|ls",
Aliases: []string{"ls"},
Example: "pb sql list [-o | --output]",
Short: "List of saved queries",
Expand Down
4 changes: 2 additions & 2 deletions cmd/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ var AddRoleCmd = &cobra.Command{
}

var RemoveRoleCmd = &cobra.Command{
Use: "remove role-name",
Use: "remove|rm role-name",
Aliases: []string{"rm"},
Example: " pb role remove ingestor",
Short: "Delete a role",
Expand Down Expand Up @@ -188,7 +188,7 @@ var RemoveRoleCmd = &cobra.Command{
}

var ListRoleCmd = &cobra.Command{
Use: "list",
Use: "list|ls",
Aliases: []string{"ls"},
Short: "List all roles",
Example: " pb role list",
Expand Down
4 changes: 2 additions & 2 deletions cmd/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ var AddUserCmd = func() *cobra.Command {
}()

var RemoveUserCmd = &cobra.Command{
Use: "remove user-name",
Use: "remove|rm user-name",
Aliases: []string{"rm"},
Example: " pb user remove bob",
Short: "Delete a user",
Expand Down Expand Up @@ -275,7 +275,7 @@ var SetUserRoleCmd = &cobra.Command{
}

var ListUserCmd = &cobra.Command{
Use: "list",
Use: "list|ls",
Aliases: []string{"ls"},
Short: "List all users",
Example: " pb user list",
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@ func renderSQLControlsBox(start, end, dataset string, columns []string, columnId
paneRule("┌", "┐", "TIME RANGE "+formatResultTimeLabel(displayMode), width, borderStyle, timeTitleStyle),
}
lines = append(lines, paneBodyLines(lipgloss.JoinVertical(lipgloss.Left, timeLines...), width, len(timeLines), borderStyle)...)
lines = append(lines, paneRule("├", "┤", "DATASET", width, borderStyle, datasetTitleStyle))
lines = append(lines, paneRule("├", "┤", "DATASET <ctrl-d>", width, borderStyle, datasetTitleStyle))
lines = append(lines, paneBodyLines(lipgloss.JoinVertical(lipgloss.Left, datasetLines...), width, len(datasetLines), borderStyle)...)
lines = append(lines, paneRule("├", "┤", columnsTitle, width, borderStyle, columnsTitleStyle))
lines = append(lines, paneBodyLines(lipgloss.JoinVertical(lipgloss.Left, columnLines...), width, columnSectionH, borderStyle)...)
Expand Down
Loading