Cluster: Add AppName, AppVersion and Theme request/response fields #98

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-10-19 12:44:21 +02:00
parent 1c0f68aa39
commit 1b85f84943
24 changed files with 491 additions and 35 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/photoprism/photoprism/internal/photoprism/get"
"github.com/photoprism/photoprism/internal/service/cluster"
reg "github.com/photoprism/photoprism/internal/service/cluster/registry"
"github.com/photoprism/photoprism/internal/service/cluster/theme"
"github.com/photoprism/photoprism/pkg/service/http/header"
)
@@ -44,12 +45,18 @@ func ClusterSummary(router *gin.RouterGroup) {
}
nodes, _ := regy.List()
themeVersion := ""
if v, err := theme.DetectVersion(conf.PortalThemePath()); err == nil {
themeVersion = v
}
c.JSON(http.StatusOK, cluster.SummaryResponse{
UUID: conf.ClusterUUID(),
ClusterCIDR: conf.ClusterCIDR(),
Nodes: len(nodes),
Database: cluster.DatabaseInfo{Driver: conf.DatabaseDriverName(), Host: conf.DatabaseHost(), Port: conf.DatabasePort()},
Theme: themeVersion,
Time: time.Now().UTC().Format(time.RFC3339),
})
})