mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Updated fetch hook.
This commit is contained in:
parent
3374f875f3
commit
1fcb610bdd
6 changed files with 57 additions and 30 deletions
|
|
@ -94,14 +94,24 @@ export default function RealtimeLog({ data, websites }) {
|
|||
}
|
||||
}
|
||||
|
||||
function getTime({ created_at }) {
|
||||
return format(new Date(created_at), 'h:mm:ss');
|
||||
}
|
||||
|
||||
function getColor(row) {
|
||||
const { session_id } = row;
|
||||
|
||||
return stringToColor(uuids[session_id] || `${session_id}${getWebsite(row)}`);
|
||||
}
|
||||
|
||||
const Row = ({ index, style }) => {
|
||||
const row = logs[index];
|
||||
return (
|
||||
<div className={styles.row} style={style}>
|
||||
<div>
|
||||
<Dot color={stringToColor(uuids[row.session_id] || `${row.session_id}`)} />
|
||||
<Dot color={getColor(row)} />
|
||||
</div>
|
||||
<div className={styles.time}>{format(new Date(row.created_at), 'h:mm:ss')}</div>
|
||||
<div className={styles.time}>{getTime(row)}</div>
|
||||
<div className={styles.detail}>
|
||||
<Icon className={styles.icon} icon={getIcon(row)} />
|
||||
{getDetail(row)}
|
||||
|
|
|
|||
|
|
@ -34,15 +34,12 @@
|
|||
|
||||
.website {
|
||||
text-align: right;
|
||||
padding-right: 20px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.detail {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.detail span {
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue