Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "No root app page component found" error #82

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions src/components/DescriptionPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { KentikAPI } from '../datasource/kentik_api';

import { getBackendSrv } from '@grafana/runtime';
import { getBackendSrv, locationService } from '@grafana/runtime';
import { PanelProps, GrafanaTheme2 } from '@grafana/data';
import { HorizontalGroup, VerticalGroup, useStyles2 } from '@grafana/ui';
import { Button, useStyles2 } from '@grafana/ui';
import React, { FC, useEffect, useState } from 'react';

import { css } from '@emotion/css';
Expand Down Expand Up @@ -31,28 +31,22 @@ export const DescriptionPanel: FC<Props> = () => {
});
}

const handleTopTalkersClick = () => {
locationService.push('/d/NS58GIo71/kentik-top-talkers');
};

return (
<div>
<div className={styles.container}>
<img className={styles.image} src="public/plugins/kentik-connect-app/img/kentik_logo.png" />
<p>
<p className={styles.descriptionText}>
Kentik Connect Pro for Grafana allows you to quickly and easily add network activity visibility metrics to your
Grafana dashboard. By leveraging the power of Kentik’s monitoring SaaS, you can enjoy rich, actionable insights
into consumers of network bandwidth and anomalies that can affect application or service performance.
</p>
<div className={styles.actionsContainer}>
<VerticalGroup>
<div>Complete:</div>
<HorizontalGroup>
<i className={styles.successIcon + ' icon-gf icon-gf-check'}></i>
<span className={styles.successLine}>Install Kentik Connect for Grafana.</span>
</HorizontalGroup>
{state.devices.length > 0 && (
<HorizontalGroup>
<i className={styles.successIcon + ' icon-gf icon-gf-check'}></i>
<span className={styles.successLine}>Add your first device.</span>
</HorizontalGroup>
)}
</VerticalGroup>
<Button variant={'primary'} fill={'text'} onClick={handleTopTalkersClick}>
Kentik Top Talkers
</Button>
</div>
</div>
);
Expand All @@ -66,6 +60,9 @@ const getStyles = (theme: GrafanaTheme2) => ({
width: 150px;
margin-bottom: 10px;
`,
container: css`
padding: 16px;
`,
actionsContainer: css`
margin-left: 16px;
`,
Expand All @@ -79,4 +76,7 @@ const getStyles = (theme: GrafanaTheme2) => ({
successLine: css`
text-decoration: line-through;
`,
descriptionText: css`
max-width: 600px;
`,
});
16 changes: 10 additions & 6 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DescriptionPanel } from 'components/DescriptionPanel';
import { AppConfig } from './components/AppConfig';

import './styles/dark.scss';
Expand All @@ -11,9 +12,12 @@ loadPluginCss({
light: 'plugins/kentik-connect-app/styles/light.css',
});

export const plugin = new AppPlugin<{}>().addConfigPage({
title: 'Configuration',
icon: 'cog',
body: AppConfig,
id: 'configuration',
});
export const plugin = new AppPlugin<{}>()
// @ts-ignore
.setRootPage(DescriptionPanel)
.addConfigPage({
title: 'Configuration',
icon: 'cog',
body: AppConfig,
id: 'configuration',
});