Merge pull request #459 from crawlab-team/develop

Develop
This commit is contained in:
Marvin Zhang
2020-01-17 14:16:55 +08:00
committed by GitHub
6 changed files with 38 additions and 7 deletions

3
.gitignore vendored
View File

@@ -121,4 +121,5 @@ _book/
.idea
*.lock
backend/spiders
backend/spiders
spiders/*.zip

View File

@@ -12,6 +12,8 @@
### Bug 修复
- **`nil retuened` 错误**.
- **使用 HTTPS 出现的报错**.
- **无法在爬虫列表页运行可配置爬虫**.
- **上传爬虫文件缺少表单验证**.
# 0.4.3 (2020-01-07)

View File

@@ -11,6 +11,8 @@
### Bug Fixes
- **`nil retuened` error**.
- **Error when using HTTPS**.
- **Unable to run Configurable Spiders on Spider List**.
- **Missing form validation before uploading spider files**.
# 0.4.3 (2020-01-07)

View File

@@ -24,6 +24,12 @@ services:
# CRAWLAB_TASK_WORKERS: 4 # number of task executors 任务执行器个数(并行执行任务数)
# CRAWLAB_SERVER_LANG_NODE: "Y" # whether to pre-install Node.js 预安装 Node.js 语言环境
# CRAWLAB_SETTING_ALLOWREGISTER: "N" # whether to allow user registration 是否允许用户注册
# CRAWLAB_NOTIFICATION_MAIL_SERVER: smtp.exmaple.com # STMP server address STMP 服务器地址
# CRAWLAB_NOTIFICATION_MAIL_PORT: 465 # STMP server port STMP 服务器端口
# CRAWLAB_NOTIFICATION_MAIL_SENDEREMAIL: admin@exmaple.com # sender email 发送者邮箱
# CRAWLAB_NOTIFICATION_MAIL_SENDEREIDENTITY: admin@exmaple.com # sender ID 发送者 ID
# CRAWLAB_NOTIFICATION_MAIL_SMTP_USER: username # SMTP username SMTP 用户名
# CRAWLAB_NOTIFICATION_MAIL_SMTP_PASSWORD: password # SMTP password SMTP 密码
ports:
- "8080:8080" # frontend port mapping 前端端口映射
depends_on:

View File

@@ -55,7 +55,9 @@
:data="uploadForm"
:headers="{Authorization:token}"
:on-success="onUploadSuccess"
:file-list="fileList">
:file-list="fileList"
:before-upload="beforeUpload"
>
<el-button size="small" type="primary" icon="el-icon-upload">
{{$t('Upload')}}
</el-button>
@@ -508,11 +510,8 @@ export default {
this.dialogVisible = true
},
isShowRun (row) {
if (row.cmd) {
return true
} else {
return false
}
if (!this.isCustomized(row)) return true
return !!row.cmd
},
isCustomized (row) {
return row.type === 'customized'
@@ -560,6 +559,17 @@ export default {
// navigate to spider detail
this.$router.push(`/spiders/${res.data._id}`)
},
beforeUpload (file) {
return new Promise((resolve, reject) => {
this.$refs['addCustomizedForm'].validate(res => {
if (res) {
resolve()
} else {
reject(new Error('form validation error'))
}
})
})
},
getTime (str) {
if (!str || str.match('^0001')) return 'NA'
return dayjs(str).format('YYYY-MM-DD HH:mm:ss')

10
test/README.md Normal file
View File

@@ -0,0 +1,10 @@
# Test for Crawlab
## Test Cases
Test Case | Steps | Expected Results
--- | --- | ---
Login | |
Signup | |
Upload Spider | |
Edit Spider File | |