Merge pull request #129 from ccowan/feature/issue-59-error-reporting

Fixing #59 and Mergin #124
This commit is contained in:
Chris Cowan 2014-03-07 15:43:43 -07:00
commit 267956419f
3 changed files with 27 additions and 33 deletions

View file

@ -41,13 +41,14 @@ function (angular, app, kbn, _) {
// setup the optIn and version values
var marvelOpts = storeFactory($scope, 'marvelOpts', {
report: void 0,
report: true,
version: void 0,
lastReport: void 0
});
$scope.init = function () {
$scope.kbnVersion = kbnVersion;
$scope.report = marvelOpts.report;
// If the user hasn't opted in or out, ask them to.
if(marvelOpts.version == null || marvelOpts.version !== kbnVersion) {
@ -137,6 +138,7 @@ function (angular, app, kbn, _) {
$scope.setOptIn = function(val) {
marvelOpts.version = kbnVersion;
marvelOpts.report = val;
$scope.report = val;
};
$scope.clearMarvelStorage = function() {
@ -149,6 +151,7 @@ function (angular, app, kbn, _) {
var panelModal = $modal({
template: './app/panels/marvel/cluster/optin.html',
persist: true,
backdrop: 'static',
show: false,
scope: $scope,
keyboard: false
@ -242,4 +245,4 @@ function (angular, app, kbn, _) {
});
});
});

View file

@ -1,32 +1,16 @@
<div class="modal-body">
<h2>Welcome to Elasticsearch Marvel</h2>
<div style="max-width: 600px;">
<p>
You're all set up! If you need a bit of help you can always visit
<a href="http://www.elasticsearch.org/overview/marvel/" target="_blank">Marvel's web page</a>
<p/>
<h5>A friendly request</h5>
<p>
Help us make Elasticsearch better by sharing your cluster statistics with us.
Totally <strong>anonymous</strong> and <strong>never</strong> shared with anyone. Not ever.
Curious what we see? <span class="link" ng-click="showSample=true">View report here</span>
</p>
<p>
Thx,<br>
The Elasticsearch Dev Team
</p>
<div ng-show="showSample">
<h5>Sample Statistics</h5>
<pre>{{ data | json }}</pre>
</div>
<div class="modal-body" style="text-align: center;">
<h2>Try Marvel for Free in Development</h2>
<p class="lead">Like it? Then <a href="http://www.elasticsearch.com/marvel/" target="_BLANK">buy a license</a> for production, only $500 for your first 5 nodes.<br/>
…or talk to us about our <a href="http://www.elasticsearch.com/support/" target="_BLANK">annual support packages</a> that include Marvel for free.</p>
<p>
<a href="http://www.elasticsearch.com/marvel/" target="_BLANK" class="btn btn-success">Buy Marvel Now</a>
<a class="btn btn-success" ng-click="setOptIn(report);dismiss();">Continue Free Trial</a>
</p>
<p>Sharing your cluster statistics with us to help us improve. Totally anonymous and never shared with <br/>
anyone. Not ever. Curious what we see? <a ng-click="showSample=true">View report here</a>. <span ng-show="report">Not interested? <a ng-click="setOptIn(false);">Opt out here</a></span><span ng-hide="report">Opted Out? <a ng-click="setOptIn(true);">Click here to opt back in.</a></span></p>
<div ng-show="showSample" style="text-align: left;">
<h5>Sample Statistics</h5>
<span class="close" ng-click="showSample=false" style="margin: 10px 10px; font-size: 30px;">&times;</span>
<pre>{{ data | json }}</pre>
</div>
<div class="modal-footer">
<button ng-click="setOptIn(true);dismiss();" class="btn btn-success">Count me in!</button>
<span ng-click="setOptIn(false);dismiss();" class="pointer small">No Thanks</span>
</div>
</div>

View file

@ -335,6 +335,8 @@ define([
return;
}
$scope.panel.error = false;
var
request,
filter,
@ -385,6 +387,11 @@ define([
// populate the summary data based on the other facets
newData = {};
// Check for error and abort if found
if(!(_.isUndefined(r.error))) {
$scope.panel.error = $scope.parse_error(r.error);
return;
}
_.each(r.facets['timestamp'].terms, function (f) {
if (!$scope.panel.show_hidden && f.term[0] === ".") {