feat(device): Add save config buttons to the Device settings page (#447)
* feat(device): Add save config buttons to the Device settings page * feat(device): Set danger style to the reset user-config buttone
This commit is contained in:
committed by
László Monda
parent
737897b40e
commit
6b46c85ca6
@@ -1,5 +1,22 @@
|
||||
<h1>
|
||||
<i class="fa fa-cog"></i>
|
||||
<span>Device settings...</span>
|
||||
<span>Device settings</span>
|
||||
</h1>
|
||||
<a (click)="resetUserConfiguration()">Reset user configuration</a>
|
||||
|
||||
<ul class="list-unstyled btn-list">
|
||||
<li>
|
||||
<button class="btn btn-danger"
|
||||
(click)="resetUserConfiguration()">Reset user configuration including all your keymaps and macros
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="btn btn-default"
|
||||
(click)="saveConfigurationInJSONFormat()">Save device JSON configuration
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="btn btn-default"
|
||||
(click)="saveConfigurationInBINFormat()">Save device binary configuration
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Store } from '@ngrx/store';
|
||||
|
||||
import { AppState } from '../../../store';
|
||||
import { ResetUserConfigurationAction } from '../../../store/actions/device';
|
||||
import { SaveUserConfigInBinaryFileAction, SaveUserConfigInJsonFileAction } from '../../../store/actions/user-config';
|
||||
|
||||
@Component({
|
||||
selector: 'device-settings',
|
||||
@@ -20,4 +21,12 @@ export class DeviceSettingsComponent {
|
||||
resetUserConfiguration() {
|
||||
this.store.dispatch(new ResetUserConfigurationAction());
|
||||
}
|
||||
|
||||
saveConfigurationInJSONFormat(){
|
||||
this.store.dispatch(new SaveUserConfigInJsonFileAction());
|
||||
}
|
||||
|
||||
saveConfigurationInBINFormat(){
|
||||
this.store.dispatch(new SaveUserConfigInBinaryFileAction());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user