From 18deb7de74b6a53521c6706046206255a4f8a532 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Tue, 21 Jan 2020 11:34:09 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 9bcfaca6..633d6dc7 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -39,7 +39,6 @@ export default { }, mounted () { window.setUseStats = (value) => { - localStorage.setItem('useStats', value) document.querySelector('.el-message__closeBtn').click() if (value === 1) { this.$st.sendPv('/allow_stats') @@ -48,6 +47,7 @@ export default { this.$st.sendPv('/disallow_stats') this.$st.sendEv('全局', '允许/禁止统计', '禁止') } + localStorage.setItem('useStats', value) } // first-time user From b101b8b8cdf0e810e003d0ef9e3c2c50df13c0ed Mon Sep 17 00:00:00 2001 From: marvzhang Date: Tue, 21 Jan 2020 15:40:03 +0800 Subject: [PATCH 02/16] updated stats --- frontend/src/App.vue | 9 ++++++--- frontend/src/views/layout/components/Sidebar/index.vue | 4 +--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 633d6dc7..bf60dc0b 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -34,10 +34,13 @@ export default { } }, methods: {}, - created () { - this.$store.dispatch('setting/getSetting') + async created () { + await this.$store.dispatch('setting/getSetting') }, - mounted () { + async mounted () { + const res = await this.$request.get('/version') + this.version = res.data.data + sessionStorage.setItem('v', this.version) window.setUseStats = (value) => { document.querySelector('.el-message__closeBtn').click() if (value === 1) { diff --git a/frontend/src/views/layout/components/Sidebar/index.vue b/frontend/src/views/layout/components/Sidebar/index.vue index 8b371a44..97e3d86a 100644 --- a/frontend/src/views/layout/components/Sidebar/index.vue +++ b/frontend/src/views/layout/components/Sidebar/index.vue @@ -55,9 +55,7 @@ export default { } }, async created () { - const res = await this.$request.get('/version') - this.version = res.data.data - sessionStorage.setItem('v', this.version) + } } From f265ecafe8e958cb5977771f50e08e5d5fcf7a75 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Tue, 21 Jan 2020 15:40:17 +0800 Subject: [PATCH 03/16] updated stats --- frontend/src/views/layout/components/Sidebar/index.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/views/layout/components/Sidebar/index.vue b/frontend/src/views/layout/components/Sidebar/index.vue index 97e3d86a..942cd3dd 100644 --- a/frontend/src/views/layout/components/Sidebar/index.vue +++ b/frontend/src/views/layout/components/Sidebar/index.vue @@ -55,7 +55,6 @@ export default { } }, async created () { - } } From e3f4bcd0ab5bef56c004ef9d3dcbecffed95d44a Mon Sep 17 00:00:00 2001 From: marvzhang Date: Wed, 22 Jan 2020 11:07:38 +0800 Subject: [PATCH 04/16] updated stats --- backend/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/main.go b/backend/main.go index 20d70b22..a7a07002 100644 --- a/backend/main.go +++ b/backend/main.go @@ -133,6 +133,8 @@ func main() { anonymousGroup.POST("/login", routes.Login) // 用户登录 anonymousGroup.PUT("/users", routes.PutUser) // 添加用户 anonymousGroup.GET("/setting", routes.GetSetting) // 获取配置信息 + // release版本 + anonymousGroup.GET("/version", routes.GetVersion) // 获取发布的版本 } authGroup := app.Group("/", middlewares.AuthorizationMiddleware()) { @@ -206,8 +208,6 @@ func main() { authGroup.DELETE("/users/:id", routes.DeleteUser) // 删除用户 authGroup.GET("/me", routes.GetMe) // 获取自己账户 authGroup.POST("/me", routes.PostMe) // 修改自己账户 - // release版本 - authGroup.GET("/version", routes.GetVersion) // 获取发布的版本 // 系统 authGroup.GET("/system/deps/:lang", routes.GetAllDepList) // 节点所有第三方依赖列表 authGroup.GET("/system/deps/:lang/:dep_name/json", routes.GetDepJson) // 节点第三方依赖JSON From 2a199677bec1ce605a0e2530d97b8070ff1f5aa6 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Wed, 22 Jan 2020 12:17:59 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BAversion=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/layout/components/Sidebar/index.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/layout/components/Sidebar/index.vue b/frontend/src/views/layout/components/Sidebar/index.vue index 942cd3dd..34679a77 100644 --- a/frontend/src/views/layout/components/Sidebar/index.vue +++ b/frontend/src/views/layout/components/Sidebar/index.vue @@ -47,11 +47,13 @@ export default { }, isCollapse () { return !this.sidebar.opened + }, + version () { + return window.sessionStorage.getItem('v') } }, data () { return { - version: '' } }, async created () { From fe3666ed08e54c556b193fe1a42f878ab927199d Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Fri, 24 Jan 2020 12:02:02 +0800 Subject: [PATCH 06/16] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index c6c92339..ac5c2dab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,7 +27,7 @@ services: # 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_SENDERIDENTITY: 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: From e3c8cff27c327391dd6b4ad8644574f50188fc85 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Mon, 27 Jan 2020 09:07:43 +0800 Subject: [PATCH 07/16] updated demo --- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- frontend/src/views/spider/SpiderDetail.vue | 6 +++--- jenkins/master/docker-compose.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d..36014cde 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project title: '' -labels: '' +labels: 'enhancement' assignees: '' --- diff --git a/frontend/src/views/spider/SpiderDetail.vue b/frontend/src/views/spider/SpiderDetail.vue index 868f8762..46626f63 100644 --- a/frontend/src/views/spider/SpiderDetail.vue +++ b/frontend/src/views/spider/SpiderDetail.vue @@ -118,9 +118,9 @@ export default { await this.$store.dispatch('spider/getSpiderList') // if spider is configurable spider, set to config tab by default - if (this.spiderForm.type === 'configurable') { - this.activeTabName = 'config' - } + // if (this.spiderForm.type === 'configurable') { + // this.activeTabName = 'config' + // } } } diff --git a/jenkins/master/docker-compose.yaml b/jenkins/master/docker-compose.yaml index ed649aa8..2f09da6d 100644 --- a/jenkins/master/docker-compose.yaml +++ b/jenkins/master/docker-compose.yaml @@ -3,7 +3,7 @@ services: master: image: "tikazyq/crawlab:master" environment: - CRAWLAB_API_ADDRESS: "http://crawlab.cn/api" + CRAWLAB_API_ADDRESS: "https://crawlab.cn/api" CRAWLAB_BASE_URL: "/demo" CRAWLAB_SERVER_MASTER: "Y" CRAWLAB_MONGO_HOST: "mongo" From 689ce564f312205ffc929202afc30de937ee14f1 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Mon, 27 Jan 2020 09:29:41 +0800 Subject: [PATCH 08/16] updated env to adapt api.crawlab.cn --- frontend/.env.development | 2 +- frontend/.env.production | 2 +- frontend/.env.test | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/.env.development b/frontend/.env.development index 580de54d..73ca1a55 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -1,3 +1,3 @@ NODE_ENV='development' VUE_APP_BASE_URL=http://localhost:8000 -VUE_APP_CRAWLAB_BASE_URL=http://api.crawlab.cn +VUE_APP_CRAWLAB_BASE_URL=https://api.crawlab.cn diff --git a/frontend/.env.production b/frontend/.env.production index d54deef7..d01edd25 100644 --- a/frontend/.env.production +++ b/frontend/.env.production @@ -1,3 +1,3 @@ NODE_ENV='production' VUE_APP_BASE_URL=/api -VUE_APP_CRAWLAB_BASE_URL=http://api.crawlab.cn +VUE_APP_CRAWLAB_BASE_URL=https://api.crawlab.cn diff --git a/frontend/.env.test b/frontend/.env.test index cc3d7823..e9aeafc9 100644 --- a/frontend/.env.test +++ b/frontend/.env.test @@ -1,3 +1,3 @@ NODE_ENV='test' VUE_APP_BASE_URL='http://localhost:8000' -VUE_APP_CRAWLAB_BASE_URL=http://api.crawlab.cn +VUE_APP_CRAWLAB_BASE_URL=https://api.crawlab.cn From 7ff42f46d18f0b8a88ba1ef4e918572d13b5f9fc Mon Sep 17 00:00:00 2001 From: marvzhang Date: Mon, 27 Jan 2020 09:49:32 +0800 Subject: [PATCH 09/16] updated issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 16 +------------- .github/ISSUE_TEMPLATE/bug_report_zh.md | 23 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 3 --- .github/ISSUE_TEMPLATE/feature_request_zh.md | 17 +++++++++++++++ 4 files changed, 41 insertions(+), 18 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report_zh.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request_zh.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea78..26ba8c5d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Create a report to help us improve title: '' -labels: '' +labels: 'bug' assignees: '' --- @@ -22,17 +22,3 @@ A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report_zh.md b/.github/ISSUE_TEMPLATE/bug_report_zh.md new file mode 100644 index 00000000..748ae4bc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report_zh.md @@ -0,0 +1,23 @@ +--- +name: Bug 报告 +about: 创建一份 Bug 报告帮助我们优化产品 +title: '' +labels: 'bug' +assignees: '' + +--- + +**Bug 描述** +例如,当 xxx 时,xxx 功能不工作。 + +**复现步骤** +该 Bug 复现步骤如下 +1. +2. +3. + +**期望结果** +xxx 能工作。 + +**截屏** +![截屏1](http://static-docs.crawlab.cn/login.png) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 36014cde..dee496d4 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -15,6 +15,3 @@ A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request_zh.md b/.github/ISSUE_TEMPLATE/feature_request_zh.md new file mode 100644 index 00000000..15c941ca --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request_zh.md @@ -0,0 +1,17 @@ +--- +name: 功能需求 +about: 优化和功能需求建议 +title: '' +labels: 'enhancement' +assignees: '' + +--- + +**请描述该需求尝试解决的问题** +例如,当 xxx 时,我总是被当前 xxx 的设计所困扰。 + +**请描述您认为可行的解决方案** +例如,添加 xxx 功能能够解决问题。 + +**考虑过的替代方案** +例如,如果用 xxx,也能解决该问题。 From 6d98e719f331114fdfdbf938b22e6f9ffc528a55 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Tue, 28 Jan 2020 09:52:37 +0800 Subject: [PATCH 10/16] fixed https://github.com/crawlab-team/crawlab/issues/479 --- frontend/src/components/File/FileList.vue | 119 ++++++++++++++++++---- frontend/src/i18n/zh.js | 3 + 2 files changed, 100 insertions(+), 22 deletions(-) diff --git a/frontend/src/components/File/FileList.vue b/frontend/src/components/File/FileList.vue index 4bf76395..ea70e05c 100644 --- a/frontend/src/components/File/FileList.vue +++ b/frontend/src/components/File/FileList.vue @@ -30,7 +30,9 @@ -
+
-
- - - - {{$t('Create')}} -
-
    -
  • +
      +
    • - {{$t('Directory')}} + {{$t('Create Directory')}}
    • -
    • +
    • - {{$t('File')}} + {{$t('Create File')}} +
    • +
    +
      +
    • + + {{$t('Remove')}}
    @@ -172,7 +173,8 @@ export default { nodeFormRules: { name: [{ required: true, message: 'Required Field', trigger: 'change' }] }, - activeTab: undefined + activeTab: undefined, + isButtonClicked: false } }, computed: { @@ -235,6 +237,11 @@ export default { this.dialogVisible = true }, onRemove (row) { + this.isButtonClicked = true + setTimeout(() => { + this.isButtonClicked = false + }, 100) + this.$confirm(this.$t('Are you sure to delete this node?'), this.$t('Notification'), { confirmButtonText: this.$t('Confirm'), cancelButtonText: this.$t('Cancel'), @@ -251,6 +258,11 @@ export default { }) }, onView (row) { + this.isButtonClicked = true + setTimeout(() => { + this.isButtonClicked = false + }, 100) + this.$router.push(`/nodes/${row._id}`) this.$st.sendEv('节点列表', '查看节点') @@ -262,6 +274,7 @@ export default { this.$store.dispatch('node/getNodeSystemInfo', row._id) }, onRowClick (row) { + if (this.isButtonClicked) return this.onView(row) }, getExecutables (row) { From 392c6cf7c01e53f4e29b48b20313a7387dd97add Mon Sep 17 00:00:00 2001 From: marvzhang Date: Tue, 28 Jan 2020 10:31:19 +0800 Subject: [PATCH 14/16] re-order file create items --- frontend/src/components/File/FileList.vue | 18 +++++++-------- frontend/src/i18n/zh.js | 2 +- frontend/src/views/node/NodeList.vue | 27 +++++++++++++++-------- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/File/FileList.vue b/frontend/src/components/File/FileList.vue index fc03b0da..620481ca 100644 --- a/frontend/src/components/File/FileList.vue +++ b/frontend/src/components/File/FileList.vue @@ -48,14 +48,14 @@
      -
    • - - {{$t('Create Directory')}} -
    • {{$t('Create File')}}
    • +
    • + + {{$t('Create Directory')}} +
    • @@ -90,14 +90,14 @@
        -
      • - - {{$t('Create Directory')}} -
      • {{$t('Create File')}}
      • +
      • + + {{$t('Create Directory')}} +
      - {{$t('Please select a file on the left.')}} + {{$t('Please select a file or click the add button on the left.')}}