From 0c5331d33ca8e5579b99734678839ca47df3b14b Mon Sep 17 00:00:00 2001 From: David Kaltschmidt Date: Fri, 4 Dec 2015 15:45:16 +0100 Subject: [PATCH] Render hostname in UI --- client/app/scripts/actions/app-actions.js | 1 + client/app/scripts/components/app.js | 5 +++-- client/app/scripts/stores/app-store.js | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/client/app/scripts/actions/app-actions.js b/client/app/scripts/actions/app-actions.js index 6dc3c3250a..491f33a718 100644 --- a/client/app/scripts/actions/app-actions.js +++ b/client/app/scripts/actions/app-actions.js @@ -167,6 +167,7 @@ export function receiveTopologies(topologies) { export function receiveApiDetails(apiDetails) { AppDispatcher.dispatch({ type: ActionTypes.RECEIVE_API_DETAILS, + hostname: apiDetails.hostname, version: apiDetails.version }); } diff --git a/client/app/scripts/components/app.js b/client/app/scripts/components/app.js index 6f6e7af3c7..de024c07f0 100644 --- a/client/app/scripts/components/app.js +++ b/client/app/scripts/components/app.js @@ -25,6 +25,7 @@ function getStateFromStores() { errorUrl: AppStore.getErrorUrl(), highlightedEdgeIds: AppStore.getHighlightedEdgeIds(), highlightedNodeIds: AppStore.getHighlightedNodeIds(), + hostname: AppStore.getHostname(), selectedNodeId: AppStore.getSelectedNodeId(), nodeDetails: AppStore.getNodeDetails(), nodes: AppStore.getNodes(), @@ -68,7 +69,7 @@ export default class App extends React.Component { render() { const showingDetails = this.state.selectedNodeId; - const versionString = this.state.version ? 'Version ' + this.state.version : ''; + const footer = `Version ${this.state.version} on ${this.state.hostname}`; // width of details panel blocking a view const detailsWidth = showingDetails ? 450 : 0; const topMargin = 100; @@ -101,7 +102,7 @@ export default class App extends React.Component {
- {versionString}   + {footer}   Report an issue
diff --git a/client/app/scripts/stores/app-store.js b/client/app/scripts/stores/app-store.js index 1a2a956f7a..d01d158b34 100644 --- a/client/app/scripts/stores/app-store.js +++ b/client/app/scripts/stores/app-store.js @@ -51,7 +51,8 @@ let controlPending = false; let currentTopology = null; let currentTopologyId = 'containers'; let errorUrl = null; -let version = ''; +let hostname = '...'; +let version = '...'; let mouseOverEdgeId = null; let mouseOverNodeId = null; let nodes = makeOrderedMap(); @@ -198,6 +199,10 @@ export class AppStore extends Store { return null; } + getHostname() { + return hostname; + } + getNodeDetails() { return nodeDetails; } @@ -403,6 +408,7 @@ export class AppStore extends Store { case ActionTypes.RECEIVE_API_DETAILS: errorUrl = null; + hostname = payload.hostname; version = payload.version; this.__emitChange(); break;