From 2e9ec3cbc00a79284c6348a3df352c1ec67c95f1 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 26 Apr 2024 01:50:12 -0400 Subject: [PATCH] Reorganized model URLs and added filter by model URL. --- frontend/src/components/CAMKPFrontend.vue | 10 ++-- frontend/src/components/DisplayCAM.vue | 20 ++++---- frontend/src/components/SearchCAMs.vue | 57 ++++++++++++++++------- 3 files changed, 53 insertions(+), 34 deletions(-) diff --git a/frontend/src/components/CAMKPFrontend.vue b/frontend/src/components/CAMKPFrontend.vue index f449757..6e03f57 100644 --- a/frontend/src/components/CAMKPFrontend.vue +++ b/frontend/src/components/CAMKPFrontend.vue @@ -5,12 +5,12 @@ import SearchCAMs from "./SearchCAMs.vue"; // Some editable const automatCAMKPEndpoint = ref("https://automat.renci.org/cam-kp") -const selectedModel = ref({}) -const searchIds = ref([]); +const selectedModelURL = ref('') +const searchIds = ref>(new Set()); -function changeSelectedModel(modelName: string) { +function changeSelectedModel(modelURL: string) { // Allows other components to change the selected model. - selectedModel.value = modelName; + selectedModelURL.value = modelURL; } function changeSearchIds(searchIdList: string[]) { @@ -41,7 +41,7 @@ function changeSearchIds(searchIdList: string[]) {
- +
diff --git a/frontend/src/components/DisplayCAM.vue b/frontend/src/components/DisplayCAM.vue index dcd4e95..785e0e7 100644 --- a/frontend/src/components/DisplayCAM.vue +++ b/frontend/src/components/DisplayCAM.vue @@ -4,7 +4,7 @@ import {urlToID} from "./shared.ts"; export interface Props { automatCAMKPEndpoint?: string, - selectedModel: object, + selectedModelURL: string, searchIds: Set, } @@ -13,8 +13,6 @@ const props = withDefaults(defineProps(), { searchIDs: new Set(), }); -const modelNotSelected = computed(() => !('url' in props.selectedModel)); - const downloadInProgress = ref(false); const modelRows = ref([]); const spos = ref([]); @@ -32,9 +30,7 @@ function getPredicates(fromId: string, toId: string) { }).sort(); } -watch(() => props.selectedModel, (_, model) => { - const modelURL = model.url; - +watch(() => props.selectedModelURL, (_, modelURL) => { modelRows.value = []; spos.value = []; labels.value = {}; @@ -85,7 +81,7 @@ async function getModelRows(modelURL: string) {