diff --git a/src/main.js b/src/main.js index 14cb52f..983b468 100644 --- a/src/main.js +++ b/src/main.js @@ -14,8 +14,10 @@ import '@/assets/tailwind.css'; import Nora from '@primevue/themes/nora'; import axios from 'axios'; import { LoadingStore } from './stores/LoadingStore.js'; -axios.defaults.baseURL = import.meta.env.VITE_BACKEND_URL;//'http://localhost:8082' //' -console.log(import.meta.env.VITE_BACKEND_URL); + +//axios.defaults.baseURL = import.meta.env.VITE_BACKEND_URL; +axios.defaults.baseURL = 'http://localhost:8082' +console.log(axios.defaults.baseURL); diff --git a/src/service/KsVideoGroupService.js b/src/service/KsVideoGroupService.js index 5b6acaa..09a6f2b 100644 --- a/src/service/KsVideoGroupService.js +++ b/src/service/KsVideoGroupService.js @@ -23,5 +23,11 @@ export const KsVideoGroupService = { getVideoGroupById(id) { return axios.get(`/fe-api/video-group/${id}`); + }, + + getVideoCountByGroup(groupIds) { + return axios.get('/fe-api/ksvideos/video-count', { + params: { groupIds } + }); } }; diff --git a/src/stores/KsVideoGroupStore.js b/src/stores/KsVideoGroupStore.js index 425a173..198f910 100644 --- a/src/stores/KsVideoGroupStore.js +++ b/src/stores/KsVideoGroupStore.js @@ -5,6 +5,7 @@ import { KsVideoGroupService } from '../service/KsVideoGroupService'; export const KsVideoGroupStore = defineStore('ksvideogroup_store', () => { const lstKsVideoGroup = ref([]); const selectedKsVideoGroup = ref(null); + const videoCountsByGroup = ref([]); async function fetchKsVideoGroup(projectId) { try { @@ -20,6 +21,15 @@ export const KsVideoGroupStore = defineStore('ksvideogroup_store', () => { return lstKsVideoGroup.value; }); + async function fetchKsVideoGroupById(id) { + try { + const response = await KsVideoGroupService.getVideoGroupById(id); + selectedKsVideoGroup.value = response.data; + } catch (error) { + console.error('Error fetching video group by ID:', error); + } + } + const getSelectedKsVideoGroup = computed(() => { return selectedKsVideoGroup.value; }); @@ -29,12 +39,28 @@ export const KsVideoGroupStore = defineStore('ksvideogroup_store', () => { console.log('selectedVideoGroup', selectedKsVideoGroup.value); } + async function fetchVideoCountsByGroup(groupIds) { + try { + const response = await KsVideoGroupService.getVideoCountByGroup(groupIds); + videoCountsByGroup.value = response.data; + } catch (error) { + console.error('Error fetching video counts by group:', error); + } + } + + const getVideoCountsByGroup = computed(() => { + return videoCountsByGroup.value; + }); + return { fetchKsVideoGroup, selectedKsVideoGroup, lstKsVideoGroup, ksVideoGroup, getSelectedKsVideoGroup, - setSelectedKsVideoGroup + setSelectedKsVideoGroup, + fetchKsVideoGroupById, + getVideoCountsByGroup, + fetchVideoCountsByGroup }; }); diff --git a/src/views/pages/KsVideos/KsNewVideoForm.vue b/src/views/pages/KsVideos/KsNewVideoForm.vue index 95b138d..5d849d4 100644 --- a/src/views/pages/KsVideos/KsNewVideoForm.vue +++ b/src/views/pages/KsVideos/KsNewVideoForm.vue @@ -138,7 +138,7 @@
-

Wait until the upload is completed. You will be automatically redirected.

+

Wait until the upload is completed. You will be automatically redirected in few minutes.

@@ -291,13 +291,12 @@ onMounted(async () => { const fetchVideos = async () => { ksVideoStore.fetchKsVideoByGroupId(route.params.groupId).then(() => { ksVideos.value = (ksVideoStore.ksVideo || []); - console.log('ksVideos', ksVideos.value); }); }; const fetchGroupVideo = async () => { ksVideoGroupStore.fetchKsVideoGroupById(route.params.groupId).then(() => { - groupDocType.value = (ksVideoGroupStore.getSelectedKsVideoGroup.type || []); + groupDocType.value = (ksVideoGroupStore.getSelectedKsVideoGroup.type || ''); }); } diff --git a/src/views/pages/KsVideos/KsVideoGroup.vue b/src/views/pages/KsVideos/KsVideoGroup.vue index 80a9d00..03ca6c0 100644 --- a/src/views/pages/KsVideos/KsVideoGroup.vue +++ b/src/views/pages/KsVideos/KsVideoGroup.vue @@ -38,9 +38,20 @@ placeholder="Search By Name" /> + + + + + + + +