mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 02:24:24 +00:00
Frontend: Enhance download settings for files and albums #848
This commit is contained in:
parent
98a6a452ae
commit
a9164cee62
3 changed files with 150 additions and 6 deletions
|
|
@ -503,3 +503,9 @@ export const Orientations = () => [
|
|||
];
|
||||
|
||||
export const AccountTypes = () => [{ value: "webdav", text: $gettext("WebDAV") }];
|
||||
|
||||
export const DownloadName = () => [
|
||||
{ value: "file", text: $gettext("File Name") },
|
||||
{ value: "original", text: $gettext("Original Name") },
|
||||
{ value: "share", text: $gettext("Share Identifier") },
|
||||
];
|
||||
|
|
|
|||
|
|
@ -164,16 +164,31 @@
|
|||
</v-card-actions>
|
||||
</v-card>
|
||||
|
||||
<v-card v-if="settings.features.library && settings.features.download" flat tile class="mt-0 px-1 bg-background">
|
||||
<v-card v-if="canChangeDownloads && (settings.features.download || settings.download.disabled)" flat tile class="mt-0 px-1 bg-background">
|
||||
<v-card-title class="pb-0 text-subtitle-2">
|
||||
{{ $gettext(`Download`) }}
|
||||
{{ $gettext(`File Downloads`) }}
|
||||
</v-card-title>
|
||||
|
||||
<v-card-actions>
|
||||
<v-row align="start" dense>
|
||||
<v-col cols="12" sm="4" class="px-2 pb-2 pt-2">
|
||||
<v-col v-if="isSuperAdmin" cols="12" sm="6" md="4" lg="2" class="px-2 pb-2 pt-2">
|
||||
<v-checkbox
|
||||
v-model="settings.download.disabled"
|
||||
class="ma-0 pa-0 input-download-disabled"
|
||||
density="compact"
|
||||
:label="$gettext('Disabled')"
|
||||
:hint="$gettext('Prevent downloading of individual files through the web interface.')"
|
||||
prepend-icon="mdi-cancel"
|
||||
persistent-hint
|
||||
@update:model-value="onChange"
|
||||
>
|
||||
</v-checkbox>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="6" md="4" :lg="isSuperAdmin ? 2 : 4" class="px-2 pb-2 pt-2">
|
||||
<v-checkbox
|
||||
v-model="settings.download.originals"
|
||||
:disabled="settings.download.disabled"
|
||||
class="ma-0 pa-0 input-download-originals"
|
||||
density="compact"
|
||||
:label="$gettext('Originals')"
|
||||
|
|
@ -185,9 +200,10 @@
|
|||
</v-checkbox>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="4" class="px-2 pb-2 pt-2">
|
||||
<v-col cols="12" sm="6" md="4" :lg="isSuperAdmin ? 2 : 4" class="px-2 pb-2 pt-2">
|
||||
<v-checkbox
|
||||
v-model="settings.download.mediaRaw"
|
||||
:disabled="settings.download.disabled"
|
||||
class="ma-0 pa-0 input-download-raw"
|
||||
density="compact"
|
||||
:label="$gettext('RAW')"
|
||||
|
|
@ -199,9 +215,10 @@
|
|||
</v-checkbox>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="4" class="px-2 pb-2 pt-2">
|
||||
<v-col cols="12" sm="6" md="4" :lg="isSuperAdmin ? 2 : 4" class="px-2 pb-2 pt-2">
|
||||
<v-checkbox
|
||||
v-model="settings.download.mediaSidecar"
|
||||
:disabled="settings.download.disabled"
|
||||
class="ma-0 pa-0 input-download-sidecar"
|
||||
density="compact"
|
||||
:label="$gettext('Sidecar')"
|
||||
|
|
@ -212,6 +229,112 @@
|
|||
>
|
||||
</v-checkbox>
|
||||
</v-col>
|
||||
|
||||
<v-col v-if="isSuperAdmin" cols="12" sm="6" md="4" lg="4" class="px-2 pb-2 pt-2">
|
||||
<v-select
|
||||
v-model="settings.download.name"
|
||||
:disabled="busy || settings.download.disabled"
|
||||
:items="options.DownloadName()"
|
||||
item-title="text"
|
||||
item-value="value"
|
||||
:label="$gettext('Name')"
|
||||
:hint="$gettext('File naming convention for downloads.')"
|
||||
:menu-props="{ maxHeight: 346 }"
|
||||
persistent-hint
|
||||
class="input-download-name"
|
||||
@update:model-value="onChange"
|
||||
></v-select>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
|
||||
<v-card
|
||||
v-if="canChangeDownloads && (settings.features.download || settings.download.disabled || settings.albums.download.disabled)"
|
||||
flat
|
||||
tile
|
||||
class="mt-0 px-1 bg-background"
|
||||
>
|
||||
<v-card-title class="pb-0 text-subtitle-2">
|
||||
{{ $gettext(`Album Downloads`) }}
|
||||
</v-card-title>
|
||||
|
||||
<v-card-actions>
|
||||
<v-row align="start" dense>
|
||||
<v-col v-if="isSuperAdmin" cols="12" sm="6" md="4" lg="2" class="px-2 pb-2 pt-2">
|
||||
<v-checkbox
|
||||
v-model="settings.albums.download.disabled"
|
||||
class="ma-0 pa-0 input-album-download-disabled"
|
||||
density="compact"
|
||||
:label="$gettext('Disabled')"
|
||||
:hint="$gettext('Prevent downloading of album archives through the web interface.')"
|
||||
prepend-icon="mdi-cancel"
|
||||
persistent-hint
|
||||
@update:model-value="onChange"
|
||||
>
|
||||
</v-checkbox>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="6" md="4" :lg="isSuperAdmin ? 2 : 4" class="px-2 pb-2 pt-2">
|
||||
<v-checkbox
|
||||
v-model="settings.albums.download.originals"
|
||||
:disabled="settings.albums.download.disabled"
|
||||
class="ma-0 pa-0 input-album-download-originals"
|
||||
density="compact"
|
||||
:label="$gettext('Originals')"
|
||||
:hint="$gettext('Include only original files in album archives.')"
|
||||
prepend-icon="mdi-camera"
|
||||
persistent-hint
|
||||
@update:model-value="onChange"
|
||||
>
|
||||
</v-checkbox>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="6" md="4" :lg="isSuperAdmin ? 2 : 4" class="px-2 pb-2 pt-2">
|
||||
<v-checkbox
|
||||
v-model="settings.albums.download.mediaRaw"
|
||||
:disabled="settings.albums.download.disabled"
|
||||
class="ma-0 pa-0 input-album-download-raw"
|
||||
density="compact"
|
||||
:label="$gettext('RAW')"
|
||||
:hint="$gettext('Include RAW image files in album archives.')"
|
||||
prepend-icon="mdi-raw"
|
||||
persistent-hint
|
||||
@update:model-value="onChange"
|
||||
>
|
||||
</v-checkbox>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="6" md="4" :lg="isSuperAdmin ? 2 : 4" class="px-2 pb-2 pt-2">
|
||||
<v-checkbox
|
||||
v-model="settings.albums.download.mediaSidecar"
|
||||
:disabled="settings.albums.download.disabled"
|
||||
class="ma-0 pa-0 input-album-download-sidecar"
|
||||
density="compact"
|
||||
:label="$gettext('Sidecar')"
|
||||
:hint="$gettext('Include sidecar files in album archives.')"
|
||||
prepend-icon="mdi-paperclip"
|
||||
persistent-hint
|
||||
@update:model-value="onChange"
|
||||
>
|
||||
</v-checkbox>
|
||||
</v-col>
|
||||
|
||||
<v-col v-if="isSuperAdmin" cols="12" sm="6" md="4" lg="4" class="px-2 pb-2 pt-2">
|
||||
<v-select
|
||||
v-model="settings.albums.download.name"
|
||||
:disabled="busy || settings.albums.download.disabled"
|
||||
:items="options.DownloadName()"
|
||||
item-title="text"
|
||||
item-value="value"
|
||||
:label="$gettext('Name')"
|
||||
:hint="$gettext('File naming convention for album downloads.')"
|
||||
:menu-props="{ maxHeight: 346 }"
|
||||
persistent-hint
|
||||
class="input-album-download-name"
|
||||
@update:model-value="onChange"
|
||||
></v-select>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
|
|
@ -232,10 +355,14 @@ export default {
|
|||
PAboutFooter,
|
||||
},
|
||||
data() {
|
||||
// Determine if user can change download settings (admins and users, not restricted roles).
|
||||
const canChangeDownloads = this.$session.isAdmin() || (this.$session.isUser() && !this.$session.hasScope());
|
||||
|
||||
return {
|
||||
isDemo: this.$config.isDemo(),
|
||||
isAdmin: this.$session.isAdmin(),
|
||||
isSuperAdmin: this.$session.isSuperAdmin(),
|
||||
canChangeDownloads: canChangeDownloads,
|
||||
readonly: this.$config.get("readonly"),
|
||||
experimental: this.$config.get("experimental"),
|
||||
config: this.$config.values,
|
||||
|
|
|
|||
|
|
@ -37,11 +37,22 @@ export default class Page {
|
|||
this.dateTimeStacksCheckbox = Selector(".input-stack-meta div.v-selection-control__input");
|
||||
this.uuidStacksCheckbox = Selector(".input-stack-uuid div.v-selection-control__input");
|
||||
this.nameStacksCheckbox = Selector(".input-stack-name div.v-selection-control__input");
|
||||
this.downloadRawCheckbox = Selector(".input-download-raw div.v-selection-control__input");
|
||||
this.hideTitlesCheckbox = Selector(".input-search-titles div.v-selection-control__input");
|
||||
this.hideCaptionsCheckbox = Selector(".input-search-captions div.v-selection-control__input");
|
||||
this.hideListViewCheckbox = Selector(".input-search-listview div.v-selection-control__input");
|
||||
|
||||
this.downloadDisabledCheckbox = Selector(".input-download-disabled div.v-selection-control__input");
|
||||
this.downloadNameSelect = Selector(".input-download-name div.v-input__control");
|
||||
this.downloadOriginalsCheckbox = Selector(".input-download-originals div.v-selection-control__input");
|
||||
this.downloadRawCheckbox = Selector(".input-download-raw div.v-selection-control__input");
|
||||
this.downloadSidecarCheckbox = Selector(".input-download-sidecar div.v-selection-control__input");
|
||||
|
||||
this.albumDownloadDisabledCheckbox = Selector(".input-album-download-disabled div.v-selection-control__input");
|
||||
this.albumDownloadNameSelect = Selector(".input-album-download-name div.v-input__control");
|
||||
this.albumDownloadOriginalsCheckbox = Selector(".input-album-download-originals div.v-selection-control__input");
|
||||
this.albumDownloadRawCheckbox = Selector(".input-album-download-raw div.v-selection-control__input");
|
||||
this.albumDownloadSidecarCheckbox = Selector(".input-album-download-sidecar div.v-selection-control__input");
|
||||
|
||||
this.advancedTab = Selector("#tab-settings_advanced");
|
||||
this.debugCheckbox = Selector("label").withText("Debug Logs");
|
||||
this.backupCheckbox = Selector("label").withText("Disable Backups");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue