Files
directus/app/src/interfaces/files/index.ts
Rijk van Zanten 887601520b Add configurable page-size to files/o2m/m2m/m2a interfaces (#13772)
* Add configurable page-size to o2m/m2m/m2a interfaces

Ref #12818

* Add configurable page-size to files interface

* Update limit option to occupy half width

Co-authored-by: ian <licitdev@gmail.com>
2022-06-08 16:10:16 +08:00

85 lines
1.6 KiB
TypeScript

import { defineInterface } from '@directus/shared/utils';
import InterfaceFiles from './files.vue';
import PreviewSVG from './preview.svg?raw';
export default defineInterface({
id: 'files',
name: '$t:interfaces.files.files',
description: '$t:interfaces.files.description',
icon: 'note_add',
component: InterfaceFiles,
relational: true,
types: ['alias'],
localTypes: ['files'],
group: 'relational',
options: ({ relations }) => {
return [
{
field: 'folder',
name: '$t:interfaces.system-folder.folder',
type: 'uuid',
meta: {
width: 'full',
interface: 'system-folder',
note: '$t:interfaces.system-folder.field_hint',
},
schema: {
default_value: undefined,
},
},
{
field: 'template',
name: '$t:display_template',
meta: {
interface: 'system-display-template',
options: {
collectionName: relations.o2m?.collection,
},
},
},
{
field: 'enableCreate',
name: '$t:creating_items',
schema: {
default_value: true,
},
meta: {
interface: 'boolean',
options: {
label: '$t:enable_create_button',
},
width: 'half',
},
},
{
field: 'enableSelect',
name: '$t:selecting_items',
schema: {
default_value: true,
},
meta: {
interface: 'boolean',
options: {
label: '$t:enable_select_button',
},
width: 'half',
},
},
{
field: 'limit',
name: '$t:per_page',
type: 'integer',
meta: {
interface: 'input',
width: 'half',
},
schema: {
default_value: 15,
},
},
];
},
recommendedDisplays: ['related-values'],
preview: PreviewSVG,
});