no message

This commit is contained in:
Ioannis Kalyvas 2018-08-27 18:09:33 +03:00
parent d28d2fd3c2
commit f8c3ce4362
9 changed files with 93 additions and 63 deletions

View File

@ -62,17 +62,21 @@ public class DashBoardManager {
RecentActivity activity = new RecentActivity();
UserInfo user = new UserInfo();
user.setId(principal.getId());
DatasetCriteria datasetCriteria = new DatasetCriteria();
datasetCriteria.setAllVersions(false);
DataManagementPlanCriteria dataManagementPlanCriteria = new DataManagementPlanCriteria();
dataManagementPlanCriteria.setAllVersions(false);
RecentActivityDataBuilder recentActivityDataBuilder = apiContext.getOperationsContext().getBuilderFactory().getBuilder(RecentActivityDataBuilder.class);
CompletableFuture<List<RecentActivityData>> dmps = dataManagementPlanRepository.getAuthenticated(dataManagementPlanRepository.asQueryable(), user)
CompletableFuture<List<RecentActivityData>> dmps = dataManagementPlanRepository.getAuthenticated(dataManagementPlanRepository.getWithCriteria(dataManagementPlanCriteria), user)
.withHint("dmpRecentActivity")
.orderBy((builder, root) -> builder.desc(root.get("modified")))
.take(numberofactivities)
.selectAsync(item -> recentActivityDataBuilder.label(item.getLabel()).timestamp(item.getModified()).id(item.getId().toString()).build())
.whenComplete((dmpActivities, throwable) -> activity.setRecentDmpActivities(dmpActivities));
CompletableFuture<List<RecentActivityData>> datasets = datasetRepository.getAuthenticated(datasetRepository.asQueryable(), user)
CompletableFuture<List<RecentActivityData>> datasets = datasetRepository.getAuthenticated(datasetRepository.getWithCriteria(datasetCriteria), user)
.withHint("datasetRecentActivity")
.orderBy((builder, root) -> builder.desc(root.get("modified")))
.take(numberofactivities)

View File

@ -71,5 +71,5 @@ http-logger.initial-delay = 0
http-logger.delay = 10
http-logger.server-address = http://logstash:31311
#############################Elastic Search######################################
elasticsearch.host = elasticsearch-dmp
elasticsearch.port = 9200
elasticsearch.host = localhost
elasticsearch.port = 9201

Binary file not shown.

Before

Width:  |  Height:  |  Size: 939 B

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -4065,7 +4065,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -4086,12 +4087,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -4106,17 +4109,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -4233,7 +4239,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -4245,6 +4252,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -4259,6 +4267,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -4266,12 +4275,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -4290,6 +4301,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -4370,7 +4382,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -4382,6 +4395,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -4467,7 +4481,8 @@
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -4503,6 +4518,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -4522,6 +4538,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -4565,12 +4582,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},

View File

@ -52,11 +52,13 @@ export class HomepageComponent implements OnInit {
ngOnInit() {
this.userReferenceService.getRecentActivity().subscribe(response => {
this.datasetActivities = response["recentDatasetActivities"];
this.dmpActivities = response["recentDmpActivities"];
this.projectActivities = response["recentProjectActivities"];
})
if (this.isAuthenticated()) {
this.userReferenceService.getRecentActivity().subscribe(response => {
this.datasetActivities = response["recentDatasetActivities"];
this.dmpActivities = response["recentDmpActivities"];
this.projectActivities = response["recentProjectActivities"];
})
}
this.projectAutoCompleteConfiguration = {
filterFn: this.searchProject.bind(this),

View File

@ -5,7 +5,7 @@
<div class="card-content">
<p class="category">{{ category | translate }}</p>
<h3 class="title">{{ title }}</h3>
<button mat-raised-button color="primary" (click)="createNew()" >{{buttonTitle}}</button>
<button *ngIf="isAuthenticated()" mat-raised-button color="primary" (click)="createNew()" >{{buttonTitle}}</button>
</div>
<div *ngIf="hasFootContent" class="card-footer">
</div>

View File

@ -1,5 +1,6 @@
import { Component, OnInit, Input } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from '../../../services/auth/auth.service';
@Component({
selector: 'app-figurecard',
@ -19,7 +20,7 @@ export class FigurecardComponent implements OnInit {
@Input() buttonTitle: string;
@Input() buttonRedirectLink: string;
constructor(private router: Router) { }
constructor(private router: Router,private authService: AuthService) { }
ngOnInit() {
}
@ -32,4 +33,8 @@ export class FigurecardComponent implements OnInit {
this.router.navigate([this.buttonRedirectLink]);
}
isAuthenticated(){
return this.authService.current() != null;
}
}

View File

@ -13,7 +13,7 @@
<!--<button mat-button class="navbar-button" routerLink="/about">{{'NAV-BAR.ABOUT' | translate}}</button>-->
<span class="navbar-spacer"></span>
<div fxFlex *ngIf="search">
<div fxFlex *ngIf="search && this.isAuthenticated()">
<mat-form-field class="full-width">
<input type="text" placeholder="{{'DASHBOARD.SEARCH' | translate}}" matInput [formControl]="searchControl" [matAutocomplete]="auto">
<mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" (optionSelected)="onOptionSelected($event)">
@ -24,13 +24,13 @@
</mat-form-field>
</div>
<div fxLayout="row">
<div fxFlex *ngIf="!search">
<div fxFlex *ngIf="!search && this.isAuthenticated()">
<button mat-button (click)="this.search = true">
<mat-icon>search</mat-icon>
</button>
</div>
<div fxFlex *ngIf="search">
<div fxFlex *ngIf="search && this.isAuthenticated()">
<button mat-button (click)="this.search = false">
<mat-icon>close</mat-icon>
</button>

View File

@ -56,31 +56,31 @@ services:
##########################ELK-STACK######################################################################
# elasticsearch:
# image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
# container_name: elasticsearch
# environment: ['http.host=0.0.0.0', 'transport.host=127.0.0.1', 'ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
# ports: ['0.0.0.0:9200:9200']
# networks: ['stack']
# volumes:
# - esdata:/usr/share/elasticsearch/data
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
container_name: elasticsearch
environment: ['http.host=0.0.0.0', 'transport.host=127.0.0.1', 'ELASTIC_PASSWORD=${ELASTIC_PASSWORD}','discovery.type=single-node']
ports: ['0.0.0.0:9200:9200']
networks: ['stack']
volumes:
- esdata:/usr/share/elasticsearch/data
# kibana:
# image: docker.elastic.co/kibana/kibana:${TAG}
# container_name: kibana
# ports: ['0.0.0.0:5601:5601']
# networks: ['stack']
# depends_on: ['elasticsearch']
kibana:
image: docker.elastic.co/kibana/kibana:${TAG}
container_name: kibana
ports: ['0.0.0.0:5601:5601']
networks: ['stack']
depends_on: ['elasticsearch']
# logstash:
# image: docker.elastic.co/logstash/logstash:${TAG}
# container_name: logstash
# volumes:
# - ./ELK.Docker/config/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
# ports: ['0.0.0.0:31311:31311']
logstash:
image: docker.elastic.co/logstash/logstash:${TAG}
container_name: logstash
volumes:
- ./ELK.Docker/config/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
ports: ['0.0.0.0:31311:31311']
# networks: ['stack']
# depends_on: ['elasticsearch', 'setup_logstash']
networks: ['stack']
depends_on: ['elasticsearch', 'setup_logstash']
#filebeat:
# image: docker.elastic.co/beats/filebeat:${TAG}
@ -97,23 +97,23 @@ services:
# depends_on: ['elasticsearch', 'setup_heartbeat']
# Run a short-lived container to set up Logstash.
# setup_logstash:
# image: centos:7
# container_name: setup_logstash
# volumes: ['./ELK.Docker/scripts/setup-logstash.sh:/usr/local/bin/setup-logstash.sh:ro']
# command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-logstash.sh | tr -d "\r" | bash']
# environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
# networks: ['stack']
# depends_on: ['elasticsearch']
setup_logstash:
image: centos:7
container_name: setup_logstash
volumes: ['./ELK.Docker/scripts/setup-logstash.sh:/usr/local/bin/setup-logstash.sh:ro']
command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-logstash.sh | tr -d "\r" | bash']
environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
networks: ['stack']
depends_on: ['elasticsearch']
# setup_kibana:
# image: centos:7
# container_name: setup_kibana
# volumes: ['./ELK.Docker/scripts/setup-kibana.sh:/usr/local/bin/setup-kibana.sh:ro']
# command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-kibana.sh | tr -d "\r" | bash']
# environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
# networks: ['stack']
# depends_on: ['elasticsearch']
setup_kibana:
image: centos:7
container_name: setup_kibana
volumes: ['./ELK.Docker/scripts/setup-kibana.sh:/usr/local/bin/setup-kibana.sh:ro']
command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-kibana.sh | tr -d "\r" | bash']
environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
networks: ['stack']
depends_on: ['elasticsearch']
#setup_filebeat:
# image: docker.elastic.co/beats/filebeat:${TAG}