Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f666439e
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,发现更多精彩内容 >>
提交
f666439e
编写于
7月 12, 2017
作者:
C
Christof Marti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Deployment experiment
上级
044e454b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
200 addition
and
1 deletion
+200
-1
src/vs/workbench/parts/scm/electron-browser/deploymentView.ts
...vs/workbench/parts/scm/electron-browser/deploymentView.ts
+159
-0
src/vs/workbench/parts/scm/electron-browser/media/deploymentView.css
...bench/parts/scm/electron-browser/media/deploymentView.css
+17
-0
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
+24
-1
未找到文件。
src/vs/workbench/parts/scm/electron-browser/deploymentView.ts
0 → 100644
浏览文件 @
f666439e
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
'
vs/css!./media/deploymentView
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
DOM
=
require
(
'
vs/base/browser/dom
'
);
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
$
}
from
'
vs/base/browser/builder
'
;
import
{
IActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
CollapsibleView
,
IViewletViewOptions
,
IViewOptions
}
from
'
vs/workbench/parts/views/browser/views
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
ViewSizing
}
from
'
vs/base/browser/ui/splitview/splitview
'
;
import
{
IThemeService
,
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
focusBorder
,
textLinkForeground
,
textLinkActiveForeground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
IQuickOpenService
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
const
TARGETS
=
[
{
id
:
'
azure
'
,
label
:
nls
.
localize
(
'
deployToAzure
'
,
"
Deploy to Azure App Service
"
),
uri
:
()
=>
URI
.
parse
(
'
https://code.visualstudio.com/nodejs-deployment#vscode
'
)
},
{
id
:
'
aws
'
,
label
:
nls
.
localize
(
'
deployToAWS
'
,
"
Deploy to Elastic Beanstalk (AWS)
"
),
uri
:
()
=>
URI
.
parse
(
'
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-cli-git.html
'
)
},
{
id
:
'
heroku
'
,
label
:
nls
.
localize
(
'
deployToHeroku
'
,
"
Deploy to Heroku
"
),
uri
:
()
=>
URI
.
parse
(
'
https://devcenter.heroku.com/articles/git
'
)
},
];
export
class
DeploymentView
extends
CollapsibleView
{
public
static
ID
:
string
=
'
workbench.deploymentView
'
;
public
static
NAME
=
nls
.
localize
(
'
deployment
'
,
"
Deployment
"
);
public
static
HEIGHT
=
80
;
private
deploymentLink
:
HTMLAnchorElement
;
constructor
(
options
:
IViewletViewOptions
,
@
IThemeService
private
themeService
:
IThemeService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IQuickOpenService
private
quickOpenService
:
IQuickOpenService
,
@
IOpenerService
private
openerService
:
IOpenerService
,
@
ITelemetryService
private
telemetryService
:
ITelemetryService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IContextMenuService
contextMenuService
:
IContextMenuService
)
{
super
({
...(
options
as
IViewOptions
),
ariaHeaderLabel
:
nls
.
localize
(
'
deploymentSection
'
,
"
Deployment Section
"
),
sizing
:
ViewSizing
.
Fixed
},
keybindingService
,
contextMenuService
);
}
public
renderHeader
(
container
:
HTMLElement
):
void
{
let
titleDiv
=
$
(
'
div.title
'
).
appendTo
(
container
);
$
(
'
span
'
).
text
(
this
.
name
).
appendTo
(
titleDiv
);
}
protected
renderBody
(
container
:
HTMLElement
):
void
{
DOM
.
addClass
(
container
,
'
deployment-view
'
);
let
section
=
$
(
'
div.section
'
).
appendTo
(
container
);
this
.
deploymentLink
=
document
.
createElement
(
'
a
'
);
this
.
deploymentLink
.
innerText
=
nls
.
localize
(
'
deployApplication
'
,
"
Deploy your applciation using Git
"
);
this
.
deploymentLink
.
classList
.
add
(
'
pointer
'
);
this
.
deploymentLink
.
classList
.
add
(
'
prominent
'
);
this
.
deploymentLink
.
tabIndex
=
0
;
this
.
deploymentLink
.
href
=
'
javascript:void(0)
'
;
this
.
deploymentLink
.
addEventListener
(
'
click
'
,
e
=>
{
this
.
pickTargetService
();
e
.
preventDefault
();
e
.
stopPropagation
();
});
section
.
append
(
this
.
deploymentLink
);
}
private
pickTargetService
()
{
this
.
telemetryService
.
publicLog
(
'
deploymentClicked
'
);
this
.
quickOpenService
.
pick
(
TARGETS
,
{
placeHolder
:
nls
.
localize
(
'
pickTargetService
'
,
"
Pick target service
"
)
})
.
then
(
pick
=>
{
if
(
pick
)
{
this
.
telemetryService
.
publicLog
(
'
deploymentServicePicked
'
,
{
id
:
pick
.
id
});
}
else
{
this
.
telemetryService
.
publicLog
(
'
deploymentCanceled
'
);
}
return
pick
&&
this
.
openerService
.
open
(
pick
.
uri
());
})
.
then
(
null
,
errors
.
onUnexpectedError
);
}
layoutBody
(
size
:
number
):
void
{
// no-op
}
public
create
():
TPromise
<
void
>
{
return
TPromise
.
as
(
null
);
}
public
setVisible
(
visible
:
boolean
):
TPromise
<
void
>
{
return
TPromise
.
as
(
null
);
}
public
focusBody
():
void
{
if
(
this
.
deploymentLink
)
{
this
.
deploymentLink
.
focus
();
}
}
protected
reveal
(
element
:
any
,
relativeTop
?:
number
):
TPromise
<
void
>
{
return
TPromise
.
as
(
null
);
}
public
getActions
():
IAction
[]
{
return
[];
}
public
getSecondaryActions
():
IAction
[]
{
return
[];
}
public
getActionItem
(
action
:
IAction
):
IActionItem
{
return
null
;
}
public
shutdown
():
void
{
}
}
// theming
registerThemingParticipant
((
theme
,
collector
)
=>
{
const
link
=
theme
.
getColor
(
textLinkForeground
);
if
(
link
)
{
collector
.
addRule
(
`.deployment-view a { color:
${
link
}
; }`
);
}
const
activeLink
=
theme
.
getColor
(
textLinkActiveForeground
);
if
(
activeLink
)
{
collector
.
addRule
(
`.deployment-view a:hover,
.deployment-view a:active { color:
${
activeLink
}
; }`
);
}
const
focusColor
=
theme
.
getColor
(
focusBorder
);
if
(
focusColor
)
{
collector
.
addRule
(
`.deployment-view a:focus { outline-color:
${
focusColor
}
; }`
);
}
});
src/vs/workbench/parts/scm/electron-browser/media/deploymentView.css
0 → 100644
浏览文件 @
f666439e
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.deployment-view
{
padding
:
7px
19px
;
}
.deployment-view
a
{
text-decoration
:
none
;
}
.deployment-view
a
:focus
{
outline
:
1px
solid
-webkit-focus-ring-color
;
outline-offset
:
-1px
;
}
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
浏览文件 @
f666439e
...
...
@@ -46,6 +46,9 @@ import { comparePaths } from 'vs/base/common/comparers';
import
{
isSCMResource
}
from
'
./scmUtil
'
;
import
{
attachInputBoxStyler
,
attachListStyler
,
attachBadgeStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
IViewletViewOptions
}
from
'
vs/workbench/parts/views/browser/views
'
;
import
{
SplitView
}
from
'
vs/base/browser/ui/splitview/splitview
'
;
import
{
DeploymentView
}
from
'
./deploymentView
'
;
// TODO@Joao
// Need to subclass MenuItemActionItem in order to respect
...
...
@@ -228,6 +231,7 @@ export class SCMViewlet extends Viewlet {
private
inputBox
:
InputBox
;
private
listContainer
:
HTMLElement
;
private
list
:
List
<
ISCMResourceGroup
|
ISCMResource
>
;
private
deploymentSplitView
:
SplitView
;
private
menus
:
SCMMenus
;
private
providerChangeDisposable
:
IDisposable
=
EmptyDisposable
;
private
disposables
:
IDisposable
[]
=
[];
...
...
@@ -258,7 +262,11 @@ export class SCMViewlet extends Viewlet {
private
setActiveProvider
(
activeProvider
:
ISCMProvider
|
undefined
):
void
{
this
.
providerChangeDisposable
.
dispose
();
const
updateLayout
=
(
this
.
activeProvider
&&
this
.
activeProvider
.
id
===
'
git
'
)
!==
(
activeProvider
&&
activeProvider
.
id
===
'
git
'
);
this
.
activeProvider
=
activeProvider
;
if
(
updateLayout
)
{
this
.
layout
();
}
if
(
activeProvider
)
{
const
disposables
=
[
activeProvider
.
onDidChange
(
this
.
update
,
this
)];
...
...
@@ -316,6 +324,18 @@ export class SCMViewlet extends Viewlet {
keyboardSupport
:
false
});
const
options
:
IViewletViewOptions
=
{
id
:
DeploymentView
.
ID
,
name
:
DeploymentView
.
NAME
,
actionRunner
:
this
.
actionRunner
,
collapsed
:
false
,
viewletSettings
:
null
};
this
.
deploymentSplitView
=
new
SplitView
(
root
);
const
view
=
this
.
instantiationService
.
createInstance
(
DeploymentView
,
options
);
this
.
deploymentSplitView
.
addView
(
view
);
this
.
disposables
.
push
(
this
.
deploymentSplitView
);
this
.
disposables
.
push
(
attachListStyler
(
this
.
list
,
this
.
themeService
));
this
.
disposables
.
push
(
this
.
listService
.
register
(
this
.
list
));
...
...
@@ -390,10 +410,13 @@ export class SCMViewlet extends Viewlet {
this
.
inputBox
.
layout
();
const
editorHeight
=
this
.
inputBox
.
height
;
const
listHeight
=
dimension
.
height
-
(
editorHeight
+
12
/* margin */
);
const
deploymentHeight
=
this
.
activeProvider
&&
this
.
activeProvider
.
id
===
'
git
'
?
DeploymentView
.
HEIGHT
:
0
;
const
listHeight
=
dimension
.
height
-
(
editorHeight
+
12
/* margin */
)
-
deploymentHeight
;
this
.
listContainer
.
style
.
height
=
`
${
listHeight
}
px`
;
this
.
list
.
layout
(
listHeight
);
this
.
deploymentSplitView
.
layout
(
deploymentHeight
);
toggleClass
(
this
.
inputBoxContainer
,
'
scroll
'
,
editorHeight
>=
134
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录