Skip to content

Commit

Permalink
Add upload maxFilesize configuration and update file type acceptance …
Browse files Browse the repository at this point in the history
…for uploads
  • Loading branch information
trheyi committed Nov 5, 2024
1 parent 05734fd commit a3e26d1
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions forms/hero.form.yao
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
{ "name": "Divider", "width": 24 },
{ "name": "Upload placeholder", "width": 24 },
{ "name": "Upload placeholderIcon", "width": 24 },
{ "name": "Upload maxFilesize", "width": 24 },
{ "name": "Divider", "width": 24 },
{ "name": "Upload previewURL", "width": 24 },
{ "name": "Upload previewURL Multiple", "width": 24 },
Expand Down Expand Up @@ -810,7 +811,7 @@
"type": "Upload",
"props": {
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"accept": "image/*",
"maxSize": "5M"
}
}
Expand All @@ -834,7 +835,7 @@
"type": "Upload",
"props": {
"filetype": "video",
"accept": ".mp4,.avi,.mov,.wmv",
"accept": "video/*",
"maxSize": "5M"
}
}
Expand All @@ -859,7 +860,6 @@
"props": {
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"maxSize": "5M",
"maxCount": 3
}
}
Expand All @@ -872,7 +872,6 @@
"props": {
"filetype": "audio",
"accept": ".mp3,.wav,.ogg",
"maxSize": "5M",
"maxCount": 3
}
}
Expand All @@ -885,7 +884,6 @@
"props": {
"filetype": "video",
"accept": ".mp4,.avi,.mov,.wmv",
"maxSize": "5M",
"maxCount": 3
}
}
Expand All @@ -898,7 +896,6 @@
"props": {
"filetype": "file",
"accept": ".doc,.docx,.pdf,.xls,.xlsx,.ppt,.pptx",
"maxSize": "5M",
"maxCount": 3
}
}
Expand All @@ -911,7 +908,6 @@
"props": {
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"maxSize": "5M",
"previewSize": { "width": 210, "height": 90 },
"placeholder": "Upload Cover"
}
Expand All @@ -925,7 +921,6 @@
"props": {
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"maxSize": "5M",
"previewSize": { "width": 210, "height": 90 },
"placeholder": "Upload Cover",
"maxCount": 20
Expand All @@ -940,7 +935,6 @@
"props": {
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"maxSize": "5M",
"previewSize": { "ratio": 1.33 },
"placeholder": "Upload Cover"
}
Expand All @@ -954,7 +948,6 @@
"props": {
"filetype": "video",
"accept": ".mp4,.avi,.mov,.wmv",
"maxSize": "5M",
"previewSize": { "width": 420, "height": 180 }
}
}
Expand All @@ -967,7 +960,6 @@
"props": {
"filetype": "video",
"accept": ".mp4,.avi,.mov,.wmv",
"maxSize": "5M",
"previewSize": {
"width": 420,
"height": 180,
Expand All @@ -985,7 +977,6 @@
"props": {
"filetype": "video",
"accept": ".mp4,.avi,.mov,.wmv",
"maxSize": "5M",
"previewSize": { "ratio": 2.33 }
}
}
Expand All @@ -998,7 +989,6 @@
"props": {
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"maxSize": "5M",
"placeholder": "Upload Cover"
}
}
Expand All @@ -1011,21 +1001,32 @@
"props": {
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"maxSize": "5M",
"placeholder": "Upload Cover",
"placeholderIcon": "icon-upload-cloud"
}
}
},

"Upload maxFilesize": {
"bind": "upload_max_filesize",
"edit": {
"type": "Upload",
"props": {
"placeholder": "Select Image less than 1M",
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"maxFilesize": "1M"
}
}
},

"Upload previewURL": {
"bind": "upload_preview_url",
"edit": {
"type": "Upload",
"props": {
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"maxSize": "5M",

// [[ $PATH ]] is the file path,
// [[ $TOKEN ]] is the admin panel user token
Expand All @@ -1046,7 +1047,6 @@
"props": {
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"maxSize": "5M",

// [[ $PATH ]] is the file path,
// [[ $TOKEN ]] is the admin panel user token
Expand All @@ -1067,7 +1067,7 @@
"type": "Upload",
"props": {
"filetype": "video",
"accept": ".mp4,.avi,.mov,.wmv",
"accept": "video/*",
"maxSize": "1G",
"chunkSize": "2M"
}
Expand All @@ -1081,7 +1081,6 @@
"props": {
"filetype": "image",
"accept": ".jpg,.jpeg,.png,.gif,.webp",
"maxSize": "5M",
"chunkSize": "200K",
"maxCount": 3
}
Expand Down

0 comments on commit a3e26d1

Please sign in to comment.