Skip to content

Commit

Permalink
spinner on enrich model (#4824)
Browse files Browse the repository at this point in the history
Co-authored-by: Cole Blanchard <[email protected]>
  • Loading branch information
blanchco and Cole Blanchard authored Sep 18, 2024
1 parent baeb58f commit c09f3ea
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ import {
mapAssetTypeToProvenanceType,
RelationshipType
} from '@/services/provenance';
import type { DocumentAsset, ProjectAsset, TerariumAsset } from '@/types/Types';
import { AssetType, ProvenanceType } from '@/types/Types';
import type { ClientEvent, DocumentAsset, ProjectAsset, TaskResponse, TerariumAsset } from '@/types/Types';
import { AssetType, ClientEventType, ProvenanceType, TaskStatus } from '@/types/Types';
import { isDocumentAsset } from '@/utils/asset';
import Button from 'primevue/button';
import RadioButton from 'primevue/radiobutton';
Expand All @@ -57,6 +57,7 @@ import { logger } from '@/utils/logger';
import { modelCard } from '@/services/goLLM';
import { useProjects } from '@/composables/project';
import TeraModal from '@/components/widgets/tera-modal.vue';
import { useClientEvent } from '@/composables/useClientEvent';
const props = defineProps<{
assetType: AssetType;
Expand All @@ -65,6 +66,18 @@ const props = defineProps<{
const emit = defineEmits(['finished-job']);
// Listen for the task completion event for models
useClientEvent(ClientEventType.TaskGollmModelCard, (event: ClientEvent<TaskResponse>) => {
const { modelId } = event.data?.additionalProperties || {};
const { status } = event.data || {};
if (props.assetType !== AssetType.Model || modelId !== props.assetId) {
return;
}
isLoading.value = ![TaskStatus.Success, TaskStatus.Failed, TaskStatus.Cancelled].includes(status);
});
enum DialogType {
ENRICH,
EXTRACT
Expand Down

0 comments on commit c09f3ea

Please sign in to comment.