-
Notifications
You must be signed in to change notification settings - Fork 9
feat(frontend): add frontend #114
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: master
Are you sure you want to change the base?
Conversation
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 adds a frontend web application built with React and Vite, along with corresponding backend API updates to support the new UI. The changes rename several core fields from service/name to function_name for consistency across the codebase.
Key Changes:
- Added a complete React frontend application with authentication, function deployment, and management capabilities
- Updated backend API schema and handlers to use
function_nameconsistently instead ofservice/name - Modified OpenAPI specification to reflect authentication endpoints and updated function invocation paths
Reviewed Changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| web/vite.config.js | Vite configuration with API proxy setup |
| web/src/register.jsx | User registration component |
| web/src/login.jsx | User login component |
| web/src/mainpage.jsx | Main application page for function management |
| web/src/function.jsx | Function item display and management component |
| web/src/deploy.jsx | Function deployment/update form component |
| web/src/http.js | Axios HTTP client with interceptors and API endpoints |
| web/src/App.jsx | Root application component with authentication flow |
| web/src/main.jsx | Application entry point |
| web/package.json | Project dependencies and scripts |
| web/index.html | HTML template |
| web/eslint.config.js | ESLint configuration |
| web/README.md | Frontend documentation |
| web/.gitignore | Git ignore patterns |
| web/.env | Environment configuration |
| docs/openapi.yaml | Updated API specification with auth endpoints and function invocation paths |
| crates/gateway/src/types/function.rs | Renamed fields from service/name to function_name |
| crates/gateway/src/handlers/proxy.rs | Updated to use function_name field |
| crates/gateway/src/handlers/function.rs | Updated handlers to use function_name |
| crates/gateway/src/bootstrap/mod.rs | Test updated for field rename |
| crates/faas-containerd/src/provider/function/*.rs | Provider functions updated for field rename |
| crates/faas-containerd/src/impls/*.rs | Implementation files updated for field rename |
Files not reviewed (1)
- web/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
web/src/login.jsx
Outdated
| setError(body?.message || JSON.stringify(body)); | ||
| } | ||
| } catch (err) { | ||
| const msg = err?.response?.err ?? err?.response?.data?.message ?? err.message ?? '网络错误'; |
Copilot
AI
Oct 26, 2025
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.
The error path err?.response?.err appears incorrect. Based on the register.jsx pattern (line 28), this should be err?.response?.data?.msg to match the common axios error response structure.
| const msg = err?.response?.err ?? err?.response?.data?.message ?? err.message ?? '网络错误'; | |
| const msg = err?.response?.data?.msg ?? err?.response?.data?.message ?? err.message ?? '网络错误'; |
web/src/deploy.jsx
Outdated
| Cancel | ||
| </button> | ||
| <button type="submit" disabled={submitting}> | ||
| {submitting ? 'Submitting...' : 'Deploy'} |
Copilot
AI
Oct 26, 2025
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.
The button text is hardcoded to 'Deploy' for both deploy and update operations. This should conditionally display 'Update' when formType === 'update' to accurately reflect the action being performed.
| {submitting ? 'Submitting...' : 'Deploy'} | |
| {submitting ? 'Submitting...' : (formType === 'update' ? 'Update' : 'Deploy')} |
web/src/mainpage.jsx
Outdated
| useEffect(()=>{ | ||
| fetchList(); | ||
| },[]) |
Copilot
AI
Oct 26, 2025
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.
Missing dependency in useEffect. The fetchList function should be included in the dependency array or wrapped with useCallback to avoid potential stale closures.
No description provided.