backstage

Форк
0
99 строк · 3.0 Кб
1
/*
2
 * Copyright 2020 The Backstage Authors
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
import { pagerDutyApiRef, PagerDutyClient } from './api';
17
import {
18
  createApiFactory,
19
  createPlugin,
20
  createRouteRef,
21
  discoveryApiRef,
22
  fetchApiRef,
23
  configApiRef,
24
  createComponentExtension,
25
} from '@backstage/core-plugin-api';
26
import { createCardExtension } from '@backstage/plugin-home-react';
27
import { HomePagePagerDutyCardProps } from './components/HomePagePagerDutyCard/Content';
28

29
export const rootRouteRef = createRouteRef({
30
  id: 'pagerduty',
31
});
32

33
/**
34
 * @public
35
 * @deprecated This plugin will be removed in a future release. Please use \@pagerduty/backstage-plugin plugin instead (https://www.npmjs.com/package/\@pagerduty/backstage-plugin).
36
 */
37
export const pagerDutyPlugin = createPlugin({
38
  id: 'pagerduty',
39
  apis: [
40
    createApiFactory({
41
      api: pagerDutyApiRef,
42
      deps: {
43
        discoveryApi: discoveryApiRef,
44
        configApi: configApiRef,
45
        fetchApi: fetchApiRef,
46
      },
47
      factory: ({ configApi, discoveryApi, fetchApi }) =>
48
        PagerDutyClient.fromConfig(configApi, { discoveryApi, fetchApi }),
49
    }),
50
  ],
51
});
52

53
/**
54
 * @public
55
 * @deprecated This plugin and it's cards will be removed in a future release. Please use \@pagerduty/backstage-plugin plugin instead (https://www.npmjs.com/package/\@pagerduty/backstage-plugin).
56
 */
57
export const EntityPagerDutyCard = pagerDutyPlugin.provide(
58
  createComponentExtension({
59
    name: 'EntityPagerDutyCard',
60
    component: {
61
      lazy: () =>
62
        import('./components/EntityPagerDutyCard').then(
63
          m => m.EntityPagerDutyCard,
64
        ),
65
    },
66
  }),
67
);
68

69
/**
70
 * @public
71
 * @deprecated This plugin and it's cards will be removed in a future release. Please use \@pagerduty/backstage-plugin plugin instead (https://www.npmjs.com/package/\@pagerduty/backstage-plugin).
72
 */
73
export const HomePagePagerDutyCard = pagerDutyPlugin.provide(
74
  createCardExtension<HomePagePagerDutyCardProps>({
75
    name: 'HomePagePagerDutyCard',
76
    title: 'PagerDuty Homepage Card',
77
    components: () => import('./components/HomePagePagerDutyCard'),
78
    settings: {
79
      schema: {
80
        title: 'PagerDuty',
81
        type: 'object',
82
        properties: {
83
          integrationKey: {
84
            title: 'PagerDuty integration key',
85
            type: 'string',
86
          },
87
          serviceId: {
88
            title: 'PagerDuty service id',
89
            type: 'string',
90
          },
91
          name: {
92
            title: 'PagerDuty service name',
93
            type: 'string',
94
          },
95
        },
96
      },
97
    },
98
  }),
99
);
100

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.