Commit 77768038 by utkarshcmu

Removed unused components

parent bcaaedf2
...@@ -4,7 +4,6 @@ define([ ...@@ -4,7 +4,6 @@ define([
'./dashboardNavCtrl', './dashboardNavCtrl',
'./snapshotTopNavCtrl', './snapshotTopNavCtrl',
'./saveDashboardAsCtrl', './saveDashboardAsCtrl',
'./playlistCtrl',
'./rowCtrl', './rowCtrl',
'./shareModalCtrl', './shareModalCtrl',
'./shareSnapshotCtrl', './shareSnapshotCtrl',
......
define([
'angular',
'lodash',
'app/core/config'
],
function (angular, _, config) {
'use strict';
var module = angular.module('grafana.controllers');
module.controller('PlaylistCtrl', function($scope, playlistSrv, backendSrv) {
$scope.init = function() {
$scope.playlist = [];
$scope.timespan = config.playlist_timespan;
$scope.search();
};
$scope.search = function() {
var query = {starred: true, limit: 10};
if ($scope.searchQuery) {
query.query = $scope.searchQuery;
query.starred = false;
}
backendSrv.search(query).then(function(results) {
$scope.searchHits = results;
$scope.filterHits();
});
};
$scope.filterHits = function() {
$scope.filteredHits = _.reject($scope.searchHits, function(dash) {
return _.findWhere($scope.playlist, {uri: dash.uri});
});
};
$scope.addDashboard = function(dashboard) {
$scope.playlist.push(dashboard);
$scope.filterHits();
};
$scope.removeDashboard = function(dashboard) {
$scope.playlist = _.without($scope.playlist, dashboard);
$scope.filterHits();
};
$scope.start = function() {
playlistSrv.start($scope.playlist, $scope.timespan);
};
});
});
<div ng-controller="PlaylistCtrl" ng-init="init()">
<div class="gf-box-header">
<div class="gf-box-title">
<i class="fa fa-play"></i>
Start dashboard playlist
</div>
<button class="gf-box-header-close-btn" ng-click="dismiss();">
<i class="fa fa-remove"></i>
</button>
</div>
<div class="gf-box-body">
<div class="row-fluid" style="margin-bottom: 10px;">
<div class="span12">
<div style="display: inline-block">
<div class="tight-form last">
<ul class="tight-form-list">
<li class="tight-form-item">
Search
</li>
<li>
<input type="text" class="tight-form-input input-xlarge last" ng-model="searchQuery" placeholder="query or empty for starred" ng-change="search()">
</li>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<h5>Search result</h5>
<table class="grafana-options-table">
<tr ng-repeat="dashboard in filteredHits">
<td style="white-space: nowrap;">
{{dashboard.title}}
</td>
<td style="text-align: center">
<button class="btn btn-inverse btn-mini pull-right" ng-click="addDashboard(dashboard)">
<i class="fa fa-plus"></i>
Add to playlist
</button>
</td>
</tr>
<tr ng-hide="searchHits.length">
<td colspan="2">
<i class="fa fa-warning"></i> No dashboards found
</td>
</tr>
</table>
</div>
<div class="span6">
<h5>Playlist dashboards</h5>
<table class="grafana-options-table">
<tr ng-repeat="dashboard in playlist">
<td style="white-space: nowrap;">
{{dashboard.title}}
</td>
<td style="text-align: center">
<button class="btn btn-inverse btn-mini pull-right" ng-click="removeDashboard(dashboard)">
<i class="fa fa-remove"></i>
</button>
</td>
</tr>
<tr ng-hide="playlist.length">
<td colspan="2">
Playlist empty
</td>
</tr>
</table>
</div>
</div>
<br>
<br>
<div class="pull-left">
<div class="tight-form last">
<ul class="tight-form-list">
<li class="tight-form-item">
Timespan between dashboard change
</li>
<li>
<input type="text" class="tight-form-input input-small" ng-model="timespan" />
</li>
<li>
<button class="btn btn-success tight-form-btn" ng-click="start();dismiss();"><i class="fa fa-play"></i> Start</button>
</li>
</ul>
<div class="clearfix"></div>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
...@@ -71,10 +71,6 @@ ...@@ -71,10 +71,6 @@
<i class="fa fa-download"></i> <i class="fa fa-download"></i>
Import Import
</a> </a>
<button class="btn btn-inverse pull-left" dash-editor-link="app/partials/playlist.html" editor-scope="isolated" ng-click="dismiss();">
<i class="fa fa-play"></i>
Playlist
</button>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
......
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