Prechádzať zdrojové kódy

update website Dashboard example

Artur Paikin 7 rokov pred
rodič
commit
8a158c91db

+ 10 - 10
website/src/examples/dashboard/app.es6

@@ -38,33 +38,33 @@ function uppyInit () {
     target: opts.DashboardInline ? '.DashboardContainer' : 'body',
     note: opts.restrictions ? 'Images and video only, 2–3 files, up to 1 MB' : '',
     metaFields: [
-      { id: 'license', name: 'License', value: 'Creative Commons', placeholder: 'specify license' },
-      { id: 'caption', name: 'Caption', value: '', placeholder: 'describe what the image is about' }
+      { id: 'license', name: 'License', placeholder: 'specify license' },
+      { id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
     ]
   })
 
   if (opts.GoogleDrive) {
-    uppy.use(GoogleDrive, {target: Dashboard, host: UPPY_SERVER})
+    uppy.use(GoogleDrive, { target: Dashboard, host: UPPY_SERVER })
   }
 
   if (opts.Dropbox) {
-    uppy.use(Dropbox, {target: Dashboard, host: UPPY_SERVER})
+    uppy.use(Dropbox, { target: Dashboard, host: UPPY_SERVER })
   }
 
   if (opts.Instagram) {
-    uppy.use(Instagram, {target: Dashboard, host: UPPY_SERVER})
+    uppy.use(Instagram, { target: Dashboard, host: UPPY_SERVER })
   }
 
   if (opts.Webcam) {
-    uppy.use(Webcam, {target: Dashboard})
+    uppy.use(Webcam, { target: Dashboard })
   }
 
-  uppy.use(Tus, {endpoint: TUS_ENDPOINT, resume: true})
+  uppy.use(Tus, { endpoint: TUS_ENDPOINT, resume: true })
   uppy.run()
 
-  uppy.on('complete', (result) => {
-    console.log('Yo, uploaded: ')
-    console.log(result.successful)
+  uppy.on('complete', result => {
+    console.log('successful files:', result.successful)
+    console.log('failed files:', result.failed)
   })
 }
 

+ 10 - 9
website/src/examples/dashboard/index.ejs

@@ -43,18 +43,19 @@ const uppy = Uppy({
   target: '.DashboardContainer'
   note: 'Images and video only, 2–3 files, up to 1 MB',
   metaFields: [
-    { id: 'license', name: 'License', value: 'Creative Commons', placeholder: 'specify license' },
-    { id: 'caption', name: 'Caption', value: '', placeholder: 'describe what the image is about' }
+    { id: 'license', name: 'License', placeholder: 'specify license' },
+    { id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
   ]
 })
-.use(GoogleDrive, {target: Dashboard, host: 'https://server.uppy.io'})
-.use(Dropbox, {target: Dashboard, host: 'https://server.uppy.io'})
-.use(Instagram, {target: Dashboard, host: 'https://server.uppy.io'})
-.use(Webcam, {target: Dashboard})
-.use(Tus, {endpoint: 'https://master.tus.io/files/'})
+.use(GoogleDrive, { target: Dashboard, host: 'https://server.uppy.io' })
+.use(Dropbox, { target: Dashboard, host: 'https://server.uppy.io' })
+.use(Instagram, { target: Dashboard, host: 'https://server.uppy.io' })
+.use(Webcam, { target: Dashboard })
+.use(Tus, { endpoint: 'https://master.tus.io/files/' })
 .run()
 
-uppy.on('complete', (result) => {
-  console.log('Successfully uploaded:', result.successful)
+uppy.on('complete', result => {
+  console.log('successful files:', result.successful)
+  console.log('failed files:', result.failed)
 })
 {% endcodeblock %}