From 47910774dd07aabdb7b398299bb0849b8c18a19e Mon Sep 17 00:00:00 2001 From: yusing Date: Sun, 13 Jul 2025 15:47:26 +0800 Subject: [PATCH] fix(homepage): missing homepage.url option --- internal/homepage/homepage.go | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/internal/homepage/homepage.go b/internal/homepage/homepage.go index 13d78bb..f030541 100644 --- a/internal/homepage/homepage.go +++ b/internal/homepage/homepage.go @@ -1,7 +1,6 @@ package homepage import ( - "encoding/json" "slices" "github.com/yusing/go-proxy/internal/homepage/widgets" @@ -18,6 +17,7 @@ type ( Icon *IconURL `json:"icon"` Category string `json:"category"` Description string `json:"description" aliases:"desc"` + URL string `json:"url,omitempty"` SortOrder int `json:"sort_order"` } @@ -25,9 +25,9 @@ type ( *ItemConfig WidgetConfig *widgets.Config `json:"widget_config,omitempty" aliases:"widget"` - Alias string - Provider string - OriginURL string + Alias string `json:"alias"` + Provider string `json:"provider"` + OriginURL string `json:"origin_url"` } ) @@ -43,20 +43,6 @@ func (cfg *ItemConfig) GetOverride(alias string) *ItemConfig { return overrideConfigInstance.GetOverride(alias, cfg) } -func (item *Item) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]any{ - "show": item.Show, - "alias": item.Alias, - "provider": item.Provider, - "name": item.Name, - "icon": item.Icon, - "category": item.Category, - "description": item.Description, - "sort_order": item.SortOrder, - "widget_config": item.WidgetConfig, - }) -} - func (c Homepage) Add(item *Item) { if c[item.Category] == nil { c[item.Category] = make(Category, 0)