test
This commit is contained in:
@@ -114,7 +114,7 @@ module.exports = new Vue({
|
|||||||
full_version: "<loading>",
|
full_version: "<loading>",
|
||||||
ip: "<>",
|
ip: "<>",
|
||||||
wifiName: "not connected",
|
wifiName: "not connected",
|
||||||
macros:[]
|
macros:[{},{},{},{},{},{}]
|
||||||
},
|
},
|
||||||
state: {
|
state: {
|
||||||
messages: [],
|
messages: [],
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ module.exports = {
|
|||||||
return state || "";
|
return state || "";
|
||||||
},
|
},
|
||||||
is_ready: function() {
|
is_ready: function() {
|
||||||
console.log("is_ready: ",this.mach_state);
|
|
||||||
return this.mach_state == "READY";
|
return this.mach_state == "READY";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -56,19 +55,23 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
saveMacros: function(){
|
saveMacros: function(){
|
||||||
var macrosName = document.getElementById("macros-name").value;
|
var macrosName = document.getElementById("macros-name").value;
|
||||||
var macrosColor = document.getElementById("macros-color").value;
|
var macrosColor = document.getElementById("macros-color").value
|
||||||
|
console.log(this.state.selected);
|
||||||
if(this.config.macros == undefined) {
|
if(this.config.macros == undefined) {
|
||||||
console.log("macros is undefined");
|
console.log("macros is undefined");
|
||||||
this.config.macros=[];
|
this.config.macros=[];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.config.macros.push({
|
this.config.macros.push({
|
||||||
id:Math.random(),
|
id:Math.round(Math.random()*100000),
|
||||||
name:macrosName,
|
name:macrosName,
|
||||||
color:macrosColor
|
color:macrosColor
|
||||||
})
|
})
|
||||||
console.log("Successfully saved");
|
console.log("Successfully saved");
|
||||||
console.log(this.config.macros);
|
console.log(this.config.macros);
|
||||||
},
|
},
|
||||||
|
printConfig: function(){
|
||||||
|
console.log(this.config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,13 +7,17 @@ script#macros-template(type="text/x-template")
|
|||||||
p.title Select Your Macros Color
|
p.title Select Your Macros Color
|
||||||
input.input-color(type="color",id="macros-color",value="#ffffff")
|
input.input-color(type="color",id="macros-color",value="#ffffff")
|
||||||
p.title Select/Upload G-Code
|
p.title Select/Upload G-Code
|
||||||
button.pure-button(title="Upload a new GCode program.", @click="open",
|
|
||||||
:disabled="!is_ready",style="height:100px;width:100px;font-weight:normal")
|
|
||||||
.fa.fa-folder-open
|
|
||||||
select(title="Select previously uploaded GCode programs.",
|
select(title="Select previously uploaded GCode programs.",
|
||||||
v-model="state.selected", @change="load", :disabled="!is_ready",
|
v-model="state.selected", @change="load", :disabled="!is_ready",
|
||||||
style="max-width:100%")
|
style="max-width:100%;height:40px;border-radius:5px")
|
||||||
option(v-for="file in state.files", :value="file") {{file}}
|
option(v-for="file in state.files", :value="file") {{file}}
|
||||||
button.submit-macros(title="Save Macros",@click="saveMacros",style="height:100px;width:100px;font-weight:normal") Save Macros
|
button.pure-button(title="Upload a new GCode program.", @click="open",
|
||||||
|
:disabled="!is_ready",style="height:40px;width:50px;font-weight:normal;border-radius:5px")
|
||||||
|
Upload
|
||||||
|
button.submit-macros(title="Save Macros",@click="saveMacros",
|
||||||
|
style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border-color:#add1ad") Save Macros
|
||||||
|
button.pure-button(title="Print config.", @click="printConfig",
|
||||||
|
style="height:50px;width:100px;font-weight:normal")
|
||||||
|
.fa.fa-folder-open
|
||||||
|
|
||||||
gcode-viewer
|
gcode-viewer
|
||||||
|
|||||||
@@ -613,6 +613,8 @@ span.unit
|
|||||||
|
|
||||||
.macros-buttons
|
.macros-buttons
|
||||||
padding 40px
|
padding 40px
|
||||||
|
margin-left 200px
|
||||||
|
|
||||||
|
|
||||||
.path-viewer
|
.path-viewer
|
||||||
table
|
table
|
||||||
@@ -1041,7 +1043,8 @@ tt.save
|
|||||||
padding 30px
|
padding 30px
|
||||||
|
|
||||||
.macros-form
|
.macros-form
|
||||||
padding 50px
|
padding-left 50px
|
||||||
|
padding-top 50px
|
||||||
|
|
||||||
input.input-name
|
input.input-name
|
||||||
width 300px
|
width 300px
|
||||||
@@ -1051,16 +1054,21 @@ tt.save
|
|||||||
border-color #434242
|
border-color #434242
|
||||||
padding-left 10px
|
padding-left 10px
|
||||||
|
|
||||||
|
p.title
|
||||||
|
font-size 20px
|
||||||
|
padding-top 20px
|
||||||
|
font-weight 600
|
||||||
|
|
||||||
|
|
||||||
input.input-color
|
input.input-color
|
||||||
height 40px
|
height 40px
|
||||||
width 40px
|
width 300px
|
||||||
border-radius 2px
|
border-radius 2px
|
||||||
|
|
||||||
button
|
button
|
||||||
border-radius 8px
|
border-radius 8px
|
||||||
border-width 1px
|
border-width 1px
|
||||||
border-color #434242
|
border-color #434242
|
||||||
padding-left 10px
|
|
||||||
|
|
||||||
.input-field
|
.input-field
|
||||||
margin-top 10px
|
margin-top 10px
|
||||||
|
|||||||
Reference in New Issue
Block a user