You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by ha...@apache.org on 2018/01/22 07:28:07 UTC

[incubator-skywalking-ui] 01/02: Refactor time select style

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

hanahmily pushed a commit to branch feature/5.0.0
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking-ui.git

commit 222c6d00fb7a96e8dfcf1319ce28d510ef6d41b0
Author: hanahmily <ha...@gmail.com>
AuthorDate: Mon Jan 22 14:14:52 2018 +0800

    Refactor time select style
---
 src/main/frontend/mock/dashboard.js                |  2 +-
 src/main/frontend/mock/server.js                   | 18 ++++++------
 src/main/frontend/mock/service.js                  |  6 ++--
 .../src/components/Time/TimeSelect/index.js        | 34 +++++++++++++---------
 4 files changed, 34 insertions(+), 26 deletions(-)

diff --git a/src/main/frontend/mock/dashboard.js b/src/main/frontend/mock/dashboard.js
index c97c655..8a10082 100644
--- a/src/main/frontend/mock/dashboard.js
+++ b/src/main/frontend/mock/dashboard.js
@@ -13,7 +13,7 @@ export default {
             'numOfMQ|1-100': 1,
           },
           getAlarmTrend: {
-            'numOfAlarmRate|15': ['@natural(0, 99)'],
+            'numOfAlarmRate|60': ['@natural(0, 99)'],
           },
           getConjecturalApps: {
             'apps|3-5': [{ 'name|1': ['Oracle', 'MySQL', 'ActiveMQ', 'Redis', 'Memcache', 'SQLServer'], num: '@natural(1, 20)' }],
diff --git a/src/main/frontend/mock/server.js b/src/main/frontend/mock/server.js
index 321f0fc..fab3ec6 100644
--- a/src/main/frontend/mock/server.js
+++ b/src/main/frontend/mock/server.js
@@ -7,23 +7,23 @@ export default {
         data: {
           'searchServer|5': [{}],
           getServerResponseTimeTrend: {
-            'trendList|15': ['@natural(100, 1000)'],
+            'trendList|60': ['@natural(100, 1000)'],
           },
           getServerTPSTrend: {
-            'trendList|15': ['@natural(500, 10000)'],
+            'trendList|60': ['@natural(500, 10000)'],
           },
           getCPUTrend: {
-            'cost|15': ['@natural(0, 99)'],
+            'cost|60': ['@natural(0, 99)'],
           },
           getMemoryTrend: {
-            'heap|15': ['@natural(500, 900)'],
-            'maxHeap|15': [1000],
-            'noheap|15': ['@natural(100, 200)'],
-            'maxNoheap|15': [300],
+            'heap|60': ['@natural(500, 900)'],
+            'maxHeap|60': [1000],
+            'noheap|60': ['@natural(100, 200)'],
+            'maxNoheap|60': [300],
           },
           getGCTrend: {
-            'youngGC|15': ['@natural(200, 300)'],
-            'oldGC|15': ['@natural(10,100)'],
+            'youngGC|60': ['@natural(200, 300)'],
+            'oldGC|60': ['@natural(10,100)'],
           },
         },
       }
diff --git a/src/main/frontend/mock/service.js b/src/main/frontend/mock/service.js
index 1f0cf0a..8135e36 100644
--- a/src/main/frontend/mock/service.js
+++ b/src/main/frontend/mock/service.js
@@ -7,13 +7,13 @@ export default {
         data: {
           'searchService|5': [{}],
           getServiceResponseTimeTrend: {
-            'trendList|15': ['@natural(100, 1000)'],
+            'trendList|60': ['@natural(100, 1000)'],
           },
           getServiceTPSTrend: {
-            'trendList|15': ['@natural(500, 10000)'],
+            'trendList|60': ['@natural(500, 10000)'],
           },
           getServiceSLATrend: {
-            'trendList|15': ['@natural(80, 100)'],
+            'trendList|60': ['@natural(80, 100)'],
           },
           getServiceTopology: () => {
             const upNodes = mockjs.mock({
diff --git a/src/main/frontend/src/components/Time/TimeSelect/index.js b/src/main/frontend/src/components/Time/TimeSelect/index.js
index 161f5cf..6f7cadb 100644
--- a/src/main/frontend/src/components/Time/TimeSelect/index.js
+++ b/src/main/frontend/src/components/Time/TimeSelect/index.js
@@ -36,12 +36,6 @@ class TimeSelect extends PureComponent {
     this.shortcuts = [
       { ...now,
         from() {
-          return moment().subtract('minutes', 5);
-        },
-        label: 'Last 5 minutes',
-      },
-      { ...now,
-        from() {
           return moment().subtract('minutes', 15);
         },
         label: 'Last 15 minutes',
@@ -60,12 +54,6 @@ class TimeSelect extends PureComponent {
       },
       { ...now,
         from() {
-          return moment().subtract('hours', 3);
-        },
-        label: 'Last 3 hours',
-      },
-      { ...now,
-        from() {
           return moment().subtract('hours', 6);
         },
         label: 'Last 6 hours',
@@ -102,6 +90,24 @@ class TimeSelect extends PureComponent {
         },
         label: 'Last 14 days',
       },
+      { ...now,
+        from() {
+          return moment().subtract('days', 30);
+        },
+        label: 'Last 30 days',
+      },
+      { ...now,
+        from() {
+          return moment().subtract('months', 6);
+        },
+        label: 'Last 6 months',
+      },
+      { ...now,
+        from() {
+          return moment().subtract('months', 12);
+        },
+        label: 'Last 12 months',
+      },
     ];
   }
   componentDidMount() {
@@ -185,7 +191,9 @@ class TimeSelect extends PureComponent {
                 </Select>
               )}
             </FormItem>
-            <FormItem>
+            <FormItem
+              wrapperCol={{ offset: 7 }}
+            >
               <Button
                 type="primary"
                 htmlType="submit"

-- 
To stop receiving notification emails like this one, please contact
hanahmily@apache.org.