added max limit for macros

This commit is contained in:
sanjayk03-dev
2024-01-29 03:50:48 +05:30
parent a11def9c54
commit 2a1182db56
3 changed files with 43 additions and 7 deletions

View File

@@ -15,6 +15,7 @@ module.exports = {
deleteSelected: false, deleteSelected: false,
deleteGCode: false, deleteGCode: false,
edited: false, edited: false,
maxLimitReached:false,
newGcode: new Array(this.config.macros.length).fill(""), newGcode: new Array(this.config.macros.length).fill(""),
}; };
}, },
@@ -313,6 +314,10 @@ module.exports = {
}, },
addNewMacros: async function () { addNewMacros: async function () {
const length = this.config.macros.length; const length = this.config.macros.length;
if (length >= 30) {
this.maxLimitReached = true;
return;
}
const newMacros = { const newMacros = {
name: `Macros ${length + 1}`, name: `Macros ${length + 1}`,
color: "#dedede", color: "#dedede",

View File

@@ -37,6 +37,12 @@ script#macros-template(type="text/x-template")
.fa.fa-trash .fa.fa-trash
|  Yes |  Yes
message(:show.sync="maxLimitReached")
h3(slot="header") Delete Selected Macros?
p(slot="body")
div(slot="footer")
button.pure-button.button-secondary(@click="maxLimitReached = false") OK
h1 Macros Configuration h1 Macros Configuration
.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

View File

@@ -689,10 +689,35 @@ span.unit
display none display none
clear both clear both
> input:checked ~ section > #tab1:checked ~ #content1,
display none > #tab2:checked ~ #content2,
> #tab3:checked ~ #content3,
> input:checked ~ label + label ~ section > #tab4:checked ~ #content4,
> #tab5:checked ~ #content5,
> #tab6:checked ~ #content6,
> #tab7:checked ~ #content7,
> #tab8:checked ~ #content8,
> #tab9:checked ~ #content9,
> #tab10:checked ~ #content10,
> #tab11:checked ~ #content11,
> #tab12:checked ~ #content12,
> #tab13:checked ~ #content13,
> #tab14:checked ~ #content14,
> #tab15:checked ~ #content15,
> #tab16:checked ~ #content16,
> #tab17:checked ~ #content17,
> #tab18:checked ~ #content18,
> #tab19:checked ~ #content19,
> #tab21:checked ~ #content21,
> #tab22:checked ~ #content22,
> #tab23:checked ~ #content23,
> #tab24:checked ~ #content24,
> #tab25:checked ~ #content25,
> #tab26:checked ~ #content26,
> #tab27:checked ~ #content27,
> #tab28:checked ~ #content28,
> #tab29:checked ~ #content29,
> #tab30:checked ~ #content30,
display block display block
[id^="tab"]:checked + label [id^="tab"]:checked + label