forked from doitintl/bigquery-grafana
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add macros autocomplete for code editor (#217)
* Feat: Add macros autocomplete for code editor * Add directly instead
- Loading branch information
1 parent
19c4cf2
commit 51b9c74
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ | |
"TINYINT", | ||
"tokenprovider", | ||
"typecheck", | ||
"UNIXTIME", | ||
"uuidv", | ||
"vectorator" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { MacroType } from '@grafana/experimental'; | ||
|
||
export const MACROS = [ | ||
{ | ||
id: '$__timeFilter(dateColumn)', | ||
name: '$__timeFilter(dateColumn)', | ||
text: '$__timeFilter', | ||
args: ['dateColumn'], | ||
type: MacroType.Filter, | ||
description: | ||
'Will be replaced by a time range filter using the specified column name. For example, dateColumn BETWEEN FROM_UNIXTIME(1494410783) AND FROM_UNIXTIME(1494410983)', | ||
}, | ||
{ | ||
id: '$__timeFrom()', | ||
name: '$__timeFrom()', | ||
text: '$__timeFrom', | ||
args: [], | ||
type: MacroType.Filter, | ||
description: | ||
'Will be replaced by the start of the currently active time selection. For example, FROM_UNIXTIME(1494410783)', | ||
}, | ||
{ | ||
id: '$__timeTo()', | ||
name: '$__timeTo()', | ||
text: '$__timeTo', | ||
args: [], | ||
type: MacroType.Filter, | ||
description: | ||
'Will be replaced by the end of the currently active time selection. For example, FROM_UNIXTIME(1494410983)', | ||
}, | ||
{ | ||
id: "$__timeGroup(dateColumn, '5m')", | ||
name: "$__timeGroup(dateColumn, '5m')", | ||
text: '$__timeGroup', | ||
args: ['dateColumn', "'5m'"], | ||
type: MacroType.Value, | ||
description: | ||
'Will be replaced by an expression usable in GROUP BY clause. For example, *cast(cast(UNIX_TIMESTAMP(dateColumn)/(300) as signed)*300 as signed),*', | ||
}, | ||
]; |