2020-07-28 23:09:34 +05:30
|
|
|
import Vue from 'vue';
|
2021-01-29 00:20:46 +05:30
|
|
|
import { GlToast } from '@gitlab/ui';
|
2020-07-28 23:09:34 +05:30
|
|
|
import { parseBoolean } from '~/lib/utils/common_utils';
|
2021-01-29 00:20:46 +05:30
|
|
|
import AlertSettingsWrapper from './components/alerts_settings_wrapper.vue';
|
|
|
|
import apolloProvider from './graphql';
|
|
|
|
|
|
|
|
apolloProvider.clients.defaultClient.cache.writeData({
|
|
|
|
data: {
|
|
|
|
currentIntegration: null,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
Vue.use(GlToast);
|
2020-07-28 23:09:34 +05:30
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
export default (el) => {
|
2020-07-28 23:09:34 +05:30
|
|
|
if (!el) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
const {
|
|
|
|
prometheusActivated,
|
|
|
|
prometheusUrl,
|
|
|
|
prometheusAuthorizationKey,
|
|
|
|
prometheusFormPath,
|
|
|
|
prometheusResetKeyPath,
|
|
|
|
prometheusApiUrl,
|
|
|
|
activated: activatedStr,
|
|
|
|
alertsSetupUrl,
|
|
|
|
alertsUsageUrl,
|
|
|
|
formPath,
|
|
|
|
authorizationKey,
|
|
|
|
url,
|
2021-01-29 00:20:46 +05:30
|
|
|
projectPath,
|
|
|
|
multiIntegrations,
|
2020-07-28 23:09:34 +05:30
|
|
|
} = el.dataset;
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
2021-03-08 18:12:59 +05:30
|
|
|
components: {
|
|
|
|
AlertSettingsWrapper,
|
|
|
|
},
|
2020-10-24 23:57:45 +05:30
|
|
|
provide: {
|
|
|
|
prometheus: {
|
2021-01-29 00:20:46 +05:30
|
|
|
active: parseBoolean(prometheusActivated),
|
|
|
|
url: prometheusUrl,
|
|
|
|
token: prometheusAuthorizationKey,
|
2020-10-24 23:57:45 +05:30
|
|
|
prometheusFormPath,
|
|
|
|
prometheusResetKeyPath,
|
|
|
|
prometheusApiUrl,
|
|
|
|
},
|
|
|
|
generic: {
|
|
|
|
alertsSetupUrl,
|
|
|
|
alertsUsageUrl,
|
2021-01-29 00:20:46 +05:30
|
|
|
active: parseBoolean(activatedStr),
|
2020-10-24 23:57:45 +05:30
|
|
|
formPath,
|
2021-01-29 00:20:46 +05:30
|
|
|
token: authorizationKey,
|
2020-10-24 23:57:45 +05:30
|
|
|
url,
|
|
|
|
},
|
2021-01-29 00:20:46 +05:30
|
|
|
projectPath,
|
|
|
|
multiIntegrations: parseBoolean(multiIntegrations),
|
2020-10-24 23:57:45 +05:30
|
|
|
},
|
2021-01-29 00:20:46 +05:30
|
|
|
apolloProvider,
|
2020-07-28 23:09:34 +05:30
|
|
|
render(createElement) {
|
2021-01-29 00:20:46 +05:30
|
|
|
return createElement('alert-settings-wrapper');
|
2020-07-28 23:09:34 +05:30
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|