add option to remove gauge borders
This commit is contained in:
parent
fc717d627e
commit
a90bec834a
|
@ -33,7 +33,7 @@ type Gauge struct {
|
|||
func NewGauge(c config.GaugeConfig, palette console.Palette) *Gauge {
|
||||
|
||||
g := Gauge{
|
||||
Block: component.NewBlock(c.Title, true, palette),
|
||||
Block: component.NewBlock(c.Title, *c.Border, palette),
|
||||
Consumer: data.NewConsumer(),
|
||||
color: *c.Color,
|
||||
scale: *c.Scale,
|
||||
|
|
|
@ -65,6 +65,7 @@ type GaugeConfig struct {
|
|||
Cur Item `yaml:"cur"`
|
||||
Max Item `yaml:"max"`
|
||||
Min Item `yaml:"min"`
|
||||
Border *bool `yaml:"border,omitempty"`
|
||||
}
|
||||
|
||||
type SparkLineConfig struct {
|
||||
|
|
|
@ -89,6 +89,10 @@ func (c *Config) setDefaultValues() {
|
|||
p := defaultScale
|
||||
g.Scale = &p
|
||||
}
|
||||
if g.Border == nil {
|
||||
border := true
|
||||
g.Border = &border
|
||||
}
|
||||
|
||||
cur := "cur"
|
||||
max := "max"
|
||||
|
|
Loading…
Reference in New Issue