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 {
|
export class SqlPartDef {
|
||||||
type: string;
|
type: string;
|
||||||
|
style: string;
|
||||||
label: string;
|
label: string;
|
||||||
params: any[];
|
params: any[];
|
||||||
defaultParams: any[];
|
defaultParams: any[];
|
||||||
|
wrapOpen: string;
|
||||||
|
wrapClose: string;
|
||||||
renderer: any;
|
renderer: any;
|
||||||
category: any;
|
category: any;
|
||||||
addStrategy: any;
|
addStrategy: any;
|
||||||
|
|
||||||
constructor(options: any) {
|
constructor(options: any) {
|
||||||
this.type = options.type;
|
this.type = options.type;
|
||||||
|
if (options.label) {
|
||||||
this.label = 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.params = options.params;
|
||||||
this.defaultParams = options.defaultParams;
|
this.defaultParams = options.defaultParams;
|
||||||
this.renderer = options.renderer;
|
this.renderer = options.renderer;
|
||||||
|
@ -5,7 +5,7 @@ import coreModule from 'app/core/core_module';
|
|||||||
var template = `
|
var template = `
|
||||||
<div class="dropdown cascade-open">
|
<div class="dropdown cascade-open">
|
||||||
<a ng-click="showActionsMenu()" class="query-part-name pointer dropdown-toggle" data-toggle="dropdown">{{part.def.label}}</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>
|
<span>{{part.def.wrapOpen}}</span><span class="query-part-parameters"></span><span>{{part.def.wrapClose}}</span>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li ng-repeat="action in partActions">
|
<li ng-repeat="action in partActions">
|
||||||
<a ng-click="triggerPartAction(action)">{{action.text}}</a>
|
<a ng-click="triggerPartAction(action)">{{action.text}}</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user