Files.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div v-if="!files">None found or insufficient permissions...</div>
  3. <div v-else>
  4. <p>Files found:</p>
  5. <div
  6. v-for="(current, index) in files.keys"
  7. v-bind:key="index"
  8. class="message"
  9. >
  10. <p class="uppercase">{{ current }}</p>
  11. <ul>
  12. <li v-for="(file, index) in files[current]" v-bind:key="index">
  13. <FileDownload
  14. v-bind:endpoint="downloadService"
  15. v-bind:filename="file.filename"
  16. v-bind:fkey="file.fkey"
  17. v-bind:id="file.id"
  18. v-bind:repo="file.repo"
  19. ></FileDownload>
  20. </li>
  21. </ul>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import FileDownload from "@/components/FileDownload.vue";
  27. import { mapGetters } from "vuex";
  28. export default {
  29. name: "Files",
  30. components: {
  31. FileDownload
  32. },
  33. props: ["files"],
  34. computed: {
  35. ...mapGetters(["api", "readonly"]),
  36. downloadService: function() {
  37. return this.api.download;
  38. }
  39. }
  40. };
  41. </script>
  42. <style scoped>
  43. .uppercase {
  44. text-transform: uppercase;
  45. }
  46. </style>