mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 01:38:44 +00:00
Merge pull request #532 from storytold/contdev/page/video_transfer
even better admin pabnel
This commit is contained in:
2 files changed
+10
-3
No files matched your search
+9
-3
@@ -1,7 +1,7 @@
|
||||
import React, {
|
||||
useState
|
||||
} from "react";
|
||||
|
||||
import { useHistory } from "react-router-dom";
|
||||
import {
|
||||
Accordion,
|
||||
Button,
|
||||
@@ -14,13 +14,17 @@ import { Action } from "../../reducer";
|
||||
import EnqueueVideoStyleTransfer from "@storyteller/components/src/api/video_styleTransfer";
|
||||
|
||||
export const CompAdminPanel = ({
|
||||
parentPath,
|
||||
vstValues,
|
||||
dispatchPageState
|
||||
}:{
|
||||
vstValues : VSTType
|
||||
parentPath: string;
|
||||
vstValues : VSTType;
|
||||
dispatchPageState: (action: Action) => void;
|
||||
})=>{
|
||||
const [jsonRequest, setJsonRequest] = useState<string>("{}");
|
||||
const history = useHistory();
|
||||
const exampleJSON = JSON.stringify(mapRequest(vstValues));
|
||||
const [jsonRequest, setJsonRequest] = useState<string>(exampleJSON);
|
||||
const handleSendRequest = ()=>{
|
||||
EnqueueVideoStyleTransfer(JSON.parse(jsonRequest)).then(res => {
|
||||
if (res.success && res.inference_job_token) {
|
||||
@@ -35,6 +39,8 @@ export const CompAdminPanel = ({
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
dispatchPageState({ type: "enqueueJob" });
|
||||
history.push(`${parentPath}/jobs`);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
+1
@@ -139,6 +139,7 @@ export default function PageVSTApp({
|
||||
</div>
|
||||
{debug &&
|
||||
<CompAdminPanel
|
||||
parentPath={parentPath}
|
||||
dispatchPageState={dispatchPageState}
|
||||
vstValues={vstValues}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user