fixed types
This commit is contained in:
parent
0848e98d5e
commit
a530eaf521
2 changed files with 8 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ export function useConnections() {
|
||||||
setConnections(prev =>
|
setConnections(prev =>
|
||||||
prev.map(conn =>
|
prev.map(conn =>
|
||||||
conn.id === connectionId
|
conn.id === connectionId
|
||||||
? { ...conn, status: 'inactive' as any, lastChecked: new Date().toISOString() }
|
? { ...conn, status: 'inactive' as any, lastChecked: Math.floor(Date.now() / 1000) }
|
||||||
: conn
|
: conn
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,13 @@ function Dashboard() {
|
||||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i];
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i];
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatDate = (dateString: string) => new Date(dateString).toLocaleString();
|
const formatDate = (dateValue: string | number) => {
|
||||||
|
if (typeof dateValue === 'number') {
|
||||||
|
// Convert from seconds to milliseconds for Date constructor
|
||||||
|
return new Date(dateValue * 1000).toLocaleString();
|
||||||
|
}
|
||||||
|
return new Date(dateValue).toLocaleString();
|
||||||
|
};
|
||||||
|
|
||||||
const getStatusColor = (status: string) => {
|
const getStatusColor = (status: string) => {
|
||||||
switch (status.toLowerCase()) {
|
switch (status.toLowerCase()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue