mirror of
https://github.com/yusing/godoxy.git
synced 2025-07-15 01:54:03 +02:00
fix(homepage): missing homepage.url option
This commit is contained in:
parent
b6bfd19cc2
commit
47910774dd
1 changed files with 4 additions and 18 deletions
|
@ -1,7 +1,6 @@
|
||||||
package homepage
|
package homepage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"slices"
|
"slices"
|
||||||
|
|
||||||
"github.com/yusing/go-proxy/internal/homepage/widgets"
|
"github.com/yusing/go-proxy/internal/homepage/widgets"
|
||||||
|
@ -18,6 +17,7 @@ type (
|
||||||
Icon *IconURL `json:"icon"`
|
Icon *IconURL `json:"icon"`
|
||||||
Category string `json:"category"`
|
Category string `json:"category"`
|
||||||
Description string `json:"description" aliases:"desc"`
|
Description string `json:"description" aliases:"desc"`
|
||||||
|
URL string `json:"url,omitempty"`
|
||||||
SortOrder int `json:"sort_order"`
|
SortOrder int `json:"sort_order"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@ type (
|
||||||
*ItemConfig
|
*ItemConfig
|
||||||
WidgetConfig *widgets.Config `json:"widget_config,omitempty" aliases:"widget"`
|
WidgetConfig *widgets.Config `json:"widget_config,omitempty" aliases:"widget"`
|
||||||
|
|
||||||
Alias string
|
Alias string `json:"alias"`
|
||||||
Provider string
|
Provider string `json:"provider"`
|
||||||
OriginURL string
|
OriginURL string `json:"origin_url"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -43,20 +43,6 @@ func (cfg *ItemConfig) GetOverride(alias string) *ItemConfig {
|
||||||
return overrideConfigInstance.GetOverride(alias, cfg)
|
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) {
|
func (c Homepage) Add(item *Item) {
|
||||||
if c[item.Category] == nil {
|
if c[item.Category] == nil {
|
||||||
c[item.Category] = make(Category, 0)
|
c[item.Category] = make(Category, 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue