@qlover/create-app 0.3.2 → 0.3.4
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 +139 -0
- package/package.json +4 -4
- package/templates/react-app/README.md +311 -120
- package/templates/react-app/config/Identifier.I18n.ts +1048 -0
- package/templates/react-app/config/app.router.json +7 -7
- package/templates/react-app/config/common.ts +13 -0
- package/templates/react-app/config/theme.json +7 -88
- package/templates/react-app/package.json +11 -5
- package/templates/react-app/postcss.config.js +1 -2
- package/templates/react-app/public/locales/en/common.json +142 -1
- package/templates/react-app/public/locales/zh/common.json +142 -1
- package/templates/react-app/src/App.tsx +16 -3
- package/templates/react-app/src/base/apis/AiApi.ts +4 -4
- package/templates/react-app/src/base/apis/feApi/FeApiAdapter.ts +2 -2
- package/templates/react-app/src/base/apis/userApi/UserApiAdapter.ts +2 -2
- package/templates/react-app/src/base/cases/AppConfig.ts +103 -0
- package/templates/react-app/src/base/cases/{appError/AppError.ts → AppError.ts} +0 -3
- package/templates/react-app/src/base/cases/DialogHandler.ts +86 -0
- package/templates/react-app/src/base/cases/RequestLogger.ts +1 -1
- package/templates/react-app/src/base/cases/RouterLoader.ts +166 -0
- package/templates/react-app/src/base/port/InteractionHubInterface.ts +94 -0
- package/templates/react-app/src/base/services/I18nService.ts +50 -3
- package/templates/react-app/src/base/services/ProcesserService.ts +0 -1
- package/templates/react-app/src/base/types/deprecated-antd.d.ts +60 -0
- package/templates/react-app/src/core/IOC.ts +18 -8
- package/templates/react-app/src/core/bootstrap.ts +41 -62
- 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 +8 -1
- package/templates/react-app/src/core/registers/RegisterApi.ts +2 -5
- package/templates/react-app/src/core/registers/RegisterCommon.ts +38 -29
- package/templates/react-app/src/core/registers/RegisterControllers.ts +5 -10
- package/templates/react-app/src/core/registers/RegisterGlobals.ts +21 -17
- package/templates/react-app/src/core/registers/index.ts +27 -13
- 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 +118 -2
- package/templates/react-app/src/pages/base/ErrorIdentifier.tsx +38 -19
- package/templates/react-app/src/pages/base/Executor.tsx +442 -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/antd-themes/_default.css +239 -0
- package/templates/react-app/src/styles/css/antd-themes/dark.css +176 -0
- package/templates/react-app/src/styles/css/antd-themes/index.css +3 -0
- package/templates/react-app/src/styles/css/antd-themes/no-context.css +34 -0
- package/templates/react-app/src/styles/css/antd-themes/pink.css +199 -0
- package/templates/react-app/src/{uikit/styles → styles}/css/index.css +3 -0
- 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 +29 -0
- package/templates/react-app/src/styles/css/themes/dark.css +29 -0
- package/templates/react-app/src/styles/css/themes/index.css +3 -0
- package/templates/react-app/src/styles/css/themes/pink.css +29 -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/RouterRenderComponent.tsx +1 -1
- 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 +1 -1
- package/templates/react-app/src/uikit/controllers/UserController.ts +2 -2
- package/templates/react-app/tailwind.config.js +1 -15
- package/templates/react-app/tsconfig.json +3 -2
- package/templates/react-app/tsconfig.node.json +2 -1
- package/templates/react-app/vite.config.ts +15 -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 -6
- 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 -7
- package/templates/react-app/public/locales/zh/request.json +0 -15
- package/templates/react-app/src/base/cases/router-loader/index.ts +0 -90
- package/templates/react-app/src/base/port/InversifyIocInterface.ts +0 -9
- package/templates/react-app/src/core/AppConfig.ts +0 -36
- 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
|
@@ -4,6 +4,9 @@ import { JSONStorageController } from '@/uikit/controllers/JSONStorageController
|
|
|
4
4
|
import { RequestController } from '@/uikit/controllers/RequestController';
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
6
|
import { useSliceStore } from '@qlover/slice-store-react';
|
|
7
|
+
import { Button } from 'antd';
|
|
8
|
+
import { LoadingOutlined } from '@ant-design/icons';
|
|
9
|
+
import * as i18nKeys from '@config/Identifier.I18n';
|
|
7
10
|
|
|
8
11
|
function JSONValue({ value }: { value: unknown }) {
|
|
9
12
|
const output = useMemo(() => {
|
|
@@ -14,7 +17,7 @@ function JSONValue({ value }: { value: unknown }) {
|
|
|
14
17
|
}
|
|
15
18
|
}, [value]);
|
|
16
19
|
return (
|
|
17
|
-
<pre className="mt-1 text-sm text-
|
|
20
|
+
<pre className="mt-1 text-sm text-text-secondary font-mono bg-secondary p-2 rounded overflow-x-auto">
|
|
18
21
|
{output}
|
|
19
22
|
</pre>
|
|
20
23
|
);
|
|
@@ -27,72 +30,48 @@ export default function Request() {
|
|
|
27
30
|
const { t } = useBaseRoutePage();
|
|
28
31
|
|
|
29
32
|
return (
|
|
30
|
-
<div className="min-h-screen bg-
|
|
33
|
+
<div className="min-h-screen bg-primary py-8 px-4 sm:px-6 lg:px-8">
|
|
31
34
|
<div className="max-w-4xl mx-auto space-y-6">
|
|
32
35
|
{/* Request Timeout Information */}
|
|
33
|
-
<div className="bg-
|
|
34
|
-
<h2 className="text-lg font-medium text-
|
|
35
|
-
{t(
|
|
36
|
+
<div className="bg-secondary shadow sm:rounded-lg p-6 border border-primary">
|
|
37
|
+
<h2 className="text-lg font-medium text-text mb-2">
|
|
38
|
+
{t(i18nKeys.PAGE_REQUEST_TIMEOUT)}
|
|
36
39
|
</h2>
|
|
37
|
-
<div className="text-sm text-
|
|
40
|
+
<div className="text-sm text-text-secondary font-mono bg-base p-2 rounded">
|
|
38
41
|
{jsonStorageControllerState.requestTimeout}
|
|
39
42
|
</div>
|
|
40
43
|
</div>
|
|
41
44
|
|
|
42
45
|
{/* Hello Request Card */}
|
|
43
|
-
<div className="bg-
|
|
44
|
-
<h2 className="text-lg font-medium text-
|
|
45
|
-
|
|
46
|
+
<div className="bg-secondary shadow sm:rounded-lg p-6 border border-primary hover:bg-elevated transition-colors duration-200">
|
|
47
|
+
<h2 className="text-lg font-medium text-text mb-4">
|
|
48
|
+
{t(i18nKeys.PAGE_REQUEST_HELLO_TITLE)}
|
|
46
49
|
</h2>
|
|
47
50
|
|
|
48
|
-
<p className="text-sm text-
|
|
49
|
-
|
|
50
|
-
ApiMockPlugin, RequestLogger 插件
|
|
51
|
+
<p className="text-sm text-text-secondary mb-4">
|
|
52
|
+
{t(i18nKeys.PAGE_REQUEST_HELLO_DESCRIPTION)}
|
|
51
53
|
</p>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
+
<Button
|
|
55
|
+
type="primary"
|
|
54
56
|
onClick={requestController.onHello}
|
|
57
|
+
loading={requestControllerState.helloState.loading}
|
|
55
58
|
>
|
|
56
|
-
{requestControllerState.helloState.loading
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
61
|
-
fill="none"
|
|
62
|
-
viewBox="0 0 24 24"
|
|
63
|
-
>
|
|
64
|
-
<circle
|
|
65
|
-
className="opacity-25"
|
|
66
|
-
cx="12"
|
|
67
|
-
cy="12"
|
|
68
|
-
r="10"
|
|
69
|
-
stroke="currentColor"
|
|
70
|
-
strokeWidth="4"
|
|
71
|
-
></circle>
|
|
72
|
-
<path
|
|
73
|
-
className="opacity-75"
|
|
74
|
-
fill="currentColor"
|
|
75
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
76
|
-
></path>
|
|
77
|
-
</svg>
|
|
78
|
-
{t('loading')}
|
|
79
|
-
</>
|
|
80
|
-
) : (
|
|
81
|
-
'Hello'
|
|
82
|
-
)}
|
|
83
|
-
</button>
|
|
59
|
+
{requestControllerState.helloState.loading
|
|
60
|
+
? t(i18nKeys.REQUEST_LOADING)
|
|
61
|
+
: t(i18nKeys.PAGE_REQUEST_HELLO_BUTTON)}
|
|
62
|
+
</Button>
|
|
84
63
|
|
|
85
64
|
<div className="mt-4 space-y-2">
|
|
86
65
|
<div>
|
|
87
|
-
<p className="text-sm font-medium text-
|
|
88
|
-
{t(
|
|
66
|
+
<p className="text-sm font-medium text-text">
|
|
67
|
+
{t(i18nKeys.REQUEST_HELLO_RESULT)}:
|
|
89
68
|
</p>
|
|
90
69
|
<JSONValue value={requestControllerState.helloState.result} />
|
|
91
70
|
</div>
|
|
92
71
|
|
|
93
72
|
<div>
|
|
94
|
-
<p className="text-sm font-medium text-
|
|
95
|
-
{t(
|
|
73
|
+
<p className="text-sm font-medium text-text">
|
|
74
|
+
{t(i18nKeys.REQUEST_HELLO_ERROR)}:
|
|
96
75
|
</p>
|
|
97
76
|
<JSONValue value={requestControllerState.helloState.error} />
|
|
98
77
|
</div>
|
|
@@ -100,105 +79,54 @@ export default function Request() {
|
|
|
100
79
|
</div>
|
|
101
80
|
|
|
102
81
|
{/* IP Information Card */}
|
|
103
|
-
<div className="bg-
|
|
104
|
-
<h2 className="text-lg font-medium text-
|
|
105
|
-
|
|
82
|
+
<div className="bg-secondary shadow sm:rounded-lg p-6 border border-primary hover:bg-elevated transition-colors duration-200">
|
|
83
|
+
<h2 className="text-lg font-medium text-text mb-4">
|
|
84
|
+
{t(i18nKeys.PAGE_REQUEST_IP_INFO_TITLE)}
|
|
106
85
|
</h2>
|
|
107
86
|
|
|
108
|
-
<p className="text-sm text-
|
|
109
|
-
|
|
110
|
-
RequestCommonPlugin, RequestLogger, ApiPickDataPlugin 插件, 其中
|
|
111
|
-
ApiPickDataPlugin 插件可以将返回类型统一扁平到 data 字段
|
|
87
|
+
<p className="text-sm text-text-secondary mb-4">
|
|
88
|
+
{t(i18nKeys.PAGE_REQUEST_IP_INFO_DESCRIPTION)}
|
|
112
89
|
</p>
|
|
113
|
-
<
|
|
114
|
-
|
|
90
|
+
<Button
|
|
91
|
+
type="primary"
|
|
115
92
|
onClick={requestController.onIpInfo}
|
|
93
|
+
loading={requestControllerState.ipInfoState.loading}
|
|
116
94
|
>
|
|
117
|
-
{requestControllerState.ipInfoState.loading
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
122
|
-
fill="none"
|
|
123
|
-
viewBox="0 0 24 24"
|
|
124
|
-
>
|
|
125
|
-
<circle
|
|
126
|
-
className="opacity-25"
|
|
127
|
-
cx="12"
|
|
128
|
-
cy="12"
|
|
129
|
-
r="10"
|
|
130
|
-
stroke="currentColor"
|
|
131
|
-
strokeWidth="4"
|
|
132
|
-
></circle>
|
|
133
|
-
<path
|
|
134
|
-
className="opacity-75"
|
|
135
|
-
fill="currentColor"
|
|
136
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
137
|
-
></path>
|
|
138
|
-
</svg>
|
|
139
|
-
{t('loading')}
|
|
140
|
-
</>
|
|
141
|
-
) : (
|
|
142
|
-
t('ipInfo')
|
|
143
|
-
)}
|
|
144
|
-
</button>
|
|
95
|
+
{requestControllerState.ipInfoState.loading
|
|
96
|
+
? t(i18nKeys.REQUEST_LOADING)
|
|
97
|
+
: t(i18nKeys.REQUEST_IP_INFO)}
|
|
98
|
+
</Button>
|
|
145
99
|
|
|
146
100
|
<div className="mt-4">
|
|
147
|
-
<p className="text-sm font-medium text-
|
|
148
|
-
{t(
|
|
101
|
+
<p className="text-sm font-medium text-text">
|
|
102
|
+
{t(i18nKeys.REQUEST_IP_INFO_RESULT)}:
|
|
149
103
|
</p>
|
|
150
104
|
<JSONValue value={requestControllerState.ipInfoState.result} />
|
|
151
105
|
</div>
|
|
152
106
|
</div>
|
|
153
107
|
|
|
154
108
|
{/* Random User Card */}
|
|
155
|
-
<div className="bg-
|
|
156
|
-
<h2 className="text-lg font-medium text-
|
|
157
|
-
|
|
109
|
+
<div className="bg-secondary shadow sm:rounded-lg p-6 border border-primary hover:bg-elevated transition-colors duration-200">
|
|
110
|
+
<h2 className="text-lg font-medium text-text mb-4">
|
|
111
|
+
{t(i18nKeys.PAGE_REQUEST_RANDOM_USER_TITLE)}
|
|
158
112
|
</h2>
|
|
159
|
-
<p className="text-sm text-
|
|
160
|
-
|
|
161
|
-
RequestCommonPlugin, ApiMockPlugin, FetchAbortPlugin,
|
|
162
|
-
RequestLogger,ApiCatchPlugin 插件, 其中 FetchAbortPlugin 可以
|
|
163
|
-
中止请求, ApiCatchPlugin 可以将捕获的错误统一到 apiCatchResult 字段
|
|
113
|
+
<p className="text-sm text-text-secondary mb-4">
|
|
114
|
+
{t(i18nKeys.PAGE_REQUEST_RANDOM_USER_DESCRIPTION)}
|
|
164
115
|
</p>
|
|
165
|
-
<
|
|
166
|
-
|
|
116
|
+
<Button
|
|
117
|
+
type="primary"
|
|
167
118
|
onClick={requestController.onRandomUser}
|
|
119
|
+
loading={requestControllerState.randomUserState.loading}
|
|
168
120
|
>
|
|
169
|
-
{requestControllerState.randomUserState.loading
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
174
|
-
fill="none"
|
|
175
|
-
viewBox="0 0 24 24"
|
|
176
|
-
>
|
|
177
|
-
<circle
|
|
178
|
-
className="opacity-25"
|
|
179
|
-
cx="12"
|
|
180
|
-
cy="12"
|
|
181
|
-
r="10"
|
|
182
|
-
stroke="currentColor"
|
|
183
|
-
strokeWidth="4"
|
|
184
|
-
></circle>
|
|
185
|
-
<path
|
|
186
|
-
className="opacity-75"
|
|
187
|
-
fill="currentColor"
|
|
188
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
189
|
-
></path>
|
|
190
|
-
</svg>
|
|
191
|
-
{t('loading')}
|
|
192
|
-
</>
|
|
193
|
-
) : (
|
|
194
|
-
t('randomUser')
|
|
195
|
-
)}
|
|
196
|
-
</button>
|
|
121
|
+
{requestControllerState.randomUserState.loading
|
|
122
|
+
? t(i18nKeys.REQUEST_LOADING)
|
|
123
|
+
: t(i18nKeys.REQUEST_RANDOM_USER)}
|
|
124
|
+
</Button>
|
|
197
125
|
|
|
198
126
|
<div className="mt-4 space-y-2">
|
|
199
127
|
<div>
|
|
200
|
-
<p className="text-sm font-medium text-
|
|
201
|
-
{t(
|
|
128
|
+
<p className="text-sm font-medium text-text">
|
|
129
|
+
{t(i18nKeys.REQUEST_RANDOM_USER_RESULT)}:
|
|
202
130
|
</p>
|
|
203
131
|
<JSONValue
|
|
204
132
|
value={requestControllerState.randomUserState.result}
|
|
@@ -206,8 +134,8 @@ export default function Request() {
|
|
|
206
134
|
</div>
|
|
207
135
|
|
|
208
136
|
<div>
|
|
209
|
-
<p className="text-sm font-medium text-
|
|
210
|
-
{t(
|
|
137
|
+
<p className="text-sm font-medium text-text">
|
|
138
|
+
{t(i18nKeys.REQUEST_RANDOM_USER_ERROR)}:
|
|
211
139
|
</p>
|
|
212
140
|
<JSONValue value={requestControllerState.randomUserState.error} />
|
|
213
141
|
</div>
|
|
@@ -215,51 +143,29 @@ export default function Request() {
|
|
|
215
143
|
</div>
|
|
216
144
|
|
|
217
145
|
{/* Api catch result */}
|
|
218
|
-
<div className="bg-
|
|
219
|
-
<h2 className="text-lg font-medium text-
|
|
220
|
-
|
|
146
|
+
<div className="bg-secondary shadow sm:rounded-lg p-6 border border-primary hover:bg-elevated transition-colors duration-200">
|
|
147
|
+
<h2 className="text-lg font-medium text-text mb-4">
|
|
148
|
+
{t(i18nKeys.PAGE_REQUEST_API_CATCH_TITLE)}
|
|
221
149
|
</h2>
|
|
222
|
-
<
|
|
223
|
-
|
|
150
|
+
<Button
|
|
151
|
+
type={
|
|
224
152
|
requestControllerState.apiCatchResultState.loading
|
|
225
|
-
? '
|
|
226
|
-
: '
|
|
227
|
-
}
|
|
153
|
+
? 'primary'
|
|
154
|
+
: 'primary'
|
|
155
|
+
}
|
|
156
|
+
danger={requestControllerState.apiCatchResultState.loading}
|
|
228
157
|
onClick={requestController.onTriggerApiCatchResult}
|
|
158
|
+
loading={requestControllerState.apiCatchResultState.loading}
|
|
229
159
|
>
|
|
230
|
-
{requestControllerState.apiCatchResultState.loading
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
235
|
-
fill="none"
|
|
236
|
-
viewBox="0 0 24 24"
|
|
237
|
-
>
|
|
238
|
-
<circle
|
|
239
|
-
className="opacity-25"
|
|
240
|
-
cx="12"
|
|
241
|
-
cy="12"
|
|
242
|
-
r="10"
|
|
243
|
-
stroke="currentColor"
|
|
244
|
-
strokeWidth="4"
|
|
245
|
-
></circle>
|
|
246
|
-
<path
|
|
247
|
-
className="opacity-75"
|
|
248
|
-
fill="currentColor"
|
|
249
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
250
|
-
></path>
|
|
251
|
-
</svg>
|
|
252
|
-
{t('stopApiCatchResult')}
|
|
253
|
-
</>
|
|
254
|
-
) : (
|
|
255
|
-
t('triggerApiCatchResult')
|
|
256
|
-
)}
|
|
257
|
-
</button>
|
|
160
|
+
{requestControllerState.apiCatchResultState.loading
|
|
161
|
+
? t(i18nKeys.PAGE_REQUEST_STOP_API_CATCH)
|
|
162
|
+
: t(i18nKeys.PAGE_REQUEST_TRIGGER_API_CATCH)}
|
|
163
|
+
</Button>
|
|
258
164
|
|
|
259
165
|
<div className="mt-4 space-y-2">
|
|
260
166
|
<div>
|
|
261
|
-
<p className="text-sm font-medium text-
|
|
262
|
-
{t(
|
|
167
|
+
<p className="text-sm font-medium text-text">
|
|
168
|
+
{t(i18nKeys.REQUEST_ABORT_RESULT)}:
|
|
263
169
|
</p>
|
|
264
170
|
<JSONValue
|
|
265
171
|
value={requestControllerState.apiCatchResultState.result}
|
|
@@ -267,8 +173,8 @@ export default function Request() {
|
|
|
267
173
|
</div>
|
|
268
174
|
|
|
269
175
|
<div>
|
|
270
|
-
<p className="text-sm font-medium text-
|
|
271
|
-
{t(
|
|
176
|
+
<p className="text-sm font-medium text-text">
|
|
177
|
+
{t(i18nKeys.REQUEST_ABORT_ERROR)}:
|
|
272
178
|
</p>
|
|
273
179
|
<JSONValue
|
|
274
180
|
value={requestControllerState.apiCatchResultState.error}
|
|
@@ -278,58 +184,34 @@ export default function Request() {
|
|
|
278
184
|
</div>
|
|
279
185
|
|
|
280
186
|
{/* Abort Request Card */}
|
|
281
|
-
<div className="bg-
|
|
282
|
-
<h2 className="text-lg font-medium text-
|
|
283
|
-
|
|
187
|
+
<div className="bg-secondary shadow sm:rounded-lg p-6 border border-primary hover:bg-elevated transition-colors duration-200">
|
|
188
|
+
<h2 className="text-lg font-medium text-text mb-4">
|
|
189
|
+
{t(i18nKeys.PAGE_REQUEST_ABORT_TITLE)}
|
|
284
190
|
</h2>
|
|
285
|
-
<
|
|
286
|
-
|
|
287
|
-
requestControllerState.abortState.loading
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}`}
|
|
191
|
+
<Button
|
|
192
|
+
type={
|
|
193
|
+
requestControllerState.abortState.loading ? 'primary' : 'primary'
|
|
194
|
+
}
|
|
195
|
+
danger={requestControllerState.abortState.loading}
|
|
291
196
|
onClick={requestController.onTriggerAbortRequest}
|
|
292
197
|
>
|
|
293
|
-
{requestControllerState.abortState.loading
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
fill="none"
|
|
299
|
-
viewBox="0 0 24 24"
|
|
300
|
-
>
|
|
301
|
-
<circle
|
|
302
|
-
className="opacity-25"
|
|
303
|
-
cx="12"
|
|
304
|
-
cy="12"
|
|
305
|
-
r="10"
|
|
306
|
-
stroke="currentColor"
|
|
307
|
-
strokeWidth="4"
|
|
308
|
-
></circle>
|
|
309
|
-
<path
|
|
310
|
-
className="opacity-75"
|
|
311
|
-
fill="currentColor"
|
|
312
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
313
|
-
></path>
|
|
314
|
-
</svg>
|
|
315
|
-
{t('stopAbortRequest')}
|
|
316
|
-
</>
|
|
317
|
-
) : (
|
|
318
|
-
t('triggerAbortRequest')
|
|
319
|
-
)}
|
|
320
|
-
</button>
|
|
198
|
+
{requestControllerState.abortState.loading && <LoadingOutlined />}
|
|
199
|
+
{requestControllerState.abortState.loading
|
|
200
|
+
? t(i18nKeys.PAGE_REQUEST_STOP_ABORT)
|
|
201
|
+
: t(i18nKeys.PAGE_REQUEST_TRIGGER_ABORT)}
|
|
202
|
+
</Button>
|
|
321
203
|
|
|
322
204
|
<div className="mt-4 space-y-2">
|
|
323
205
|
<div>
|
|
324
|
-
<p className="text-sm font-medium text-
|
|
325
|
-
{t(
|
|
206
|
+
<p className="text-sm font-medium text-text">
|
|
207
|
+
{t(i18nKeys.REQUEST_ABORT_RESULT)}:
|
|
326
208
|
</p>
|
|
327
209
|
<JSONValue value={requestControllerState.abortState.result} />
|
|
328
210
|
</div>
|
|
329
211
|
|
|
330
212
|
<div>
|
|
331
|
-
<p className="text-sm font-medium text-
|
|
332
|
-
{t(
|
|
213
|
+
<p className="text-sm font-medium text-text">
|
|
214
|
+
{t(i18nKeys.REQUEST_ABORT_ERROR)}:
|
|
333
215
|
</p>
|
|
334
216
|
<JSONValue value={requestControllerState.abortState.error} />
|
|
335
217
|
</div>
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import ThemeSwitcher from '@/uikit/components/ThemeSwitcher';
|
|
2
2
|
import LocaleLink from '@/uikit/components/LocaleLink';
|
|
3
|
+
import LanguageSwitcher from '@/uikit/components/LanguageSwitcher';
|
|
3
4
|
|
|
4
5
|
export default function BaseHeader() {
|
|
5
6
|
return (
|
|
6
|
-
<header className="h-
|
|
7
|
-
<div className="flex items-center justify-between h-full px-
|
|
7
|
+
<header className="h-14 bg-secondary border-b border-border sticky top-0 z-50">
|
|
8
|
+
<div className="flex items-center justify-between h-full px-4 mx-auto max-w-7xl">
|
|
8
9
|
<div className="flex items-center">
|
|
9
|
-
<LocaleLink
|
|
10
|
-
|
|
10
|
+
<LocaleLink
|
|
11
|
+
href="/"
|
|
12
|
+
className="flex items-center hover:opacity-80 transition-opacity"
|
|
13
|
+
>
|
|
14
|
+
<img src="/logo.svg" alt="logo" className="h-8 w-auto" />
|
|
15
|
+
<span className="ml-2 text-lg font-semibold text-text">
|
|
16
|
+
{'appName'}
|
|
17
|
+
</span>
|
|
11
18
|
</LocaleLink>
|
|
12
19
|
</div>
|
|
13
|
-
<div className="flex items-center">
|
|
20
|
+
<div className="flex items-center gap-4">
|
|
21
|
+
<LanguageSwitcher />
|
|
14
22
|
<ThemeSwitcher />
|
|
15
23
|
</div>
|
|
16
24
|
</div>
|