feat(homepage): enhance homepage functionality with new item click tracking, sort methods and category management

- Added ItemClick endpoint to increment item click counts.
- Refactored Categories function to dynamically generate categories based on available items.
- Introduced sorting methods for homepage items and categories.
- Updated item configuration to include visibility, favorite status, and sort orders.
- Improved handling of item URLs and added support for websocket connections in item retrieval.
This commit is contained in:
yusing
2025-09-13 23:52:54 +08:00
parent 58a2dc73dd
commit 2c290a3916
12 changed files with 612 additions and 105 deletions

View File

@@ -66,6 +66,7 @@ func FromDocker(c *container.Summary, dockerHost string) (res *types.Container)
IsExplicit: isExplicit,
IsHostNetworkMode: c.HostConfig.NetworkMode == "host",
Running: c.Status == "running" || c.State == "running",
State: c.State,
}
if agent.IsDockerHostAgent(dockerHost) {
@@ -143,9 +144,11 @@ var databaseMPs = map[string]struct{}{
}
func isDatabase(c *types.Container) bool {
for _, m := range c.Mounts.Iter {
if _, ok := databaseMPs[m]; ok {
return true
if c.Mounts != nil { // only happens in test
for _, m := range c.Mounts.Iter {
if _, ok := databaseMPs[m]; ok {
return true
}
}
}