|
@@ -1,14 +1,14 @@
|
|
|
<navbar title="Playlists" title-url="playlists" icon="fa fa-fw fa-list" subnav="true">
|
|
<navbar title="Playlists" title-url="playlists" icon="fa fa-fw fa-list" subnav="true">
|
|
|
<ul class="nav">
|
|
<ul class="nav">
|
|
|
- <li ng-class="{active: isNew()}" ng-show="isNew()"><a href="datasources/create">New</a></li>
|
|
|
|
|
- <li class="active" ng-show="!isNew()"><a href="playlists/edit/{{playlist.id}}">{{playlist.name}}</a></li>
|
|
|
|
|
|
|
+ <li ng-class="{active: ctrl.isNew()}" ng-show="ctrl.isNew()"><a href="datasources/create">New</a></li>
|
|
|
|
|
+ <li class="active" ng-show="!ctrl.isNew()"><a href="playlists/edit/{{ctrl.playlist.id}}">{{ctrl.playlist.name}}</a></li>
|
|
|
</ul>
|
|
</ul>
|
|
|
</navbar>
|
|
</navbar>
|
|
|
|
|
|
|
|
<div class="page-container" ng-form="playlistEditForm">
|
|
<div class="page-container" ng-form="playlistEditForm">
|
|
|
<div class="page">
|
|
<div class="page">
|
|
|
- <h2 ng-show="isNew()">New playlist</h2>
|
|
|
|
|
- <h2 ng-show="!isNew()">Edit playlist</h2>
|
|
|
|
|
|
|
+ <h2 ng-show="ctrl.isNew()">New playlist</h2>
|
|
|
|
|
+ <h2 ng-show="!ctrl.isNew()">Edit playlist</h2>
|
|
|
|
|
|
|
|
<h4>Name and interval</h4>
|
|
<h4>Name and interval</h4>
|
|
|
|
|
|
|
@@ -20,7 +20,7 @@
|
|
|
Name
|
|
Name
|
|
|
</li>
|
|
</li>
|
|
|
<li>
|
|
<li>
|
|
|
- <input type="text" required ng-model="playlist.name" class="input-xlarge tight-form-input">
|
|
|
|
|
|
|
+ <input type="text" required ng-model="ctrl.playlist.name" class="input-xlarge tight-form-input">
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
<div class="clearfix"></div>
|
|
<div class="clearfix"></div>
|
|
@@ -31,7 +31,7 @@
|
|
|
Interval
|
|
Interval
|
|
|
</li>
|
|
</li>
|
|
|
<li>
|
|
<li>
|
|
|
- <input type="text" required ng-model="playlist.interval" placeholder="5m" class="input-xlarge tight-form-input">
|
|
|
|
|
|
|
+ <input type="text" required ng-model="ctrl.playlist.interval" placeholder="5m" class="input-xlarge tight-form-input">
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
<div class="clearfix"></div>
|
|
<div class="clearfix"></div>
|
|
@@ -39,66 +39,72 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<br>
|
|
<br>
|
|
|
- <h4>Add dashboards</h4>
|
|
|
|
|
|
|
|
|
|
- <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="dashboard search term"
|
|
|
|
|
- ng-trim="true"
|
|
|
|
|
- ng-change="search()">
|
|
|
|
|
- </li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- <div class="clearfix"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
<div class="row">
|
|
|
<div class="span5 pull-left">
|
|
<div class="span5 pull-left">
|
|
|
- <h5>Search results ({{filteredPlaylistItems.length}})</h5>
|
|
|
|
|
|
|
+ <h5>Add dashboards</h5>
|
|
|
|
|
+ <div style="">
|
|
|
|
|
+ <playlist-search class="playlist-search-container" search-started="ctrl.searchStarted(promise)"></playlist-search>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="span5 pull-left" ng-if="ctrl.filteredDashboards.length > 0">
|
|
|
|
|
+ <h5>Search results ({{ctrl.filteredDashboards.length}})</h5>
|
|
|
<table class="grafana-options-table">
|
|
<table class="grafana-options-table">
|
|
|
- <tr ng-repeat="playlistItem in filteredPlaylistItems">
|
|
|
|
|
|
|
+ <tr ng-repeat="playlistItem in ctrl.filteredDashboards">
|
|
|
<td style="white-space: nowrap;">
|
|
<td style="white-space: nowrap;">
|
|
|
{{playlistItem.title}}
|
|
{{playlistItem.title}}
|
|
|
</td>
|
|
</td>
|
|
|
<td style="text-align: center">
|
|
<td style="text-align: center">
|
|
|
- <button class="btn btn-inverse btn-mini pull-right" ng-click="addPlaylistItem(playlistItem)">
|
|
|
|
|
|
|
+ <button class="btn btn-inverse btn-mini pull-right" ng-click="ctrl.addPlaylistItem(playlistItem)">
|
|
|
<i class="fa fa-plus"></i>
|
|
<i class="fa fa-plus"></i>
|
|
|
Add to playlist
|
|
Add to playlist
|
|
|
</button>
|
|
</button>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
- <tr ng-if="isSearchResultsEmpty()">
|
|
|
|
|
- <td colspan="2">
|
|
|
|
|
- <i class="fa fa-warning"></i> Search results empty
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
</table>
|
|
</table>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="playlist-search-results-container" ng-if="ctrl.filteredTags.length > 0">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="span6 offset1">
|
|
|
|
|
+ <div ng-repeat="tag in ctrl.filteredTags" class="pointer" style="width: 180px; float: left;"
|
|
|
|
|
+ ng-class="{'selected': $index === selectedIndex }"
|
|
|
|
|
+ ng-click="ctrl.addTagPlaylistItem(tag, $event)">
|
|
|
|
|
+ <a class="search-result-tag label label-tag" tag-color-from-name="tag.term">
|
|
|
|
|
+ <i class="fa fa-tag"></i>
|
|
|
|
|
+ <span>{{tag.term}} ({{tag.count}})</span>
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
<div class="span5 pull-left">
|
|
<div class="span5 pull-left">
|
|
|
<h5>Added dashboards</h5>
|
|
<h5>Added dashboards</h5>
|
|
|
<table class="grafana-options-table">
|
|
<table class="grafana-options-table">
|
|
|
- <tr ng-repeat="playlistItem in playlistItems">
|
|
|
|
|
- <td style="white-space: nowrap;">
|
|
|
|
|
|
|
+ <tr ng-repeat="playlistItem in ctrl.playlistItems">
|
|
|
|
|
+ <td style="white-space: nowrap;" ng-if="playlistItem.type === 'dashboard_by_id'">
|
|
|
{{playlistItem.title}}
|
|
{{playlistItem.title}}
|
|
|
</td>
|
|
</td>
|
|
|
|
|
+ <td style="white-space: nowrap;" ng-if="playlistItem.type === 'dashboard_by_tag'">
|
|
|
|
|
+ <a class="search-result-tag label label-tag" tag-color-from-name="playlistItem.title">
|
|
|
|
|
+ <i class="fa fa-tag"></i>
|
|
|
|
|
+ <span>{{playlistItem.title}}</span>
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </td>
|
|
|
|
|
+
|
|
|
<td style="text-align: right">
|
|
<td style="text-align: right">
|
|
|
- <button class="btn btn-inverse btn-mini" ng-hide="$first" ng-click="movePlaylistItemUp(playlistItem)">
|
|
|
|
|
|
|
+ <button class="btn btn-inverse btn-mini" ng-hide="$first" ng-click="ctrl.movePlaylistItemUp(playlistItem)">
|
|
|
<i class="fa fa-arrow-up"></i>
|
|
<i class="fa fa-arrow-up"></i>
|
|
|
</button>
|
|
</button>
|
|
|
- <button class="btn btn-inverse btn-mini" ng-hide="$last" ng-click="movePlaylistItemDown(playlistItem)">
|
|
|
|
|
|
|
+ <button class="btn btn-inverse btn-mini" ng-hide="$last" ng-click="ctrl.movePlaylistItemDown(playlistItem)">
|
|
|
<i class="fa fa-arrow-down"></i>
|
|
<i class="fa fa-arrow-down"></i>
|
|
|
</button>
|
|
</button>
|
|
|
- <button class="btn btn-inverse btn-mini" ng-click="removePlaylistItem(playlistItem)">
|
|
|
|
|
|
|
+ <button class="btn btn-inverse btn-mini" ng-click="ctrl.removePlaylistItem(playlistItem)">
|
|
|
<i class="fa fa-remove"></i>
|
|
<i class="fa fa-remove"></i>
|
|
|
</button>
|
|
</button>
|
|
|
</td>
|
|
</td>
|
|
@@ -113,11 +119,11 @@
|
|
|
<!-- <div class="tight-form"> -->
|
|
<!-- <div class="tight-form"> -->
|
|
|
<button type="button"
|
|
<button type="button"
|
|
|
class="btn btn-success"
|
|
class="btn btn-success"
|
|
|
- ng-disabled="playlistEditForm.$invalid || isPlaylistEmpty()"
|
|
|
|
|
- ng-click="savePlaylist(playlist, playlistItems)">Save</button>
|
|
|
|
|
|
|
+ ng-disabled="ctrl.playlistEditForm.$invalid || ctrl.isPlaylistEmpty()"
|
|
|
|
|
+ ng-click="ctrl.savePlaylist(ctrl.playlist, ctrl.playlistItems)">Save</button>
|
|
|
<button type="button"
|
|
<button type="button"
|
|
|
class="btn btn-inverse"
|
|
class="btn btn-inverse"
|
|
|
- ng-click="backToList()">Cancel</button>
|
|
|
|
|
|
|
+ ng-click="ctrl.backToList()">Cancel</button>
|
|
|
<!-- </div> -->
|
|
<!-- </div> -->
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|