mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 01:16:31 -06:00
67 lines
2.8 KiB
HTML
67 lines
2.8 KiB
HTML
<kibana-panel ng-controller='query' ng-init="init()" class="query-panel">
|
|
<style>
|
|
.short-query {
|
|
display:inline-block;
|
|
margin-right: 10px;
|
|
}
|
|
.begin-query {
|
|
position:absolute;
|
|
left:13px;
|
|
top:5px;
|
|
}
|
|
.end-query {
|
|
position:absolute;
|
|
right:15px;
|
|
top:5px;
|
|
}
|
|
.panel-query {
|
|
padding-left: 35px !important;
|
|
height: 31px !important;
|
|
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
|
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
|
box-sizing: border-box; /* Opera/IE 8+ */
|
|
}
|
|
.form-search:hover .has-remove {
|
|
padding-left: 50px !important;
|
|
}
|
|
.remove-query {
|
|
opacity: 0;
|
|
}
|
|
.last-query {
|
|
padding-right: 45px !important;
|
|
}
|
|
.form-search:hover .remove-query {
|
|
opacity: 1;
|
|
}
|
|
.query-panel .pins {
|
|
text-decoration: underline;
|
|
}
|
|
.query-panel .pinned {
|
|
margin-right: 5px;
|
|
}
|
|
</style>
|
|
<label class="small">{{panel.label}}</label>
|
|
<div ng-repeat="id in (unPinnedQueries = (querySrv.ids|pinnedQuery:false))" ng-class="{'short-query': unPinnedQueries.length>1}">
|
|
<form class="form-search" style="position:relative;margin-bottom:5px;" ng-submit="refresh()">
|
|
<span class="begin-query">
|
|
<i class="icon-circle pointer" data-unique="1" bs-popover="'panels/query/meta.html'" data-placement="right" ng-style="{color: querySrv.list[id].color}"></i>
|
|
<i class="icon-remove-sign pointer remove-query" ng-show="unPinnedQueries.length>1" ng-click="querySrv.remove(id);refresh()"></i>
|
|
</span>
|
|
<input class="search-query panel-query" ng-class="{'input-block-level': unPinnedQueries.length==1,'last-query': $last,'has-remove': unPinnedQueries.length>1}" bs-typeahead="panel.history" data-min-length=0 data-items=100 type="text" ng-model="querySrv.list[id].query"/>
|
|
<span class="end-query">
|
|
<i class="icon-search pointer" ng-click="refresh()" ng-show="$last"></i>
|
|
<i class="icon-plus pointer" ng-click="querySrv.set({})" ng-show="$last"></i>
|
|
</span>
|
|
</form>
|
|
</div>
|
|
<div style="display:inline-block" ng-repeat="id in querySrv.ids|pinnedQuery:true">
|
|
<span class="pointer" ng-show="$first" ng-click="panel.pinned = !panel.pinned"><small class="pins">Pinned</small> <i ng-class="{'icon-caret-right':panel.pinned,'icon-caret-left':!panel.pinned}"></i></span>
|
|
<span ng-show="panel.pinned" class="pinned badge">
|
|
<i class="icon-circle pointer" ng-style="{color: querySrv.list[id].color}" data-unique="1" bs-popover="'panels/query/meta.html'"></i><span bs-tooltip="querySrv.list[id].query"> {{querySrv.list[id].alias || querySrv.list[id].query}}</span>
|
|
</span>
|
|
</div>
|
|
<span style="display:inline-block" ng-show="unPinnedQueries.length == 0">
|
|
<i class="icon-search pointer" ng-click="refresh()"></i>
|
|
<i class="icon-plus pointer" ng-click="querySrv.set({})"></i>
|
|
</span>
|
|
</kibana-panel> |