-
Notifications
You must be signed in to change notification settings - Fork 83
fix(new-webui): Add support for querying metadata from multiple datasets (fixes #1024). #1042
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
Changes from 14 commits
a4d1cd8
dab039b
89a8b04
0786e2c
9f33330
6e90915
038656f
1f0dc43
01a134f
e1bdcd5
0191277
7a9846d
f9512b9
e463470
4bdc128
36d91fb
6b72a6d
4235ed6
e7824cd
55a3e80
279e7ad
77b15c9
21e8eb2
481e230
661262c
883f849
f014a50
f62a620
968cc80
84d80be
a80a7dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import axios from "axios"; | ||
|
|
||
|
|
||
| /** | ||
| * Query the SQL server with the queryString. | ||
| * | ||
| * @param queryString | ||
| * @return | ||
| */ | ||
| const querySql = async <T>(queryString: string) => { | ||
| return axios.post<T>("/query/sql", {queryString}); | ||
| }; | ||
|
|
||
| export {querySql}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original idea of having separate However, this idea doesn't work. Since you are already create an
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for 1. i think the src/api is already the api module no?.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yes, but everything is mixed now. Can we create a module one-to-one maps each endpoint that fastify exposes?
yes, it doesn't need to be a class. but we should move shared fetchers to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for 1. do you mean like a new folder for each. I think that is okay
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If we go with that approach, then I feel it's best to:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about src/api/fetchers.ts?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the fetchers are making requests so okay to be in the api folder, and keep one file out of the top level code
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, sure. Let's put them in Also, I’m thinking about adding a generic This way, we can keep all the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i dont think this works since some like the dataset fetch multiple rows. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import {QueryClient} from "@tanstack/react-query"; | ||
|
|
||
|
|
||
| const DEFAULT_STALE_TIME_MILLIS = 10_000; | ||
|
|
||
| const queryClient = new QueryClient({ | ||
| defaultOptions: { | ||
| queries: { | ||
| staleTime: DEFAULT_STALE_TIME_MILLIS, | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| export default queryClient; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import StatCard from "../../../components/StatCard"; | |
| interface DetailsCardProps { | ||
| title: string; | ||
| stat: string; | ||
| isLoading: boolean; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -14,12 +15,14 @@ interface DetailsCardProps { | |
| * @param props | ||
| * @param props.title | ||
| * @param props.stat | ||
| * @param props.isLoading | ||
| * @return | ||
| */ | ||
| const DetailsCard = ({title, stat}: DetailsCardProps) => { | ||
| const DetailsCard = ({title, stat, isLoading}: DetailsCardProps) => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This inheritance-style dependencies is too crazy. Suggestion:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did also think these cards can be refactored when working on the code. But probably a different PR.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we create a quick refactor PR to address this before merging? It shouldn’t take long — I’m happy to submit one and you review that. However, we shouldn't let the current
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay this is reasonable, but you will have to merge into this PR |
||
| const {token} = theme.useToken(); | ||
| return ( | ||
| <StatCard | ||
| isLoading={isLoading} | ||
| stat={stat} | ||
| statColor={token.colorTextSecondary} | ||
| statSize={"1.4rem"} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.