2020-04-15 16:50:01 +02:00
|
|
|
import { View } from 'framework/views/view';
|
|
|
|
import { AppSettingsModel } from 'models/app-settings-model';
|
|
|
|
import template from 'templates/settings/settings-devices.hbs';
|
2020-04-19 18:52:21 +02:00
|
|
|
import { Links } from 'const/links';
|
2020-04-15 16:50:01 +02:00
|
|
|
|
|
|
|
class SettingsDevicesView extends View {
|
|
|
|
template = template;
|
|
|
|
|
|
|
|
events = {
|
2020-04-19 18:52:21 +02:00
|
|
|
'change .settings__devices-enable-usb': 'changeEnableUsb',
|
|
|
|
'change .settings__yubikey-show-icon': 'changeYubiKeyShowIcon',
|
|
|
|
'change .settings__yubikey-auto-open': 'changeYubiKeyAutoOpen',
|
|
|
|
'change .settings__yubikey-match-entries': 'changeYubiKeyMatchEntries',
|
|
|
|
'change .settings__yubikey-chalresp-show': 'changeYubiKeyShowChalResp'
|
2020-04-15 16:50:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
super.render({
|
2020-04-19 18:52:21 +02:00
|
|
|
enableUsb: AppSettingsModel.enableUsb,
|
|
|
|
yubiKeyShowIcon: AppSettingsModel.yubiKeyShowIcon,
|
|
|
|
yubiKeyAutoOpen: AppSettingsModel.yubiKeyAutoOpen,
|
|
|
|
yubiKeyMatchEntries: AppSettingsModel.yubiKeyMatchEntries,
|
|
|
|
yubiKeyShowChalResp: AppSettingsModel.yubiKeyShowChalResp,
|
|
|
|
yubiKeyManualLink: Links.YubiKeyManual
|
2020-04-15 16:50:01 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
changeEnableUsb(e) {
|
|
|
|
AppSettingsModel.enableUsb = e.target.checked;
|
|
|
|
this.render();
|
|
|
|
}
|
2020-04-19 18:52:21 +02:00
|
|
|
|
|
|
|
changeYubiKeyShowIcon(e) {
|
|
|
|
AppSettingsModel.yubiKeyShowIcon = e.target.checked;
|
|
|
|
this.render();
|
|
|
|
}
|
|
|
|
|
|
|
|
changeYubiKeyAutoOpen(e) {
|
|
|
|
AppSettingsModel.yubiKeyAutoOpen = e.target.checked;
|
|
|
|
this.render();
|
|
|
|
}
|
|
|
|
|
|
|
|
changeYubiKeyMatchEntries(e) {
|
|
|
|
AppSettingsModel.yubiKeyMatchEntries = e.target.checked;
|
|
|
|
this.render();
|
|
|
|
}
|
|
|
|
|
|
|
|
changeYubiKeyShowChalResp(e) {
|
|
|
|
AppSettingsModel.yubiKeyShowChalResp = e.target.checked;
|
|
|
|
this.render();
|
|
|
|
}
|
2020-04-15 16:50:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export { SettingsDevicesView };
|