♻️ refactor(web): migrate React modules from .js to .jsx and align entrypoint

- Rename React components/pages/utilities that contain JSX to `.jsx` across `web/src`
- Update import paths and re-exports to match new `.jsx` extensions
- Fix Vite entry by switching `web/index.html` from `/src/index.js` to `/src/index.jsx`
- Verified remaining `.js` files are plain JS (hooks/helpers/constants) and do not require JSX
- No runtime behavior changes; extension and reference alignment only

Context: Resolves the Vite pre-transform error caused by the stale `/src/index.js` entry after migrating to `.jsx`.
This commit is contained in:
t0ng7u
2025-08-18 04:14:35 +08:00
parent cfc6bc8e5e
commit adc7fbd424
173 changed files with 299 additions and 280 deletions

View File

@@ -26,7 +26,7 @@ import {
showSuccess,
verifyJSON,
} from '../../../../helpers';
import { useIsMobile } from '../../../../hooks/common/useIsMobile.js';
import { useIsMobile } from '../../../../hooks/common/useIsMobile';
import { CHANNEL_OPTIONS } from '../../../../constants';
import {
SideSheet,
@@ -1653,50 +1653,50 @@ const EditChannelModal = (props) => {
/>
<Form.TextArea
field='param_override'
label={t('参数覆盖')}
placeholder={
t('此项可选,用于覆盖请求参数。不支持覆盖 stream 参数') +
'\n' + t('旧格式(直接覆盖):') +
'\n{\n "temperature": 0,\n "max_tokens": 1000\n}' +
'\n\n' + t('新格式支持条件判断与json自定义') +
'\n{\n "operations": [\n {\n "path": "temperature",\n "mode": "set",\n "value": 0.7,\n "conditions": [\n {\n "path": "model",\n "mode": "prefix",\n "value": "gpt"\n }\n ]\n }\n ]\n}'
}
autosize
onChange={(value) => handleInputChange('param_override', value)}
extraText={
<div className="flex gap-2 flex-wrap">
<Text
className="!text-semi-color-primary cursor-pointer"
onClick={() => handleInputChange('param_override', JSON.stringify({ temperature: 0 }, null, 2))}
>
{t('旧格式模板')}
</Text>
<Text
className="!text-semi-color-primary cursor-pointer"
onClick={() => handleInputChange('param_override', JSON.stringify({
operations: [
field='param_override'
label={t('参数覆盖')}
placeholder={
t('此项可选,用于覆盖请求参数。不支持覆盖 stream 参数') +
'\n' + t('旧格式(直接覆盖):') +
'\n{\n "temperature": 0,\n "max_tokens": 1000\n}' +
'\n\n' + t('新格式支持条件判断与json自定义') +
'\n{\n "operations": [\n {\n "path": "temperature",\n "mode": "set",\n "value": 0.7,\n "conditions": [\n {\n "path": "model",\n "mode": "prefix",\n "value": "gpt"\n }\n ]\n }\n ]\n}'
}
autosize
onChange={(value) => handleInputChange('param_override', value)}
extraText={
<div className="flex gap-2 flex-wrap">
<Text
className="!text-semi-color-primary cursor-pointer"
onClick={() => handleInputChange('param_override', JSON.stringify({ temperature: 0 }, null, 2))}
>
{t('旧格式模板')}
</Text>
<Text
className="!text-semi-color-primary cursor-pointer"
onClick={() => handleInputChange('param_override', JSON.stringify({
operations: [
{
path: "temperature",
mode: "set",
value: 0.7,
conditions: [
{
path: "temperature",
mode: "set",
value: 0.7,
conditions: [
{
path: "model",
mode: "prefix",
value: "gpt"
}
],
logic: "AND"
path: "model",
mode: "prefix",
value: "gpt"
}
]
}, null, 2))}
>
{t('新格式模板')}
</Text>
</div>
}
showClear
],
logic: "AND"
}
]
}, null, 2))}
>
{t('新格式模板')}
</Text>
</div>
}
showClear
/>