column_options.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <div class="edit-tab-with-sidemenu">
  2. <aside class="edit-sidemenu-aside">
  3. <ul class="edit-sidemenu">
  4. <li ng-repeat="style in editor.panel.styles" ng-class="{active: editor.activeStyleIndex === $index}">
  5. <a ng-click="editor.activeStyleIndex = $index" >{{style.pattern || 'New rule'}}</a>
  6. </li>
  7. <li>
  8. <a class="pointer" ng-click="editor.addColumnStyle()">
  9. <i class="fa fa-plus"></i>&nbsp;Add
  10. </a>
  11. </li>
  12. </ul>
  13. </aside>
  14. <div class="edit-tab-content" ng-repeat="style in editor.panel.styles" ng-if="editor.activeStyleIndex === $index">
  15. <div class="section gf-form-group">
  16. <h5 class="section-heading">Options</h5>
  17. <div class="gf-form-inline">
  18. <div class="gf-form">
  19. <label class="gf-form-label width-13">Apply to columns named</label>
  20. <input type="text" placeholder="Name or regex" class="gf-form-input width-13" ng-model="style.pattern" bs-tooltip="'Specify regex using /my.*regex/ syntax'" bs-typeahead="editor.getColumnNames" ng-blur="editor.render()" data-min-length=0 data-items=100 ng-model-onblur data-placement="right">
  21. </div>
  22. </div>
  23. <div class="gf-form" ng-if="style.type !== 'hidden'">
  24. <label class="gf-form-label width-13">Column Header</label>
  25. <input type="text" class="gf-form-input width-13" ng-model="style.alias" ng-change="editor.render()" ng-model-onblur placeholder="Override header label">
  26. </div>
  27. </div>
  28. <div class="section gf-form-group">
  29. <h5 class="section-heading">Type</h5>
  30. <div class="gf-form">
  31. <label class="gf-form-label width-8">Type</label>
  32. <div class="gf-form-select-wrapper width-10">
  33. <select class="gf-form-input" ng-model="style.type" ng-options="c.value as c.text for c in editor.columnTypes" ng-change="editor.render()"></select>
  34. </div>
  35. </div>
  36. <div class="gf-form" ng-if="style.type === 'date'">
  37. <label class="gf-form-label width-8">Date Format</label>
  38. <metric-segment-model property="style.dateFormat" options="editor.dateFormats" on-change="editor.render()" custom="true"></metric-segment-model>
  39. </div>
  40. <div ng-if="style.type === 'string'">
  41. <gf-form-switch class="gf-form" label-class="width-8" ng-if="style.type === 'string'" label="Sanitize HTML" checked="style.sanitize" change="editor.render()"></gf-form-switch>
  42. </div>
  43. <div ng-if="style.type === 'number'">
  44. <div class="gf-form">
  45. <label class="gf-form-label width-8">Unit</label>
  46. <div class="gf-form-dropdown-typeahead width-10" ng-model="style.unit" dropdown-typeahead2="editor.unitFormats" dropdown-typeahead-on-select="editor.setUnitFormat(style, $subItem)"></div>
  47. </div>
  48. <div class="gf-form">
  49. <label class="gf-form-label width-8">Decimals</label>
  50. <input type="number" class="gf-form-input width-4" data-placement="right" ng-model="style.decimals" ng-change="editor.render()" ng-model-onblur>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="section gf-form-group" ng-if="style.type === 'number'">
  55. <h5 class="section-heading">Thresholds</h5>
  56. <div class="gf-form">
  57. <label class="gf-form-label width-8">Thresholds<tip>Comma separated values</tip></label>
  58. <input type="text" class="gf-form-input width-10" ng-model="style.thresholds" placeholder="50,80" ng-blur="editor.render()" array-join ng-model-onblur>
  59. </div>
  60. <div class="gf-form">
  61. <label class="gf-form-label width-8">Color Mode</label>
  62. <div class="gf-form-select-wrapper width-10">
  63. <select class="gf-form-input" ng-model="style.colorMode" ng-options="c.value as c.text for c in editor.colorModes" ng-change="editor.render()"></select>
  64. </div>
  65. </div>
  66. <div class="gf-form">
  67. <label class="gf-form-label width-8">Colors</label>
  68. <span class="gf-form-label">
  69. <spectrum-picker ng-model="style.colors[0]" ng-change="editor.render()"></spectrum-picker>
  70. </span>
  71. <span class="gf-form-label">
  72. <spectrum-picker ng-model="style.colors[1]" ng-change="editor.render()"></spectrum-picker>
  73. </span>
  74. <span class="gf-form-label">
  75. <spectrum-picker ng-model="style.colors[2]" ng-change="editor.render()"></spectrum-picker>
  76. </span>
  77. <div class="gf-form-label">
  78. <a class="pointer" ng-click="editor.invertColorOrder($index)">Invert</a>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="clearfix"></div>
  83. <button class="btn btn-danger btn-small" ng-click="editor.removeColumnStyle(style)">
  84. <i class="fa fa-trash"></i> Remove Rule
  85. </button>
  86. <br />
  87. <br />
  88. </div>