mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
tab context menu option to save split layouts as profiles - fixes #3468
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
|
||||
.mb-4
|
||||
|
||||
.col-12.col-lg-8
|
||||
.col-12.col-lg-8(*ngIf='this.profileProvider.settingsComponent')
|
||||
ng-template(#placeholder)
|
||||
|
||||
.modal-footer
|
||||
|
@@ -16,7 +16,7 @@ const iconsClassList = Object.keys(iconsData).map(
|
||||
template: require('./editProfileModal.component.pug'),
|
||||
})
|
||||
export class EditProfileModalComponent {
|
||||
@Input() profile: Profile|ConfigProxy
|
||||
@Input() profile: Profile & ConfigProxy
|
||||
@Input() profileProvider: ProfileProvider
|
||||
@Input() settingsComponent: new () => ProfileSettingsComponent
|
||||
groupNames: string[]
|
||||
@@ -41,17 +41,20 @@ export class EditProfileModalComponent {
|
||||
|
||||
ngOnInit () {
|
||||
this._profile = this.profile
|
||||
this.profile = this.profilesService.getConfigProxyForProfile(this.profile)
|
||||
this.profile = this.profilesService.getConfigProxyForProfile(this.profile) as any
|
||||
}
|
||||
|
||||
ngAfterViewInit () {
|
||||
setTimeout(() => {
|
||||
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.profileProvider.settingsComponent)
|
||||
const componentRef = componentFactory.create(this.injector)
|
||||
this.settingsComponentInstance = componentRef.instance
|
||||
this.settingsComponentInstance.profile = this.profile
|
||||
this.placeholder.insert(componentRef.hostView)
|
||||
})
|
||||
const componentType = this.profileProvider.settingsComponent
|
||||
if (componentType) {
|
||||
setTimeout(() => {
|
||||
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(componentType)
|
||||
const componentRef = componentFactory.create(this.injector)
|
||||
this.settingsComponentInstance = componentRef.instance
|
||||
this.settingsComponentInstance.profile = this.profile
|
||||
this.placeholder.insert(componentRef.hostView)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
groupTypeahead = (text$: Observable<string>) =>
|
||||
|
@@ -206,6 +206,7 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
|
||||
ssh: 'secondary',
|
||||
serial: 'success',
|
||||
telnet: 'info',
|
||||
'split-layout': 'primary',
|
||||
}[this.profilesService.providerForProfile(profile)?.id ?? ''] ?? 'warning'
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user