mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-19 18:07:58 +00:00
strongly typed partial profiles wip
This commit is contained in:
@@ -8,6 +8,6 @@ import { TelnetProfile } from '../session'
|
||||
@Component({
|
||||
template: require('./telnetProfileSettings.component.pug'),
|
||||
})
|
||||
export class TelnetProfileSettingsComponent implements ProfileSettingsComponent {
|
||||
export class TelnetProfileSettingsComponent implements ProfileSettingsComponent<TelnetProfile> {
|
||||
profile: TelnetProfile
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { ProfileProvider, Profile, NewTabParameters } from 'tabby-core'
|
||||
import { ProfileProvider, NewTabParameters, PartialProfile } from 'tabby-core'
|
||||
import { TelnetProfileSettingsComponent } from './components/telnetProfileSettings.component'
|
||||
import { TelnetTabComponent } from './components/telnetTab.component'
|
||||
import { TelnetProfile } from './session'
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class TelnetProfilesService extends ProfileProvider {
|
||||
export class TelnetProfilesService extends ProfileProvider<TelnetProfile> {
|
||||
id = 'telnet'
|
||||
name = 'Telnet'
|
||||
supportsQuickConnect = false
|
||||
@@ -22,7 +22,7 @@ export class TelnetProfilesService extends ProfileProvider {
|
||||
},
|
||||
}
|
||||
|
||||
async getBuiltinProfiles (): Promise<TelnetProfile[]> {
|
||||
async getBuiltinProfiles (): Promise<PartialProfile<TelnetProfile>[]> {
|
||||
return [
|
||||
{
|
||||
id: `telnet:template`,
|
||||
@@ -55,7 +55,7 @@ export class TelnetProfilesService extends ProfileProvider {
|
||||
]
|
||||
}
|
||||
|
||||
async getNewTabParameters (profile: Profile): Promise<NewTabParameters<TelnetTabComponent>> {
|
||||
async getNewTabParameters (profile: PartialProfile<TelnetProfile>): Promise<NewTabParameters<TelnetTabComponent>> {
|
||||
return {
|
||||
type: TelnetTabComponent,
|
||||
inputs: { profile },
|
||||
@@ -66,7 +66,7 @@ export class TelnetProfilesService extends ProfileProvider {
|
||||
return profile.options.host ? `${profile.options.host}:${profile.options.port}` : ''
|
||||
}
|
||||
|
||||
quickConnect (query: string): TelnetProfile {
|
||||
quickConnect (query: string): PartialProfile<TelnetProfile> {
|
||||
let host = query
|
||||
let port = 23
|
||||
if (host.includes('[')) {
|
||||
|
Reference in New Issue
Block a user