"...composable_kernel_rocm.git" did not exist on "5db68230bda30ad76085edf771ba6bc0311c8d82"
Unverified Commit b0bcde86 authored by Lijiaoa's avatar Lijiaoa Committed by GitHub
Browse files

Refine webui (#4548)

parent b4d8aebb
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
}, },
"plugins": [ "plugins": [
"@typescript-eslint", "@typescript-eslint",
"eslint-plugin-prettier" "eslint-plugin-prettier",
"import"
], ],
"extends": [ "extends": [
"eslint:recommended", "eslint:recommended",
...@@ -50,6 +51,15 @@ ...@@ -50,6 +51,15 @@
"react": { "react": {
"version": "detect" "version": "detect"
}, },
"import/resolver": {
"alias": {
"@": "src",
"@components": "src/components",
"@static": "src/static",
"@style": "src/static/style",
"@model": "src/static/model"
}
},
"ignorePatterns": [ "ignorePatterns": [
"node_modules/", "node_modules/",
"build/", "build/",
......
...@@ -27,7 +27,14 @@ const config = { ...@@ -27,7 +27,14 @@ const config = {
}, },
optimization: { minimize: false }, optimization: { minimize: false },
resolve: { resolve: {
modules: [ 'node_modules' ], modules: [ 'node_modules', 'src' ],
alias: {
'@': paths.appSrc,
'@components': `${paths.appSrc}/components`,
'@static': `${paths.appSrc}/static`,
'@style': `${paths.appSrc}/static/style`,
'@model': `${paths.appSrc}/static/model`
},
extensions: paths.moduleFileExtensions.map(ext => `.${ext}`), extensions: paths.moduleFileExtensions.map(ext => `.${ext}`),
}, },
module: { module: {
......
...@@ -19,7 +19,11 @@ const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeM ...@@ -19,7 +19,11 @@ const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeM
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent'); const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent');
const paths = require('./paths'); const paths = require('./paths');
const modules = require('./modules'); // note this line because it will cause this error:
// "Your project's `baseUrl` can only be set to `src` or `node_modules`." +
// ' Create React App does not support other values at this time.'
// Only set baseUrl to '.' could fix the `absolute path` issue
// const modules = require('./modules');
const getClientEnvironment = require('./env'); const getClientEnvironment = require('./env');
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin'); const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin'); const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
...@@ -252,7 +256,16 @@ module.exports = function(webpackEnv) { ...@@ -252,7 +256,16 @@ module.exports = function(webpackEnv) {
// We placed these paths second because we want `node_modules` to "win" // We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism. // if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebook/create-react-app/issues/253 // https://github.com/facebook/create-react-app/issues/253
modules: ['node_modules', paths.appNodeModules].concat(modules.additionalModulePaths || []), // modules: ['node_modules', paths.appNodeModules].concat(modules.additionalModulePaths || []),
modules: ['node_modules', 'src'],
alias: {
'react-native': 'react-native-web',
'@': paths.appSrc,
'@components': `${paths.appSrc}/components`,
'@static': `${paths.appSrc}/static`,
'@style': `${paths.appSrc}/static/style`,
'@model': `${paths.appSrc}/static/model`
},
// These are the reasonable defaults supported by the Node ecosystem. // These are the reasonable defaults supported by the Node ecosystem.
// We also include JSX as a common component filename extension to support // We also include JSX as a common component filename extension to support
// some tools, although we do not recommend using it, see: // some tools, although we do not recommend using it, see:
...@@ -262,11 +275,6 @@ module.exports = function(webpackEnv) { ...@@ -262,11 +275,6 @@ module.exports = function(webpackEnv) {
extensions: paths.moduleFileExtensions extensions: paths.moduleFileExtensions
.map(ext => `.${ext}`) .map(ext => `.${ext}`)
.filter(ext => useTypeScript || !ext.includes('ts')), .filter(ext => useTypeScript || !ext.includes('ts')),
alias: {
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
},
plugins: [ plugins: [
// Adds support for installing with Plug'n'Play, leading to faster installs and adding // Adds support for installing with Plug'n'Play, leading to faster installs and adding
// guards against forgotten dependencies and such. // guards against forgotten dependencies and such.
......
import * as React from 'react'; import * as React from 'react';
import { Stack } from '@fluentui/react'; import { Stack } from '@fluentui/react';
import { COLUMN } from './static/const'; import { SlideNavBtns } from '@components/nav/slideNav/SlideNavBtns';
import { EXPERIMENT, TRIALS } from './static/datamodel'; import { EXPERIMENT, TRIALS } from '@static/datamodel';
import { isManagerExperimentPage } from './static/function'; import NavCon from '@components/nav/Nav';
import NavCon from './components/NavCon'; import MessageInfo from '@components/common/MessageInfo';
import MessageInfo from './components/modals/MessageInfo'; import { COLUMN } from '@static/const';
import { SlideNavBtns } from './components/slideNav/SlideNavBtns'; import { isManagerExperimentPage } from '@static/function';
import '@style/App.scss';
import '@style/common/common.scss';
import '@style/experiment/trialdetail/trialsDetail.scss';
const echarts = require('echarts/lib/echarts'); const echarts = require('echarts/lib/echarts');
echarts.registerTheme('nni_theme', { echarts.registerTheme('nni_theme', {
color: '#3c8dbc' color: '#3c8dbc'
}); });
import './App.scss';
import './static/style/common.scss';
import './static/style/trialsDetail.scss';
interface AppState { interface AppState {
interval: number; interval: number;
......
...@@ -2,7 +2,7 @@ import React, { useRef } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useRef } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import copy from 'copy-to-clipboard'; import copy from 'copy-to-clipboard';
import { IconButton, FontSizes, TooltipHost } from '@fluentui/react'; import { IconButton, FontSizes, TooltipHost } from '@fluentui/react';
import { TOOLTIP_BACKGROUND_COLOR } from '../../static/const'; import { TOOLTIP_BACKGROUND_COLOR } from '@static/const';
const COPIED_TOOLTIP_CLOSE_DELAY = 1000; const COPIED_TOOLTIP_CLOSE_DELAY = 1000;
......
import * as React from 'react'; import * as React from 'react';
import { DetailsRow, IDetailsRowBaseProps } from '@fluentui/react'; import { DetailsRow, IDetailsRowBaseProps } from '@fluentui/react';
import OpenRow from '../public-child/OpenRow'; import OpenRow from './OpenRow';
interface ExpandableDetailsProps { interface ExpandableDetailsProps {
detailsProps: IDetailsRowBaseProps; detailsProps: IDetailsRowBaseProps;
......
import * as React from 'react'; import * as React from 'react';
import * as copy from 'copy-to-clipboard'; import * as copy from 'copy-to-clipboard';
import { Stack, PrimaryButton, Pivot, PivotItem, DefaultButton } from '@fluentui/react'; import { Stack, PrimaryButton, Pivot, PivotItem, DefaultButton } from '@fluentui/react';
import { Trial } from '../../static/model/trial';
import { MANAGER_IP, RETIARIIPARAMETERS } from '../../static/const';
import { EXPERIMENT, TRIALS } from '../../static/datamodel';
import { reformatRetiariiParameter } from '../../static/function';
import JSONTree from 'react-json-tree'; import JSONTree from 'react-json-tree';
import PaiTrialLog from '../public-child/PaiTrialLog'; import { Trial } from '@model/trial';
import TrialLog from '../public-child/TrialLog'; import { MANAGER_IP, RETIARIIPARAMETERS } from '@static/const';
import MessageInfo from '../modals/MessageInfo'; import { EXPERIMENT, TRIALS } from '@static/datamodel';
import PanelMonacoEditor from '../public-child/PanelMonacoEditor'; import { reformatRetiariiParameter } from '@static/function';
import '../../static/style/overview/overview.scss'; import PaiTrialLog from './PaiTrialLog';
import '../../static/style/copyParameter.scss'; import TrialLog from './TrialLog';
import '../../static/style/openRow.scss'; import MessageInfo from './MessageInfo';
import PanelMonacoEditor from './PanelMonacoEditor';
import '@style/experiment/overview/overview.scss';
import '@style/copyParameter.scss';
import '@style/openRow.scss';
/** /**
* netron URL must be synchronized with ts/nni_manager/rest_server/index.ts`. * netron URL must be synchronized with ts/nni_manager/rest_server/index.ts`.
......
import * as React from 'react'; import * as React from 'react';
import { DOWNLOAD_IP } from '../../static/const'; import { DOWNLOAD_IP } from '@static/const';
import LogPathChild from './LogPathChild'; import LogPathChild from './LogPathChild';
interface PaiTrialChildProps { interface PaiTrialChildProps {
......
import * as React from 'react'; import * as React from 'react';
import { DOWNLOAD_IP } from '../../static/const'; import { DOWNLOAD_IP } from '@static/const';
import PaiTrialChild from './PaiTrialChild'; import PaiTrialChild from './PaiTrialChild';
import LogPathChild from './LogPathChild'; import LogPathChild from './LogPathChild';
......
import * as React from 'react'; import * as React from 'react';
import { Stack, Panel, PrimaryButton } from '@fluentui/react'; import { Stack, Panel, PrimaryButton } from '@fluentui/react';
import MonacoEditor from 'react-monaco-editor'; import MonacoEditor from 'react-monaco-editor';
import { caclMonacoEditorHeight } from '../../static/function'; import { caclMonacoEditorHeight } from '@static/function';
import '../../static/style/logDrawer.scss'; import '@style/logPanel.scss';
interface LogDrawerProps { interface LogPanelProps {
hideConfigPanel: () => void; hideConfigPanel: () => void;
panelName: string; panelName: string;
panelContent: string; panelContent: string;
} }
interface LogDrawerState { interface LogPanelState {
panelInnerHeight: number; panelInnerHeight: number;
} }
...@@ -21,8 +21,8 @@ interface LogDrawerState { ...@@ -21,8 +21,8 @@ interface LogDrawerState {
* panel * panel
*/ */
class PanelMonacoEditor extends React.Component<LogDrawerProps, LogDrawerState> { class PanelMonacoEditor extends React.Component<LogPanelProps, LogPanelState> {
constructor(props: LogDrawerProps) { constructor(props: LogPanelProps) {
super(props); super(props);
this.state = { this.state = {
...@@ -31,16 +31,16 @@ class PanelMonacoEditor extends React.Component<LogDrawerProps, LogDrawerState> ...@@ -31,16 +31,16 @@ class PanelMonacoEditor extends React.Component<LogDrawerProps, LogDrawerState>
} }
// use arrow function for change window size met error: this.setState is not a function // use arrow function for change window size met error: this.setState is not a function
setLogDrawerHeight = (): void => { setLogPanelHeight = (): void => {
this.setState(() => ({ panelInnerHeight: window.innerHeight, innerWidth: window.innerWidth })); this.setState(() => ({ panelInnerHeight: window.innerHeight, innerWidth: window.innerWidth }));
}; };
async componentDidMount(): Promise<void> { async componentDidMount(): Promise<void> {
window.addEventListener('resize', this.setLogDrawerHeight); window.addEventListener('resize', this.setLogPanelHeight);
} }
componentWillUnmount(): void { componentWillUnmount(): void {
window.removeEventListener('resize', this.setLogDrawerHeight); window.removeEventListener('resize', this.setLogPanelHeight);
} }
render(): React.ReactNode { render(): React.ReactNode {
......
import * as React from 'react'; import * as React from 'react';
import { Stack, Icon, Dropdown, DefaultButton } from '@fluentui/react'; import { Stack, Icon, Dropdown, DefaultButton } from '@fluentui/react';
import { EXPERIMENT, TRIALS } from '../static/datamodel'; import { EXPERIMENT, TRIALS } from '@static/datamodel';
import { Trial } from '../static/model/trial'; import { Trial } from '@static/model/trial';
import { AppContext } from '../App'; import { AppContext } from '@/App';
import { Title } from './overview/Title'; import { Title } from './Title';
import SuccessTable from './overview/table/SuccessTable'; import SuccessTable from './table/SuccessTable';
import DefaultPoint from './trial-detail/DefaultMetricPoint'; import DefaultPoint from '../trialdetail/chart/DefaultMetricPoint';
import { BasicInfo } from './overview/params/BasicInfo'; import { BasicInfo } from './params/BasicInfo';
import { ExpDuration } from './overview/count/ExpDuration'; import { ExpDuration } from './count/ExpDuration';
import { ExpDurationContext } from './overview/count/ExpDurationContext'; import { ExpDurationContext } from './count/ExpDurationContext';
import { TrialCount } from './overview/count/TrialCount'; import { TrialCount } from './count/TrialCount';
import { Command1 } from './overview/command/Command1'; import { Command1 } from './command/Command1';
import { Command2 } from './overview/command/Command2'; import { Command2 } from './command/Command2';
import { TitleContext } from './overview/TitleContext'; import { TitleContext } from './TitleContext';
import { itemStyleSucceed, entriesOption } from './overview/overviewConst'; import { itemStyleSucceed, entriesOption } from './overviewConst';
import '../static/style/overview/overview.scss'; import '@style/experiment/overview/overview.scss';
import '../static/style/overview/topTrial.scss'; import '@style/experiment/overview/topTrial.scss';
import '../static/style/logPath.scss'; import '@style/logPath.scss';
/**
* single experiment
* overview page
*/
interface OverviewState { interface OverviewState {
trialConcurrency: number; trialConcurrency: number;
......
import React from 'react'; import React from 'react';
import { Stack, Icon, initializeIcons } from '@fluentui/react'; import { Stack, Icon } from '@fluentui/react';
import { TitleContext } from './TitleContext'; import { TitleContext } from './TitleContext';
import '../../static/style/overview/overviewTitle.scss'; import '@style/experiment/overview/overviewTitle.scss';
initializeIcons();
export const Title = (): any => ( export const Title = (): any => (
<TitleContext.Consumer> <TitleContext.Consumer>
......
import React from 'react'; import React from 'react';
import { EXPERIMENT } from '../../../static/datamodel'; import { EXPERIMENT } from '@static/datamodel';
import { rightEidtParam } from '../count/commonStyle'; import { rightEidtParam } from '../count/commonStyle';
import '../../../static/style/overview/command.scss'; import '@style/experiment/overview/command.scss';
export const Command1 = (): any => { export const Command1 = (): any => {
const tuner = EXPERIMENT.profile.params.tuner; const tuner = EXPERIMENT.profile.params.tuner;
......
import React from 'react'; import React from 'react';
import { TooltipHost, DirectionalHint } from '@fluentui/react'; import { TooltipHost, DirectionalHint } from '@fluentui/react';
import { EXPERIMENT } from '../../../static/datamodel'; import { EXPERIMENT } from '@static/datamodel';
import { leftProgress } from '../count/commonStyle'; import { leftProgress } from '../count/commonStyle';
import { TOOLTIP_BACKGROUND_COLOR } from '../../../static/const'; import { TOOLTIP_BACKGROUND_COLOR } from '@static/const';
import '../../../static/style/overview/command.scss'; import '@style/experiment/overview/command.scss';
export const Command2 = (): any => { export const Command2 = (): any => {
return ( return (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment