Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sören Giller authored and Sören Giller committed Jul 19, 2018
2 parents df7ba25 + 591908e commit 2842cc4
Show file tree
Hide file tree
Showing 39 changed files with 2,657 additions and 824 deletions.
10 changes: 5 additions & 5 deletions hooks/env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[ -n "$SOURCE_BRANCH" ] || SOURCE_BRANCH=$(git symbolic-ref -q --short HEAD)
SOURCE_BRANCH=$(git symbolic-ref -q --short HEAD)

if [[ $SOURCE_BRANCH = "prod" ]] || [[ $SOURCE_BRANCH == *.*.* ]] ; then
ANGULAR_MODE="prod"
if $(git describe --exact-match --tags HEAD) "$ret" -eq 0 || [ $SOURCE_BRANCH = "master" ]; then
ANGULAR_MODE="prod"
else
ANGULAR_MODE="stage"
fi
ANGULAR_MODE="stage"
fi
63 changes: 63 additions & 0 deletions src/app/api-connector/applications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,69 @@ export class ApplicationsService {
});
}



requestRenewal(data) {
let parameter = data;


let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
'Content-Type': 'application/json'
});
return this.http.post(this.settings.getApiBaseURL() + 'application/requestRenewal/',parameter,
{
headers: header,
withCredentials: true
});
}

approveRenewal(application_id: number) {


let urlSearchParams = new URLSearchParams();
urlSearchParams.append('project_application_id', application_id.toString());
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
return this.http.post(this.settings.getApiBaseURL() + 'application/approveRenewal/', urlSearchParams,
{
headers: header,
withCredentials: true
});
}

declineRenewal(application_id: number) {


let urlSearchParams = new URLSearchParams();
urlSearchParams.append('project_application_id', application_id.toString());
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
return this.http.post(this.settings.getApiBaseURL() + 'application/declineRenewal/', urlSearchParams,
{
headers: header,
withCredentials: true
});
}


getAllApplicationsRenewalRequests() {
return this.http.get(this.settings.getApiBaseURL() + 'application/applicationRenewalRequests/', {
withCredentials: true,
params: {format: this.settings.getApiFormat()}
});
}

getApplicationsRenewalRequest(application_id: number) {
return this.http.get(this.settings.getApiBaseURL() + 'application/getApplicationRenewalRequestById/', {
withCredentials: true,
params: {format: this.settings.getApiFormat(),'project_application_id':application_id}
});
}


deleteApplication(application_id: number) {


Expand Down
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 @@ -343,7 +343,7 @@ export class GroupService {
return this.http.post(this.settings.getApiBaseURL() + 'group/setPerunId/', urlSearchParams, {
withCredentials: true,
headers: header
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))
})


}
Expand Down
65 changes: 55 additions & 10 deletions src/app/api-connector/image.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Injectable} from '@angular/core';
import {Image} from '../virtualmachines/virtualmachinemodels/image';
import {SnapshotModel} from "../virtualmachines/virtualmachinemodels/snapshot.model";
import {Http, Response, Headers, RequestOptions} from '@angular/http';
import {Observable} from 'rxjs/Rx';
import {URLSearchParams} from '@angular/http';
Expand All @@ -17,7 +18,6 @@ export class ImageService {
let urlSearchParams = new URLSearchParams();



return this.http.get(this.settings.getConnectorBaseUrl() + 'images/getImages/', {
withCredentials: true,
search: urlSearchParams
Expand All @@ -39,38 +39,83 @@ export class ImageService {
}


addImageTags(imageTag:string, description:string): Observable<any> {
addImageTags(imageTag: string, description: string): Observable<any> {
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
let urlSearchParams = new URLSearchParams();

urlSearchParams.append('imageTag',imageTag)
urlSearchParams.append('description',description)
urlSearchParams.append('imageTag', imageTag)
urlSearchParams.append('description', description)

return this.http.post(this.settings.getConnectorBaseUrl() + 'images/addImageTag/', urlSearchParams,{
return this.http.post(this.settings.getConnectorBaseUrl() + 'images/addImageTag/', urlSearchParams, {
withCredentials: true,
headers:header
headers: header
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))

}


deleteImageTag(imageTag:string): Observable<any> {
deleteImageTag(imageTag: string): Observable<any> {
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
let urlSearchParams = new URLSearchParams();

urlSearchParams.append('imageTag',imageTag)
urlSearchParams.append('imageTag', imageTag)


return this.http.post(this.settings.getConnectorBaseUrl() + 'images/deleteImageTag/', urlSearchParams, {
withCredentials: true,
headers: header
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))

}


createSnapshot(snaptshot_instance: string, snapshot_name: string,): Observable<any> {
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
let urlSearchParams = new URLSearchParams();

urlSearchParams.append('snapshot_name', snapshot_name)
urlSearchParams.append('snapshot_instance', snaptshot_instance)

return this.http.post(this.settings.getConnectorBaseUrl() + 'images/deleteImageTag/', urlSearchParams,{
return this.http.post(this.settings.getConnectorBaseUrl() + 'images/createSnapshot/', urlSearchParams, {
withCredentials: true,
headers:header
headers: header
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))

}

deleteSnapshot(snapshot_id: string): Observable<any> {
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
let urlSearchParams = new URLSearchParams();

urlSearchParams.append('snapshot_id', snapshot_id)

return this.http.post(this.settings.getConnectorBaseUrl() + 'images/deleteSnapshot/', urlSearchParams, {
withCredentials: true,
headers: header
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))


}

getSnapshotsByUser(): Observable<SnapshotModel[]> {
let urlSearchParams = new URLSearchParams();


return this.http.get(this.settings.getConnectorBaseUrl() + 'images/getSnapshots/', {
withCredentials: true,
search: urlSearchParams
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))


}


}
16 changes: 16 additions & 0 deletions src/app/api-connector/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,21 @@ export class UserService {

}

sendHelpMail(subject, message, reply): Observable<any> {
let urlSearchParams = new URLSearchParams();
urlSearchParams.append('subject', subject);
urlSearchParams.append('message', message);
urlSearchParams.append('reply', reply);

let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
return this.http.post(this.settings.getApiBaseURL() + 'user/sendHelpMail/', urlSearchParams, {
withCredentials: true,
headers: header,
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))

}


}
81 changes: 77 additions & 4 deletions src/app/api-connector/virtualmachine.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {ApiSettings} from './api-settings.service'
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import {VirtualMachine} from '../virtualmachines/virtualmachinemodels/virtualmachine';
import {Volume} from "../virtualmachines/virtualmachinemodels/volume";

@Injectable()
export class VirtualmachineService {
Expand All @@ -17,7 +18,6 @@ export class VirtualmachineService {
}



startVM(flavor: string, image: string, servername: string, project: string, projectid: string, diskspace?: string): Observable<Response> {

let header = new Headers({
Expand Down Expand Up @@ -60,7 +60,18 @@ export class VirtualmachineService {
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))
}

checkStatusInactiveVms(elixir_id: string): Observable<VirtualMachine[]> {
getActiveVmsByProject(groupid: string): Observable<VirtualMachine[]> {
let urlSearchParams = new URLSearchParams();
urlSearchParams.append('groupid', groupid)

return this.http.get(this.baseVmUrl + 'getActiveVmsByProject/', {
withCredentials: true,
search: urlSearchParams
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))
}


checkStatusInactiveVms(elixir_id: string): Observable<VirtualMachine[]> {
let urlSearchParams = new URLSearchParams();
urlSearchParams.append('elixir_id', elixir_id)

Expand All @@ -80,10 +91,10 @@ export class VirtualmachineService {
urlSearchParams.append('openstack_id', openstack_id)


return this.http.post(this.baseVmUrl + 'checkStatusVm/',urlSearchParams, {
return this.http.post(this.baseVmUrl + 'checkStatusVm/', urlSearchParams, {
withCredentials: true,

headers:header
headers: header
});
}

Expand Down Expand Up @@ -129,4 +140,66 @@ export class VirtualmachineService {
});
}


getVolumesByUser(): Observable<Volume[]> {
let urlSearchParams = new URLSearchParams();

return this.http.get(this.settings.getConnectorBaseUrl() + 'volumes/get_volumes/', {
withCredentials: true,
search: urlSearchParams
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'));


}

attachVolumetoServer(volume_id: string, instance_id: string): Observable<Response> {
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
let urlSearchParams = new URLSearchParams();

urlSearchParams.append('volume_id', volume_id)
urlSearchParams.append('instance_id', instance_id)


return this.http.post(this.settings.getConnectorBaseUrl() + 'volumes/attachVolume/', urlSearchParams, {
withCredentials: true,
headers: header,
});
}


deleteVolume(volume_id: string): Observable<Response> {
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
let urlSearchParams = new URLSearchParams();

urlSearchParams.append('volume_id', volume_id)


return this.http.post(this.settings.getConnectorBaseUrl() + 'volumes/deleteVolume/', urlSearchParams, {
withCredentials: true,
headers: header,
});
}


deleteVolumeAttachment(volume_id: string, instance_id: string): Observable<Response> {
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
let urlSearchParams = new URLSearchParams();

urlSearchParams.append('volume_id', volume_id)
urlSearchParams.append('instance_id', instance_id)


return this.http.post(this.settings.getConnectorBaseUrl() + 'volumes/deleteVolumeAttachment/', urlSearchParams, {
withCredentials: true,
headers: header,
});
}


}
4 changes: 4 additions & 0 deletions src/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export const routes: Routes = [
path: 'userinfo',
loadChildren: './userinfo/userinfo.module#UserinfoModule'
},
{
path: 'help',
loadChildren: './help/help.module#HelpModule'
},
{
path: 'project-management',
loadChildren: './projectmanagement/projectmanagement.module#ProjectManagementModule'
Expand Down
10 changes: 10 additions & 0 deletions src/app/applications/application.model.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {ApplicationExtension} from "./application_extension.model";

export class Application {
private _Id: number;
private _Name: string;
Expand All @@ -23,12 +25,20 @@ export class Application {
private _OpenStackProject: boolean;
private _ComputeCenterDetails:[string,string][];
private _DaysRunning: number;
private _ApplicationExtension:ApplicationExtension;



constructor() {
}

get ApplicationExtension():ApplicationExtension{
return this._ApplicationExtension;
}

set ApplicationExtension(value:ApplicationExtension){
this._ApplicationExtension=value;
}
get DaysRunning():number{
return this._DaysRunning;
}
Expand Down
Loading

0 comments on commit 2842cc4

Please sign in to comment.