-<!DOCTYPE html><html lang="zh-tw"><head><meta http-equiv=content-type content="text/html; charset=utf-8"><meta name=viewport content="width=device-width,initial-scale=1"><title> BrewPiLess系統組態 </title><meta name=apple-mobile-web-app-title content=BrewPiLess><meta name=apple-mobile-web-app-capable content=yes><script>function invoke(n){var e=new XMLHttpRequest;e.onreadystatechange=function(){4==e.readyState&&(200==e.status?n.success(e.responseText):e.onerror(e.status))},e.ontimeout=function(){void 0!==n.timeout?n.timeout():e.onerror(-1)},e.onerror=function(e){void 0!==n.fail&&n.fail(e)},e.open(n.m,n.url,!0),void 0!==n.data?(e.setRequestHeader("Content-Type",void 0!==n.mime?n.mime:"application/x-www-form-urlencoded"),e.send(n.data)):e.send()}var BWF={process:function(msg){if(null==this.raw)for(var key in eval("m={"+msg+"}"),m)void 0!==this.handlers[key]&&this.handlers[key](m[key]);else this.raw(msg)},on:function(n,e){this.handlers[n]=e},send:function(n){1==this.ws.readyState&&this.ws.send(n)},reconnecting:!1,status:function(){return void 0===this.ws?-1:1==this.ws.readyState?0:1},connect:function(){var n=this;if("undefined"!=typeof WebSocket){var e=new WebSocket("ws://"+document.location.host+"/ws");n.ws=e,e.onopen=function(){console.log("Connected"),n.onconnect()},e.onclose=function(){n.reconnecting||(console.log("WS close"),n.error(-2),n.auto&&setTimeout(function(){n.reconnect()},5e3))},e.onmessage=function(e){n.process(e.data)}}else alert("Error! WebSocket Not Supported!")},reconnect:function(n){n=void 0!==n;var e=this;e.reconnecting||(n||1!=e.ws.readyState)&&(console.log("reconnect forced:"+n+" state:"+e.ws.readyState),e.reconnecting=!0,e.ws.close(),e.connect(),e.reconnecting=!1)},init:function(n){var e=this;e.error=void 0===n.error?function(){}:n.error,e.handlers=void 0===n.handlers?{}:n.handlers,e.raw=void 0===n.raw?null:n.raw,e.onconnect=void 0===n.onconnect?function(){}:n.onconnect,e.auto=void 0===n.reconnect||n.reconnect,e.connect()},save:function(n,e,o,t){invoke({m:"POST",url:"/fputs",data:"path="+n+"&content="+encodeURIComponent(e),success:function(){o()},fail:function(n){t(n)}})},load:function(n,e,o){invoke({m:"GET",url:n,success:function(n){e(n)},fail:function(n){o(n)}})}}</script><script>var JSVERSION = "4.2";
0 commit comments