mirror of
https://github.com/KaySar12/NextZen-UserService.git
synced 2025-10-06 19:59:42 +07:00
add gpu number
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/IceWhaleTech/CasaOS-Common/external"
|
||||
"github.com/IceWhaleTech/CasaOS-Common/utils/common_err"
|
||||
"github.com/IceWhaleTech/CasaOS-Common/utils/jwt"
|
||||
"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
|
||||
@@ -818,6 +819,11 @@ func GetUserStatus(c *gin.Context) {
|
||||
data["key"] = key
|
||||
data["initialized"] = false
|
||||
}
|
||||
gpus, err := external.NvidiaGPUInfoList()
|
||||
if err != nil {
|
||||
logger.Error("NvidiaGPUInfoList error", zap.Error(err))
|
||||
}
|
||||
data["gpus"] = len(gpus)
|
||||
c.JSON(common_err.SUCCESS,
|
||||
model.Result{
|
||||
Success: common_err.SUCCESS,
|
||||
|
||||
Reference in New Issue
Block a user