mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 10:41:14 +00:00
* Initial top level control. * Added the jump buttons. * Tiny styling adjustments. * Massive renaming. * Pause info * Added slider marks. * Improved messaging. * Freeze all updates when paused. * Repositioned for Configure button. * Improved the flow. * Working browsing through slider. * Small styling. * Hide time travel button behind the feature flag. * Fixed actions. * Elements positioning corner cases. * Removed nodes delta buffering code. * Fixed the flow. * Fixed almost all API call cases. * Final touches * Fixed the tests. * Fix resource view updates when time travelling. * Added some comments. * Addressed some of @foot's comments.
30 lines
873 B
JavaScript
30 lines
873 B
JavaScript
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
// TODO: Move this back into TimeTravelControls once we move away from CloudFeature.
|
|
class TimeTravelButton extends React.Component {
|
|
render() {
|
|
const { className, onClick, isTimeTravelling, hasTimeTravel } = this.props;
|
|
|
|
if (!hasTimeTravel) return null;
|
|
|
|
return (
|
|
<span className={className} onClick={onClick} title="Travel back in time">
|
|
{isTimeTravelling && <span className="fa fa-clock-o" />}
|
|
<span className="label">Time Travel</span>
|
|
</span>
|
|
);
|
|
}
|
|
}
|
|
|
|
function mapStateToProps({ root }, { params }) {
|
|
const cloudInstance = root.instances[params.orgId] || {};
|
|
const featureFlags = cloudInstance.featureFlags || [];
|
|
return {
|
|
hasTimeTravel: featureFlags.includes('time-travel'),
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps)(TimeTravelButton);
|