2020-07-02 17:09:14 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
import { parseBoolean } from '~/lib/utils/common_utils';
|
2020-10-28 20:08:36 -04:00
|
|
|
import AlertSettingsWrapper from './components/alerts_settings_wrapper.vue';
|
2020-07-02 17:09:14 -04:00
|
|
|
|
|
|
|
export default el => {
|
|
|
|
if (!el) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
const {
|
|
|
|
prometheusActivated,
|
|
|
|
prometheusUrl,
|
|
|
|
prometheusAuthorizationKey,
|
|
|
|
prometheusFormPath,
|
|
|
|
prometheusResetKeyPath,
|
|
|
|
prometheusApiUrl,
|
|
|
|
activated: activatedStr,
|
|
|
|
alertsSetupUrl,
|
|
|
|
alertsUsageUrl,
|
|
|
|
formPath,
|
|
|
|
authorizationKey,
|
|
|
|
url,
|
2020-07-15 02:09:35 -04:00
|
|
|
opsgenieMvcAvailable,
|
|
|
|
opsgenieMvcFormPath,
|
|
|
|
opsgenieMvcEnabled,
|
|
|
|
opsgenieMvcTargetUrl,
|
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-10-28 20:08:36 -04:00
|
|
|
activated: parseBoolean(prometheusActivated),
|
2020-08-19 08:10:17 -04:00
|
|
|
prometheusUrl,
|
|
|
|
authorizationKey: prometheusAuthorizationKey,
|
|
|
|
prometheusFormPath,
|
|
|
|
prometheusResetKeyPath,
|
|
|
|
prometheusApiUrl,
|
|
|
|
},
|
|
|
|
generic: {
|
|
|
|
alertsSetupUrl,
|
|
|
|
alertsUsageUrl,
|
2020-10-28 20:08:36 -04:00
|
|
|
activated: parseBoolean(activatedStr),
|
2020-08-19 08:10:17 -04:00
|
|
|
formPath,
|
|
|
|
authorizationKey,
|
|
|
|
url,
|
|
|
|
},
|
|
|
|
opsgenie: {
|
|
|
|
formPath: opsgenieMvcFormPath,
|
2020-10-28 20:08:36 -04:00
|
|
|
activated: parseBoolean(opsgenieMvcEnabled),
|
2020-08-19 08:10:17 -04:00
|
|
|
opsgenieMvcTargetUrl,
|
2020-10-28 20:08:36 -04:00
|
|
|
opsgenieMvcIsAvailable: parseBoolean(opsgenieMvcAvailable),
|
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
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|