From 4d5c2d341e23c2c7fec79462c0a992f509d57a70 Mon Sep 17 00:00:00 2001 From: v-liguo Date: Thu, 1 Nov 2018 19:15:28 +0800 Subject: [PATCH 1/2] Fix bug of Default Metric and modifiy trials detail style --- src/webui/src/components/Overview.tsx | 7 ++----- .../src/components/overview/SuccessTable.tsx | 15 ++++++++++++-- .../src/components/trial-detail/TableList.tsx | 19 ++++++++++++++---- src/webui/src/static/const.ts | 4 ++-- src/webui/src/static/img/icon/6.png | Bin 415 -> 326 bytes src/webui/src/static/style/trialsDetail.scss | 9 ++++++--- 6 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/webui/src/components/Overview.tsx b/src/webui/src/components/Overview.tsx index 0c0109d4df..21cbb5e661 100644 --- a/src/webui/src/components/Overview.tsx +++ b/src/webui/src/components/Overview.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import axios from 'axios'; import { Row, Col } from 'antd'; -import { MANAGER_IP, overviewItem } from '../static/const'; +import { MANAGER_IP } from '../static/const'; import { Experiment, TableObj, Parameters, AccurPoint, TrialNumber @@ -28,7 +28,6 @@ interface SessionState { searchSpace: object; status: string; trialProfile: Experiment; - selNum: number; option: object; noData: string; accuracyData: object; @@ -72,7 +71,6 @@ class Overview extends React.Component<{}, SessionState> { parameters: {} } }], - selNum: overviewItem, option: {}, noData: '', // accuracy @@ -173,7 +171,6 @@ class Overview extends React.Component<{}, SessionState> { }) .then(res => { if (res.status === 200) { - const { selNum } = this.state; const tableData = res.data; const topTableData: Array = []; const profile: TrialNumber = { @@ -248,7 +245,7 @@ class Overview extends React.Component<{}, SessionState> { return NaN; } }); - topTableData.length = Math.min(selNum, topTableData.length); + topTableData.length = Math.min(10, topTableData.length); if (this._isMounted) { this.setState({ tableData: topTableData, diff --git a/src/webui/src/components/overview/SuccessTable.tsx b/src/webui/src/components/overview/SuccessTable.tsx index e458cfefad..8787af2120 100644 --- a/src/webui/src/components/overview/SuccessTable.tsx +++ b/src/webui/src/components/overview/SuccessTable.tsx @@ -70,14 +70,25 @@ class SuccessTable extends React.Component { dataIndex: 'acc', key: 'acc', render: (text: string, record: TableObj) => { + const accuracy = record.acc; + let wei = 0; + if (accuracy) { + if (accuracy.toString().indexOf('.') !== -1) { + wei = accuracy.toString().length - accuracy.toString().indexOf('.') - 1; + } + } return (
{ record.acc ? - record.acc.toFixed(6) + wei > 6 + ? + record.acc.toFixed(6) + : + record.acc : - record.acc + 'NaN' }
); diff --git a/src/webui/src/components/trial-detail/TableList.tsx b/src/webui/src/components/trial-detail/TableList.tsx index 1456c1bda1..c9d9d7ca8d 100644 --- a/src/webui/src/components/trial-detail/TableList.tsx +++ b/src/webui/src/components/trial-detail/TableList.tsx @@ -227,14 +227,25 @@ class TableList extends React.Component { width: 200, sorter: (a: TableObj, b: TableObj) => (a.acc as number) - (b.acc as number), render: (text: string, record: TableObj) => { - return( + const accuracy = record.acc; + let wei = 0; + if (accuracy) { + if (accuracy.toString().indexOf('.') !== -1) { + wei = accuracy.toString().length - accuracy.toString().indexOf('.') - 1; + } + } + return (
{ record.acc ? - record.acc.toFixed(6) + wei > 6 + ? + record.acc.toFixed(6) + : + record.acc : - record.acc + 'NaN' }
); @@ -309,7 +320,7 @@ class TableList extends React.Component { } return (
-                     {
+                    {
                         isHasParameters
                             ?
                             < JSONTree
diff --git a/src/webui/src/static/const.ts b/src/webui/src/static/const.ts
index c01e2436fd..9282429b24 100644
--- a/src/webui/src/static/const.ts
+++ b/src/webui/src/static/const.ts
@@ -1,4 +1,5 @@
-export const MANAGER_IP = `/api/v1/nni`;
+// export const MANAGER_IP = `/api/v1/nni`;
+export const MANAGER_IP = 'http://10.150.144.121:8080/api/v1/nni';
 export const trialJobStatus = [
     'UNKNOWN',
     'WAITING',
@@ -13,4 +14,3 @@ export const CONTROLTYPE = [
     'TRIAL_CONCURRENCY',
     'MAX_EXEC_DURATION'
 ];
-export const overviewItem = 10;
diff --git a/src/webui/src/static/img/icon/6.png b/src/webui/src/static/img/icon/6.png
index 443f7cd8cd4bcbe4e6c156eb19f2fb040449035d..0cfaef4ba67251e316619acc938ea757a63cd1c8 100644
GIT binary patch
delta 276
zcmbQwe2hu4Gr-TCmrII^fq{Y7)59eQNCyJ31qU0DY%LL4GEvc{p5d~mi(^Q|tv9z0
z@-`VrG+a!QX$h2R%zL2r$VJxCy>N2WyCzkqODBHo$#_&%EL5z&oF~yHV^{94*}HI)
z#N(wlat|BkHYqr@Xmm)I&HH!A`29TX>s7jIzFsf2OrJmLEsx+Lpd?42!1oyuNj;D6
z9GMifYF^YStJ=z#eyeYHv&8PLm;C!nKl|pnCJsR*m#a@~E>7ow=~3KvyF}ylq~-cR
z8ON3zSMFQxc=EHDFEuy4Lx2@1*3q=%`jJPIo|`4l_nx=S7|7??xbz+q4}*S+uBCHv
S?nIzR89ZJ6T-G@yGywo~ws4LB

delta 366
zcmX@cG@n_qGr-TCmrII^fq{Y7)59eQNT&d?JqH_*6kDB}Fj3K_o>9ls#WAGf)|=Z0
zGY>lmxFuTdV3__u=#Jwgz9oE@Jg4vlHCfLP+N8RKrF797Ck64fo1Dax>-neI^89J9
zG|-VMdGWjM-L#(_9UHS#B-*Ce)Rx{jI$2DB$%%te@%zDzdzNW!-C~#>b<#<>y>edZ
z!4pi1Ee!%r4jhUKEdl~fuJwKUXYW&8)-fZhx#*l`ytwXN%_XbX$DVFKROozd>E=VG
zn}Fs3b^O`8DK7i`z23DZdfUSd5uVD~=R_(L#(AvE7$ZSl&#p1>ev@O1TaS?83{1OPgBlurNv

diff --git a/src/webui/src/static/style/trialsDetail.scss b/src/webui/src/static/style/trialsDetail.scss
index 995a9d061a..ac5b360f52 100644
--- a/src/webui/src/static/style/trialsDetail.scss
+++ b/src/webui/src/static/style/trialsDetail.scss
@@ -23,10 +23,13 @@
         }
     }
     .panelTitle{
-        font-size: 18px;
-        font-family: 'Segoe';
-        padding: 0 10px;
+        margin-right: 14px;
         border-right: 2px solid #e8e8e8;
+        
+        span{
+            font-size: 18px;
+            font-family: 'Segoe';
+        }
     }
 }
 

From a4b6eedffea9ca321060324bce569cb3117676f6 Mon Sep 17 00:00:00 2001
From: v-liguo 
Date: Thu, 1 Nov 2018 19:20:49 +0800
Subject: [PATCH 2/2] update

---
 src/webui/src/static/const.ts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/webui/src/static/const.ts b/src/webui/src/static/const.ts
index 9282429b24..b3b9c15544 100644
--- a/src/webui/src/static/const.ts
+++ b/src/webui/src/static/const.ts
@@ -1,5 +1,4 @@
-// export const MANAGER_IP = `/api/v1/nni`;
-export const MANAGER_IP = 'http://10.150.144.121:8080/api/v1/nni';
+export const MANAGER_IP = `/api/v1/nni`;
 export const trialJobStatus = [
     'UNKNOWN',
     'WAITING',