fixed delete bug
This commit is contained in:
@@ -205,7 +205,7 @@ module.exports = {
|
|||||||
this.config.macros[this.tab - 1].file_name = "default";
|
this.config.macros[this.tab - 1].file_name = "default";
|
||||||
} else {
|
} else {
|
||||||
api.delete(`file/${filename}`);
|
api.delete(`file/${filename}`);
|
||||||
this.$set("newGcode[this.tab]", "");
|
this.$set("newGcode[this.tab-1]", "");
|
||||||
this.config.macros[this.tab - 1].file_name = "default";
|
this.config.macros[this.tab - 1].file_name = "default";
|
||||||
this.config.macrosList = this.config.macrosList.filter(item => item.file_name !== filename);
|
this.config.macrosList = this.config.macrosList.filter(item => item.file_name !== filename);
|
||||||
}
|
}
|
||||||
@@ -216,6 +216,7 @@ module.exports = {
|
|||||||
console.error("Restore Failed: ", error);
|
console.error("Restore Failed: ", error);
|
||||||
alert("Restore failed");
|
alert("Restore failed");
|
||||||
}
|
}
|
||||||
|
this.tab = "1";
|
||||||
this.deleteGCode = false;
|
this.deleteGCode = false;
|
||||||
},
|
},
|
||||||
delete_all_macros: async function () {
|
delete_all_macros: async function () {
|
||||||
@@ -279,6 +280,7 @@ module.exports = {
|
|||||||
];
|
];
|
||||||
this.delete_all_macros();
|
this.delete_all_macros();
|
||||||
this.cancelMacros();
|
this.cancelMacros();
|
||||||
|
this.tab = "1";
|
||||||
this.confirmReset = false;
|
this.confirmReset = false;
|
||||||
try {
|
try {
|
||||||
await api.put("config/save", this.config);
|
await api.put("config/save", this.config);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.flex-row-container
|
.flex-row-container
|
||||||
button.blue-button(title="Reset Macros", @click="confirmReset=true") Delete All
|
button.blue-button(title="Reset Macros", @click="confirmReset=true") Delete All
|
||||||
button.blue-button(title="Add a Macros", @click="addNewMacros", style="margin-left:5px") New Macros
|
button.blue-button(title="Add a Macros", @click="addNewMacros", style="margin-left:5px") New Macros
|
||||||
button.blue-button(title="Add a Macros", @click="deleteSelected=true", style="margin-left:5px",:disabled="!macrosLength") Delete Selected
|
// button.blue-button(title="Delete a Macros", @click="deleteSelected=true", style="margin-left:5px",:disabled="!macrosLength") Delete Selected
|
||||||
|
|
||||||
.tabs
|
.tabs
|
||||||
input#tab1(type="radio", name="tabs",checked="" @click="tab = '1'")
|
input#tab1(type="radio", name="tabs",checked="" @click="tab = '1'")
|
||||||
@@ -51,7 +51,7 @@ script#macros-template(type="text/x-template")
|
|||||||
input(type="radio",:id="'tab'+(index+2)", name="tabs",@click="tab = (index+2).toString()")
|
input(type="radio",:id="'tab'+(index+2)", name="tabs",@click="tab = (index+2).toString()")
|
||||||
label(:for="'tab'+(index+2)",style="height:50px;width:100px") Macros {{index+2}}
|
label(:for="'tab'+(index+2)",style="height:50px;width:100px") Macros {{index+2}}
|
||||||
|
|
||||||
section.tab-content(v-for="(index,macros) in config.macros",:id="'content'+(index+1)")
|
section.macros-tab-content(v-for="(index,macros) in config.macros",:id="'content'+(index+1)")
|
||||||
.macros-form
|
.macros-form
|
||||||
p.title Name
|
p.title Name
|
||||||
.input-container
|
.input-container
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ span.unit
|
|||||||
border-radius 10px
|
border-radius 10px
|
||||||
border-color #424242
|
border-color #424242
|
||||||
border-style solid
|
border-style solid
|
||||||
|
|
||||||
.new-gcode
|
.new-gcode
|
||||||
height 13rem
|
height 13rem
|
||||||
width 23rem
|
width 23rem
|
||||||
@@ -660,14 +660,21 @@ span.unit
|
|||||||
.flex-row-container
|
.flex-row-container
|
||||||
display flex
|
display flex
|
||||||
flex-direction row
|
flex-direction row
|
||||||
|
width 440px
|
||||||
margin-bottom 1rem
|
margin-bottom 1rem
|
||||||
|
|
||||||
.tabs
|
.tabs
|
||||||
margin-top 5px
|
margin-top 5px
|
||||||
|
width 850px
|
||||||
|
|
||||||
|
|
||||||
.macros-view
|
.macros-view
|
||||||
padding 30px
|
padding 30px
|
||||||
width 95%
|
width 95%
|
||||||
|
|
||||||
|
.macros-tab-content
|
||||||
|
padding-bottom 20px
|
||||||
|
border-radius 5px
|
||||||
|
|
||||||
.macros-form
|
.macros-form
|
||||||
padding-left 30px
|
padding-left 30px
|
||||||
|
|||||||
Reference in New Issue
Block a user