trying an textarea to get new input

This commit is contained in:
sanjayk03-dev
2024-01-10 00:55:15 +05:30
parent be1aa15b4a
commit 52511b18fa
3 changed files with 73 additions and 44 deletions

View File

@@ -12,6 +12,7 @@ module.exports = {
tab: "1", tab: "1",
confirmReset: false, confirmReset: false,
confirmSave: false, confirmSave: false,
newGcode: "",
}; };
}, },
components: { components: {
@@ -33,6 +34,11 @@ module.exports = {
}, },
}, },
methods: { methods: {
updateNewGcode(event) {
console.log(event)
this.newGcode = event.target.value;
console.log(this.newGcode);
},
open: function () { open: function () {
utils.clickFileInput("gcode-file-input"); utils.clickFileInput("gcode-file-input");
}, },
@@ -41,15 +47,20 @@ module.exports = {
const file = this.state.selected; const file = this.state.selected;
this.$broadcast("gcode-load", file); this.$broadcast("gcode-load", file);
this.$broadcast("gcode-line", this.state.line); this.$broadcast("gcode-line", this.state.line);
this.newGCode = "";
}, },
upload: function (e) { upload: function (e) {
const files = e.target.files || e.dataTransfer.files; const files = e.target.files || e.dataTransfer.files;
console.log(e);
console.log(files);
if (!files.length) { if (!files.length) {
return; return;
} }
const file = files[0]; const file = files[0];
console.log(file)
const extension = file.name.split(".").pop(); const extension = file.name.split(".").pop();
console.log(extension)
switch (extension.toLowerCase()) { switch (extension.toLowerCase()) {
case "nc": case "nc":
case "ngc": case "ngc":
@@ -115,7 +126,7 @@ module.exports = {
gcode_file_time: 0, gcode_file_time: 0,
}, },
{ {
name: "Park", name: "Perk",
color: "#e6e6e6", color: "#e6e6e6",
gcode_file_name: " ", gcode_file_name: " ",
gcode_file_time: 0, gcode_file_time: 0,

View File

@@ -16,8 +16,8 @@ script#macros-template(type="text/x-template")
p Are you sure you want to save the current settings? p Are you sure you want to save the current settings?
div(slot="footer") div(slot="footer")
button.pure-button(@click="confirmSave=false") Cancel button.pure-button(@click="confirmSave=false") Cancel
button.pure-button.pure-button-primary(@click="saveMacros") button.pure-button.pure-button-primary(@click="saveMacros")
| Confirm | Confirm
h1 Macros Configuration h1 Macros Configuration
@@ -75,7 +75,9 @@ script#macros-template(type="text/x-template")
input(type="file", @change="upload", :disabled="!is_ready", input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc") accept=".nc,.ngc,.gcode,.gc")
br br
gcode-viewer .gcodeContainer
textarea.new-gcode( v-if="state.selected=='default",:value='newGcode' @input="updateNewGcode")
gcode-viewer(v-if="state.selected !== 'default'")
button.submit-macros(title="Save Macros",@click="confirmSave=true", button.submit-macros(title="Save Macros",@click="confirmSave=true",
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros", button.submit-macros(title="Cancel Macros",@click="cancelMacros",
@@ -103,7 +105,8 @@ script#macros-template(type="text/x-template")
input(type="file", @change="upload", :disabled="!is_ready", input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc") accept=".nc,.ngc,.gcode,.gc")
br br
gcode-viewer .gcodeContainer
gcode-viewer
button.submit-macros(title="Save Macros",@click="confirmSave=true", button.submit-macros(title="Save Macros",@click="confirmSave=true",
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros", button.submit-macros(title="Cancel Macros",@click="cancelMacros",
@@ -131,7 +134,8 @@ script#macros-template(type="text/x-template")
input(type="file", @change="upload", :disabled="!is_ready", input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc") accept=".nc,.ngc,.gcode,.gc")
br br
gcode-viewer .gcodeContainer
gcode-viewer
button.submit-macros(title="Save Macros",@click="confirmSave=true", button.submit-macros(title="Save Macros",@click="confirmSave=true",
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros", button.submit-macros(title="Cancel Macros",@click="cancelMacros",
@@ -159,7 +163,8 @@ script#macros-template(type="text/x-template")
input(type="file", @change="upload", :disabled="!is_ready", input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc") accept=".nc,.ngc,.gcode,.gc")
br br
gcode-viewer .gcodeContainer
gcode-viewer
button.submit-macros(title="Save Macros",@click="confirmSave=true", button.submit-macros(title="Save Macros",@click="confirmSave=true",
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros", button.submit-macros(title="Cancel Macros",@click="cancelMacros",
@@ -187,7 +192,8 @@ script#macros-template(type="text/x-template")
input(type="file", @change="upload", :disabled="!is_ready", input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc") accept=".nc,.ngc,.gcode,.gc")
br br
gcode-viewer .gcodeContainer
gcode-viewer
button.submit-macros(title="Save Macros",@click="confirmSave=true", button.submit-macros(title="Save Macros",@click="confirmSave=true",
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros", button.submit-macros(title="Cancel Macros",@click="cancelMacros",
@@ -215,7 +221,8 @@ script#macros-template(type="text/x-template")
input(type="file", @change="upload", :disabled="!is_ready", input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc") accept=".nc,.ngc,.gcode,.gc")
br br
gcode-viewer .gcodeContainer
gcode-viewer
button.submit-macros(title="Save Macros",@click="confirmSave=true", button.submit-macros(title="Save Macros",@click="confirmSave=true",
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros", button.submit-macros(title="Cancel Macros",@click="cancelMacros",
@@ -243,7 +250,8 @@ script#macros-template(type="text/x-template")
input(type="file", @change="upload", :disabled="!is_ready", input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc") accept=".nc,.ngc,.gcode,.gc")
br br
gcode-viewer .gcodeContainer
gcode-viewer
button.submit-macros(title="Save Macros",@click="confirmSave=true", button.submit-macros(title="Save Macros",@click="confirmSave=true",
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros", button.submit-macros(title="Cancel Macros",@click="cancelMacros",
@@ -271,7 +279,8 @@ script#macros-template(type="text/x-template")
input(type="file", @change="upload", :disabled="!is_ready", input(type="file", @change="upload", :disabled="!is_ready",
accept=".nc,.ngc,.gcode,.gc") accept=".nc,.ngc,.gcode,.gc")
br br
gcode-viewer .gcodeContainer
gcode-viewer
button.submit-macros(title="Save Macros",@click="confirmSave=true", button.submit-macros(title="Save Macros",@click="confirmSave=true",
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save
button.submit-macros(title="Cancel Macros",@click="cancelMacros", button.submit-macros(title="Cancel Macros",@click="cancelMacros",

View File

@@ -631,35 +631,52 @@ span.unit
border 0 border 0
color #fff color #fff
.macros #macros
width 90% width 104%
.warning-box .gcodeContainer
display flex width 25rem
background-color #F3FF00 height 15rem
border-radius 5px border-width 1px
border 0 border-radius 10px
margin-bottom 10px border-color #424242
margin-top 10px border-style solid
align-items center
justify-content center
.select-upload-gcode .new-gcode
display flex display flex
flex-direction row
.tabs .warning-box
margin-top 5px display flex
width 51.8rem background-color #F3FF00
border-radius 5px
border 0
margin-bottom 10px
margin-top 10px
align-items center
justify-content center
.submit-macros .select-upload-gcode
height 50px display flex
width 140px flex-direction row
margin-top 30px
font-weight normal .tabs
background-color #add1ad margin-top 5px
color #fff
border 0 .macros-view
padding 30px
width 95%
.macros-form
padding-left 30px
.submit-macros
height 50px
width 140px
margin-top 30px
font-weight normal
background-color #add1ad
color #fff
border 0
.path-viewer .path-viewer
@@ -1085,14 +1102,6 @@ tt.save
.pure-form-aligned .pure-control-group label.extra .pure-form-aligned .pure-control-group label.extra
width 8em width 8em
.macros-view
padding 30px
width 95%
.macros-form
padding 30px
input.input-name input.input-name
width 300px width 300px
height 40px height 40px