From b45841fff8a10ab5cf34e3a136f1daa6f7c91a93 Mon Sep 17 00:00:00 2001 From: jedi Date: Mon, 17 Jul 2023 15:53:26 +0200 Subject: [PATCH] stash --- frontend/src/components/CameraFileSource.vue | 76 ++++++++ frontend/src/components/CombinedFileField.vue | 170 ++++++++---------- .../src/components/DragDropFileSource.vue | 88 +++++++++ frontend/src/components/FsFileSource.vue | 59 ++++++ frontend/src/store.js | 2 +- frontend/src/views/InventoryEdit.vue | 14 ++ frontend/src/views/InventoryNew.vue | 12 ++ 7 files changed, 322 insertions(+), 99 deletions(-) create mode 100644 frontend/src/components/CameraFileSource.vue create mode 100644 frontend/src/components/DragDropFileSource.vue create mode 100644 frontend/src/components/FsFileSource.vue diff --git a/frontend/src/components/CameraFileSource.vue b/frontend/src/components/CameraFileSource.vue new file mode 100644 index 0000000..5a93a89 --- /dev/null +++ b/frontend/src/components/CameraFileSource.vue @@ -0,0 +1,76 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/CombinedFileField.vue b/frontend/src/components/CombinedFileField.vue index ef678f7..06ee839 100644 --- a/frontend/src/components/CombinedFileField.vue +++ b/frontend/src/components/CombinedFileField.vue @@ -1,33 +1,33 @@ \ No newline at end of file diff --git a/frontend/src/components/DragDropFileSource.vue b/frontend/src/components/DragDropFileSource.vue new file mode 100644 index 0000000..6646ef5 --- /dev/null +++ b/frontend/src/components/DragDropFileSource.vue @@ -0,0 +1,88 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/FsFileSource.vue b/frontend/src/components/FsFileSource.vue new file mode 100644 index 0000000..29bff9a --- /dev/null +++ b/frontend/src/components/FsFileSource.vue @@ -0,0 +1,59 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/store.js b/frontend/src/store.js index 211c4ef..1b70654 100644 --- a/frontend/src/store.js +++ b/frontend/src/store.js @@ -267,7 +267,7 @@ export default createStore({ async pushFile({state, dispatch, getters}, {item_id, file}) { const servers = await dispatch('getHomeServers') const data = await servers.post(getters.signAuth, '/api/item_files/'+item_id+'/', file) - if (data.mime_type) { + if (data.hash) { state.files.push(data) return data } diff --git a/frontend/src/views/InventoryEdit.vue b/frontend/src/views/InventoryEdit.vue index 881eb47..8aa31c9 100644 --- a/frontend/src/views/InventoryEdit.vue +++ b/frontend/src/views/InventoryEdit.vue @@ -6,6 +6,13 @@
Edit Item
+
+
    +
  • + {{ file.name }} ({{ file.hash }}) +
  • +
+
+
+ + +