main.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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. const uppy = new Core({debug: true, autoProceed: false})
  12. .use(Dashboard, {trigger: '#uppyModalOpener', inline: false})
  13. .use(GoogleDrive, {target: Dashboard, host: 'http://localhost:3020'})
  14. .use(Dummy, {target: Dashboard})
  15. .use(Webcam, {target: Dashboard})
  16. // .use(ProgressBar, {target: Dashboard})
  17. .use(Tus10, {endpoint: 'http://master.tus.io:8080/files/', resume: false})
  18. .use(Informer, {target: Dashboard})
  19. .use(MetaData, {
  20. fields: [
  21. { id: 'resizeTo', name: 'Resize to', value: 1200, placeholder: 'specify future image size' },
  22. { id: 'description', name: 'Description', value: 'none', placeholder: 'describe what the file is for' }
  23. ]
  24. })
  25. uppy.run()
  26. // uppy.emit('informer', 'Smile!', 'info', 2000)
  27. uppy.on('core:success', (fileCount) => {
  28. console.log(fileCount)
  29. })
  30. document.querySelector('#uppyModalOpener').click()