Merge remote-tracking branch 'upstream/master'

Conflicts:
	src/app/directives/kibanaPanel.js
	src/app/panels/bettermap/editor.html
	src/app/panels/bettermap/module.js
	src/app/panels/hits/editor.html
	src/app/panels/map/editor.html
	src/app/panels/pie/editor.html
	src/app/panels/table/module.html
	src/app/panels/table/pagination.html
	src/app/panels/terms/editor.html
	src/app/panels/terms/module.js
	src/app/partials/dasheditor.html
	src/css/bootstrap.dark.min.css
This commit is contained in:
Torkel Ödegaard 2013-12-26 16:41:56 +01:00
commit 4aceb6086b
14 changed files with 113 additions and 65 deletions

View File

@ -26,7 +26,8 @@ function (angular, $, _, appLevelRequire) {
// features if we define them after boot time // features if we define them after boot time
register_fns = {}; register_fns = {};
app.constant('version',"3.0.0pre5"); // This stores the Kibana revision number, @REV@ is replaced by grunt.
app.constant('kbnVersion',"@REV@");
// Use this for cache busting partials // Use this for cache busting partials
app.constant('cacheBust',"cache-bust="+Date.now()); app.constant('cacheBust',"cache-bust="+Date.now());

View File

@ -8,5 +8,6 @@ define([
'./ngModelOnBlur', './ngModelOnBlur',
'./tip', './tip',
'./confirmClick', './confirmClick',
'./esVersion' './esVersion',
'./configModal'
], function () {}); ], function () {});

View File

@ -0,0 +1,34 @@
define([
'angular',
'app',
],
function (angular) {
'use strict';
angular
.module('kibana.directives')
.directive('configModal', function($modal,$q) {
return {
restrict: 'A',
link: function(scope, elem) {
// create a new modal. Can't reuse one modal unforunately as the directive will not
// re-render on show.
elem.bind('click',function(){
var panelModal = $modal({
template: './app/partials/paneleditor.html',
persist: true,
show: false,
scope: scope,
keyboard: false
});
// and show it
$q.when(panelModal).then(function(modalEl) {
modalEl.modal('show');
});
scope.$apply();
});
}
};
});
});

View File

@ -34,6 +34,11 @@ function (angular) {
'<span class="row-text">{{panel.type}}</span>'+ '<span class="row-text">{{panel.type}}</span>'+
'</span>' + '</span>' +
'<span class="row-button extra" ng-show="panel.editable != false">' +
'<span config-modal class="pointer">'+
'<i class="icon-cog pointer" bs-tooltip="\'Configure\'"></i></span>'+
'</span>' +
'<span ng-repeat="task in panelMeta.modals" class="row-button extra" ng-show="task.show">' + '<span ng-repeat="task in panelMeta.modals" class="row-button extra" ng-show="task.show">' +
'<span bs-modal="task.partial" class="pointer"><i ' + '<span bs-modal="task.partial" class="pointer"><i ' +
'bs-tooltip="task.description" ng-class="task.icon" class="pointer"></i></span>'+ 'bs-tooltip="task.description" ng-class="task.icon" class="pointer"></i></span>'+

View File

@ -7,7 +7,7 @@
</div> </div>
<div class="editor-option" ng-show="panel.mode != 'count'"> <div class="editor-option" ng-show="panel.mode != 'count'">
<label class="small">Value Field <tip>This field must contain a numeric value</tip></label> <label class="small">Value Field <tip>This field must contain a numeric value</tip></label>
<input ng-change="set_refresh(true)" placeholder="Start typing" bs-typeahead="fields.list" type="text" class="input-large" ng-model="panel.value_field"> <input ng-change="set_refresh(true)" placeholder="Start typing" bs-typeahead="fields.list" type="text" class="input-medium" ng-model="panel.value_field">
</div> </div>
</div> </div>
<div class="section"> <div class="section">
@ -23,9 +23,8 @@
<label class="small">Derivative <tip>Plot the change per interval in the series</tip></label><input type="checkbox" ng-model="panel.derivative" ng-checked="panel.derivative" ng-change="set_refresh(true)"> <label class="small">Derivative <tip>Plot the change per interval in the series</tip></label><input type="checkbox" ng-model="panel.derivative" ng-checked="panel.derivative" ng-change="set_refresh(true)">
</div> </div>
</div> </div>
</div> <div class="section">
<h5>Time Options</h5> <h5>Time Options</h5>
<div class="editor-row">
<div class="editor-option"> <div class="editor-option">
<label class="small">Time Field</label> <label class="small">Time Field</label>
<input ng-change="set_refresh(true)" placeholder="Start typing" bs-typeahead="fields.list" type="text" class="input-small" ng-model="panel.time_field"> <input ng-change="set_refresh(true)" placeholder="Start typing" bs-typeahead="fields.list" type="text" class="input-small" ng-model="panel.time_field">
@ -45,4 +44,5 @@
<label class="small">Interval <tip>Use Elasticsearch date math format (eg 1m, 5m, 1d, 2w, 1y)</tip></label> <label class="small">Interval <tip>Use Elasticsearch date math format (eg 1m, 5m, 1d, 2w, 1y)</tip></label>
<input type="text" class='input-mini' ng-model="panel.interval" ng-change='set_refresh(true)'/> <input type="text" class='input-mini' ng-model="panel.interval" ng-change='set_refresh(true)'/>
</div> </div>
</div>
</div> </div>

View File

@ -1,6 +1,6 @@
<div ng-include="'app/partials/panelgeneral.html'"></div> <div ng-include="'app/partials/panelgeneral.html'"></div>
<div ng-include="edit_path(panel.type)"></div> <div ng-include="edit_path(panel.type)"></div>
<div ng-repeat="tab in panelMeta.editorTabs"> <div ng-repeat="tab in panelMeta.editorTabs">
<h4>{{tab.title}}</h4> <h5>{{tab.title}}</h5>
<div ng-include="tab.src"></div> <div ng-include="tab.src"></div>
</div> </div>

View File

@ -1,22 +1,24 @@
<div class="row-fluid"> <div class="editor-row">
<div class="span12"> <div class="section">
<strong>{{panelMeta.status}}</strong> // <span ng-bind-html="panelMeta.description"></span> <strong>{{panelMeta.status}}</strong> // <span ng-bind-html="panelMeta.description"></span>
</div> </div>
</div> </div>
<div class="row-fluid"> <div class="editor-row">
<div class="span4"> <div class="section">
<div class="editor-option">
<label class="small">Title</label><input type="text" class="input-medium" ng-model='panel.title'></input> <label class="small">Title</label><input type="text" class="input-medium" ng-model='panel.title'></input>
</div> </div>
<div class="span2" ng-hide="panel.sizeable == false"> <div class="editor-option" ng-hide="panel.sizeable == false">
<label class="small">Span</label> <select class="input-mini" ng-model="panel.span" ng-options="f for f in [0,1,2,3,4,5,6,7,8,9,10,11,12]"></select> <label class="small">Span</label> <select class="input-mini" ng-model="panel.span" ng-options="f for f in [0,1,2,3,4,5,6,7,8,9,10,11,12]"></select>
</div> </div>
<div class="span2"> <div class="editor-option">
<label class="small">Editable</label><input type="checkbox" ng-model="panel.editable" ng-checked="panel.editable"> <label class="small">Editable</label><input type="checkbox" ng-model="panel.editable" ng-checked="panel.editable">
</div> </div>
<div class="span2" ng-show="!_.isUndefined(panel.spyable)"> <div class="editor-option" ng-show="!_.isUndefined(panel.spyable)">
<label class="small"> <label class="small">
Inspect <i class="icon-question-sign" bs-tooltip="'Allow query reveal via <i class=icon-eye-open></i>'"></i> Inspect <i class="icon-question-sign" bs-tooltip="'Allow query reveal via <i class=icon-eye-open></i>'"></i>
</label> </label>
<input type="checkbox" ng-model="panel.spyable" ng-checked="panel.spyable"> <input type="checkbox" ng-model="panel.spyable" ng-checked="panel.spyable">
</div> </div>
</div> </div>
</div>

View File

@ -215,9 +215,13 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
self.set_interval(dashboard.refresh); self.set_interval(dashboard.refresh);
} }
// Set the available panels for the "Add Panel" drop down
self.availablePanels = _.difference(config.panel_names, self.availablePanels = _.difference(config.panel_names,
_.pluck(_.union(self.current.nav,self.current.pulldowns),'type')); _.pluck(_.union(self.current.nav,self.current.pulldowns),'type'));
// Take out any that we're not allowed to add from the gui.
self.availablePanels = _.difference(self.availablePanels,config.hidden_panels);
return true; return true;
}; };

View File

@ -28,7 +28,6 @@ function (angular, _, config) {
self.indices = _.union(self.indices,_.keys(result)); self.indices = _.union(self.indices,_.keys(result));
self.list = mapFields(result); self.list = mapFields(result);
}); });
// Otherwise just use the cached mapping
} }
} }
}); });
@ -76,13 +75,18 @@ function (angular, _, config) {
dot = (prefix) ? '.':'', dot = (prefix) ? '.':'',
ret = {}; ret = {};
for(var attr in obj){ for(var attr in obj){
if(attr === 'dynamic_templates' || attr === '_default_') {
continue;
}
// For now only support multi field on the top level // For now only support multi field on the top level
// and if there is a default field set. // and if there is a default field set.
if(obj[attr]['type'] === 'multi_field') { if(obj[attr]['type'] === 'multi_field') {
ret[attr] = obj[attr]['fields'][attr] || obj[attr]; ret[attr] = obj[attr]['fields'][attr] || obj[attr];
continue; var keys = _.without(_.keys(obj[attr]['fields']),attr);
for(var key in keys) {
ret[attr+'.'+keys[key]] = obj[attr]['fields'][keys[key]];
} }
if (attr === 'properties') { } else if (attr === 'properties') {
_.extend(ret,flatten(obj[attr], propName)); _.extend(ret,flatten(obj[attr], propName));
} else if(typeof obj[attr] === 'object'){ } else if(typeof obj[attr] === 'object'){
_.extend(ret,flatten(obj[attr], propName + dot + attr)); _.extend(ret,flatten(obj[attr], propName + dot + attr));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -22,17 +22,10 @@
// Base modal // Base modal
.modal { .modal {
position: fixed; position: absolute;
top: 10%;
left: 50%;
z-index: @zindexModal; z-index: @zindexModal;
width: 560px; width: 100%;
margin-left: -280px;
background-color: @white; background-color: @white;
border: 1px solid #999;
border: 1px solid rgba(0,0,0,.3);
*border: 1px solid #999; /* IE6-7 */
.border-radius(6px);
.box-shadow(0 3px 7px rgba(0,0,0,0.3)); .box-shadow(0 3px 7px rgba(0,0,0,0.3));
.background-clip(padding-box); .background-clip(padding-box);
// Remove focus outline from opened modal // Remove focus outline from opened modal
@ -60,7 +53,7 @@
.modal-body { .modal-body {
position: relative; position: relative;
overflow-y: auto; overflow-y: auto;
max-height: 400px; max-height: 700px;
padding: 15px; padding: 15px;
} }
// Remove bottom margin if need be // Remove bottom margin if need be
@ -75,7 +68,6 @@
text-align: right; // right align buttons text-align: right; // right align buttons
background-color: #f5f5f5; background-color: #f5f5f5;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
.border-radius(0 0 6px 6px);
.box-shadow(inset 0 1px 0 @white); .box-shadow(inset 0 1px 0 @white);
.clearfix(); // clear it in case folks use .pull-* classes on buttons .clearfix(); // clear it in case folks use .pull-* classes on buttons

View File

@ -210,9 +210,8 @@ form input.ng-invalid {
} }
.modal { .modal {
width: 770px; width: 100%;
margin-left: -385px; top: 0px !important;
top: 10px !important;
} }
.tiny { .tiny {

View File

@ -19,13 +19,19 @@ module.exports = function(grunt) {
grunt.registerTask('build:write_revision', function() { grunt.registerTask('build:write_revision', function() {
grunt.event.once('git-describe', function (desc) { grunt.event.once('git-describe', function (desc) {
grunt.config('string-replace.config', { grunt.config('string-replace.config', {
src: '<%= destDir %>/app/components/require.config.js', files: {
dest: '<%= destDir %>/app/components/require.config.js', '<%= destDir %>/app/components/require.config.js': '<%= destDir %>/app/components/require.config.js',
'<%= destDir %>/app/app.js': '<%= destDir %>/app/app.js'
},
options: { options: {
replacements: [ replacements: [
{ {
pattern: /(?:^|\/\/)(.*)@REV@/, pattern: /(?:^|\/\/)(.*)@REV@/,
replacement: '$1'+desc.object replacement: '$1'+desc.object
},
{
pattern: /@REV@/,
replacement: desc.object
} }
] ]
} }
@ -34,4 +40,4 @@ module.exports = function(grunt) {
}); });
grunt.task.run('git-describe'); grunt.task.run('git-describe');
}); });
} };