Commit 77391f0
Eric Bower
·
2026-08-24 09:19:58 -0400 EDT
parent a139e53
chore(tui): check for pgs feature flag
3 files changed,
+16,
-7
+11,
-6
| ... | ... | @@ -153,11 +153,12 @@ func (m *FeaturesList) getFeaturesKv() []Kv { | |
| 153 | 153 | } | |
| 154 | 154 | ||
| 155 | 155 | type ServicesList struct { | |
| 156 | - | ff *db.FeatureFlag | |
| 156 | + | plusFf *db.FeatureFlag | |
| 157 | + | pgsFf *db.FeatureFlag | |
| 157 | 158 | } | |
| 158 | 159 | ||
| 159 | - | func NewServicesList(ff *db.FeatureFlag) *ServicesList { | |
| 160 | - | return &ServicesList{ff} | |
| 160 | + | func NewServicesList(plusFf *db.FeatureFlag, pgsFf *db.FeatureFlag) *ServicesList { | |
| 161 | + | return &ServicesList{plusFf: plusFf, pgsFf: pgsFf} | |
| 161 | 162 | } | |
| 162 | 163 | ||
| 163 | 164 | func (m *ServicesList) HandleEvent(ev vaxis.Event, phase vxfw.EventPhase) (vxfw.Command, error) { |
| ... | ... | @@ -180,18 +181,23 @@ func (m *ServicesList) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error) { | |
| 180 | 181 | } | |
| 181 | 182 | ||
| 182 | 183 | func (m *ServicesList) getServiceKv() []Kv { | |
| 183 | - | hasPlus := m.ff != nil | |
| 184 | + | hasPlus := m.plusFf != nil && m.plusFf.IsValid() | |
| 185 | + | hasPgs := m.pgsFf != nil && m.pgsFf.IsValid() | |
| 186 | + | pagesStatus := "pico+" | |
| 187 | + | if hasPlus || hasPgs { | |
| 188 | + | pagesStatus = "active" | |
| 189 | + | } | |
| 184 | 190 | data := [][]string{ | |
| 185 | 191 | {"name", "status"}, | |
| 186 | 192 | {"prose", "active"}, | |
| 187 | 193 | {"pipe", "active"}, | |
| 188 | 194 | {"pastes", "active"}, | |
| 195 | + | {"pages", pagesStatus}, | |
| 189 | 196 | } | |
| 190 | 197 | ||
| 191 | 198 | if hasPlus { | |
| 192 | 199 | data = append( | |
| 193 | 200 | data, | |
| 194 | - | []string{"pages", "active"}, | |
| 195 | 201 | []string{"tuns", "active"}, | |
| 196 | 202 | []string{"irc bouncer", "active"}, | |
| 197 | 203 | []string{"rss-to-email", "active"}, |
| ... | ... | @@ -199,7 +205,6 @@ func (m *ServicesList) getServiceKv() []Kv { | |
| 199 | 205 | } else { | |
| 200 | 206 | data = append( | |
| 201 | 207 | data, | |
| 202 | - | []string{"pages", "pico+"}, | |
| 203 | 208 | []string{"tuns", "pico+"}, | |
| 204 | 209 | []string{"irc bouncer", "pico+"}, | |
| 205 | 210 | []string{"rss-to-email", "pico+"}, |
| ... | ... | @@ -104,7 +104,7 @@ func (m *MenuPage) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error) { | |
| 104 | 104 | }, | |
| 105 | 105 | }) | |
| 106 | 106 | ||
| 107 | - | services, _ := NewServicesList(m.shared.PlusFeatureFlag).Draw(ctx) | |
| 107 | + | services, _ := NewServicesList(m.shared.PlusFeatureFlag, m.shared.PgsFeatureFlag).Draw(ctx) | |
| 108 | 108 | features, _ := m.features.Draw(ctx) | |
| 109 | 109 | ||
| 110 | 110 | leftPane := NewGroupStack([]vxfw.Surface{ |
+4,
-0