2020-01-24 10:27:35 +00:00
|
|
|
<template>
|
|
|
|
<div class="p-tab p-tab-photo-edit-files">
|
|
|
|
<v-data-table
|
|
|
|
:headers="listColumns"
|
|
|
|
:items="model.Files"
|
|
|
|
hide-actions
|
|
|
|
disable-initial-sort
|
2020-01-26 15:06:03 +00:00
|
|
|
class="elevation-0 p-files p-files-list p-results"
|
2020-01-24 10:27:35 +00:00
|
|
|
item-key="ID"
|
|
|
|
v-model="selected"
|
|
|
|
:no-data-text="this.$gettext('No files found')"
|
|
|
|
>
|
|
|
|
<template slot="items" slot-scope="props" class="p-file">
|
2020-01-26 15:06:03 +00:00
|
|
|
<td>
|
2020-04-13 17:45:38 +00:00
|
|
|
<a :href="'/api/v1/download/' + props.item.FileHash" class="secondary-dark--text" target="_blank" v-if="$config.feature('download')">
|
2020-01-26 15:06:03 +00:00
|
|
|
{{ props.item.FileName }}
|
|
|
|
</a>
|
2020-04-13 17:45:38 +00:00
|
|
|
<span v-else>
|
|
|
|
{{ props.item.FileName }}
|
|
|
|
</span>
|
2020-01-26 15:06:03 +00:00
|
|
|
</td>
|
2020-01-24 10:27:35 +00:00
|
|
|
<td>{{ props.item.FileWidth ? props.item.FileWidth : "" }}</td>
|
|
|
|
<td>{{ props.item.FileHeight ? props.item.FileHeight : "" }}</td>
|
2020-01-29 18:12:31 +00:00
|
|
|
<td>{{ fileType(props.item) }}</td>
|
|
|
|
<td>{{ fileStatus(props.item) }}</td>
|
2020-01-24 10:27:35 +00:00
|
|
|
</template>
|
|
|
|
</v-data-table>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'p-tab-photo-edit-files',
|
|
|
|
props: {
|
|
|
|
model: Object,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
config: this.$config.values,
|
|
|
|
readonly: this.$config.getValue("readonly"),
|
|
|
|
selected: [],
|
|
|
|
listColumns: [
|
2020-01-26 15:06:03 +00:00
|
|
|
{text: this.$gettext('Name'), value: 'FileName', sortable: false, align: 'left'},
|
|
|
|
{text: this.$gettext('Width'), value: 'FileWidth', sortable: false},
|
|
|
|
{text: this.$gettext('Height'), value: 'FileHeight', sortable: false},
|
2020-01-29 18:12:31 +00:00
|
|
|
{text: this.$gettext('Type'), value: '', sortable: false, align: 'left'},
|
|
|
|
{text: this.$gettext('Status'), value: '', sortable: false, align: 'left'},
|
2020-01-24 10:27:35 +00:00
|
|
|
],
|
|
|
|
};
|
|
|
|
},
|
2020-01-26 15:06:03 +00:00
|
|
|
computed: {},
|
2020-01-24 10:27:35 +00:00
|
|
|
methods: {
|
|
|
|
openPhoto() {
|
|
|
|
this.$viewer.show([this.model], 0)
|
|
|
|
},
|
2020-01-29 18:12:31 +00:00
|
|
|
fileType(file) {
|
|
|
|
if (file.FilePrimary) {
|
|
|
|
return this.$gettext("Primary");
|
|
|
|
} else if (file.FileVideo) {
|
|
|
|
return this.$gettext("Video");
|
|
|
|
} else if (file.FileSidecar) {
|
|
|
|
return this.$gettext("Sidecar");
|
|
|
|
}
|
|
|
|
|
|
|
|
return file.FileType.toUpperCase();
|
|
|
|
},
|
|
|
|
fileStatus(file) {
|
|
|
|
if (file.FileMissing) {
|
|
|
|
return this.$gettext("Missing");
|
|
|
|
} else if (file.FileError) {
|
|
|
|
return file.FileError;
|
|
|
|
} else if (file.Duplicate) {
|
|
|
|
return this.$gettext("Duplicate");
|
|
|
|
}
|
|
|
|
|
|
|
|
return "OK";
|
2020-01-24 10:27:35 +00:00
|
|
|
},
|
|
|
|
refresh() {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|