folder upload
This commit is contained in:
@@ -353,7 +353,7 @@ module.exports = {
|
|||||||
utils.clickFileInput("gcode-file-input");
|
utils.clickFileInput("gcode-file-input");
|
||||||
},
|
},
|
||||||
|
|
||||||
upload: async function (e) {
|
upload_file: async function (e) {
|
||||||
const files = e.target.files || e.dataTransfer.files;
|
const files = e.target.files || e.dataTransfer.files;
|
||||||
if (!files.length) {
|
if (!files.length) {
|
||||||
return;
|
return;
|
||||||
@@ -396,6 +396,12 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
upload_folder: function (e) {
|
||||||
|
console.log(e);
|
||||||
|
const folderInput = document.getElementById('folderInput');
|
||||||
|
console.log(folderInput);
|
||||||
|
},
|
||||||
|
|
||||||
delete_current: function () {
|
delete_current: function () {
|
||||||
if (this.config.macrosList.find(item => item.file_name == this.state.selected) == undefined) {
|
if (this.config.macrosList.find(item => item.file_name == this.state.selected) == undefined) {
|
||||||
if (this.state.selected) {
|
if (this.state.selected) {
|
||||||
|
|||||||
@@ -273,9 +273,17 @@ script#control-view-template(type="text/x-template")
|
|||||||
.fa.fa-folder-open
|
.fa.fa-folder-open
|
||||||
|
|
||||||
form.gcode-file-input.file-upload
|
form.gcode-file-input.file-upload
|
||||||
input(type="file", @change="upload", :disabled="!is_ready",
|
input(type="file", @change="upload_file", :disabled="!is_ready",
|
||||||
accept=".nc,.ngc,.gcode,.gc")
|
accept=".nc,.ngc,.gcode,.gc")
|
||||||
|
|
||||||
|
button.pure-button(title="Upload a new GCode folder.", @click="open",
|
||||||
|
:disabled="!is_ready",style="height:100px;width:100px;font-weight:normal")
|
||||||
|
.fa.fa-folder-plus
|
||||||
|
|
||||||
|
form.gcode-folder-input.file-upload
|
||||||
|
input#folderInput(type="file", @change="upload_folder", :disabled="!is_ready",
|
||||||
|
webkitdirectory, directory, multiple)
|
||||||
|
|
||||||
a(:disabled="!state.selected", download,
|
a(:disabled="!state.selected", download,
|
||||||
:href="'/api/file/' + state.selected",
|
:href="'/api/file/' + state.selected",
|
||||||
title="Download the selected GCode program.")
|
title="Download the selected GCode program.")
|
||||||
|
|||||||
Reference in New Issue
Block a user