mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
grid: need to find a way to add angular component inside react
This commit is contained in:
parent
6cd2624caf
commit
63bf2a0278
@ -2,6 +2,7 @@ import React from 'react';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import ReactGridLayout from 'react-grid-layout';
|
||||
import {DashboardModel} from '../model';
|
||||
import {DashboardPanel} from './DashboardPanel';
|
||||
import sizeMe from 'react-sizeme';
|
||||
|
||||
const COLUMN_COUNT = 24;
|
||||
@ -68,14 +69,7 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
|
||||
for (let panel of this.props.dashboard.panels) {
|
||||
panelElements.push(
|
||||
<div key={panel.id.toString()} className="panel">
|
||||
<div className="panel-container">
|
||||
<div className="panel-header grid-drag-handle">
|
||||
<div className="panel-title-container">{panel.type}</div>
|
||||
</div>
|
||||
<div className="panel-content">
|
||||
{panel.title} - {panel.type}
|
||||
</div>
|
||||
</div>
|
||||
<DashboardPanel panel={panel} />
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
24
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
Normal file
24
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import React from 'react';
|
||||
|
||||
export interface DashboardPanelProps {
|
||||
panel: any;
|
||||
}
|
||||
|
||||
export class DashboardPanel extends React.Component<DashboardPanelProps, any> {
|
||||
private element: any;
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div ref={element => this.element = element} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
import coreModule from 'app/core/core';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user