diff --git a/models/admin_info_response.go b/models/admin_info_response.go index 3bd6f5e38..2b4897c0c 100644 --- a/models/admin_info_response.go +++ b/models/admin_info_response.go @@ -42,6 +42,9 @@ type AdminInfoResponse struct { // Enum: [not configured available unavailable] AdvancedMetricsStatus string `json:"advancedMetricsStatus,omitempty"` + // backend + Backend *BackendProperties `json:"backend,omitempty"` + // buckets Buckets int64 `json:"buckets,omitempty"` @@ -66,6 +69,10 @@ func (m *AdminInfoResponse) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateBackend(formats); err != nil { + res = append(res, err) + } + if err := m.validateServers(formats); err != nil { res = append(res, err) } @@ -125,6 +132,25 @@ func (m *AdminInfoResponse) validateAdvancedMetricsStatus(formats strfmt.Registr return nil } +func (m *AdminInfoResponse) validateBackend(formats strfmt.Registry) error { + if swag.IsZero(m.Backend) { // not required + return nil + } + + if m.Backend != nil { + if err := m.Backend.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backend") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backend") + } + return err + } + } + + return nil +} + func (m *AdminInfoResponse) validateServers(formats strfmt.Registry) error { if swag.IsZero(m.Servers) { // not required return nil @@ -181,6 +207,10 @@ func (m *AdminInfoResponse) validateWidgets(formats strfmt.Registry) error { func (m *AdminInfoResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateBackend(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateServers(ctx, formats); err != nil { res = append(res, err) } @@ -195,6 +225,22 @@ func (m *AdminInfoResponse) ContextValidate(ctx context.Context, formats strfmt. return nil } +func (m *AdminInfoResponse) contextValidateBackend(ctx context.Context, formats strfmt.Registry) error { + + if m.Backend != nil { + if err := m.Backend.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backend") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backend") + } + return err + } + } + + return nil +} + func (m *AdminInfoResponse) contextValidateServers(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Servers); i++ { diff --git a/models/backend_properties.go b/models/backend_properties.go new file mode 100644 index 000000000..0d8a15131 --- /dev/null +++ b/models/backend_properties.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// This file is part of MinIO Console Server +// Copyright (c) 2022 MinIO, Inc. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BackendProperties backend properties +// +// swagger:model BackendProperties +type BackendProperties struct { + + // backend type + BackendType string `json:"backendType,omitempty"` + + // rr s c parity + RrSCParity int64 `json:"rrSCParity,omitempty"` + + // standard s c parity + StandardSCParity int64 `json:"standardSCParity,omitempty"` +} + +// Validate validates this backend properties +func (m *BackendProperties) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this backend properties based on context it is used +func (m *BackendProperties) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *BackendProperties) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BackendProperties) UnmarshalBinary(b []byte) error { + var res BackendProperties + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx index 730652a2e..09d3ce7d4 100644 --- a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx +++ b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx @@ -15,7 +15,7 @@ // along with this program. If not, see . import React from "react"; -import { Box } from "@mui/material"; +import { Box, Grid } from "@mui/material"; import { ArrowRightIcon, BucketsIcon, @@ -25,6 +25,8 @@ import { ServersIcon, TotalObjectsIcon, UptimeIcon, + FormatDrivesIcon, + StorageIcon, } from "../../../../icons"; import HelpBox from "../../../../common/HelpBox"; import { calculateBytes, representationNumber } from "../../../../common/utils"; @@ -276,6 +278,41 @@ const BasicDashboard = ({ usage }: IDashboardProps) => { + + + } + label={"Backend type"} + value={ + usage?.backend?.backendType + ? usage.backend.backendType + : "Unknown" + } + /> + + + } + label={"Standard storage class parity"} + value={ + usage?.backend?.standardSCParity + ? usage.backend.standardSCParity.toString() + : "n/a" + } + /> + + + } + label={"Reduced redundancy storage class parity"} + value={ + usage?.backend?.standardSCParity + ? usage.backend.rrSCParity.toString() + : "n/a" + } + /> + +