Открыть боковую панель
nt_test133
nt_project_uxpg8lvcuq8w
Коммиты
de38bb96
Коммит
de38bb96
создал
Авг 28, 2019
по автору
lauraMon
Просмотр файлов
Removes exportMetricsToCsv ff in timeseries
владелец
ffa5328c
Изменения
1
Скрыть пробелы
Построчно
Рядом
app/assets/javascripts/monitoring/components/charts/time_series.vue
Просмотр файла @
de38bb96
<
script
>
import
{
__
}
from
'
~/locale
'
;
import
{
mapState
}
from
'
vuex
'
;
import
{
GlLink
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlAreaChart
,
GlLineChart
,
GlChartSeriesLabel
}
from
'
@gitlab/ui/dist/charts
'
;
import
dateFormat
from
'
dateformat
'
;
...
...
@@ -75,7 +74,6 @@ export default {
};
},
computed
:
{
...
mapState
(
'
monitoringDashboard
'
,
[
'
exportMetricsToCsvEnabled
'
]),
chartData
()
{
// Transforms & supplements query data to render appropriate labels & styles
// Input: [{ queryAttributes1 }, { queryAttributes2 }]
...
...
@@ -195,18 +193,6 @@ export default {
yAxisLabel
()
{
return
`
${
this
.
graphData
.
y_label
}
`
;
},
csvText
()
{
const
chartData
=
this
.
chartData
[
0
].
data
;
const
header
=
`timestamp,
${
this
.
graphData
.
y_label
}
\r\n`
;
// eslint-disable-line @gitlab/i18n/no-non-i18n-strings
return
chartData
.
reduce
((
csv
,
data
)
=>
{
const
row
=
data
.
join
(
'
,
'
);
return
`
${
csv
}${
row
}
\r\n`
;
},
header
);
},
downloadLink
()
{
const
data
=
new
Blob
([
this
.
csvText
],
{
type
:
'
text/plain
'
});
return
window
.
URL
.
createObjectURL
(
data
);
},
},
watch
:
{
containerWidth
:
'
onResize
'
,
...
...
@@ -279,16 +265,6 @@ export default {
<div
:class=
"
{ 'prometheus-graph-embed w-100 p-3': showBorder }">
<div
class=
"prometheus-graph-header"
>
<h5
class=
"prometheus-graph-title js-graph-title"
>
{{
graphData
.
title
}}
</h5>
<gl-button
v-if=
"exportMetricsToCsvEnabled"
:href=
"downloadLink"
:title=
"__('Download CSV')"
:aria-label=
"__('Download CSV')"
style=
"margin-left: 200px;"
download=
"chart_metrics.csv"
>
{{
__
(
'
Download CSV
'
)
}}
</gl-button>
<div
class=
"prometheus-graph-widgets js-graph-widgets"
>
<slot></slot>
</div>
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать