@qlover/create-app 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -0
- package/configs/_common/.github/workflows/general-check.yml +17 -29
- package/configs/_common/.github/workflows/{release.yml.template → release.yml} +16 -51
- package/package.json +3 -3
- package/templates/pack-app/fe-config.json +30 -1
- package/templates/pack-app/package.json +45 -32
- package/templates/pack-app/tsconfig.test.json +1 -1
- package/templates/react-app/config/Identifier.I18n.ts +878 -0
- package/templates/react-app/config/app.router.json +7 -7
- package/templates/react-app/config/common.ts +7 -4
- package/templates/react-app/config/theme.json +7 -88
- package/templates/react-app/package.json +9 -4
- package/templates/react-app/postcss.config.js +1 -2
- package/templates/react-app/public/locales/en/common.json +118 -1
- package/templates/react-app/public/locales/zh/common.json +118 -1
- package/templates/react-app/src/App.tsx +14 -2
- package/templates/react-app/src/base/cases/RequestLogger.ts +3 -4
- package/templates/react-app/src/base/cases/RequestStatusCatcher.ts +3 -2
- package/templates/react-app/src/base/services/I18nService.ts +31 -3
- package/templates/react-app/src/base/services/ProcesserService.ts +3 -2
- package/templates/react-app/src/core/IOC.ts +15 -9
- package/templates/react-app/src/core/bootstrap.ts +42 -53
- package/templates/react-app/src/core/bootstraps/PrintBootstrap.ts +14 -0
- package/templates/react-app/src/core/bootstraps/index.ts +36 -7
- package/templates/react-app/src/core/globals.ts +4 -6
- package/templates/react-app/src/core/registers/RegisterApi.ts +2 -5
- package/templates/react-app/src/core/registers/RegisterCommon.ts +38 -28
- package/templates/react-app/src/core/registers/RegisterControllers.ts +5 -10
- package/templates/react-app/src/core/registers/RegisterGlobals.ts +15 -14
- package/templates/react-app/src/core/registers/index.ts +27 -12
- package/templates/react-app/src/main.tsx +1 -1
- package/templates/react-app/src/pages/404.tsx +1 -1
- package/templates/react-app/src/pages/500.tsx +1 -1
- package/templates/react-app/src/pages/auth/Login.tsx +128 -36
- package/templates/react-app/src/pages/base/About.tsx +5 -2
- package/templates/react-app/src/pages/base/ErrorIdentifier.tsx +38 -19
- package/templates/react-app/src/pages/base/Executor.tsx +447 -29
- package/templates/react-app/src/pages/base/Home.tsx +99 -93
- package/templates/react-app/src/pages/base/JSONStorage.tsx +47 -38
- package/templates/react-app/src/pages/base/Layout.tsx +5 -2
- package/templates/react-app/src/pages/base/Request.tsx +90 -208
- package/templates/react-app/src/pages/base/components/BaseHeader.tsx +13 -5
- package/templates/react-app/src/styles/css/page.css +11 -0
- package/templates/react-app/src/styles/css/tailwind.css +5 -0
- package/templates/react-app/src/styles/css/themes/_default.css +200 -0
- package/templates/react-app/src/styles/css/themes/dark.css +154 -0
- package/templates/react-app/src/styles/css/themes/index.css +3 -0
- package/templates/react-app/src/styles/css/themes/pink.css +160 -0
- package/templates/react-app/src/uikit/components/LanguageSwitcher.tsx +56 -0
- package/templates/react-app/src/uikit/components/Loading.tsx +27 -21
- package/templates/react-app/src/uikit/components/ThemeSwitcher.tsx +63 -13
- package/templates/react-app/src/uikit/contexts/BaseRouteContext.ts +1 -1
- package/templates/react-app/src/uikit/controllers/RouterController.ts +3 -3
- package/templates/react-app/src/uikit/controllers/UserController.ts +1 -1
- package/templates/react-app/tailwind.config.js +1 -15
- package/templates/react-app/vite.config.ts +9 -3
- package/templates/react-app/lib/tailwind/root10px.js +0 -178
- package/templates/react-app/lib/tailwind/theme-generator.js +0 -238
- package/templates/react-app/public/locales/en/about.json +0 -3
- package/templates/react-app/public/locales/en/executor.json +0 -6
- package/templates/react-app/public/locales/en/home.json +0 -10
- package/templates/react-app/public/locales/en/jsonStorage.json +0 -11
- package/templates/react-app/public/locales/en/login.json +0 -7
- package/templates/react-app/public/locales/en/request.json +0 -15
- package/templates/react-app/public/locales/zh/about.json +0 -3
- package/templates/react-app/public/locales/zh/executor.json +0 -7
- package/templates/react-app/public/locales/zh/home.json +0 -10
- package/templates/react-app/public/locales/zh/jsonStorage.json +0 -11
- package/templates/react-app/public/locales/zh/login.json +0 -8
- package/templates/react-app/public/locales/zh/request.json +0 -15
- package/templates/react-app/src/base/port/InversifyIocInterface.ts +0 -9
- package/templates/react-app/src/uikit/styles/css/page.css +0 -3
- package/templates/react-app/src/uikit/styles/css/tailwind.css +0 -3
- /package/templates/react-app/config/{ErrorIdentifier.ts → Identifier.Error.ts} +0 -0
- /package/templates/react-app/src/{uikit/styles → styles}/css/index.css +0 -0
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"meta": {
|
|
22
22
|
"title": "fe-utils/home",
|
|
23
23
|
"icon": "home",
|
|
24
|
-
"localNamespace": "
|
|
24
|
+
"localNamespace": "common"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"meta": {
|
|
31
31
|
"title": "关于",
|
|
32
32
|
"icon": "info",
|
|
33
|
-
"localNamespace": "
|
|
33
|
+
"localNamespace": "common"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
{
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"meta": {
|
|
40
40
|
"title": "FE-Utils JSONStorage",
|
|
41
41
|
"icon": "info",
|
|
42
|
-
"localNamespace": "
|
|
42
|
+
"localNamespace": "common"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"meta": {
|
|
49
49
|
"title": "FE-Utils Request",
|
|
50
50
|
"icon": "info",
|
|
51
|
-
"localNamespace": "
|
|
51
|
+
"localNamespace": "common"
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
{
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"meta": {
|
|
58
58
|
"title": "FE-Utils Executor",
|
|
59
59
|
"icon": "info",
|
|
60
|
-
"localNamespace": "
|
|
60
|
+
"localNamespace": "common"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
{
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"meta": {
|
|
110
110
|
"title": "登录",
|
|
111
111
|
"icon": "info",
|
|
112
|
-
"localNamespace": "
|
|
112
|
+
"localNamespace": "common"
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
{
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"meta": {
|
|
119
119
|
"title": "注册",
|
|
120
120
|
"icon": "info",
|
|
121
|
-
"localNamespace": "
|
|
121
|
+
"localNamespace": "common"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
]
|
|
@@ -8,8 +8,11 @@ export const browserGlobalsName = 'feGlobals';
|
|
|
8
8
|
export const envBlackList = ['env', 'userNodeEnv'];
|
|
9
9
|
|
|
10
10
|
export const loggerStyles = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
fatal: { color: '#ff0000', fontWeight: 'bold' },
|
|
12
|
+
error: { color: '#ff0000' },
|
|
13
|
+
warn: { color: '#ffa500' },
|
|
14
|
+
info: { color: '#0000ff' },
|
|
15
|
+
debug: { color: '#008000' },
|
|
16
|
+
trace: { color: '#808080' },
|
|
17
|
+
log: { color: '#000000' }
|
|
15
18
|
};
|
|
@@ -1,90 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"colors": {
|
|
10
|
-
"light": {
|
|
11
|
-
"primary": "#00f",
|
|
12
|
-
"secondary": "#fff",
|
|
13
|
-
"text": "#000",
|
|
14
|
-
"background": "#fff"
|
|
15
|
-
},
|
|
16
|
-
"dark": {
|
|
17
|
-
"primary": "#f00",
|
|
18
|
-
"secondary": "#000",
|
|
19
|
-
"text": "#fff",
|
|
20
|
-
"background": "#000"
|
|
21
|
-
},
|
|
22
|
-
"pink": {
|
|
23
|
-
"primary": "#f0f",
|
|
24
|
-
"secondary": "#aaa",
|
|
25
|
-
"text": "#ddd",
|
|
26
|
-
"background": "#e0e0e0"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"override": {
|
|
31
|
-
"domAttribute": "data-theme",
|
|
32
|
-
"defaultTheme": "system",
|
|
33
|
-
"target": "html",
|
|
34
|
-
"supportedThemes": ["light", "dark", "pink"],
|
|
35
|
-
"storageKey": "fe_theme",
|
|
36
|
-
"styleThemeKeyTemplate": "${target}[${domAttribute}='${theme}']",
|
|
37
|
-
"styleKeyTemplate": "--fe-color-${colorKey}",
|
|
38
|
-
"colorsValueTemplate": "rgb(var(${styleKey}))",
|
|
39
|
-
"colors": {
|
|
40
|
-
"light": {
|
|
41
|
-
"white": "255 255 255",
|
|
42
|
-
"black": "0 0 0",
|
|
43
|
-
"gray": {
|
|
44
|
-
"50": "249 250 251",
|
|
45
|
-
"100": "243 244 246",
|
|
46
|
-
"200": "229 231 235",
|
|
47
|
-
"300": "209 213 219",
|
|
48
|
-
"400": "156 163 175",
|
|
49
|
-
"500": "107 114 128",
|
|
50
|
-
"600": "75 85 99",
|
|
51
|
-
"700": "55 65 81",
|
|
52
|
-
"800": "31 41 55",
|
|
53
|
-
"900": "17 24 39"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"dark": {
|
|
57
|
-
"white": "226 232 240",
|
|
58
|
-
"black": "0 0 0",
|
|
59
|
-
"gray": {
|
|
60
|
-
"50": "10 10 10",
|
|
61
|
-
"100": "28 28 28",
|
|
62
|
-
"200": "46 46 46",
|
|
63
|
-
"300": "64 64 64",
|
|
64
|
-
"400": "82 82 82",
|
|
65
|
-
"500": "100 100 100",
|
|
66
|
-
"600": "120 120 120",
|
|
67
|
-
"700": "138 138 138",
|
|
68
|
-
"800": "156 156 156",
|
|
69
|
-
"900": "176 176 176"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"pink": {
|
|
73
|
-
"white": "255 228 225",
|
|
74
|
-
"black": "51 51 51",
|
|
75
|
-
"gray": {
|
|
76
|
-
"50": "255 245 245",
|
|
77
|
-
"100": "255 234 234",
|
|
78
|
-
"200": "255 194 194",
|
|
79
|
-
"300": "255 153 153",
|
|
80
|
-
"400": "255 112 112",
|
|
81
|
-
"500": "255 71 71",
|
|
82
|
-
"600": "255 31 31",
|
|
83
|
-
"700": "230 0 0",
|
|
84
|
-
"800": "179 0 0",
|
|
85
|
-
"900": "128 0 0"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
2
|
+
"domAttribute": "data-theme",
|
|
3
|
+
"defaultTheme": "system",
|
|
4
|
+
"target": "html",
|
|
5
|
+
"supportedThemes": ["light", "dark", "pink"],
|
|
6
|
+
"storageKey": "fe_theme",
|
|
7
|
+
"init": true,
|
|
8
|
+
"prioritizeStore": true
|
|
90
9
|
}
|
|
@@ -51,9 +51,14 @@
|
|
|
51
51
|
"test": "vitest run"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@qlover/corekit-bridge": "^
|
|
55
|
-
"@qlover/fe-corekit": "^1.
|
|
54
|
+
"@qlover/corekit-bridge": "^1.0.3",
|
|
55
|
+
"@qlover/fe-corekit": "^1.3.1",
|
|
56
|
+
"@qlover/logger": "^0.1.1",
|
|
56
57
|
"@qlover/slice-store-react": "^1.0.8",
|
|
58
|
+
"@tailwindcss/postcss": "^4.1.8",
|
|
59
|
+
"@tailwindcss/vite": "^4.1.8",
|
|
60
|
+
"antd": "^5.25.3",
|
|
61
|
+
"clsx": "^2.1.1",
|
|
57
62
|
"i18next": "^24.2.0",
|
|
58
63
|
"i18next-browser-languagedetector": "^8.0.2",
|
|
59
64
|
"i18next-http-backend": "^3.0.1",
|
|
@@ -85,10 +90,10 @@
|
|
|
85
90
|
"eslint-plugin-react-refresh": "^0.4.14",
|
|
86
91
|
"eslint-plugin-vitest": "^0.5.4",
|
|
87
92
|
"globals": "^15.12.0",
|
|
88
|
-
"postcss": "^8.4
|
|
93
|
+
"postcss": "^8.5.4",
|
|
89
94
|
"prettier": "^3.5.3",
|
|
90
95
|
"sass-embedded": "^1.79.4",
|
|
91
|
-
"tailwindcss": "^
|
|
96
|
+
"tailwindcss": "^4.1.8",
|
|
92
97
|
"typescript": "^5.6.3",
|
|
93
98
|
"typescript-eslint": "^8.15.0",
|
|
94
99
|
"vite": "^5.4.8",
|
|
@@ -6,5 +6,122 @@
|
|
|
6
6
|
"err.ioc.not.implemented": "IOC not implemented",
|
|
7
7
|
"err.local.no.user.token": "Local no user token",
|
|
8
8
|
"err.global.no.window": "Global no window",
|
|
9
|
-
"err.within.page.provider": "Must be used in PageProvider"
|
|
9
|
+
"err.within.page.provider": "Must be used in PageProvider",
|
|
10
|
+
"page.about.title": "About",
|
|
11
|
+
"page.about.description": "Learn more about our project and team information",
|
|
12
|
+
"about.title": "About",
|
|
13
|
+
"jsonStorage.title": "JSONStorage Demo",
|
|
14
|
+
"jsonStorage.title2": "Permanent storage test",
|
|
15
|
+
"jsonStorage.title3": "Expire time test",
|
|
16
|
+
"jsonStorage.title4": "Request Timeout",
|
|
17
|
+
"jsonStorage.format.title": "Test key: ${key}, Random value range: ${min}~${max}",
|
|
18
|
+
"jsonStorage.setRandomValue": "Set random value",
|
|
19
|
+
"jsonStorage.currentValue": "Current value",
|
|
20
|
+
"jsonStorage.ms": "ms",
|
|
21
|
+
"jsonStorage.setExpireTime": "Set random value(with expire time)",
|
|
22
|
+
"login.title": "Login",
|
|
23
|
+
"login.email": "Email",
|
|
24
|
+
"login.username": "Username",
|
|
25
|
+
"login.password": "Password",
|
|
26
|
+
"login.login": "Login",
|
|
27
|
+
"request.requestTimeout": "Request Timeout",
|
|
28
|
+
"request.helloResult": "Hello result is",
|
|
29
|
+
"request.helloError": "Hello error is",
|
|
30
|
+
"request.ipInfoResult": "IpInfo result is",
|
|
31
|
+
"request.ipInfo": "IpInfo",
|
|
32
|
+
"request.randomUser": "RandomUser",
|
|
33
|
+
"request.loading": "Loading...",
|
|
34
|
+
"request.randomUserResult": "RandomUser result is",
|
|
35
|
+
"request.randomUserError": "RandomUser error is",
|
|
36
|
+
"request.triggerAbortRequest": "Trigger Abort Request",
|
|
37
|
+
"request.stopAbortRequest": "Stop Abort Request",
|
|
38
|
+
"request.abortRequestResult": "Abort Request Result",
|
|
39
|
+
"request.abortRequestError": "Abort Request Error",
|
|
40
|
+
"executor.executorDemo": "Executor Demo",
|
|
41
|
+
"executor.requestTimeout": "Request Timeout",
|
|
42
|
+
"executor.executorTestPlugin": "Executor Test Plugin",
|
|
43
|
+
"executor.testPlugin": "Test Plugin",
|
|
44
|
+
"home.welcome": "Welcome to the home page",
|
|
45
|
+
"home.description": "A modern frontend utility library collection providing various practical tools and components",
|
|
46
|
+
"home.about": "About Us",
|
|
47
|
+
"home.about_description": "Learn more about our project and team information",
|
|
48
|
+
"home.jsonstorage": "JSONStorage",
|
|
49
|
+
"home.jsonstorage_description": "Efficient JSON data storage solution",
|
|
50
|
+
"home.request": "Request",
|
|
51
|
+
"home.request_description": "A modern frontend utility library collection providing various practical tools and components",
|
|
52
|
+
"page.jsonstorage.title": "JSONStorage Page",
|
|
53
|
+
"page.jsonstorage.description": "Use JSONStorage for data storage and management",
|
|
54
|
+
"page.request.title": "Request Examples",
|
|
55
|
+
"page.request.description": "Demonstrate various request examples and usage",
|
|
56
|
+
"page.executor.title": "Executor Examples",
|
|
57
|
+
"page.executor.description": "A powerful task executor supporting multiple task types and state management",
|
|
58
|
+
"page.error.identifier.title": "Error Identifier",
|
|
59
|
+
"page.error.identifier.description": "Error identifier usage and examples",
|
|
60
|
+
"home.explore": "Explore",
|
|
61
|
+
"home.get_started.title": "Ready to Get Started?",
|
|
62
|
+
"home.get_started.description": "Join us and discover the power of our utilities",
|
|
63
|
+
"home.get_started.button": "Get Started Now",
|
|
64
|
+
"header.theme.default": "Default Theme",
|
|
65
|
+
"header.theme.dark": "Dark Theme",
|
|
66
|
+
"header.theme.pink": "Pink Theme",
|
|
67
|
+
"page.jsonstorage.main_title": "JSONStorage Demo",
|
|
68
|
+
"page.jsonstorage.permanent_title": "Permanent Storage Test",
|
|
69
|
+
"page.jsonstorage.expire_title": "Expire Time Test",
|
|
70
|
+
"page.jsonstorage.timeout_title": "Request Timeout Setting",
|
|
71
|
+
"page.jsonstorage.format_title": "Test key: ${key}, Random value range: ${min}~${max}",
|
|
72
|
+
"page.jsonstorage.set_random": "Set Random Value",
|
|
73
|
+
"page.jsonstorage.current_value": "Current Value",
|
|
74
|
+
"page.jsonstorage.set_expire": "Set Random Value (with expire time)",
|
|
75
|
+
"page.jsonstorage.ms": "ms",
|
|
76
|
+
"page.request.timeout": "Request Timeout",
|
|
77
|
+
"page.request.hello.title": "AI API: Hello",
|
|
78
|
+
"page.request.hello.description": "Functional API using FetchURLPlugin, RequestCommonPlugin, ApiMockPlugin, RequestLogger plugins",
|
|
79
|
+
"page.request.hello.button": "Hello",
|
|
80
|
+
"page.request.ip_info.title": "FeApi: IP Information",
|
|
81
|
+
"page.request.ip_info.description": "RequestScheduler class API using FetchURLPlugin, RequestCommonPlugin, RequestLogger, ApiPickDataPlugin plugins, where ApiPickDataPlugin can flatten return types to data field",
|
|
82
|
+
"page.request.random_user.title": "UserApi: Random User",
|
|
83
|
+
"page.request.random_user.description": "RequestTransaction class API using FetchURLPlugin, RequestCommonPlugin, ApiMockPlugin, FetchAbortPlugin, RequestLogger, ApiCatchPlugin plugins, where FetchAbortPlugin can abort requests, ApiCatchPlugin can unify caught errors to apiCatchResult field",
|
|
84
|
+
"page.request.api_catch.title": "UserApi: Api Catch Result",
|
|
85
|
+
"page.request.abort.title": "UserApi: Abort Request",
|
|
86
|
+
"page.request.trigger_abort": "Trigger Abort Request",
|
|
87
|
+
"page.request.stop_abort": "Stop Abort Request",
|
|
88
|
+
"page.request.trigger_api_catch": "Trigger API Catch Result",
|
|
89
|
+
"page.request.stop_api_catch": "Stop API Catch Result",
|
|
90
|
+
"page.executor.main_title": "Executor",
|
|
91
|
+
"page.executor.test_plugin.title": "Test Plugin",
|
|
92
|
+
"page.executor.task.status.pending": "Pending",
|
|
93
|
+
"page.executor.task.status.running": "Running",
|
|
94
|
+
"page.executor.task.status.completed": "Completed",
|
|
95
|
+
"page.executor.task.status.failed": "Failed",
|
|
96
|
+
"page.executor.task.type.data_sync": "Data Sync",
|
|
97
|
+
"page.executor.task.type.report": "Report Generation",
|
|
98
|
+
"page.executor.task.type.maintenance": "System Maintenance",
|
|
99
|
+
"page.executor.task.type.backup": "Backup",
|
|
100
|
+
"page.executor.task.duration.unit": "minutes",
|
|
101
|
+
"page.executor.task.start": "Start",
|
|
102
|
+
"page.executor.task.stop": "Stop",
|
|
103
|
+
"page.executor.task.success": "Task %{name} executed successfully",
|
|
104
|
+
"page.executor.task.failure": "Task %{name} execution failed",
|
|
105
|
+
"page.executor.plugin.test.success": "Plugin test successful",
|
|
106
|
+
"page.executor.plugin.test.failure": "Plugin test failed",
|
|
107
|
+
"page.executor.custom_task.url_required": "Please enter URL",
|
|
108
|
+
"page.executor.custom_task.name": "Custom Task %{method} %{url}",
|
|
109
|
+
"page.executor.create_task.title": "Create Custom Task",
|
|
110
|
+
"page.executor.create_button": "Create",
|
|
111
|
+
"page.executor.enter_url": "Enter URL",
|
|
112
|
+
"page.executor.task_list.title": "Task List",
|
|
113
|
+
"page.executor.task_stats.total": "Total Tasks",
|
|
114
|
+
"page.executor.task_stats.running": "Running",
|
|
115
|
+
"page.executor.task_stats.completed": "Completed",
|
|
116
|
+
"page.executor.task_stats.failed": "Failed",
|
|
117
|
+
"page.executor.task_history.title": "Execution History",
|
|
118
|
+
"page.executor.help.title": "Need Help?",
|
|
119
|
+
"page.executor.help.description": "Having issues? Check our task execution guide or contact support",
|
|
120
|
+
"page.executor.view_guide": "View Guide",
|
|
121
|
+
"page.executor.contact_support": "Contact Support",
|
|
122
|
+
"page.error.identifier.main_title": "Error Identifier",
|
|
123
|
+
"page.error.identifier.source_description": "Identifier From: '@config/Identifier.Error'",
|
|
124
|
+
"page.error.identifier.help.title": "Need Help?",
|
|
125
|
+
"page.error.identifier.help.description": "If you encounter any issues while using error identifiers, please contact our support team",
|
|
126
|
+
"page.error.identifier.contact_support": "Contact Support"
|
|
10
127
|
}
|
|
@@ -6,5 +6,122 @@
|
|
|
6
6
|
"err.ioc.not.implemented": "IOC 未实现",
|
|
7
7
|
"err.local.no.user.token": "本地未找到 user token",
|
|
8
8
|
"err.global.no.window": "全局未找到 window",
|
|
9
|
-
"err.within.page.provider": "必须在 PageProvider 中使用"
|
|
9
|
+
"err.within.page.provider": "必须在 PageProvider 中使用",
|
|
10
|
+
"page.about.title": "关于",
|
|
11
|
+
"page.about.description": "了解更多关于我们的项目和团队信息",
|
|
12
|
+
"about.title": "关于我们",
|
|
13
|
+
"jsonStorage.title": "JSONStorage Demo",
|
|
14
|
+
"jsonStorage.title2": "永久存储测试",
|
|
15
|
+
"jsonStorage.title3": "过期时间测试",
|
|
16
|
+
"jsonStorage.title4": "请求超时时间设置",
|
|
17
|
+
"jsonStorage.format.title": "测试 key: ${key}, 随机值范围: ${min}~${max}",
|
|
18
|
+
"jsonStorage.setRandomValue": "设置随机值",
|
|
19
|
+
"jsonStorage.currentValue": "当前值",
|
|
20
|
+
"jsonStorage.ms": "毫秒",
|
|
21
|
+
"jsonStorage.setExpireTime": "设置随机值(带过期时间)",
|
|
22
|
+
"login.title": "登录",
|
|
23
|
+
"login.email": "邮箱",
|
|
24
|
+
"login.username": "用户名",
|
|
25
|
+
"login.password": "密码",
|
|
26
|
+
"login.login": "登录",
|
|
27
|
+
"request.requestTimeout": "请求超时",
|
|
28
|
+
"request.helloResult": "Hello 结果是",
|
|
29
|
+
"request.helloError": "Hello 错误是",
|
|
30
|
+
"request.ipInfoResult": "IpInfo 结果是",
|
|
31
|
+
"request.ipInfo": "IpInfo",
|
|
32
|
+
"request.randomUser": "随机用户",
|
|
33
|
+
"request.loading": "加载中...",
|
|
34
|
+
"request.randomUserResult": "随机用户 结果是",
|
|
35
|
+
"request.randomUserError": "随机用户 错误是",
|
|
36
|
+
"request.triggerAbortRequest": "触发中止请求",
|
|
37
|
+
"request.stopAbortRequest": "停止中止请求",
|
|
38
|
+
"request.abortRequestResult": "中止请求 结果是",
|
|
39
|
+
"request.abortRequestError": "中止请求 错误是",
|
|
40
|
+
"executor.executorDemo": "执行器 Demo",
|
|
41
|
+
"executor.requestTimeout": "请求超时",
|
|
42
|
+
"executor.executorTestPlugin": "执行器 测试插件",
|
|
43
|
+
"executor.testPlugin": "测试插件",
|
|
44
|
+
"home.welcome": "欢迎来到主页",
|
|
45
|
+
"home.description": "一个现代前端实用库集合,提供各种实用工具和组件",
|
|
46
|
+
"home.about": "关于我们",
|
|
47
|
+
"home.about_description": "了解更多关于我们的项目和团队信息",
|
|
48
|
+
"home.jsonstorage": "JSON存储",
|
|
49
|
+
"home.jsonstorage_description": "高效的JSON数据存储解决方案",
|
|
50
|
+
"home.request": "请求",
|
|
51
|
+
"home.request_description": "一个现代前端实用库集合,提供各种实用工具和组件",
|
|
52
|
+
"page.jsonstorage.title": "JSONStorage 页面",
|
|
53
|
+
"page.jsonstorage.description": "使用 JSONStorage 进行数据存储和管理",
|
|
54
|
+
"page.request.title": "请求示例",
|
|
55
|
+
"page.request.description": "展示各种请求示例和用法",
|
|
56
|
+
"page.executor.title": "执行器示例",
|
|
57
|
+
"page.executor.description": "一个强大的任务执行器,支持多种任务类型和状态管理",
|
|
58
|
+
"page.error.identifier.title": "错误标识符",
|
|
59
|
+
"page.error.identifier.description": "错误标识符的使用和示例",
|
|
60
|
+
"home.explore": "探索",
|
|
61
|
+
"home.get_started.title": "准备开始使用?",
|
|
62
|
+
"home.get_started.description": "加入我们,探索实用工具的力量",
|
|
63
|
+
"home.get_started.button": "立即开始",
|
|
64
|
+
"header.theme.default": "默认主题",
|
|
65
|
+
"header.theme.dark": "暗色主题",
|
|
66
|
+
"header.theme.pink": "粉色主题",
|
|
67
|
+
"page.jsonstorage.main_title": "JSONStorage 演示",
|
|
68
|
+
"page.jsonstorage.permanent_title": "永久存储测试",
|
|
69
|
+
"page.jsonstorage.expire_title": "过期时间测试",
|
|
70
|
+
"page.jsonstorage.timeout_title": "请求超时时间设置",
|
|
71
|
+
"page.jsonstorage.format_title": "测试 key: ${key}, 随机值范围: ${min}~${max}",
|
|
72
|
+
"page.jsonstorage.set_random": "设置随机值",
|
|
73
|
+
"page.jsonstorage.current_value": "当前值",
|
|
74
|
+
"page.jsonstorage.set_expire": "设置随机值(带过期时间)",
|
|
75
|
+
"page.jsonstorage.ms": "毫秒",
|
|
76
|
+
"page.request.timeout": "请求超时时间",
|
|
77
|
+
"page.request.hello.title": "AI API: Hello",
|
|
78
|
+
"page.request.hello.description": "函数式 api, 使用了 FetchURLPlugin, RequestCommonPlugin, ApiMockPlugin, RequestLogger 插件",
|
|
79
|
+
"page.request.hello.button": "Hello",
|
|
80
|
+
"page.request.ip_info.title": "FeApi: IP Information",
|
|
81
|
+
"page.request.ip_info.description": "RequestScheduler 类式 api, 使用了 FetchURLPlugin, RequestCommonPlugin, RequestLogger, ApiPickDataPlugin 插件, 其中 ApiPickDataPlugin 插件可以将返回类型统一扁平到 data 字段",
|
|
82
|
+
"page.request.random_user.title": "UserApi: Random User",
|
|
83
|
+
"page.request.random_user.description": "RequestTransaction 类式 api, 使用了 FetchURLPlugin, RequestCommonPlugin, ApiMockPlugin, FetchAbortPlugin, RequestLogger, ApiCatchPlugin 插件, 其中 FetchAbortPlugin 可以中止请求, ApiCatchPlugin 可以将捕获的错误统一到 apiCatchResult 字段",
|
|
84
|
+
"page.request.api_catch.title": "UserApi: Api Catch Result",
|
|
85
|
+
"page.request.abort.title": "UserApi: Abort Request",
|
|
86
|
+
"page.request.trigger_abort": "触发中止请求",
|
|
87
|
+
"page.request.stop_abort": "停止中止请求",
|
|
88
|
+
"page.request.trigger_api_catch": "触发 API 捕获结果",
|
|
89
|
+
"page.request.stop_api_catch": "停止 API 捕获结果",
|
|
90
|
+
"page.executor.main_title": "执行器",
|
|
91
|
+
"page.executor.test_plugin.title": "测试插件",
|
|
92
|
+
"page.executor.task.status.pending": "等待中",
|
|
93
|
+
"page.executor.task.status.running": "运行中",
|
|
94
|
+
"page.executor.task.status.completed": "已完成",
|
|
95
|
+
"page.executor.task.status.failed": "失败",
|
|
96
|
+
"page.executor.task.type.data_sync": "数据同步",
|
|
97
|
+
"page.executor.task.type.report": "报告生成",
|
|
98
|
+
"page.executor.task.type.maintenance": "系统维护",
|
|
99
|
+
"page.executor.task.type.backup": "数据备份",
|
|
100
|
+
"page.executor.task.duration.unit": "分钟",
|
|
101
|
+
"page.executor.task.start": "开始",
|
|
102
|
+
"page.executor.task.stop": "停止",
|
|
103
|
+
"page.executor.task.success": "任务 %{name} 执行成功",
|
|
104
|
+
"page.executor.task.failure": "任务 %{name} 执行失败",
|
|
105
|
+
"page.executor.plugin.test.success": "插件测试成功",
|
|
106
|
+
"page.executor.plugin.test.failure": "插件测试失败",
|
|
107
|
+
"page.executor.custom_task.url_required": "请输入URL",
|
|
108
|
+
"page.executor.custom_task.name": "自定义任务 %{method} %{url}",
|
|
109
|
+
"page.executor.create_task.title": "创建自定义任务",
|
|
110
|
+
"page.executor.create_button": "创建",
|
|
111
|
+
"page.executor.enter_url": "输入URL",
|
|
112
|
+
"page.executor.task_list.title": "任务列表",
|
|
113
|
+
"page.executor.task_stats.total": "总任务数",
|
|
114
|
+
"page.executor.task_stats.running": "运行中",
|
|
115
|
+
"page.executor.task_stats.completed": "已完成",
|
|
116
|
+
"page.executor.task_stats.failed": "失败",
|
|
117
|
+
"page.executor.task_history.title": "执行历史",
|
|
118
|
+
"page.executor.help.title": "需要帮助?",
|
|
119
|
+
"page.executor.help.description": "遇到问题?查看我们的任务执行指南或联系支持团队",
|
|
120
|
+
"page.executor.view_guide": "查看指南",
|
|
121
|
+
"page.executor.contact_support": "联系支持",
|
|
122
|
+
"page.error.identifier.main_title": "错误标识符",
|
|
123
|
+
"page.error.identifier.source_description": "来自 '@config/Identifier.Error' 的标识符",
|
|
124
|
+
"page.error.identifier.help.title": "需要帮助?",
|
|
125
|
+
"page.error.identifier.help.description": "如果您在使用错误标识符时遇到问题,请联系我们的支持团队",
|
|
126
|
+
"page.error.identifier.contact_support": "联系支持"
|
|
10
127
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import '@/
|
|
1
|
+
import '@/styles/css/index.css';
|
|
2
2
|
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
|
|
3
3
|
import { lazy, useMemo } from 'react';
|
|
4
4
|
import { RouterRenderComponent } from './uikit/components/RouterRenderComponent';
|
|
5
5
|
import { IOC } from './core/IOC';
|
|
6
6
|
import { RouterController } from './uikit/controllers/RouterController';
|
|
7
7
|
import { RouterLoader, type ComponentValue } from '@/base/cases/router-loader';
|
|
8
|
+
import { ConfigProvider } from 'antd';
|
|
8
9
|
|
|
9
10
|
function getAllPages() {
|
|
10
11
|
const modules = import.meta.glob('./pages/**/*.tsx');
|
|
@@ -34,7 +35,18 @@ function App() {
|
|
|
34
35
|
return router;
|
|
35
36
|
}, []);
|
|
36
37
|
|
|
37
|
-
return
|
|
38
|
+
return (
|
|
39
|
+
<ConfigProvider
|
|
40
|
+
theme={{
|
|
41
|
+
cssVar: {
|
|
42
|
+
key: 'fe-theme',
|
|
43
|
+
prefix: 'fe'
|
|
44
|
+
}
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<RouterProvider router={routerBase} />
|
|
48
|
+
</ConfigProvider>
|
|
49
|
+
);
|
|
38
50
|
}
|
|
39
51
|
|
|
40
52
|
export default App;
|
|
@@ -3,22 +3,21 @@ import {
|
|
|
3
3
|
type ExecutorPlugin,
|
|
4
4
|
type ExecutorContext,
|
|
5
5
|
type RequestAdapterFetchConfig,
|
|
6
|
-
type RequestAdapterResponse
|
|
7
|
-
Logger
|
|
6
|
+
type RequestAdapterResponse
|
|
8
7
|
} from '@qlover/fe-corekit';
|
|
9
8
|
import {
|
|
10
9
|
type ApiCatchPluginConfig,
|
|
11
10
|
type ApiCatchPluginResponse
|
|
12
11
|
} from '@qlover/corekit-bridge';
|
|
13
12
|
import { injectable, inject } from 'inversify';
|
|
14
|
-
|
|
13
|
+
import { LoggerInterface } from '@qlover/logger';
|
|
15
14
|
@injectable()
|
|
16
15
|
export class RequestLogger
|
|
17
16
|
implements ExecutorPlugin<RequestAdapterFetchConfig>
|
|
18
17
|
{
|
|
19
18
|
readonly pluginName = 'RequestLogger';
|
|
20
19
|
|
|
21
|
-
constructor(@inject(IOCIdentifier.Logger) public logger:
|
|
20
|
+
constructor(@inject(IOCIdentifier.Logger) public logger: LoggerInterface) {}
|
|
22
21
|
|
|
23
22
|
onBefore(context: ExecutorContext<RequestAdapterFetchConfig<unknown>>): void {
|
|
24
23
|
this.logger.log(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RequestCatcherInterface } from '@/base/port/RequestCatcherInterface';
|
|
2
2
|
import { IOCIdentifier } from '@/core/IOC';
|
|
3
|
-
import type {
|
|
3
|
+
import type { RequestAdapterResponse } from '@qlover/fe-corekit';
|
|
4
|
+
import type { LoggerInterface } from '@qlover/logger';
|
|
4
5
|
import { inject, injectable } from 'inversify';
|
|
5
6
|
|
|
6
7
|
@injectable()
|
|
@@ -9,7 +10,7 @@ export class RequestStatusCatcher
|
|
|
9
10
|
{
|
|
10
11
|
constructor(
|
|
11
12
|
@inject(IOCIdentifier.Logger)
|
|
12
|
-
private readonly logger:
|
|
13
|
+
private readonly logger: LoggerInterface
|
|
13
14
|
) {}
|
|
14
15
|
/**
|
|
15
16
|
* default handler
|
|
@@ -4,17 +4,37 @@ import LanguageDetector from 'i18next-browser-languagedetector';
|
|
|
4
4
|
import HttpApi from 'i18next-http-backend';
|
|
5
5
|
import merge from 'lodash/merge';
|
|
6
6
|
import i18nConfig from '@config/i18n';
|
|
7
|
-
import
|
|
7
|
+
import {
|
|
8
|
+
SliceStore,
|
|
9
|
+
type BootstrapExecutorPlugin
|
|
10
|
+
} from '@qlover/corekit-bridge';
|
|
8
11
|
|
|
9
12
|
const { supportedLngs, fallbackLng } = i18nConfig;
|
|
10
13
|
|
|
11
14
|
export type I18nServiceLocale = (typeof supportedLngs)[number];
|
|
12
15
|
|
|
13
|
-
export class
|
|
16
|
+
export class I18nServiceState {
|
|
17
|
+
loading: boolean = false;
|
|
18
|
+
constructor(public language: I18nServiceLocale) {}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class I18nService
|
|
22
|
+
extends SliceStore<I18nServiceState>
|
|
23
|
+
implements BootstrapExecutorPlugin
|
|
24
|
+
{
|
|
14
25
|
readonly pluginName = 'I18nService';
|
|
15
26
|
|
|
16
|
-
|
|
27
|
+
selector = {
|
|
28
|
+
loading: (state: I18nServiceState) => state.loading
|
|
29
|
+
};
|
|
17
30
|
|
|
31
|
+
constructor(private pathname: string) {
|
|
32
|
+
super(() => new I18nServiceState(i18n.language as I18nServiceLocale));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @override
|
|
37
|
+
*/
|
|
18
38
|
onBefore(): void {
|
|
19
39
|
const debug = false;
|
|
20
40
|
|
|
@@ -48,6 +68,14 @@ export class I18nService implements BootstrapExecutorPlugin {
|
|
|
48
68
|
i18n.services.languageDetector.addDetector(pathLanguageDetector);
|
|
49
69
|
}
|
|
50
70
|
|
|
71
|
+
async changeLanguage(language: I18nServiceLocale): Promise<void> {
|
|
72
|
+
await i18n.changeLanguage(language);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
changeLoading(loading: boolean): void {
|
|
76
|
+
this.emit({ ...this.state, loading });
|
|
77
|
+
}
|
|
78
|
+
|
|
51
79
|
static getCurrentLanguage(): I18nServiceLocale {
|
|
52
80
|
return i18n.language as I18nServiceLocale;
|
|
53
81
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { AsyncExecutor, ExecutorPlugin
|
|
1
|
+
import { AsyncExecutor, ExecutorPlugin } from '@qlover/fe-corekit';
|
|
2
2
|
import { IOCIdentifier } from '@/core/IOC';
|
|
3
3
|
import { injectable, inject } from 'inversify';
|
|
4
|
+
import type { LoggerInterface } from '@qlover/logger';
|
|
4
5
|
|
|
5
6
|
@injectable()
|
|
6
7
|
export class ProcesserService {
|
|
7
8
|
constructor(
|
|
8
|
-
@inject(IOCIdentifier.Logger) private logger:
|
|
9
|
+
@inject(IOCIdentifier.Logger) private logger: LoggerInterface,
|
|
9
10
|
@inject(AsyncExecutor) private executor: AsyncExecutor
|
|
10
11
|
) {}
|
|
11
12
|
|