Commit 6d2af0d8 by Rashid Khan

Added share link for ES stored dashboards

parent 430bdd03
<div> <div>
<a class="close" ng-click="dismiss()" href="">×</a> <a class="close" ng-click="dismiss()" href="">×</a>
<h4>Load</h4>
<div ng-show='panel.load.local'> <div ng-show='panel.load.local'>
<h5>Local File</h5> <h5>Local File</h5>
<form> <form>
...@@ -32,6 +33,7 @@ ...@@ -32,6 +33,7 @@
<tr ng-repeat="dashboard in elasticsearch.dashboards"> <tr ng-repeat="dashboard in elasticsearch.dashboards">
<td><a ng-click="delete_elasticsearch(dashboard)"><i class="icon-remove"></i></a></td> <td><a ng-click="delete_elasticsearch(dashboard)"><i class="icon-remove"></i></a></td>
<td><a ng-click="dash_load(dashboard['_source']['dashboard'])">{{dashboard._id}}</a></td> <td><a ng-click="dash_load(dashboard['_source']['dashboard'])">{{dashboard._id}}</a></td>
<td><a><i class="icon-share" ng-click="share_link(dashboard._id,'elasticsearch',dashboard._id)" bs-modal="'panels/dashcontrol/share.html'"></i></a></td>
</tr> </tr>
</table> </table>
</div> </div>
......
<kibana-panel ng-controller='dashcontrol'> <kibana-panel ng-controller='dashcontrol'>
<label class='small'>Dashboard Control</label> <label class='small'>Dashboard Control</label>
<button class='btn' ng-show="panel.load.gist || panel.load.elasticsearch || panel.load.local" data-placement="bottom" data-unique="1" ng-click="elasticsearch_dblist(elasticsearch.query)" bs-popover="'panels/dashcontrol/load.html'"><i class='icon-folder-open'></i> Load <i class='icon-caret-down'></i></button> <button class='btn' ng-show="panel.load.gist || panel.load.elasticsearch || panel.load.local" data-placement="bottom" data-unique="1" ng-click="elasticsearch_dblist(elasticsearch.query)" bs-popover="'panels/dashcontrol/load.html'"><i class='icon-folder-open'></i> <i class='icon-caret-down'></i></button>
<button class='btn' ng-show="panel.save.gist || panel.save.elasticsearch || panel.save.local || panel.save.default" data-placement="bottom" data-unique="1" bs-popover="'panels/dashcontrol/save.html'"><i class='icon-save'></i> Save <i class='icon-caret-down'></i></button> <button class='btn' ng-show="panel.save.gist || panel.save.elasticsearch || panel.save.local || panel.save.default" data-placement="bottom" data-unique="1" bs-popover="'panels/dashcontrol/save.html'"><i class='icon-save'></i> <i class='icon-caret-down'></i></button>
</kibana-panel> </kibana-panel>
\ No newline at end of file
...@@ -89,6 +89,15 @@ angular.module('kibana.dashcontrol', []) ...@@ -89,6 +89,15 @@ angular.module('kibana.dashcontrol', [])
} }
} }
$scope.share_link = function(title,type,id) {
$scope.share = {
location : location.href.replace(location.hash,""),
type : type,
id : id,
link : location.href.replace(location.hash,"")+"#dashboard/"+type+"/"+id
};
}
$scope.purge = function() { $scope.purge = function() {
if (Modernizr.localstorage) { if (Modernizr.localstorage) {
localStorage['dashboard'] = ''; localStorage['dashboard'] = '';
......
<div> <div>
<a class="close" ng-click="dismiss()" href="">×</a> <a class="close" ng-click="dismiss()" href="">×</a>
<h4>Save</h4>
<div ng-show="panel.save.default || panel.save.local"> <div ng-show="panel.save.default || panel.save.local">
<h5>Locally</h5> <h5>Locally</h5>
<form> <form>
......
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>{{share.id}} <small>shareable link</small></h3>
</div>
<div class="modal-body">
<label>Share this dashboard with this URL</label>
<input ng-model='share.link' type="text" style="width:90%" onclick="this.select()" onfocus="this.select()" ng-change="share_link(share.type,share.id)">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" ng-click="dismiss();$broadcast('render')">Close</button>
</div>
\ No newline at end of file
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