Newer
Older
package views
import (
"code.fbi.h-da.de/cocsn/gosdn/cmd/gosdn-tview/app"
"github.com/rivo/tview"
"google.golang.org/grpc"
)
type FooterView struct {
footerView *tview.Flex
databaseStatusView *DatabaseStatusView
gRPCStatusView *GRPCStatusView
}
func NewFooterView(app *app.App, conn *grpc.ClientConn) *FooterView {
fw := &FooterView{
footerView: tview.NewFlex(),
databaseStatusView: NewDatabaseStatusView(app),
gRPCStatusView: NewGRPCStatusView(app, conn),
}
fw.footerView.
SetBorder(true).
SetTitle("Status")
fw.footerView.
AddItem(fw.gRPCStatusView.GetContent(), 0, 1, false).
AddItem(fw.databaseStatusView.GetContent(), 0, 1, false)
return fw
}
func (fw *FooterView) GetContent() tview.Primitive {
return fw.footerView
}