mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Cluster: Add AppName, AppVersion and Theme request/response fields #98
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -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),
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user