-
Notifications
You must be signed in to change notification settings - Fork 1.8k
refactor experiment summary file(to fix componentWillReceiveProps waring) and click other areas to close panel #2734
Changes from 9 commits
c95bf9e
ac60633
63bfd1c
7094329
5525320
ed098a6
65ab65c
bf62a8e
b9366b0
53b42e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,14 @@ import { | |
Stack, initializeIcons, StackItem, CommandBarButton, | ||
IContextualMenuProps, IStackTokens, IStackStyles | ||
} from 'office-ui-fabric-react'; | ||
import LogDrawer from './Modals/LogDrawer'; | ||
import ExperimentDrawer from './Modals/ExperimentDrawer'; | ||
import LogPanel from './Modals/LogPanel'; | ||
import ExperimentPanel from './Modals/ExperimentPanel'; | ||
import { | ||
downLoadIcon, infoIconAbout, | ||
timeIcon, disableUpdates, requency, closeTimer | ||
} from './Buttons/Icon'; | ||
import { OVERVIEWTABS, DETAILTABS, NNILOGO } from './stateless-component/NNItabs'; | ||
import { EXPERIMENT } from '../static/datamodel'; | ||
import '../static/style/nav/nav.scss'; | ||
import '../static/style/icon.scss'; | ||
|
||
|
@@ -97,9 +98,9 @@ class NavCon extends React.Component<NavProps, NavState> { | |
openDocs = (): void => { | ||
window.open(WEBUIDOC); | ||
} | ||
|
||
openGithubNNI = (): void => { | ||
const {version} = this.state; | ||
const { version } = this.state; | ||
const nniLink = `https://github.com/Microsoft/nni/tree/${version}`; | ||
window.open(nniLink); | ||
} | ||
|
@@ -178,8 +179,8 @@ class NavCon extends React.Component<NavProps, NavState> { | |
</Stack> | ||
</StackItem> | ||
{/* the drawer for dispatcher & nnimanager log message */} | ||
{isvisibleLogDrawer && <LogDrawer closeDrawer={this.closeLogDrawer} />} | ||
<ExperimentDrawer isVisble={isvisibleExperimentDrawer} closeExpDrawer={this.closeExpDrawer} /> | ||
{isvisibleLogDrawer && <LogPanel closeDrawer={this.closeLogDrawer} />} | ||
{isvisibleExperimentDrawer && <ExperimentPanel closeExpDrawer={this.closeExpDrawer} experimentProfile={EXPERIMENT.profile} />} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if it's proper to pass There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. had tested this status. ExperimentPanel will refresh as interval not every time. |
||
</Stack> | ||
); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,15 @@ class TrialManager { | |
private latestMetricdataErrorMessage: string = ''; // metric-data-latest error message | ||
private isMetricdataRangeError: boolean = false; // metric-data-range api error filed | ||
private metricdataRangeErrorMessage: string = ''; // metric-data-latest error message | ||
private metricsList: Array<any> = []; | ||
private trialJobList: Array<any> = []; | ||
|
||
public getMetricsList(): Array<any> { | ||
return this.metricsList; | ||
} | ||
public getTrialJobList(): Array<any> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trial job should have a type. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. had fixed. add type |
||
return this.trialJobList; | ||
} | ||
|
||
public async init(): Promise<void> { | ||
while (!this.infoInitialized || !this.metricInitialized) { | ||
|
@@ -230,6 +239,7 @@ class TrialManager { | |
requestAxios(`${MANAGER_IP}/trial-jobs`) | ||
.then(data => { | ||
const newTrials = TrialManager.expandJobsToTrials(data as any); | ||
this.trialJobList = newTrials; | ||
for (const trialInfo of newTrials as TrialJobInfo[]) { | ||
if (this.trials.has(trialInfo.id)) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
|
@@ -265,7 +275,10 @@ class TrialManager { | |
|
||
private async updateAllMetrics(): Promise<boolean> { | ||
return requestAxios(`${MANAGER_IP}/metric-data`) | ||
.then(data => this.doUpdateMetrics(data as any, false)) | ||
.then(data => { | ||
this.metricsList = data; | ||
return this.doUpdateMetrics(data as any, false); | ||
}) | ||
.catch(error => { | ||
this.isMetricdataError = true; | ||
this.MetricdataErrorMessage = `${error.message}`; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra space before
=
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok