未验证 提交 3f9a02f5 编写于 作者: P Peter Pan 提交者: GitHub

frontend v2.0.0-beta.23: fix scalar chart error when data is null (#602)

* ignore .tools-versions

* fix: do not render null values of scalar list

* v2.0.0-beta.23
上级 9e693836
......@@ -103,11 +103,8 @@ ENV/
.DS_Store
# frontend
node_modules
/.vscode
package-lock.json
# PyCharm IDE
.idea/
/.vscode
.tool-versions
......@@ -72,7 +72,7 @@ const ScalarChart: FunctionComponent<ScalarChartProps> = ({
}) => {
const {t, i18n} = useTranslation(['scalars', 'common']);
const {data: datasets, error, loading} = useRunningRequest<Dataset[]>(
const {data: datasets, error, loading} = useRunningRequest<(Dataset | null)[]>(
runs.map(run => `/scalars/list?${queryString.stringify({run, tag})}`),
!!running,
(...urls) => cycleFetcher(urls)
......@@ -84,7 +84,7 @@ const ScalarChart: FunctionComponent<ScalarChartProps> = ({
const transformParams = useMemo(
() => ({
datasets: datasets ?? [],
datasets: datasets?.map(data => data ?? []) ?? [],
smoothing
}),
[datasets, smoothing]
......
{
"name": "visualdl",
"version": "2.0.0-beta.22",
"version": "2.0.0-beta.23",
"title": "VisualDL",
"description": "A platform to visualize the deep learning process and result.",
"keywords": [
......
......@@ -42,7 +42,7 @@ export default (options: Options) => {
res.send(Buffer.from(mock));
} else {
const result = JSON.parse(faker.fake(JSON.stringify(mock, null, 4)));
if ('status' in result && 'data' in result) {
if (result && 'status' in result && 'data' in result) {
res.json(result);
} else {
res.json({status: 0, msg: '', data: result});
......@@ -50,6 +50,8 @@ export default (options: Options) => {
}
} catch (e) {
res.status(500).send(e.message);
// eslint-disable-next-line no-console
console.error(e);
}
};
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册