ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / contrib / chat / electron-browser / toggleRemoteConnectionsActionViewItem.ts 156 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import './media/tunnelHost.css' ;
import * as dom from '../../../../base/browser/dom.js' ;
import { IManagedHover, IManagedHoverContent } from '../../../../base/browser/ui/hover/hover.js' ;
import { getDefaultHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js' ;
import { renderLabelWithIcons } from '../../../../base/browser/ui/iconLabel/iconLabels.js' ;
import { BaseActionViewItem } from '../../../../base/browser/ui/actionbar/actionViewItems.js' ;
import { disposableTimeout } from '../../../../base/common/async.js' ;
import { IAction } from
Codicon
MarkdownString
localize
IHoverService
IProductService
ITunnelHostService
_iconElement HTMLElement
_toastElement HTMLElement
_hover IManagedHover
_wasSharing
action IAction
_tunnelHostService ITunnelHostService
_hoverService IHoverService
_productService IProductService
action
_wasSharing _tunnelHostService isSharing
_tunnelHostService
override container HTMLElement
container
element
element classList
element tabIndex
element role
_iconElement dom element dom
_iconElement
_toastElement dom element dom
hoverDelegate
_hover _hoverService
hoverDelegate element
element
isSharing _tunnelHostService isSharing
isConnecting _tunnelHostService isConnecting
element classList isSharing
element classList isConnecting
_hover
element
element isSharing
isSharing _wasSharing isConnecting
isSharing _wasSharing
_wasSharing isSharing
_toastElement
_toastElement textContent
_toastElement classList
_store
_toastElement classList
IManagedHoverContent
lines
_tunnelHostService isConnecting
lines
_tunnelHostService isSharing
info _tunnelHostService sharingInfo
info
lines info viaRemoteTunnelAccess
info tunnelName
info tunnelName
lines
agentsUrl _productService webUrl
lines agentsUrl
lines
md lines isTrusted enabledCommands
markdown md markdownNotSupportedFallback lines
_tunnelHostService isConnecting
_tunnelHostService isSharing
info _tunnelHostService sharingInfo
info
info viaRemoteTunnelAccess
info tunnelName
info tunnelName
agentsUrl _productService webUrl
agentsUrl
agentsUrl
'../../../../base/common/actions.js'
;
import
{
}
from
'../../../../base/common/codicons.js'
;
import
{
}
from
'../../../../base/common/htmlContent.js'
;
import
{
}
from
'../../../../nls.js'
;
import
{
}
from
'../../../../platform/hover/browser/hover.js'
;
import
{
}
from
'../../../../platform/product/common/productService.js'
;
import
{
}
from
'../common/tunnelHost.js'
;
import
{
RENAME_TUNNEL_ID
,
SHOW_TUNNEL_HOST_OUTPUT_ID
}
from
'./tunnelHostService.js'
;
const
TUNNEL_ACCESS_DOCS_URL
=
'https://aka.ms/vscode-agent-tunnel-access'
;
export
class
ToggleRemoteConnectionsActionViewItem
extends
BaseActionViewItem
{
private
:
|
undefined
;
private
:
|
undefined
;
private
:
|
undefined
;
private
=
false
;
constructor
(
:
,
@ ITunnelHostService
private
readonly
:
,
@ IHoverService
private
readonly
:
,
@ IProductService
private
readonly
:
,
)
{
super
(
undefined
,
)
;
this
.
=
this
.
.
;
this
.
_register
(
this
.
.
onDidChangeStatus
(
(
)
=>
{
this
.
_updateState
(
)
;
}
)
)
;
}
render
(
:
)
:
void
{
super
.
render
(
)
;
if
(
!
this
.
)
{
return
;
}
this
.
.
.
add
(
'tunnel-host-toggle'
)
;
this
.
.
=
0
;
this
.
.
=
'button'
;
this
.
=
.
append
(
this
.
,
.
$
(
'span.tunnel-host-icon'
)
)
;
this
.
.
append
(
...
renderLabelWithIcons
(
` $( ${ Codicon. radioTower. id} ) `
)
)
;
this
.
=
.
append
(
this
.
,
.
$
(
'span.tunnel-host-toast'
)
)
;
const
=
getDefaultHoverDelegate
(
'element'
)
;
this
.
=
this
.
_register
(
this
.
.
setupManagedHover
(
,
this
.
,
this
.
_getHoverContent
(
)
)
)
;
this
.
_updateState
(
)
;
}
private
_updateState
(
)
:
void
{
if
(
!
this
.
)
{
return
;
}
const
=
this
.
.
;
const
=
this
.
.
;
this
.
.
.
toggle
(
'sharing'
,
)
;
this
.
.
.
toggle
(
'connecting'
,
)
;
this
.
?.
update
(
this
.
_getHoverContent
(
)
)
;
this
.
.
setAttribute
(
'aria-label'
,
this
.
_getAriaLabel
(
)
)
;
this
.
.
setAttribute
(
'aria-pressed'
,
String
(
)
)
;
if
(
&&
!
this
.
&&
!
)
{
this
.
_showToast
(
)
;
}
else
if
(
!
&&
this
.
)
{
this
.
_hideToast
(
)
;
}
this
.
=
;
}
private
_showToast
(
)
:
void
{
if
(
!
this
.
)
{
return
;
}
this
.
.
=
localize
(
'tunnelHost.toast'
,
"Remote session access is now enabled"
)
;
this
.
.
.
add
(
'visible'
)
;
disposableTimeout
(
(
)
=>
{
this
.
_hideToast
(
)
;
}
,
3000
,
this
.
)
;
}
private
_hideToast
(
)
:
void
{
this
.
?.
.
remove
(
'visible'
)
;
}
private
_getHoverContent
(
)
:
{
const
:
string
[
]
=
[
]
;
if
(
this
.
.
)
{
.
push
(
localize
(
'tunnelHost.hover.connecting'
,
"Establishing tunnel connection..."
)
)
;
}
else
if
(
this
.
.
)
{
const
=
this
.
.
;
if
(
)
{
.
push
(
.
?
localize
(
'tunnelHost.hover.remoteTunnelAccess'
,
"Remote session access is provided by Remote Tunnel Access via tunnel '{0}'. Turning off remote session access does not disable Remote Tunnel Access."
,
.
)
:
localize
(
'tunnelHost.hover.sharing'
,
"Remote session access enabled via tunnel '{0}'"
,
.
)
)
;
}
else
{
.
push
(
localize
(
'tunnelHost.hover.enabled'
,
"Remote session access is enabled"
)
)
;
}
}
else
{
const
=
this
.
.
?
` ${ this . _productService. webUrl. replace ( / \/ $ / , '' ) } /agents `
:
undefined
;
.
push
(
?
localize
(
'tunnelHost.hover.idle'
,
"Allow connections from other machines and {0}"
,
` [ ${ agentsUrl. replace ( / https? :\/ \/ / , '' ) } ]( ${ agentsUrl} ) `
)
:
localize
(
'tunnelHost.hover.idle.noWebUrl'
,
"Allow connections from other machines"
)
)
;
}
.
push
(
` [ ${ localize ( 'tunnelHost.hover.showOutput' , "Show Output" ) } ](command: ${ SHOW_TUNNEL_HOST_OUTPUT_ID } ) | [ ${ localize ( 'tunnelHost.hover.renameTunnel' , "Rename Tunnel" ) } ](command: ${ RENAME_TUNNEL_ID } ) | [ ${ localize ( 'tunnelHost.hover.learnMore' , "Learn More" ) } ]( ${ TUNNEL_ACCESS_DOCS_URL } ) `
)
;
const
=
new
MarkdownString
(
.
join
(
'\n\n'
)
,
{
:
{
:
[
SHOW_TUNNEL_HOST_OUTPUT_ID
,
RENAME_TUNNEL_ID
]
}
}
)
;
return
{
:
,
:
[
0
]
}
;
}
private
_getAriaLabel
(
)
:
string
{
if
(
this
.
.
)
{
return
localize
(
'tunnelHost.hover.connecting'
,
"Establishing tunnel connection..."
)
;
}
if
(
this
.
.
)
{
const
=
this
.
.
;
if
(
)
{
return
.
?
localize
(
'tunnelHost.ariaLabel.remoteTunnelAccess'
,
"Remote session access provided by Remote Tunnel Access via tunnel '{0}'"
,
.
)
:
localize
(
'tunnelHost.hover.sharing'
,
"Remote session access enabled via tunnel '{0}'"
,
.
)
;
}
return
localize
(
'tunnelHost.hover.enabled'
,
"Remote session access is enabled"
)
;
}
const
=
this
.
.
?
` ${ this . _productService. webUrl. replace ( / \/ $ / , '' ) } /agents `
:
undefined
;
return
?
localize
(
'tunnelHost.hover.idle.ariaLabel'
,
"Allow connections from other machines and {0}"
,
.
replace
(
/ https? :\/ \/ /
,
''
)
)
:
localize
(
'tunnelHost.hover.idle.ariaLabel.noWebUrl'
,
"Allow connections from other machines"
)
;
}
}