clock.go 408 B

1234567891011121314151617181920212223
  1. package widget
  2. import (
  3. "context"
  4. "html/template"
  5. "github.com/glanceapp/glance/internal/assets"
  6. )
  7. type Clock struct {
  8. widgetBase `yaml:",inline"`
  9. }
  10. func (widget *Clock) Initialize() error {
  11. widget.withTitle("Clock").withError(nil)
  12. return nil
  13. }
  14. func (widget *Clock) Update(ctx context.Context) {}
  15. func (widget *Clock) Render() template.HTML {
  16. return widget.render(widget, assets.ClockTemplate)
  17. }