mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 13:23:14 +01:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -205,7 +205,7 @@ func (ctrl *V1Controller) handleItemAttachmentsHandler(w http.ResponseWriter, r
|
|||||||
}(bucket)
|
}(bucket)
|
||||||
|
|
||||||
// Set the Content-Disposition header for RFC6266 compliance
|
// Set the Content-Disposition header for RFC6266 compliance
|
||||||
disposition := "attachment; filename*=UTF-8''" + url.QueryEscape(doc.Title)
|
disposition := "inline; filename*=UTF-8''" + url.QueryEscape(doc.Title)
|
||||||
w.Header().Set("Content-Disposition", disposition)
|
w.Header().Set("Content-Disposition", disposition)
|
||||||
http.ServeContent(w, r, doc.Title, doc.CreatedAt, file)
|
http.ServeContent(w, r, doc.Title, doc.CreatedAt, file)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -3639,7 +3639,7 @@ const docTemplate = `{
|
|||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"maxLength": 255
|
"maxLength": 1000
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
@@ -3637,7 +3637,7 @@
|
|||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"maxLength": 255
|
"maxLength": 1000
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
@@ -1012,7 +1012,7 @@ definitions:
|
|||||||
color:
|
color:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description:
|
||||||
maxLength: 255
|
maxLength: 1000
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
maxLength: 255
|
maxLength: 255
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ type LabelRepository struct {
|
|||||||
type (
|
type (
|
||||||
LabelCreate struct {
|
LabelCreate struct {
|
||||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||||
Description string `json:"description" validate:"max=255"`
|
Description string `json:"description" validate:"max=1000"`
|
||||||
Color string `json:"color"`
|
Color string `json:"color"`
|
||||||
}
|
}
|
||||||
|
|
||||||
LabelUpdate struct {
|
LabelUpdate struct {
|
||||||
ID uuid.UUID `json:"id"`
|
ID uuid.UUID `json:"id"`
|
||||||
Name string `json:"name" validate:"required,min=1,max=255"`
|
Name string `json:"name" validate:"required,min=1,max=255"`
|
||||||
Description string `json:"description" validate:"max=255"`
|
Description string `json:"description" validate:"max=1000"`
|
||||||
Color string `json:"color"`
|
Color string `json:"color"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3637,7 +3637,7 @@
|
|||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"maxLength": 255
|
"maxLength": 1000
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
@@ -1012,7 +1012,7 @@ definitions:
|
|||||||
color:
|
color:
|
||||||
type: string
|
type: string
|
||||||
description:
|
description:
|
||||||
maxLength: 255
|
maxLength: 1000
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
maxLength: 255
|
maxLength: 255
|
||||||
|
|||||||
@@ -42,6 +42,6 @@
|
|||||||
<MdiArrowUp class="hidden group-hover/label-chip:block" />
|
<MdiArrowUp class="hidden group-hover/label-chip:block" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ label.name.length > 20 ? `${label.name.substring(0, 20)}...` : label.name }}
|
{{ label.name }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<FormTextArea
|
<FormTextArea
|
||||||
v-model="form.description"
|
v-model="form.description"
|
||||||
:label="$t('components.label.create_modal.label_description')"
|
:label="$t('components.label.create_modal.label_description')"
|
||||||
:max-length="255"
|
:max-length="1000"
|
||||||
/>
|
/>
|
||||||
<ColorSelector v-model="form.color" :label="$t('components.label.create_modal.label_color')" :show-hex="true" />
|
<ColorSelector v-model="form.color" :label="$t('components.label.create_modal.label_color')" :show-hex="true" />
|
||||||
<div class="mt-4 flex flex-row-reverse">
|
<div class="mt-4 flex flex-row-reverse">
|
||||||
|
|||||||
@@ -7,16 +7,16 @@
|
|||||||
<TagsInput
|
<TagsInput
|
||||||
v-model="modelValue"
|
v-model="modelValue"
|
||||||
class="w-full gap-0 px-0"
|
class="w-full gap-0 px-0"
|
||||||
:display-value="v => shortenedLabels.find(l => l.id === v)?.name ?? 'Loading...'"
|
:display-value="v => props.labels.find(l => l.id === v)?.name ?? 'Loading...'"
|
||||||
>
|
>
|
||||||
<div class="flex flex-wrap items-center gap-2 px-3">
|
<div class="flex flex-wrap items-center gap-2 overflow-hidden px-3">
|
||||||
<TagsInputItem v-for="item in modelValue" :key="item" :value="item">
|
<TagsInputItem v-for="item in modelValue" :key="item" :value="item" class="h-auto overflow-hidden text-wrap">
|
||||||
<span
|
<span
|
||||||
v-if="shortenedLabels.find(l => l.id === item)?.color"
|
v-if="props.labels.find(l => l.id === item)?.color"
|
||||||
class="ml-2 inline-block size-4 rounded-full"
|
class="ml-2 size-4 shrink-0 rounded-full"
|
||||||
:style="{ backgroundColor: shortenedLabels.find(l => l.id === item)?.color }"
|
:style="{ backgroundColor: props.labels.find(l => l.id === item)?.color }"
|
||||||
/>
|
/>
|
||||||
<TagsInputItemText />
|
<TagsInputItemText class="py-0.5" />
|
||||||
<TagsInputItemDelete />
|
<TagsInputItemDelete />
|
||||||
</TagsInputItem>
|
</TagsInputItem>
|
||||||
</div>
|
</div>
|
||||||
@@ -61,9 +61,9 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="mr-2 inline-block size-4 rounded-full align-middle"
|
class="mr-2 size-4 shrink-0 rounded-full align-middle"
|
||||||
:class="{ border: shortenedLabels.find(l => l.id === label.value)?.color }"
|
:class="{ border: props.labels.find(l => l.id === label.value)?.color }"
|
||||||
:style="{ backgroundColor: shortenedLabels.find(l => l.id === label.value)?.color }"
|
:style="{ backgroundColor: props.labels.find(l => l.id === label.value)?.color }"
|
||||||
/>
|
/>
|
||||||
{{ label.label }}
|
{{ label.label }}
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
@@ -114,16 +114,9 @@
|
|||||||
const open = ref(false);
|
const open = ref(false);
|
||||||
const searchTerm = ref("");
|
const searchTerm = ref("");
|
||||||
|
|
||||||
const shortenedLabels = computed(() => {
|
|
||||||
return props.labels.map(l => ({
|
|
||||||
...l,
|
|
||||||
name: l.name.length > 20 ? `${l.name.substring(0, 20)}...` : l.name,
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
const filteredLabels = computed(() => {
|
const filteredLabels = computed(() => {
|
||||||
const filtered = fuzzysort
|
const filtered = fuzzysort
|
||||||
.go(searchTerm.value, shortenedLabels.value, { key: "name", all: true })
|
.go(searchTerm.value, props.labels, { key: "name", all: true })
|
||||||
.map(l => ({
|
.map(l => ({
|
||||||
value: l.obj.id,
|
value: l.obj.id,
|
||||||
label: l.obj.name,
|
label: l.obj.name,
|
||||||
|
|||||||
@@ -648,7 +648,7 @@ export interface ItemUpdate {
|
|||||||
|
|
||||||
export interface LabelCreate {
|
export interface LabelCreate {
|
||||||
color: string;
|
color: string;
|
||||||
/** @maxLength 255 */
|
/** @maxLength 1000 */
|
||||||
description: string;
|
description: string;
|
||||||
/**
|
/**
|
||||||
* @minLength 1
|
* @minLength 1
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
<FormTextArea
|
<FormTextArea
|
||||||
v-model="updateData.description"
|
v-model="updateData.description"
|
||||||
:label="$t('components.label.create_modal.label_description')"
|
:label="$t('components.label.create_modal.label_description')"
|
||||||
:max-length="255"
|
:max-length="1000"
|
||||||
/>
|
/>
|
||||||
<ColorSelector
|
<ColorSelector
|
||||||
v-model="updateData.color"
|
v-model="updateData.color"
|
||||||
|
|||||||
Reference in New Issue
Block a user