summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Knox <simon@gitlab.com>2018-01-23 16:00:15 +0000
committerPhil Hughes <me@iamphill.com>2018-01-23 16:00:15 +0000
commit0b47c94a7243e956221fe2447e5c338d8ff2280b (patch)
tree3a57c8ff564c31f024c55a85a743030f306f4ddc
parentd3f42147a3c6d5f18ec7e7cb821f870efabf026a (diff)
downloadgitlab-ce-0b47c94a7243e956221fe2447e5c338d8ff2280b.tar.gz
remove webpack bundle tag for monitoring:environments:metrics
-rw-r--r--app/assets/javascripts/dispatcher.js5
-rw-r--r--app/assets/javascripts/monitoring/monitoring_bundle.js4
-rw-r--r--app/assets/javascripts/pages/projects/environments/metrics/index.js3
-rw-r--r--app/views/projects/environments/metrics.html.haml1
4 files changed, 10 insertions, 3 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index 96e5c8c890c..895251cec3c 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -68,6 +68,11 @@ import SearchAutocomplete from './search_autocomplete';
.catch(fail);
shortcut_handler = true;
break;
+ case 'projects:environments:metrics':
+ import('./pages/projects/environments/metrics')
+ .then(callDefault)
+ .catch(fail);
+ break;
case 'projects:merge_requests:index':
import('./pages/projects/merge_requests/index')
.then(callDefault)
diff --git a/app/assets/javascripts/monitoring/monitoring_bundle.js b/app/assets/javascripts/monitoring/monitoring_bundle.js
index 104432ef5de..c3b0ef7e9ca 100644
--- a/app/assets/javascripts/monitoring/monitoring_bundle.js
+++ b/app/assets/javascripts/monitoring/monitoring_bundle.js
@@ -1,7 +1,7 @@
import Vue from 'vue';
import Dashboard from './components/dashboard.vue';
-document.addEventListener('DOMContentLoaded', () => new Vue({
+export default () => new Vue({
el: '#prometheus-graphs',
render: createElement => createElement(Dashboard),
-}));
+});
diff --git a/app/assets/javascripts/pages/projects/environments/metrics/index.js b/app/assets/javascripts/pages/projects/environments/metrics/index.js
new file mode 100644
index 00000000000..f4760cb2720
--- /dev/null
+++ b/app/assets/javascripts/pages/projects/environments/metrics/index.js
@@ -0,0 +1,3 @@
+import monitoringBundle from '~/monitoring/monitoring_bundle';
+
+export default monitoringBundle;
diff --git a/app/views/projects/environments/metrics.html.haml b/app/views/projects/environments/metrics.html.haml
index ad94113fffd..5257b42548e 100644
--- a/app/views/projects/environments/metrics.html.haml
+++ b/app/views/projects/environments/metrics.html.haml
@@ -3,7 +3,6 @@
- content_for :page_specific_javascripts do
= webpack_bundle_tag 'common_vue'
= webpack_bundle_tag 'common_d3'
- = webpack_bundle_tag 'monitoring'
.prometheus-container{ class: container_class }
.top-area