Skip to content

Commit

Permalink
Merge branch 'implement/pluginSpecificStatus' into pr/7454
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Jun 15, 2016
2 parents 1556b81 + e232e07 commit 8296efc
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 73 deletions.
40 changes: 11 additions & 29 deletions src/plugins/status_page/public/status_page.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="container state_default state_{{ui.serverState}}">
<div class="container overall_state_default overall_state_{{ui.serverState}}">
<header>
<h1>
Status: <span class="state_color">{{ ui.serverStateMessage }}</span>
<i class="fa state_color state_icon" />
Status: <span class="overall_state_color">{{ ui.serverStateMessage }}</span>
<i class="fa overall_state_color state_icon" />
<span class="pull-right">
{{ ui.name }}
</span>
Expand All @@ -15,45 +15,27 @@ <h1>
</div>
</div>

<div class="row status_statuses_wrapper">
<div class="row statuses_wrapper">
<h3>Status Breakdown</h3>

<div ng-if="!ui.statuses && ui.loading" class="loading_statuses">
<div ng-if="!ui.statuses && ui.loading" class="statuses_loading">
<span class="spinner"></span>
</div>

<h4 ng-if="!ui.statuses && !ui.loading" class="missing_statuses">
<h4 ng-if="!ui.statuses && !ui.loading" class="statuses_missing">
No status information available
</h4>

<table class="status_statuses_breakdown" ng-if="ui.statuses.services">
<table class="statuses" data-test-subj="statusBreakdown" ng-if="ui.statuses">
<tr class="row">
<th class="col-xs-4">Service</th>
<th class="col-xs-4">ID</th>
<th class="col-xs-8">Status</th>
</tr>
<tr
ng-repeat="status in ui.statuses.services"
class="status_row status_state_default status_state_{{status.state}} row">
ng-repeat="status in ui.statuses"
class="status status_state_default status_state_{{status.state}} row">

<td class="col-xs-4 status_name">{{status.id}}</td>
<td class="col-xs-8 status_message">
<i class="fa status_state_color status_state_icon" />
{{status.message}}
</td>
</tr>
</table>
<table class="status_statuses_breakdown" data-test-subj="pluginStatusBreakdown" ng-if="ui.statuses.plugins">
<tr class="row">
<th class="col-xs-2">Plugin</th>
<th class="col-xs-2">Version</th>
<th class="col-xs-8">Status</th>
</tr>
<tr
ng-repeat="status in ui.statuses.plugins"
class="status_row status_state_default status_state_{{status.state}} row">

<td class="col-xs-2 status_name">{{status.plugin.id}}</td>
<td class="col-xs-2 status_version">{{status.plugin.version}}</td>
<td class="col-xs-4 status_id">{{status.id}}</td>
<td class="col-xs-8 status_message">
<i class="fa status_state_color status_state_icon" />
{{status.message}}
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/status_page/public/status_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ const chrome = require('ui/chrome')
ui.metrics = data.metrics;
ui.name = data.name;

ui.statuses = _.groupBy(data.status.statuses, s => s.plugin ? 'plugins' : 'services');
if (!_.size(ui.statuses)) ui.statuses = null;
ui.statuses = data.status.statuses;

const overall = data.status.overall;
if (!ui.serverState || (ui.serverState !== overall.state)) {
Expand Down
28 changes: 14 additions & 14 deletions src/plugins/status_page/public/status_page.less
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
}

// status status table section
.status_statuses_wrapper {
.statuses_wrapper {
margin-top: 25px;
margin-left: -5px;
margin-right: -5px;
Expand All @@ -72,18 +72,18 @@
margin-bottom: 3px;
}

.missing_statuses,
.loading_statuses {
.statuses_loading,
.statuses_missing {
padding: 20px;
text-align: center;
}

.status_statuses_breakdown {
.statuses {
margin-left: 0;
margin-right: 0;
margin-bottom: 30px;

.status_row {
.status {
height:30px;
line-height:30px;
border-bottom:1px solid;
Expand All @@ -99,7 +99,7 @@
border-bottom-color: @status-statuses-border;
}

.status_name {
.status_id {
padding:0px 5px;
border-left: 2px solid;
}
Expand All @@ -122,7 +122,7 @@
content: @icon;
}

.status_name {
.status_id {
border-left-color: @color !important;
}

Expand All @@ -149,31 +149,31 @@

//server state
.state(@color, @icon) {
.state_color {
.overall_state_color {
color: @color;
}

.state_icon:before {
.overall_state_icon:before {
content: @icon;
}

.status_statuses_wrapper {
.statuses_wrapper {
border-top-color: @color;
}
}

.state_default {
.overall_state_default {
.state(@status-default, @icon-default);
}

.state_green {
.overall_state_green {
.state(@status-green, @icon-green);
}

.state_yellow {
.overall_state_yellow {
.state(@status-yellow, @icon-yellow);
}

.state_red {
.overall_state_red {
.state(@status-red, @icon-red);
}
1 change: 0 additions & 1 deletion src/server/status/__tests__/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ describe('Status class', function () {

let json = status.toJSON();
expect(json.id).to.eql(status.id);
expect(json.plugin).to.eql({ id: plugin.id, version: plugin.version });
expect(json.state).to.eql('green');
expect(json.message).to.eql('Ready');
});
Expand Down
22 changes: 0 additions & 22 deletions src/server/status/plugin_status.js

This file was deleted.

5 changes: 2 additions & 3 deletions src/server/status/server_status.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import _ from 'lodash';

import states from './states';
import Status from './status';
import PluginStatus from './plugin_status';

module.exports = class ServerStatus {
constructor(server) {
Expand All @@ -17,8 +16,8 @@ module.exports = class ServerStatus {
}

createForPlugin(plugin) {
const status = new PluginStatus(plugin, this.server);
this._created[status.id] = status;
const status = this.create(`plugin:${plugin.id}@${plugin.version}`);
status.plugin = plugin;
return status;
}

Expand Down
4 changes: 2 additions & 2 deletions test/functional/status_page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ bdd.describe('status page', function () {
var self = this;

return common.tryForTime(6000, function () {
return common.findTestSubject('pluginStatusBreakdown')
return common.findTestSubject('statusBreakdown')
.getVisibleText()
.then(function (text) {
common.saveScreenshot('Status');
expect(text.indexOf('kibana 1.0.0 Ready')).to.be.above(-1);
expect(text.indexOf('plugin:kibana')).to.be.above(-1);
});
})
.catch(common.handleError(self));
Expand Down

0 comments on commit 8296efc

Please sign in to comment.