main.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Core,
  2. Dummy,
  3. Dashboard,
  4. GoogleDrive,
  5. Webcam,
  6. Tus10,
  7. MetaData,
  8. Informer } from '../src/index.js'
  9. // import ru_RU from '../src/locales/ru_RU.js'
  10. // import MagicLog from '../src/plugins/MagicLog'
  11. // import PersistentState from '../src/plugins/PersistentState'
  12. const uppy = new Core({debug: true, autoProceed: false})
  13. // .use(FileInput, {text: 'Выбрать файл', pretty: true})
  14. // .use(PersistentState)
  15. .use(Dashboard, {trigger: '#uppyModalOpener', inline: false})
  16. .use(GoogleDrive, {target: Dashboard, host: 'http://localhost:3020'})
  17. .use(Dummy, {target: Dashboard})
  18. .use(Webcam, {target: Dashboard})
  19. .use(Tus10, {endpoint: 'https://tusd.tus.io/files/', resume: true})
  20. .use(Informer, {target: Dashboard})
  21. .use(MetaData, {
  22. fields: [
  23. { id: 'resizeTo', name: 'Resize to', value: 1200, placeholder: 'specify future image size' },
  24. { id: 'description', name: 'Description', value: 'none', placeholder: 'describe what the file is for' }
  25. ]
  26. })
  27. uppy.run()
  28. uppy.on('core:success', (fileCount) => {
  29. console.log(fileCount)
  30. })
  31. // uppy.emit('informer', 'Smile!', 'info', 2000)
  32. document.querySelector('#uppyModalOpener').click()