mirror of
https://github.com/garethgeorge/backrest.git
synced 2026-08-27 11:26:28 +00:00
fix: hide system operations in tree view
This commit is contained in:
@@ -6,6 +6,7 @@ import { GetOperationsRequest } from "../../gen/ts/v1/service_pb";
|
||||
import { useAlertApi } from "./Alerts";
|
||||
import { OperationRow } from "./OperationRow";
|
||||
import { OplogState, syncStateFromRequest } from "../state/logstate";
|
||||
import { shouldHideStatus } from "../state/oplog";
|
||||
|
||||
// OperationList displays a list of operations that are either fetched based on 'req' or passed in via 'useBackups'.
|
||||
// If showPlan is provided the planId will be displayed next to each operation in the operation list.
|
||||
@@ -25,9 +26,8 @@ export const OperationList = ({
|
||||
let [operations, setOperations] = useState<Operation[]>([]);
|
||||
|
||||
if (req) {
|
||||
// track backups for this operation tree view.
|
||||
useEffect(() => {
|
||||
const logState = new OplogState();
|
||||
const logState = new OplogState((op) => !shouldHideStatus(op.status));
|
||||
|
||||
logState.subscribe((ids, flowIDs, event) => {
|
||||
setOperations(logState.getAll());
|
||||
|
||||
@@ -74,10 +74,14 @@ export const OperationTree = ({
|
||||
event === OperationEventType.EVENT_UPDATED
|
||||
) {
|
||||
for (const flowID of flowIDs) {
|
||||
backupInfoByFlowID.set(
|
||||
flowID,
|
||||
displayInfoForFlow(logState.getByFlowID(flowID) || [])
|
||||
const displayInfo = displayInfoForFlow(
|
||||
logState.getByFlowID(flowID) || []
|
||||
);
|
||||
if (!displayInfo.hidden) {
|
||||
backupInfoByFlowID.set(flowID, displayInfo);
|
||||
} else {
|
||||
backupInfoByFlowID.delete(flowID);
|
||||
}
|
||||
}
|
||||
} else if (event === OperationEventType.EVENT_DELETED) {
|
||||
for (const flowID of flowIDs) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
OpSelector,
|
||||
} from "../../gen/ts/v1/service_pb";
|
||||
import { SpinButton } from "../components/SpinButton";
|
||||
import { shouldHideStatus } from "../state/oplog";
|
||||
import { useShowModal } from "../components/ModalManager";
|
||||
|
||||
export const PlanView = ({ plan }: React.PropsWithChildren<{ plan: Plan }>) => {
|
||||
|
||||
@@ -10,9 +10,7 @@ import {
|
||||
GetOperationsRequest,
|
||||
OpSelector,
|
||||
} from "../../gen/ts/v1/service_pb";
|
||||
import { shouldHideStatus } from "../state/oplog";
|
||||
import { backrestService } from "../api";
|
||||
import { StringValue } from "@bufbuild/protobuf";
|
||||
import { SpinButton } from "../components/SpinButton";
|
||||
import { useConfig } from "../components/ConfigProvider";
|
||||
import { formatErrorAlert, useAlertApi } from "../components/Alerts";
|
||||
@@ -21,7 +19,7 @@ import { useShowModal } from "../components/ModalManager";
|
||||
const StatsPanel = React.lazy(() => import("../components/StatsPanel"));
|
||||
|
||||
export const RepoView = ({ repo }: React.PropsWithChildren<{ repo: Repo }>) => {
|
||||
const [config, setConfig] = useConfig();
|
||||
const [config, _] = useConfig();
|
||||
const showModal = useShowModal();
|
||||
const alertsApi = useAlertApi()!;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user