Skip to content

Commit

Permalink
Dev (#255)
Browse files Browse the repository at this point in the history
* feat(version):show volumes if version is right

* feat(client):now checks version featuress

* feat(applications):added error message

* feat(application):added max lifetime 12

* removed unused things
  • Loading branch information
dweinholz authored Oct 26, 2018
1 parent e38b46d commit 41ef563
Show file tree
Hide file tree
Showing 11 changed files with 176 additions and 119 deletions.
2 changes: 1 addition & 1 deletion src/app/api-connector/group.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {Observable, throwError} from 'rxjs';
import {catchError} from 'rxjs/operators';
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
import {Cookie} from 'ng2-cookies/ng2-cookies';

import {Vmclient} from "../virtualmachines/virtualmachinemodels/vmclient";

const header = new HttpHeaders({
'X-CSRFToken': Cookie.get("csrftoken")
Expand Down
75 changes: 49 additions & 26 deletions src/app/applications/addcloudapplication.component.html

Large diffs are not rendered by default.

53 changes: 35 additions & 18 deletions src/app/applications/addsinglevm.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ <h5 class="col-md-6 form-control-label">General Information</h5>
<strong>Single Virtual Machines Project
<i data-balloon="You will be able to start virtual machines through the portal with minimal
effort and access them via ssh. This project type does not demand knowlegde in cloud
computing." data-balloon-pos="down" data-balloon-length="large"><i class="icon-question" style="cursor: pointer;"></i></i>
computing." data-balloon-pos="down" data-balloon-length="large"><i
class="icon-question" style="cursor: pointer;"></i></i>
</strong>

</label>
Expand All @@ -43,7 +44,8 @@ <h5 class="col-md-6 form-control-label">General Information</h5>
'has-success': f.controls.project_application_name?.valid && (f.controls.project_application_name?.dirty || f.controls.project_application_name?.touched)
}">
<label class="col-md-4 form-control-label" for="text-input"><strong>Project
Name* <i data-balloon="Full name of your project" data-balloon-pos="down"><i class="icon-question" style="cursor: pointer;"></i></i></strong></label>
Name* <i data-balloon="Full name of your project" data-balloon-pos="down"><i
class="icon-question" style="cursor: pointer;"></i></i></strong></label>
<div class="col-md-8">
<input required type="text" id="id_project_application_name"
name="project_application_name"
Expand All @@ -59,8 +61,10 @@ <h5 class="col-md-6 form-control-label">General Information</h5>
'has-success': f.controls.project_application_shortname?.valid && (f.controls.project_application_shortname?.dirty || f.controls.project_application_shortname?.touched)
}">
<label class="col-md-4 form-control-label" for="text-input"><strong>Project
Short Name* <i data-balloon="Shortname of your project. This name will be referenced in OpenStack and also when you start a new virtual machine. Use between 5 and 15 characters"
data-balloon-pos="down" data-balloon-length="large"><i class="icon-question" style="cursor: pointer;"></i></i></strong></label>
Short Name* <i
data-balloon="Shortname of your project. This name will be referenced in OpenStack and also when you start a new virtual machine. Use between 5 and 15 characters"
data-balloon-pos="down" data-balloon-length="large"><i class="icon-question"
style="cursor: pointer;"></i></i></strong></label>
<div class="col-md-8">
<div *ngIf='wronginput'>
<strong><font color="red">Umlauts and special characters are prohibited in the
Expand All @@ -83,8 +87,10 @@ <h5 class="col-md-6 form-control-label">General Information</h5>
'has-success': f.controls.project_application_description?.valid && (f.controls.project_application_description?.dirty || f.controls.project_application_description?.touched)
}">
<label class="col-md-4 form-control-label" for="textarea-input"><strong>Project
Description* <i data-balloon="Full description of your project including tools you might are going to use."
data-balloon-pos="down" data-balloon-length="large"><i class="icon-question" style="cursor: pointer;"></i></i></strong></label>
Description* <i
data-balloon="Full description of your project including tools you might are going to use."
data-balloon-pos="down" data-balloon-length="large"><i class="icon-question"
style="cursor: pointer;"></i></i></strong></label>
<div class="col-md-8">
<textarea required id="id_project_application_description"
name="project_application_description" rows="9"
Expand All @@ -101,16 +107,18 @@ <h5 class="col-md-6 form-control-label">General Information</h5>
}">
<label class="col-md-4 form-control-label" for="textarea-input"><strong>Desired
lifetime* <i data-balloon="Lifetime in months of your project" data-balloon-pos="down">
<i class="icon-question" style="cursor: pointer;"></i></i></strong></label>
<i class="icon-question" style="cursor: pointer;"></i></i></strong></label>
<div class="col-md-8">
<div class="input-group">
<input class="form-control" id="id_project_application_lifetime"
name="project_application_lifetime" placeholder="e.g 3"
type="number" min="1" step="1" ngModel required>
type="number" min="1" max="12" step="1" ngModel required
pattern="^([1-9]|1[012])$"
>
<span class="input-group-addon"> months
</span>
</div>
<span class="help-block">How long would you like to run this project?</span>
<span class="help-block">How long would you like to run this project (12 month is maximum)?</span>
</div>
</div>

Expand All @@ -124,8 +132,10 @@ <h5 class="col-md-12 form-control-label">Resources</h5>
'has-success': f.controls.project_application_vms_requested?.valid
}">
<label class="col-md-4 form-control-label" for="textarea-input"><strong>Number of Virtual
Machines* <i data-balloon="A virtual machine allows you to run operating system of your choice with flexible resource parameters like number of CPUs and RAM."
data-balloon-pos="down" data-balloon-length="large"><i class="icon-question" style="cursor: pointer;"></i></i></strong></label>
Machines* <i
data-balloon="A virtual machine allows you to run operating system of your choice with flexible resource parameters like number of CPUs and RAM."
data-balloon-pos="down" data-balloon-length="large"><i class="icon-question"
style="cursor: pointer;"></i></i></strong></label>
<div class="col-md-8">
<div class="input-group">
<input required class="form-control" id="id_project_application_vms_requested"
Expand All @@ -145,8 +155,10 @@ <h5 class="col-md-12 form-control-label">Resources</h5>
}">
<label class="col-md-4 form-control-label" for="textarea-input"><strong>Storage Limit*
<i
data-balloon="Storage limit is the sum of extra storage provided by volumes." data-balloon-pos="down"
data-balloon-length="large"><i class="icon-question" style="cursor: pointer;"></i></i></strong></label>
data-balloon="Storage limit is the sum of extra storage provided by volumes."
data-balloon-pos="down"
data-balloon-length="large"><i class="icon-question"
style="cursor: pointer;"></i></i></strong></label>
<div class="col-md-8">
<div class="input-group">
<input required class="form-control" id="id_project_application_volume_limit"
Expand All @@ -168,7 +180,8 @@ <h5 class="col-md-12 form-control-label">Resources</h5>
volumes*
<i
data-balloon="The number of storage volumes allowed to create. Each vm is allowed to mount only one storage volume. The sum of the volumes size equals the value provided in the sotrage limit field"
data-balloon-pos="down" data-balloon-length="large"><i class="icon-question" style="cursor: pointer;"></i></i></strong></label>
data-balloon-pos="down" data-balloon-length="large"><i class="icon-question"
style="cursor: pointer;"></i></i></strong></label>
<div class="col-md-8">
<div class="input-group">
<input required class="form-control" id="id_project_application_volume_counter"
Expand Down Expand Up @@ -213,7 +226,8 @@ <h5 class="col-md-6 form-control-label">Institutional Information</h5>
'has-success': f.controls.project_application_institute?.valid && (f.controls.project_application_institute?.dirty || f.controls.project_application_institute?.touched)
}">
<label class="col-md-4 form-control-label" for="text-input"><strong>Institute Name* <i
data-balloon="Your institute" data-balloon-pos="down"><i class="icon-question" style="cursor: pointer;"></i></i></strong></label>
data-balloon="Your institute" data-balloon-pos="down"><i class="icon-question"
style="cursor: pointer;"></i></i></strong></label>
<div class="col-md-8">
<input required type="text" id="id_project_application_institute"
name="project_application_institute" class="form-control"
Expand All @@ -228,7 +242,8 @@ <h5 class="col-md-6 form-control-label">Institutional Information</h5>
}">
<label class="col-md-4 form-control-label" for="text-input"><strong>Workgroup Name* <i
data-balloon="Your Workgroup"
data-balloon-pos="down"><i class="icon-question" style="cursor: pointer;"></i></i></strong></label>
data-balloon-pos="down"><i class="icon-question"
style="cursor: pointer;"></i></i></strong></label>
<div class="col-md-8">
<input required type="text" id="id_project_application_workgroup"
name="project_application_workgroup" class="form-control"
Expand Down Expand Up @@ -268,7 +283,8 @@ <h5 class="col-md-6 form-control-label">Institutional Information</h5>
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ notificationModalTitle }}</h4>
<button type="button" class="close" style="cursor:pointer" (click)="notificationModal.hide()" aria-label="Close">
<button type="button" class="close" style="cursor:pointer" (click)="notificationModal.hide()"
aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
Expand Down Expand Up @@ -311,7 +327,8 @@ <h4 class="modal-title">{{ notificationModalTitle }}</h4>
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"> {{acknowledgeModalTitle}}</h4>
<button type="button" class="close" style="cursor:pointer" (click)="acknowledgemodal.hide()" aria-label="Close">
<button type="button" class="close" style="cursor:pointer" (click)="acknowledgemodal.hide()"
aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
Expand Down
15 changes: 10 additions & 5 deletions src/app/projectmanagement/overview.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h1>Projects Overview</h1>
<p *ngIf="project.ComputeCenter?.Name">{{project.ComputeCenter.Name}}</p>
<ul *ngIf="project.ComputeCenter?.Name">
<li *ngIf="project.OpenStackProject"> Login: <a target="_blank"
href="{{project.ComputeCenter.Login}}">
href="{{project.ComputeCenter.Login}}">
{{project.ComputeCenter.Login}}</a></li>
<li>Support: {{project.ComputeCenter.Support}}</li>

Expand Down Expand Up @@ -527,7 +527,7 @@ <h4 class="modal-title">Applications for {{selectedProject?.Name}}</h4>

<td>{{application.Name}}</td>
<td>{{application.DateCreated}}</td>
<td *ngIf="application.UserIsVoMember">
<td>
<button
(click)="approveMemberApplication(selectedProject?.Id,application.Id,application.Name); "
class="btn btn-success"><i class="fa fa-check"></i> Approve
Expand All @@ -537,7 +537,6 @@ <h4 class="modal-title">Applications for {{selectedProject?.Name}}</h4>
class="btn btn-danger"><i class="fa fa-times"></i> Reject
</button>
</td>
<td *ngIf="!application.UserIsVoMember"> Membership for the vo must be approved beforehand</td>
</tbody>
</table>
</div>
Expand All @@ -550,16 +549,22 @@ <h4 class="modal-title">Applications for {{selectedProject?.Name}}</h4>
<strong>Success:</strong> Succesfully {{application_action}} the application of
{{application_member_name}}.
</p>
<p *ngIf="!application_action_success && application_action_done" class="alert alert-danger mr-auto">
<p *ngIf="!application_action_success && application_action_done && !application_action_error_message"
class="alert alert-danger mr-auto">
<strong>Failed:</strong> The application of {{application_member_name}} could not be
{{application_action}} .
</p>
<p *ngIf="!application_action_success && application_action_done && application_action_error_message"
class="alert alert-danger mr-auto">
<strong>Failed:</strong> User didn't verify his email address yet. Please wait until the email is
verified.
</p>
<button type="button" class="btn btn-primary"
(click)="loadProjectApplications(selectedProject?.Id)">
Refresh
</button>
<button type="button" class="btn btn-secondary"
(click)="application_action_done=false;selectedProject=undefined;applicationModal.hide();">
(click)="application_action_error_message=null;application_action_done=false;selectedProject=undefined;applicationModal.hide();">
Close
</button>
</div>
Expand Down
Loading

0 comments on commit 41ef563

Please sign in to comment.