sshSettingsTab.component.ts 720 B

1234567891011121314151617181920212223242526
  1. import { Component, HostBinding } from '@angular/core'
  2. import { X11Socket } from '../session/x11'
  3. import { ConfigService, HostAppService, Platform } from 'tabby-core'
  4. /** @hidden */
  5. @Component({
  6. templateUrl:'./sshSettingsTab.component.pug',
  7. })
  8. export class SSHSettingsTabComponent {
  9. Platform = Platform
  10. defaultX11Display: string
  11. @HostBinding('class.content-box') true
  12. constructor (
  13. public config: ConfigService,
  14. public hostApp: HostAppService,
  15. ) {
  16. const spec = X11Socket.resolveDisplaySpec()
  17. if ('path' in spec) {
  18. this.defaultX11Display = spec.path
  19. } else {
  20. this.defaultX11Display = `${spec.host}:${spec.port}`
  21. }
  22. }
  23. }