Skip to content

Commit 1d563f4

Browse files
committed
GUI => add info message to GUI when "View Only" mode activated
1 parent 2408424 commit 1d563f4

File tree

6 files changed

+25
-8
lines changed

6 files changed

+25
-8
lines changed

elastest-torm-gui/src/app/config/config-model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ export interface ConfigModel {
1616
empGrafanaUrl: string;
1717
edmCommandUrl: string;
1818
isKubernetes: boolean;
19+
etmViewOnly: boolean;
1920
}

elastest-torm-gui/src/app/config/configuration-service.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class ConfigurationService {
6868
empGrafanaUrl: servicesInfo.empGrafanaUrl,
6969
edmCommandUrl: servicesInfo.edmCommandUrl,
7070
isKubernetes: servicesInfo.isKubernetes,
71+
etmViewOnly: servicesInfo.etmViewOnly,
7172
};
7273

7374
resolve();

elastest-torm-gui/src/app/elastest-edm/edm-container/edm-container.component.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ import { Component, OnInit } from '@angular/core';
44
@Component({
55
selector: 'app-edm-container',
66
templateUrl: './edm-container.component.html',
7-
styleUrls: ['./edm-container.component.scss']
7+
styleUrls: ['./edm-container.component.scss'],
88
})
99
export class EdmContainerComponent implements OnInit {
10+
serviceUrl: string = '';
1011

11-
serviceUrl: string = "";
12+
constructor(private configService: ConfigurationService) {}
1213

13-
constructor(private configService: ConfigurationService) { }
14-
15-
ngOnInit() {
16-
this.serviceUrl = this.configService.configModel.edmCommandUrl;
14+
ngOnInit(): void {
15+
this.serviceUrl = this.configService.configModel.edmCommandUrl;
1716
}
18-
1917
}

elastest-torm-gui/src/app/elastest-etm/etm.component.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@
226226
Vnc Test
227227
</a> -->
228228
</mat-nav-list>
229+
<td-message
230+
id="viewOnlyMsg"
231+
*ngIf="configService && configService.configModel && configService.configModel.etmViewOnly"
232+
label="Info: This instance of ElasTest is started with 'View Only' mode, so you cannot create, modify or delete data. It is also not possible to start Test Engines or Browsers."
233+
icon="info"
234+
></td-message>
229235
<router-outlet></router-outlet>
230236
</td-layout-manage-list>
231237
<!-- <td-layout-footer>

elastest-torm-gui/src/app/elastest-etm/etm.component.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,14 @@
4444
max-width: 100%;
4545
overflow-x: hidden !important;
4646
}
47+
48+
:host /deep/ #viewOnlyMsg {
49+
margin: 0px 6px !important;
50+
color: #ffffff !important;
51+
background-color: #ffac2f !important;
52+
}
53+
54+
:host /deep/ #viewOnlyMsg .td-message-wrapper {
55+
min-height: 38px !important;
56+
padding: 1px 16px !important;
57+
}

elastest-torm/src/main/java/io/elastest/etm/config/WebRequestFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void init(FilterConfig filterConfig) throws ServletException {
3333
if (etEtmViewOnly != null && etEtmViewOnly) {
3434
allowedMethodsList = Arrays.asList("GET");
3535
}
36-
logger.info("Allowed Methods: {}", Arrays.asList(allowedMethodsList));
36+
logger.info("Allowed Methods: {}", allowedMethodsList);
3737
}
3838

3939
@Override

0 commit comments

Comments
 (0)