mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-23 06:45:22 -07:00
Fix asset link
This commit is contained in:
parent
785ab184af
commit
3000a446b1
2 changed files with 5 additions and 9 deletions
|
@ -160,7 +160,7 @@ export const recipeAPI = {
|
|||
},
|
||||
|
||||
recipeAssetPath(recipeSlug, assetName) {
|
||||
return `api/media/recipes/${recipeSlug}/assets/${assetName}`;
|
||||
return `/api/media/recipes/${recipeSlug}/assets/${assetName}`;
|
||||
},
|
||||
|
||||
/** Create comment in the Database
|
||||
|
|
|
@ -21,9 +21,7 @@
|
|||
<v-btn color="error" icon @click="deleteAsset(i)" top>
|
||||
<v-icon>{{ $globals.icons.delete }}</v-icon>
|
||||
</v-btn>
|
||||
<v-btn color="primary" icon @click="copyLink(item.name, item.fileName)" top>
|
||||
<v-icon>mdi-content-copy</v-icon>
|
||||
</v-btn>
|
||||
<TheCopyButton :copy-text="copyLink(item.name, item.fileName)" />
|
||||
</div>
|
||||
</v-list-item-action>
|
||||
</v-list-item>
|
||||
|
@ -60,6 +58,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import TheCopyButton from "@/components/UI/Buttons/TheCopyButton";
|
||||
import TheUploadBtn from "@/components/UI/Buttons/TheUploadBtn";
|
||||
import BaseDialog from "@/components/UI/Dialogs/BaseDialog";
|
||||
import { api } from "@/api";
|
||||
|
@ -67,6 +66,7 @@ export default {
|
|||
components: {
|
||||
BaseDialog,
|
||||
TheUploadBtn,
|
||||
TheCopyButton,
|
||||
},
|
||||
props: {
|
||||
slug: String,
|
||||
|
@ -132,11 +132,7 @@ export default {
|
|||
},
|
||||
copyLink(name, fileName) {
|
||||
const assetLink = api.recipes.recipeAssetPath(this.slug, fileName);
|
||||
const copyText = ``;
|
||||
navigator.clipboard.writeText(copyText).then(
|
||||
() => console.log("Copied", copyText),
|
||||
() => console.log("Copied Failed", copyText)
|
||||
);
|
||||
return `<img src="${window.location.origin}${assetLink}" height="100%" width="100%"> </img>`;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue