Commit b4573bd8 authored by Mike Greiling's avatar Mike Greiling

integrate prometheus graphs into cluster page (rough pass)

parent 6d7be79b
import Vue from 'vue';
import Dashboard from '~/monitoring/components/dashboard.vue';
export default () => {
const el = document.querySelector('#prometheus-graphs');
if (el) {
// eslint-disable-next-line no-new
new Vue({
el,
render: createElement => createElement(Dashboard),
});
}
};
import ClustersBundle from '~/clusters/clusters_bundle'; import ClustersBundle from '~/clusters/clusters_bundle';
import initClusterHealth from './cluster_health';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
new ClustersBundle(); // eslint-disable-line no-new new ClustersBundle(); // eslint-disable-line no-new
initClusterHealth();
}); });
...@@ -3,7 +3,21 @@ ...@@ -3,7 +3,21 @@
%h4= s_('ClusterIntegration|Kubernetes cluster health') %h4= s_('ClusterIntegration|Kubernetes cluster health')
.settings-content .settings-content
%p= s_("ClusterIntegration|In order to show the health of the cluster, we'll need to provision your cluster with Prometheus to collect the required data.") - if @cluster&.application_prometheus&.installed?
#prometheus-graphs{ data: { "settings-path": edit_project_service_path(@project, 'prometheus'),
"clusters-path": project_clusters_path(@project),
"documentation-path": help_page_path('administration/monitoring/prometheus/index.md'),
"empty-getting-started-svg-path": image_path('illustrations/monitoring/getting_started.svg'),
"empty-loading-svg-path": image_path('illustrations/monitoring/loading.svg'),
"empty-unable-to-connect-svg-path": image_path('illustrations/monitoring/unable_to_connect.svg'),
"additional-metrics": metrics_namespace_project_cluster_path( format: :json ),
"project-path": project_path(@project),
"tags-path": project_tags_path(@project),
"has-metrics": "true",
"deployment-endpoint": nil } }
%a.btn{ href: '#cluster-applications' } - else
= s_('ClusterIntegration|Install Prometheus') %p= s_("ClusterIntegration|In order to show the health of the cluster, we'll need to provision your cluster with Prometheus to collect the required data.")
%a.btn{ href: '#cluster-applications' }
= s_('ClusterIntegration|Install Prometheus')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment