Skip to content

Commit f648824

Browse files
authored
Support Auto Switch profile, closing #10 (#15)
* modified README.md * remove transifex from Github action. Use Github integration instead * update deps * replace jest with vitest * optimized UX * [I18n] Translate messages.json in zh_CN (#12)
1 parent d415bcc commit f648824

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3006
-1188
lines changed

.tx/config

-12
This file was deleted.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It's still in the early development stage, and more features are still on the w
1111

1212
- [x] Basic profile switch support
1313
- [x] Support proxy authentication
14-
- [ ] Support auto switch rules
14+
- [x] Support auto switch rules
1515
- [x] Support more languages
1616
- [ ] Support customized preference
1717
- [ ] Support Safari
@@ -29,7 +29,7 @@ It's still in the early development stage, and more features are still on the w
2929
## Development
3030

3131
1. Fork the repository and make changes.
32-
2. Write unit tests. If applicable, write unit tests for your changes to ensure they don't break existing functionality. Our project uses [ts-jest](https://jestjs.io/docs/getting-started#via-ts-jest) for unit testing.
32+
2. Write unit tests. If applicable, write unit tests for your changes to ensure they don't break existing functionality. Our project uses [vitest](https://vitest.dev/) for unit testing.
3333
3. Make sure everything works perfectly before you make any pull request.
3434

3535

package-lock.json

+102-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
"dev": "vite",
88
"test": "vitest",
99
"coverage": "vitest run --coverage",
10-
"i18n:sync": "tx pull -a",
11-
"build:test": "vue-tsc && vite build",
1210
"build": "vue-tsc && vite build",
1311
"dist": "rm -f dist.zip && cd ./dist/ && zip -r ../dist.zip ./",
1412
"preview": "vite preview"
@@ -18,16 +16,19 @@
1816
},
1917
"dependencies": {
2018
"@highlightjs/vue-plugin": "^2.1.0",
19+
"@vueuse/core": "^11.1.0",
2120
"escodegen": "^2.1.0",
21+
"esprima": "^4.0.1",
2222
"ipaddr.js": "^2.2.0",
2323
"vue": "^3.4.35",
2424
"vue-router": "^4.3.2"
2525
},
2626
"devDependencies": {
27-
"@arco-design/web-vue": "^2.55.2",
27+
"@arco-design/web-vue": "^2.56.2",
2828
"@arco-plugins/vite-vue": "^1.4.5",
2929
"@types/chrome": "^0.0.266",
3030
"@types/escodegen": "^0.0.10",
31+
"@types/esprima": "^4.0.6",
3132
"@vitejs/plugin-vue": "^5.0.4",
3233
"@vitest/coverage-v8": "^2.1.3",
3334
"sass-embedded": "^1.79.5",

public/_locales/en/messages.json

+62-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@
1010
"nav_config": {
1111
"message": "Config"
1212
},
13-
"nav_custome_profiles": {
13+
"nav_custom_profiles": {
1414
"message": "Custom Profiles"
1515
},
16+
"nav_system_profiles": {
17+
"message": "Presets"
18+
},
19+
1620

1721

1822
"theme_light_mode": {
@@ -49,6 +53,9 @@
4953
"config_proxy_type_pac": {
5054
"message": "PAC Script"
5155
},
56+
"config_proxy_type_auto": {
57+
"message": "Auto Switch"
58+
},
5259
"config_proxy_type_default": {
5360
"message": "Same as Default"
5461
},
@@ -70,6 +77,9 @@
7077
"config_section_proxy_auth_tips": {
7178
"message": "Set username and password if your proxy requires authentication"
7279
},
80+
"config_section_proxy_auth_unsupported": {
81+
"message": "The current proxy type does not support authentication"
82+
},
7383
"config_section_proxy_auth_title": {
7484
"message": "Proxy Authentication"
7585
},
@@ -90,6 +100,49 @@
90100
"message": "Learn more about bypass list"
91101
},
92102

103+
"config_section_auto_switch_rules": {
104+
"message": "Auto Switch Rules"
105+
},
106+
"config_section_auto_switch_type": {
107+
"message": "Condition Type"
108+
},
109+
"config_section_auto_switch_type_domain": {
110+
"message": "Domain"
111+
},
112+
"config_section_auto_switch_type_url": {
113+
"message": "URL"
114+
},
115+
"config_section_auto_switch_type_cidr": {
116+
"message": "IP/CIDR"
117+
},
118+
"config_section_auto_switch_type_disabled": {
119+
"message": "Temporarily Skip"
120+
},
121+
"config_section_auto_switch_condition": {
122+
"message": "Condition"
123+
},
124+
"config_section_auto_switch_profile": {
125+
"message": "Route to"
126+
},
127+
"config_section_auto_switch_actions": {
128+
"message": "Actions"
129+
},
130+
"config_section_auto_switch_add_rule": {
131+
"message": "Add Rule"
132+
},
133+
"config_section_auto_switch_delete_rule": {
134+
"message": "Delete Current Rule"
135+
},
136+
"config_section_auto_switch_duplicate_rule": {
137+
"message": "Duplicate Current Rule"
138+
},
139+
"config_section_auto_switch_default_profile": {
140+
"message": "Default Profile"
141+
},
142+
"config_section_auto_switch_pac_preview": {
143+
"message": "Preview PAC Script"
144+
},
145+
93146
"config_action_edit": {
94147
"message": "Edit"
95148
},
@@ -112,11 +165,17 @@
112165
"config_feedback_saved": {
113166
"message": "The profile had been saved"
114167
},
168+
"config_feedback_copied": {
169+
"message": "Copied"
170+
},
115171
"config_feedback_deleted": {
116172
"message": "The profile had been deleted"
117173
},
118-
"config_feedback_error_occured": {
119-
"message": "Error occured: $1"
174+
"config_feedback_unknown_profile": {
175+
"message": "Unknown profile"
176+
},
177+
"config_feedback_error_occurred": {
178+
"message": "Error occurred: $1"
120179
},
121180

122181

0 commit comments

Comments
 (0)