Skip to content

Conversation

@kaleidoscope416
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings October 26, 2025 12:34
Copy link

Copilot AI left a 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_name consistently instead of service/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.

setError(body?.message || JSON.stringify(body));
}
} catch (err) {
const msg = err?.response?.err ?? err?.response?.data?.message ?? err.message ?? '网络错误';
Copy link

Copilot AI Oct 26, 2025

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.

Suggested change
const msg = err?.response?.err ?? err?.response?.data?.message ?? err.message ?? '网络错误';
const msg = err?.response?.data?.msg ?? err?.response?.data?.message ?? err.message ?? '网络错误';

Copilot uses AI. Check for mistakes.
Cancel
</button>
<button type="submit" disabled={submitting}>
{submitting ? 'Submitting...' : 'Deploy'}
Copy link

Copilot AI Oct 26, 2025

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.

Suggested change
{submitting ? 'Submitting...' : 'Deploy'}
{submitting ? 'Submitting...' : (formType === 'update' ? 'Update' : 'Deploy')}

Copilot uses AI. Check for mistakes.
Comment on lines 19 to 21
useEffect(()=>{
fetchList();
},[])
Copy link

Copilot AI Oct 26, 2025

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.

Copilot uses AI. Check for mistakes.
@kaleidoscope416 kaleidoscope416 marked this pull request as draft October 26, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant