Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 984 Bytes

File metadata and controls

33 lines (22 loc) · 984 Bytes

Installation

Switch to node v18.16.0 (using .nvmrc) :

nvm use

Install and build :

npm ci
npm run build

Then, move the built dist/index.js file into a new directory of your extensions/interfaces, for example extensions/interfaces/uuid-file-image/index.js.

That's it!

If you use docker, don't forget to mount the interfaces volume pointing to the directory containing uuid-file-image/index.js:

    volumes:
      - ./path/to/local/interfaces:/directus/extensions/interfaces/

Example of usage in a JSON repeater field

Capture d’écran 2021-11-23 à 09 57 53

To do (next version)

When the file's selected, I currently set in uuid field the filename_disk key of the file.

I wanted this to be set by the user into interface options (props.file_key_to_get: String), but I didn't added it yet in src/index.ts.