-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pause and resume mirror buttons, along with state reflection (#1133)
not the most aligned button
- Loading branch information
1 parent
e6b18fd
commit a013eee
Showing
6 changed files
with
129 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { FlowStateChangeResponse } from '@/grpc_generated/route'; | ||
import { GetFlowHttpAddressFromEnv } from '@/rpc/http'; | ||
|
||
export async function POST(request: Request) { | ||
const body = await request.json(); | ||
const flowServiceAddr = GetFlowHttpAddressFromEnv(); | ||
console.log('/mirrors/state_change: req:', body); | ||
try { | ||
const res: FlowStateChangeResponse = await fetch( | ||
`${flowServiceAddr}/v1/mirrors/state_change`, | ||
{ | ||
method: 'POST', | ||
body: JSON.stringify(body), | ||
} | ||
).then((res) => { | ||
return res.json(); | ||
}); | ||
|
||
return new Response(JSON.stringify(res)); | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters