forked from element-plus/element-plus
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add spider template selection and internationalization support
- Introduced a new computed property for spider template options in SpiderForm.vue, allowing users to select from predefined spider templates. - Implemented a template change handler to update form fields based on the selected template. - Enhanced internationalization files to include new labels for the template feature in both English and Chinese. - Updated type definitions to support the new template and template parameters in the spider model. These changes improve the user experience by providing a more flexible and user-friendly interface for managing spider configurations.
- Loading branch information
Marvin Zhang
committed
Jan 6, 2025
1 parent
f583aab
commit 89b7876
Showing
6 changed files
with
137 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
export const getSpiderTemplates = (): SpiderTemplate[] => { | ||
return [ | ||
{ | ||
name: 'scrapy', | ||
label: 'Scrapy', | ||
cmd: 'scrapy crawl scrapy_spider', | ||
params: { | ||
spider_name: 'scrapy_spider', | ||
start_urls: 'http://example.com', | ||
domains: 'example.com', | ||
}, | ||
}, | ||
{ | ||
name: 'bs4', | ||
label: 'BeautifulSoup', | ||
cmd: 'python main.py', | ||
}, | ||
{ | ||
name: 'selenium', | ||
label: 'Selenium', | ||
cmd: 'python main.py', | ||
}, | ||
{ | ||
name: 'puppeteer', | ||
label: 'Puppeteer', | ||
cmd: 'node main.js', | ||
}, | ||
{ | ||
name: 'playwright', | ||
label: 'Playwright', | ||
cmd: 'node main.js', | ||
}, | ||
{ | ||
name: 'colly', | ||
label: 'Colly', | ||
cmd: 'go run main.go', | ||
}, | ||
{ | ||
name: 'python', | ||
label: 'Basic Python', | ||
cmd: 'python main.py', | ||
}, | ||
{ | ||
name: 'node', | ||
label: 'Basic Node.js', | ||
cmd: 'node main.js', | ||
}, | ||
{ | ||
name: 'go', | ||
label: 'Basic Go', | ||
cmd: 'go run main.go', | ||
}, | ||
{ | ||
name: 'java', | ||
label: 'Basic Java', | ||
cmd: 'mvn clean compile exec:java', | ||
}, | ||
]; | ||
}; |