diff --git a/src/App.vue b/src/App.vue index e86238a..03bb442 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,7 +6,7 @@ - + @@ -34,8 +34,9 @@ export default defineComponent({ return { darkTheme } }, computed: { - isHome() { - return this.$route.name == 'Home' + doesntNeedNav() { + let currentPage = this.$route.name + return !(currentPage == 'Home' || this.$route.name == 'CameraCapture') } } }) diff --git a/src/api/index.js b/src/api/index.js index 02df3fc..6b7a0f3 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -3,7 +3,7 @@ import axios from 'axios' const apiClient = axios.create({ baseURL: 'https://server.riezel.com/api/v1', withCredentials: false, - timeout: 2000, + timeout: 10000, headers: { Accept: 'application/json', 'Content-Type': 'application/json' @@ -52,4 +52,32 @@ export function getPhotosByGroup(group_id) { export function getPhotoLogPDF(id) { return apiClient.get('/generatephotolog/'+id+'/') +} + +export function addNewPhotoGroup(name, date) { + return apiClient.post('/addphotogroup/', { + name, + date + }) +} + +export function addNewPhoto(original_image, cropped_image=null, group_id=null, ocr_text=null, legacy_id=null) { + const data = new FormData() + + data.append('original_image', original_image, original_image.name) + + if (cropped_image !== null) + data.append('cropped_image', cropped_image, cropped_image.name) + if (group_id !== null) + data.append('group', group_id) + if (ocr_text !== null) + data.append('ocr_text', ocr_text) + if (legacy_id !== null) + data.append('legacy_id', legacy_id) + + const config = { + headers: { 'Content-Type': 'multipart/form-data' } + } + + return apiClient.post('/addphoto/', data, config) } \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index e76698a..01fde60 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4,6 +4,7 @@ import { createRouter, createWebHistory } from 'vue-router' import HomeView from '../views/Home.vue' import LogsList from '../views/LogsList.vue' import CreateLog from '../views/CreateLog.vue' +import CameraCapture from '../views/CameraCapture.vue' const routes = [ { @@ -27,7 +28,12 @@ const routes = [ } return {e} } - } + }, + { + path: '/capture', + name: 'CameraCapture', + component: CameraCapture + }, ] const router = createRouter({ diff --git a/src/views/CameraCapture.vue b/src/views/CameraCapture.vue new file mode 100644 index 0000000..2da1201 --- /dev/null +++ b/src/views/CameraCapture.vue @@ -0,0 +1,282 @@ + + + + + \ No newline at end of file diff --git a/src/views/Home.vue b/src/views/Home.vue index b35e84a..fbd1a3f 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -28,7 +28,14 @@ + New - Crop Photos + + + + + + + Crop Photos + @@ -36,9 +43,13 @@