Commit aa57b698 authored by Jose Vargas's avatar Jose Vargas

Add missing props to monitoring bundles

This also eliminates the need for multiple entrypoints, since it
reuses the same CE entrypoint, also this pushes a missing
feature flag in the clusters controller
parent a5e5470d
...@@ -2,7 +2,7 @@ import Vue from 'vue'; ...@@ -2,7 +2,7 @@ import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
import Dashboard from './components/dashboard.vue'; import Dashboard from './components/dashboard.vue';
export default () => { export default (props = {}) => {
const el = document.getElementById('prometheus-graphs'); const el = document.getElementById('prometheus-graphs');
if (el && el.dataset) { if (el && el.dataset) {
...@@ -15,6 +15,7 @@ export default () => { ...@@ -15,6 +15,7 @@ export default () => {
...el.dataset, ...el.dataset,
hasMetrics: parseBoolean(el.dataset.hasMetrics), hasMetrics: parseBoolean(el.dataset.hasMetrics),
showTimeWindowDropdown: gon.features.metricsTimeWindow, showTimeWindowDropdown: gon.features.metricsTimeWindow,
...props,
}, },
}); });
}, },
......
...@@ -12,6 +12,9 @@ class Clusters::ClustersController < Clusters::BaseController ...@@ -12,6 +12,9 @@ class Clusters::ClustersController < Clusters::BaseController
before_action :authorize_update_cluster!, only: [:update] before_action :authorize_update_cluster!, only: [:update]
before_action :authorize_admin_cluster!, only: [:destroy] before_action :authorize_admin_cluster!, only: [:destroy]
before_action :update_applications_status, only: [:cluster_status] before_action :update_applications_status, only: [:cluster_status]
before_action only: [:show] do
push_frontend_feature_flag(:metrics_time_window)
end
helper_method :token_in_session helper_method :token_in_session
......
import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
import Dashboard from './components/dashboard.vue'; import initCeBundle from '~/monitoring/monitoring_bundle';
export default () => { export default () => {
const el = document.getElementById('prometheus-graphs'); const el = document.getElementById('prometheus-graphs');
if (el && el.dataset) { if (el && el.dataset) {
// eslint-disable-next-line no-new initCeBundle({
new Vue({ prometheusAlertsAvailable: parseBoolean(el.dataset.prometheusAlertsAvailable),
el,
render(createElement) {
return createElement(Dashboard, {
props: {
...el.dataset,
hasMetrics: parseBoolean(el.dataset.hasMetrics),
prometheusAlertsAvailable: parseBoolean(el.dataset.prometheusAlertsAvailable),
},
});
},
}); });
} }
}; };
import Vue from 'vue'; import initCeBundle from '~/monitoring/monitoring_bundle';
import Dashboard from '~/monitoring/components/dashboard.vue';
export default () => { export default () => {
const el = document.getElementById('prometheus-graphs'); const el = document.getElementById('prometheus-graphs');
if (el && el.dataset) { if (el && el.dataset) {
// eslint-disable-next-line no-new initCeBundle({
new Vue({ ...el.dataset,
el, showLegend: false,
render(createElement) { showPanels: false,
return createElement(Dashboard, { forceSmallGraph: true,
props: { currentEnvironmentName: '',
...el.dataset, environmentsEndpoint: '',
showLegend: false, hasMetrics: true,
showPanels: false,
forceSmallGraph: true,
currentEnvironmentName: '',
environmentsEndpoint: '',
},
});
},
}); });
} }
}; };
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