mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
make param wrapper configurable
This commit is contained in:
parent
a5bcd8eac0
commit
067bfa3f72
@ -2,16 +2,31 @@ import _ from 'lodash';
|
||||
|
||||
export class SqlPartDef {
|
||||
type: string;
|
||||
style: string;
|
||||
label: string;
|
||||
params: any[];
|
||||
defaultParams: any[];
|
||||
wrapOpen: string;
|
||||
wrapClose: string;
|
||||
renderer: any;
|
||||
category: any;
|
||||
addStrategy: any;
|
||||
|
||||
constructor(options: any) {
|
||||
this.type = options.type;
|
||||
this.label = options.label;
|
||||
if (options.label) {
|
||||
this.label = options.label;
|
||||
} else {
|
||||
this.label = this.type[0].toUpperCase() + this.type.substring(1) + ':';
|
||||
}
|
||||
this.style = options.style;
|
||||
if (this.style === "function") {
|
||||
this.wrapOpen = "(";
|
||||
this.wrapClose = ")";
|
||||
} else {
|
||||
this.wrapOpen = " ";
|
||||
this.wrapClose = " ";
|
||||
}
|
||||
this.params = options.params;
|
||||
this.defaultParams = options.defaultParams;
|
||||
this.renderer = options.renderer;
|
||||
|
@ -5,7 +5,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.label}}</a>
|
||||
<span>(</span><span class="query-part-parameters"></span><span>)</span>
|
||||
<span>{{part.def.wrapOpen}}</span><span class="query-part-parameters"></span><span>{{part.def.wrapClose}}</span>
|
||||
<ul class="dropdown-menu">
|
||||
<li ng-repeat="action in partActions">
|
||||
<a ng-click="triggerPartAction(action)">{{action.text}}</a>
|
||||
|
Loading…
Reference in New Issue
Block a user