Fixed Drives offline card UI (#2732)
This commit is contained in:
@@ -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"`
|
||||
|
||||
|
||||
@@ -609,6 +609,8 @@ export interface BackendProperties {
|
||||
backendType?: string;
|
||||
rrSCParity?: number;
|
||||
standardSCParity?: number;
|
||||
onlineDrives?: number;
|
||||
offlineDrives?: number;
|
||||
}
|
||||
|
||||
export interface ArnsResponse {
|
||||
|
||||
@@ -201,8 +201,10 @@ const BasicDashboard = ({ usage }: IDashboardProps) => {
|
||||
</BoxItem>
|
||||
<BoxItem>
|
||||
<StatusCountCard
|
||||
offlineCount={offlineDrives.length}
|
||||
onlineCount={onlineDrives.length}
|
||||
offlineCount={
|
||||
usage?.backend.offlineDrives || offlineDrives.length
|
||||
}
|
||||
onlineCount={usage?.backend.onlineDrives || onlineDrives.length}
|
||||
label={"Drives"}
|
||||
icon={<DrivesIcon />}
|
||||
/>
|
||||
|
||||
@@ -34,6 +34,8 @@ export interface Backend {
|
||||
backendType: string;
|
||||
standardSCParity: number;
|
||||
rrSCParity: number;
|
||||
onlineDrives: number;
|
||||
offlineDrives: number;
|
||||
}
|
||||
|
||||
export interface ServerInfo {
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
@@ -4616,6 +4616,10 @@ definitions:
|
||||
type: integer
|
||||
standardSCParity:
|
||||
type: integer
|
||||
onlineDrives:
|
||||
type: integer
|
||||
offlineDrives:
|
||||
type: integer
|
||||
arnsResponse:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user