module.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <kibana-panel ng-controller='query' ng-init="init()" class="query-panel">
  2. <style>
  3. .short-query {
  4. display:inline-block;
  5. margin-right: 10px;
  6. }
  7. .begin-query {
  8. position:absolute;
  9. left:13px;
  10. top:5px;
  11. }
  12. .end-query {
  13. position:absolute;
  14. right:15px;
  15. top:5px;
  16. }
  17. .panel-query {
  18. padding-left: 35px !important;
  19. height: 31px !important;
  20. -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
  21. -moz-box-sizing: border-box; /* Firefox, other Gecko */
  22. box-sizing: border-box; /* Opera/IE 8+ */
  23. }
  24. .form-search:hover .has-remove {
  25. padding-left: 50px !important;
  26. }
  27. .remove-query {
  28. opacity: 0;
  29. }
  30. .last-query {
  31. padding-right: 45px !important;
  32. }
  33. .form-search:hover .remove-query {
  34. opacity: 1;
  35. }
  36. .query-panel .pins {
  37. text-decoration: underline;
  38. }
  39. .query-panel .pinned {
  40. margin-right: 5px;
  41. }
  42. </style>
  43. <label class="small">{{panel.label}}</label>
  44. <div ng-repeat="id in (unPinnedQueries = (querySrv.ids|pinnedQuery:false))" ng-class="{'short-query': unPinnedQueries.length>1}">
  45. <form class="form-search" style="position:relative;margin-bottom:5px;" ng-submit="refresh()">
  46. <span class="begin-query">
  47. <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>
  48. <i class="icon-remove-sign pointer remove-query" ng-show="unPinnedQueries.length>1" ng-click="querySrv.remove(id);refresh()"></i>
  49. </span>
  50. <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"/>
  51. <span class="end-query">
  52. <i class="icon-search pointer" ng-click="refresh()" ng-show="$last"></i>
  53. <i class="icon-plus pointer" ng-click="querySrv.set({})" ng-show="$last"></i>
  54. </span>
  55. </form>
  56. </div>
  57. <div style="display:inline-block" ng-repeat="id in querySrv.ids|pinnedQuery:true">
  58. <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>
  59. <span ng-show="panel.pinned" class="pinned badge">
  60. <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>
  61. </span>
  62. </div>
  63. <span style="display:inline-block" ng-show="unPinnedQueries.length == 0">
  64. <i class="icon-search pointer" ng-click="refresh()"></i>
  65. <i class="icon-plus pointer" ng-click="querySrv.set({})"></i>
  66. </span>
  67. </kibana-panel>