fixed delete bug

This commit is contained in:
sanjayk03-dev
2024-01-29 01:58:51 +05:30
parent 15c93d899a
commit 30348187f5
3 changed files with 13 additions and 4 deletions

View File

@@ -205,7 +205,7 @@ module.exports = {
this.config.macros[this.tab - 1].file_name = "default";
} else {
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.macrosList = this.config.macrosList.filter(item => item.file_name !== filename);
}
@@ -216,6 +216,7 @@ module.exports = {
console.error("Restore Failed: ", error);
alert("Restore failed");
}
this.tab = "1";
this.deleteGCode = false;
},
delete_all_macros: async function () {
@@ -279,6 +280,7 @@ module.exports = {
];
this.delete_all_macros();
this.cancelMacros();
this.tab = "1";
this.confirmReset = false;
try {
await api.put("config/save", this.config);

View File

@@ -41,7 +41,7 @@ script#macros-template(type="text/x-template")
.flex-row-container
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="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
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()")
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
p.title Name
.input-container

View File

@@ -650,7 +650,7 @@ span.unit
border-radius 10px
border-color #424242
border-style solid
.new-gcode
height 13rem
width 23rem
@@ -660,14 +660,21 @@ span.unit
.flex-row-container
display flex
flex-direction row
width 440px
margin-bottom 1rem
.tabs
margin-top 5px
width 850px
.macros-view
padding 30px
width 95%
.macros-tab-content
padding-bottom 20px
border-radius 5px
.macros-form
padding-left 30px