1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-14 14:48:18 +00:00

changed hide for disabled, resorted buttons

This commit is contained in:
gitolicious 2019-05-26 10:32:19 +00:00
parent c101bd75fc
commit 7aee6c8b70
2 changed files with 7 additions and 7 deletions

View File

@ -412,21 +412,21 @@ const downloadAfterUploadButton = document.querySelector('.download-after-upload
const uploadModal = new LogModalElem({
name: 'upload',
onPrepare: (modalElem, config) => {
retryUploadButton.setAttribute('data-node', uploadModal.activeConfig);
retryUploadButton.classList.add('hide');
editAfterUploadButton.setAttribute('data-node', uploadModal.activeConfig);
downloadAfterUploadButton.classList.remove('hide');
downloadAfterUploadButton.classList.add('disabled');
retryUploadButton.setAttribute('data-node', uploadModal.activeConfig);
retryUploadButton.classList.add('disabled');
editAfterUploadButton.setAttribute('data-node', uploadModal.activeConfig);
modalElem.querySelector(".stop-logs").innerHTML = "Stop";
},
onProcessExit: (modalElem, code) => {
if (code === 0) {
M.toast({html: "Program exited successfully."});
// if compilation succeeds but OTA fails, you can still download the binary and upload manually
downloadAfterUploadButton.classList.remove('disabled');
} else {
M.toast({html: `Program failed with code ${code}`});
downloadAfterUploadButton.classList.add('hide');
retryUploadButton.classList.remove('hide');
downloadAfterUploadButton.classList.add('disabled');
retryUploadButton.classList.remove('disabled');
}
modalElem.querySelector(".stop-logs").innerHTML = "Close";
},

View File

@ -122,8 +122,8 @@
<i class="material-icons flash-using-esphomeflasher">help_outline</i>
</a>
<a class="modal-close waves-effect waves-green btn-flat disabled download-after-upload">Download Binary</a>
<a class="waves-effect waves-green btn-flat disabled action-upload retry-upload">Retry</a>
<a class="modal-close waves-effect waves-green btn-flat action-edit edit-after-upload">Edit</a>
<a class="waves-effect waves-green btn-flat hide action-upload retry-upload">Retry</a>
<a class="modal-close waves-effect waves-green btn-flat stop-logs">Stop</a>
</div>
</div>