Display user defined functions
parent
a7c7945042
commit
5e35865888
|
@ -39,7 +39,7 @@ export default class VariableName extends PureComponent<Props, State> {
|
||||||
const {name} = this.props
|
const {name} = this.props
|
||||||
const split = name.split('=')
|
const split = name.split('=')
|
||||||
const varName = split[0].substring(0, split[0].length - 1)
|
const varName = split[0].substring(0, split[0].length - 1)
|
||||||
const varValue = split[1].substring(1)
|
const varValue = this.props.name.replace(/^[^=]+=/, '')
|
||||||
|
|
||||||
const valueIsString = varValue.endsWith('"')
|
const valueIsString = varValue.endsWith('"')
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ export class IFQLPage extends PureComponent<Props, State> {
|
||||||
ast: null,
|
ast: null,
|
||||||
data: 'Hit "Get Data!" or Ctrl + Enter to run your script',
|
data: 'Hit "Get Data!" or Ctrl + Enter to run your script',
|
||||||
suggestions: [],
|
suggestions: [],
|
||||||
script: `tele = from(db: "telegraf")
|
script: `fil = (r) => r._measurement == "cpu"
|
||||||
tele |> sum()`,
|
tele = from(db: "telegraf") |> filter(fn: fil) |> range(start: -1m) |> sum()`,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue