1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-28 06:00:06 +02:00

style(cp-frontend): format

This commit is contained in:
Sérgio Ramos 2017-08-30 12:17:21 +01:00
parent 441d4118d7
commit 468604058e
4 changed files with 32 additions and 13 deletions

View File

@ -11,7 +11,10 @@ export const MetricNames = [
export const withServiceMetricsPolling = ({
pollingInterval = 1000, // in milliseconds
getPreviousEnd = () => moment().utc().format()
getPreviousEnd = () =>
moment()
.utc()
.format()
}) => {
return WrappedComponent => {
return class extends Component {
@ -68,12 +71,15 @@ export const withServiceMetricsGql = ({
...instance,
metrics: instance.metrics.map(metric => ({
...metric,
metrics: uniqBy(getPreviousMetrics(
previousResult,
service.id,
instance.id,
metric.name
).concat(metric.metrics), 'time')
metrics: uniqBy(
getPreviousMetrics(
previousResult,
service.id,
instance.id,
metric.name
).concat(metric.metrics),
'time'
)
}))
}))
}))

View File

@ -77,7 +77,13 @@ export default compose(
return false;
}
return get(service, 'instances[0].metrics[0].end', moment().utc().format());
return get(
service,
'instances[0].metrics[0].end',
moment()
.utc()
.format()
);
}
}),
withNotFound([GqlPaths.DEPLOYMENT_GROUP, GqlPaths.SERVICES])

View File

@ -110,9 +110,7 @@ export class ServiceList extends Component {
? 'An error occurred while attempting to restart your service.'
: '';
renderedError = (
<ErrorMessage title="Ooops!" message={message} />
);
renderedError = <ErrorMessage title="Ooops!" message={message} />;
}
const serviceList = sortBy(services, ['slug'])
@ -191,7 +189,12 @@ export default compose(
.filter(Boolean)
.shift();
return previousEnd || moment().utc().format();
return (
previousEnd ||
moment()
.utc()
.format()
);
}
}),
UiConnect,

View File

@ -58,7 +58,11 @@ const GraphNodeInfo = ({ data, pos }) => {
))
);
const healthy = <HealthyIcon healthy={instancesHealthy.total === instancesHealthy.healthy} />;
const healthy = (
<HealthyIcon
healthy={instancesHealthy.total === instancesHealthy.healthy}
/>
);
return (
<g transform={`translate(${x}, ${y})`}>