From 6d98e719f331114fdfdbf938b22e6f9ffc528a55 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Tue, 28 Jan 2020 09:52:37 +0800 Subject: [PATCH 1/7] 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 5/7] 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.')}}