mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 00:50:46 +08:00
UmePage: show error banner when runtime pause/resume fails
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
1741965de6
commit
fa1135a9c2
1 changed files with 12 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ import { formatSystemTime } from "../utils/time";
|
|||
export function UmePage() {
|
||||
const queryClient = useQueryClient();
|
||||
const [tokenOpError, setTokenOpError] = useState("");
|
||||
const [runtimeTaskError, setRuntimeTaskError] = useState("");
|
||||
const [syncPage, setSyncPage] = useState(1);
|
||||
const [syncPageSize, setSyncPageSize] = useState(20);
|
||||
const [neKeyword, setNeKeyword] = useState("");
|
||||
|
|
@ -113,9 +114,15 @@ export function UmePage() {
|
|||
`/v1/ume/runtime/tasks/${encodeURIComponent(vars.task)}/${vars.action}`,
|
||||
{},
|
||||
),
|
||||
onMutate: () => {
|
||||
setRuntimeTaskError("");
|
||||
},
|
||||
onSuccess: async () => {
|
||||
await queryClient.invalidateQueries({ queryKey: ["umeSyncStatus"] });
|
||||
},
|
||||
onError: (err) => {
|
||||
setRuntimeTaskError(String(err));
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
@ -209,6 +216,11 @@ export function UmePage() {
|
|||
</tbody>
|
||||
</table>
|
||||
<h3 style={{ marginTop: 12 }}>后台任务</h3>
|
||||
{runtimeTaskError ? (
|
||||
<div className="pill pill--high" style={{ marginBottom: 8 }}>
|
||||
后台任务操作失败: {runtimeTaskError}
|
||||
</div>
|
||||
) : null}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue