sqs-browse: remove assumption regarding table keys
Table keys are now retrieved from describe
This commit is contained in:
parent
3428bd2a8a
commit
5a69e6c954
47 changed files with 150 additions and 98 deletions
|
|
@ -2,4 +2,4 @@ package ui
|
|||
|
||||
import "github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
|
||||
type NewMessagesEvent []*models.Message
|
||||
type NewMessagesEvent []*models.Message
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
table "github.com/calyptia/go-bubble-table"
|
||||
"github.com/charmbracelet/bubbles/textinput"
|
||||
"github.com/charmbracelet/bubbles/viewport"
|
||||
|
|
@ -14,19 +17,17 @@ import (
|
|||
"github.com/lmika/awstools/internal/common/ui/uimodels"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/controllers"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
"log"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
activeHeaderStyle = lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color("#ffffff")).
|
||||
Background(lipgloss.Color("#eac610"))
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color("#ffffff")).
|
||||
Background(lipgloss.Color("#eac610"))
|
||||
|
||||
inactiveHeaderStyle = lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("#000000")).
|
||||
Background(lipgloss.Color("#d1d1d1"))
|
||||
Foreground(lipgloss.Color("#000000")).
|
||||
Background(lipgloss.Color("#d1d1d1"))
|
||||
)
|
||||
|
||||
type uiModel struct {
|
||||
|
|
@ -52,12 +53,12 @@ func NewModel(dispatcher *dispatcher.Dispatcher, msgSendingHandlers *controllers
|
|||
textInput := textinput.New()
|
||||
|
||||
model := uiModel{
|
||||
table: tbl,
|
||||
tableRows: rows,
|
||||
message: "",
|
||||
textInput: textInput,
|
||||
table: tbl,
|
||||
tableRows: rows,
|
||||
message: "",
|
||||
textInput: textInput,
|
||||
msgSendingHandlers: msgSendingHandlers,
|
||||
dispatcher: dispatcher,
|
||||
dispatcher: dispatcher,
|
||||
}
|
||||
|
||||
return model
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@ package ui
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
table "github.com/calyptia/go-bubble-table"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
table "github.com/calyptia/go-bubble-table"
|
||||
"github.com/lmika/awstools/internal/sqs-browse/models"
|
||||
)
|
||||
|
||||
type messageTableRow models.Message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue