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