You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by xx...@apache.org on 2023/04/21 08:49:02 UTC

[kylin] 02/17: KYLIN-5501 diagnostic last 30 days issue

This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch kylin5
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit f3a3a061b7a452b018aa3146e6d237a964402647
Author: Qian Xia <la...@gmail.com>
AuthorDate: Wed Apr 12 11:48:45 2023 +0800

    KYLIN-5501 diagnostic last 30 days issue
---
 kystudio/src/components/admin/Diagnostic/index.vue  | 9 +++++----
 kystudio/src/components/admin/Diagnostic/locales.js | 5 +++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/kystudio/src/components/admin/Diagnostic/index.vue b/kystudio/src/components/admin/Diagnostic/index.vue
index 9fe385e43a..8886c79ccf 100644
--- a/kystudio/src/components/admin/Diagnostic/index.vue
+++ b/kystudio/src/components/admin/Diagnostic/index.vue
@@ -218,7 +218,7 @@ export default class Diagnostic extends Vue {
       {text: this.$t('lastHour'), label: 'lastHour'},
       {text: this.$t('lastDay'), label: 'lastDay'},
       {text: this.$t('lastThreeDay'), label: 'lastThreeDay'},
-      {text: this.$t('lastMonth'), label: 'lastMonth'},
+      {text: this.$t('lastThirtyDay'), label: 'lastThirtyDay'},
       {text: this.$t('custom'), label: 'custom'}
     ]
   }
@@ -263,7 +263,7 @@ export default class Diagnostic extends Vue {
   }
   // 日期在5分钟~1个月内
   get getDateTimeValid () {
-    return !this.dateTime.prev || !this.dateTime.next || this.getTimes(this.dateTime.prev) > this.getTimes(this.dateTime.next) || (this.getTimes(this.dateTime.next) - this.getTimes(this.dateTime.prev)) < 300000 || (this.getTimes(getPrevTimeValue({ date: this.dateTime.next, m: 1 })) - this.getTimes(this.dateTime.prev)) > 0
+    return !this.dateTime.prev || !this.dateTime.next || this.getTimes(this.dateTime.prev) > this.getTimes(this.dateTime.next) || (this.getTimes(this.dateTime.next) - this.getTimes(this.dateTime.prev)) < 300000 || (this.getTimes(this.dateTime.next) - this.getTimes(this.dateTime.prev)) > 30 * 24 * 60 * 60 * 1000
   }
   // 是否展示手动下载提示
   // get showManualDownloadLayout () {
@@ -349,8 +349,9 @@ export default class Diagnostic extends Vue {
         this.dateTime.prev = new Date(t)
         this.dateTime.next = date
         break
-      case 'lastMonth':
-        this.dateTime.prev = new Date(getPrevTimeValue({ date, m: 1 }))
+        case 'lastThirtyDay':
+        t = dt - 30 * 24 * 60 * 60 * 1000
+        this.dateTime.prev = new Date(t)
         this.dateTime.next = date
         break
       case 'custom':
diff --git a/kystudio/src/components/admin/Diagnostic/locales.js b/kystudio/src/components/admin/Diagnostic/locales.js
index 86374ae905..fb35bedb23 100644
--- a/kystudio/src/components/admin/Diagnostic/locales.js
+++ b/kystudio/src/components/admin/Diagnostic/locales.js
@@ -9,9 +9,10 @@ export default {
     lastHour: 'Last 1 Hour',
     lastDay: 'Last 1 Day',
     lastThreeDay: 'Last 3 Days',
+    lastThirtyDay: 'Last 30 Days',
     lastMonth: 'Last 1 Month',
     custom: 'Customize',
-    customTimeTip: 'The time range could vary from 5 minutes to 1 month.',
+    customTimeTip: 'The time range could vary from 5 minutes to 30 days.',
     selectDatePlaceholder: 'Select Date',
     server: 'Server',
     downloadTip: 'The diagnostic package would be downloaded automatically once it\'s successfully generated.',
@@ -33,7 +34,7 @@ export default {
     modelTitle: 'Notice',
     confrimBtn: 'Discard',
     cancelBtn: 'Cancel',
-    timeErrorMsg: 'The time range must be greater than or equal to 5 minutes and less than or equal  to 1 month. Please reselect.',
+    timeErrorMsg: 'The time range must be greater than or equal to 5 minutes and less than or equal  to 30 days. Please reselect.',
     selectServerTip: 'Please select the server(s)',
     selectServerPlaceHolder: 'Please select server',
     downloadJobDiagPackage1: 'The diagnostic package includes this job’s logs for the executor, driver and project metadata. For other error like query error, please download system diagnostic package in ',