Skip to content

Commit

Permalink
fix: download and copy link
Browse files Browse the repository at this point in the history
  • Loading branch information
SalmaElsoly committed Aug 13, 2024
1 parent 57eb8ff commit 7791127
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions frontend/src/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@
</template>
<template #item.path_uri="{ value }">
<v-btn class="elevation-0">
<a :href="value" download>
<a :href="baseURL + `/` + value" download>
<v-icon icon="mdi-download" color="grey"></v-icon
></a>
<v-tooltip activator="parent" location="start"
>Download flist</v-tooltip
>
</v-btn>
<v-btn @click="copyLink(value)" class="elevation-0">
<v-btn @click="copyLink(baseURL + `/` + value)" class="elevation-0">
<v-icon icon="mdi-content-copy" color="grey"></v-icon>
<v-tooltip activator="parent">Copy Link</v-tooltip>
</v-btn>
Expand All @@ -95,8 +95,10 @@ import { useClipboard } from "@vueuse/core";
import { FlistsResponseInterface, FlistBody } from "../types/Flists.ts";
import { toast } from "vue3-toastify";
const baseURL = import.meta.env.VITE_API_URL;
const api = axios.create({
baseURL: import.meta.env.VITE_API_URL,
baseURL: baseURL,
headers: {
"Content-Type": "application/json",
},
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/UserFlist.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<template v-slot:item.path_uri="{ index, value }">
<template v-if="currentUserFlists[index].progress === 100">
<v-btn class="elevation-0">
<a :href="value" download>
<a :href="baseURL + `/` + value" download>
<v-icon icon="mdi-download" color="grey"></v-icon
></a>
<v-tooltip activator="parent" location="start"
>Download flist</v-tooltip
>
</v-btn>
<v-btn @click="copyLink(value)" class="elevation-0">
<v-btn @click="copyLink(baseURL + `/` + value)" class="elevation-0">
<v-icon icon="mdi-content-copy" color="grey"></v-icon>
<v-tooltip activator="parent">Copy Link</v-tooltip>
</v-btn>
Expand Down Expand Up @@ -71,8 +71,9 @@ const tableHeader = [
];
const loggedInUser = sessionStorage.getItem("username");
var flists = ref<FlistsResponseInterface>({});
const baseURL = import.meta.env.VITE_API_URL
const api = axios.create({
baseURL: import.meta.env.VITE_API_URL,
baseURL: baseURL,
headers: {
"Content-Type": "application/json",
},
Expand Down

0 comments on commit 7791127

Please sign in to comment.