Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filebeat wizard #5790

Merged
merged 29 commits into from
Feb 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2672b72
beginning to play with jsdata
Bargs Dec 29, 2015
6b2a525
Add exception for unneeded lib since we're using js-data-angular
Bargs Dec 29, 2015
f1f0eab
starting to work on pattern creation UI
Bargs Dec 29, 2015
518b9a3
remove per page limit
Bargs Dec 29, 2015
dcb5e5a
starting a simple wizard controller with placeholder steps
Bargs Dec 30, 2015
52a4ee3
add breadcrumb to wizard
Bargs Dec 30, 2015
8b5c95d
demonstrating flow of data through the wizard steps
Bargs Dec 30, 2015
50f4652
Merge branch 'feature/ingest' into filebeatWizard
Bargs Jan 12, 2016
db8014c
Simplifying communication between wizard and the step directives
Bargs Jan 12, 2016
ede8ef6
Disabling navigation buttons until each step is complete and adding s…
Bargs Jan 12, 2016
c5c85b7
Merge branch 'feature/ingest' into filebeatWizard
Bargs Jan 13, 2016
25a4e91
Merge branch 'ingest/addDataStart' into filebeatWizard
Bargs Jan 20, 2016
b7ddd7e
move filebeat wizard under settings/indices
Bargs Jan 20, 2016
70e21a2
make filebeat wizard layout more consistent with the create index pat…
Bargs Jan 20, 2016
6690e59
Merge branch 'ingest/addDataStart' into filebeatWizard
Bargs Jan 22, 2016
35bd6f4
Use AppState to keep track of current step in the filebeat wizard
Bargs Jan 22, 2016
20b1e6e
Delete changes to current step when navigating backwards, warning the…
Bargs Jan 22, 2016
38a5ef0
Make the step headings clickable
Bargs Jan 22, 2016
43e44d1
Merge branch 'ingest/addDataStart' into filebeatWizard
Bargs Jan 22, 2016
47609ea
remove jsdata files
Bargs Jan 23, 2016
f93707b
update the filebeat wizard url to match the existing index pattern cr…
Bargs Jan 23, 2016
a74b213
Merge branch 'ingest/addDataStart' into filebeatWizard
Bargs Jan 25, 2016
a76b5ec
Remove unnecessary controller that got copy pasted
Bargs Jan 25, 2016
54af347
Merge branch 'feature/ingest' into filebeatWizard
Bargs Jan 26, 2016
2e112f5
Convert filebeat wizard into a directive
Bargs Feb 2, 2016
e84b028
don't allow users to navigate back through the wizard after clicking …
Bargs Feb 2, 2016
911cc51
better wording for tail a file description
Bargs Feb 2, 2016
770b51a
Merge branch 'feature/ingest' into filebeatWizard
Bargs Feb 2, 2016
9748328
update new tests to work with add data landing page
Bargs Feb 2, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<h2>Install filebeat step</h2>

<div>
Results:
<ul>
<li>Logs: {{results.samples}}</li>
<li>Docs: {{results.sampleDocs}}</li>
<li>Pattern: {{results.indexPattern}}</li>
</ul>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var modules = require('ui/modules');
var template = require('plugins/kibana/settings/sections/indices/directives/install_filebeat_step.html');

modules.get('apps/settings')
.directive('installFilebeatStep', function () {
return {
template: template,
scope: {
results: '='
},
controller: function ($scope) {
var results = $scope.results;
}
};
});

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h2>Paste samples step</h2>

<button ng-click="samples = 'some sample logs'">Do Stuff</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var modules = require('ui/modules');
var template = require('plugins/kibana/settings/sections/indices/directives/paste_samples_step.html');

modules.get('apps/settings')
.directive('pasteSamplesStep', function () {
return {
template: template,
scope: {
samples: '='
}
};
});

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<h2>Pattern review step</h2>

<div>
Docs: {{sampleDocs}}
</div>

<button ng-click="indexPattern = {id: 'logstash-*', title: 'myFirstIndexPattern'}">Create an index pattern</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var modules = require('ui/modules');
var template = require('plugins/kibana/settings/sections/indices/directives/pattern_review_step.html');

modules.get('apps/settings')
.directive('patternReviewStep', function () {
return {
template: template,
scope: {
sampleDocs: '=',
indexPattern: '=',
pipeline: '='
}
};
});

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<h2>Build pipeline step</h2>

<div>
Logs: {{samples}}
</div>

<button ng-click="sampleDocs = {results: {os: 'osx'}}; pipeline = {processor: 'I processor'};">Build a pipeline</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var modules = require('ui/modules');
var template = require('plugins/kibana/settings/sections/indices/directives/pipeline_step.html');

modules.get('apps/settings')
.directive('pipelineStep', function () {
return {
template: template,
scope: {
samples: '=',
sampleDocs: '=',
pipeline: '='
}
};
});

Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<div>
<div class="page-header">
<h1>Tail a File</h1>
Let's send some log data to Elasticsearch.
</div>
</div>

<div>
<div class="wizard-step-headings" ng-class="{complete: wizard.complete}">
<span ng-class="{active: wizard.currentStep === 0}"
class="wizard-step-heading"
ng-click="wizard.setCurrentStep(0)">
1. Paste
</span>
<span ng-class="{active: wizard.currentStep === 1, aheadActive: wizard.currentStep < 1}"
class="wizard-step-heading"
ng-click="wizard.currentStep < 1 || wizard.setCurrentStep(1)">
2. Parse
</span>
<span ng-class="{active: wizard.currentStep === 2, aheadActive: wizard.currentStep < 2}"
class="wizard-step-heading"
ng-click="wizard.currentStep < 2 || wizard.setCurrentStep(2)">
3. Review
</span>
<span ng-class="{active: wizard.currentStep === 3, aheadActive: wizard.currentStep < 3}"
class="wizard-step-heading"
ng-click="wizard.currentStep < 3 || wizard.setCurrentStep(3)">
4. Install Filebeat
</span>
</div>

<div ng-switch="wizard.currentStep">
<div ng-switch-when="0">
<paste-samples-step samples="wizard.stepResults.samples"></paste-samples-step>
<div class="nav-buttons">
<button ng-disabled="!wizard.stepResults.samples" ng-click="wizard.nextStep()">Next</button>
</div>
</div>

<div ng-switch-when="1">
<pipeline-step
samples="wizard.stepResults.samples"
pipeline="wizard.stepResults.pipeline"
sample-docs="wizard.stepResults.sampleDocs">
</pipeline-step>

<div class="nav-buttons">
<button ng-click="wizard.prevStep()">Prev</button>
<button ng-disabled="!wizard.stepResults.pipeline || !wizard.stepResults.sampleDocs" ng-click="wizard.nextStep()">Next</button>
</div>
</div>

<div ng-switch-when="2">
<pattern-review-step
index-pattern="wizard.stepResults.indexPattern"
sample-docs="wizard.stepResults.sampleDocs"
pipeline="wizard.stepResults.pipeline">
</pattern-review-step>

<div class="nav-buttons">
<button ng-click="wizard.prevStep()">Prev</button>
<button ng-disabled="!wizard.stepResults.indexPattern" ng-click="wizard.nextStep()">Save</button>
</div>
</div>

<div ng-switch-when="3">
<install-filebeat-step results="wizard.stepResults"></install-filebeat-step>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
var modules = require('ui/modules');
var template = require('plugins/kibana/settings/sections/indices/filebeat/directives/filebeat_wizard.html');

require('plugins/kibana/settings/sections/indices/directives/pattern_review_step');
require('plugins/kibana/settings/sections/indices/directives/paste_samples_step');
require('plugins/kibana/settings/sections/indices/directives/pipeline_step');
require('plugins/kibana/settings/sections/indices/directives/install_filebeat_step');

// wrapper directive, which sets up the breadcrumb for all filebeat steps
modules.get('apps/settings')
.directive('filebeatWizard', function () {
return {
restrict: 'E',
template: template,
scope: {},
bindToController: true,
controllerAs: 'wizard',
controller: function ($scope, AppState, safeConfirm) {
var $state = this.state = new AppState();
var totalSteps = 4;
this.stepResults = {};

this.setCurrentStep = (step) => {
if (!this.complete) {
$state.currentStep = step;
$state.save();
}
};
this.setCurrentStep(0);

this.nextStep = () => {
if ($state.currentStep + 1 < totalSteps) {
this.setCurrentStep($state.currentStep + 1);
}
};
this.prevStep = () => {
if ($state.currentStep > 0) {
this.setCurrentStep($state.currentStep - 1);
}
};

$scope.$watch('wizard.state.currentStep', (newValue, oldValue) => {
if (this.complete) {
$state.currentStep = totalSteps - 1;
$state.save();
return;
}
if (newValue + 1 === totalSteps) {
this.complete = true;
}
if (newValue < oldValue) {
return safeConfirm('Going back will reset any changes you\'ve made to this step, do you want to continue?')
.then(
() => {
if ($state.currentStep < 1) {
delete this.stepResults.pipeline;
}
if ($state.currentStep < 2) {
delete this.stepResults.indexPattern;
}
this.currentStep = newValue;
},
() => {
$state.currentStep = oldValue;
$state.save();
}
);
}
else {
this.currentStep = newValue;
}
});
}
};
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<kbn-settings-app section="indices">
<kbn-settings-indices>
<filebeat-wizard />
</kbn-settings-indices>
</kbn-settings-app>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var routes = require('ui/routes');
var template = require('plugins/kibana/settings/sections/indices/filebeat/index.html');

require('plugins/kibana/settings/sections/indices/filebeat/directives/filebeat_wizard');

routes.when('/settings/indices/create/filebeat', {
template: template
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ <h4>
<div>
Pick this option if you already have data in Elasticsearch.
</div>

<h4>
<a href="#/settings/indices/create/filebeat">Tail a File</a>
</h4>
<div>
Pick this option if you have log file data you'd like to send to Elasticsearch.
</div>
</div>
</kbn-settings-indices>
</kbn-settings-app>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ define(function (require) {

require('plugins/kibana/settings/sections/indices/directives/kbn_settings_indices');
require('plugins/kibana/settings/sections/indices/_create');
require('plugins/kibana/settings/sections/indices/filebeat/index');
require('plugins/kibana/settings/sections/indices/_edit');
require('plugins/kibana/settings/sections/indices/_field_editor');

Expand Down
25 changes: 25 additions & 0 deletions src/plugins/kibana/public/settings/styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,28 @@ kbn-settings-indices {
.kbn-settings-indices-create {
.time-and-pattern > div {}
}

.wizard-step-headings{
margin-top: 1em;

.wizard-step-heading {
font-size: 1.5em;
padding-right: 1.5em;

&.active {
cursor: default;
font-weight: bold;
}
&.aheadActive {
cursor: default;
font-weight: 300;
}
}

&.complete {
.wizard-step-heading:not(.active) {
color: #dddddd;
cursor: default;
}
}
}
2 changes: 1 addition & 1 deletion test/functional/apps/discover/_collapse_expand.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define(function (require) {
})
.then(function (navigateTo) {
common.debug('navigateTo');
return settingsPage.navigateTo();
return settingsPage.navigateTo().then(settingsPage.clickExistingIndicesAddDataLink);
})
.then(function () {
common.debug('createIndexPattern');
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/discover/_shared_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ define(function (require) {
})
.then(function (navigateTo) {
common.debug('navigateTo');
return settingsPage.navigateTo();
return settingsPage.navigateTo().then(settingsPage.clickExistingIndicesAddDataLink);
})
.then(function () {
common.debug('createIndexPattern');
Expand Down