feat: change version API to generated version

This commit is contained in:
Hintay 2025-02-04 01:38:15 +09:00
parent de420ab6ff
commit f9802e6b2b
No known key found for this signature in database
GPG key ID: 120FC7FF121F2F2D
4 changed files with 30 additions and 30 deletions

View file

@ -1,14 +1,16 @@
package system
import (
"net/http"
"os"
"github.com/0xJacky/Nginx-UI/api"
"github.com/0xJacky/Nginx-UI/internal/upgrader"
"github.com/0xJacky/Nginx-UI/internal/version"
"github.com/0xJacky/Nginx-UI/settings"
"github.com/gin-gonic/gin"
"github.com/gorilla/websocket"
"github.com/uozi-tech/cosy/logger"
"net/http"
"os"
)
func GetRelease(c *gin.Context) {
@ -32,13 +34,7 @@ func GetRelease(c *gin.Context) {
}
func GetCurrentVersion(c *gin.Context) {
curVer, err := upgrader.GetCurrentVersion()
if err != nil {
api.ErrHandler(c, err)
return
}
c.JSON(http.StatusOK, curVer)
c.JSON(http.StatusOK, version.GetVersionInfo())
}
const (