-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show event logs in the console (#17)
* Event logs * [Not currently implemented] 'Pipelines UI' * Bare bones date range logic (will evolve as we see what's useful). --------- Co-authored-by: Zack <[email protected]>
- Loading branch information
Showing
36 changed files
with
985 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script> | ||
import { ArrowLeftSolid } from 'flowbite-svelte-icons'; | ||
</script> | ||
|
||
<div | ||
class="pl-8 pr-8 md:pl-20 md:pr-20 py-9 w-full flex justify-between border-solid border-b items-center border-grey dark:border-white dark:border-opacity-10" | ||
> | ||
<a href="/console/advanced"> | ||
<ArrowLeftSolid class="dark:text-white text-black" /> | ||
</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<div class="flex items-center justify-center h-screen"> | ||
<div /> | ||
<img src="/images/casey-white.svg" alt="Hiphops logo" class="animate-ping" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div | ||
class="rounded-sm px-2 py-1 w-fit mb-2 text-xs font-medium dark:text-midgrey text-grey bg-lightgrey dark:bg-almostblack" | ||
> | ||
<slot /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import TimeAgo from 'javascript-time-ago'; | ||
import en from 'javascript-time-ago/locale/en'; | ||
|
||
export interface Event { | ||
hops: { | ||
action: string; | ||
event: string; | ||
source: string; | ||
}; | ||
|
||
timestamp: number; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
[key: string]: any; | ||
} | ||
|
||
export interface EventLog { | ||
start_timestamp: string; | ||
end_timestamp: string; | ||
event_items: EventItem[]; | ||
} | ||
|
||
export interface EventItem { | ||
event: Event; | ||
sequence_id: string; | ||
timestamp: string; | ||
} | ||
|
||
export interface EventTable { | ||
timestamp: string; // '2023-11-22T10:44:00.518137754Z'; | ||
eventId: string; | ||
event: string; | ||
source: string; | ||
action: string; | ||
JSON: { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
[key: string]: any; | ||
}; | ||
} | ||
|
||
export function eventToTable(eventItem: EventItem): EventTable { | ||
return { | ||
timestamp: new Date(eventItem.timestamp).toLocaleString(), | ||
eventId: eventItem.sequence_id, | ||
event: eventItem.event.hops.event, | ||
source: eventItem.event.hops.source, | ||
action: eventItem.event.hops.action || '', | ||
JSON: eventItem.event | ||
}; | ||
} | ||
|
||
TimeAgo.addLocale(en); | ||
const timeAgo = new TimeAgo('en'); | ||
|
||
export function ago(startTimestamp: string): string { | ||
const then = new Date(startTimestamp); | ||
console.log(timeAgo.format(then)); | ||
return timeAgo.format(then); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<td | ||
class=" border-r border-b border-midgrey dark:border-almostblack p-2 last:border-r-0 text-grey dark:text-midgrey text-sm" | ||
> | ||
<slot /> | ||
</td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<th | ||
class=" border-r border-b border-midgrey dark:border-almostblack p-2 last:border-b last:border-r-0 text-black dark:text-midgrey font-medium text-sm" | ||
> | ||
<slot /> | ||
</th> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.