Skip to content

Commit 1853b25

Browse files
committed
修复GitHub Actions工作流文件中的YAML语法错误
1 parent 0d675a0 commit 1853b25

File tree

8 files changed

+64
-16
lines changed

8 files changed

+64
-16
lines changed

.github/workflows/deploy-github-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
token: ${{ secrets.GITHUB_TOKEN }} # GitHub自动提供的访问令牌
3636

3737
- name: 部署完成通知
38-
run: echo "✅ 网站已成功部署到GitHub Pages!访问地址: https://jsrep.github.io/crawler-leetcode/"
38+
run: 'echo "✅ 网站已成功部署到GitHub Pages!访问地址: https://jsrep.github.io/crawler-leetcode/"'

docs/challenges/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ challenges:
6666
```yaml
6767
version: 1
6868
challenges:
69-
- id: 12
70-
id-alias: akamai-bot
69+
- id: 999
70+
id-alias: example-akamai
7171
tags:
7272
- browser-fingerprint
7373
- behavior-analysis

docs/challenges/加速乐.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version: 1
66
# 爬虫挑战合集定义
77
challenges:
88
# 单个爬虫挑战定义,每个挑战都有一个唯一的id标识,id是必须的,ID必须是一个整数,并且全局唯一
9-
- id: 21
9+
- id: 33
1010
# 可以给ID设置一个别名,用于在列表中显示,ID别名也可以用于访问详情页
1111
id-alias: jsl
1212
# 挑战标签系统(数组格式,选填)

docs/challenges/瑞数.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version: 1
66
# 爬虫挑战合集定义
77
challenges:
88
# 单个爬虫挑战定义,每个挑战都有一个唯一的id标识,id是必须的,ID必须是一个整数,并且全局唯一
9-
- id: 12
9+
- id: 32
1010
# 可以给ID设置一个别名,用于在列表中显示,ID别名也可以用于访问详情页
1111
id-alias: river
1212
# 挑战标签系统(数组格式,选填)

docs/challenges/阿里滑块.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version: 1
66
# 爬虫挑战合集定义
77
challenges:
88
# 单个爬虫挑战定义,每个挑战都有一个唯一的id标识,id是必须的,ID必须是一个整数,并且全局唯一
9-
- id: 10
9+
- id: 31
1010
# 可以给ID设置一个别名,用于在列表中显示,ID别名也可以用于访问详情页
1111
id-alias: ali-slider
1212
# 挑战标签系统(数组格式,选填)

src/components/ChallengeListPage/ChallengeControls.tsx

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import { Select, Divider, Space, Dropdown, Button, Menu, Checkbox } from 'antd';
2-
import { SortAscendingOutlined, SortDescendingOutlined, TagOutlined, FilterOutlined, DownOutlined } from '@ant-design/icons';
1+
import { Select, Divider, Space, Dropdown, Button, Menu, Checkbox, Input } from 'antd';
2+
import { SortAscendingOutlined, SortDescendingOutlined, TagOutlined, FilterOutlined, DownOutlined, SearchOutlined } from '@ant-design/icons';
33
import { useTranslation } from 'react-i18next';
4+
import { useState, ChangeEvent } from 'react';
45
import StarRating from '../StarRating';
56

7+
// 定义平台枚举值
8+
const PLATFORM_TYPES = ['Web', 'Android', 'iOS'];
9+
610
interface ChallengeControlsProps {
711
/**
812
* 所有可用的标签
@@ -85,6 +89,9 @@ const ChallengeControls: React.FC<ChallengeControlsProps> = ({
8589
}) => {
8690
const { t } = useTranslation();
8791

92+
// 在组件的开头部分添加状态
93+
const [tagSearchText, setTagSearchText] = useState('');
94+
8895
// 排序功能菜单
8996
const sortMenu = (
9097
<Menu
@@ -130,7 +137,8 @@ const ChallengeControls: React.FC<ChallengeControlsProps> = ({
130137
onClick={({ key }) => onPlatformChange(key)}
131138
>
132139
<Menu.Item key="all">{t('challenges.filters.allPlatforms')}</Menu.Item>
133-
{allPlatforms.map(platform => (
140+
{/* 使用固定的平台枚举列表,而不是从挑战中提取的 */}
141+
{PLATFORM_TYPES.map(platform => (
134142
<Menu.Item key={platform}>{platform}</Menu.Item>
135143
))}
136144
</Menu>
@@ -142,17 +150,55 @@ const ChallengeControls: React.FC<ChallengeControlsProps> = ({
142150
padding: '12px',
143151
maxHeight: '400px',
144152
overflowY: 'auto',
145-
minWidth: '200px',
153+
minWidth: '300px',
146154
backgroundColor: '#fff',
147155
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.15)',
148156
borderRadius: '4px',
149157
border: '1px solid #f0f0f0'
150158
}}>
151-
<Checkbox.Group
152-
options={allTags.map(tag => ({ label: tag, value: tag }))}
153-
value={selectedTags}
154-
onChange={tags => onTagsChange(tags as string[])}
159+
{/* 添加标签搜索框 */}
160+
<Input
161+
prefix={<SearchOutlined />}
162+
placeholder={t('challenges.filters.searchTags')}
163+
style={{ marginBottom: '12px' }}
164+
onChange={(e: ChangeEvent<HTMLInputElement>) => {
165+
setTagSearchText(e.target.value);
166+
}}
167+
allowClear
155168
/>
169+
170+
{/* 标签列表,使用Grid布局优化显示 */}
171+
<div>
172+
<Checkbox.Group
173+
value={selectedTags}
174+
onChange={tags => onTagsChange(tags as string[])}
175+
style={{
176+
display: 'flex',
177+
flexWrap: 'wrap',
178+
width: '100%'
179+
}}
180+
>
181+
{allTags
182+
.filter(tag => tag.toLowerCase().includes(tagSearchText.toLowerCase()))
183+
.map(tag => (
184+
<Checkbox
185+
key={tag}
186+
value={tag}
187+
style={{
188+
marginRight: '12px',
189+
marginBottom: '6px',
190+
width: 'auto',
191+
display: 'inline-flex',
192+
alignItems: 'center',
193+
fontSize: '13px'
194+
}}
195+
>
196+
{tag}
197+
</Checkbox>
198+
))
199+
}
200+
</Checkbox.Group>
201+
</div>
156202
</div>
157203
);
158204

src/locales/en.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ export default {
9797
allDifficulties: 'All difficulties',
9898
allPlatforms: 'All platforms',
9999
search: 'Search challenges...',
100-
clearAll: 'Clear all'
100+
clearAll: 'Clear all',
101+
searchTags: 'Search tags...'
101102
},
102103
sort: {
103104
number: 'Problem No.',

src/locales/zh.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ const zhTranslations = {
9797
allDifficulties: '所有难度',
9898
allPlatforms: '所有平台',
9999
search: '搜索挑战...',
100-
clearAll: '清空所有'
100+
clearAll: '清空所有',
101+
searchTags: '搜索标签...'
101102
},
102103
sort: {
103104
number: '题号',

0 commit comments

Comments
 (0)