proxy,ui: add version endpoint and display version info in UI (#395)
- Add /api/version endpoint to ProxyManager that returns build date, commit hash, and version - Implement SetVersion method to configure version info in ProxyManager - Add version info fetching to APIProvider and display in ConnectionStatus component - Include version info in UI context and update dependencies - Add tests for version endpoint functionality
This commit is contained in:
@@ -45,6 +45,11 @@ type ProxyManager struct {
|
||||
// shutdown signaling
|
||||
shutdownCtx context.Context
|
||||
shutdownCancel context.CancelFunc
|
||||
|
||||
// version info
|
||||
buildDate string
|
||||
commit string
|
||||
version string
|
||||
}
|
||||
|
||||
func New(config config.Config) *ProxyManager {
|
||||
@@ -122,6 +127,10 @@ func New(config config.Config) *ProxyManager {
|
||||
|
||||
shutdownCtx: shutdownCtx,
|
||||
shutdownCancel: shutdownCancel,
|
||||
|
||||
buildDate: "unknown",
|
||||
commit: "abcd1234",
|
||||
version: "0",
|
||||
}
|
||||
|
||||
// create the process groups
|
||||
@@ -770,3 +779,11 @@ func (pm *ProxyManager) findGroupByModelName(modelName string) *ProcessGroup {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (pm *ProxyManager) SetVersion(buildDate string, commit string, version string) {
|
||||
pm.Lock()
|
||||
defer pm.Unlock()
|
||||
pm.buildDate = buildDate
|
||||
pm.commit = commit
|
||||
pm.version = version
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user