Merge pull request #6610 from jbudz/server-name

[config] server name
This commit is contained in:
Rashid Khan 2016-03-24 10:18:08 -07:00
commit fd2f9d87ce
9 changed files with 19 additions and 1 deletions

View file

@ -11,6 +11,9 @@
# The maximum payload size in bytes for incoming server requests.
# server.maxPayloadBytes: 1048576
# The Kibana server's name. This is used for display purposes.
# server.name: "your-hostname"
# The URL of the Elasticsearch instance to use for all your queries.
# elasticsearch.url: "http://localhost:9200"

View file

@ -21,6 +21,11 @@
<td>{{buildSha | limitTo:7}}</td>
</tr>
<tr>
<td>Server name</td>
<td>{{serverName}}</td>
</tr>
</table>
</p>
<small>© 2015 All Rights Reserved - <a href="https://elastic.co">Elasticsearch</a></small>

View file

@ -10,10 +10,11 @@ uiRoutes
});
uiModules.get('apps/settings')
.controller('settingsAbout', function ($scope, kbnVersion, buildNum, buildSha) {
.controller('settingsAbout', function ($scope, kbnVersion, buildNum, buildSha, serverName) {
$scope.kbnVersion = kbnVersion;
$scope.buildNum = buildNum;
$scope.buildSha = buildSha;
$scope.serverName = serverName;
});
registry.register(_.constant({

View file

@ -3,6 +3,9 @@
<h1>
Status: <span class="state_color">{{ ui.serverStateMessage }}</span>
<i class="fa state_color state_icon" />
<span class="pull-right">
{{ ui.name }}
</span>
</h1>
</header>

View file

@ -29,6 +29,7 @@ const chrome = require('ui/chrome')
const data = resp.data;
ui.metrics = data.metrics;
ui.statuses = data.status.statuses;
ui.name = data.name;
const overall = data.status.overall;
if (!ui.serverState || (ui.serverState !== overall.state)) {

View file

@ -3,6 +3,7 @@ import fs from 'fs';
import path from 'path';
import { get } from 'lodash';
import { randomBytes } from 'crypto';
import os from 'os';
import fromRoot from '../../utils/from_root';
@ -29,6 +30,7 @@ module.exports = () => Joi.object({
}).default(),
server: Joi.object({
name: Joi.string().default(os.hostname()),
host: Joi.string().hostname().default('0.0.0.0'),
port: Joi.number().default(5601),
maxPayloadBytes: Joi.number().default(1048576),

View file

@ -14,6 +14,7 @@ module.exports = function (kbnServer, server, config) {
path: '/api/status',
handler: function (request, reply) {
return reply({
name: config.get('server.name'),
status: kbnServer.status.toJSON(),
metrics: kbnServer.metrics
});

View file

@ -67,6 +67,7 @@ module.exports = async (kbnServer, server, config) => {
buildNum: config.get('pkg.buildNum'),
buildSha: config.get('pkg.buildSha'),
basePath: config.get('server.basePath'),
serverName: config.get('server.name'),
vars: defaults(app.getInjectedVars() || {}, uiExports.defaultInjectedVars),
};

View file

@ -17,6 +17,7 @@ module.exports = function (chrome, internals) {
.value('kbnVersion', internals.version)
.value('buildNum', internals.buildNum)
.value('buildSha', internals.buildSha)
.value('serverName', internals.serverName)
.value('sessionId', Date.now())
.value('chrome', chrome)
.value('esUrl', (function () {