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 Authorized, {EDITOR_ROLE} from 'src/auth/Authorized'
|
||||||
import TemplateControlDropdown from 'src/dashboards/components/TemplateControlDropdown'
|
import TemplateControlDropdown from 'src/dashboards/components/TemplateControlDropdown'
|
||||||
import {Template} from 'src/types/dashboard'
|
import {Template} from 'src/types/tempVars'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
meRole: string
|
meRole: string
|
||||||
|
|
|
@ -3,7 +3,7 @@ import React, {SFC} from 'react'
|
||||||
import Dropdown from 'src/shared/components/Dropdown'
|
import Dropdown from 'src/shared/components/Dropdown'
|
||||||
import {calculateDropdownWidth} from 'src/dashboards/constants/templateControlBar'
|
import {calculateDropdownWidth} from 'src/dashboards/constants/templateControlBar'
|
||||||
import {isUserAuthorized, EDITOR_ROLE} from 'src/auth/Authorized'
|
import {isUserAuthorized, EDITOR_ROLE} from 'src/auth/Authorized'
|
||||||
import {Template} from 'src/types/dashboard'
|
import {Template} from 'src/types/tempVars'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
template: Template
|
template: Template
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
|
||||||
import {TEMPLATE_VARIABLE_QUERIES} from 'src/dashboards/constants'
|
import {TEMPLATE_VARIABLE_QUERIES} from 'src/dashboards/constants'
|
||||||
import {Template, TemplateQuery} from 'src/types/dashboard'
|
import {Template, TemplateQuery, URLQueries} from 'src/types/tempVars'
|
||||||
import {URLQueries} from 'src/types'
|
|
||||||
|
|
||||||
interface PartialTemplateWithQuery {
|
interface PartialTemplateWithQuery {
|
||||||
query: string
|
query: string
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {QueryConfig} from 'src/types'
|
import {QueryConfig} from 'src/types'
|
||||||
import {ColorString} from 'src/types/colors'
|
import {ColorString} from 'src/types/colors'
|
||||||
|
import {Template} from 'src/types/tempVars'
|
||||||
|
|
||||||
interface Axis {
|
interface Axis {
|
||||||
bounds: [string, string]
|
bounds: [string, string]
|
||||||
|
@ -96,32 +97,6 @@ export enum CellType {
|
||||||
Guide = 'guide',
|
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 {
|
interface DashboardLinks {
|
||||||
self: string
|
self: string
|
||||||
cells: string
|
cells: string
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import {LayoutCell, LayoutQuery} from './layouts'
|
import {LayoutCell, LayoutQuery} from './layouts'
|
||||||
import {Service, NewService} from './services'
|
import {Service, NewService} from './services'
|
||||||
import {AuthLinks, Organization, Role, User, Me} from './auth'
|
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 {
|
import {
|
||||||
GroupBy,
|
GroupBy,
|
||||||
Query,
|
Query,
|
||||||
|
@ -20,7 +21,7 @@ import {
|
||||||
} from './query'
|
} from './query'
|
||||||
import {AlertRule, Kapacitor, Task} from './kapacitor'
|
import {AlertRule, Kapacitor, Task} from './kapacitor'
|
||||||
import {Source, SourceLinks} from './sources'
|
import {Source, SourceLinks} from './sources'
|
||||||
import {DropdownAction, DropdownItem, URLQueries} from './shared'
|
import {DropdownAction, DropdownItem} from './shared'
|
||||||
import {
|
import {
|
||||||
Notification,
|
Notification,
|
||||||
NotificationFunc,
|
NotificationFunc,
|
||||||
|
|
|
@ -16,7 +16,3 @@ export interface PageSection {
|
||||||
component: ReactNode
|
component: ReactNode
|
||||||
enabled: boolean
|
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