mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
separate label in template from type
This commit is contained in:
parent
e93276b1f8
commit
3af4e4e0d6
@ -2,6 +2,7 @@ import _ from 'lodash';
|
||||
|
||||
export class SqlPartDef {
|
||||
type: string;
|
||||
label: string;
|
||||
params: any[];
|
||||
defaultParams: any[];
|
||||
renderer: any;
|
||||
@ -10,6 +11,7 @@ export class SqlPartDef {
|
||||
|
||||
constructor(options: any) {
|
||||
this.type = options.type;
|
||||
this.label = options.label;
|
||||
this.params = options.params;
|
||||
this.defaultParams = options.defaultParams;
|
||||
this.renderer = options.renderer;
|
||||
|
@ -4,7 +4,7 @@ import coreModule from 'app/core/core_module';
|
||||
|
||||
var template = `
|
||||
<div class="dropdown cascade-open">
|
||||
<a ng-click="showActionsMenu()" class="query-part-name pointer dropdown-toggle" data-toggle="dropdown">{{part.def.type}}</a>
|
||||
<a ng-click="showActionsMenu()" class="query-part-name pointer dropdown-toggle" data-toggle="dropdown">{{part.def.label}}</a>
|
||||
<span>(</span><span class="query-part-parameters"></span><span>)</span>
|
||||
<ul class="dropdown-menu">
|
||||
<li ng-repeat="action in partActions">
|
||||
|
@ -85,6 +85,7 @@ function addColumnStrategy(selectParts, partModel, query) {
|
||||
|
||||
register({
|
||||
type: 'column',
|
||||
label: 'Column:',
|
||||
addStrategy: addColumnStrategy,
|
||||
params: [{ type: 'column', dynamicLookup: true }],
|
||||
defaultParams: ['value'],
|
||||
@ -93,6 +94,7 @@ register({
|
||||
|
||||
register({
|
||||
type: 'aggregate',
|
||||
label: 'Aggregate:',
|
||||
addStrategy: replaceAggregationAddStrategy,
|
||||
params: [{name: 'name', type: 'string', dynamicLookup: true}],
|
||||
defaultParams: ['avg'],
|
||||
@ -101,6 +103,7 @@ register({
|
||||
|
||||
register({
|
||||
type: 'math',
|
||||
label: 'Math:',
|
||||
addStrategy: addMathStrategy,
|
||||
params: [{ name: 'expr', type: 'string' }],
|
||||
defaultParams: [' / 100'],
|
||||
@ -109,6 +112,7 @@ register({
|
||||
|
||||
register({
|
||||
type: 'alias',
|
||||
label: 'Alias:',
|
||||
addStrategy: addAliasStrategy,
|
||||
params: [{ name: 'name', type: 'string', quote: 'double' }],
|
||||
defaultParams: ['alias'],
|
||||
@ -118,6 +122,7 @@ register({
|
||||
|
||||
register({
|
||||
type: 'time',
|
||||
label: 'time',
|
||||
params: [
|
||||
{
|
||||
name: 'interval',
|
||||
|
Loading…
Reference in New Issue
Block a user