Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
61ce591b
Commit
61ce591b
authored
Jan 24, 2020
by
Tristan Read
Committed by
Natalia Tepluhina
Jan 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace underscore with lodash for ~/monitoring
parent
90baa159
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
16 deletions
+16
-16
app/assets/javascripts/monitoring/components/charts/anomaly.vue
...sets/javascripts/monitoring/components/charts/anomaly.vue
+2
-2
app/assets/javascripts/monitoring/components/charts/time_series.vue
.../javascripts/monitoring/components/charts/time_series.vue
+2
-2
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+3
-3
app/assets/javascripts/monitoring/components/date_time_picker/date_time_picker_input.vue
...ng/components/date_time_picker/date_time_picker_input.vue
+2
-2
app/assets/javascripts/monitoring/components/panel_type.vue
app/assets/javascripts/monitoring/components/panel_type.vue
+2
-2
app/assets/javascripts/monitoring/stores/utils.js
app/assets/javascripts/monitoring/stores/utils.js
+2
-2
ee/app/assets/javascripts/monitoring/components/alert_widget_form.vue
...s/javascripts/monitoring/components/alert_widget_form.vue
+3
-3
No files found.
app/assets/javascripts/monitoring/components/charts/anomaly.vue
View file @
61ce591b
<
script
>
import
{
flatten
,
isNumber
}
from
'
underscore
'
;
import
{
flatten
Deep
,
isNumber
}
from
'
lodash
'
;
import
{
GlChartSeriesLabel
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
roundOffFloat
}
from
'
~/lib/utils/common_utils
'
;
import
{
hexToRgb
}
from
'
~/lib/utils/color_utils
'
;
...
...
@@ -77,7 +77,7 @@ export default {
* This offset is the lowest value.
*/
yOffset
()
{
const
values
=
flatten
(
this
.
series
.
map
(
ser
=>
ser
.
data
.
map
(([,
y
])
=>
y
)));
const
values
=
flatten
Deep
(
this
.
series
.
map
(
ser
=>
ser
.
data
.
map
(([,
y
])
=>
y
)));
const
min
=
values
.
length
?
Math
.
floor
(
Math
.
min
(...
values
))
:
0
;
return
min
<
0
?
-
min
:
0
;
},
...
...
app/assets/javascripts/monitoring/components/charts/time_series.vue
View file @
61ce591b
<
script
>
import
_
from
'
underscore
'
;
import
{
omit
}
from
'
lodash
'
;
import
{
GlLink
,
GlButton
,
GlTooltip
,
GlResizeObserverDirective
}
from
'
@gitlab/ui
'
;
import
{
GlAreaChart
,
GlLineChart
,
GlChartSeriesLabel
}
from
'
@gitlab/ui/dist/charts
'
;
import
dateFormat
from
'
dateformat
'
;
...
...
@@ -140,7 +140,7 @@ export default {
return
(
this
.
option
.
series
||
[]).
concat
(
this
.
scatterSeries
?
[
this
.
scatterSeries
]
:
[]);
},
chartOptions
()
{
const
option
=
_
.
omit
(
this
.
option
,
'
series
'
);
const
option
=
omit
(
this
.
option
,
'
series
'
);
return
{
series
:
this
.
chartOptionSeries
,
xAxis
:
{
...
...
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
61ce591b
<
script
>
import
_
from
'
underscore
'
;
import
{
debounce
,
pickBy
}
from
'
lodash
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
VueDraggable
from
'
vuedraggable
'
;
import
{
...
...
@@ -294,7 +294,7 @@ export default {
generateLink
(
group
,
title
,
yLabel
)
{
const
dashboard
=
this
.
currentDashboard
||
this
.
firstDashboard
.
path
;
const
params
=
_
.
pick
({
dashboard
,
group
,
title
,
y_label
:
yLabel
},
value
=>
value
!=
null
);
const
params
=
pickBy
({
dashboard
,
group
,
title
,
y_label
:
yLabel
},
value
=>
value
!=
null
);
return
mergeUrlParams
(
params
,
window
.
location
.
href
);
},
hideAddMetricModal
()
{
...
...
@@ -306,7 +306,7 @@ export default {
setFormValidity
(
isValid
)
{
this
.
formIsValid
=
isValid
;
},
debouncedEnvironmentsSearch
:
_
.
debounce
(
function
environmentsSearchOnInput
(
searchTerm
)
{
debouncedEnvironmentsSearch
:
debounce
(
function
environmentsSearchOnInput
(
searchTerm
)
{
this
.
setEnvironmentsSearchTerm
(
searchTerm
);
},
500
),
submitCustomMetricsForm
()
{
...
...
app/assets/javascripts/monitoring/components/date_time_picker/date_time_picker_input.vue
View file @
61ce591b
<
script
>
import
_
from
'
underscore
'
;
import
{
uniqueId
}
from
'
lodash
'
;
import
{
GlFormGroup
,
GlFormInput
}
from
'
@gitlab/ui
'
;
import
{
__
,
sprintf
}
from
'
~/locale
'
;
import
{
dateFormats
}
from
'
./date_time_picker_lib
'
;
...
...
@@ -35,7 +35,7 @@ export default {
id
:
{
type
:
String
,
required
:
false
,
default
:
()
=>
_
.
uniqueId
(
'
dateTimePicker_
'
),
default
:
()
=>
uniqueId
(
'
dateTimePicker_
'
),
},
},
data
()
{
...
...
app/assets/javascripts/monitoring/components/panel_type.vue
View file @
61ce591b
<
script
>
import
{
mapState
}
from
'
vuex
'
;
import
_
from
'
underscore
'
;
import
{
pickBy
}
from
'
lodash
'
;
import
{
GlDropdown
,
GlDropdownItem
,
...
...
@@ -90,7 +90,7 @@ export default {
getGraphAlerts
(
queries
)
{
if
(
!
this
.
allAlerts
)
return
{};
const
metricIdsForChart
=
queries
.
map
(
q
=>
q
.
metricId
);
return
_
.
pick
(
this
.
allAlerts
,
alert
=>
metricIdsForChart
.
includes
(
alert
.
metricId
));
return
pickBy
(
this
.
allAlerts
,
alert
=>
metricIdsForChart
.
includes
(
alert
.
metricId
));
},
getGraphAlertValues
(
queries
)
{
return
Object
.
values
(
this
.
getGraphAlerts
(
queries
));
...
...
app/assets/javascripts/monitoring/stores/utils.js
View file @
61ce591b
import
_
from
'
underscore
'
;
import
{
omit
}
from
'
lodash
'
;
export
const
uniqMetricsId
=
metric
=>
`
${
metric
.
metric_id
}
_
${
metric
.
id
}
`
;
...
...
@@ -11,7 +11,7 @@ export const uniqMetricsId = metric => `${metric.metric_id}_${metric.id}`;
*/
export
const
normalizeMetric
=
(
metric
=
{})
=>
_
.
omit
(
omit
(
{
...
metric
,
metric_id
:
uniqMetricsId
(
metric
),
...
...
ee/app/assets/javascripts/monitoring/components/alert_widget_form.vue
View file @
61ce591b
<
script
>
import
_
from
'
underscore
'
;
import
{
isEmpty
,
findKey
}
from
'
lodash
'
;
import
Vue
from
'
vue
'
;
import
{
GlLink
,
...
...
@@ -118,7 +118,7 @@ export default {
);
},
submitAction
()
{
if
(
_
.
isEmpty
(
this
.
selectedAlert
))
return
'
create
'
;
if
(
isEmpty
(
this
.
selectedAlert
))
return
'
create
'
;
if
(
this
.
haveValuesChanged
)
return
'
update
'
;
return
'
delete
'
;
},
...
...
@@ -147,7 +147,7 @@ export default {
},
methods
:
{
selectQuery
(
queryId
)
{
const
existingAlertPath
=
_
.
findKey
(
this
.
alertsToManage
,
alert
=>
alert
.
metricId
===
queryId
);
const
existingAlertPath
=
findKey
(
this
.
alertsToManage
,
alert
=>
alert
.
metricId
===
queryId
);
const
existingAlert
=
this
.
alertsToManage
[
existingAlertPath
];
if
(
existingAlert
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment