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