Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
18c154d3
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
18c154d3
编写于
11月 01, 2020
作者:
R
Raihaan Shouhell
提交者:
GitHub
11月 01, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5030 from Wadeck/JENKINS-60866_load_statistics
[JENKINS-60866] Un-inline LoadStatistics
上级
09f14b29
f0244bd5
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
69 addition
and
13 deletion
+69
-13
core/src/main/resources/hudson/model/LoadStatistics/main.jelly
...src/main/resources/hudson/model/LoadStatistics/main.jelly
+16
-13
core/src/main/resources/hudson/model/LoadStatistics/main.properties
...ain/resources/hudson/model/LoadStatistics/main.properties
+3
-0
core/src/main/resources/hudson/model/LoadStatistics/resources.js
...c/main/resources/hudson/model/LoadStatistics/resources.js
+50
-0
未找到文件。
core/src/main/resources/hudson/model/LoadStatistics/main.jelly
浏览文件 @
18c154d3
...
...
@@ -24,7 +24,8 @@ THE SOFTWARE.
<!-- renders an HTML fragment that shows trend graph -->
<?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">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout">
<st:adjunct includes="hudson.model.LoadStatistics.resources"/>
<h1>
<l:icon class="icon-monitor icon-xlg"/>
${%title(it.displayName)}
...
...
@@ -43,39 +44,41 @@ THE SOFTWARE.
${%Timespan}:
<j:choose>
<j:when test="${type != 'sec10'}">
<a href="?type=sec10">${%Short}</a>
<a href="?type=sec10"
tooltip="${%timeScale10sec}"
>${%Short}</a>
</j:when>
<j:otherwise>
${%Short}
<span tooltip="${%timeScale10sec}">${%Short}</span>
</j:otherwise>
</j:choose>
<st:nbsp />
<j:choose>
<j:when test="${type != 'min'}">
<a href="?type=min">${%Medium}</a>
<a href="?type=min"
tooltip="${%timeScaleMinute}"
>${%Medium}</a>
</j:when>
<j:otherwise>
${%Medium}
<span tooltip="${%timeScaleMinute}">${%Medium}</span>
</j:otherwise>
</j:choose>
<st:nbsp />
<j:choose>
<j:when test="${type != 'hour'}">
<a href="?type=hour">${%Long}</a>
<a href="?type=hour"
tooltip="${%timeScaleHour}"
>${%Long}</a>
</j:when>
<j:otherwise>
${%Long}
<span tooltip="${%timeScaleHour}">${%Long}</span>
</j:otherwise>
</j:choose>
</div>
<script type="text/javascript">
var w = document.getElementById('main-panel').offsetWidth - 30;
document.write('<img src="${prefix?:'loadStatistics'}/graph?type=${type}&width=' + w + '&height=500" alt="[${%Load statistics graph}]" />');
</script>
<div class="js-load-graph"
data-graph-type="${type}" data-graph-parent-selector="#main-panel"
data-graph-base-url="${prefix?:'loadStatistics'}" data-graph-alt="${%Load statistics graph}">
<!-- The graph will be loaded dynamically by JS -->
</div>
<noscript>
<!-- The noscript alternative does not have the possibility to adjust the image to the available space -->
<img src="${prefix?:'loadStatistics'}/graph?type=${type}&width=500&height=300" alt="[${%Load statistics graph}]" />
</noscript>
<
div style="margin-top: 2em;"
>
<
p
>
${%blurb}
</
div
>
</
p
>
</j:jelly>
core/src/main/resources/hudson/model/LoadStatistics/main.properties
浏览文件 @
18c154d3
...
...
@@ -21,6 +21,9 @@
# THE SOFTWARE.
title
=
Load statistics: {0}
timeScale10sec
=
Every tick is 10 seconds
timeScaleMinute
=
Every tick is one minute
timeScaleHour
=
Every tick is one hour
blurb
=
\
Load statistics keep track of four key metrics of resource utilization:
\
<dl>
\
...
...
core/src/main/resources/hudson/model/LoadStatistics/resources.js
0 → 100644
浏览文件 @
18c154d3
/*
* The MIT License
*
* Copyright (c) 2020, CloudBees, Inc.
*
* 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.
*/
(
function
(){
document
.
addEventListener
(
"
DOMContentLoaded
"
,
function
()
{
var
graphLocation
=
document
.
querySelector
(
'
.js-load-graph
'
);
if
(
graphLocation
)
{
var
type
=
graphLocation
.
getAttribute
(
"
data-graph-type
"
);
var
parentSelector
=
graphLocation
.
getAttribute
(
"
data-graph-parent-selector
"
);
var
baseUrl
=
graphLocation
.
getAttribute
(
"
data-graph-base-url
"
);
var
graphAlt
=
graphLocation
.
getAttribute
(
"
data-graph-alt
"
);
var
parent
=
document
.
querySelector
(
parentSelector
);
if
(
parent
)
{
var
availableWidth
=
parent
.
offsetWidth
;
var
padding
=
30
;
// for some browsers, the perfect width is not enough
var
quirkyBrowserAdjustment
=
15
;
var
graphWidth
=
availableWidth
-
padding
-
quirkyBrowserAdjustment
;
// type in {sec10, min, hour}
var
graphUrl
=
baseUrl
+
"
/graph?type
"
+
type
+
"
&width=
"
+
graphWidth
+
"
&height=500
"
;
var
graphImgTag
=
document
.
createElement
(
"
img
"
);
graphImgTag
.
src
=
graphUrl
;
graphImgTag
.
alt
=
graphAlt
;
graphLocation
.
appendChild
(
graphImgTag
);
}
}
});
})();
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录