Skip to content

Commit 1263867

Browse files
committed
Merge branch 'release/v2.4.6'
2 parents df4334c + 2bdd5ea commit 1263867

File tree

14 files changed

+806
-25
lines changed

14 files changed

+806
-25
lines changed

LICENSE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Aleksandr Manekin [email protected]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "laravel-file-manager",
3-
"version": "2.4.4",
3+
"version": "2.4.6",
44
"description": "File manager for Laravel",
55
"keywords": [
66
"laravel",

src/FileManager.vue

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ import Modal from './components/modals/Modal.vue';
4545
import InfoBlock from './components/blocks/InfoBlock.vue';
4646
import ContextMenu from './components/blocks/ContextMenu.vue';
4747
import Notification from './components/blocks/Notification.vue';
48+
// Mixins
49+
import translate from './mixins/translate';
4850
4951
export default {
5052
name: 'FileManager',
53+
mixins: [translate],
5154
components: {
5255
Navbar,
5356
FolderTree,
@@ -140,11 +143,18 @@ export default {
140143
// create notification, if find message text
141144
if (Object.prototype.hasOwnProperty.call(response.data, 'result')) {
142145
if (response.data.result.message) {
146+
const message = {
147+
status: response.data.result.status,
148+
message: Object.prototype.hasOwnProperty.call(this.lang.response, response.data.result.message)
149+
? this.lang.response[response.data.result.message]
150+
: response.data.result.message,
151+
};
152+
143153
// show notification
144-
EventBus.$emit('addNotification', response.data.result);
154+
EventBus.$emit('addNotification', message);
145155
146156
// set action result
147-
this.$store.commit('fm/messages/setActionResult', response.data.result);
157+
this.$store.commit('fm/messages/setActionResult', message);
148158
}
149159
}
150160
@@ -153,25 +163,45 @@ export default {
153163
// loading spinner -
154164
this.$store.commit('fm/messages/subtractLoading');
155165
156-
// set error message
157-
this.$store.commit('fm/messages/setError', error);
158-
159166
const errorMessage = {
167+
status: 0,
168+
message: '',
169+
};
170+
171+
const errorNotificationMessage = {
160172
status: 'error',
161173
message: '',
162174
};
163175
164176
// add message
165177
if (error.response) {
166-
errorMessage.message = error.response.data.message || error.response.statusText;
178+
errorMessage.status = error.response.status;
179+
180+
if (error.response.data.message) {
181+
const trMessage = Object.prototype.hasOwnProperty.call(this.lang.response, error.response.data.message)
182+
? this.lang.response[error.response.data.message]
183+
: error.response.data.message;
184+
185+
errorMessage.message = trMessage;
186+
errorNotificationMessage.message = trMessage;
187+
} else {
188+
errorMessage.message = error.response.statusText;
189+
errorNotificationMessage.message = error.response.statusText;
190+
}
167191
} else if (error.request) {
192+
errorMessage.status = error.request.status;
168193
errorMessage.message = error.request.statusText || 'Network error';
194+
errorNotificationMessage.message = error.request.statusText || 'Network error';
169195
} else {
170196
errorMessage.message = error.message;
197+
errorNotificationMessage.message = error.message;
171198
}
172199
200+
// set error message
201+
this.$store.commit('fm/messages/setError', errorMessage);
202+
173203
// show notification
174-
EventBus.$emit('addNotification', errorMessage);
204+
EventBus.$emit('addNotification', errorNotificationMessage);
175205
176206
return Promise.reject(error);
177207
});

src/lang/ar.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,33 @@ const ar = {
157157
cutToClipboard: 'قص إلى الحافظة!',
158158
copyToClipboard: 'نسخ إلى الحافظة!',
159159
},
160+
response: {
161+
noConfig: 'الاعدادت غير متوفرة!',
162+
notFound: 'غير متوفر!',
163+
diskNotFound: 'القرص غير موجود!',
164+
pathNotFound: 'مسار غير موجود!',
165+
diskSelected: 'تم اختيار القرص!',
166+
// files
167+
fileExist: 'الملف موجود بالفعل!',
168+
fileCreated: 'تم إنشاء الملف!',
169+
fileUpdated: 'تم تحديث الملف!',
170+
fileNotFound: 'الملف غير موجود!',
171+
// directories
172+
dirExist: 'المجلد موجود بالفعل!',
173+
dirCreated: 'تم أنشاء المجلد!',
174+
dirNotFound: 'المجلد غير موجود',
175+
// actions
176+
uploaded: 'تم تحديث كل الملفات!',
177+
notAllUploaded: 'بعض الملفات غير المحملة!',
178+
delNotFound: 'بعض الملفات غير موجودة! تحديث!',
179+
deleted: 'تم الحذف!',
180+
renamed: 'أعيدت تسميتها!',
181+
copied: 'تم النسخ بنجاح!',
182+
// zip
183+
zipError: 'خطأ في إنشاء الأرشيف!',
184+
// acl
185+
aclError: 'تم الرفض!',
186+
},
160187
};
161188

162189
export default ar;

src/lang/cs.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,33 @@ const cs = {
158158
cutToClipboard: 'Vyjmuto do schránky!',
159159
copyToClipboard: 'Zkopírováno do schránky!',
160160
},
161+
response: {
162+
noConfig: 'Konfigurace nebyla nalezena!',
163+
notFound: 'Nenalezeno!',
164+
diskNotFound: 'Disk nebyla nalezen!',
165+
pathNotFound: 'Cesta nebyla nalezena!',
166+
diskSelected: 'Disk byl vybrán!',
167+
// files
168+
fileExist: 'Soubor již existuje!',
169+
fileCreated: 'Soubor byl vytvořen!',
170+
fileUpdated: 'Soubor byl aktualizován!',
171+
fileNotFound: 'Soubor nebyl nalezen!',
172+
// directories
173+
dirExist: 'Složka již existuje!',
174+
dirCreated: 'Složka byla vytvořena!',
175+
dirNotFound: 'Složka nebyla nalezena',
176+
// actions
177+
uploaded: 'Všechny soubory byly nahrány!',
178+
notAllUploaded: 'Některé soubory nebyly nahrány!',
179+
delNotFound: 'Některé položky nebyly nalezeny!',
180+
deleted: 'Smazáno!',
181+
renamed: 'Přejmenováno!',
182+
copied: 'Úspěšně zkopírováno!',
183+
// zip
184+
zipError: 'Chyba při vytváření archivu!',
185+
// acl
186+
aclError: 'Přístup odepřen!',
187+
},
161188
};
162189

163190
export default cs;

src/lang/de.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,33 @@ const de = {
157157
cutToClipboard: 'Ausgeschnitten in die Zwischenablage!',
158158
copyToClipboard: 'Kopiert in die Zwischenablage!',
159159
},
160+
response: {
161+
noConfig: 'Konfiguration nicht gefunden!',
162+
notFound: 'Nicht gefunden!',
163+
diskNotFound: 'Festplatte nicht gefunden!',
164+
pathNotFound: 'Pfad nicht gefunden!',
165+
diskSelected: 'Festplatte ausgewählt!',
166+
// files
167+
fileExist: 'Datei existiert bereits!',
168+
fileCreated: 'Datei erstellt!',
169+
fileUpdated: 'Datei wurde aktualisiert!',
170+
fileNotFound: 'Datei nicht gefunden!',
171+
// directories
172+
dirExist: 'Ordner existiert bereits!',
173+
dirCreated: 'Ordner angelegt!',
174+
dirNotFound: 'Ordner nicht gefunden',
175+
// actions
176+
uploaded: 'Alle Dateien wurden hochgeladen!',
177+
notAllUploaded: 'Einige Dateien wurden nicht hochgeladen!',
178+
delNotFound: 'Einige Dateien wurden nicht gefunden!',
179+
deleted: 'Gelöscht!',
180+
renamed: 'Umbenannt!',
181+
copied: 'Erfolgreich kopiert!',
182+
// zip
183+
zipError: 'Fehler bei der Erstellung des Archivs!',
184+
// acl
185+
aclError: 'Zugriff verweigert!',
186+
},
160187
};
161188

162189
export default de;

src/lang/en.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,33 @@ const en = {
157157
cutToClipboard: 'Cut to clipboard!',
158158
copyToClipboard: 'Copied to clipboard!',
159159
},
160+
response: {
161+
noConfig: 'Config not found!',
162+
notFound: 'Not found!',
163+
diskNotFound: 'Disk not found!',
164+
pathNotFound: 'Path not found!',
165+
diskSelected: 'Disk selected!',
166+
// files
167+
fileExist: 'File already exists!',
168+
fileCreated: 'File created!',
169+
fileUpdated: 'File updated!',
170+
fileNotFound: 'File not found!',
171+
// directories
172+
dirExist: 'Directory already exists!',
173+
dirCreated: 'Directory created!',
174+
dirNotFound: 'Directory not found',
175+
// actions
176+
uploaded: 'All files uploaded!',
177+
notAllUploaded: 'Some files weren\'t uploaded!',
178+
delNotFound: 'Some items weren\'t founded!',
179+
deleted: 'Deleted!',
180+
renamed: 'Renamed!',
181+
copied: 'Copied successfully!',
182+
// zip
183+
zipError: 'Error creating archive!',
184+
// acl
185+
aclError: 'Access denied!',
186+
},
160187
};
161188

162189
export default en;

0 commit comments

Comments
 (0)