Commit 47523f80 by Torkel Ödegaard

fixed logging start page

parent ac6170a7
...@@ -15,7 +15,7 @@ const CHEAT_SHEET_ITEMS = [ ...@@ -15,7 +15,7 @@ const CHEAT_SHEET_ITEMS = [
export default (props: any) => ( export default (props: any) => (
<div> <div>
<h1>Logging Cheat Sheet</h1> <h2>Logging Cheat Sheet</h2>
{CHEAT_SHEET_ITEMS.map(item => ( {CHEAT_SHEET_ITEMS.map(item => (
<div className="cheat-sheet-item" key={item.expression}> <div className="cheat-sheet-item" key={item.expression}>
<div className="cheat-sheet-item__title">{item.title}</div> <div className="cheat-sheet-item__title">{item.title}</div>
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import classNames from 'classnames';
import LoggingCheatSheet from './LoggingCheatSheet'; import LoggingCheatSheet from './LoggingCheatSheet';
const TAB_MENU_ITEMS = [ interface Props {
{ onClickExample: () => void;
text: 'Start', }
id: 'start',
icon: 'fa fa-rocket',
},
];
export default class LoggingStartPage extends PureComponent<any, { active: string }> {
state = {
active: 'start',
};
onClickTab = active => {
this.setState({ active });
};
export default class LoggingStartPage extends PureComponent<Props> {
render() { render() {
const { active } = this.state;
const customCss = '';
return ( return (
<div style={{ margin: '45px 0', border: '1px solid #ddd', borderRadius: 5 }}> <div className="grafana-info-box">
<div className="page-header-canvas"> <LoggingCheatSheet onClickExample={this.props.onClickExample} />
<div className="page-container">
<div className="page-header">
<nav>
<ul className={`gf-tabs ${customCss}`}>
{TAB_MENU_ITEMS.map((tab, idx) => {
const tabClasses = classNames({
'gf-tabs-link': true,
active: tab.id === active,
});
return (
<li className="gf-tabs-item" key={tab.id}>
<a className={tabClasses} onClick={() => this.onClickTab(tab.id)}>
<i className={tab.icon} />
{tab.text}
</a>
</li>
);
})}
</ul>
</nav>
</div>
</div>
</div>
<div className="page-container page-body">
{active === 'start' && <LoggingCheatSheet onClickExample={this.props.onClickExample} />}
</div>
</div> </div>
); );
} }
......
...@@ -21,7 +21,7 @@ const CHEAT_SHEET_ITEMS = [ ...@@ -21,7 +21,7 @@ const CHEAT_SHEET_ITEMS = [
export default (props: any) => ( export default (props: any) => (
<div> <div>
<h1>PromQL Cheat Sheet</h1> <h2>PromQL Cheat Sheet</h2>
{CHEAT_SHEET_ITEMS.map(item => ( {CHEAT_SHEET_ITEMS.map(item => (
<div className="cheat-sheet-item" key={item.expression}> <div className="cheat-sheet-item" key={item.expression}>
<div className="cheat-sheet-item__title">{item.title}</div> <div className="cheat-sheet-item__title">{item.title}</div>
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import PromCheatSheet from './PromCheatSheet'; import PromCheatSheet from './PromCheatSheet';
export default class PromStart extends PureComponent<any> { interface Props {
onClickExample: () => void;
}
export default class PromStart extends PureComponent<Props> {
render() { render() {
return ( return (
<div className="grafana-info-box"> <div className="grafana-info-box">
......
...@@ -218,7 +218,7 @@ $tab-border-color: $gray-5; ...@@ -218,7 +218,7 @@ $tab-border-color: $gray-5;
$search-shadow: 0 5px 30px 0 $gray-4; $search-shadow: 0 5px 30px 0 $gray-4;
$search-filter-box-bg: $gray-7; $search-filter-box-bg: $gray-7;
// ypeahead // Typeahead
$typeahead-shadow: 0 5px 10px 0 $gray-5; $typeahead-shadow: 0 5px 10px 0 $gray-5;
$typeahead-selected-bg: $gray-6; $typeahead-selected-bg: $gray-6;
$typeahead-selected-color: $yellow; $typeahead-selected-color: $yellow;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment