Skip to content

Commit

Permalink
merge dev into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Sören Giller authored and Sören Giller committed Oct 19, 2018
2 parents eb55f16 + 9a764df commit e38b46d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/virtualmachines/volumeOverview.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,15 @@ <h4 class="modal-title">Create & Attach Volume</h4>
<div class="col-md-9">
<div class="input-group">
<input min="0" step="1" [value]="diskspace"
(input)="diskspace = $event.target.value" type="number" placeholder="e.g 8 "><span
(input)="diskspace = $event.target.value;calcDiskSpaceSum();" type="number" placeholder="e.g 8 "><span
class="input-group-addon"> GB
</span>


</div>
</div>
</div>
<div *ngIf="selected_vm && (diskspace + selectedProjectDiskspaceUsed) > selectedProjectVolumesMax"
<div *ngIf="selected_vm && (selectedProjectDiskSpaceSum > selectedProjectDiskspaceMax)"
class="alert alert-danger">
The storage limit is exceeded

Expand All @@ -390,7 +390,7 @@ <h4 class="modal-title">Create & Attach Volume</h4>
</div>
<div class="modal-footer">
<button class="btn btn-success col-md-6"
[disabled]="selected_vm == undefined || diskspace <= 0 || volumeName.length == 0 || (diskspace + selectedProjectDiskspaceUsed) > selectedProjectVolumesMax"
[disabled]="selected_vm == undefined || diskspace <= 0 || volumeName.length == 0 || (selectedProjectDiskSpaceSum > selectedProjectDiskspaceMax)"
(click)="createAndAttachvolume(volumeName,diskspace,selected_vm.openstackid);createModal.hide();resultModal.show()">
Create & Attach Volume
</button>
Expand Down
5 changes: 5 additions & 0 deletions src/app/virtualmachines/volumeOverview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class VolumeOverviewComponent implements OnInit {
selectedProjectDiskspaceUsed: number;
selectedProjectVolumesMax: number;
selectedProjectVolumesUsed: number;
selectedProjectDiskSpaceSum:number;
selectedProject: [string, number];
projects: string[] = new Array();
diskspace: number = 1;
Expand Down Expand Up @@ -75,6 +76,10 @@ export class VolumeOverviewComponent implements OnInit {
})
}

calcDiskSpaceSum():void{
this.selectedProjectDiskSpaceSum=parseInt(this.diskspace.toString()) + parseInt(this.selectedProjectDiskspaceUsed.toString());
}


getSelectedProjectDiskspace(): void {
this.groupService.getGroupMaxDiskspace(this.selectedProject[1].toString()).subscribe(result => {
Expand Down

0 comments on commit e38b46d

Please sign in to comment.