- commit
- 6954c8a
- parent
- 5775c48
- author
- Eric Bower
- date
- 2024-11-28 15:46:56 +0000 UTC
chore: tui copy
2 files changed,
+5,
-8
+4,
-5
1@@ -15,7 +15,6 @@ import (
2 "github.com/picosh/pico/tui/common"
3 "github.com/picosh/pico/tui/pages"
4 "github.com/picosh/utils"
5-
6 pipeLogger "github.com/picosh/utils/pipe/log"
7 )
8
9@@ -49,7 +48,7 @@ func headerWidth(w int) int {
10 return w - 2
11 }
12
13-var defMsg = "Logs will show up here in realtime as they are generated. There is no log buffer."
14+var defMsg = "This view shows all logs generated by our services tagged with your user. This view will show errors triggered by your pages sites, blogs, tuns, etc. Logs will show up here in realtime as they are generated. There is no log buffer."
15
16 func NewModel(shrd common.SharedModel) Model {
17 im := input.New()
18@@ -172,19 +171,19 @@ func (m Model) waitForActivity(sub chan map[string]any) tea.Cmd {
19 func (m Model) connectLogs(sub chan map[string]any) tea.Cmd {
20 return func() tea.Msg {
21 conn := shared.NewPicoPipeClient()
22- stdoutPipe, err := pipeLogger.ReadLogs(m.ctx, m.shared.Logger, conn)
23+ drain, err := pipeLogger.ReadLogs(m.ctx, m.shared.Logger, conn)
24 if err != nil {
25 return errMsg(err)
26 }
27
28- scanner := bufio.NewScanner(stdoutPipe)
29+ scanner := bufio.NewScanner(drain)
30 for scanner.Scan() {
31 line := scanner.Text()
32 parsedData := map[string]any{}
33
34 err := json.Unmarshal([]byte(line), &parsedData)
35 if err != nil {
36- m.shared.Logger.Error("json unmarshal", "err", err)
37+ m.shared.Logger.Error("json unmarshal", "err", err, "line", line)
38 continue
39 }
40
+1,
-3
1@@ -26,12 +26,10 @@ func PlusView(username string, w int) string {
2 - prose
3 - increased storage limits
4 - blog analytics
5-- docker registry
6- - full access
7 - 10GB total storage
8
9 There are a few ways to purchase a membership. We try our best to
10-provide immediate access to <code>pico+</code> regardless of payment
11+provide immediate access to pico+ regardless of payment
12 method.
13
14 ## Online Payment (credit card, paypal)