-
Notifications
You must be signed in to change notification settings - Fork 92
feat(new-webui): Integrate database queries for IngestPage dashboard components. #910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c446289
feat(new-webui): Connect the ingestion page to SQL server.
hoophalab 977bdf3
Fix coderabbit comments.
hoophalab c3cc97f
fix: Query SQL in each widget.
hoophalab 2fc3f14
Fix coderabbit comments.
hoophalab 6d93f14
refactor: Move column names to `sqlConfig.ts`
hoophalab 68190ca
fix comments
hoophalab dc7ec64
rename zustand
hoophalab a873236
fix comments
hoophalab 03f6ae7
Merge branch 'main' into ingestion-data
hoophalab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 7 additions & 5 deletions
12
components/log-viewer-webui/client/src/pages/IngestPage/Details/Files.tsx
This file contains hidden or 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
12 changes: 7 additions & 5 deletions
12
components/log-viewer-webui/client/src/pages/IngestPage/Details/Messages.tsx
This file contains hidden or 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
22 changes: 13 additions & 9 deletions
22
components/log-viewer-webui/client/src/pages/IngestPage/Details/TimeRange.tsx
This file contains hidden or 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
73 changes: 70 additions & 3 deletions
73
components/log-viewer-webui/client/src/pages/IngestPage/Details/index.tsx
This file contains hidden or 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
47 changes: 47 additions & 0 deletions
47
components/log-viewer-webui/client/src/pages/IngestPage/Details/sql.ts
This file contains hidden or 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,47 @@ | ||
| import { | ||
| CLP_ARCHIVES_TABLE_COLUMN_NAMES, | ||
| CLP_FILES_TABLE_COLUMN_NAMES, | ||
| SQL_CONFIG, | ||
| } from "../sqlConfig"; | ||
|
|
||
|
|
||
| /** | ||
| * Builds the query string to query stats. | ||
| * | ||
| * @return | ||
| */ | ||
|
hoophalab marked this conversation as resolved.
|
||
| const getDetailsSql = () => ` | ||
| SELECT | ||
| a.begin_timestamp AS begin_timestamp, | ||
| a.end_timestamp AS end_timestamp, | ||
| b.num_files AS num_files, | ||
| b.num_messages AS num_messages | ||
| FROM | ||
| ( | ||
| SELECT | ||
| MIN(${CLP_ARCHIVES_TABLE_COLUMN_NAMES.BEGIN_TIMESTAMP}) AS begin_timestamp, | ||
| MAX(${CLP_ARCHIVES_TABLE_COLUMN_NAMES.END_TIMESTAMP}) AS end_timestamp | ||
| FROM ${SQL_CONFIG.SqlDbClpArchivesTableName} | ||
| ) a, | ||
| ( | ||
| SELECT | ||
| NULLIF(COUNT(DISTINCT ${CLP_FILES_TABLE_COLUMN_NAMES.ORIG_FILE_ID}), 0) AS num_files, | ||
| SUM(${CLP_FILES_TABLE_COLUMN_NAMES.NUM_MESSAGES}) AS num_messages | ||
| FROM ${SQL_CONFIG.SqlDbClpFilesTableName} | ||
| ) b; | ||
|
hoophalab marked this conversation as resolved.
|
||
| `; | ||
|
hoophalab marked this conversation as resolved.
|
||
|
|
||
|
hoophalab marked this conversation as resolved.
|
||
| interface DetailsItem { | ||
| begin_timestamp: number; | ||
| end_timestamp: number; | ||
| num_files: number; | ||
| num_messages: number; | ||
| } | ||
|
hoophalab marked this conversation as resolved.
|
||
|
|
||
| type DetailsResp = DetailsItem[]; | ||
|
|
||
| export type { | ||
| DetailsItem, | ||
| DetailsResp, | ||
| }; | ||
| export {getDetailsSql}; | ||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.