react panels wip
This commit is contained in:
1 parent
682c792dfb
commit
70c808130f
3 files changed
+31
-6
No files matched your search
@@ -19,8 +19,15 @@ interface PanelEditorTab {
|
||||
|
||||
@observer
|
||||
export class PanelEditor extends React.Component<PanelEditorProps, any> {
|
||||
tabs: PanelEditorTab[];
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.tabs = [
|
||||
{ id: 'queries', text: 'Queries', icon: 'fa fa-database' },
|
||||
{ id: 'viz', text: 'Visualization', icon: 'fa fa-line-chart' },
|
||||
];
|
||||
}
|
||||
|
||||
renderQueriesTab() {
|
||||
@@ -37,16 +44,12 @@ export class PanelEditor extends React.Component<PanelEditorProps, any> {
|
||||
|
||||
render() {
|
||||
const activeTab: string = store.view.query.get('tab') || 'queries';
|
||||
const tabs: PanelEditorTab[] = [
|
||||
{ id: 'queries', text: 'Queries', icon: 'fa fa-database' },
|
||||
{ id: 'viz', text: 'Visualization', icon: 'fa fa-line-chart' },
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="tabbed-view tabbed-view--panel-edit-new">
|
||||
<div className="tabbed-view-header">
|
||||
<ul className="gf-tabs">
|
||||
{tabs.map(tab => {
|
||||
{this.tabs.map(tab => {
|
||||
return <TabItem tab={tab} activeTab={activeTab} onClick={this.onChangeTab} key={tab.id} />;
|
||||
})}
|
||||
</ul>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import React, { Component, ComponentClass } from 'react';
|
||||
import _ from 'lodash';
|
||||
|
||||
export interface Props {
|
||||
type: string;
|
||||
queries: Query[];
|
||||
}
|
||||
|
||||
interface State {
|
||||
isLoading: boolean;
|
||||
timeSeries: TimeSeriesServerResponse[];
|
||||
}
|
||||
|
||||
export interface OriginalProps {
|
||||
data: TimeSeriesServerResponse[];
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
const DataPanel = (ComposedComponent: ComponentClass<OriginalProps & Props>) => {
|
||||
class Wrapper extends Component<Props, State> {}
|
||||
|
||||
return Wrapper;
|
||||
};
|
||||
@@ -110,7 +110,6 @@ function pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $
|
||||
let datasource = scope.target.datasource || scope.ctrl.panel.datasource;
|
||||
return datasourceSrv.get(datasource).then(ds => {
|
||||
scope.datasource = ds;
|
||||
console.log('scope', scope);
|
||||
|
||||
return importPluginModule(ds.meta.module).then(dsModule => {
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user