mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
53 lines
1.1 KiB
TypeScript
53 lines
1.1 KiB
TypeScript
import React, { PureComponent } from 'react';
|
|
|
|
import { getAngularLoader, AngularComponent } from 'app/core/services/AngularLoader';
|
|
import { EditorTabBody } from './EditorTabBody';
|
|
|
|
import { PanelModel } from '../panel_model';
|
|
import './../../panel/GeneralTabCtrl';
|
|
|
|
interface Props {
|
|
panel: PanelModel;
|
|
}
|
|
|
|
export class GeneralTab extends PureComponent<Props> {
|
|
element: any;
|
|
component: AngularComponent;
|
|
|
|
constructor(props) {
|
|
super(props);
|
|
}
|
|
|
|
componentDidMount() {
|
|
if (!this.element) {
|
|
return;
|
|
}
|
|
|
|
const { panel } = this.props;
|
|
|
|
const loader = getAngularLoader();
|
|
const template = '<panel-general-tab />';
|
|
const scopeProps = {
|
|
ctrl: {
|
|
panel: panel,
|
|
},
|
|
};
|
|
|
|
this.component = loader.load(this.element, scopeProps, template);
|
|
}
|
|
|
|
componentWillUnmount() {
|
|
if (this.component) {
|
|
this.component.destroy();
|
|
}
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<EditorTabBody heading="Panel Options" toolbarItems={[]}>
|
|
<div ref={element => (this.element = element)} />
|
|
</EditorTabBody>
|
|
);
|
|
}
|
|
}
|