diff --git a/models/backend_properties.go b/models/backend_properties.go index a21f7ee8a..f328eda17 100644 --- a/models/backend_properties.go +++ b/models/backend_properties.go @@ -37,6 +37,12 @@ type BackendProperties struct { // backend type BackendType string `json:"backendType,omitempty"` + // offline drives + OfflineDrives int64 `json:"offlineDrives,omitempty"` + + // online drives + OnlineDrives int64 `json:"onlineDrives,omitempty"` + // rr s c parity RrSCParity int64 `json:"rrSCParity,omitempty"` diff --git a/portal-ui/src/api/consoleApi.ts b/portal-ui/src/api/consoleApi.ts index 605ced0ea..f42e2725e 100644 --- a/portal-ui/src/api/consoleApi.ts +++ b/portal-ui/src/api/consoleApi.ts @@ -609,6 +609,8 @@ export interface BackendProperties { backendType?: string; rrSCParity?: number; standardSCParity?: number; + onlineDrives?: number; + offlineDrives?: number; } export interface ArnsResponse { diff --git a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx index cfbda54d6..824ac9030 100644 --- a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx +++ b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx @@ -201,8 +201,10 @@ const BasicDashboard = ({ usage }: IDashboardProps) => { } /> diff --git a/portal-ui/src/screens/Console/Dashboard/types.ts b/portal-ui/src/screens/Console/Dashboard/types.ts index 6d4c5a1f5..a012d7c13 100644 --- a/portal-ui/src/screens/Console/Dashboard/types.ts +++ b/portal-ui/src/screens/Console/Dashboard/types.ts @@ -34,6 +34,8 @@ export interface Backend { backendType: string; standardSCParity: number; rrSCParity: number; + onlineDrives: number; + offlineDrives: number; } export interface ServerInfo { diff --git a/restapi/admin_info.go b/restapi/admin_info.go index 4b552e3b9..6db478c31 100644 --- a/restapi/admin_info.go +++ b/restapi/admin_info.go @@ -76,6 +76,8 @@ func GetAdminInfo(ctx context.Context, client MinioAdmin) (*UsageInfo, error) { var backendType string var rrSCParity float64 var standardSCParity float64 + var onlineDrives float64 + var offlineDrives float64 if v, success := serverInfo.Backend.(map[string]interface{}); success { bt, ok := v["backendType"] @@ -90,6 +92,14 @@ func GetAdminInfo(ctx context.Context, client MinioAdmin) (*UsageInfo, error) { if ok { standardSCParity = sp.(float64) } + onDrives, ok := v["onlineDisks"] + if ok { + onlineDrives = onDrives.(float64) + } + offDrives, ok := v["offlineDisks"] + if ok { + offlineDrives = offDrives.(float64) + } } var usedSpace int64 @@ -132,8 +142,9 @@ func GetAdminInfo(ctx context.Context, client MinioAdmin) (*UsageInfo, error) { BackendType: backendType, RrSCParity: int64(rrSCParity), StandardSCParity: int64(standardSCParity), + OnlineDrives: int64(onlineDrives), + OfflineDrives: int64(offlineDrives), } - return &UsageInfo{ Buckets: int64(serverInfo.Buckets.Count), Objects: int64(serverInfo.Objects.Count), diff --git a/restapi/embedded_spec.go b/restapi/embedded_spec.go index 7d7f2ea0a..1c074f546 100644 --- a/restapi/embedded_spec.go +++ b/restapi/embedded_spec.go @@ -5301,6 +5301,12 @@ func init() { "backendType": { "type": "string" }, + "offlineDrives": { + "type": "integer" + }, + "onlineDrives": { + "type": "integer" + }, "rrSCParity": { "type": "integer" }, @@ -14297,6 +14303,12 @@ func init() { "backendType": { "type": "string" }, + "offlineDrives": { + "type": "integer" + }, + "onlineDrives": { + "type": "integer" + }, "rrSCParity": { "type": "integer" }, diff --git a/swagger.yml b/swagger.yml index 8a51f810d..29669e997 100644 --- a/swagger.yml +++ b/swagger.yml @@ -4616,6 +4616,10 @@ definitions: type: integer standardSCParity: type: integer + onlineDrives: + type: integer + offlineDrives: + type: integer arnsResponse: type: object properties: