mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-11-02 03:37:59 +00:00
seconds to hh:mm:ss format
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import React, { useEffect, useContext } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import moment from 'moment';
|
||||
import { useLazyQuery } from '@apollo/react-hooks';
|
||||
import { Alert } from 'antd';
|
||||
import { floor, padStart } from 'lodash';
|
||||
import { NetworkTable, Loading } from '@tip-wlan/wlan-cloud-ui-library';
|
||||
|
||||
import UserContext from 'contexts/UserContext';
|
||||
import { FILTER_EQUIPMENT } from 'graphql/queries';
|
||||
import styles from './index.module.scss';
|
||||
@@ -22,6 +23,13 @@ const renderTableCell = tabCell => {
|
||||
return tabCell;
|
||||
};
|
||||
|
||||
const durationToString = duration =>
|
||||
`${floor(duration.asHours())}h ${padStart(duration.minutes(), 2, 0)}m ${padStart(
|
||||
duration.seconds(),
|
||||
2,
|
||||
0
|
||||
)}s`;
|
||||
|
||||
const accessPointsTableColumns = [
|
||||
{
|
||||
title: 'NAME',
|
||||
@@ -61,7 +69,7 @@ const accessPointsTableColumns = [
|
||||
{
|
||||
title: 'UP TIME',
|
||||
dataIndex: ['status', 'osPerformance', 'details', 'uptimeInSeconds'],
|
||||
render: renderTableCell,
|
||||
render: upTimeInSeconds => durationToString(moment.duration(upTimeInSeconds, 'seconds')),
|
||||
},
|
||||
{
|
||||
title: 'PROFILE',
|
||||
|
||||
Reference in New Issue
Block a user