Documentation
¶
Index ¶
- Constants
- Variables
- func FormatDuration(d time.Duration) string
- func FormatFileSize(bytes int64) string
- func RenderBox(title, content string, width int) string
- func RenderKeyHelp(keys []string) string
- func RenderProgress(current, total int) string
- func StatusActive() string
- func StatusInactive() string
- func StatusUnknown() string
- func TruncateText(text string, maxLength int) string
- type AnalyticsBrowserModel
- type AnalyticsMetric
- type AnalyticsResult
- type CMDBBrowserModel
- type CMDBClass
- type CMDBRelationship
- type CartItem
- type CatalogBrowserModel
- type CatalogInfo
- type CatalogItem
- type CatalogVariable
- type IdentityBrowserModel
- type TableBrowserModel
- type TableInfo
Constants ¶
const ( ColorPrimary = lipgloss.Color("86") // Green ColorSecondary = lipgloss.Color("244") // Gray ColorError = lipgloss.Color("196") // Red ColorWarning = lipgloss.Color("214") // Orange ColorSuccess = lipgloss.Color("46") // Bright green ColorInfo = lipgloss.Color("39") // Blue ColorHighlight = lipgloss.Color("57") // Dark blue )
Color constants for consistency
const ( DefaultPadding = 2 DefaultMargin = 1 DefaultWidth = 80 DefaultHeight = 24 )
Common layout constants
Variables ¶
var ( // Exported style variables for use in other components TitleStyle = titleStyle HeaderStyle = headerStyle ContentStyle = contentStyle ErrorStyle = errorStyle BreadcrumbStyle = breadcrumbStyle // Exported info style InfoStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("39")). Italic(true) )
Common styles used across TUI components
Functions ¶
func RenderKeyHelp ¶
func StatusInactive ¶
func StatusInactive() string
func StatusUnknown ¶
func StatusUnknown() string
func TruncateText ¶
Truncate text with ellipsis
Types ¶
type AnalyticsBrowserModel ¶
type AnalyticsBrowserModel struct {
// contains filtered or unexported fields
}
Analytics Browser Model
func NewAnalyticsBrowser ¶
func NewAnalyticsBrowser(client *servicenow.Client) *AnalyticsBrowserModel
NewAnalyticsBrowser creates a new analytics browser
func (*AnalyticsBrowserModel) Init ¶
func (m *AnalyticsBrowserModel) Init() tea.Cmd
Init initializes the analytics browser
func (*AnalyticsBrowserModel) Update ¶
func (m *AnalyticsBrowserModel) Update(msg tea.Msg) (*AnalyticsBrowserModel, tea.Cmd)
Update handles messages
func (*AnalyticsBrowserModel) View ¶
func (m *AnalyticsBrowserModel) View() string
View renders the analytics browser
type AnalyticsMetric ¶
type AnalyticsMetric struct {
Name string
Description string
Type string // count, sum, avg, max, min, group_by
Field string
GroupBy string
}
Analytics Metric represents a metric that can be computed
type AnalyticsResult ¶
Analytics Result represents the result of an analytics query
type CMDBBrowserModel ¶
type CMDBBrowserModel struct {
// contains filtered or unexported fields
}
CMDB Browser Model
func NewCMDBBrowser ¶
func NewCMDBBrowser(client *servicenow.Client) *CMDBBrowserModel
NewCMDBBrowser creates a new CMDB browser
func (*CMDBBrowserModel) Init ¶
func (m *CMDBBrowserModel) Init() tea.Cmd
Init initializes the CMDB browser
func (*CMDBBrowserModel) Update ¶
func (m *CMDBBrowserModel) Update(msg tea.Msg) (*CMDBBrowserModel, tea.Cmd)
Update handles messages
func (*CMDBBrowserModel) View ¶
func (m *CMDBBrowserModel) View() string
View renders the CMDB browser
type CMDBRelationship ¶
type CMDBRelationship struct {
Type string
Direction string
TargetClass string
TargetName string
TargetSysID string
}
CMDB Relationship represents a CI relationship
type CartItem ¶
type CartItem struct {
Item CatalogItem
Quantity int
Variables map[string]string
}
Cart Item represents an item in the shopping cart
type CatalogBrowserModel ¶
type CatalogBrowserModel struct {
// contains filtered or unexported fields
}
Catalog Browser Model
func NewCatalogBrowser ¶
func NewCatalogBrowser(client *servicenow.Client) *CatalogBrowserModel
NewCatalogBrowser creates a new catalog browser
func (*CatalogBrowserModel) Init ¶
func (m *CatalogBrowserModel) Init() tea.Cmd
Init initializes the catalog browser
func (*CatalogBrowserModel) Update ¶
func (m *CatalogBrowserModel) Update(msg tea.Msg) (*CatalogBrowserModel, tea.Cmd)
Update handles messages
func (*CatalogBrowserModel) View ¶
func (m *CatalogBrowserModel) View() string
View renders the catalog browser
type CatalogInfo ¶
Catalog Info represents a service catalog
type CatalogItem ¶
type CatalogItem struct {
SysID string
Name string
ShortDesc string
Description string
Price string
Category string
Available bool
Icon string
Variables []CatalogVariable
}
Catalog Item represents a catalog item
type CatalogVariable ¶
type CatalogVariable struct {
Name string
Label string
Type string
Mandatory bool
DefaultValue string
Options []string
}
Catalog Variable represents an item variable
type IdentityBrowserModel ¶
type IdentityBrowserModel struct {
// contains filtered or unexported fields
}
Identity browser model
func NewIdentityBrowser ¶
func NewIdentityBrowser(client *servicenow.Client) *IdentityBrowserModel
Create new identity browser
func (*IdentityBrowserModel) Init ¶
func (m *IdentityBrowserModel) Init() tea.Cmd
Initialize identity browser
func (*IdentityBrowserModel) Update ¶
func (m *IdentityBrowserModel) Update(msg tea.Msg) (*IdentityBrowserModel, tea.Cmd)
Update identity browser
func (*IdentityBrowserModel) View ¶
func (m *IdentityBrowserModel) View() string
View identity browser
type TableBrowserModel ¶
type TableBrowserModel struct {
// contains filtered or unexported fields
}
Table browser model
func NewTableBrowser ¶
func NewTableBrowser(client *servicenow.Client) *TableBrowserModel
Create new table browser
func (*TableBrowserModel) Init ¶
func (m *TableBrowserModel) Init() tea.Cmd
Initialize table browser
func (*TableBrowserModel) Update ¶
func (m *TableBrowserModel) Update(msg tea.Msg) (*TableBrowserModel, tea.Cmd)
Update table browser