Files
ESP3D-WEBUI/extensions_samples/query.html
Luc d9ad884d48 Merge 3.0 refactoring
## What's Changed
* Complete refactoring using spectre.css and correct Preact API per @alexblog suggestion
* Smaller footprint
* Add support for extensions/pluggins
* Add theme support by using external css
* Remove banner as unnecessary
* Remove information bar and put information to separate page and respective panel
* Add audio and haptic feedback
* Add Repetier / ESP3DLib V2 / Smoothieware / GRBL support
* Split code for 3DPrinter / CNC / Sand Table

## Limitations
* CNC / Sand Table specific UI is still not defined
* Wizard is not implemented yet
* Works with ESP3D 3.0- alpha-2 - no backward compatibility
* Language packs are not ready to be translated yet as UI is not finished

## Discussion / status
[Discussion](https://github.com/luc-github/ESP3D-WEBUI/discussions/94)

## New Contributors
@alexblog made several contributions like https://github.com/luc-github/ESP3D-WEBUI/pull/236
2022-06-01 15:31:57 +08:00

34 lines
1.0 KiB
HTML

<script type="text/javascript">
function sendMessage(msg){
window.parent.postMessage(msg, '*');
}
function processMessage(eventMsg){
if (eventMsg.data.type && (!eventMsg.data.id||eventMsg.data.id=="querypanel")){
if (eventMsg.data.type=="query"){
const line = eventMsg.data.content
if (line.status=="success"){
const resultPanel = document.getElementById("output");
resultPanel.innerHTML = resultPanel.innerHTML + "<br>" + line.response.replace("\n", "<br/>") + "<hr />";
}
if (line.status=="error"){
//TBD
}
}
}
}
window.onload = (event) => {
window.addEventListener("message", processMessage, false);
};
</script>
<div class="container">
<button class="btn m-1" onclick="sendMessage({type:'query', target:'webui', id:'querypanel', url:'files', args:{action:'list', path:'/'}});">List Files</button>
<div class="container m-2" id="output">
</div>
</div>