|
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'
|
|
|
import { HostAppService } from './api/hostApp'
|
|
import { HostAppService } from './api/hostApp'
|
|
|
import { CLIHandler, CLIEvent } from './api/cli'
|
|
import { CLIHandler, CLIEvent } from './api/cli'
|
|
|
import { HostWindowService } from './api/hostWindow'
|
|
import { HostWindowService } from './api/hostWindow'
|
|
|
|
|
+import { QuickConnectProfileProvider } from './api/profileProvider'
|
|
|
import { ProfilesService } from './services/profiles.service'
|
|
import { ProfilesService } from './services/profiles.service'
|
|
|
|
|
|
|
|
@Injectable()
|
|
@Injectable()
|
|
@@ -27,6 +28,10 @@ export class ProfileCLIHandler extends CLIHandler {
|
|
|
this.handleOpenRecentProfile(event.argv.profileNumber)
|
|
this.handleOpenRecentProfile(event.argv.profileNumber)
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
|
|
+ if (op === 'quickConnect') {
|
|
|
|
|
+ this.handleOpenQuickConnect(event.argv.providerId, event.argv.query)
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -48,6 +53,21 @@ export class ProfileCLIHandler extends CLIHandler {
|
|
|
this.profiles.openNewTabForProfile(profiles[profileNumber])
|
|
this.profiles.openNewTabForProfile(profiles[profileNumber])
|
|
|
this.hostWindow.bringToFront()
|
|
this.hostWindow.bringToFront()
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private async handleOpenQuickConnect (providerId: string, query: string) {
|
|
|
|
|
+ const provider = this.profiles.getProviders().find(x => x.id === providerId)
|
|
|
|
|
+ if(!provider || !(provider instanceof QuickConnectProfileProvider)) {
|
|
|
|
|
+ console.error(`Requested provider "${providerId}" not found`)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const profile = provider.quickConnect(query)
|
|
|
|
|
+ if(!profile) {
|
|
|
|
|
+ console.error(`Could not parse quick connect query "${query}"`)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.profiles.openNewTabForProfile(profile)
|
|
|
|
|
+ this.hostWindow.bringToFront()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Injectable()
|
|
@Injectable()
|