diff --git a/models/pvcs_list_response.go b/models/pvcs_list_response.go index 10deb7f79..41f866715 100644 --- a/models/pvcs_list_response.go +++ b/models/pvcs_list_response.go @@ -52,6 +52,9 @@ type PvcsListResponse struct { // storage class StorageClass string `json:"storageClass,omitempty"` + // tenant + Tenant string `json:"tenant,omitempty"` + // volume Volume string `json:"volume,omitempty"` } diff --git a/operatorapi/embedded_spec.go b/operatorapi/embedded_spec.go index 2f46596b4..39e48144d 100644 --- a/operatorapi/embedded_spec.go +++ b/operatorapi/embedded_spec.go @@ -3851,6 +3851,9 @@ func init() { "storageClass": { "type": "string" }, + "tenant": { + "type": "string" + }, "volume": { "type": "string" } @@ -9281,6 +9284,9 @@ func init() { "storageClass": { "type": "string" }, + "tenant": { + "type": "string" + }, "volume": { "type": "string" } diff --git a/operatorapi/operator_volumes.go b/operatorapi/operator_volumes.go index d89bf6a74..6c7fe6485 100644 --- a/operatorapi/operator_volumes.go +++ b/operatorapi/operator_volumes.go @@ -72,8 +72,8 @@ func getPVCsResponse(session *models.Principal) (*models.ListPVCsResponse, *mode Status: string(pvc.Status.Phase), StorageClass: *pvc.Spec.StorageClassName, Volume: pvc.Spec.VolumeName, + Tenant: pvc.Labels["v1.min.io/tenant"], } - ListPVCs = append(ListPVCs, &pvcResponse) } diff --git a/portal-ui/src/screens/Console/Storage/StoragePVCs.tsx b/portal-ui/src/screens/Console/Storage/StoragePVCs.tsx index 8b398d31e..f7e292da4 100644 --- a/portal-ui/src/screens/Console/Storage/StoragePVCs.tsx +++ b/portal-ui/src/screens/Console/Storage/StoragePVCs.tsx @@ -19,6 +19,7 @@ import get from "lodash/get"; import { connect } from "react-redux"; import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; import { Grid, InputAdornment, TextField } from "@material-ui/core"; +import history from "../../../history"; import SearchIcon from "@material-ui/icons/Search"; import { actionsTray, @@ -83,7 +84,16 @@ const StorageVolumes = ({ elementItem.name.includes(filter) ); - return ( + const tableActions = [ + { + type: "view", + onClick: (record: any) => { + history.push(`/namespaces/${record.namespace}/tenants/${record.tenant}`); + }, + }, + ]; + + return ( `${record.namespace}/${record.tenant}`, }, { label: "Capacity", diff --git a/portal-ui/src/screens/Console/Storage/types.ts b/portal-ui/src/screens/Console/Storage/types.ts index 3bfe21527..d7b0e2ee8 100644 --- a/portal-ui/src/screens/Console/Storage/types.ts +++ b/portal-ui/src/screens/Console/Storage/types.ts @@ -23,6 +23,7 @@ export interface IStoragePVCs { storageClass: string; node: string; age: string; + tenant: string; } export interface IPVCsResponse { diff --git a/swagger-operator.yml b/swagger-operator.yml index 1691a1bac..4516ed74a 100644 --- a/swagger-operator.yml +++ b/swagger-operator.yml @@ -3501,6 +3501,8 @@ definitions: type: string volume: type: string + tenant: + type: string capacity: type: string storageClass: