sqs-browse: remove assumption regarding table keys

Table keys are now retrieved from describe
This commit is contained in:
Leon Mika 2022-03-25 08:17:52 +11:00
parent 3428bd2a8a
commit 5a69e6c954
47 changed files with 150 additions and 98 deletions

View file

@ -2,4 +2,4 @@ package ui
import "github.com/lmika/awstools/internal/sqs-browse/models"
type NewMessagesEvent []*models.Message
type NewMessagesEvent []*models.Message

View file

@ -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

View file

@ -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