@@ -10,23 +10,15 @@ import { Entity } from '@backstage/catalog-model';
|
||||
import { RouteRef } from '@backstage/core-plugin-api';
|
||||
|
||||
// @public
|
||||
export const DashboardSnapshotComponent: ({
|
||||
guid,
|
||||
name,
|
||||
permalink,
|
||||
}: {
|
||||
export const DashboardSnapshotComponent: (props: {
|
||||
guid: string;
|
||||
name: string;
|
||||
permalink: string;
|
||||
}) => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityNewRelicDashboardCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityNewRelicDashboardCard: () => JSX.Element;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "EntityNewRelicDashboardContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const EntityNewRelicDashboardContent: () => JSX.Element;
|
||||
|
||||
@@ -35,8 +27,6 @@ export const EntityNewRelicDashboardContent: () => JSX.Element;
|
||||
// @public (undocumented)
|
||||
export const isNewRelicDashboardAvailable: (entity: Entity) => boolean;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "newRelicDashboardPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
export const newRelicDashboardPlugin: BackstagePlugin<
|
||||
{
|
||||
|
||||
+7
-4
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Box, Grid, MenuItem, Select } from '@material-ui/core';
|
||||
import { useApi, storageApiRef } from '@backstage/core-plugin-api';
|
||||
@@ -27,13 +28,15 @@ import { newRelicDashboardApiRef } from '../../../api';
|
||||
import { DashboardSnapshotSummary } from '../../../api/NewRelicDashboardApi';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
|
||||
type Props = {
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const DashboardSnapshot = (props: {
|
||||
guid: string;
|
||||
name: string;
|
||||
permalink: string;
|
||||
};
|
||||
|
||||
export const DashboardSnapshot = ({ guid, name, permalink }: Props) => {
|
||||
}) => {
|
||||
const { guid, name, permalink } = props;
|
||||
const newRelicDashboardAPI = useApi(newRelicDashboardApiRef);
|
||||
const storageApi = useApi(storageApiRef).forBucket('newrelic-dashboard');
|
||||
const setStorageValue = (value: number) => {
|
||||
|
||||
+5
-4
@@ -44,15 +44,14 @@ function TabPanel(props: TabPanelProps) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function a11yProps(index: number) {
|
||||
return {
|
||||
id: `simple-tab-${index}`,
|
||||
'aria-controls': `simple-tabpanel-${index}`,
|
||||
};
|
||||
}
|
||||
type Props = {
|
||||
guid: string;
|
||||
};
|
||||
|
||||
const useStyles = makeStyles(
|
||||
theme => ({
|
||||
tabsWrapper: {
|
||||
@@ -79,7 +78,9 @@ const useStyles = makeStyles(
|
||||
}),
|
||||
{ name: 'DashboardHeaderTabs' },
|
||||
);
|
||||
export const DashboardSnapshotList = ({ guid }: Props) => {
|
||||
|
||||
export const DashboardSnapshotList = (props: { guid: string }) => {
|
||||
const { guid } = props;
|
||||
const styles = useStyles();
|
||||
const newRelicDashboardAPI = useApi(newRelicDashboardApiRef);
|
||||
const { value, loading, error } = useAsync(async (): Promise<
|
||||
|
||||
+1
@@ -13,5 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { DashboardSnapshot } from './DashboardSnapshot';
|
||||
export { DashboardSnapshotList } from './DashboardSnapshotList';
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
createPlugin,
|
||||
configApiRef,
|
||||
@@ -24,6 +25,7 @@ import {
|
||||
import { newRelicDashboardApiRef, NewRelicDashboardClient } from './api';
|
||||
import { rootRouteRef } from './routes';
|
||||
|
||||
/** @public */
|
||||
export const newRelicDashboardPlugin = createPlugin({
|
||||
id: 'new-relic-dashboard',
|
||||
routes: {
|
||||
@@ -46,6 +48,8 @@ export const newRelicDashboardPlugin = createPlugin({
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
/** @public */
|
||||
export const EntityNewRelicDashboardContent = newRelicDashboardPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'EntityNewRelicDashboardPage',
|
||||
@@ -55,6 +59,7 @@ export const EntityNewRelicDashboardContent = newRelicDashboardPlugin.provide(
|
||||
}),
|
||||
);
|
||||
|
||||
/** @public */
|
||||
export const EntityNewRelicDashboardCard = newRelicDashboardPlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'EntityNewRelicDashboardListComponent',
|
||||
@@ -66,6 +71,7 @@ export const EntityNewRelicDashboardCard = newRelicDashboardPlugin.provide(
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* Render dashboard snapshots from Newrelic in backstage. Use dashboards which have the tag `isDashboardPage: true`
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user