style: format
This commit is contained in:
parent
d4aff642e3
commit
cceacbebab
@ -1,4 +1,4 @@
|
|||||||
import React, { Component } from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import remcalc from 'remcalc';
|
import remcalc from 'remcalc';
|
||||||
@ -8,13 +8,7 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
CardView,
|
CardView,
|
||||||
CardTitle,
|
CardTitle,
|
||||||
CardSubTitle,
|
CardHeader
|
||||||
CardDescription,
|
|
||||||
CardGroupView,
|
|
||||||
CardOptions,
|
|
||||||
CardHeader,
|
|
||||||
CardInfo,
|
|
||||||
Anchor
|
|
||||||
} from 'joyent-ui-toolkit';
|
} from 'joyent-ui-toolkit';
|
||||||
|
|
||||||
const MetricView = styled(CardView)`
|
const MetricView = styled(CardView)`
|
||||||
|
@ -16,7 +16,6 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
CardView,
|
CardView,
|
||||||
CardTitle,
|
CardTitle,
|
||||||
CardSubTitle,
|
|
||||||
CardDescription,
|
CardDescription,
|
||||||
CardGroupView,
|
CardGroupView,
|
||||||
CardOptions,
|
CardOptions,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { compose, graphql } from 'react-apollo';
|
import { graphql } from 'react-apollo';
|
||||||
import find from 'lodash.find';
|
import find from 'lodash.find';
|
||||||
import uniqBy from 'lodash.uniqby';
|
import uniqBy from 'lodash.uniqby';
|
||||||
import get from 'lodash.get';
|
import get from 'lodash.get';
|
||||||
@ -22,7 +22,7 @@ export const withServiceMetricsPolling = ({
|
|||||||
return class extends Component {
|
return class extends Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this._poll = setInterval(() => {
|
this._poll = setInterval(() => {
|
||||||
const { loading, error, service, fetchMoreMetrics } = this.props;
|
const { loading, fetchMoreMetrics } = this.props;
|
||||||
const previousEnd = getPreviousEnd(this.props);
|
const previousEnd = getPreviousEnd(this.props);
|
||||||
|
|
||||||
if (previousEnd) {
|
if (previousEnd) {
|
||||||
|
@ -30,7 +30,7 @@ export default paths => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { error, location, match } = this.props;
|
const { location, match } = this.props;
|
||||||
|
|
||||||
if (location.state && location.state.notFound) {
|
if (location.state && location.state.notFound) {
|
||||||
const notFound = location.state.notFound;
|
const notFound = location.state.notFound;
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
import React, { Component } from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import { compose } from 'react-apollo';
|
||||||
import { compose, graphql } from 'react-apollo';
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import ServiceMetricsQuery from '@graphql/ServiceMetrics.gql';
|
import ServiceMetricsQuery from '@graphql/ServiceMetrics.gql';
|
||||||
import { withNotFound, GqlPaths } from '@containers/navigation';
|
import { withNotFound, GqlPaths } from '@containers/navigation';
|
||||||
import { LayoutContainer } from '@components/layout';
|
import { LayoutContainer } from '@components/layout';
|
||||||
import { Title } from '@components/navigation';
|
import { Title } from '@components/navigation';
|
||||||
import { ServiceMetrics as ServiceMetricsComponent } from '@components/service';
|
import { ServiceMetrics as ServiceMetricsComponent } from '@components/service';
|
||||||
import { Button } from 'joyent-ui-toolkit';
|
|
||||||
import { Loader, ErrorMessage } from '@components/messaging';
|
import { Loader, ErrorMessage } from '@components/messaging';
|
||||||
import { processInstancesMetrics } from '@state/selectors';
|
import { processInstancesMetrics } from '@state/selectors';
|
||||||
import get from 'lodash.get';
|
import get from 'lodash.get';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { compose, graphql } from 'react-apollo';
|
import { compose } from 'react-apollo';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import forceArray from 'force-array';
|
import forceArray from 'force-array';
|
||||||
|
@ -172,11 +172,12 @@ const getMetrics = query => {
|
|||||||
return Promise.resolve(metrics);
|
return Promise.resolve(metrics);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getInstanceMetrics = ({ id }) => query => getMetrics(
|
const getInstanceMetrics = ({ id }) => query =>
|
||||||
Object.assign({}, query, {
|
getMetrics(
|
||||||
instanceId: id
|
Object.assign({}, query, {
|
||||||
})
|
instanceId: id
|
||||||
);
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const updateInstance = async query => {
|
const updateInstance = async query => {
|
||||||
await delay(0.5);
|
await delay(0.5);
|
||||||
@ -184,7 +185,10 @@ const updateInstance = async query => {
|
|||||||
const instanceIndex = findIndex(instances, ['id', query.id]);
|
const instanceIndex = findIndex(instances, ['id', query.id]);
|
||||||
const original = cleanQuery(instances[instanceIndex]);
|
const original = cleanQuery(instances[instanceIndex]);
|
||||||
|
|
||||||
instances[instanceIndex] = Object.assign(instances[instanceIndex], cleanQuery(query));
|
instances[instanceIndex] = Object.assign(
|
||||||
|
instances[instanceIndex],
|
||||||
|
cleanQuery(query)
|
||||||
|
);
|
||||||
|
|
||||||
emit('instance-updated', diff(original, instances[instanceIndex], 'name'));
|
emit('instance-updated', diff(original, instances[instanceIndex], 'name'));
|
||||||
|
|
||||||
@ -454,7 +458,7 @@ const getServiceInstances = async (query, { id }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getBranchInstances = async (query, instanceIds) =>
|
const getBranchInstances = async (query, instanceIds) =>
|
||||||
map(instanceIds, (id) => getInstance({ id }));
|
map(instanceIds, id => getInstance({ id }));
|
||||||
|
|
||||||
const getServiceBranches = async (query, { branches }) => {
|
const getServiceBranches = async (query, { branches }) => {
|
||||||
await delay(0.1);
|
await delay(0.1);
|
||||||
|
Loading…
Reference in New Issue
Block a user