Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
99e822ef
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,体验更适合开发者的 AI 搜索 >>
提交
99e822ef
编写于
12月 02, 2019
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tweak strings in tunnel UI
上级
b8025bcf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
34 deletion
+27
-34
src/vs/platform/remote/common/tunnel.ts
src/vs/platform/remote/common/tunnel.ts
+1
-1
src/vs/workbench/contrib/remote/browser/tunnelView.ts
src/vs/workbench/contrib/remote/browser/tunnelView.ts
+18
-23
src/vs/workbench/services/remote/common/remoteExplorerService.ts
...workbench/services/remote/common/remoteExplorerService.ts
+6
-7
src/vs/workbench/services/remote/node/tunnelService.ts
src/vs/workbench/services/remote/node/tunnelService.ts
+2
-3
未找到文件。
src/vs/platform/remote/common/tunnel.ts
浏览文件 @
99e822ef
...
...
@@ -12,7 +12,7 @@ export const ITunnelService = createDecorator<ITunnelService>('tunnelService');
export
interface
RemoteTunnel
{
readonly
tunnelRemotePort
:
number
;
readonly
tunnelLocalPort
:
number
;
readonly
localAddress
?:
URI
;
readonly
localAddress
?:
string
;
dispose
():
void
;
}
...
...
src/vs/workbench/contrib/remote/browser/tunnelView.ts
浏览文件 @
99e822ef
...
...
@@ -29,7 +29,6 @@ import { IMenuService, MenuId, IMenu, MenuRegistry, MenuItemAction } from 'vs/pl
import
{
createAndFillInContextMenuActions
,
createAndFillInActionBarActions
,
ContextAwareMenuEntryActionViewItem
}
from
'
vs/platform/actions/browser/menuEntryActionViewItem
'
;
import
{
IRemoteExplorerService
,
TunnelModel
}
from
'
vs/workbench/services/remote/common/remoteExplorerService
'
;
import
{
IClipboardService
}
from
'
vs/platform/clipboard/common/clipboardService
'
;
import
{
URI
}
from
'
vs/workbench/workbench.web.api
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
InputBox
,
MessageType
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
attachInputBoxStyler
}
from
'
vs/platform/theme/common/styler
'
;
...
...
@@ -37,6 +36,7 @@ import { once } from 'vs/base/common/functional';
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
class
TunnelTreeVirtualDelegate
implements
IListVirtualDelegate
<
ITunnelItem
>
{
getHeight
(
element
:
ITunnelItem
):
number
{
...
...
@@ -103,13 +103,13 @@ export class TunnelViewModel extends Disposable implements ITunnelViewModel {
get
forwarded
():
TunnelItem
[]
{
return
Array
.
from
(
this
.
model
.
forwarded
.
values
()).
map
(
tunnel
=>
{
return
new
TunnelItem
(
TunnelType
.
Forwarded
,
tunnel
.
remote
,
tunnel
.
closeable
,
tunnel
.
name
,
tunnel
.
description
,
tunnel
.
local
);
return
new
TunnelItem
(
TunnelType
.
Forwarded
,
tunnel
.
remote
,
tunnel
.
localAddress
,
tunnel
.
closeable
,
tunnel
.
name
,
tunnel
.
description
);
});
}
get
published
():
TunnelItem
[]
{
return
Array
.
from
(
this
.
model
.
published
.
values
()).
map
(
tunnel
=>
{
return
new
TunnelItem
(
TunnelType
.
Published
,
tunnel
.
remote
,
false
,
tunnel
.
name
,
tunnel
.
description
,
tunnel
.
local
);
return
new
TunnelItem
(
TunnelType
.
Published
,
tunnel
.
remote
,
tunnel
.
localAddress
,
false
,
tunnel
.
name
,
tunnel
.
description
);
});
}
...
...
@@ -119,7 +119,7 @@ export class TunnelViewModel extends Disposable implements ITunnelViewModel {
let
iterator
=
values
.
next
();
while
(
!
iterator
.
done
)
{
if
(
!
this
.
model
.
forwarded
.
has
(
iterator
.
value
.
remote
)
&&
!
this
.
model
.
published
.
has
(
iterator
.
value
.
remote
))
{
candidates
.
push
(
new
TunnelItem
(
TunnelType
.
Candidate
,
iterator
.
value
.
remote
,
false
,
undefined
,
iterator
.
value
.
description
));
candidates
.
push
(
new
TunnelItem
(
TunnelType
.
Candidate
,
iterator
.
value
.
remote
,
iterator
.
value
.
localAddress
,
false
,
undefined
,
iterator
.
value
.
description
));
}
iterator
=
values
.
next
();
}
...
...
@@ -333,7 +333,7 @@ interface ITunnelGroup {
interface
ITunnelItem
{
tunnelType
:
TunnelType
;
remote
:
number
;
local
?:
number
;
local
Address
?:
string
;
name
?:
string
;
closeable
?:
boolean
;
readonly
description
?:
string
;
...
...
@@ -344,33 +344,28 @@ class TunnelItem implements ITunnelItem {
constructor
(
public
tunnelType
:
TunnelType
,
public
remote
:
number
,
public
localAddress
?:
string
,
public
closeable
?:
boolean
,
public
name
?:
string
,
private
_description
?:
string
,
public
local
?:
number
,
)
{
}
get
label
():
string
{
if
(
this
.
name
&&
this
.
local
)
{
if
(
this
.
name
)
{
return
nls
.
localize
(
'
remote.tunnelsView.forwardedPortLabel0
'
,
"
{0}
"
,
this
.
name
);
}
else
if
(
this
.
local
===
this
.
remote
)
{
return
nls
.
localize
(
'
remote.tunnelsView.forwardedPortLabel1
'
,
"
{0} to localhost
"
,
this
.
remote
);
}
else
if
(
this
.
local
)
{
return
nls
.
localize
(
'
remote.tunnelsView.forwardedPortLabel2
'
,
"
{0} to localhost:{1}
"
,
this
.
remote
,
this
.
local
);
}
else
if
(
this
.
localAddress
)
{
return
nls
.
localize
(
'
remote.tunnelsView.forwardedPortLabel2
'
,
"
{0} to {1}
"
,
this
.
remote
,
this
.
localAddress
);
}
else
{
return
nls
.
localize
(
'
remote.tunnelsView.forwardedPortLabel3
'
,
"
{0} not forwarded
"
,
this
.
remote
);
}
}
get
description
():
string
|
undefined
{
if
(
this
.
name
)
{
return
nls
.
localize
(
'
remote.tunnelsView.forwardedPortDescription0
'
,
"
remote {0} available at {1}
"
,
this
.
remote
,
this
.
local
);
}
else
if
(
this
.
local
===
this
.
remote
)
{
return
nls
.
localize
(
'
remote.tunnelsView.forwardedPortDescription1
'
,
"
available at {0}
"
,
this
.
local
);
}
else
if
(
this
.
local
)
{
return
this
.
_description
;
}
else
{
if
(
this
.
_description
)
{
return
this
.
_description
;
}
else
if
(
this
.
name
)
{
return
nls
.
localize
(
'
remote.tunnelsView.forwardedPortDescription0
'
,
"
{0} to {1}
"
,
this
.
remote
,
this
.
localAddress
);
}
return
undefined
;
}
}
...
...
@@ -562,7 +557,7 @@ export class TunnelPanelDescriptor implements IViewDescriptor {
namespace
NameTunnelAction
{
export
const
ID
=
'
remote.tunnel.name
'
;
export
const
LABEL
=
nls
.
localize
(
'
remote.tunnel.name
'
,
"
Name Tunnel
"
);
export
const
LABEL
=
nls
.
localize
(
'
remote.tunnel.name
'
,
"
Rename
"
);
export
function
handler
():
ICommandHandler
{
return
async
(
accessor
,
arg
)
=>
{
...
...
@@ -576,7 +571,7 @@ namespace NameTunnelAction {
remoteExplorerService
.
setEditable
(
arg
.
remote
,
null
);
},
validationMessage
:
()
=>
null
,
placeholder
:
nls
.
localize
(
'
remote.tunnelsView.namePlaceholder
'
,
"
Name port
"
),
placeholder
:
nls
.
localize
(
'
remote.tunnelsView.namePlaceholder
'
,
"
Port name
"
),
startingValue
:
arg
.
name
});
}
...
...
@@ -644,9 +639,9 @@ namespace OpenPortInBrowserAction {
const
model
=
accessor
.
get
(
IRemoteExplorerService
).
tunnelModel
;
const
openerService
=
accessor
.
get
(
IOpenerService
);
const
tunnel
=
model
.
forwarded
.
has
(
arg
.
remote
)
?
model
.
forwarded
.
get
(
arg
.
remote
)
:
model
.
published
.
get
(
arg
.
remote
);
let
address
:
URI
|
undefined
;
if
(
tunnel
&&
tunnel
.
local
Uri
&&
(
address
=
model
.
address
(
tunnel
.
remote
)))
{
return
openerService
.
open
(
address
);
let
address
:
string
|
undefined
;
if
(
tunnel
&&
tunnel
.
local
Address
&&
(
address
=
model
.
address
(
tunnel
.
remote
)))
{
return
openerService
.
open
(
URI
.
parse
(
address
)
);
}
return
Promise
.
resolve
();
}
...
...
src/vs/workbench/services/remote/common/remoteExplorerService.ts
浏览文件 @
99e822ef
...
...
@@ -10,7 +10,6 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
ExtensionsRegistry
,
IExtensionPointUser
}
from
'
vs/workbench/services/extensions/common/extensionsRegistry
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
ITunnelService
}
from
'
vs/platform/remote/common/tunnel
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IEditableData
}
from
'
vs/workbench/common/views
'
;
...
...
@@ -20,7 +19,7 @@ export const REMOTE_EXPLORER_TYPE_KEY: string = 'remote.explorerType';
export
interface
Tunnel
{
remote
:
number
;
local
Uri
:
URI
;
local
Address
:
string
;
local
?:
number
;
name
?:
string
;
description
?:
string
;
...
...
@@ -47,7 +46,7 @@ export class TunnelModel extends Disposable {
if
(
tunnel
.
localAddress
)
{
this
.
forwarded
.
set
(
tunnel
.
tunnelRemotePort
,
{
remote
:
tunnel
.
tunnelRemotePort
,
local
Uri
:
tunnel
.
localAddress
,
local
Address
:
tunnel
.
localAddress
,
local
:
tunnel
.
tunnelLocalPort
});
}
...
...
@@ -63,7 +62,7 @@ export class TunnelModel extends Disposable {
if
(
!
this
.
forwarded
.
has
(
tunnel
.
tunnelRemotePort
)
&&
tunnel
.
localAddress
)
{
this
.
forwarded
.
set
(
tunnel
.
tunnelRemotePort
,
{
remote
:
tunnel
.
tunnelRemotePort
,
local
Uri
:
tunnel
.
localAddress
,
local
Address
:
tunnel
.
localAddress
,
local
:
tunnel
.
tunnelLocalPort
});
}
...
...
@@ -86,7 +85,7 @@ export class TunnelModel extends Disposable {
local
:
tunnel
.
tunnelLocalPort
,
name
:
name
,
closeable
:
true
,
local
Uri
:
tunnel
.
localAddress
local
Address
:
tunnel
.
localAddress
};
this
.
forwarded
.
set
(
remote
,
newForward
);
this
.
_onForwardPort
.
fire
(
newForward
);
...
...
@@ -105,8 +104,8 @@ export class TunnelModel extends Disposable {
return
this
.
tunnelService
.
closeTunnel
(
remote
);
}
address
(
remote
:
number
):
URI
|
undefined
{
return
(
this
.
forwarded
.
get
(
remote
)
||
this
.
published
.
get
(
remote
))?.
local
Uri
;
address
(
remote
:
number
):
string
|
undefined
{
return
(
this
.
forwarded
.
get
(
remote
)
||
this
.
published
.
get
(
remote
))?.
local
Address
;
}
}
...
...
src/vs/workbench/services/remote/node/tunnelService.ts
浏览文件 @
99e822ef
...
...
@@ -17,7 +17,6 @@ import { ISignService } from 'vs/platform/sign/common/sign';
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
findFreePort
}
from
'
vs/base/node/ports
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
export
async
function
createRemoteTunnel
(
options
:
IConnectionOptions
,
tunnelRemotePort
:
number
,
tunnelLocalPort
?:
number
):
Promise
<
RemoteTunnel
>
{
...
...
@@ -29,7 +28,7 @@ class NodeRemoteTunnel extends Disposable implements RemoteTunnel {
public
readonly
tunnelRemotePort
:
number
;
public
tunnelLocalPort
!
:
number
;
public
localAddress
?:
URI
;
public
localAddress
?:
string
;
private
readonly
_options
:
IConnectionOptions
;
private
readonly
_server
:
net
.
Server
;
...
...
@@ -71,7 +70,7 @@ class NodeRemoteTunnel extends Disposable implements RemoteTunnel {
this
.
tunnelLocalPort
=
address
.
port
;
await
this
.
_barrier
.
wait
();
this
.
localAddress
=
URI
.
from
({
scheme
:
'
http
'
,
authority
:
'
localhost:
'
+
address
.
port
})
;
this
.
localAddress
=
'
localhost:
'
+
address
.
port
;
return
this
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录