mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-02 17:50:39 +00:00
Render hostname in UI
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
</Sidebar>
|
||||
|
||||
<div className="footer">
|
||||
{versionString}
|
||||
{footer}
|
||||
<a href="https://gitreports.com/issue/weaveworks/scope" target="_blank">Report an issue</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user