mirror of
https://github.com/glanceapp/glance.git
synced 2025-08-18 20:08:15 +02:00
Add a clock widget
It's a simple clock that shows the current time Signed-off-by: Yarden Shoham <git@yardenshoham.com>
This commit is contained in:
23
internal/widget/clock.go
Normal file
23
internal/widget/clock.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package widget
|
||||
|
||||
import (
|
||||
"context"
|
||||
"html/template"
|
||||
|
||||
"github.com/glanceapp/glance/internal/assets"
|
||||
)
|
||||
|
||||
type Clock struct {
|
||||
widgetBase `yaml:",inline"`
|
||||
}
|
||||
|
||||
func (widget *Clock) Initialize() error {
|
||||
widget.withTitle("Clock").withError(nil)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (widget *Clock) Update(ctx context.Context) {}
|
||||
|
||||
func (widget *Clock) Render() template.HTML {
|
||||
return widget.render(widget, assets.ClockTemplate)
|
||||
}
|
Reference in New Issue
Block a user