@gadmin2n/schematics 0.0.85 → 0.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102,16 +102,20 @@ function RunDot({
102
102
  count,
103
103
  color,
104
104
  label,
105
+ onClick,
105
106
  }: {
106
107
  count: number;
107
108
  color: string;
108
109
  label: string;
110
+ onClick?: () => void;
109
111
  }) {
110
112
  const size = 28;
111
113
  const hasCount = count > 0;
114
+ const clickable = hasCount && !!onClick;
112
115
  return (
113
116
  <Tooltip title={`${label}: ${count}`}>
114
117
  <span
118
+ onClick={clickable ? onClick : undefined}
115
119
  style={{
116
120
  display: 'inline-flex',
117
121
  alignItems: 'center',
@@ -124,7 +128,7 @@ function RunDot({
124
128
  fontSize: 11,
125
129
  fontWeight: 600,
126
130
  color: hasCount ? color : '#d9d9d9',
127
- cursor: 'default',
131
+ cursor: clickable ? 'pointer' : 'default',
128
132
  lineHeight: 1,
129
133
  }}
130
134
  >
@@ -339,14 +343,38 @@ export default function AgendaJobsPage() {
339
343
  title: 'Runs',
340
344
  key: 'runs',
341
345
  width: 170,
342
- render: (_: any, record: JobItem) => (
343
- <Space size={6}>
344
- <RunDot count={record.runs.queued} color="#faad14" label="Queued" />
345
- <RunDot count={record.runs.success} color="#006d32" label="Success" />
346
- <RunDot count={record.runs.running} color="#52c41a" label="Running" />
347
- <RunDot count={record.runs.failed} color="#ff4d4f" label="Failed" />
348
- </Space>
349
- ),
346
+ render: (_: any, record: JobItem) => {
347
+ const go = (status: string) =>
348
+ navigate(`show/${encodeURIComponent(record.name)}?status=${status}`);
349
+ return (
350
+ <Space size={6}>
351
+ <RunDot
352
+ count={record.runs.queued}
353
+ color="#faad14"
354
+ label="Queued"
355
+ onClick={() => go('queued')}
356
+ />
357
+ <RunDot
358
+ count={record.runs.success}
359
+ color="#006d32"
360
+ label="Success"
361
+ onClick={() => go('success')}
362
+ />
363
+ <RunDot
364
+ count={record.runs.running}
365
+ color="#52c41a"
366
+ label="Running"
367
+ onClick={() => go('running')}
368
+ />
369
+ <RunDot
370
+ count={record.runs.failed}
371
+ color="#ff4d4f"
372
+ label="Failed"
373
+ onClick={() => go('failed')}
374
+ />
375
+ </Space>
376
+ );
377
+ },
350
378
  },
351
379
  {
352
380
  title: 'Schedule',
@@ -451,7 +479,7 @@ export default function AgendaJobsPage() {
451
479
  icon={<DatabaseOutlined />}
452
480
  onClick={() => navigate('/admin/data-mngt/agenda-job')}
453
481
  >
454
- AgendaJob 表
482
+ 任务原始表
455
483
  </Button>
456
484
  </Tooltip>
457
485
  <Button
@@ -22,7 +22,7 @@ import {
22
22
  DeleteOutlined,
23
23
  PlayCircleOutlined,
24
24
  } from '@ant-design/icons';
25
- import { useNavigate, useParams } from 'react-router-dom';
25
+ import { useNavigate, useParams, useSearchParams } from 'react-router-dom';
26
26
  import { customRequest } from 'helpers/http';
27
27
  import { useECharts } from 'hooks/useECharts';
28
28
  import dayjs from 'dayjs';
@@ -216,6 +216,8 @@ export default function AgendaJobShow() {
216
216
  const { jobName: rawJobName } = useParams<{ jobName: string }>();
217
217
  const jobName = decodeURIComponent(rawJobName || '');
218
218
  const navigate = useNavigate();
219
+ const [searchParams] = useSearchParams();
220
+ const initialStatus = searchParams.get('status') || undefined;
219
221
 
220
222
  const [detail, setDetail] = useState<JobDetail | null>(null);
221
223
  const [loading, setLoading] = useState(true);
@@ -231,7 +233,9 @@ export default function AgendaJobShow() {
231
233
  // Chart filters
232
234
  const [filterBefore, setFilterBefore] = useState<dayjs.Dayjs | null>(dayjs());
233
235
  const [filterLimit, setFilterLimit] = useState(25);
234
- const [filterStatus, setFilterStatus] = useState<string | undefined>();
236
+ const [filterStatus, setFilterStatus] = useState<string | undefined>(
237
+ initialStatus,
238
+ );
235
239
 
236
240
  // Fetch job detail
237
241
  const fetchDetail = useCallback(async () => {
@@ -327,9 +331,10 @@ export default function AgendaJobShow() {
327
331
  if (!detail) {
328
332
  return (
329
333
  <div style={{ padding: 24 }}>
330
- <Button icon={<ArrowLeftOutlined />} onClick={() => navigate(-1)}>
331
- 返回
332
- </Button>
334
+ <Button
335
+ icon={<ArrowLeftOutlined />}
336
+ onClick={() => navigate(-1)}
337
+ ></Button>
333
338
  <div style={{ marginTop: 24, textAlign: 'center', color: '#999' }}>
334
339
  Job 不存在
335
340
  </div>
@@ -408,9 +408,7 @@ export default function WorkflowEditorPage() {
408
408
  type="text"
409
409
  icon={<ArrowLeftOutlined />}
410
410
  onClick={() => navigate('/admin/workflow')}
411
- >
412
- Back
413
- </Button>
411
+ ></Button>
414
412
  {editingTitle ? (
415
413
  <Input
416
414
  ref={titleInputRef}
@@ -420,7 +420,7 @@ export default function WorkflowListPage() {
420
420
  navigate('/admin/data-mngt/workflow-event-outbox')
421
421
  }
422
422
  >
423
- EventOutbox 表
423
+ PG表事件队列
424
424
  </Button>
425
425
  </Tooltip>
426
426
  <Button
@@ -234,9 +234,7 @@ export default function WorkflowInstanceDetailPage() {
234
234
  type="text"
235
235
  icon={<ArrowLeftOutlined />}
236
236
  onClick={() => navigate(-1)}
237
- >
238
- Back
239
- </Button>
237
+ ></Button>
240
238
  <Title level={4} style={{ margin: 0 }}>
241
239
  {data.workflow.name} — Instance #{data.id}
242
240
  </Title>
@@ -197,9 +197,7 @@ export default function WorkflowInstancesPage() {
197
197
  type="text"
198
198
  icon={<ArrowLeftOutlined />}
199
199
  onClick={() => navigate('/admin/workflow')}
200
- >
201
- Back
202
- </Button>
200
+ ></Button>
203
201
  <Title level={4} style={{ margin: 0 }}>
204
202
  {workflowName || 'Workflow'} — Execution History
205
203
  </Title>
@@ -93,9 +93,11 @@ export function NodeInstanceForm({
93
93
  }}
94
94
  >
95
95
  <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
96
- <Button type="text" icon={<ArrowLeftOutlined />} onClick={onBack}>
97
- 返回
98
- </Button>
96
+ <Button
97
+ type="text"
98
+ icon={<ArrowLeftOutlined />}
99
+ onClick={onBack}
100
+ ></Button>
99
101
  <Title level={4} style={{ margin: 0 }}>
100
102
  {title}
101
103
  </Title>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gadmin2n/schematics",
3
- "version": "0.0.85",
3
+ "version": "0.0.86",
4
4
  "description": "Gadmin - modern, fast, powerful node.js web framework (@schematics)",
5
5
  "main": "dist/index.js",
6
6
  "files": [