fix: Asset type selector dropdown #6413; asset entry layout; asset download content disposition (#6595)

Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
Simon Lam
2025-11-29 10:13:26 -06:00
committed by GitHub
parent 07ecd88685
commit 5b65ceda93
2 changed files with 11 additions and 10 deletions

View File

@@ -28,11 +28,12 @@
<v-list-item-title class="pl-2"> <v-list-item-title class="pl-2">
{{ item.name }} {{ item.name }}
</v-list-item-title> </v-list-item-title>
<v-list-item-action> <template #append>
<v-btn <v-btn
v-if="!edit" v-if="!edit"
color="primary" color="primary"
icon icon
size="small"
:href="assetURL(item.fileName ?? '')" :href="assetURL(item.fileName ?? '')"
target="_blank" target="_blank"
top top
@@ -43,6 +44,7 @@
<v-btn <v-btn
color="error" color="error"
icon icon
size="small"
top top
@click="model.splice(i, 1)" @click="model.splice(i, 1)"
> >
@@ -53,7 +55,7 @@
:copy-text="assetEmbed(item.fileName ?? '')" :copy-text="assetEmbed(item.fileName ?? '')"
/> />
</div> </div>
</v-list-item-action> </template>
</v-list-item> </v-list-item>
</v-list> </v-list>
</v-card> </v-card>
@@ -90,13 +92,12 @@
item-value="name" item-value="name"
class="mr-2" class="mr-2"
> >
<template #item="{ item }"> <template #item="{ item, props }">
<v-avatar> <v-list-item v-bind="props">
<v-icon class="mr-auto"> <template #prepend>
{{ item.raw.icon }} <v-icon>{{ item.raw.icon }}</v-icon>
</v-icon> </template>
</v-avatar> </v-list-item>
{{ item.title }}
</template> </template>
</v-select> </v-select>
<AppButtonUpload <AppButtonUpload

View File

@@ -54,6 +54,6 @@ async def get_recipe_asset(recipe_id: UUID4, file_name: str):
file = Recipe.directory_from_id(recipe_id).joinpath("assets", file_name) file = Recipe.directory_from_id(recipe_id).joinpath("assets", file_name)
try: try:
return FileResponse(file) return FileResponse(file, content_disposition_type="attachment", filename=file_name)
except Exception as e: except Exception as e:
raise HTTPException(status.HTTP_404_NOT_FOUND) from e raise HTTPException(status.HTTP_404_NOT_FOUND) from e