Skip to content

Commit

Permalink
Added config directive
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Feb 27, 2014
1 parent dc9eb13 commit 1989d77
Show file tree
Hide file tree
Showing 8 changed files with 5,976 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/kibana/apps/dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
{{dashboard.title}}
</div>

<ul class="nav navbar-nav pull-right">
<ul class="nav navbar-nav">
<li><a class="link" ng-click="gridControl.addWidget()"><i class="fa fa-plus"></i></a></li>
<li><a class="link" ng-click="save(dashboard.title)"><i class="fa fa-save"></i></a></li>
<li><a class="link" ng-click="load(dashboard.title)"><i class="fa fa-folder-open"></i></a></li>

<li><a class="link" ng-click="openSave()"><i class="fa fa-save"></i></a></li>
<li><a class="link" ng-click="openLoad()"><i class="fa fa-folder-open"></i></a></li>
</ul>
</nav>
<config config-template="configTemplate" config-object="configurable" config-close="configClose"></config>

<div class="container-default">
<ul dashboard-grid grid="dashboard.panels" control="gridControl"></ul>
Expand Down
19 changes: 19 additions & 0 deletions src/kibana/apps/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ define(function (require) {

require('css!./styles/main.css');
require('css!../../../bower_components/gridster/dist/jquery.gridster.css');
require('directives/config');
require('gridster');


Expand All @@ -18,6 +19,20 @@ define(function (require) {
// the controller and view
$scope.gridControl = {foo: true};

$scope.openSave = function () {
$scope.configTemplate = 'kibana/apps/dashboard/partials/saveDashboard.html';
$scope.configClose = function () {
console.log('SAVE close');
};
};

$scope.openLoad = function () {
$scope.configTemplate = 'kibana/apps/dashboard/partials/loadDashboard.html';
$scope.configClose = function () {
console.log('LOAD close');
};
};

$scope.save = function (title) {
var doc = courier.createSource('doc')
.index(configFile.kibanaIndex)
Expand Down Expand Up @@ -111,6 +126,10 @@ define(function (require) {
]
};

$scope.configurable = {
dashboard: $scope.dashboard
};


});

Expand Down
5 changes: 5 additions & 0 deletions src/kibana/apps/dashboard/partials/loadDashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="form-group">
<label for="exampleInputEmail1">Load</label>
<input type="text" ng-model="configObject.dashboard.title" class="form-control" placeholder="Dashboard title">
</div>
<button type="submit" class="btn btn-default">Load</button>
5 changes: 5 additions & 0 deletions src/kibana/apps/dashboard/partials/saveDashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="form-group">
<label for="exampleInputEmail1">Save As</label>
<input type="text" ng-model="configObject.dashboard.title" class="form-control" placeholder="Dashboard title">
</div>
<button type="submit" class="btn btn-primary">Save</button>
Loading

0 comments on commit 1989d77

Please sign in to comment.