feat: testing mode banner + snapshot storage fields fix
This commit is contained in:
@@ -23,7 +23,7 @@ type Snapshot = {
|
||||
Name: string;
|
||||
ParentID: string;
|
||||
CreationTime: string;
|
||||
occupied_memory: number;
|
||||
occupied_disk_space_gb: number;
|
||||
};
|
||||
|
||||
type SnapshotStatus = {
|
||||
@@ -34,8 +34,8 @@ type SnapshotStatus = {
|
||||
};
|
||||
|
||||
type StorageInfo = {
|
||||
available_memory: number;
|
||||
all_memory: number;
|
||||
available_disk_space_gb: number;
|
||||
total_disk_space_gb: number;
|
||||
};
|
||||
|
||||
class SnapshotStore {
|
||||
@@ -271,10 +271,10 @@ class SnapshotStore {
|
||||
|
||||
runInAction(() => {
|
||||
this.snapshots = this.snapshots.filter((s) => s.ID !== id);
|
||||
if (this.storageInfo && snapshot?.occupied_memory) {
|
||||
if (this.storageInfo && snapshot?.occupied_disk_space_gb) {
|
||||
this.storageInfo = {
|
||||
...this.storageInfo,
|
||||
available_memory: this.storageInfo.available_memory + snapshot.occupied_memory,
|
||||
available_disk_space_gb: this.storageInfo.available_disk_space_gb + snapshot.occupied_disk_space_gb,
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user