|
|
@@ -1,11 +1,14 @@
|
|
|
// Libraries
|
|
|
import React, { Component } from 'react';
|
|
|
+import config from 'app/core/config';
|
|
|
|
|
|
// Components
|
|
|
import PageHeader from '../PageHeader/PageHeader';
|
|
|
+import Footer from '../Footer/Footer';
|
|
|
import PageContents from './PageContents';
|
|
|
import { CustomScrollbar } from '@grafana/ui';
|
|
|
|
|
|
+
|
|
|
interface Props {
|
|
|
title?: string;
|
|
|
children: JSX.Element[] | JSX.Element;
|
|
|
@@ -14,15 +17,11 @@ interface Props {
|
|
|
class Page extends Component<Props> {
|
|
|
private bodyClass = 'is-react';
|
|
|
private body = document.getElementsByTagName('body')[0];
|
|
|
- private footer = document.getElementsByClassName('footer')[0].cloneNode(true);
|
|
|
- private scrollbarElementRef = React.createRef<HTMLDivElement>();
|
|
|
static Header = PageHeader;
|
|
|
static Contents = PageContents;
|
|
|
|
|
|
-
|
|
|
componentDidMount() {
|
|
|
this.body.classList.add(this.bodyClass);
|
|
|
- this.copyFooter();
|
|
|
this.updateTitle();
|
|
|
}
|
|
|
|
|
|
@@ -41,17 +40,19 @@ class Page extends Component<Props> {
|
|
|
document.title = title ? title + ' - Grafana' : 'Grafana';
|
|
|
}
|
|
|
|
|
|
- copyFooter = () => {
|
|
|
- const c = this.scrollbarElementRef.current;
|
|
|
- c.append(this.footer);
|
|
|
- }
|
|
|
-
|
|
|
render() {
|
|
|
+ const { buildInfo } = config;
|
|
|
return (
|
|
|
<div className="page-scrollbar-wrapper">
|
|
|
<CustomScrollbar autoHeightMin={'100%'}>
|
|
|
- <div className="page-scrollbar-content" ref={this.scrollbarElementRef}>
|
|
|
+ <div className="page-scrollbar-content">
|
|
|
{this.props.children}
|
|
|
+ <Footer
|
|
|
+ appName="Grafana"
|
|
|
+ buildCommit={buildInfo.commit}
|
|
|
+ buildVersion={buildInfo.version}
|
|
|
+ newGrafanaVersion={buildInfo.latestVersion}
|
|
|
+ newGrafanaVersionExists={buildInfo.hasUpdate} />
|
|
|
</div>
|
|
|
</CustomScrollbar>
|
|
|
</div>
|