new profile system

This commit is contained in:
Eugene Pankov
2021-07-04 12:23:27 +02:00
parent 38b7e44f64
commit 92b34fbc08
104 changed files with 2029 additions and 2205 deletions

View File

@@ -36,7 +36,7 @@ export class ButtonProvider extends ToolbarButtonProvider {
if (settingsTab) {
this.app.selectTab(settingsTab)
} else {
this.app.openNewTabRaw(SettingsTabComponent)
this.app.openNewTabRaw({ type: SettingsTabComponent })
}
}
}

View File

@@ -6,18 +6,14 @@ h3.mb-3 Hotkeys
i.fas.fa-fw.fa-search
input.form-control(type='search', placeholder='Search hotkeys', [(ngModel)]='hotkeyFilter')
.form-group
table.hotkeys-table
tr
th Name
th ID
th Hotkey
ng-container(*ngFor='let hotkey of hotkeyDescriptions')
tr(*ngIf='!hotkeyFilter || hotkeyFilterFn(hotkey, hotkeyFilter)')
td {{hotkey.name}}
td {{hotkey.id}}
td.pr-5
multi-hotkey-input(
[model]='getHotkey(hotkey.id) || []',
(modelChange)='setHotkey(hotkey.id, $event)'
)
.form-group.hotkeys-table
ng-container(*ngFor='let hotkey of hotkeyDescriptions')
.row.align-items-center(*ngIf='!hotkeyFilter || hotkeyFilterFn(hotkey, hotkeyFilter)')
.col-8.py-2
span {{hotkey.name}}
span.ml-2.text-muted ({{hotkey.id}})
.col-4.pr-5
multi-hotkey-input(
[model]='getHotkey(hotkey.id) || []',
(modelChange)='setHotkey(hotkey.id, $event)'
)

View File

@@ -1,7 +0,0 @@
.hotkeys-table {
margin-top: 30px;
td, th {
padding: 5px 10px;
}
}

View File

@@ -11,9 +11,6 @@ import {
@Component({
selector: 'hotkey-settings-tab',
template: require('./hotkeySettingsTab.component.pug'),
styles: [
require('./hotkeySettingsTab.component.scss'),
],
})
export class HotkeySettingsTabComponent {
hotkeyFilter = ''
@@ -51,7 +48,7 @@ export class HotkeySettingsTabComponent {
hotkeyFilterFn (hotkey: HotkeyDescription, query: string): boolean {
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
const s = hotkey.name + (this.getHotkey(hotkey.id) || []).toString()
const s = hotkey.name + hotkey.id + (this.getHotkey(hotkey.id) || []).toString()
return s.toLowerCase().includes(query.toLowerCase())
}
}

View File

@@ -47,6 +47,7 @@ export class SettingsTabComponent extends BaseTabComponent {
super()
this.setTitle('Settings')
this.settingsProviders = config.enabledServices(this.settingsProviders)
this.settingsProviders = this.settingsProviders.filter(x => !!x.getComponentType())
this.settingsProviders.sort((a, b) => a.title.localeCompare(b.title))
this.configDefaults = yaml.dump(config.getDefaults())