-
Notifications
You must be signed in to change notification settings - Fork 2
0.2.0 #33
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
Open
xiaoland
wants to merge
153
commits into
master
Choose a base branch
from
develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
This commit introduces the `routeEditor` and its sub-editors (`routeRuleEditor` and `ruleSetsSelector`) to manage the route configuration for a sing-box profile. - Implemented API endpoints to retrieve tags for outbounds and rule sets. - Defined Zod schemas for route, routeRule, and ruleSet objects. - Created selector components for outbounds and rule sets. - Implemented editor components for route rules and rule sets. - Integrated the `routeEditor` into the main `profileEditor`. - Fixed bugs related to permission checks, N+1 queries, and component state management.
Added a default value for the `modelValue` prop in the `routeEditor` component.
- Replaced `axios` with native `fetch` for all API requests. - Implemented `authorizedFetch` from the `user` store for authenticated requests. - Created new Pinia stores for `Profile`, `Outbound`, and `RuleSet` modules to encapsulate API logic. - Refactored components to use the new stores, improving code organization and maintainability.
- Replaced `axios` with native `fetch` for all API requests. - Implemented `authorizedFetch` from the `user` store for authenticated requests. - Created new Pinia stores for `Profile`, `Outbound`, and `RuleSet` modules to encapsulate API logic. - Refactored components to use the new stores, improving code organization and maintainability. - Corrected the API endpoint for the RuleSet service.
- Replaced `axios` with native `fetch` for all API requests. - Implemented `authorizedFetch` from the `user` store for authenticated requests. - Created new Pinia stores for `Profile`, `Outbound`, and `RuleSet` modules to encapsulate API logic. - Refactored components to use the new stores, improving code organization and maintainability. - Corrected the API endpoint for the RuleSet service. - Updated the RuleSet schema and editor based on feedback.
- Replaced `axios` with native `fetch` for all API requests. - Implemented `authorizedFetch` from the `user` store for authenticated requests. - Created new Pinia stores for `Profile`, `Outbound`, and `RuleSet` modules to encapsulate API logic. - Refactored components to use the new stores, improving code organization and maintainability. - Corrected the API endpoint for the RuleSet service. - Updated the RuleSet schema and editor based on feedback. - Refactored `ruleSetEditor` and `routeRuleEditor` to use the common `Editor` component.
- Replaced `axios` with native `fetch` for all API requests. - Implemented `authorizedFetch` from the `user` store for authenticated requests. - Created new Pinia stores for `Profile`, `Outbound`, and `RuleSet` modules to encapsulate API logic. - Refactored components to use the new stores, improving code organization and maintainability. - Corrected the API endpoint for the RuleSet service. - Updated the RuleSet schema and editor based on feedback. - Refactored `ruleSetEditor` and `routeRuleEditor` to use the common `Editor` component. - Fixed a bug in the backend that prevented RuleSets from being created.
This reverts commit 2756da9.
feat: Refactor API client
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
a-cup | 8bbca69 | Commit Preview URL Branch Preview URL |
Oct 24 2025, 05:59 AM |
This commit refactors the `routeEditor` component to use the `outboundsSelector` for the `final` field, instead of a plain text input. This ensures that only valid outbound tags can be selected.
This commit updates the `routeRuleEditor` to include "Rule Sets" as a conditional field in the "Add Condition" dropdown menu. This makes the UI consistent for all condition-like fields.
This commit updates the `addRule` function in `routeEditor.vue` to set default values for new route rules. The `action` is set to 'route' and `outbound` is initialized as an empty string. The `rule_set` field is not included by default.
This commit adds the ability to remove condition fields from the `routeRuleEditor`. A 'remove' icon button has been added next to each conditional field, which, when clicked, will hide the field and clear its data.
This commit addresses several styling and layout issues in the route editor components: - **ruleSetsSelector**: The select field and 'Create New' button are now on the same line. - **routeRuleEditor**: The `ruleSetsSelector` now correctly expands to fill available width, and consistent vertical margins have been added to all conditional fields. - **routeEditor**: Consistent spacing has been applied to improve the overall layout.
This commit adds the ability to create a new outbound directly from the `outboundsSelector` component. This is achieved by adding a 'Create New' button that opens a dialog containing the `outboundEditor`.
This commit updates the 'Create New' buttons in the `outboundsSelector` and `ruleSetsSelector` to be icon buttons. This makes them more visually integrated with the select fields and provides a more consistent user experience.
This commit fixes several alignment issues: - In `outboundsSelector` and `ruleSetsSelector`, the 'Create New' icon button is now vertically centered with the select field. - In `routeRuleEditor`, the 'remove' icon buttons are now vertically centered with their corresponding conditional fields.
…s from R2 The `getProfiles` method in `ProfileService` has been updated to fetch the complete profile configuration from Cloudflare R2, in addition to the profile data from the database. This ensures that the response body is an array of `SingBoxProfileRequestSchema`, including fields like `ntp` and `dns` that are not stored in the database. The implementation now: - Fetches all user profiles from the database. - For each profile, it retrieves the corresponding configuration file from Cloudflare R2. - It then merges the database fields with the R2 configuration to construct the final profile objects.
Refactored API route handlers in `outbound.ts`, `profile.ts`, and `rule-set.ts` to correctly access the JWT payload using `c.get('jwtPayload')` instead of the incorrect `c.get('token_payload')`. This change ensures that user authentication details are properly retrieved and utilized in the application's backend logic.
…e. getProfileById should returns like getProfiles (includes fields from r2Object)
…e. getProfileById should returns like getProfiles (includes fields from r2Object)
Refactor Backend: use Hono, separate business logic from route handler
Owner
Author
前端重构
|
This commit refactors the outbound schema to distinguish between normal and special outbounds. Special outbounds (selector, urltest, direct) are no longer persisted in the database. Instead, they are stored directly in the profile configuration in R2. The backend has been updated to handle the new `special_outbounds` field in the profile creation and update requests. The frontend has been updated to: - Conditionally render the outbound editor form based on the outbound type. - Use a `tag` field instead of `name`, `region`, and `provider` for special outbounds. - Manage the `special_outbounds` array in the profile editor.
The `outboundsSelector` component was using the `Select` component from PrimeVue, which is intended for single-item selection. This has been corrected to use the `MultiSelect` component, which allows for the selection of multiple items.
This commit corrects the implementation of the `outboundsPicker` component. The PrimeVue `Select` component was being incorrectly used for multiple selections. This has been replaced with the `MultiSelect` component, which is the correct component for this purpose. This ensures that the UI for selecting multiple outbounds in the special outbound forms now functions as expected.
This commit corrects the implementation of the `outboundsPicker` component. The PrimeVue `Select` component was being incorrectly used for multiple selections. This has been replaced with the `MultiSelect` component, which is the correct component for this purpose. This ensures that the UI for selecting multiple outbounds in the special outbound forms now functions as expected.
…orrectly. - The `getProfileById` service method has been updated to filter the outbounds from the R2 configuration. - A new `special_outbounds` field has been added to the response, containing the full objects for special outbounds (`selector`, `urltest`, `direct`). - The existing `outbounds` field now correctly contains only the numeric IDs of the database-persisted outbounds.
Refactor outbound
Refactored the backend Outbound service to improve code structure and maintainability. - Introduced `zod-class` and `drizzle-zod` to create domain model classes and generate Zod schemas from Drizzle table definitions. - Created an `Outbound` class to encapsulate business logic related to outbounds. - Created a `ServiceBase` class to share `db` and `env` dependencies across services. - Refactored `OutboundService` to inherit from `ServiceBase` and return instances of the `Outbound` class. - Moved the `Outbounds` table schema to a separate file.
Added a try...catch block to the GET /api/outbounds endpoint to return a detailed error message upon failure. This will help in diagnosing the cause of the internal server error.
- region, provider allows null - use `loose` instead of `passthourgh`
Refactor Backend Outbound Service
Refactored the rule-set module to align with the new architectural pattern. - Moved the RuleSets table definition to server/db/rule-set.ts. - Created a RuleSet business object in server/business/rule-set.ts. - Updated RuleSetService to use the new business object and extend ServiceBase. - Updated the ruleSetRouter to use the refactored service and implement standardized error handling.
Refactor rule-set module
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
现在的操作逻辑太蠢太繁琐了…我需要重新设计:
其它: