This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class FileController extends Controller | |
| { | |
| /** | |
| * Constructor | |
| */ | |
| public function __construct() | |
| { | |
| $this->middleware('auth'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <img v-if="file === editingFile" src="" :src="'{{ asset('storage/' . Auth::user()->name . '_' . Auth::id()) }}' + '/' + savedFile.type + '/' + savedFile.name + '.' + savedFile.extension" :alt="file.name"> | |
| <img v-if="file !== editingFile" src="" :src="'{{ asset('storage/' . Auth::user()->name . '_' . Auth::id()) }}' + '/' + file.type + '/' + file.name + '.' + file.extension" :alt="file.name"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <style type="text/css">@import url("style.css");</style> | |
| <style type="text/css">@import url("bulma.min.css");</style> | |
| <?php | |
| // Define main variables | |
| $im_folders = array('images', 'images10', 'images35', 'images_t', 'images_hq'); | |
| /** | |
| * Select server | |
| * @return array Server params |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body, | |
| html { | |
| font-family: Arial; | |
| font-size: 13px; | |
| } | |
| .container { | |
| margin: 10px !important; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if (!function_exists("readline")) { | |
| /** | |
| * Reads a single line from the user | |
| * @param string $prompt You may specify a string with which to prompt the user | |
| * @return string Single string from the user | |
| */ | |
| function readline($prompt = null) { | |
| if ($prompt){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| endEditing(file) { | |
| this.editingFile = {}; | |
| let formData = new FormData(); | |
| formData.append('name', file.name); | |
| formData.append('type', file.type); | |
| formData.append('extension', file.extension); | |
| axios.post('files/edit/' + file.id, formData) | |
| .then(response => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| deleteFile() { | |
| axios.post('files/delete/' + this.deletingFile.id) | |
| .then(response => { | |
| this.showNotification('File successfully deleted!', true); | |
| this.fetchFile(this.activeTab, this.pagination.current_page); | |
| }) | |
| .catch(error => { | |
| this.errors = error.response.data.errors(); | |
| this.showNotification('Something went wrong! Please try again later.', false); | |
| this.fetchFile(this.activeTab, this.pagination.current_page); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| submitForm() { | |
| this.formData = new FormData(); | |
| this.formData.append('name', this.fileName); | |
| this.formData.append('file', this.attachment); | |
| axios.post('files/add', this.formData, {headers: {'Content-Type': 'multipart/form-data'}}) | |
| .then(response => { | |
| this.resetForm(); | |
| this.showNotification('File successfully upload!', true); | |
| this.fetchFile(this.activeTab); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getFiles(type) { | |
| this.setActive(type); | |
| this.fetchFile(type); | |
| if (this.activeTab === 'video') { | |
| this.isVideo = true; | |
| } else { | |
| this.isVideo = false; | |
| } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fetchFile(type, page) { | |
| this.loading = true; | |
| axios.get('files/' + type + '?page=' + page).then(result => { | |
| this.loading = false; | |
| this.files = result.data.data.data; | |
| this.pagination = result.data.pagination; | |
| }).catch(error => { | |
| console.log(error); | |
| this.loading = false; | |
| }); |