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:
@@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
<ul class="list-unstyled btn-list">
|
<ul class="list-unstyled btn-list">
|
||||||
<li>
|
<li>
|
||||||
Export device configuration in
|
<button class="btn btn-default"
|
||||||
<span role="button" class="btn-link" (click)="saveConfigurationInJSONFormat()">JSON</span> or
|
(click)="exportUserConfiguration($event)">Export device configuration
|
||||||
<span role="button" class="btn-link" (click)="saveConfigurationInBINFormat()">binary</span> format.
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label class="btn btn-default btn-file">
|
<label class="btn btn-default btn-file">
|
||||||
|
|||||||
@@ -34,6 +34,14 @@ export class DeviceConfigurationComponent {
|
|||||||
this.store.dispatch(new SaveUserConfigInBinaryFileAction());
|
this.store.dispatch(new SaveUserConfigInBinaryFileAction());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exportUserConfiguration(event: MouseEvent) {
|
||||||
|
if (event.shiftKey) {
|
||||||
|
this.saveConfigurationInBINFormat();
|
||||||
|
} else {
|
||||||
|
this.saveConfigurationInJSONFormat();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
changeFile(event): void {
|
changeFile(event): void {
|
||||||
const files = event.srcElement.files;
|
const files = event.srcElement.files;
|
||||||
const fileReader = new FileReader();
|
const fileReader = new FileReader();
|
||||||
|
|||||||
Reference in New Issue
Block a user