diff --git a/ts/webui/src/components/common/CopyButton.tsx b/ts/webui/src/components/common/CopyButton.tsx index e8fa95017..b5cfd2db4 100644 --- a/ts/webui/src/components/common/CopyButton.tsx +++ b/ts/webui/src/components/common/CopyButton.tsx @@ -1,7 +1,7 @@ import React, { useRef } from 'react'; import copy from 'copy-to-clipboard'; import { IconButton, FontSizes, TooltipHost } from '@fluentui/react'; -import { TOOLTIP_BACKGROUND_COLOR } from '@static/const'; +import { TOOLTIPSTYLE } from '@static/const'; interface CopyButtonProps { value: string; @@ -38,15 +38,7 @@ const CopyButton = (props: CopyButtonProps): any => { content='Copied' componentRef={ref} delay={0} - tooltipProps={{ - calloutProps: { - styles: { - beak: { background: TOOLTIP_BACKGROUND_COLOR }, - beakCurtain: { background: TOOLTIP_BACKGROUND_COLOR }, - calloutMain: { background: TOOLTIP_BACKGROUND_COLOR } - } - } - }} + tooltipProps={TOOLTIPSTYLE} /> ); diff --git a/ts/webui/src/components/common/TooltipHostIndex.tsx b/ts/webui/src/components/common/TooltipHostIndex.tsx new file mode 100644 index 000000000..42ee7529b --- /dev/null +++ b/ts/webui/src/components/common/TooltipHostIndex.tsx @@ -0,0 +1,31 @@ +import * as React from 'react'; +import { TOOLTIPSTYLE } from '@static/const'; +import { DirectionalHint, TooltipHost } from '@fluentui/react'; + +interface TooltipHostIndexProps { + value: string; +} + +const TooltipHostIndex = (props: TooltipHostIndexProps): any => { + const { value } = props; + const length = String(value).length; + return ( + <> + {length >= 15 ? ( +
+ +
{value}
+
+
+ ) : ( +
{value}
+ )} + + ); +}; + +export default TooltipHostIndex; diff --git a/ts/webui/src/components/experiment/overview/Config.tsx b/ts/webui/src/components/experiment/overview/Config.tsx new file mode 100644 index 000000000..9020ac8bc --- /dev/null +++ b/ts/webui/src/components/experiment/overview/Config.tsx @@ -0,0 +1,52 @@ +import * as React from 'react'; +import { Stack } from '@fluentui/react'; +import { EXPERIMENT } from '@static/datamodel'; +import { leftProgress, rightEditParam } from './count/commonStyle'; +import TooltipHostIndex from '@components/common/TooltipHostIndex'; +import '@style/experiment/overview/command.scss'; + +// This file is for showing the experiment some important params, +// Log directory, trial command, training platform and tuner/advisor message + +const Config = (): any => { + const tuner = EXPERIMENT.profile.params.tuner; + const advisor = EXPERIMENT.profile.params.advisor; + const assessor = EXPERIMENT.profile.params.assessor; + const title: string[] = []; + const builtinName: string[] = []; + if (tuner !== undefined) { + title.push('Tuner'); + builtinName.push(tuner.name || tuner.className || 'unknown'); + } + + if (advisor !== undefined) { + title.push('Advisor'); + builtinName.push(advisor.name || advisor.className || 'unknown'); + } + + if (assessor !== undefined) { + title.push('Assessor'); + builtinName.push(assessor.name || assessor.className || 'unknown'); + } + + return ( + +
+

Log directory

+ +

Trial command

+ +
+
+
+

Training platform

+
{EXPERIMENT.trainingServicePlatform}
+

{title.join('/')}

+
{builtinName.join('/')}
+
+
+
+ ); +}; + +export default Config; diff --git a/ts/webui/src/components/experiment/overview/Overview.tsx b/ts/webui/src/components/experiment/overview/Overview.tsx index d93de9727..65becad41 100644 --- a/ts/webui/src/components/experiment/overview/Overview.tsx +++ b/ts/webui/src/components/experiment/overview/Overview.tsx @@ -10,8 +10,7 @@ import { BasicInfo } from './params/BasicInfo'; import { ExpDuration } from './count/ExpDuration'; import { ExpDurationContext } from './count/ExpDurationContext'; import { TrialCount } from './count/TrialCount'; -import { Command1 } from './command/Command1'; -import { Command2 } from './command/Command2'; +import Config from './Config'; import { TitleContext } from './TitleContext'; import { itemStyleSucceed, entriesOption } from './overviewConst'; import '@style/experiment/overview/overview.scss'; @@ -185,9 +184,8 @@ class Overview extends React.Component<{}, OverviewState> { /> - - - + + diff --git a/ts/webui/src/components/experiment/overview/command/Command1.tsx b/ts/webui/src/components/experiment/overview/command/Command1.tsx deleted file mode 100644 index aa917b6c5..000000000 --- a/ts/webui/src/components/experiment/overview/command/Command1.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; -import { EXPERIMENT } from '@static/datamodel'; -import { rightEidtParam } from '../count/commonStyle'; -import '@style/experiment/overview/command.scss'; - -export const Command1 = (): any => { - const tuner = EXPERIMENT.profile.params.tuner; - const advisor = EXPERIMENT.profile.params.advisor; - const assessor = EXPERIMENT.profile.params.assessor; - const title: string[] = []; - const builtinName: string[] = []; - if (tuner !== undefined) { - title.push('Tuner'); - builtinName.push(tuner.name || tuner.className || 'unknown'); - } - - if (advisor !== undefined) { - title.push('Advisor'); - builtinName.push(advisor.name || advisor.className || 'unknown'); - } - - if (assessor !== undefined) { - title.push('Assessor'); - builtinName.push(assessor.name || assessor.className || 'unknown'); - } - - return ( -
-
-

Training platform

-
{EXPERIMENT.trainingServicePlatform}
-

{title.join('/')}

-
{builtinName.join('/')}
-
-
- ); -}; diff --git a/ts/webui/src/components/experiment/overview/command/Command2.tsx b/ts/webui/src/components/experiment/overview/command/Command2.tsx deleted file mode 100644 index 90712031c..000000000 --- a/ts/webui/src/components/experiment/overview/command/Command2.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import React from 'react'; -import { TooltipHost, DirectionalHint } from '@fluentui/react'; -import { EXPERIMENT } from '@static/datamodel'; -import { leftProgress } from '../count/commonStyle'; -import { TOOLTIP_BACKGROUND_COLOR } from '@static/const'; -import '@style/experiment/overview/command.scss'; - -export const Command2 = (): any => { - return ( -
-

Log directory

-
- - {EXPERIMENT.profile.logDir || 'unknown'} - -
-

Trial command

-
- - {EXPERIMENT.config.trialCommand || 'unknown'} - -
-
- ); -}; diff --git a/ts/webui/src/components/experiment/overview/count/ExpDuration.tsx b/ts/webui/src/components/experiment/overview/count/ExpDuration.tsx index c32f09de8..dbb18e083 100644 --- a/ts/webui/src/components/experiment/overview/count/ExpDuration.tsx +++ b/ts/webui/src/components/experiment/overview/count/ExpDuration.tsx @@ -1,12 +1,11 @@ import React from 'react'; -import { Stack, ProgressIndicator, TooltipHost, DirectionalHint } from '@fluentui/react'; import { EXPERIMENT } from '@static/datamodel'; -import { CONTROLTYPE, TOOLTIP_BACKGROUND_COLOR } from '@static/const'; +import { CONTROLTYPE } from '@static/const'; import { convertDuration, convertTimeAsUnit } from '@static/function'; import { EditExperimentParam } from './EditExperimentParam'; import { ExpDurationContext } from './ExpDurationContext'; +import ProgressBar from './ProgressBar'; import { EditExpeParamContext } from './context'; -import { leftProgress, rightEidtParam, progressHeight } from './commonStyle'; import '@style/experiment/overview/count.scss'; export const ExpDuration = (): any => ( @@ -18,35 +17,14 @@ export const ExpDuration = (): any => ( const execDurationStr = convertDuration(execDuration); const maxExecDurationStr = convertTimeAsUnit(maxDurationUnit, maxExecDuration).toString(); return ( - -
- - - - {/* execDuration / maxDuration: 20min / 1h */} -
- {execDurationStr} - / - {`${maxExecDurationStr} ${maxDurationUnit}`} -
-
-
+ + +
(
- +
); }} diff --git a/ts/webui/src/components/experiment/overview/count/ProgressBar.tsx b/ts/webui/src/components/experiment/overview/count/ProgressBar.tsx new file mode 100644 index 000000000..dae437a9a --- /dev/null +++ b/ts/webui/src/components/experiment/overview/count/ProgressBar.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import { Stack, ProgressIndicator, TooltipHost, DirectionalHint } from '@fluentui/react'; +import { EXPERIMENT } from '@static/datamodel'; +import { TOOLTIPSTYLE } from '@static/const'; +import { leftProgress, progressHeight } from './commonStyle'; +import '@style/experiment/overview/count.scss'; + +interface ProgressBarProps { + tooltip: string; + percent: number; + latestVal: string; + presetVal: string; +} + +const ProgressBar = (props: ProgressBarProps): any => { + const { tooltip, percent, latestVal, presetVal } = props; + return ( + +
+ + + +
+ {latestVal} + / + {presetVal} +
+
+
+ ); +}; + +export default ProgressBar; diff --git a/ts/webui/src/components/experiment/overview/count/TrialCount.tsx b/ts/webui/src/components/experiment/overview/count/TrialCount.tsx index 44e644dc2..289ad5e09 100644 --- a/ts/webui/src/components/experiment/overview/count/TrialCount.tsx +++ b/ts/webui/src/components/experiment/overview/count/TrialCount.tsx @@ -1,11 +1,12 @@ import * as React from 'react'; -import { Stack, TooltipHost, ProgressIndicator, DirectionalHint, IStackTokens } from '@fluentui/react'; +import { Stack, IStackTokens } from '@fluentui/react'; import { EXPERIMENT, TRIALS } from '@static/datamodel'; -import { CONTROLTYPE, TOOLTIP_BACKGROUND_COLOR, MAX_TRIAL_NUMBERS } from '@static/const'; +import { CONTROLTYPE, MAX_TRIAL_NUMBERS } from '@static/const'; import { EditExperimentParam } from './EditExperimentParam'; +import ProgressBar from './ProgressBar'; import { EditExpeParamContext } from './context'; import { ExpDurationContext } from './ExpDurationContext'; -import { leftProgress, rightEidtParam, progressHeight } from './commonStyle'; +import { leftProgress, rightEditParam } from './commonStyle'; const line1Tokens: IStackTokens = { childrenGap: 60 @@ -29,34 +30,12 @@ export const TrialCount = (): any => { const { updateOverviewPage } = value; return ( - -
- - - -
- {bar2} - / - {maxTrialNum} -
-
-
+
@@ -85,7 +64,7 @@ export const TrialCount = (): any => {
-
+
{ ) }), ...(k === 'message' && { - onRender: (record): React.ReactNode => - record.message.length > 15 ? ( - -
{record.message}
-
- ) : ( -
{record.message}
- ) + onRender: (record): React.ReactNode => }), ...((k.startsWith('metric/') || k.startsWith('space/')) && { // show tooltip - onRender: (record): React.ReactNode => ( - -
{record[k]}
-
- ) + onRender: (record): React.ReactNode => }), ...(k === 'latestAccuracy' && { // FIXME: this is ad-hoc - onRender: (record): React.ReactNode => ( - -
{record.formattedLatestAccuracy}
-
- ) + onRender: (record): React.ReactNode => }), ...(['startTime', 'endTime'].includes(k) && { onRender: (record): React.ReactNode => {formatTimestamp(record[k], '--')} diff --git a/ts/webui/src/components/experimentManagement/FilterBtns.tsx b/ts/webui/src/components/experimentManagement/FilterBtns.tsx index 98f1ea698..918f6999c 100644 --- a/ts/webui/src/components/experimentManagement/FilterBtns.tsx +++ b/ts/webui/src/components/experimentManagement/FilterBtns.tsx @@ -60,6 +60,7 @@ class FilterBtns extends React.Component { ariaLabel='Select a date' value={selectedStartDate} onSelectDate={getSelectedData.bind(this, 'start')} + className='filter-condition-date' /> { ariaLabel='Select a date' value={selectedEndDate} onSelectDate={getSelectedData.bind(this, 'end')} + className='filter-condition-date' /> diff --git a/ts/webui/src/static/const.ts b/ts/webui/src/static/const.ts index 9af7ac5d8..7ebe5b209 100644 --- a/ts/webui/src/static/const.ts +++ b/ts/webui/src/static/const.ts @@ -70,6 +70,15 @@ const SUPPORTED_SEARCH_SPACE_TYPE = [ ]; const TOOLTIP_BACKGROUND_COLOR = '#484848'; +const TOOLTIPSTYLE = { + calloutProps: { + styles: { + beak: { background: TOOLTIP_BACKGROUND_COLOR }, + beakCurtain: { background: TOOLTIP_BACKGROUND_COLOR }, + calloutMain: { background: TOOLTIP_BACKGROUND_COLOR } + } + } +}; const MAX_TRIAL_NUMBERS = 'Max trial No.'; const RETIARIIPARAMETERS = 'mutation_summary'; @@ -88,7 +97,7 @@ export { METRIC_GROUP_UPDATE_SIZE, CONCURRENCYTOOLTIP, SUPPORTED_SEARCH_SPACE_TYPE, - TOOLTIP_BACKGROUND_COLOR, + TOOLTIPSTYLE, MAX_TRIAL_NUMBERS, RETIARIIPARAMETERS }; diff --git a/ts/webui/src/static/interface.ts b/ts/webui/src/static/interface.ts index a605d670d..96243fcb1 100644 --- a/ts/webui/src/static/interface.ts +++ b/ts/webui/src/static/interface.ts @@ -27,7 +27,7 @@ interface MultipleAxes { } interface TableRecord { - key: string; + _key: string; sequenceId: number; startTime: number; endTime?: number; @@ -37,7 +37,7 @@ interface TableRecord { message: string; intermediateCount: number; latestAccuracy: number | undefined; - formattedLatestAccuracy: string; // format (LATEST/FINAL), + _formattedLatestAccuracy: string; // format (LATEST/FINAL), } interface SearchSpace { diff --git a/ts/webui/src/static/model/trial.ts b/ts/webui/src/static/model/trial.ts index f24937adb..2a4596abf 100644 --- a/ts/webui/src/static/model/trial.ts +++ b/ts/webui/src/static/model/trial.ts @@ -184,7 +184,7 @@ class Trial { const duration = (endTime - this.info.startTime!) / 1000; return { - key: this.info.trialJobId, + _key: this.info.trialJobId, sequenceId: this.info.sequenceId, id: this.info.trialJobId, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -195,7 +195,7 @@ class Trial { message: this.info.message ?? '--', intermediateCount: this.intermediates.length, latestAccuracy: this.latestAccuracy, - formattedLatestAccuracy: this.formatLatestAccuracy() + _formattedLatestAccuracy: this.formatLatestAccuracy() }; } diff --git a/ts/webui/src/static/style/experiment/overview/count.scss b/ts/webui/src/static/style/experiment/overview/count.scss index b1857e8c5..0e8c962a7 100644 --- a/ts/webui/src/static/style/experiment/overview/count.scss +++ b/ts/webui/src/static/style/experiment/overview/count.scss @@ -5,14 +5,6 @@ $margin: 24px; margin-top: $margin; } -.ExpDuration { - margin-top: $margin; - - .maxTrialNum { - margin-bottom: 10px; - } -} - .exp-progress { margin-top: 9px; @@ -39,6 +31,7 @@ $margin: 24px; } .maxTrialNum { + margin-bottom: 10px; .editparam { position: relative; top: -7px; @@ -55,6 +48,14 @@ $margin: 24px; top: -4px; } +.editExpDuration{ + box-sizing: border-box; + width: 31%; + position: relative; + left: 69%; + bottom: 33%; +} + .concurrency { .editparam { margin-top: 5px; diff --git a/ts/webui/src/static/style/experimentManagement/experiment.scss b/ts/webui/src/static/style/experimentManagement/experiment.scss index 3844ae83e..051cde932 100644 --- a/ts/webui/src/static/style/experimentManagement/experiment.scss +++ b/ts/webui/src/static/style/experimentManagement/experiment.scss @@ -59,6 +59,10 @@ $pageMargin: 24px; &-platform { width: 150px; } + + &-date { + width: 162px; + } } .hidden {