mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-06 02:00:46 +00:00
can read inference job list
This commit is contained in:
1 parent
6434c18d3f
commit
0bff2dcf5c
2 files changed
+32
-8
No files matched your search
@@ -2,13 +2,17 @@ import { audioFilter, audioItems } from "~/pages/PageEnigma/store";
|
||||
import { AssetFilterOption } from "~/pages/PageEnigma/models";
|
||||
import { useSignals } from "@preact/signals-react/runtime";
|
||||
import { ItemElements } from "~/pages/PageEnigma/comps/SidePanelTabs/itemTabs/ItemElements";
|
||||
import { Button } from "~/components";
|
||||
import { Button, H4 } from "~/components";
|
||||
import { faCirclePlus } from "@fortawesome/pro-solid-svg-icons";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
import { inferenceJobs } from "~/pages/PageEnigma/store/inferenceJobs";
|
||||
|
||||
|
||||
export const AudioTabComponent = () => {
|
||||
useSignals();
|
||||
|
||||
const singals = useSignals();
|
||||
console.log('Audio Tab Component > Singals >>>')
|
||||
console.log(inferenceJobs);
|
||||
console.log('<<<');
|
||||
return (
|
||||
<>
|
||||
<div className="w-full overflow-x-auto">
|
||||
@@ -63,6 +67,19 @@ export const AudioTabComponent = () => {
|
||||
items={audioItems.value}
|
||||
assetFilter={audioFilter.value}
|
||||
/>
|
||||
|
||||
<H4 className="mt-10">inference jobs</H4>
|
||||
{inferenceJobs.value.length > 0 &&
|
||||
<ul>
|
||||
{inferenceJobs.value.map(job=>
|
||||
<li key={job.job_id}>{job.jobt_type}:{job.job_id}</li>
|
||||
)}
|
||||
</ul>
|
||||
}
|
||||
{
|
||||
inferenceJobs.value.length === 0 &&
|
||||
<p>no inference jobs</p>
|
||||
}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { signal } from "@preact/signals-core";
|
||||
|
||||
import Queue from "~/pages/PageEnigma/Queue/Queue";
|
||||
import { QueueNames } from "../Queue/QueueNames";
|
||||
import { toInferenceActions } from "../Queue/toInferenceActions";
|
||||
@@ -6,11 +8,16 @@ import { toInferenceActions } from "../Queue/toInferenceActions";
|
||||
|
||||
import { InferenceJob } from "../models";
|
||||
|
||||
export const inferenceJobs = signal<InferenceJob[]>([]);
|
||||
|
||||
export function addInferenceJob(
|
||||
inferenceJob: InferenceJob){
|
||||
Queue.publish({
|
||||
queueName: QueueNames.TO_INFERENCE,
|
||||
action: toInferenceActions.ADD_TTS_JOB,
|
||||
data: inferenceJob,
|
||||
});
|
||||
const existingInferenceJobs = inferenceJobs.value;
|
||||
|
||||
existingInferenceJobs.push(inferenceJob);
|
||||
// Queue.publish({
|
||||
// queueName: QueueNames.TO_INFERENCE,
|
||||
// action: toInferenceActions.ADD_TTS_JOB,
|
||||
// data: inferenceJob,
|
||||
// });
|
||||
}
|
||||
Reference in new issue
Block a user