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

style: format

This commit is contained in:
Sérgio Ramos 2017-08-30 17:00:42 +01:00
parent 9c4d69d586
commit 2b46af7e2f
3 changed files with 43 additions and 43 deletions

View File

@ -179,23 +179,22 @@ const ServiceListItem = ({
); );
} }
const graphs = !children.length && Object.keys(service.metrics).length const graphs =
? Object.keys(service.metrics).map(key => ( !children.length && Object.keys(service.metrics).length
<GraphContainer xs={4}> ? Object.keys(service.metrics).map(key => (
<GraphLeftShaddow /> <GraphContainer xs={4}>
<GraphTitle>{key}</GraphTitle> <GraphLeftShaddow />
<MetricGraph <GraphTitle>{key}</GraphTitle>
key={key} <MetricGraph
metricsData={service.metrics[key]} key={key}
graphDurationSeconds={90} metricsData={service.metrics[key]}
/> graphDurationSeconds={90}
</GraphContainer> />
)) </GraphContainer>
: null; ))
: null;
const metrics = graphs ? ( const metrics = graphs ? <GraphsContainer>{graphs}</GraphsContainer> : null;
<GraphsContainer>{graphs}</GraphsContainer>
) : null;
const view = children.length ? ( const view = children.length ? (
<CardGroupView>{childrenItems}</CardGroupView> <CardGroupView>{childrenItems}</CardGroupView>

View File

@ -61,10 +61,7 @@ export const withServiceMetricsGql = ({
return []; return [];
} }
const service = find(services, [ const service = find(services, ['id', serviceId]);
'id',
serviceId
]);
if (!service) { if (!service) {
return []; return [];

View File

@ -696,32 +696,36 @@ class Data extends EventEmitter {
return cb(err); return cb(err);
} }
cb(err, ForceArray(result.successes).map(({ name, instances }) => ({ cb(err, ForceArray(result.successes).map(({ name, instances }) => {
id: Uuid(), return {
serviceName: name, id: Uuid(),
replicas: ForceArray(instances).length serviceName: name,
}))); replicas: ForceArray(instances).length
};
}));
}; };
const handleServices = ({ dg }) => (err, services) => { const handleServices = ({ dg }) => {
if (err) { return (err, services) => {
return cb(err); if (err) {
} return cb(err);
VAsync.forEachParallel({
inputs: services,
func: (service, next) => {
service.instances({}, (err, instances) => {
if (err) {
return next(err);
}
next(err, Object.assign({}, service, {
instances
}));
});
} }
}, handleServiceInstanceMap);
VAsync.forEachParallel({
inputs: services,
func: (service, next) => {
service.instances({}, (err, instances) => {
if (err) {
return next(err);
}
next(err, Object.assign({}, service, {
instances
}));
});
}
}, handleServiceInstanceMap);
};
}; };
const handleDeploymentGroup = (err, dg) => { const handleDeploymentGroup = (err, dg) => {