|
|
@@ -1,7 +1,3 @@
|
|
|
-// TODO(chart): dynamically render charts to fit height on not set
|
|
|
-//
|
|
|
-// TODO(styling): allow end user to define their own styles when hacking.
|
|
|
-//
|
|
|
// Pingo defines an extensible TUI based on the bubbletea framework (v2). An
|
|
|
// executable entry point is defined via cmd/pingo.go. For more on this topic,
|
|
|
// see the Readme.
|
|
|
@@ -18,7 +14,9 @@
|
|
|
// - addresses([]string): the hosts to ping. The length must be greater than
|
|
|
// or equal to 1
|
|
|
//
|
|
|
-// - speed(time.Duration): the polling interval
|
|
|
+// - width(int): the width of the bubble
|
|
|
+//
|
|
|
+// - height(int): the height of the bubble
|
|
|
//
|
|
|
// - chartHeight(int): the desired height of the resulting charts. This
|
|
|
// argument is integral to ensuring desired rendering of charts, when
|
|
|
@@ -28,11 +26,14 @@
|
|
|
//
|
|
|
// NOTE: chartHeight is ignored when only one address or host is provided
|
|
|
//
|
|
|
+// NOTE: if a specific chartHeight is specified, it is possible to exceeed
|
|
|
+// desired height.
|
|
|
+//
|
|
|
// For more, please please see InitialPeakBubble()
|
|
|
//
|
|
|
// Pingo defines the following bubbletea.Cmd functions:
|
|
|
//
|
|
|
-// - Model.Poll() tea.Msg: used to asynchronously call all Model.Addresses.Poll()
|
|
|
+// - Peak.Poll() tea.Msg: used to asynchronously call all Model.Addresses.Poll()
|
|
|
// functions.
|
|
|
//
|
|
|
// NOTE: the project does not implement a timing mechanism for polling Addresses.
|
|
|
@@ -43,7 +44,16 @@
|
|
|
// As timing may be handled in a number of ways, it exceeds the scope of this
|
|
|
// project to provide one.
|
|
|
//
|
|
|
-// For an example implementation, see cmd/pingo.go
|
|
|
+// For an example implementation, including a recommended timing mechanisim,
|
|
|
+// see cmd/pingo.go.
|
|
|
+//
|
|
|
+// TODO(chart): dynamically render charts to fit height on not set
|
|
|
+//
|
|
|
+// TODO(styling): allow end user to define their own styles when hacking.
|
|
|
+//
|
|
|
+// TODO(deprecate chart height): in future, specifying chart height's directly
|
|
|
+// will be deprecated in favour of a dynamically determined chart height. (see
|
|
|
+// "TODO(chart)")
|
|
|
package pingo
|
|
|
|
|
|
import (
|
|
|
@@ -107,7 +117,7 @@ type ( // tea.Msg signatures
|
|
|
// Bubbletea bubble
|
|
|
type Peak struct {
|
|
|
Addresses []Address // as defined in internal/tui/types.go
|
|
|
- ChartHeight int
|
|
|
+ ChartHeight int // DEPRECATE
|
|
|
Height int
|
|
|
Width int
|
|
|
}
|
|
|
@@ -181,7 +191,7 @@ func (p Peak) View() tea.View {
|
|
|
// render chart at fullscreen minus a few lines to hint at scrolling
|
|
|
slc = streamlinechart.New(p.Width, p.Height-2)
|
|
|
} else {
|
|
|
- slc = streamlinechart.New(p.Width, p.ChartHeight-1)
|
|
|
+ slc = streamlinechart.New(p.Width, p.ChartHeight-1) // DEPRECATE
|
|
|
}
|
|
|
|
|
|
for _, v := range address.Results {
|