Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FIY695
jenkins
提交
c140e731
J
jenkins
项目概览
FIY695
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c140e731
编写于
9月 01, 2012
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'pull-535'
上级
c8adf785
c20edce9
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
79 addition
and
0 deletion
+79
-0
changelog.html
changelog.html
+3
-0
core/src/main/java/hudson/model/Computer.java
core/src/main/java/hudson/model/Computer.java
+25
-0
core/src/main/resources/hudson/model/Computer/index.jelly
core/src/main/resources/hudson/model/Computer/index.jelly
+3
-0
core/src/main/resources/hudson/model/Computer/index.properties
...src/main/resources/hudson/model/Computer/index.properties
+1
-0
core/src/main/resources/hudson/model/Computer/setOfflineCause.jelly
...ain/resources/hudson/model/Computer/setOfflineCause.jelly
+44
-0
core/src/main/resources/hudson/model/Computer/setOfflineCause.properties
...esources/hudson/model/Computer/setOfflineCause.properties
+3
-0
未找到文件。
changelog.html
浏览文件 @
c140e731
...
...
@@ -67,6 +67,9 @@ Upcoming changes</a>
<li
class=
bug
>
Detect bugs relating to short
<code>
Descriptor
</code>
names early.
(
<a
href=
"https://issues.jenkins-ci.org/browse/JENKINS-14995"
>
issue 14995
</a>
continued)
<li
class=
rfe
>
Allow the user to type in the reason why a node is offline
(
<a
href=
"https://github.com/jenkinsci/jenkins/pull/535"
>
pull 535
</a>
)
<li
class=
rfe
>
Parameters defined in matrix projects are now available in configuration builds.
(
<a
href=
"https://github.com/jenkinsci/jenkins/pull/543"
>
pull 543
</a>
)
...
...
core/src/main/java/hudson/model/Computer.java
浏览文件 @
c140e731
...
...
@@ -240,6 +240,21 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
return
offlineCause
;
}
/**
* If the computer was offline (either temporarily or not),
* this method will return the cause as a string (without user info).
*
* @return
* null if the system was put offline without given a cause.
*/
@Exported
public
String
getOfflineCauseReason
()
{
String
newString
=
offlineCause
.
toString
().
replaceAll
(
"^Disconnected by [\\w]* \\: "
,
""
);
return
newString
.
toString
().
replaceAll
(
"^Disconnected by [\\w]*"
,
""
);
}
/**
* Gets the channel that can be used to run a program on this computer.
*
...
...
@@ -999,6 +1014,16 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
return
HttpResponses
.
redirectToDot
();
}
public
HttpResponse
doChangeOfflineCause
(
@QueryParameter
String
offlineMessage
)
throws
IOException
,
ServletException
{
checkPermission
(
DISCONNECT
);
offlineMessage
=
Util
.
fixEmptyAndTrim
(
offlineMessage
);
setTemporarilyOffline
(
true
,
OfflineCause
.
create
(
hudson
.
slaves
.
Messages
.
_SlaveComputer_DisconnectedBy
(
Jenkins
.
getAuthentication
().
getName
(),
offlineMessage
!=
null
?
" : "
+
offlineMessage
:
""
)));
return
HttpResponses
.
redirectToDot
();
}
public
Api
getApi
()
{
return
new
Api
(
this
);
}
...
...
core/src/main/resources/hudson/model/Computer/index.jelly
浏览文件 @
c140e731
...
...
@@ -36,6 +36,9 @@ THE SOFTWARE.
<form method="post" action="toggleOffline">
<f:submit value="${%submit.temporarilyOffline}" />
</form>
<form method="post" action="setOfflineCause">
<f:submit value="${%submit.updateOfflineCause}" />
</form>
</l:hasPermission>
</j:when>
<j:otherwise>
...
...
core/src/main/resources/hudson/model/Computer/index.properties
浏览文件 @
c140e731
...
...
@@ -22,6 +22,7 @@
submit.temporarilyOffline
=
Bring this node back online
submit.not.temporarilyOffline
=
Mark this node temporarily offline
submit.updateOfflineCause
=
Update offline reason
title.projects_tied_on
=
Projects tied to {0}
title.no_manual_launch
=
This node has an availability policy that will "{0}". Currently, this mandates that the node be offline.
core/src/main/resources/hudson/model/Computer/setOfflineCause.jelly
0 → 100644
浏览文件 @
c140e731
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Seiji Sogabe, Stephen Connolly, Tom Huybrechts
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:layout title="${%title(it.displayName)}" norefresh="true">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<l:hasPermission permission="${it.DISCONNECT}">
<h2>${%title(it.displayName)}</h2>
<p>
${%blurb}
</p>
<form method="post" action="changeOfflineCause">
<f:textarea name="offlineMessage" value="${it.getOfflineCauseReason()}"/>
<p>
<f:submit value="${%submit}" />
</p>
</form>
</l:hasPermission>
</l:main-panel>
</l:layout>
</j:jelly>
core/src/main/resources/hudson/model/Computer/setOfflineCause.properties
0 → 100644
浏览文件 @
c140e731
title
=
Set {0} Offline Reason
blurb
=
You can set or update the reason why this node offline, so that others can see why:
submit
=
Update reason
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录