-
Notifications
You must be signed in to change notification settings - Fork 294
DBQnA: Unified POST data format #2076
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
base: main
Are you sure you want to change the base?
Conversation
This commit aligns api "postgres/health" POST data, and use localhost instead of hard-coded ip. This commit should fix opea-project#2063 . Signed-off-by: PeterYang12 <yuhan.yang@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the API POST data format for the "postgres/health" endpoint by aligning the payload structure and replacing a hard-coded IP with localhost.
- Updated host value in the database connection configuration
- Modified the payload from plain formData to a unified connection data object
- Improved consistency with the backend API expectations
Comments suppressed due to low confidence (1)
DBQnA/ui/react/src/components/DbConnect/DBConnect.tsx:45
- Confirm that wrapping the entire formData object under the key 'conn_str' matches the API's expected schema. If the API is designed to receive a connection string rather than an object, consider transforming formData into the appropriate format.
let unifiedConnData = {"conn_str":formData};
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
@@ -9,7 +9,7 @@ const DBConnect: React.FC = () => { | |||
const [formData, setFormData] = useState({ | |||
user: 'postgres', | |||
database: 'chinook', | |||
host: '10.223.24.113', | |||
host: '127.0.0.1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean it assumes UI always run the same machine as postgres?
If UI and postgres on two different machines, can this work?
Should this be configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean it assumes UI always run the same machine as postgres? If UI and postgres on two different machines, can this work? Should this be configurable?
Thanks for your review. The 'host ip' can be configured by end user in UI. It's workable on two different machines.
This change just replace a hard coded IP with localhost. IMHO, it shouldn't be 10.223.24.113.
Could we merge this PR? |
Description
This commit aligns api "postgres/health" POST data, and use localhost instead of hard-coded ip.
Issues
This commit should fix #2063 .
Type of change
List the type of change like below. Please delete options that are not relevant.