Add the "Export device configuration" button instead of the export link. Make the button export JSON by default and BIN when pressed with Shift.

This commit is contained in:
László Monda
2018-03-29 18:44:09 +02:00
parent 2476049681
commit bf94370f2f
2 changed files with 11 additions and 3 deletions

View File

@@ -9,9 +9,9 @@
<ul class="list-unstyled btn-list">
<li>
Export device configuration in
<span role="button" class="btn-link" (click)="saveConfigurationInJSONFormat()">JSON</span> or
<span role="button" class="btn-link" (click)="saveConfigurationInBINFormat()">binary</span> format.
<button class="btn btn-default"
(click)="exportUserConfiguration($event)">Export device configuration
</button>
</li>
<li>
<label class="btn btn-default btn-file">

View File

@@ -34,6 +34,14 @@ export class DeviceConfigurationComponent {
this.store.dispatch(new SaveUserConfigInBinaryFileAction());
}
exportUserConfiguration(event: MouseEvent) {
if (event.shiftKey) {
this.saveConfigurationInBINFormat();
} else {
this.saveConfigurationInJSONFormat();
}
}
changeFile(event): void {
const files = event.srcElement.files;
const fileReader = new FileReader();