mirror of
https://github.com/Dvorinka/Dash.git
synced 2026-10-28 15:51:27 +00:00
Two tracks from the Beszel/Domain-Locker merge plan in ROADMAP.md: - Importers: POST /api/import/external sniffs Homepage services.yml, Homarr JSON, and Dashy conf.yml into sections/items; SettingsDialog import now accepts all four formats. - Monitors (M1): monitors + heartbeats schema, pure checkers for http/tcp/ping/dns/keyword/json-query/push, scheduler on app ctx, CRUD + check-now + push ingest API, /monitors + /monitors/:id pages (wouter), monitor board widget, ServiceDialog monitor opt-in. Authored By: TDvorak <[email protected]> Generated with Devin (https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
30 lines
661 B
Go
30 lines
661 B
Go
package widget
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// Clock renders client-side — it registers only so /api/widgets/types lists
|
|
// it and the add-widget dialog can offer it like any other type.
|
|
type clock struct{}
|
|
|
|
func init() { Register(clock{}) }
|
|
|
|
func (clock) Meta() Type {
|
|
return Type{
|
|
Type: "clock",
|
|
Name: "Clock",
|
|
Description: "Local time in any timezone",
|
|
Local: true,
|
|
Fields: []Field{
|
|
{Key: "timezone", Label: "Timezone", Placeholder: "Europe/Prague — blank = local"},
|
|
},
|
|
}
|
|
}
|
|
|
|
func (clock) Fetch(context.Context, json.RawMessage) (any, error) {
|
|
return nil, fmt.Errorf("clock renders client-side")
|
|
}
|