put-item: a few fixes
- Added Goreleaser configuration - Changed some key bindings for the table list - Started working on full display of items
This commit is contained in:
parent
e5a7b82a63
commit
8d984119cc
52
.github/workflows/release.yaml
vendored
Normal file
52
.github/workflows/release.yaml
vendored
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
name: release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: amazon/dynamodb-local:latest
|
||||||
|
ports:
|
||||||
|
- 18000:8000
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.18
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/lmika".insteadOf "https://github.com/lmika"
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
set -xue
|
||||||
|
go get ./...
|
||||||
|
go test ./...
|
||||||
|
env:
|
||||||
|
GOPRIVATE: "github:com/lmika/*"
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.18
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/lmika".insteadOf "https://github.com/lmika"
|
||||||
|
- name: Release
|
||||||
|
uses: goreleaser/goreleaser-action@v1
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
args: release --skip-validate --rm-dist
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
45
.goreleaser.yml
Normal file
45
.goreleaser.yml
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
builds:
|
||||||
|
- id: dynamo-browse
|
||||||
|
targets:
|
||||||
|
- windows_amd64
|
||||||
|
- linux_amd64
|
||||||
|
- darwin_amd64
|
||||||
|
- darwin_arm64
|
||||||
|
main: ./cmd/dynamo-browse/.
|
||||||
|
binary: dynamo-browse
|
||||||
|
archives:
|
||||||
|
- id: zip
|
||||||
|
builds:
|
||||||
|
- dynamo-browse
|
||||||
|
wrap_in_directory: true
|
||||||
|
format_overrides:
|
||||||
|
- goos: windows
|
||||||
|
format: zip
|
||||||
|
- goos: linux
|
||||||
|
format: tar.gz
|
||||||
|
- goos: macos
|
||||||
|
format: tar.gz
|
||||||
|
nfpms:
|
||||||
|
- id: package_nfpms
|
||||||
|
package_name: awstools
|
||||||
|
builds:
|
||||||
|
- dynamo-browse
|
||||||
|
vendor: lmika
|
||||||
|
homepage: https://awstools.lmika.dev/
|
||||||
|
maintainer: Leon Mika <lmika@lmika.org>
|
||||||
|
description: TUI tools for AWS administration
|
||||||
|
license: MIT
|
||||||
|
formats:
|
||||||
|
- deb
|
||||||
|
- rpm
|
||||||
|
bindir: /usr/local/bin
|
||||||
|
checksum:
|
||||||
|
name_template: 'checksums.txt'
|
||||||
|
snapshot:
|
||||||
|
name_template: "{{ .Tag }}-next"
|
||||||
|
changelog:
|
||||||
|
sort: asc
|
||||||
|
filters:
|
||||||
|
exclude:
|
||||||
|
- '^docs:'
|
||||||
|
- '^test:'
|
37
internal/dynamo-browse/ui/teamodels/itemdisplay/model.go
Normal file
37
internal/dynamo-browse/ui/teamodels/itemdisplay/model.go
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
package itemdisplay
|
||||||
|
|
||||||
|
import (
|
||||||
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
|
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/layout"
|
||||||
|
"github.com/lmika/awstools/internal/dynamo-browse/ui/teamodels/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Model struct {
|
||||||
|
baseMode tea.Model
|
||||||
|
}
|
||||||
|
|
||||||
|
func New(baseMode tea.Model) *Model {
|
||||||
|
return &Model{
|
||||||
|
baseMode: baseMode,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Model) Init() tea.Cmd {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
|
var cc utils.CmdCollector
|
||||||
|
|
||||||
|
m.baseMode = cc.Collect(m.baseMode.Update(msg))
|
||||||
|
return m, cc.Cmd()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Model) View() string {
|
||||||
|
return m.baseMode.View()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Model) Resize(w, h int) layout.ResizingModel {
|
||||||
|
m.baseMode = layout.Resize(m.baseMode, w, h)
|
||||||
|
return m
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package tableselect
|
package tableselect
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/charmbracelet/bubbles/key"
|
||||||
"github.com/charmbracelet/bubbles/list"
|
"github.com/charmbracelet/bubbles/list"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
@ -32,6 +33,22 @@ func newListController(tableNames []string, w, h int) listController {
|
||||||
Padding(0, 0, 0, 1)
|
Padding(0, 0, 0, 1)
|
||||||
|
|
||||||
list := list.New(items, delegate, w, h)
|
list := list.New(items, delegate, w, h)
|
||||||
|
list.KeyMap.CursorUp = key.NewBinding(
|
||||||
|
key.WithKeys("up", "i"),
|
||||||
|
key.WithHelp("↑/i", "up"),
|
||||||
|
)
|
||||||
|
list.KeyMap.CursorDown = key.NewBinding(
|
||||||
|
key.WithKeys("down", "k"),
|
||||||
|
key.WithHelp("↓/k", "down"),
|
||||||
|
)
|
||||||
|
list.KeyMap.PrevPage = key.NewBinding(
|
||||||
|
key.WithKeys("left", "j", "pgup", "b", "u"),
|
||||||
|
key.WithHelp("←/j/pgup", "prev page"),
|
||||||
|
)
|
||||||
|
list.KeyMap.NextPage = key.NewBinding(
|
||||||
|
key.WithKeys("right", "l", "pgdown", "f", "d"),
|
||||||
|
key.WithHelp("→/l/pgdn", "next page"),
|
||||||
|
)
|
||||||
list.SetShowTitle(false)
|
list.SetShowTitle(false)
|
||||||
|
|
||||||
return listController{list: list}
|
return listController{list: list}
|
||||||
|
|
Loading…
Reference in a new issue