feat(layout): refine footer visibility logic to target CardPro component pages

- Replace blanket console route footer hiding with specific page targeting
- Only hide footer on pages that use CardPro component:
  * /console/channel (channels management)
  * /console/log (usage logs)
  * /console/redemption (redemption codes)
  * /console/user (user management)
  * /console/token (token management)
  * /console/midjourney (midjourney logs)
  * /console/task (task logs)
  * /console/models (model management)
  * /pricing (pricing page)
- Footer now displays on other console pages (dashboard, settings, topup, etc.)
- Improves UI consistency by showing footer where CardPro's internal pagination isn't used

This change ensures footer is only hidden when CardPro component provides its own
pagination/footer functionality, while preserving footer visibility on other pages
that benefit from the global footer navigation.
This commit is contained in:
t0ng7u
2025-09-27 18:47:53 +08:00
committed by CaIon
parent f473d20a09
commit df19a8de5d
20 changed files with 240 additions and 143 deletions

View File

@@ -46,7 +46,6 @@ import { useTranslation } from 'react-i18next';
const SystemSetting = () => {
const { t } = useTranslation();
let [inputs, setInputs] = useState({
PasswordLoginEnabled: '',
PasswordRegisterEnabled: '',
EmailVerificationEnabled: '',
@@ -212,7 +211,9 @@ const SystemSetting = () => {
setInputs(newInputs);
setOriginInputs(newInputs);
// 同步模式布尔到本地状态
if (typeof newInputs['fetch_setting.domain_filter_mode'] !== 'undefined') {
if (
typeof newInputs['fetch_setting.domain_filter_mode'] !== 'undefined'
) {
setDomainFilterMode(!!newInputs['fetch_setting.domain_filter_mode']);
}
if (typeof newInputs['fetch_setting.ip_filter_mode'] !== 'undefined') {
@@ -749,14 +750,17 @@ const SystemSetting = () => {
noLabel
extraText={t('SSRF防护开关详细说明')}
onChange={(e) =>
handleCheckboxChange('fetch_setting.enable_ssrf_protection', e)
handleCheckboxChange(
'fetch_setting.enable_ssrf_protection',
e,
)
}
>
{t('启用SSRF防护推荐开启以保护服务器安全')}
</Form.Checkbox>
</Col>
</Row>
<Row
gutter={{ xs: 8, sm: 16, md: 24, lg: 24, xl: 24, xxl: 24 }}
style={{ marginTop: 16 }}
@@ -767,14 +771,19 @@ const SystemSetting = () => {
noLabel
extraText={t('私有IP访问详细说明')}
onChange={(e) =>
handleCheckboxChange('fetch_setting.allow_private_ip', e)
handleCheckboxChange(
'fetch_setting.allow_private_ip',
e,
)
}
>
{t('允许访问私有IP地址127.0.0.1、192.168.x.x等内网地址')}
{t(
'允许访问私有IP地址127.0.0.1、192.168.x.x等内网地址',
)}
</Form.Checkbox>
</Col>
</Row>
<Row
gutter={{ xs: 8, sm: 16, md: 24, lg: 24, xl: 24, xxl: 24 }}
style={{ marginTop: 16 }}
@@ -785,7 +794,10 @@ const SystemSetting = () => {
noLabel
extraText={t('域名IP过滤详细说明')}
onChange={(e) =>
handleCheckboxChange('fetch_setting.apply_ip_filter_for_domain', e)
handleCheckboxChange(
'fetch_setting.apply_ip_filter_for_domain',
e,
)
}
style={{ marginBottom: 8 }}
>
@@ -794,17 +806,23 @@ const SystemSetting = () => {
<Text strong>
{t(domainFilterMode ? '域名白名单' : '域名黑名单')}
</Text>
<Text type="secondary" style={{ display: 'block', marginBottom: 8 }}>
{t('支持通配符格式example.com, *.api.example.com')}
<Text
type='secondary'
style={{ display: 'block', marginBottom: 8 }}
>
{t(
'支持通配符格式example.com, *.api.example.com',
)}
</Text>
<Radio.Group
type='button'
value={domainFilterMode ? 'whitelist' : 'blacklist'}
onChange={(val) => {
const selected = val && val.target ? val.target.value : val;
const selected =
val && val.target ? val.target.value : val;
const isWhitelist = selected === 'whitelist';
setDomainFilterMode(isWhitelist);
setInputs(prev => ({
setInputs((prev) => ({
...prev,
'fetch_setting.domain_filter_mode': isWhitelist,
}));
@@ -819,9 +837,9 @@ const SystemSetting = () => {
onChange={(value) => {
setDomainList(value);
// 触发Form的onChange事件
setInputs(prev => ({
setInputs((prev) => ({
...prev,
'fetch_setting.domain_list': value
'fetch_setting.domain_list': value,
}));
}}
placeholder={t('输入域名后回车example.com')}
@@ -838,17 +856,21 @@ const SystemSetting = () => {
<Text strong>
{t(ipFilterMode ? 'IP白名单' : 'IP黑名单')}
</Text>
<Text type="secondary" style={{ display: 'block', marginBottom: 8 }}>
<Text
type='secondary'
style={{ display: 'block', marginBottom: 8 }}
>
{t('支持CIDR格式8.8.8.8, 192.168.1.0/24')}
</Text>
<Radio.Group
type='button'
value={ipFilterMode ? 'whitelist' : 'blacklist'}
onChange={(val) => {
const selected = val && val.target ? val.target.value : val;
const selected =
val && val.target ? val.target.value : val;
const isWhitelist = selected === 'whitelist';
setIpFilterMode(isWhitelist);
setInputs(prev => ({
setInputs((prev) => ({
...prev,
'fetch_setting.ip_filter_mode': isWhitelist,
}));
@@ -863,9 +885,9 @@ const SystemSetting = () => {
onChange={(value) => {
setIpList(value);
// 触发Form的onChange事件
setInputs(prev => ({
setInputs((prev) => ({
...prev,
'fetch_setting.ip_list': value
'fetch_setting.ip_list': value,
}));
}}
placeholder={t('输入IP地址后回车8.8.8.8')}
@@ -880,7 +902,10 @@ const SystemSetting = () => {
>
<Col xs={24} sm={24} md={24} lg={24} xl={24}>
<Text strong>{t('允许的端口')}</Text>
<Text type="secondary" style={{ display: 'block', marginBottom: 8 }}>
<Text
type='secondary'
style={{ display: 'block', marginBottom: 8 }}
>
{t('支持单个端口和端口范围80, 443, 8000-8999')}
</Text>
<TagInput
@@ -888,15 +913,18 @@ const SystemSetting = () => {
onChange={(value) => {
setAllowedPorts(value);
// 触发Form的onChange事件
setInputs(prev => ({
setInputs((prev) => ({
...prev,
'fetch_setting.allowed_ports': value
'fetch_setting.allowed_ports': value,
}));
}}
placeholder={t('输入端口后回车80 或 8000-8999')}
style={{ width: '100%' }}
/>
<Text type="secondary" style={{ display: 'block', marginBottom: 8 }}>
<Text
type='secondary'
style={{ display: 'block', marginBottom: 8 }}
>
{t('端口配置详细说明')}
</Text>
</Col>