Add status of octoprint container
Signed-off-by: Thomas Klaehn <thomas.klaehn@perinet.io>
This commit is contained in:
		@@ -33,6 +33,20 @@
 | 
			
		||||
                            chk = true;
 | 
			
		||||
                        }
 | 
			
		||||
                        btn.checked = chk;
 | 
			
		||||
                        if(target === "printer_slider") {
 | 
			
		||||
                            let containerstate = state.octoprint_containerstate;
 | 
			
		||||
                            let container_name = document.getElementById("container_name");
 | 
			
		||||
                            container_name.innerHTML = containerstate.name;
 | 
			
		||||
                            let container_status = document.getElementById("container_status");
 | 
			
		||||
                            container_status.innerHTML = containerstate.status;
 | 
			
		||||
 | 
			
		||||
                            let div_container = document.getElementById("containerdiv");
 | 
			
		||||
                            if(containerstate.status === "off") {
 | 
			
		||||
                                div_container.style.visibility = "hidden";
 | 
			
		||||
                            } else {
 | 
			
		||||
                                div_container.style.visibility = "visible";
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    } else {
 | 
			
		||||
                        console.log(`Error: ${xhr.status}`);
 | 
			
		||||
                    }
 | 
			
		||||
@@ -82,32 +96,52 @@
 | 
			
		||||
            </div> -->
 | 
			
		||||
        </div>
 | 
			
		||||
        <div id="content">
 | 
			
		||||
            <h1>3D Drucker</h1>
 | 
			
		||||
            <div>
 | 
			
		||||
                <h1>3D Drucker</h1>
 | 
			
		||||
                <label class="switch">
 | 
			
		||||
                    <input id="printer_slider" type="checkbox" onchange="check(this, 'printer')">
 | 
			
		||||
                    <span class="slider round"></span>
 | 
			
		||||
                </label>
 | 
			
		||||
            <h2>Schalter</h2>
 | 
			
		||||
            <table>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>Strom:</td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="switch">
 | 
			
		||||
                            <input id="power_slider" type="checkbox" onchange="check(this, 'power')">
 | 
			
		||||
                            <span class="slider round"></span>
 | 
			
		||||
                        </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>Daten:</td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="switch">
 | 
			
		||||
                            <input id="data_slider" type="checkbox" onchange="check(this, 'data')">
 | 
			
		||||
                            <span class="slider round"></span>
 | 
			
		||||
                        </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
            </table>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
                <h2>Schalter</h2>
 | 
			
		||||
                <table>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td>Strom:</td>
 | 
			
		||||
                        <td>
 | 
			
		||||
                            <label class="switch">
 | 
			
		||||
                                <input id="power_slider" type="checkbox" onchange="check(this, 'power')">
 | 
			
		||||
                                <span class="slider round"></span>
 | 
			
		||||
                            </label>
 | 
			
		||||
                        </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td>Daten:</td>
 | 
			
		||||
                        <td>
 | 
			
		||||
                            <label class="switch">
 | 
			
		||||
                                <input id="data_slider" type="checkbox" onchange="check(this, 'data')">
 | 
			
		||||
                                <span class="slider round"></span>
 | 
			
		||||
                            </label>
 | 
			
		||||
                        </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                </table>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div id="containerdiv">
 | 
			
		||||
                <h2>Octoprint Docker Container</h2>
 | 
			
		||||
                <table>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td>Name:</td>
 | 
			
		||||
                        <td id="container_name"></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <td>Status:</td>
 | 
			
		||||
                        <td id="container_status"></td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                </table>
 | 
			
		||||
                <a href="http://p4:80" target="_blank">Octoprint</a>
 | 
			
		||||
                <br>
 | 
			
		||||
                <a href="http://p4:8080" target="_blank">Camera</a>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user