增加获取磁盘挂载点接口
This commit is contained in:
@@ -70,7 +70,7 @@ func (a *MonitorApi) GetDiskStateByPath(c *gin.Context) {
|
||||
cacheDiskName := global.SystemMonitor_DISK_INFO + req.Path
|
||||
|
||||
if v, ok := global.SystemMonitor.Get(cacheDiskName); ok {
|
||||
global.Logger.Debugln("读取缓存的的RAM信息")
|
||||
global.Logger.Debugln("读取缓存的的DISK信息")
|
||||
apiReturn.SuccessData(c, v)
|
||||
return
|
||||
}
|
||||
@@ -85,3 +85,12 @@ func (a *MonitorApi) GetDiskStateByPath(c *gin.Context) {
|
||||
global.SystemMonitor.Set(cacheDiskName, diskState, cacheSecond*time.Second)
|
||||
apiReturn.SuccessData(c, diskState)
|
||||
}
|
||||
|
||||
func (a *MonitorApi) GetDiskMountpoints(c *gin.Context) {
|
||||
if list, err := monitor.GetDiskMountpoints(); err != nil {
|
||||
apiReturn.Error(c, err.Error())
|
||||
return
|
||||
} else {
|
||||
apiReturn.SuccessData(c, list)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user