Create file for tempVars types, move tempVar types there, and update imports
parent
93d09f5c12
commit
a15a950992
|
@ -6,7 +6,7 @@ import uuid from 'uuid'
|
|||
|
||||
import Authorized, {EDITOR_ROLE} from 'src/auth/Authorized'
|
||||
import TemplateControlDropdown from 'src/dashboards/components/TemplateControlDropdown'
|
||||
import {Template} from 'src/types/dashboard'
|
||||
import {Template} from 'src/types/tempVars'
|
||||
|
||||
interface Props {
|
||||
meRole: string
|
||||
|
|
|
@ -3,7 +3,7 @@ import React, {SFC} from 'react'
|
|||
import Dropdown from 'src/shared/components/Dropdown'
|
||||
import {calculateDropdownWidth} from 'src/dashboards/constants/templateControlBar'
|
||||
import {isUserAuthorized, EDITOR_ROLE} from 'src/auth/Authorized'
|
||||
import {Template} from 'src/types/dashboard'
|
||||
import {Template} from 'src/types/tempVars'
|
||||
|
||||
interface Props {
|
||||
template: Template
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import _ from 'lodash'
|
||||
|
||||
import {TEMPLATE_VARIABLE_QUERIES} from 'src/dashboards/constants'
|
||||
import {Template, TemplateQuery} from 'src/types/dashboard'
|
||||
import {URLQueries} from 'src/types'
|
||||
import {Template, TemplateQuery, URLQueries} from 'src/types/tempVars'
|
||||
|
||||
interface PartialTemplateWithQuery {
|
||||
query: string
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {QueryConfig} from 'src/types'
|
||||
import {ColorString} from 'src/types/colors'
|
||||
import {Template} from 'src/types/tempVars'
|
||||
|
||||
interface Axis {
|
||||
bounds: [string, string]
|
||||
|
@ -96,32 +97,6 @@ export enum CellType {
|
|||
Guide = 'guide',
|
||||
}
|
||||
|
||||
export interface TemplateValue {
|
||||
value: string
|
||||
type: string
|
||||
selected: boolean
|
||||
}
|
||||
|
||||
export interface TemplateQuery {
|
||||
command: string
|
||||
db: string
|
||||
database?: string
|
||||
rp?: string
|
||||
measurement: string
|
||||
tagKey: string
|
||||
fieldKey: string
|
||||
influxql: string
|
||||
}
|
||||
|
||||
export interface Template {
|
||||
id: string
|
||||
tempVar: string
|
||||
values: TemplateValue[]
|
||||
type: string
|
||||
label: string
|
||||
query?: TemplateQuery
|
||||
}
|
||||
|
||||
interface DashboardLinks {
|
||||
self: string
|
||||
cells: string
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import {LayoutCell, LayoutQuery} from './layouts'
|
||||
import {Service, NewService} from './services'
|
||||
import {AuthLinks, Organization, Role, User, Me} from './auth'
|
||||
import {Template, Cell, CellQuery, Legend, Axes, Dashboard} from './dashboard'
|
||||
import {Cell, CellQuery, Legend, Axes, Dashboard} from './dashboard'
|
||||
import {Template, URLQueries} from './tempVars'
|
||||
import {
|
||||
GroupBy,
|
||||
Query,
|
||||
|
@ -20,7 +21,7 @@ import {
|
|||
} from './query'
|
||||
import {AlertRule, Kapacitor, Task} from './kapacitor'
|
||||
import {Source, SourceLinks} from './sources'
|
||||
import {DropdownAction, DropdownItem, URLQueries} from './shared'
|
||||
import {DropdownAction, DropdownItem} from './shared'
|
||||
import {
|
||||
Notification,
|
||||
NotificationFunc,
|
||||
|
|
|
@ -16,7 +16,3 @@ export interface PageSection {
|
|||
component: ReactNode
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export interface URLQueries {
|
||||
[key: string]: string
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
export interface TemplateValue {
|
||||
value: string
|
||||
type: string
|
||||
selected: boolean
|
||||
}
|
||||
|
||||
export interface TemplateQuery {
|
||||
command: string
|
||||
db: string
|
||||
database?: string
|
||||
rp?: string
|
||||
measurement: string
|
||||
tagKey: string
|
||||
fieldKey: string
|
||||
influxql: string
|
||||
}
|
||||
|
||||
export interface Template {
|
||||
id: string
|
||||
tempVar: string
|
||||
values: TemplateValue[]
|
||||
type: string
|
||||
label: string
|
||||
query?: TemplateQuery
|
||||
}
|
||||
|
||||
export interface URLQueries {
|
||||
[key: string]: string
|
||||
}
|
Loading…
Reference in New Issue