Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2524412d
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2524412d
编写于
2月 03, 2020
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Keep process info when forwarding candidate port
Fixes
https://github.com/microsoft/vscode/issues/89424
上级
a99b0779
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
32 addition
and
14 deletion
+32
-14
src/vs/workbench/contrib/remote/browser/tunnelView.ts
src/vs/workbench/contrib/remote/browser/tunnelView.ts
+31
-13
src/vs/workbench/services/remote/common/remoteExplorerService.ts
...workbench/services/remote/common/remoteExplorerService.ts
+1
-1
未找到文件。
src/vs/workbench/contrib/remote/browser/tunnelView.ts
浏览文件 @
2524412d
...
...
@@ -57,7 +57,7 @@ export interface ITunnelViewModel {
onForwardedPortsChanged
:
Event
<
void
>
;
readonly
forwarded
:
TunnelItem
[];
readonly
detected
:
TunnelItem
[];
readonly
candidates
:
Promise
<
TunnelItem
[]
>
;
readonly
candidates
:
TunnelItem
[]
;
readonly
input
:
TunnelItem
;
groups
():
Promise
<
ITunnelGroup
[]
>
;
}
...
...
@@ -67,6 +67,7 @@ export class TunnelViewModel extends Disposable implements ITunnelViewModel {
public
onForwardedPortsChanged
:
Event
<
void
>
=
this
.
_onForwardedPortsChanged
.
event
;
private
model
:
TunnelModel
;
private
_input
:
TunnelItem
;
private
_candidates
:
Map
<
string
,
{
host
:
string
,
port
:
number
,
detail
:
string
}
>
=
new
Map
();
constructor
(
@
IRemoteExplorerService
private
readonly
remoteExplorerService
:
IRemoteExplorerService
)
{
...
...
@@ -87,6 +88,10 @@ export class TunnelViewModel extends Disposable implements ITunnelViewModel {
async
groups
():
Promise
<
ITunnelGroup
[]
>
{
const
groups
:
ITunnelGroup
[]
=
[];
this
.
_candidates
=
new
Map
();
(
await
this
.
model
.
candidates
).
forEach
(
candidate
=>
{
this
.
_candidates
.
set
(
MakeAddress
(
candidate
.
host
,
candidate
.
port
),
candidate
);
});
if
((
this
.
model
.
forwarded
.
size
>
0
)
||
this
.
remoteExplorerService
.
getEditableData
(
undefined
))
{
groups
.
push
({
label
:
nls
.
localize
(
'
remote.tunnelsView.forwarded
'
,
"
Forwarded
"
),
...
...
@@ -115,9 +120,18 @@ export class TunnelViewModel extends Disposable implements ITunnelViewModel {
return
groups
;
}
private
addProcessInfoFromCandidate
(
tunnelItem
:
ITunnelItem
)
{
const
key
=
MakeAddress
(
tunnelItem
.
remoteHost
,
tunnelItem
.
remotePort
);
if
(
this
.
_candidates
.
has
(
key
))
{
tunnelItem
.
description
=
this
.
_candidates
.
get
(
key
)
!
.
detail
;
}
}
get
forwarded
():
TunnelItem
[]
{
const
forwarded
=
Array
.
from
(
this
.
model
.
forwarded
.
values
()).
map
(
tunnel
=>
{
return
TunnelItem
.
createFromTunnel
(
tunnel
);
const
tunnelItem
=
TunnelItem
.
createFromTunnel
(
tunnel
);
this
.
addProcessInfoFromCandidate
(
tunnelItem
);
return
tunnelItem
;
}).
sort
((
a
:
TunnelItem
,
b
:
TunnelItem
)
=>
{
if
(
a
.
remotePort
===
b
.
remotePort
)
{
return
a
.
remoteHost
<
b
.
remoteHost
?
-
1
:
1
;
...
...
@@ -133,21 +147,21 @@ export class TunnelViewModel extends Disposable implements ITunnelViewModel {
get
detected
():
TunnelItem
[]
{
return
Array
.
from
(
this
.
model
.
detected
.
values
()).
map
(
tunnel
=>
{
return
TunnelItem
.
createFromTunnel
(
tunnel
,
TunnelType
.
Detected
,
false
);
const
tunnelItem
=
TunnelItem
.
createFromTunnel
(
tunnel
,
TunnelType
.
Detected
,
false
);
this
.
addProcessInfoFromCandidate
(
tunnelItem
);
return
tunnelItem
;
});
}
get
candidates
():
Promise
<
TunnelItem
[]
>
{
return
this
.
model
.
candidates
.
then
(
values
=>
{
get
candidates
():
TunnelItem
[]
{
const
candidates
:
TunnelItem
[]
=
[];
valu
es
.
forEach
(
value
=>
{
this
.
_candidat
es
.
forEach
(
value
=>
{
const
key
=
MakeAddress
(
value
.
host
,
value
.
port
);
if
(
!
this
.
model
.
forwarded
.
has
(
key
)
&&
!
this
.
model
.
detected
.
has
(
key
))
{
candidates
.
push
(
new
TunnelItem
(
TunnelType
.
Candidate
,
value
.
host
,
value
.
port
,
undefined
,
false
,
undefined
,
value
.
detail
));
}
});
return
candidates
;
});
}
get
input
():
TunnelItem
{
...
...
@@ -386,6 +400,10 @@ class TunnelItem implements ITunnelItem {
}
}
set
description
(
description
:
string
|
undefined
)
{
this
.
_description
=
description
;
}
get
description
():
string
|
undefined
{
if
(
this
.
_description
)
{
return
this
.
_description
;
...
...
src/vs/workbench/services/remote/common/remoteExplorerService.ts
浏览文件 @
2524412d
...
...
@@ -31,7 +31,7 @@ export interface ITunnelItem {
localAddress
?:
string
;
name
?:
string
;
closeable
?:
boolean
;
readonly
description
?:
string
;
description
?:
string
;
readonly
label
:
string
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录