diff --git a/src/layout/AppMenu.vue b/src/layout/AppMenu.vue index 254ade5..def8d40 100644 --- a/src/layout/AppMenu.vue +++ b/src/layout/AppMenu.vue @@ -8,8 +8,9 @@ const model = ref([ label: 'Knowledge Source', items: [{ label: 'Documents', icon: 'pi pi-fw pi-id-card', to: '/ksdocuments' }, //{ label: 'Code Repository', icon: 'pi pi-fw pi-id-card', to: '/ks_git_repos' }, - { label: 'Code Repository', icon: 'pi pi-fw pi-id-card', to: '/ks_git_repos/ks_code_parser' }, + { label: 'Videos', icon: 'pi pi-fw pi-video', to: '/ksvideogroups' }, //{ label: 'Texts', icon: 'pi pi-fw pi-id-card', to: '/kstexts' } + { label: 'Code Repository', icon: 'pi pi-fw pi-code', to: '/ks_git_repos/ks_code_parser' } ] }, { diff --git a/src/router/index.js b/src/router/index.js index ff3d28a..015b73e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -28,6 +28,14 @@ const router = createRouter({ { path: 'new', name: 'ks-document-new', component: () => import('@/views/pages/ksDocuments/KsNewDocumentForm.vue') } ] }, + { + path: '/ksvideogroups', + children: [ + { path: '', name: 'ks-video-group', component: () => import('@/views/pages/KsVideos/KsVideoGroup.vue') }, + { path: 'videos/:groupId', name: 'ks-video', component: () => import('@/views/pages/KsVideos/KsVideos.vue') }, + { path: 'videos/:groupId/new', name: 'ks-video-new', component: () => import('@/views/pages/KsVideos/KsNewVideoForm.vue') } + ] + }, { path: '/ks_git_repos', children: [ diff --git a/src/service/KsVideoGroupService.js b/src/service/KsVideoGroupService.js new file mode 100644 index 0000000..5b6acaa --- /dev/null +++ b/src/service/KsVideoGroupService.js @@ -0,0 +1,27 @@ +import axios from 'axios'; + +export const KsVideoGroupService = { + getKsVideoGroups(projectId) { + return axios.get(`/fe-api/video-group/project`, { + params: { + projectId: projectId + } + }); + }, + + findByProjectId(projectId) { + return axios.get(`/fe-api/video-group/project/${projectId}`); + }, + + createVideoGroup(formData) { + return axios.post('/create_video_group', formData); + }, + + deleteVideoGroup(groupId) { + return axios.delete(`/delete/${groupId}`); + }, + + getVideoGroupById(id) { + return axios.get(`/fe-api/video-group/${id}`); + } +}; diff --git a/src/service/KsVideoService.js b/src/service/KsVideoService.js new file mode 100644 index 0000000..6d21eab --- /dev/null +++ b/src/service/KsVideoService.js @@ -0,0 +1,15 @@ +import axios from 'axios'; + +export const KsVideoService = { + getKsVideos() { + return axios.get('/fe-api/ksvideos'); + }, + + getKsVideosByGroupId(groupId) { + return axios.get(`/fe-api/ksvideos/group/${groupId}`); + }, + + downloadKsVideo(video) { + return axios.get(`/fe-api/ksvideos/downloadKSVideo`, video, {responseType: 'blob', }); + } +}; diff --git a/src/stores/KsVideoGroupStore.js b/src/stores/KsVideoGroupStore.js new file mode 100644 index 0000000..425a173 --- /dev/null +++ b/src/stores/KsVideoGroupStore.js @@ -0,0 +1,40 @@ +import { defineStore } from 'pinia'; +import { computed, ref } from 'vue'; +import { KsVideoGroupService } from '../service/KsVideoGroupService'; + +export const KsVideoGroupStore = defineStore('ksvideogroup_store', () => { + const lstKsVideoGroup = ref([]); + const selectedKsVideoGroup = ref(null); + + async function fetchKsVideoGroup(projectId) { + try { + const response = await KsVideoGroupService.getKsVideoGroups(projectId); + lstKsVideoGroup.value = response.data; + } catch (error) { + console.error('Error fetching video groups:', error); + } finally { + } + } + + const ksVideoGroup = computed(() => { + return lstKsVideoGroup.value; + }); + + const getSelectedKsVideoGroup = computed(() => { + return selectedKsVideoGroup.value; + }); + + async function setSelectedKsVideoGroup(group) { + selectedKsVideoGroup.value = group; + console.log('selectedVideoGroup', selectedKsVideoGroup.value); + } + + return { + fetchKsVideoGroup, + selectedKsVideoGroup, + lstKsVideoGroup, + ksVideoGroup, + getSelectedKsVideoGroup, + setSelectedKsVideoGroup + }; +}); diff --git a/src/stores/KsVideoStore.js b/src/stores/KsVideoStore.js new file mode 100644 index 0000000..36e9d48 --- /dev/null +++ b/src/stores/KsVideoStore.js @@ -0,0 +1,42 @@ +import { defineStore } from 'pinia'; +import { computed, ref } from 'vue'; +import { KsVideoService } from '../service/KsVideoService'; +import { LoadingStore } from './LoadingStore'; + +export const KsVideoStore = defineStore('ksvideo_store', () => { + + const lstKsVideo = ref([]) + const selectedKsVideo = ref(null) + const loadingStore = LoadingStore() + + + async function fetchKsVideoByGroupId(groupId) { + try { + const response = await KsVideoService.getKsVideosByGroupId(groupId); + lstKsVideo.value = response.data; + } catch (error) { + console.error('Error fetching videos by group:', error); + lstKsVideo.value = []; + } finally { + } + } + + const ksVideo = computed(() => { + return lstKsVideo.value; + }); + + const getKsVideoByGroupId = computed(() => { + return lstKsVideo.value; + }); + + const getSelectedKsVideo = computed(() => { + return selectedKsVideo.value; + }); + + async function setSelectedKsVideo(ksVideo) { + selectedKsVideo.value = ksVideo; + console.log('selectedExecScenario', selectedKsVideo.value); + } + + return {fetchKsVideoByGroupId, selectedKsVideo, lstKsVideo, ksVideo, getKsVideoByGroupId, getSelectedKsVideo, setSelectedKsVideo }; +}); diff --git a/src/views/pages/KsVideos/KsNewVideoForm.vue b/src/views/pages/KsVideos/KsNewVideoForm.vue new file mode 100644 index 0000000..ddeaeb6 --- /dev/null +++ b/src/views/pages/KsVideos/KsNewVideoForm.vue @@ -0,0 +1,444 @@ + + + + + diff --git a/src/views/pages/KsVideos/KsVideoGroup.vue b/src/views/pages/KsVideos/KsVideoGroup.vue new file mode 100644 index 0000000..80a9d00 --- /dev/null +++ b/src/views/pages/KsVideos/KsVideoGroup.vue @@ -0,0 +1,319 @@ + + + \ No newline at end of file diff --git a/src/views/pages/KsVideos/KsVideos.vue b/src/views/pages/KsVideos/KsVideos.vue new file mode 100644 index 0000000..7d31642 --- /dev/null +++ b/src/views/pages/KsVideos/KsVideos.vue @@ -0,0 +1,478 @@ + + + + + \ No newline at end of file diff --git a/src/views/pages/ksDocuments/KsDocuments.vue b/src/views/pages/ksDocuments/KsDocuments.vue index b2fb895..d5647e6 100644 --- a/src/views/pages/ksDocuments/KsDocuments.vue +++ b/src/views/pages/ksDocuments/KsDocuments.vue @@ -12,7 +12,7 @@ :globalFilterFields="['ingestionInfo.metadata.KsApplicationName', 'ingestionInfo.metadata.KsFileSources', 'ingestionInfo.metadata.KsDocSource', 'ingestionStatus', 'ingestionDateFormat']" tableStyle="min-width: 70rem" removableSort> - +