alert box for reset macros
This commit is contained in:
@@ -10,7 +10,7 @@ module.exports = {
|
|||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
tab: "1",
|
tab: "1",
|
||||||
confirmShow: false,
|
confirmReset: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -92,7 +92,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
cancelMacros: function (id) {
|
cancelMacros: function (id) {
|
||||||
document.getElementById(`macros-name-${id}`).value = "";
|
document.getElementById(`macros-name-${id}`).value = "";
|
||||||
document.getElementById(`macros-color-${id}`).value = "#fff";
|
document.getElementById(`macros-color-${id}`).value = "#ffffff";
|
||||||
},
|
},
|
||||||
resetConfig: async function () {
|
resetConfig: async function () {
|
||||||
this.config.macros = [
|
this.config.macros = [
|
||||||
@@ -137,6 +137,7 @@ module.exports = {
|
|||||||
await api.put("config/save", this.config);
|
await api.put("config/save", this.config);
|
||||||
console.log("Successfully flushed");
|
console.log("Successfully flushed");
|
||||||
this.$dispatch("update");
|
this.$dispatch("update");
|
||||||
|
this.confirmReset = false;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Restore Failed: ", error);
|
console.error("Restore Failed: ", error);
|
||||||
alert("Restore failed");
|
alert("Restore failed");
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
script#macros-template(type="text/x-template")
|
script#macros-template(type="text/x-template")
|
||||||
#macros
|
#macros
|
||||||
message(:show.sync="confirmUpload")
|
message(:show.sync="confirmReset")
|
||||||
h3(slot="header") Upload Firmware?
|
h3(slot="header") Reset All Macros?
|
||||||
div(slot="body")
|
div(slot="body")
|
||||||
p Are you sure you want to upload firmware #[em {{firmwareName}}]?
|
p Are you sure you want to reset all macros?
|
||||||
|
|
||||||
div(slot="footer")
|
div(slot="footer")
|
||||||
button.pure-button(@click="confirmUpload=false") Cancel
|
button.pure-button(@click="confirmReset=false") Cancel
|
||||||
button.pure-button.pure-button-primary(@click="saveMacros(0)")
|
button.pure-button.pure-button-primary(@click="resetConfig")
|
||||||
| Upload
|
| Reset
|
||||||
h1 Macros Configuration
|
h1 Macros Configuration
|
||||||
button.pure-button(title="Print config.", @click="resetConfig",
|
button.pure-button(title="Print config.", @click="confirmReset='true'",
|
||||||
style="height:50px;width:170px;font-weight:normal;color:#fff;background-color:#5a9ad7;display:flex;align-items:center;justify-content:space-around") Reset Macros
|
style="height:50px;width:170px;font-weight:normal;color:#fff;background-color:#5a9ad7;display:flex;align-items:center;justify-content:space-around") Reset Macros
|
||||||
.fa.fa-rotate-right
|
.fa.fa-rotate-right
|
||||||
.warning-box
|
.warning-box
|
||||||
|
|||||||
@@ -633,11 +633,9 @@ span.unit
|
|||||||
|
|
||||||
.warning-box
|
.warning-box
|
||||||
display flex
|
display flex
|
||||||
background-color #ced512
|
background-color #F3FF00
|
||||||
border-radius 5px
|
border-radius 5px
|
||||||
border 0
|
border 0
|
||||||
padding 4px
|
|
||||||
margin-top 5px
|
|
||||||
margin-bottom 10px
|
margin-bottom 10px
|
||||||
margin-top 10px
|
margin-top 10px
|
||||||
align-items center
|
align-items center
|
||||||
|
|||||||
Reference in New Issue
Block a user