diff --git a/src/client/pages/Servers.tsx b/src/client/pages/Servers.tsx index b1cb785..020ca12 100644 --- a/src/client/pages/Servers.tsx +++ b/src/client/pages/Servers.tsx @@ -7,6 +7,8 @@ import { useSocketSubscribe } from '../api/socketio'; import { filesize } from 'filesize'; import prettyMilliseconds from 'pretty-ms'; import { UpDownCounter } from '../components/UpDownCounter'; +import { max } from 'lodash-es'; +import dayjs from 'dayjs'; export const Servers: React.FC = React.memo(() => { const [isModalOpen, setIsModalOpen] = useState(false); @@ -57,6 +59,7 @@ export const ServerList: React.FC = React.memo(() => { ); const dataSource = Object.values(serverMap); + const lastUpdatedAt = max(dataSource.map((d) => d.updatedAt)); const columns = useMemo((): ColumnsType => { return [ @@ -141,12 +144,17 @@ export const ServerList: React.FC = React.memo(() => { }, []); return ( - +
+
+ Last updated at: {dayjs(lastUpdatedAt).format('YYYY-MM-DD HH:mm:ss')} +
+
+ ); }); ServerList.displayName = 'ServerList';