controller v0.264.0: the household is told when an update is undone or held, in its language
gates / gates (push) Successful in 25s
gates / gates (push) Successful in 25s
app_update_undone / app_update_held events (09 decision 15), on by default and seeded once on existing boxes; R-606 update sentences as key+args rendered per reader; R-646 startup applied-meta backfill for apps current with the catalog; R-620 a disabled notifier WARNs once per event type. Needs hub v0.120.0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -128,6 +128,12 @@ func (s *Server) templateFuncMap() template.FuncMap {
|
||||
return "off"
|
||||
}
|
||||
},
|
||||
// v0.264.0 (R-606): the update path's sentences, rendered per reader. These are the HUNGARIAN
|
||||
// forms — exactly what the templates printed before (.UpdatePhaseLabel / .UpdateError /
|
||||
// .HoldReason); localeFuncs overrides all three for another language.
|
||||
"updatePhaseText": func(st interface{}) string { return stackOf(st).UpdatePhaseLabel },
|
||||
"updateErrorText": func(st interface{}) string { return stackOf(st).UpdateError },
|
||||
"holdText": func(st interface{}) string { return stackOf(st).HoldReason },
|
||||
"stateLabel": func(state stacks.ContainerState) string {
|
||||
switch state {
|
||||
case stacks.StateRunning:
|
||||
@@ -491,3 +497,18 @@ func fmtRFC3339Local(s string) string {
|
||||
}
|
||||
return t.In(getTimezone()).Format("2006-01-02 15:04")
|
||||
}
|
||||
|
||||
// stackOf lets the update-path template funcs take a stack the way each page holds it (app_info: a
|
||||
// *stacks.Stack; stacks: a stacks.Stack in a range). Anything else is an empty stack — the func then
|
||||
// prints an empty string, which a render test would see.
|
||||
func stackOf(v interface{}) stacks.Stack {
|
||||
switch st := v.(type) {
|
||||
case stacks.Stack:
|
||||
return st
|
||||
case *stacks.Stack:
|
||||
if st != nil {
|
||||
return *st
|
||||
}
|
||||
}
|
||||
return stacks.Stack{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user