Moved plugin types to @grafana/ui

This commit is contained in:
Torkel Ödegaard 2019-01-17 17:37:34 +01:00
parent a201c76c5f
commit 4fc9d794ca
8 changed files with 73 additions and 58 deletions

View File

@ -18,3 +18,54 @@ export interface PluginExports {
PanelDefaults?: any; PanelDefaults?: any;
} }
export interface PluginMeta {
id: string;
name: string;
info: PluginMetaInfo;
includes: PluginInclude[];
// Datasource-specific
metrics?: boolean;
tables?: boolean;
logs?: boolean;
explore?: boolean;
annotations?: boolean;
mixed?: boolean;
hasQueryHelp?: boolean;
queryOptions?: PluginMetaQueryOptions;
}
interface PluginMetaQueryOptions {
cacheTimeout?: boolean;
maxDataPoints?: boolean;
minInterval?: boolean;
}
export interface PluginInclude {
type: string;
name: string;
path: string;
}
interface PluginMetaInfoLink {
name: string;
url: string;
}
export interface PluginMetaInfo {
author: {
name: string;
url?: string;
};
description: string;
links: PluginMetaInfoLink[];
logos: {
large: string;
small: string;
};
screenshots: any[];
updated: string;
version: string;
}

View File

@ -1,4 +1,5 @@
import { DataSource, NavModel, NavModelItem, PluginMeta } from 'app/types'; import { DataSource, NavModel, NavModelItem } from 'app/types';
import { PluginMeta } from '@grafana/ui/src/types';
import config from 'app/core/config'; import config from 'app/core/config';
export function buildNavModel(dataSource: DataSource, pluginMeta: PluginMeta): NavModelItem { export function buildNavModel(dataSource: DataSource, pluginMeta: PluginMeta): NavModelItem {

View File

@ -1,5 +1,6 @@
import _ from 'lodash'; import _ from 'lodash';
import { DataSource, PluginMeta, NavModel } from 'app/types'; import { DataSource, NavModel } from 'app/types';
import { PluginMeta } from '@grafana/ui/src/types';
import config from 'app/core/config'; import config from 'app/core/config';
export function buildNavModel(ds: DataSource, plugin: PluginMeta, currentPage: string): NavModel { export function buildNavModel(ds: DataSource, plugin: PluginMeta, currentPage: string): NavModel {

View File

@ -2,7 +2,8 @@ import _ from 'lodash';
import * as dateMath from 'app/core/utils/datemath'; import * as dateMath from 'app/core/utils/datemath';
import { LogsStream, LogsModel, makeSeriesForLogs } from 'app/core/logs_model'; import { LogsStream, LogsModel, makeSeriesForLogs } from 'app/core/logs_model';
import { PluginMeta, DataQuery } from 'app/types'; import { DataQuery } from 'app/types';
import { PluginMeta } from '@grafana/ui/src/types';
import { addLabelToSelector } from 'app/plugins/datasource/prometheus/add_label_to_query'; import { addLabelToSelector } from 'app/plugins/datasource/prometheus/add_label_to_query';
import LanguageProvider from './language_provider'; import LanguageProvider from './language_provider';

View File

@ -0,0 +1,12 @@
import React, { PureComponent } from 'react';
interface Props {
}
export class QueryEditor extends PureComponent<Props> {
render() {
return (
<h2>Test data</h2>
);
}
}

View File

@ -1,6 +1,6 @@
import { LayoutMode } from '../core/components/LayoutSelector/LayoutSelector'; import { LayoutMode } from '../core/components/LayoutSelector/LayoutSelector';
import { Plugin, PluginMeta } from './plugins'; import { Plugin } from './plugins';
import { PluginExports } from '@grafana/ui'; import { PluginExports, PluginMeta } from '@grafana/ui/src/types';
export interface DataSource { export interface DataSource {
id: number; id: number;

View File

@ -1,4 +1,4 @@
import { PluginExports } from '@grafana/ui/src/types'; import { PluginExports, PluginMetaInfo } from '@grafana/ui/src/types';
export interface PanelPlugin { export interface PanelPlugin {
id: string; id: string;
@ -11,56 +11,6 @@ export interface PanelPlugin {
exports?: PluginExports; exports?: PluginExports;
} }
interface PluginMetaQueryOptions {
cacheTimeout?: boolean;
maxDataPoints?: boolean;
minInterval?: boolean;
}
export interface PluginMeta {
id: string;
name: string;
info: PluginMetaInfo;
includes: PluginInclude[];
// Datasource-specific
metrics?: boolean;
tables?: boolean;
logs?: boolean;
explore?: boolean;
annotations?: boolean;
mixed?: boolean;
hasQueryHelp?: boolean;
queryOptions?: PluginMetaQueryOptions;
}
export interface PluginInclude {
type: string;
name: string;
path: string;
}
interface PluginMetaInfoLink {
name: string;
url: string;
}
export interface PluginMetaInfo {
author: {
name: string;
url?: string;
};
description: string;
links: PluginMetaInfoLink[];
logos: {
large: string;
small: string;
};
screenshots: any[];
updated: string;
version: string;
}
export interface Plugin { export interface Plugin {
defaultNavUrl: string; defaultNavUrl: string;
enabled: boolean; enabled: boolean;

View File

@ -1,5 +1,4 @@
import { PluginMeta } from './plugins'; import { TimeSeries, TimeRange, RawTimeRange, PluginExports, PluginMeta } from '@grafana/ui/src/types';
import { TimeSeries, TimeRange, RawTimeRange, PluginExports } from '@grafana/ui';
export interface DataQueryResponse { export interface DataQueryResponse {
data: TimeSeries[]; data: TimeSeries[];