mirror of
				https://github.com/garethgeorge/backrest.git
				synced 2025-10-30 04:07:03 +00:00 
			
		
		
		
	fix: getOperationEvents use create EmptySchema not javascript empty object (#951)
This commit is contained in:
		| @@ -6,6 +6,8 @@ import { | ||||
| } from "../../gen/ts/v1/operations_pb"; | ||||
| import { GetOperationsRequest, OpSelector } from "../../gen/ts/v1/service_pb"; | ||||
| import { BackupProgressEntry, ResticSnapshot, RestoreProgressEntry } from "../../gen/ts/v1/restic_pb"; | ||||
| import { EmptySchema } from "../../gen/ts/types/value_pb"; | ||||
| import { create } from "@bufbuild/protobuf"; | ||||
| import _ from "lodash"; | ||||
| import { backrestService } from "../api"; | ||||
|  | ||||
| @@ -16,7 +18,7 @@ const subscribers: ((event?: OperationEvent, err?: Error) => void)[] = []; | ||||
|   while (true) { | ||||
|     let nextConnWaitUntil = new Date().getTime() + 5000; | ||||
|     try { | ||||
|       for await (const event of backrestService.getOperationEvents({})) { | ||||
|       for await (const event of backrestService.getOperationEvents(create(EmptySchema, {}))) { | ||||
|         console.log("operation event", event); | ||||
|         subscribers.forEach((subscriber) => subscriber(event, undefined)); | ||||
|       } | ||||
|   | ||||
| @@ -17,6 +17,8 @@ import { | ||||
|   SummaryDashboardResponse, | ||||
|   SummaryDashboardResponse_Summary, | ||||
| } from "../../gen/ts/v1/service_pb"; | ||||
| import { EmptySchema } from "../../gen/ts/types/value_pb"; | ||||
| import { create } from "@bufbuild/protobuf"; | ||||
| import { backrestService } from "../api"; | ||||
| import { useAlertApi } from "../components/Alerts"; | ||||
| import { | ||||
| @@ -65,7 +67,7 @@ export const SummaryDashboard = () => { | ||||
|       } | ||||
|  | ||||
|       try { | ||||
|         const data = await backrestService.getSummaryDashboard({}); | ||||
|         const data = await backrestService.getSummaryDashboard(create(EmptySchema, {})); | ||||
|         setSummaryData(data); | ||||
|       } catch (e) { | ||||
|         alertApi.error("Failed to fetch summary data: " + e); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ASNFalcon
					ASNFalcon