mirror of
https://github.com/grafana/grafana.git
synced 2025-09-27 23:43:39 +08:00

this is a fix-up PR that cleans up Explore Logging after the recent restructuring. - log results need to be merged since query transactions have been introduced - logging DS has its own language provider, query field, and start page (some of them based on prometheus components) - added loader animation to log viewer - removed logging logic from prometheus components
61 lines
1.6 KiB
TypeScript
61 lines
1.6 KiB
TypeScript
import React, { PureComponent } from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
import LoggingCheatSheet from './LoggingCheatSheet';
|
|
|
|
const TAB_MENU_ITEMS = [
|
|
{
|
|
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 });
|
|
};
|
|
|
|
render() {
|
|
const { active } = this.state;
|
|
const customCss = '';
|
|
|
|
return (
|
|
<div style={{ margin: '45px 0', border: '1px solid #ddd', borderRadius: 5 }}>
|
|
<div className="page-header-canvas">
|
|
<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 onClickQuery={this.props.onClickQuery} />}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
}
|