Added docker widget with documentation

This commit is contained in:
Andrejs Baranovskis
2024-11-19 17:58:55 +01:00
parent c8570d07ef
commit eacbb14279
12 changed files with 385 additions and 9 deletions

View File

@@ -185,15 +185,10 @@ type CustomIcon struct {
// invert the color based on the theme being light or dark
}
func (i *CustomIcon) UnmarshalYAML(node *yaml.Node) error {
var value string
if err := node.Decode(&value); err != nil {
return err
}
prefix, icon, found := strings.Cut(value, ":")
func (i *CustomIcon) FromURL(url string) error {
prefix, icon, found := strings.Cut(url, ":")
if !found {
i.URL = value
i.URL = url
return nil
}
@@ -218,8 +213,16 @@ func (i *CustomIcon) UnmarshalYAML(node *yaml.Node) error {
i.URL = "https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/" + ext + "/" + basename + "." + ext
default:
i.URL = value
i.URL = url
}
return nil
}
func (i *CustomIcon) UnmarshalYAML(node *yaml.Node) error {
var value string
if err := node.Decode(&value); err != nil {
return err
}
return i.FromURL(value)
}