|
11 | 11 | </li>
|
12 | 12 | <li class="tight-form-item">
|
13 | 13 | <div class="dropdown">
|
14 |
| - <a class="pointer dropdown-toggle" data-toggle="dropdown" tabindex="1"> |
| 14 | + <a class="pointer dropdown-toggle" data-toggle="dropdown" tabindex="1"> |
15 | 15 | <i class="fa fa-bars"></i>
|
16 | 16 | </a>
|
17 | 17 | <ul class="dropdown-menu pull-right" role="menu">
|
|
22 | 22 | </ul>
|
23 | 23 | </div>
|
24 | 24 | </li>
|
| 25 | + |
25 | 26 | <li class="tight-form-item last">
|
26 | 27 | <a class="pointer" tabindex="1" ng-click="removeDataQuery(target)">
|
27 | 28 | <i class="fa fa-remove"></i>
|
|
40 | 41 | </li>
|
41 | 42 | </ul>
|
42 | 43 |
|
43 |
| - <input type="text" class="tight-form-clear-input" style="width: 80%" ng-model="target.query" give-focus="target.rawQuery" spellcheck='false' ng-model-onblur ng-change="get_data()" ng-show="target.rawQuery"/> |
| 44 | + <ul class="tight-form-list" ng-hide="target.rawQuery"> |
| 45 | + <li class="tight-form-item query-keyword" style="width: 75px"> |
| 46 | + FROM |
| 47 | + </li> |
| 48 | + <li> |
| 49 | + <metric-segment segment="measurementSegment" get-options="getMeasurements()" on-change="measurementChanged()"></metric-segment> |
| 50 | + </li> |
| 51 | + </ul> |
| 52 | + <div class="clearfix"></div> |
44 | 53 |
|
45 |
| - <ul class="tight-form-list" role="menu" ng-hide="target.rawQuery"> |
46 |
| - <li class="tight-form-item query-keyword" style="width: 75px;"> |
47 |
| - SELECT |
48 |
| - </li> |
49 |
| - <li class="dropdown" ng-repeat="field in target.fields"> |
50 |
| - <span influxdb-func-editor field="field" get-fields="getFields()" on-change="fieldChanged(field)" class="tight-form-item"> |
51 |
| - </span> |
| 54 | + <div style="padding: 10px" ng-if="target.rawQuery"> |
| 55 | + <textarea ng-model="target.query" rows="8" spellcheck="false" style="width: 100%; box-sizing: border-box;" ng-blur="get_data()"></textarea> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | + |
| 59 | + <div ng-hide="target.rawQuery"> |
| 60 | + <div class="tight-form"> |
| 61 | + <ul class="tight-form-list"> |
| 62 | + <li class="tight-form-item query-keyword tight-form-align" style="width: 75px;"> |
| 63 | + WHERE |
52 | 64 | </li>
|
53 |
| - <li> |
54 |
| - <metric-segment segment="addFieldSegment" get-options="getFieldSegments()" on-change="addField()"></metric-segment> |
| 65 | + <li ng-repeat="segment in tagSegments"> |
| 66 | + <metric-segment segment="segment" get-options="getTagsOrValues(segment, $index)" on-change="tagSegmentUpdated(segment, $index)"></metric-segment> |
55 | 67 | </li>
|
56 | 68 | </ul>
|
57 |
| - |
58 | 69 | <div class="clearfix"></div>
|
59 | 70 | </div>
|
60 | 71 |
|
61 |
| - <div class="tight-form" ng-hide="target.rawQuery"> |
| 72 | + <div class="tight-form" ng-repeat="field in target.fields"> |
62 | 73 | <ul class="tight-form-list">
|
63 | 74 | <li class="tight-form-item query-keyword tight-form-align" style="width: 75px;">
|
64 |
| - FROM |
| 75 | + <span ng-show="$index === 0">SELECT</span> |
| 76 | + </li> |
| 77 | + <li> |
| 78 | + <metric-segment-model property="field.func" get-options="getFunctions()" on-change="get_data()" css-class="tight-form-item-xlarge"></metric-segment> |
| 79 | + </li> |
| 80 | + <li> |
| 81 | + <metric-segment-model property="field.name" get-options="getFields()" on-change="get_data()" css-class="tight-form-item-large"></metric-segment> |
| 82 | + </li> |
| 83 | + <li> |
| 84 | + <input type="text" class="tight-form-clear-input text-center" style="width: 70px;" ng-model="field.mathExpr" spellcheck='false' placeholder="math expr" ng-blur="get_data()"> |
| 85 | + </li> |
| 86 | + <li class="tight-form-item query-keyword"> |
| 87 | + AS |
65 | 88 | </li>
|
66 | 89 | <li>
|
67 |
| - <metric-segment segment="measurementSegment" get-options="getMeasurements()" on-change="measurementChanged()"></metric-segment> |
| 90 | + <input type="text" class="tight-form-clear-input" style="width: 180px;" ng-model="field.asExpr" spellcheck='false' placeholder="as expr" ng-blur="get_data()"> |
68 | 91 | </li>
|
69 | 92 | </ul>
|
70 | 93 |
|
| 94 | + <ul class="tight-form-list pull-right"> |
| 95 | + <li class="tight-form-item last" ng-show="$index === 0"> |
| 96 | + <a class="pointer" ng-click="addSelect()"><i class="fa fa-plus"></i></a> |
| 97 | + </li> |
| 98 | + <li class="tight-form-item last" ng-show="target.fields.length > 1"> |
| 99 | + <a class="pointer" ng-click="removeSelect($index)"><i class="fa fa-minus"></i></a> |
| 100 | + </li> |
| 101 | + </ul> |
71 | 102 | <div class="clearfix"></div>
|
72 | 103 | </div>
|
73 | 104 |
|
74 |
| - <div class="tight-form" ng-hide="target.rawQuery"> |
| 105 | + <div class="tight-form" ng-repeat="groupBy in target.groupBy"> |
75 | 106 | <ul class="tight-form-list">
|
76 | 107 | <li class="tight-form-item query-keyword tight-form-align" style="width: 75px;">
|
77 |
| - WHERE |
| 108 | + <span ng-show="$index === 0">GROUP BY</span> |
| 109 | + </li> |
| 110 | + <li ng-if="groupBy.type === 'time'"> |
| 111 | + <span class="tight-form-item">time</span> |
| 112 | + <metric-segment-model property="groupBy.interval" get-options="getGroupByTimeIntervals()" on-change="get_data()"> |
| 113 | + </metric-segment> |
78 | 114 | </li>
|
| 115 | + <li ng-if="groupBy.type === 'tag'"> |
| 116 | + <metric-segment-model property="groupBy.key" get-options="getTagOptions()" on-change="get_data()"></metric-segment> |
| 117 | + </li> |
| 118 | + </ul> |
79 | 119 |
|
80 |
| - <li ng-repeat="segment in tagSegments"> |
81 |
| - <metric-segment segment="segment" get-options="getTagsOrValues(segment, $index)" on-change="tagSegmentUpdated(segment, $index)"></metric-segment> |
| 120 | + <ul class="tight-form-list pull-right"> |
| 121 | + <li class="tight-form-item last" ng-show="$index === 0"> |
| 122 | + <a class="pointer" ng-click="addGroupBy()"><i class="fa fa-plus"></i></a> |
| 123 | + </li> |
| 124 | + <li class="tight-form-item last" ng-show="$index > 0"> |
| 125 | + <a class="pointer" ng-click="removeGroupBy($index)"><i class="fa fa-minus"></i></a> |
82 | 126 | </li>
|
83 | 127 | </ul>
|
84 | 128 | <div class="clearfix"></div>
|
85 | 129 | </div>
|
86 | 130 |
|
87 | 131 | <div class="tight-form">
|
88 |
| - <ul class="tight-form-list" ng-hide="target.rawQuery"> |
89 |
| - <li class="tight-form-item query-keyword tight-form-align"> |
90 |
| - GROUP BY |
91 |
| - </li> |
92 |
| - |
93 |
| - <li class="tight-form-item"> |
94 |
| - time($interval) |
95 |
| - </li> |
96 |
| - |
97 |
| - <li ng-repeat="segment in groupBySegments"> |
98 |
| - <metric-segment segment="segment" get-options="getGroupByTagSegments(segment, 0)" on-change="groupByTagUpdated(segment, $index)"></metric-segment> |
99 |
| - </li> |
100 |
| - <li class="dropdown"> |
101 |
| - <a class="tight-form-item pointer" data-toggle="dropdown" bs-tooltip="'Insert missing values, important when stacking'" data-placement="right"> |
102 |
| - <span ng-show="target.fill"> |
103 |
| - fill ({{target.fill}}) |
104 |
| - </span> |
105 |
| - <span ng-show="!target.fill"> |
106 |
| - no fill |
107 |
| - </span> |
108 |
| - </a> |
109 |
| - <ul class="dropdown-menu"> |
110 |
| - <li><a ng-click="target.fill = ''">no fill</a></li> |
111 |
| - <li><a ng-click="target.fill = '0'">fill (0)</a></li> |
112 |
| - <li><a ng-click="target.fill = 'null'">fill (null)</a></li> |
113 |
| - <li><a ng-click="target.fill = 'none'">fill (none)</a></li> |
114 |
| - <li><a ng-click="target.fill = 'previous'">fill (previous)</a></li> |
115 |
| - </ul> |
116 |
| - </li> |
117 |
| - </ul> |
118 |
| - <ul class="tight-form-list pull-right"> |
119 |
| - <li class="tight-form-item"> |
120 |
| - Alias pattern |
| 132 | + <ul class="tight-form-list"> |
| 133 | + <li class="tight-form-item query-keyword tight-form-align" style="width: 75px;"> |
| 134 | + ALIAS BY |
121 | 135 | </li>
|
122 | 136 | <li>
|
123 |
| - <input type="text" class="input-medium tight-form-input" |
124 |
| - ng-model="target.alias" spellcheck='false' placeholder="alias" |
125 |
| - ng-model-onblur ng-change="get_data()"></input> |
| 137 | + <input type="text" class="tight-form-clear-input input-xlarge" ng-model="target.alias" spellcheck='false' placeholder="Naming pattern" ng-blur="get_data()"> |
126 | 138 | </li>
|
127 | 139 | </ul>
|
128 | 140 | <div class="clearfix"></div>
|
129 | 141 | </div>
|
130 | 142 |
|
131 | 143 | </div>
|
132 | 144 | </div>
|
133 |
| - |
|
0 commit comments