Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
9b4b79ff
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9b4b79ff
编写于
3月 22, 2018
作者:
F
Filipa Lacerda
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'performance-bar-position-fix' into 'master'
Fix performance bar spacing See merge request gitlab-org/gitlab-ce!17912
上级
e86b2b23
4d1bae70
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
61 addition
and
59 deletion
+61
-59
app/assets/javascripts/performance_bar/components/detailed_metric.vue
...avascripts/performance_bar/components/detailed_metric.vue
+35
-21
app/assets/javascripts/performance_bar/components/performance_bar_app.vue
...cripts/performance_bar/components/performance_bar_app.vue
+18
-18
app/assets/javascripts/performance_bar/components/request_selector.vue
...vascripts/performance_bar/components/request_selector.vue
+1
-1
app/assets/javascripts/performance_bar/components/upstream_performance_bar.vue
...s/performance_bar/components/upstream_performance_bar.vue
+2
-0
app/assets/javascripts/performance_bar/index.js
app/assets/javascripts/performance_bar/index.js
+2
-2
app/assets/stylesheets/performance_bar.scss
app/assets/stylesheets/performance_bar.scss
+0
-6
app/views/peek/_bar.html.haml
app/views/peek/_bar.html.haml
+1
-1
spec/javascripts/performance_bar/components/detailed_metric_spec.js
...cripts/performance_bar/components/detailed_metric_spec.js
+2
-10
未找到文件。
app/assets/javascripts/performance_bar/components/detailed_metric.vue
浏览文件 @
9b4b79ff
...
...
@@ -27,12 +27,21 @@ export default {
required
:
true
,
},
},
computed
:
{
metricDetails
()
{
return
this
.
currentRequest
.
details
[
this
.
metric
];
},
detailsList
()
{
return
this
.
metricDetails
[
this
.
details
];
},
},
};
</
script
>
<
template
>
<div
:id=
"`peek-view-$
{metric}`"
class="view"
v-if="currentRequest.details"
>
<button
:data-target=
"`#modal-peek-$
{metric}-details`"
...
...
@@ -40,34 +49,39 @@ export default {
type="button"
data-toggle="modal"
>
<span
v-if=
"currentRequest.details"
class=
"bold"
>
{{
currentRequest
.
details
[
metric
].
duration
}}
/
{{
currentRequest
.
details
[
metric
].
calls
}}
</span>
{{
metricDetails
.
duration
}}
/
{{
metricDetails
.
calls
}}
</button>
<gl-modal
v-if=
"currentRequest.details"
:id=
"`modal-peek-$
{metric}-details`"
:header-title-text="header"
class="performance-bar-modal"
>
<table
class=
"table"
>
<tr
v-for=
"(item, index) in currentRequest.details[metric][details]"
:key=
"index"
>
<td><strong>
{{
item
.
duration
}}
ms
</strong></td>
<td
v-for=
"key in keys"
:key=
"key"
<table
class=
"table"
>
<template
v-if=
"detailsList.length"
>
<tr
v-for=
"(item, index) in detailsList"
:key=
"index"
>
{{
item
[
key
]
}}
</td>
</tr>
<td><strong>
{{
item
.
duration
}}
ms
</strong></td>
<td
v-for=
"key in keys"
:key=
"key"
>
{{
item
[
key
]
}}
</td>
</tr>
</
template
>
<
template
v-else
>
<tr>
<td>
No
{{
header
.
toLowerCase
()
}}
for this request.
</td>
</tr>
</
template
>
</table>
<div
slot=
"footer"
>
...
...
app/assets/javascripts/performance_bar/components/performance_bar_app.vue
浏览文件 @
9b4b79ff
...
...
@@ -113,27 +113,21 @@ export default {
id=
"js-peek"
:class=
"env"
>
<request-selector
v-if=
"currentRequest"
:current-request=
"currentRequest"
:requests=
"requests"
@
change-current-request=
"changeCurrentRequest"
/>
<div
id=
"peek-view-host"
class=
"view prepend-left-5"
>
<span
v-if=
"currentRequest && currentRequest.details"
class=
"current-host"
>
{{
currentRequest
.
details
.
host
.
hostname
}}
</span>
</div>
<div
v-if=
"currentRequest"
class=
"
wrapper
"
class=
"
container-fluid container-limited
"
>
<div
id=
"peek-view-host"
class=
"view"
>
<span
v-if=
"currentRequest.details"
class=
"current-host"
>
{{
currentRequest
.
details
.
host
.
hostname
}}
</span>
</div>
<upstream-performance-bar
v-if=
"initialRequest && currentRequest.details"
/>
...
...
@@ -186,6 +180,12 @@ export default {
gc
</span>
</div>
<request-selector
v-if=
"currentRequest"
:current-request=
"currentRequest"
:requests=
"requests"
@
change-current-request=
"changeCurrentRequest"
/>
</div>
</div>
</
template
>
app/assets/javascripts/performance_bar/components/request_selector.vue
浏览文件 @
9b4b79ff
...
...
@@ -37,7 +37,7 @@ export default {
<
template
>
<div
id=
"peek-request-selector"
class=
"
append-right-5
pull-right"
class=
"pull-right"
>
<select
v-model=
"currentRequestId"
>
<option
...
...
app/assets/javascripts/performance_bar/components/upstream_performance_bar.vue
浏览文件 @
9b4b79ff
...
...
@@ -5,6 +5,8 @@ export default {
.
getElementById
(
'
peek-view-performance-bar
'
)
.
cloneNode
(
true
);
upstreamPerformanceBar
.
classList
.
remove
(
'
hidden
'
);
this
.
$refs
.
wrapper
.
appendChild
(
upstreamPerformanceBar
);
},
};
...
...
app/assets/javascripts/performance_bar/index.js
浏览文件 @
9b4b79ff
...
...
@@ -4,9 +4,9 @@ import Vue from 'vue';
import
performanceBarApp
from
'
./components/performance_bar_app.vue
'
;
import
PerformanceBarStore
from
'
./stores/performance_bar_store
'
;
export
default
()
=>
export
default
(
{
container
}
)
=>
new
Vue
({
el
:
'
#js-peek
'
,
el
:
container
,
components
:
{
performanceBarApp
,
},
...
...
app/assets/stylesheets/performance_bar.scss
浏览文件 @
9b4b79ff
...
...
@@ -43,12 +43,6 @@
}
}
.wrapper
{
width
:
80%
;
height
:
$performance-bar-height
;
margin
:
0
auto
;
}
// UI Elements
.bucket
{
background
:
$perf-bar-bucket-bg
;
...
...
app/views/peek/_bar.html.haml
浏览文件 @
9b4b79ff
...
...
@@ -6,7 +6,7 @@
profile_url:
url_for
(
params
.
merge
(
lineprofiler:
'true'
))
},
class:
Peek
.
env
}
#peek-view-performance-bar
#peek-view-performance-bar
.hidden
=
render_server_response_time
%span
#serverstats
%ul
.performance-bar
spec/javascripts/performance_bar/components/detailed_metric_spec.js
浏览文件 @
9b4b79ff
...
...
@@ -20,16 +20,8 @@ describe('detailedMetric', () => {
});
});
it
(
'
does not display details
'
,
()
=>
{
expect
(
vm
.
$el
.
innerText
).
not
.
toContain
(
'
/
'
);
});
it
(
'
does not display the modal
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.performance-bar-modal
'
)).
toBeNull
();
});
it
(
'
displays the metric name
'
,
()
=>
{
expect
(
vm
.
$el
.
innerText
).
toContain
(
'
gitaly
'
);
it
(
'
does not render the element
'
,
()
=>
{
expect
(
vm
.
$el
.
innerHTML
).
toEqual
(
undefined
);
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录