Skip to content

Commit

Permalink
fix(merge): merged dev into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Sören Giller committed Jun 29, 2018
2 parents ee5a184 + dac23e6 commit d0da014
Show file tree
Hide file tree
Showing 34 changed files with 3,038 additions and 2,343 deletions.
3,879 changes: 2,213 additions & 1,666 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
"moment": "^2.18.1",
"ng2-charts": "1.5.0",
"ng2-cookies": "^1.0.12",
"ng2-popover": "0.0.14",
"ngx-bootstrap": "1.6.6",
"ngx-modialog": "^3.0.4",
"ngx-popover": "0.0.16",
"node-sass": "^4.4.0",
"rxjs": "5.4.0",
"ts-helpers": "1.1.2",
Expand Down
2 changes: 2 additions & 0 deletions src/app/api-connector/applications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ export class ApplicationsService {
});
}



}
3 changes: 2 additions & 1 deletion src/app/api-connector/facility.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ export class FacilityService {

}

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

let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
Expand Down
158 changes: 129 additions & 29 deletions src/app/api-connector/group.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ export class GroupService {


}
isUserAdminOfGroup(groupid: string,userid:string): Observable<any> {

isUserAdminOfGroup(groupid: string, userid: string): Observable<any> {

return this.http.get(this.settings.getApiBaseURL() + 'group/isUserPi/', {
withCredentials: true,
params: {group_id:groupid,user_id:userid}
params: {group_id: groupid, user_id: userid}
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))

}
Expand All @@ -69,7 +70,16 @@ export class GroupService {

return this.http.get(this.settings.getApiBaseURL() + 'group/getGroupAdminsId/', {
withCredentials: true,
params: {group_id:groupid}
params: {group_id: groupid}
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))

}

getGroupRichMembers(groupid: number): Observable<any> {

return this.http.get(this.settings.getApiBaseURL() + 'group/getGroupRichMembers/', {
withCredentials: true,
params: {groupid: groupid}
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))

}
Expand All @@ -90,7 +100,7 @@ export class GroupService {
}


addAdmin(group_id: number, user_id: number, facility_id: number) {
addAdmin(group_id: number, user_id: number, facility_id: number) {
let urlSearchParams = new URLSearchParams();
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
Expand All @@ -105,40 +115,39 @@ export class GroupService {
}


removeMember(group_id: number, member_id: number,user_id:number, facility_id: number) {
removeMember(group_id: number, member_id: number, user_id: number, facility_id: number) {
let urlSearchParams = new URLSearchParams();
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
urlSearchParams.append('facility_id', facility_id.toString());
urlSearchParams.append('group_id', group_id.toString());
urlSearchParams.append('member_id', member_id.toString())
urlSearchParams.append('user_id', user_id.toString())
urlSearchParams.append('user_id', user_id.toString())
return this.http.post(this.settings.getApiBaseURL() + 'group/removeMember/', urlSearchParams, {
withCredentials: true,
headers: header
})
}


removeAdmin(group_id: number,user_id:number, facility_id: number) {
removeAdmin(group_id: number, user_id: number, facility_id: number) {
let urlSearchParams = new URLSearchParams();
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
urlSearchParams.append('facility_id', facility_id.toString());
urlSearchParams.append('group_id', group_id.toString());

urlSearchParams.append('user_id', user_id.toString())
urlSearchParams.append('user_id', user_id.toString())
return this.http.post(this.settings.getApiBaseURL() + 'group/removeAdmin/', urlSearchParams, {
withCredentials: true,
headers: header
})
}



setDescription(groupid: string, description: string): Observable<any> {
setDescription(groupid: string, description: string): Observable<any> {

let urlSearchParams = new URLSearchParams();
let header = new Headers({
Expand All @@ -155,7 +164,61 @@ export class GroupService {
}


setName(groupid: string, name: string): Observable<any> {
setPerunGroupStatus(group_id: number, status: number) {
let urlSearchParams = new URLSearchParams();
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
urlSearchParams.append('groupid', group_id.toString());
urlSearchParams.append('status', status.toString());
return this.http.post(this.settings.getApiBaseURL() + 'group/setStatus/', urlSearchParams, {
withCredentials: true,
headers: header
})
}

setGroupVolumeLimit(group_id: number, value: number) {
let urlSearchParams = new URLSearchParams();
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
urlSearchParams.append('groupid', group_id.toString());
urlSearchParams.append('value', value.toString());
return this.http.post(this.settings.getApiBaseURL() + 'group/setGroupVolumeLimit/', urlSearchParams, {
withCredentials: true,
headers: header
})
}


setGroupVolumeCounter(group_id: number, value: number) {
let urlSearchParams = new URLSearchParams();
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
urlSearchParams.append('groupid', group_id.toString());
urlSearchParams.append('value', value.toString());
return this.http.post(this.settings.getApiBaseURL() + 'group/setGroupVolumeCounter/', urlSearchParams, {
withCredentials: true,
headers: header
})
}

setdeNBIDirectAcces(group_id: number, value: boolean) {
let urlSearchParams = new URLSearchParams();
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
urlSearchParams.append('groupid', group_id.toString());
urlSearchParams.append('value', value.toString());
return this.http.post(this.settings.getApiBaseURL() + 'group/setdeNBIDirectAccess/', urlSearchParams, {
withCredentials: true,
headers: header
})
}


setName(groupid: string, name: string): Observable<any> {
let urlSearchParams = new URLSearchParams();
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
Expand All @@ -171,7 +234,6 @@ export class GroupService {
}



getName(groupid: string): Observable<any> {
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
Expand All @@ -185,7 +247,7 @@ export class GroupService {
}


setShortname(groupid: string, shortname: string): Observable<any> {
setShortname(groupid: string, shortname: string): Observable<any> {
let urlSearchParams = new URLSearchParams();
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
Expand All @@ -201,10 +263,8 @@ export class GroupService {
}


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

return this.http.get(this.settings.getApiBaseURL() + 'group/getShortname/', {
withCredentials: true,
params: {groupid: groupid}
Expand All @@ -213,6 +273,20 @@ export class GroupService {

}

getMemberGroupsStatus() {

return this.http.get(this.settings.getApiBaseURL() + 'group/getMemberGroupsStatus/', {
withCredentials: true,
});

}

getMemberGroups(member_id: number) {
return this.http.get(this.settings.getApiBaseURL() + 'group/getMemberGroups/', {
withCredentials: true,
params: {memberid: member_id}
});
}


setLifetime(groupid: string, lifetime: string): Observable<any> {
Expand All @@ -230,6 +304,21 @@ export class GroupService {

}

createGroup(group_name: string, group_description: string) {
let urlSearchParams = new URLSearchParams();
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
urlSearchParams.append('group_name', group_name);
urlSearchParams.append('group_description', group_description.substring(0, 512));

return this.http.post(this.settings.getApiBaseURL() + 'group/createGroup/', urlSearchParams,
{
withCredentials: true,
headers: header
});
}


getLifetime(groupid: string): Observable<any> {
let header = new Headers({
Expand Down Expand Up @@ -274,9 +363,6 @@ export class GroupService {


getGroupMaxDiskspace(groupid: string): Observable<any> {
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
return this.http.get(this.settings.getApiBaseURL() + 'project/getApprovedDiskSpace/', {
withCredentials: true,
params: {groupid: groupid}
Expand All @@ -286,21 +372,37 @@ export class GroupService {
}

getGroupUsedDiskspace(groupid: string): Observable<any> {
let header = new Headers({
'X-CSRFToken': this.settings.getCSRFToken(),
});
return this.http.get(this.settings.getApiBaseURL() + 'project/getUsedDiskSpace/', {
withCredentials: true,
params: {groupid: groupid}
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))


}




getVolumesUsed(groupid: string): Observable<any> {
return this.http.get(this.settings.getApiBaseURL() + 'project/getUsedVolumes/', {
withCredentials: true,
params: {groupid: groupid}
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))


}

getVolumeCounter(groupid: string): Observable<any> {
return this.http.get(this.settings.getApiBaseURL() + 'project/getVolumesCounter/', {
withCredentials: true,
params: {groupid: groupid}
}).map((res: Response) => res.json()).catch((error: any) => Observable.throw(error.json().error || 'Server error'))


}

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

return this.http.get(this.settings.getApiBaseURL() + 'project/getNumberApprovedVms/', {
withCredentials: true,
params: {groupid: groupid}
Expand All @@ -310,9 +412,7 @@ export class GroupService {
}

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

return this.http.get(this.settings.getApiBaseURL() + 'project/getUsedVms/', {
withCredentials: true,
params: {groupid: groupid}
Expand Down
Loading

0 comments on commit d0da014

Please sign in to comment.