mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 09:48:44 +00:00
remove debugging
This commit is contained in:
1 parent
e6c66a39b1
commit
a3fb2a0a47
3 files changed
+48
-56
No files matched your search
@@ -10,15 +10,18 @@ import {
|
||||
} from "@fortawesome/pro-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
|
||||
import { deleteInferenceJob, inferenceJobs } from "~/pages/PageEnigma/store/inferenceJobs";
|
||||
import {
|
||||
deleteInferenceJob,
|
||||
inferenceJobs,
|
||||
} from "~/pages/PageEnigma/store/inferenceJobs";
|
||||
import { InferenceJob } from "~/pages/PageEnigma/models";
|
||||
|
||||
import { ButtonDialogue } from "../ButtonDialogue";
|
||||
import { ButtonIcon, H4,H6,P } from "~/components";
|
||||
import { ButtonIcon, H4, H6, P } from "~/components";
|
||||
import { JobState } from "~/hooks/useInferenceJobManager/useInferenceJobManager";
|
||||
|
||||
const printJobType = (jobType : string)=>{
|
||||
switch (jobType){
|
||||
const printJobType = (jobType: string) => {
|
||||
switch (jobType) {
|
||||
case "generic":
|
||||
return "Text to Speech";
|
||||
default:
|
||||
@@ -26,23 +29,23 @@ const printJobType = (jobType : string)=>{
|
||||
}
|
||||
};
|
||||
|
||||
const printJobStatus = (jobStatus : string)=>{
|
||||
switch (jobStatus){
|
||||
const printJobStatus = (jobStatus: string) => {
|
||||
switch (jobStatus) {
|
||||
case JobState.PENDING:
|
||||
return "Adding to the queue.";
|
||||
case JobState.STARTED:
|
||||
return "Processing, please wait...";
|
||||
case JobState.COMPLETE_SUCCESS:
|
||||
return "Completed! See Audio Panel for the result. file."
|
||||
return "Completed! See Audio Panel for the result. file.";
|
||||
default:
|
||||
return "Unknown Status";
|
||||
}
|
||||
};
|
||||
|
||||
const JobStatusIcon = ({jobStatus} : {jobStatus:string})=>{
|
||||
switch (jobStatus){
|
||||
case JobState.PENDING:{
|
||||
return(
|
||||
const JobStatusIcon = ({ jobStatus }: { jobStatus: string }) => {
|
||||
switch (jobStatus) {
|
||||
case JobState.PENDING: {
|
||||
return (
|
||||
<FontAwesomeIcon
|
||||
className="col-span-1 animate-spin"
|
||||
icon={faSpinner}
|
||||
@@ -50,17 +53,17 @@ const JobStatusIcon = ({jobStatus} : {jobStatus:string})=>{
|
||||
/>
|
||||
);
|
||||
}
|
||||
case JobState.STARTED:{
|
||||
return(
|
||||
<FontAwesomeIcon
|
||||
case JobState.STARTED: {
|
||||
return (
|
||||
<FontAwesomeIcon
|
||||
className="col-span-1 animate-spin"
|
||||
icon={faLoader}
|
||||
size="2xl"
|
||||
/>
|
||||
);
|
||||
}
|
||||
case JobState.COMPLETE_SUCCESS:{
|
||||
return(
|
||||
case JobState.COMPLETE_SUCCESS: {
|
||||
return (
|
||||
<FontAwesomeIcon
|
||||
className="col-span-1"
|
||||
icon={faCircleCheck}
|
||||
@@ -68,8 +71,8 @@ const JobStatusIcon = ({jobStatus} : {jobStatus:string})=>{
|
||||
/>
|
||||
);
|
||||
}
|
||||
default:{
|
||||
return(
|
||||
default: {
|
||||
return (
|
||||
<FontAwesomeIcon
|
||||
className="col-span-1"
|
||||
icon={faCircleExclamation}
|
||||
@@ -80,61 +83,56 @@ const JobStatusIcon = ({jobStatus} : {jobStatus:string})=>{
|
||||
}
|
||||
};
|
||||
|
||||
const InferenceItem = ({job}:{job:InferenceJob}) => {
|
||||
return(
|
||||
<li
|
||||
className="grid grid-cols-12 gap-2 items-center bg-brand-secondary rounded-md py-2 px-4"
|
||||
>
|
||||
const InferenceItem = ({ job }: { job: InferenceJob }) => {
|
||||
return (
|
||||
<li className="grid grid-cols-12 items-center gap-2 rounded-md bg-brand-secondary px-4 py-2">
|
||||
<JobStatusIcon jobStatus={job.job_status} />
|
||||
<div className="col-span-10 flex flex-col">
|
||||
<H4>{printJobType(job.job_type)}</H4>
|
||||
<H6>{printJobStatus(job.job_status)} </H6>
|
||||
<H4>{printJobType(job.job_type)}</H4>
|
||||
<H6>{printJobStatus(job.job_status)} </H6>
|
||||
</div>
|
||||
{job.job_status === JobState.COMPLETE_SUCCESS &&
|
||||
{job.job_status === JobState.COMPLETE_SUCCESS && (
|
||||
<div className="col-span-1 flex justify-end">
|
||||
<ButtonIcon
|
||||
icon={faSquareXmark}
|
||||
size="2xl"
|
||||
onClick={()=>{
|
||||
onClick={() => {
|
||||
deleteInferenceJob(job);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
)}
|
||||
</li>
|
||||
);
|
||||
};
|
||||
|
||||
export const DialogueInference = () =>{
|
||||
export const DialogueInference = () => {
|
||||
useSignals();
|
||||
|
||||
const buttonIcon = inferenceJobs.value.length > 0
|
||||
? faClipboardList : faClipboard;
|
||||
return(
|
||||
const buttonIcon =
|
||||
inferenceJobs.value.length > 0 ? faClipboardList : faClipboard;
|
||||
return (
|
||||
<ButtonDialogue
|
||||
title="My Jobs"
|
||||
dialogProps={{
|
||||
className:"w-1/2 max-w-full"
|
||||
className: "w-1/2 max-w-full",
|
||||
}}
|
||||
buttonProps={{
|
||||
icon: buttonIcon,
|
||||
variant: "secondary",
|
||||
label: "My Jobs",
|
||||
className:( inferenceJobs.value.length === 0 ? "invisible" : "visible")
|
||||
}}
|
||||
>
|
||||
{inferenceJobs.value.length > 0 &&
|
||||
className: inferenceJobs.value.length === 0 ? "invisible" : "visible",
|
||||
}}>
|
||||
{inferenceJobs.value.length > 0 && (
|
||||
<ul className="flex flex-col gap-2">
|
||||
{inferenceJobs.value.map(job=>
|
||||
{inferenceJobs.value.map((job) => (
|
||||
<InferenceItem key={job.job_id} job={job} />
|
||||
)}
|
||||
))}
|
||||
</ul>
|
||||
}
|
||||
{
|
||||
inferenceJobs.value.length === 0 &&
|
||||
)}
|
||||
{inferenceJobs.value.length === 0 && (
|
||||
<P>You currently have no running proccesses.</P>
|
||||
}
|
||||
)}
|
||||
</ButtonDialogue>
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -56,8 +56,7 @@ export const PageEditor = ({ setPage }: Props) => {
|
||||
<TopBar pageName="Edit Scene" />
|
||||
<div
|
||||
className="relative flex w-screen"
|
||||
style={{ height: "calc(100vh - 68px)" }}
|
||||
>
|
||||
style={{ height: "calc(100vh - 68px)" }}>
|
||||
{/* Engine section/side panel */}
|
||||
<div
|
||||
id="engine-n-panels-wrapper"
|
||||
@@ -65,23 +64,20 @@ export const PageEditor = ({ setPage }: Props) => {
|
||||
style={{
|
||||
height,
|
||||
width,
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
<div className="relative w-full overflow-hidden bg-transparent">
|
||||
<div
|
||||
className={
|
||||
appUiState.viewMode === APPUI_VIEW_MODES.SIDE_BY_SIDE
|
||||
? "invisible"
|
||||
: ""
|
||||
}
|
||||
>
|
||||
}>
|
||||
<canvas id="video-scene" width="1280px" height="720px" />
|
||||
|
||||
{/* Top controls */}
|
||||
<div
|
||||
className="absolute left-0 top-0 w-full"
|
||||
onClick={handleOverlayClick}
|
||||
>
|
||||
onClick={handleOverlayClick}>
|
||||
<div className="grid grid-cols-3 gap-4">
|
||||
<ControlsTopButtons />
|
||||
<Controls3D setPage={setPage} />
|
||||
@@ -97,8 +93,7 @@ export const PageEditor = ({ setPage }: Props) => {
|
||||
(sidePanelVisible.value ? sidePanelWidth.value : 0) -
|
||||
84,
|
||||
}}
|
||||
onClick={handleOverlayClick}
|
||||
>
|
||||
onClick={handleOverlayClick}>
|
||||
<PreviewEngineCamera />
|
||||
<ControlsVideo />
|
||||
<ControlPanelSceneObject />
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { State, Action, ACTION_TYPES } from "./types";
|
||||
|
||||
export function reducer(state: State, action: Action): State {
|
||||
console.log(action.type);
|
||||
switch (action.type) {
|
||||
case ACTION_TYPES.OPEN_DIALOGUE_TTS: {
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user