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


The following commit(s) were added to refs/heads/feature/5.0.0 by this push:
     new 6ca52a2  Amend Time-select and Search components issues
6ca52a2 is described below

commit 6ca52a279dc10500fd2f150b126c3febfbff4920
Author: hanahmily <hanahm...@gmail.com>
AuthorDate: Tue Feb 13 09:08:37 2018 +0800

    Amend Time-select and Search components issues
---
 .../frontend/src/components/Time/TimeSelect/index.js     |  2 +-
 src/main/frontend/src/layouts/BasicLayout.js             |  2 +-
 src/main/frontend/src/models/service.js                  | 16 ++++++++--------
 src/main/frontend/src/utils/utils.js                     | 11 ++++++-----
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/main/frontend/src/components/Time/TimeSelect/index.js 
b/src/main/frontend/src/components/Time/TimeSelect/index.js
index 66a7473..2a74c9a 100644
--- a/src/main/frontend/src/components/Time/TimeSelect/index.js
+++ b/src/main/frontend/src/components/Time/TimeSelect/index.js
@@ -175,7 +175,7 @@ class TimeSelect extends PureComponent {
               label="Time Range"
             >
               {getFieldDecorator('range-time-picker')(
-                <RangePicker showTime disabledDate={this.disabledDate} 
format="YYYY-MM-DD HH:mm:ss" />
+                <RangePicker showTime disabledDate={this.disabledDate} 
format="YYYY-MM-DD HH:mm" />
               )}
             </FormItem>
             <FormItem
diff --git a/src/main/frontend/src/layouts/BasicLayout.js 
b/src/main/frontend/src/layouts/BasicLayout.js
index dd115cf..419342f 100644
--- a/src/main/frontend/src/layouts/BasicLayout.js
+++ b/src/main/frontend/src/layouts/BasicLayout.js
@@ -273,7 +273,7 @@ class BasicLayout extends React.PureComponent {
       },
       lable: 'NaN',
     } } = this.props;
-    const timeFormat = 'YYYY-MM-DD HH:mm:ss';
+    const timeFormat = 'YYYY-MM-DD HH:mm';
 
     const layout = (
       <Layout>
diff --git a/src/main/frontend/src/models/service.js 
b/src/main/frontend/src/models/service.js
index 71ac04e..78c2ff7 100644
--- a/src/main/frontend/src/models/service.js
+++ b/src/main/frontend/src/models/service.js
@@ -1,17 +1,17 @@
 import { generateModal } from '../utils/utils';
 
 const dataQuery = `
-  query Service($service: ID!, $duration: Duration!) {
-    getServiceResponseTimeTrend(serverId: $serverId, duration: $duration) {
+  query Service($serviceId: ID!, $duration: Duration!) {
+    getServiceResponseTimeTrend(serviceId: $serviceId, duration: $duration) {
       trendList
     }
-    getServiceTPSTrend(serverId: $serverId, duration: $duration) {
+    getServiceTPSTrend(serviceId: $serviceId, duration: $duration) {
       trendList
     }
-    getServiceSLATrend(serverId: $serverId, duration: $duration) {
+    getServiceSLATrend(serviceId: $serviceId, duration: $duration) {
       trendList
     }
-    getServiceTopology(serverId: $serverId, duration: $duration) {
+    getServiceTopology(serviceId: $serviceId, duration: $duration) {
       nodes {
         id
         name
@@ -26,15 +26,15 @@ const dataQuery = `
           numOfServerAlarm
           numOfServiceAlarm
         }
-      },
-      calls: {
+      }
+      calls {
         source
         target
         isAlert
         callType
         callsPerSec
         responseTimePerSec
-      },
+      }
     }
   }
 `;
diff --git a/src/main/frontend/src/utils/utils.js 
b/src/main/frontend/src/utils/utils.js
index e8e5ad9..0c2529b 100644
--- a/src/main/frontend/src/utils/utils.js
+++ b/src/main/frontend/src/utils/utils.js
@@ -9,8 +9,7 @@ function createTimeMeasure(measureType, step, format, 
displayFormat = format) {
 
 function getMeasureList() {
   return [createTimeMeasure('months', 'MONTH', 'YYYY-MM'), 
createTimeMeasure('days', 'DAY', 'YYYY-MM-DD'),
-    createTimeMeasure('hours', 'HOUR', 'YYYY-MM-DD HH', 'YYYY-MM-DD 
HH:00:00'), createTimeMeasure('minutes', 'MINUTE', 'YYYY-MM-DD HHmm', 
'HH:mm:00'),
-    createTimeMeasure('seconds', 'SECOND', 'YYYY-MM-DD HHmmss', 'HH:mm:ss')];
+    createTimeMeasure('hours', 'HOUR', 'YYYY-MM-DD HH', 'YYYY-MM-DD 
HH:00:00'), createTimeMeasure('minutes', 'MINUTE', 'YYYY-MM-DD HHmm', 
'HH:mm:00')];
 }
 
 export function fixedZero(val) {
@@ -113,8 +112,10 @@ export function timeRange({ display }) {
 export function generateDuration({ from, to }) {
   const start = from();
   const end = to();
-  const { measureType, step, format, displayFormat } = getMeasureList()
-    .find(measure => (end.diff(start, measure.measureType) > 1));
+  const mlist = getMeasureList();
+  const lenght = mlist.length;
+  const { measureType, step, format, displayFormat } = mlist
+    .find((_, index) => ((index + 1 >= lenght) || end.diff(start, 
_.measureType) > 1));
   return {
     input: {
       start: start.format(format),
@@ -237,7 +238,7 @@ export function generateModal({ namespace, dataQuery, 
optionsQuery, state = {},
             },
             labels: {
               ...preLabels,
-              labels,
+              ...labels,
             },
           },
           data: {

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

Reply via email to