Commit fee44d83 by Torkel Ödegaard

Small timepicker angular binding perf improvement

parent d70c81f0
...@@ -14,6 +14,7 @@ function (angular, $, config, _) { ...@@ -14,6 +14,7 @@ function (angular, $, config, _) {
$scope, $rootScope, dashboardKeybindings, filterSrv, dashboard, panelMoveSrv, timer) { $scope, $rootScope, dashboardKeybindings, filterSrv, dashboard, panelMoveSrv, timer) {
$scope.editor = { index: 0 }; $scope.editor = { index: 0 };
$scope.panelNames = config.panels;
$scope.init = function() { $scope.init = function() {
$scope.availablePanels = config.panels; $scope.availablePanels = config.panels;
......
<div ng-controller='text' ng-init="init()" style="min-height:{{panel.height || row.height}}" ng-dblclick="openEditor()"> <div ng-controller='text' ng-init="init()" style="min-height:{{panel.height || row.height}}">
<p ng-bind-html="content"> <p ng-bind-html="content">
</p> </p>
</div> </div>
...@@ -8,5 +8,11 @@ ...@@ -8,5 +8,11 @@
<label class="small">Auto-refresh options <small>comma seperated</small></label> <label class="small">Auto-refresh options <small>comma seperated</small></label>
<input type="text" array-join class="input-xlarge" ng-model="panel.refresh_intervals"> <input type="text" array-join class="input-xlarge" ng-model="panel.refresh_intervals">
</div> </div>
<p>
<br>
<i class="icon-info-sign"></i>
For these changes to fully take effect save and reload the dashboard.
</i>
</div> </div>
</div> </div>
...@@ -31,16 +31,20 @@ ...@@ -31,16 +31,20 @@
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<!-- Relative time options --> <!-- Relative time options -->
<li ng-repeat='timespan in panel.time_options track by $index'> <li bindonce ng-repeat='timespan in panel.time_options track by $index'>
<a ng-click="setRelativeFilter(timespan)">Last {{timespan}}</a> <a ng-click="setRelativeFilter(timespan)" bo-text="'Last ' + timespan"></a>
</li> </li>
<!-- Auto refresh submenu --> <!-- Auto refresh submenu -->
<li class="dropdown-submenu"> <li class="dropdown-submenu">
<a href="#">Auto-Refresh</a> <a href="#">Auto-Refresh</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a ng-click="dashboard.set_interval(false)">Off</a></li> <li>
<li ng-repeat="interval in panel.refresh_intervals track by $index"><a ng-click="dashboard.set_interval(interval)">Every {{interval}}</a></li> <a ng-click="dashboard.set_interval(false)">Off</a>
</li>
<li bindonce ng-repeat="interval in panel.refresh_intervals track by $index">
<a ng-click="dashboard.set_interval(interval)" bo-text="'Every ' + interval"></a>
</li>
</ul> </ul>
</li> </li>
<li><a ng-click="customTime()">Custom</a></li> <li><a ng-click="customTime()">Custom</a></li>
......
...@@ -53,8 +53,9 @@ ...@@ -53,8 +53,9 @@
<li class="dropdown-submenu"> <li class="dropdown-submenu">
<a href="javascript:void(0);">Add Panel</a> <a href="javascript:void(0);">Add Panel</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a ng-click="add_panel_default('graph')">Graph</a></li> <li bindonce ng-repeat="name in panelNames">
<li><a ng-click="add_panel_default('text')">Text</a></li> <a ng-click="add_panel_default(name)" bo-text="name"></a>
</li>
</ul> </ul>
</li> </li>
<li class="dropdown-submenu"> <li class="dropdown-submenu">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment