Fixed styling of the other tools
This commit is contained in:
parent
809f9adfea
commit
eadf8d1720
19 changed files with 231 additions and 105 deletions
29
internal/slog-view/styles/styles.go
Normal file
29
internal/slog-view/styles/styles.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package styles
|
||||
|
||||
import (
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/frame"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/statusandprompt"
|
||||
)
|
||||
|
||||
type Styles struct {
|
||||
Frames frame.Style
|
||||
StatusAndPrompt statusandprompt.Style
|
||||
}
|
||||
|
||||
var DefaultStyles = Styles{
|
||||
Frames: frame.Style{
|
||||
ActiveTitle: lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color("#000000")).
|
||||
Background(lipgloss.Color("#d1d1d1")),
|
||||
InactiveTitle: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("#000000")).
|
||||
Background(lipgloss.Color("#d1d1d1")),
|
||||
},
|
||||
StatusAndPrompt: statusandprompt.Style{
|
||||
ModeLine: lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("#000000")).
|
||||
Background(lipgloss.Color("#d1d1d1")),
|
||||
},
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package fullviewlinedetails
|
|||
|
||||
import (
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/frame"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/layout"
|
||||
"github.com/lmika/awstools/internal/slog-view/models"
|
||||
"github.com/lmika/awstools/internal/slog-view/ui/linedetails"
|
||||
|
|
@ -14,10 +15,10 @@ type Model struct {
|
|||
visible bool
|
||||
}
|
||||
|
||||
func NewModel(submodel tea.Model) *Model {
|
||||
func NewModel(submodel tea.Model, style frame.Style) *Model {
|
||||
return &Model{
|
||||
submodel: submodel,
|
||||
lineDetails: linedetails.New(),
|
||||
lineDetails: linedetails.New(style),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,13 +10,6 @@ import (
|
|||
"github.com/lmika/awstools/internal/slog-view/models"
|
||||
)
|
||||
|
||||
var (
|
||||
activeHeaderStyle = lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color("#ffffff")).
|
||||
Background(lipgloss.Color("#9c9c9c"))
|
||||
)
|
||||
|
||||
type Model struct {
|
||||
frameTitle frame.FrameTitle
|
||||
viewport viewport.Model
|
||||
|
|
@ -27,11 +20,11 @@ type Model struct {
|
|||
selectedItem *models.LogLine
|
||||
}
|
||||
|
||||
func New() *Model {
|
||||
func New(style frame.Style) *Model {
|
||||
viewport := viewport.New(0, 0)
|
||||
viewport.SetContent("")
|
||||
return &Model{
|
||||
frameTitle: frame.NewFrameTitle("Item", false, activeHeaderStyle),
|
||||
frameTitle: frame.NewFrameTitle("Item", false, style),
|
||||
viewport: viewport,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,6 @@ import (
|
|||
"path/filepath"
|
||||
)
|
||||
|
||||
var (
|
||||
activeHeaderStyle = lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color("#ffffff")).
|
||||
Background(lipgloss.Color("#9c9c9c"))
|
||||
)
|
||||
|
||||
type Model struct {
|
||||
frameTitle frame.FrameTitle
|
||||
table table.Model
|
||||
|
|
@ -26,8 +19,8 @@ type Model struct {
|
|||
w, h int
|
||||
}
|
||||
|
||||
func New() *Model {
|
||||
frameTitle := frame.NewFrameTitle("File: ", true, activeHeaderStyle)
|
||||
func New(style frame.Style) *Model {
|
||||
frameTitle := frame.NewFrameTitle("File: ", true, style)
|
||||
table := table.New(table.SimpleColumns{"level", "error", "message"}, 0, 0)
|
||||
|
||||
return &Model{
|
||||
|
|
|
|||
|
|
@ -6,38 +6,40 @@ import (
|
|||
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/layout"
|
||||
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/statusandprompt"
|
||||
"github.com/lmika/awstools/internal/slog-view/controllers"
|
||||
"github.com/lmika/awstools/internal/slog-view/styles"
|
||||
"github.com/lmika/awstools/internal/slog-view/ui/fullviewlinedetails"
|
||||
"github.com/lmika/awstools/internal/slog-view/ui/linedetails"
|
||||
"github.com/lmika/awstools/internal/slog-view/ui/loglines"
|
||||
)
|
||||
|
||||
type Model struct {
|
||||
controller *controllers.LogFileController
|
||||
cmdController *commandctrl.CommandController
|
||||
controller *controllers.LogFileController
|
||||
cmdController *commandctrl.CommandController
|
||||
|
||||
root tea.Model
|
||||
logLines *loglines.Model
|
||||
lineDetails *linedetails.Model
|
||||
statusAndPrompt *statusandprompt.StatusAndPrompt
|
||||
root tea.Model
|
||||
logLines *loglines.Model
|
||||
lineDetails *linedetails.Model
|
||||
statusAndPrompt *statusandprompt.StatusAndPrompt
|
||||
fullViewLineDetails *fullviewlinedetails.Model
|
||||
}
|
||||
|
||||
func NewModel(controller *controllers.LogFileController, cmdController *commandctrl.CommandController) Model {
|
||||
logLines := loglines.New()
|
||||
lineDetails := linedetails.New()
|
||||
defaultStyles := styles.DefaultStyles
|
||||
logLines := loglines.New(defaultStyles.Frames)
|
||||
lineDetails := linedetails.New(defaultStyles.Frames)
|
||||
box := layout.NewVBox(layout.LastChildFixedAt(17), logLines, lineDetails)
|
||||
fullViewLineDetails := fullviewlinedetails.NewModel(box)
|
||||
statusAndPrompt := statusandprompt.New(fullViewLineDetails, "")
|
||||
fullViewLineDetails := fullviewlinedetails.NewModel(box, defaultStyles.Frames)
|
||||
statusAndPrompt := statusandprompt.New(fullViewLineDetails, "", defaultStyles.StatusAndPrompt)
|
||||
|
||||
root := layout.FullScreen(statusAndPrompt)
|
||||
|
||||
return Model{
|
||||
controller: controller,
|
||||
cmdController: cmdController,
|
||||
root: root,
|
||||
statusAndPrompt: statusAndPrompt,
|
||||
logLines: logLines,
|
||||
lineDetails: lineDetails,
|
||||
controller: controller,
|
||||
cmdController: cmdController,
|
||||
root: root,
|
||||
statusAndPrompt: statusAndPrompt,
|
||||
logLines: logLines,
|
||||
lineDetails: lineDetails,
|
||||
fullViewLineDetails: fullViewLineDetails,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue