mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add persistent volumes info to storage class submenu (#2160)
Signed-off-by: vshakirova <vshakirova@mirantis.com>
This commit is contained in:
1 parent
6876d774a5
commit
0d3505cfac
7 files changed
+145
-1
No files matched your search
@@ -10,14 +10,22 @@ import { KubeObjectDetailsProps } from "../kube-object";
|
||||
import { StorageClass } from "../../api/endpoints";
|
||||
import { KubeObjectMeta } from "../kube-object/kube-object-meta";
|
||||
import { kubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
|
||||
import { storageClassStore } from "./storage-class.store";
|
||||
import { VolumeDetailsList } from "../+storage-volumes/volume-details-list";
|
||||
import { volumesStore } from "../+storage-volumes/volumes.store";
|
||||
|
||||
interface Props extends KubeObjectDetailsProps<StorageClass> {
|
||||
}
|
||||
|
||||
@observer
|
||||
export class StorageClassDetails extends React.Component<Props> {
|
||||
async componentDidMount() {
|
||||
volumesStore.reloadAll();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { object: storageClass } = this.props;
|
||||
const persistentVolumes = storageClassStore.getPersistentVolumes(storageClass);
|
||||
|
||||
if (!storageClass) return null;
|
||||
const { provisioner, parameters, mountOptions } = storageClass;
|
||||
@@ -55,6 +63,7 @@ export class StorageClassDetails extends React.Component<Props> {
|
||||
}
|
||||
</>
|
||||
)}
|
||||
<VolumeDetailsList persistentVolumes={persistentVolumes}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,15 @@ import { KubeObjectStore } from "../../kube-object.store";
|
||||
import { autobind } from "../../utils";
|
||||
import { StorageClass, storageClassApi } from "../../api/endpoints/storage-class.api";
|
||||
import { apiManager } from "../../api/api-manager";
|
||||
import { volumesStore } from "../+storage-volumes/volumes.store";
|
||||
|
||||
@autobind()
|
||||
export class StorageClassStore extends KubeObjectStore<StorageClass> {
|
||||
api = storageClassApi;
|
||||
|
||||
getPersistentVolumes(storageClass: StorageClass) {
|
||||
return volumesStore.getByStorageClass(storageClass);
|
||||
}
|
||||
}
|
||||
|
||||
export const storageClassStore = new StorageClassStore();
|
||||
|
||||
Reference in new issue
Block a user