diff --git a/static/src/app/services/logs/campaign.service.ts b/static/src/app/services/logs/campaign.service.ts
index d4cc7ef..2fbda1f 100644
--- a/static/src/app/services/logs/campaign.service.ts
+++ b/static/src/app/services/logs/campaign.service.ts
@@ -25,7 +25,6 @@ export class CampaignService {
return this.http.post(this.config.apiCampaignPath, campaign)
.map(res => res.json());
}
-
}
deleteCampaign(id: string) {
diff --git a/static/src/app/statistic/war-submit/war-submit.component.html b/static/src/app/statistic/war-submit/war-submit.component.html
index 1b37492..4cebf76 100644
--- a/static/src/app/statistic/war-submit/war-submit.component.html
+++ b/static/src/app/statistic/war-submit/war-submit.component.html
@@ -29,7 +29,7 @@
-
+
Logfile muss im Format RPT, LOG oder TXT vorliegen
diff --git a/static/src/app/statistic/war-submit/war-submit.component.ts b/static/src/app/statistic/war-submit/war-submit.component.ts
index 74b3525..5e78590 100644
--- a/static/src/app/statistic/war-submit/war-submit.component.ts
+++ b/static/src/app/statistic/war-submit/war-submit.component.ts
@@ -18,7 +18,9 @@ export class WarSubmitComponent {
fileList: FileList;
- showImageError = false;
+ readonly validExtensions = ['.rpt', '.log', '.txt'];
+
+ showFileError = false;
showErrorLabel = false;
@@ -35,14 +37,13 @@ export class WarSubmitComponent {
}
fileChange(event) {
- if (!event.target.files[0].name.endsWith('.rpt')
- && !event.target.files[0].name.endsWith('.log')
- && !event.target.files[0].name.endsWith('.txt')) {
- this.showImageError = true;
- this.fileList = undefined;
- } else {
- this.showImageError = false;
+ if (this.validExtensions.filter(ext => event.target.files[0] &&
+ event.target.files[0].name.endsWith(ext)).length == 1) {
+ this.showFileError = false;
this.fileList = event.target.files;
+ } else {
+ this.showFileError = true;
+ this.fileList = undefined;
}
}