mirror of
https://github.com/Eugeny/tabby
synced 2024-11-15 01:17:14 +00:00
allow disabling individual providers and commands through config
This commit is contained in:
parent
6997c24dfa
commit
19d59a4cfb
5 changed files with 9 additions and 3 deletions
|
@ -27,7 +27,7 @@ export class CoreCommandProvider extends CommandProvider {
|
|||
async provide (): Promise<Command[]> {
|
||||
return [
|
||||
{
|
||||
id: 'profile-selector',
|
||||
id: 'core:profile-selector',
|
||||
locations: [CommandLocation.LeftToolbar, CommandLocation.StartPage],
|
||||
label: this.translate.instant('Profiles & connections'),
|
||||
icon: this.hostApp.platform === Platform.Web
|
||||
|
@ -35,7 +35,8 @@ export class CoreCommandProvider extends CommandProvider {
|
|||
: require('./icons/profiles.svg'),
|
||||
run: async () => this.activate(),
|
||||
},
|
||||
...this.profilesService.getRecentProfiles().map(profile => ({
|
||||
...this.profilesService.getRecentProfiles().map((profile, index) => ({
|
||||
id: `core:recent-profile-${index}`,
|
||||
label: profile.name,
|
||||
locations: [CommandLocation.StartPage],
|
||||
icon: require('./icons/history.svg'),
|
||||
|
|
|
@ -46,6 +46,8 @@ vault: null
|
|||
encrypted: false
|
||||
enableExperimentalFeatures: false
|
||||
pluginBlacklist: []
|
||||
commandBlacklist: []
|
||||
providerBlacklist: []
|
||||
hacks:
|
||||
disableGPU: false
|
||||
disableVibrancyWhileDragging: false
|
||||
|
|
|
@ -193,7 +193,7 @@ export default class AppModule { // eslint-disable-line @typescript-eslint/no-ex
|
|||
}
|
||||
|
||||
if (hotkey === 'profile-selector') {
|
||||
commands.run('profile-selector', {})
|
||||
commands.run('core:profile-selector', {})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ export class CommandService {
|
|||
}
|
||||
|
||||
return commands
|
||||
.filter(c => !this.config.store.commandBlacklist.includes(c.id))
|
||||
.sort((a, b) => (a.weight ?? 0) - (b.weight ?? 0))
|
||||
.map(command => {
|
||||
const run = command.run
|
||||
|
|
|
@ -254,7 +254,9 @@ export class ConfigService {
|
|||
return services.filter(service => {
|
||||
for (const pluginName in this.servicesCache) {
|
||||
if (this.servicesCache[pluginName].includes(service.constructor)) {
|
||||
const id = `${pluginName}:${service.constructor.name}`
|
||||
return !this.store?.pluginBlacklist?.includes(pluginName)
|
||||
&& !this.store?.providerBlacklist?.includes(id)
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue