lots of functionality
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"git.brettb.xyz/goinv/client/internal/api"
|
||||
"git.brettb.xyz/goinv/client/internal/ui/assets"
|
||||
"git.brettb.xyz/goinv/client/internal/ui/help"
|
||||
"git.brettb.xyz/goinv/client/internal/ui/shelves"
|
||||
"git.brettb.xyz/goinv/client/internal/ui/utils"
|
||||
"github.com/gdamore/tcell/v2"
|
||||
"github.com/rivo/tview"
|
||||
@@ -18,9 +19,9 @@ type App struct {
|
||||
pages *tview.Pages
|
||||
logger *zap.Logger
|
||||
|
||||
help *help.Help
|
||||
assets *assets.Assets
|
||||
// shelves *shelves.Shelves
|
||||
help *help.Help
|
||||
assets *assets.Assets
|
||||
shelves *shelves.Shelves
|
||||
// categories *categories.Categories
|
||||
// buildings *buildings.Buildings
|
||||
menu *tview.TextView
|
||||
@@ -48,7 +49,7 @@ func NewApp(name, version, host string, logger *zap.Logger) *App {
|
||||
menuItems := [][]string{
|
||||
{utils.HelpScreenKey.Label(), app.help.GetTitle()},
|
||||
{utils.AssetsScreenKey.Label(), app.assets.GetTitle()},
|
||||
//{utils.ShelvesScreenKey.Label(), app.shelves.GetTitle()},
|
||||
{utils.ShelvesScreenKey.Label(), app.shelves.GetTitle()},
|
||||
//{utils.CategoriesScreenKey.Label(), app.categories.GetTitle()},
|
||||
//{utils.BuildingsScreenKey.Label(), app.buildings.GetTitle()},
|
||||
}
|
||||
@@ -57,6 +58,7 @@ func NewApp(name, version, host string, logger *zap.Logger) *App {
|
||||
|
||||
app.pages.AddPage(app.help.GetTitle(), app.help, true, false)
|
||||
app.pages.AddPage(app.assets.GetTitle(), app.assets, true, false)
|
||||
app.pages.AddPage(app.shelves.GetTitle(), app.shelves, true, false)
|
||||
|
||||
return &app
|
||||
}
|
||||
@@ -98,6 +100,9 @@ func (app *App) Run() error {
|
||||
case utils.AssetsScreenKey.EventKey():
|
||||
app.switchToScreen(app.assets.GetTitle())
|
||||
return nil
|
||||
case utils.ShelvesScreenKey.EventKey():
|
||||
app.switchToScreen(app.shelves.GetTitle())
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,4 +5,8 @@ func (app *App) initUI() {
|
||||
// Assets page
|
||||
app.assets.UpdateShelfData()
|
||||
app.assets.UpdateAssetData()
|
||||
|
||||
// Shelves page
|
||||
app.shelves.UpdateShelfData()
|
||||
app.shelves.UpdateBuildingData()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user