diff --git a/console/src/pages/Evaluation/EvaluationWidgetResults.tsx b/console/src/pages/Evaluation/EvaluationWidgetResults.tsx
index 1d7b2d9394..fc4b76a956 100644
--- a/console/src/pages/Evaluation/EvaluationWidgetResults.tsx
+++ b/console/src/pages/Evaluation/EvaluationWidgetResults.tsx
@@ -3,7 +3,6 @@ import Card from '@/components/Card'
import BusyPlaceholder from '@starwhale/ui/BusyLoaderWrapper/BusyPlaceholder'
import { showTableName, tableNameOfSummary } from '@starwhale/core/datastore/utils'
import { useQueryDatastore } from '@starwhale/core/datastore/hooks/useFetchDatastore'
-import { useProject } from '@/domain/project/hooks/useProject'
import Table from '@/components/Table'
import { Panel, StatelessAccordion } from 'baseui/accordion'
import { QueryTableRequest } from '@starwhale/core/datastore'
@@ -14,7 +13,7 @@ import { Button, IconFont } from '@starwhale/ui'
const PAGE_TABLE_SIZE = 100
function Summary({ fetch }: any) {
- const record: Record
= fetch?.data?.records?.[0] ?? {}
+ const record: Record = fetch?.data?.records?.[0]
const [expanded, setExpanded] = React.useState(false)
return (
@@ -96,9 +95,7 @@ function Summary({ fetch }: any) {
}
key='summary'
>
- {fetch?.data?.records.length === 0 && (
-
- )}
+ {!record && }
- {Object.keys(record)
- .sort((a, b) => {
- if (a === 'id') return -1
- return a > b ? 1 : -1
- })
- .filter((label) => typeof record[label] !== 'object')
- .map((label) => {
- return (
-
-
- {label}
-
-
- {record[label]}
-
-
- )
- })}
+ {record &&
+ Object.keys(record)
+ .sort((a, b) => {
+ if (a === 'id') return -1
+ return a > b ? 1 : -1
+ })
+ .filter((label) => typeof record[label] !== 'object')
+ .map((label) => {
+ return (
+
+
+ {label}
+
+
+ {record[label]}
+
+
+ )
+ })}
@@ -172,13 +170,9 @@ function EvaluationViewer({ table, filter }: { table: string; filter?: Record
- }
-
- if (info.isError) {
- return
- }
+ // if (info.isFetching) {
+ // return
+ // }
if (table.includes('/summary')) return
@@ -192,15 +186,14 @@ function EvaluationViewer({ table, filter }: { table: string; filter?: Record()
- const { project } = useProject()
+ const { jobId, projectId } = useParams<{ jobId: string; projectId: string }>()
const tables = React.useMemo(() => {
const names = []
- if (project?.name) names.push(tableNameOfSummary(project?.name))
+ if (projectId) names.push(tableNameOfSummary(projectId))
return [...names]
- }, [project?.name])
+ }, [projectId])
return (
diff --git a/console/src/pages/Model/ModelOverviewLayout.tsx b/console/src/pages/Model/ModelOverviewLayout.tsx
index a5a2a279af..3c9b80bd42 100644
--- a/console/src/pages/Model/ModelOverviewLayout.tsx
+++ b/console/src/pages/Model/ModelOverviewLayout.tsx
@@ -8,11 +8,9 @@ import { fetchModel, removeModel } from '@model/services/model'
import BaseSubLayout from '@/pages/BaseSubLayout'
import IconFont from '@starwhale/ui/IconFont'
import { BaseNavTabs } from '@/components/BaseNavTabs'
-import { Button } from '@starwhale/ui'
+import { Button, Toggle } from '@starwhale/ui'
import { usePage } from '@/hooks/usePage'
import qs from 'qs'
-import Checkbox from '@starwhale/ui/Checkbox'
-import { STYLE_TYPE } from 'baseui/checkbox'
import { createUseStyles } from 'react-jss'
import { useQueryArgs } from '@starwhale/core'
import { ConfirmButton } from '@starwhale/ui/Modal'
@@ -165,18 +163,17 @@ export default function ModelOverviewLayout({ children }: IModelLayoutProps) {
- {
- setIsCompare(e.currentTarget.checked)
- if (!e.currentTarget.checked)
+ {
+ setIsCompare(checked)
+ if (!checked)
history.push(
`/projects/${projectId}/models/${modelId}/versions/${modelVersionId}/${activeItemId}?${qs.stringify(
{ ...page, compare: undefined }
)}`
)
}}
- checkmarkType={STYLE_TYPE.toggle_round}
/>
{t('model.viewer.compare')}