mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-06 02:33:48 +00:00
upload-limit v0.2 solved uploadLimitFormate issues , add helper for format_megabytes
This commit is contained in:
@@ -355,6 +355,23 @@ function format_gigabytes($gigabytes)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Format string to formated megabytes string
|
||||
*
|
||||
* @param $megabytes
|
||||
* @return string
|
||||
*/
|
||||
function format_megabytes($megabytes)
|
||||
{
|
||||
if ($megabytes >= 1000) {
|
||||
return $megabytes / 1000 . 'GB';
|
||||
} else if ($megabytes >= 1000000) {
|
||||
return $megabytes / 1000000 . 'TB';
|
||||
}else {
|
||||
return $megabytes . 'MB';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert megabytes to bytes
|
||||
*
|
||||
|
||||
@@ -74,5 +74,12 @@
|
||||
"/chunks/user-password.js": "/chunks/user-password.js?id=4d9e46c209e88d5f47ab",
|
||||
"/chunks/user-storage.js": "/chunks/user-storage.js?id=fafc88cef747e911e17b",
|
||||
"/chunks/user-subscription.js": "/chunks/user-subscription.js?id=106a3b5ccd6d467ac524",
|
||||
"/chunks/users.js": "/chunks/users.js?id=f213041c6b6095cd03e1"
|
||||
"/chunks/users.js": "/chunks/users.js?id=f213041c6b6095cd03e1",
|
||||
"/js/main.71c8bdcce2ae35287da6.hot-update.js": "/js/main.71c8bdcce2ae35287da6.hot-update.js",
|
||||
"/js/main.5292f123d34f349af3f6.hot-update.js": "/js/main.5292f123d34f349af3f6.hot-update.js",
|
||||
"/js/main.0d07f56ebf7453d2a627.hot-update.js": "/js/main.0d07f56ebf7453d2a627.hot-update.js",
|
||||
"/js/main.b8209d233d5b48391eac.hot-update.js": "/js/main.b8209d233d5b48391eac.hot-update.js",
|
||||
"/js/main.6a0eebfdcffa7d3cc808.hot-update.js": "/js/main.6a0eebfdcffa7d3cc808.hot-update.js",
|
||||
"/js/main.4a97328c7fcacdd01080.hot-update.js": "/js/main.4a97328c7fcacdd01080.hot-update.js",
|
||||
"/js/main.4e7d1c9c07d5a17b4380.hot-update.js": "/js/main.4e7d1c9c07d5a17b4380.hot-update.js"
|
||||
}
|
||||
|
||||
2
resources/js/helpers.js
vendored
2
resources/js/helpers.js
vendored
@@ -316,7 +316,7 @@ const Helpers = {
|
||||
events.$emit('alert:open', {
|
||||
emoji: '😟😟😟',
|
||||
title: i18n.t('popup_upload_limit.title'),
|
||||
message: i18n.t('popup_upload_limit.message', {uploadLimit: store.getters.config.uploadLimitPopup}),
|
||||
message: i18n.t('popup_upload_limit.message', {uploadLimit: store.getters.config.uploadLimitFormate}),
|
||||
})
|
||||
break
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@
|
||||
},
|
||||
"popup_upload_limit": {
|
||||
"title": "Oh No",
|
||||
"message": "Size of your uploaded file exceeds the upload limit ({uploadLimit} MB)."
|
||||
"message": "Size of your uploaded file exceeds the upload limit ({uploadLimit})."
|
||||
},
|
||||
"popup_mimetypes_blacklist": {
|
||||
"title": "Oh no",
|
||||
|
||||
@@ -501,7 +501,7 @@
|
||||
},
|
||||
"popup_upload_limit": {
|
||||
"title": "Oh No",
|
||||
"message": "Size of your uploaded file exceeds the upload limit ({uploadLimit} MB)."
|
||||
"message": "Size of your uploaded file exceeds the upload limit ({uploadLimit})."
|
||||
},
|
||||
"popup_mimetypes_blacklist": {
|
||||
"title": "Oh No",
|
||||
|
||||
@@ -501,7 +501,7 @@
|
||||
},
|
||||
"popup_upload_limit": {
|
||||
"title": "Je nám ľúto",
|
||||
"message": "Veľkosť nahravaneho súboru prekročila limit pre nahravane súbory ({uploadLimit} MB)"
|
||||
"message": "Veľkosť nahravaneho súboru prekročila limit pre nahravane súbory ({uploadLimit})"
|
||||
},
|
||||
"popup_mimetypes_blacklist": {
|
||||
"title": "Ospravelnujume sa",
|
||||
|
||||
2
resources/js/store/modules/fileFunctions.js
vendored
2
resources/js/store/modules/fileFunctions.js
vendored
@@ -133,7 +133,7 @@ const actions = {
|
||||
events.$emit('alert:open', {
|
||||
emoji: '😟😟😟',
|
||||
title: i18n.t('popup_upload_limit.title'),
|
||||
message: i18n.t('popup_upload_limit.message', {uploadLimit: getters.config.uploadLimitPopup})
|
||||
message: i18n.t('popup_upload_limit.message', {uploadLimit: getters.config.uploadLimitFormate})
|
||||
})
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
storageDefaultSpace: {{ isset($settings->storage_default) ? $settings->storage_default : 5 }},
|
||||
storageDefaultSpaceFormatted: '{{ isset($settings->storage_default) ? format_gigabytes($settings->storage_default) : format_gigabytes(5) }}',
|
||||
mimetypesBlacklist: '{{ isset($settings->mimetypes_blacklist) ? $settings->mimetypes_blacklist: null}}',
|
||||
uploadLimit: '{{ format_bytes(isset($settings->upload_limit) ? $settings->upload_limit: null)}}' ,
|
||||
uploadLimitPopup: '{{isset($settings->upload_limit)}}',
|
||||
uploadLimit: '{{ isset($settings->upload_limit) ? format_bytes($settings->upload_limit) : null }}',
|
||||
uploadLimitFormate: '{{ isset($settings->upload_limit) ? format_megabytes($settings->upload_limit) : null }}',
|
||||
|
||||
hasAuthCookie: {{ Cookie::has('token') ? 1 : 0 }},
|
||||
isSaaS: {{ isset($settings->license) && $settings->license === 'Extended' ? 1 : 0 }},
|
||||
|
||||
Reference in New Issue
Block a user