Database is more usable now. All pages have been updated to use the database, and share an application configuration. Page Stack has been removed, no more pages hanging around in memory. Replaced with a 'Router' which uses an Enum to determine which page should be displayed, destroys the old page and initializes the new page all in one go. No more push, pop, rollback, etc. No more holding instances of pages. Logger has been updated with proper timestamps and sorting now works as expected."
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
// schema.go defines the database schema for the GORM models.
|
|
package db
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
type AppConfig struct {
|
|
gorm.Model
|
|
DataDir string
|
|
AssetsDir string
|
|
EmailAddress string
|
|
LicenseKey string
|
|
SystemLevel string // BASIC, ADVANCED, ELITE, COMMERCIAL
|
|
SelectedAudio string // Audio filepath
|
|
SelectedAudioDevice string // The pipewire device name
|
|
InitialFontSize int // How large to create the font atlas
|
|
StandardFontSize int // The font size used for most text rendering
|
|
LinePattern string // "fibonacci"
|
|
LastVolume int // 0-128
|
|
AudioEnabled bool
|
|
}
|
|
|
|
type Log struct {
|
|
gorm.Model
|
|
Timestamp int64
|
|
Level string
|
|
Message string
|
|
}
|
|
|
|
type Proclamation struct {
|
|
gorm.Model
|
|
ID string `gorm:"primaryKey"`
|
|
Name string
|
|
Content string
|
|
SolfeggioFrequencyID int
|
|
CategoryID int
|
|
Selected bool
|
|
Available bool
|
|
Price float64
|
|
}
|