@@ -1,4 +1,4 @@
|
|||||||
import {Badge, Card, Space, Table, Tag} from "antd";
|
import {Card, Table, Tag} from "antd";
|
||||||
import LoadingSkeleton from "../../loading-skeleton/loading-skeleton.component";
|
import LoadingSkeleton from "../../loading-skeleton/loading-skeleton.component";
|
||||||
import {useTranslation} from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
import React, {useEffect, useState} from "react";
|
import React, {useEffect, useState} from "react";
|
||||||
@@ -6,7 +6,7 @@ import moment from "moment";
|
|||||||
import DashboardRefreshRequired from "../refresh-required.component";
|
import DashboardRefreshRequired from "../refresh-required.component";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const fortyFiveDaysAgo = () =>moment().subtract(45, 'days').toLocaleString();
|
const fortyFiveDaysAgo = () => moment().subtract(45, 'days').toLocaleString();
|
||||||
|
|
||||||
export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardProps}) {
|
export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardProps}) {
|
||||||
const {t} = useTranslation();
|
const {t} = useTranslation();
|
||||||
@@ -29,7 +29,7 @@ export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardP
|
|||||||
getLifecycleData().catch(e => {
|
getLifecycleData().catch(e => {
|
||||||
console.error(`Error in getLifecycleData: ${e}`);
|
console.error(`Error in getLifecycleData: ${e}`);
|
||||||
})
|
})
|
||||||
}, [data]);
|
}, [data, bodyshop]);
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
@@ -58,7 +58,7 @@ export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardP
|
|||||||
dataIndex: 'percentage',
|
dataIndex: 'percentage',
|
||||||
key: 'percentage',
|
key: 'percentage',
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.percentage.toFixed(2)+'%';
|
return record.percentage.toFixed(2) + '%';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -70,7 +70,7 @@ export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardP
|
|||||||
const extra = `${t('job_lifecycle.content.calculated_based_on')} ${lifecycleData.jobs} ${t('job_lifecycle.content.jobs_in_since')} ${fortyFiveDaysAgo()}`
|
const extra = `${t('job_lifecycle.content.calculated_based_on')} ${lifecycleData.jobs} ${t('job_lifecycle.content.jobs_in_since')} ${fortyFiveDaysAgo()}`
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card title={t("job_lifecycle.titles.dashboard")} {...cardProps}>
|
<Card title={t("job_lifecycle.titles.dashboard")} {...cardProps}>
|
||||||
<LoadingSkeleton loading={loading}>
|
<LoadingSkeleton loading={loading}>
|
||||||
<div style={{overflow: 'scroll', height: "100%"}}>
|
<div style={{overflow: 'scroll', height: "100%"}}>
|
||||||
<div id="bar-container" style={{
|
<div id="bar-container" style={{
|
||||||
@@ -149,7 +149,8 @@ export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardP
|
|||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
<Card style={{marginTop: "5px"}} type='inner' title={t("job_lifecycle.titles.top_durations")}>
|
<Card style={{marginTop: "5px"}} type='inner' title={t("job_lifecycle.titles.top_durations")}>
|
||||||
<Table size="small" pagination={false} columns={columns} dataSource={ lifecycleData.summations.sort((a, b) => b.value - a.value).slice(0, 3)}/>
|
<Table size="small" pagination={false} columns={columns}
|
||||||
|
dataSource={lifecycleData.summations.sort((a, b) => b.value - a.value).slice(0, 3)}/>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</LoadingSkeleton>
|
</LoadingSkeleton>
|
||||||
|
|||||||
Reference in New Issue
Block a user