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) {
|
recipeAssetPath(recipeSlug, assetName) {
|
||||||
return `api/media/recipes/${recipeSlug}/assets/${assetName}`;
|
return `/api/media/recipes/${recipeSlug}/assets/${assetName}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** Create comment in the Database
|
/** Create comment in the Database
|
||||||
|
|
|
@ -21,9 +21,7 @@
|
||||||
<v-btn color="error" icon @click="deleteAsset(i)" top>
|
<v-btn color="error" icon @click="deleteAsset(i)" top>
|
||||||
<v-icon>{{ $globals.icons.delete }}</v-icon>
|
<v-icon>{{ $globals.icons.delete }}</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn color="primary" icon @click="copyLink(item.name, item.fileName)" top>
|
<TheCopyButton :copy-text="copyLink(item.name, item.fileName)" />
|
||||||
<v-icon>mdi-content-copy</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
</div>
|
||||||
</v-list-item-action>
|
</v-list-item-action>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
@ -60,6 +58,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import TheCopyButton from "@/components/UI/Buttons/TheCopyButton";
|
||||||
import TheUploadBtn from "@/components/UI/Buttons/TheUploadBtn";
|
import TheUploadBtn from "@/components/UI/Buttons/TheUploadBtn";
|
||||||
import BaseDialog from "@/components/UI/Dialogs/BaseDialog";
|
import BaseDialog from "@/components/UI/Dialogs/BaseDialog";
|
||||||
import { api } from "@/api";
|
import { api } from "@/api";
|
||||||
|
@ -67,6 +66,7 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
BaseDialog,
|
BaseDialog,
|
||||||
TheUploadBtn,
|
TheUploadBtn,
|
||||||
|
TheCopyButton,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
slug: String,
|
slug: String,
|
||||||
|
@ -132,11 +132,7 @@ export default {
|
||||||
},
|
},
|
||||||
copyLink(name, fileName) {
|
copyLink(name, fileName) {
|
||||||
const assetLink = api.recipes.recipeAssetPath(this.slug, fileName);
|
const assetLink = api.recipes.recipeAssetPath(this.slug, fileName);
|
||||||
const copyText = ``;
|
return `<img src="${window.location.origin}${assetLink}" height="100%" width="100%"> </img>`;
|
||||||
navigator.clipboard.writeText(copyText).then(
|
|
||||||
() => console.log("Copied", copyText),
|
|
||||||
() => console.log("Copied Failed", copyText)
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue