Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding instance details tooltip to the agent page. This offers some b…
…asic information on the each agent
- Loading branch information
1 parent
0e6e33c
commit ff12085
Showing
6 changed files
with
118 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.tooltip { | ||
display:none; | ||
text-align: left; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { Component, PropTypes } from 'react'; | ||
import tippy from 'tippy.js'; | ||
import './tooltip.css'; | ||
|
||
|
||
class Tooltip extends Component { | ||
get defaultSettings() { | ||
return { | ||
trigger: 'mouseenter', | ||
arrow: true, | ||
html: `#${this.props.tooltipId}` | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
tippy(this.props.triggerId, this.props.tippySettings || this.defaultSettings); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="tooltip" id={this.props.tooltipId}> | ||
{this.props.children || this.props.title} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
Tooltip.propTypes = { | ||
tooltipId: PropTypes.string.isRequired, | ||
triggerId: PropTypes.string.isRequired, | ||
tippySettings: PropTypes.object, | ||
title: PropTypes.string | ||
}; | ||
|
||
export default Tooltip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import AWS from 'aws-sdk'; | ||
import awsRequest from '../awsRequest'; | ||
|
||
|
||
|
||
function describeEc2Instance(instanceId) { | ||
return function (awsConfig) { | ||
const ec2 = new AWS.EC2(awsConfig); | ||
return ec2.describeInstances({ | ||
InstanceIds: [instanceId] | ||
}) | ||
.promise() | ||
.then(response => response.Reservations[0].Instances[0]); // remove the noise, give us the instance data. | ||
}; | ||
} | ||
|
||
export function getEc2InstanceDetails(instanceId) { | ||
const detailsReq = describeEc2Instance(instanceId); | ||
return awsRequest.create(detailsReq); | ||
} |