fix: task executor with status "timeout" corrupts page when checking its details (#12467)

### What problem does this PR solve?

In **Admin UI** > **Service Status**, clicking "Show details" on task
executor with status "Timeout" may corrupts page.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Jimmy Ben Klieve
2026-01-07 09:58:16 +08:00
committed by GitHub
parent 51ece37db2
commit 8e03843145
2 changed files with 12 additions and 0 deletions

View File

@ -68,6 +68,8 @@ import {
} from './utils'; } from './utils';
import JsonView from 'react18-json-view'; import JsonView from 'react18-json-view';
import 'react18-json-view/src/style.css';
import ServiceDetail from './service-detail'; import ServiceDetail from './service-detail';
import TaskExecutorDetail from './task-executor-detail'; import TaskExecutorDetail from './task-executor-detail';

View File

@ -1,5 +1,8 @@
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { isPlainObject } from 'lodash';
import JsonView from 'react18-json-view'; import JsonView from 'react18-json-view';
import 'react18-json-view/src/style.css';
import { import {
Bar, Bar,
BarChart, BarChart,
@ -15,6 +18,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { ScrollArea } from '@/components/ui/scroll-area'; import { ScrollArea } from '@/components/ui/scroll-area';
import { formatDate, formatTime } from '@/utils/date'; import { formatDate, formatTime } from '@/utils/date';
import ServiceDetail from './service-detail';
interface TaskExecutorDetailProps { interface TaskExecutorDetailProps {
content?: AdminService.TaskExecutorInfo; content?: AdminService.TaskExecutorInfo;
@ -68,9 +72,15 @@ function CustomAxisTick({ x, y, payload }: any) {
} }
function TaskExecutorDetail({ content }: TaskExecutorDetailProps) { function TaskExecutorDetail({ content }: TaskExecutorDetailProps) {
if (!isPlainObject(content)) {
return <ServiceDetail content={content} />;
}
return ( return (
<section className="space-y-8"> <section className="space-y-8">
{Object.entries(content ?? {}).map(([name, data]) => { {Object.entries(content ?? {}).map(([name, data]) => {
console.log(data);
const items = data.map((x) => ({ const items = data.map((x) => ({
...x, ...x,
done: Math.floor(Math.random() * 100), done: Math.floor(Math.random() * 100),