Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

fix bugs on second bug bash #3016

Merged
merged 1 commit into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/webui/src/components/overview/command/Command1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export const Command1 = (): any => {
}

return (
<div className='command basic'>
<div className='basic'>
<div>
<p>Training platform</p>
<p className='command'>Training platform</p>
<div className='nowrap'>{EXPERIMENT.profile.params.trainingServicePlatform}</div>
<p className='lineMargin'>{title}</p>
<div className='nowrap'>{builtinName}</div>
Expand Down
4 changes: 2 additions & 2 deletions src/webui/src/components/overview/command/Command2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const Command2 = (): any => {
}
}
return (
<div className='command basic'>
<p>Log directory</p>
<div className='basic'>
<p className='command'>Log directory</p>
<div className='nowrap'>
<TooltipHost
content={EXPERIMENT.profile.logDir || 'unknown'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export const EditExperimentParam = (): any => {
return val;
}
}

return (
<AppContext.Consumer>
{(values): React.ReactNode => {
Expand Down
6 changes: 3 additions & 3 deletions src/webui/src/components/overview/overviewConst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const entriesOption = [
];

const durationUnit = [
{ key: 'm', text: 'm' },
{ key: 'h', text: 'h' },
{ key: 'd', text: 'd' }
{ key: 'm', text: 'min' },
{ key: 'h', text: 'hour' },
{ key: 'd', text: 'day' }
];

export { itemStyle1, itemStyleSucceed, itemStyle2, entriesOption, durationUnit };
14 changes: 7 additions & 7 deletions src/webui/src/components/trial-detail/TableList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import '../../static/style/pagination.scss';
import '../../static/style/search.scss';
import '../../static/style/table.scss';
import '../../static/style/tableStatus.css';
import '../../static/style/overview/overviewTitle.scss';
import { blocked, copy, LineChart, tableListIcon } from '../buttons/Icon';
import ChangeColumnComponent from '../modals/ChangeColumnComponent';
import Compare from '../modals/Compare';
Expand Down Expand Up @@ -297,17 +298,16 @@ class TableList extends React.Component<TableListProps, TableListState> {
// FIXME: default metric is hacked as latestAccuracy currently
continue;
}
const lengths = tableItems.map(item => `${item[k]}`.length);
const avgLengths = lengths.reduce((a, b) => a + b) / lengths.length;
const columnTitle = _inferColumnTitle(k);
const columnWidth = Math.max(columnTitle.length, avgLengths);
// TODO: add blacklist
// 0.85: tableWidth / screen
const widths = window.innerWidth * 0.85;
columns.push({
name: columnTitle,
key: k,
fieldName: k,
minWidth: columnWidth * 13,
maxWidth: columnWidth * 18,
minWidth: widths * 0.12,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to get the pixel value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(window.innerWidth * 0.85 - (20px expand button) - (150px operation)) / (5列) 来拿到每一列的宽度,宽度/屏幕宽拿到比列系数,各个屏幕适配得到最优比~

maxWidth: widths * 0.19,
isResizable: true,
onColumnClick: this._onColumnClick.bind(this),
...(k === 'status' && {
Expand Down Expand Up @@ -371,8 +371,8 @@ class TableList extends React.Component<TableListProps, TableListState> {
name: 'Operation',
key: '_operation',
fieldName: 'operation',
minWidth: 160,
maxWidth: 200,
minWidth: 150,
maxWidth: 160,
isResizable: true,
className: 'detail-table',
onRender: this._renderOperationColumn.bind(this)
Expand Down
9 changes: 7 additions & 2 deletions src/webui/src/static/style/overview/command.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
.command {
p {
.overviewCommand1,
.overviewCommand2 {
.command {
margin-top: 0;
font-weight: normal;
}
}

.basic {
.lineMargin {
margin-top: 20px;
font-weight: normal;
}
}
3 changes: 2 additions & 1 deletion src/webui/src/static/style/overview/config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
.ms-Button--default {
padding: 0 8px;
margin: 0 0 12px 0;
border: 1px solid #ccc;
border: none;
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.08);
border-radius: 18px 0 0 18px;
font-size: 12px;
text-align: left;
Expand Down
10 changes: 0 additions & 10 deletions src/webui/src/static/style/overview/overviewTitle.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
$iconPaddingVal: 20px;

.panelTitle {
img {
height: 23px;

/* (38 - 22 ) / 2 */
margin-top: 8px;

/* icon right */
padding: 0 $iconPaddingVal 0 0;
}

span {
font-size: 18px;
font-weight: 600;
Expand Down