sync with current state

This commit is contained in:
T
2024-10-28 18:10:03 +01:00
parent 895a744873
commit 8dc0480c18
38 changed files with 1675 additions and 104 deletions

View File

@ -4,9 +4,10 @@
<title>Pixelserver Interface</title>
</head>
<body>
<h1>Andreas <i>DEBUG</i> Interface</h1>
<body style="display: grid; grid-template-columns: auto auto auto;">
<h1 style="grid-column: 1 / 4; text-align: center;">Andreas <i>production-ready</i> Interface</h1>
<div>
<h2>Kommando:</h2>
<form id='in' onSubmit="return request()">
<select id="list"></select>
@ -19,17 +20,49 @@
<input id="brightness" value=1.0 /><br/>
<button id="sendbrightness">Setzen</button>
</form>
</div>
<div style="border-left: solid 1px; padding-left: 10px;">
<h2>Gamma:</h2>
<form id='gammeform' onSubmit="return setgamma()">
Rot: <input id="gammar" value=2.8 /><br/>
Grün: <input id="gammag" value=2.65 /><br/>
Blau: <input id="gammab" value=2.65 /><br/>
Weiß: <input id="gammaw" value=2.65 /><br/>
<button id="sendgamma">Setzen</button>
</form>
<h2>Flip:</h2>
<form id="flipform" onSubmit="return setFlip()">
<input id="flipx" type="checkbox" /> Flip X <br/>
<input id="flipy" type="checkbox" /> Flip Y <br/>
<button id="sendflip">Setzen</button>
</form>
<h2>Filterimage:</h2>
<form id="filteform" onSubmit="return setFilter()">
<input id="filtername" value="test"></intput><br/>
<button id="filterflip">Setzten</button>
</form>
<h2>Filter expression:</h2>
<form id="filterexprform" onSubmit="return setFilterExpr()">
<input id="filterexpr" value="0.5+0.25*sin(x/3+t)"></intput><br/>
<button>Setzten</button>
</form>
</div>
<div style="border-left: solid 1px; padding-left: 10px; width: 600px;">
<h2>Crash Log:</h2>
<form id="crashlogform" onSubmit="return enableCrashLog()">
<button>start</button>
</form>
<textarea readonly id='crashlogs' style="width: 500px; height: 300px; display: none;"></textarea>
<h2>Log:</h2>
<textarea readonly id='logs' style="width: 500px; height: 500px;"></textarea>
<form id="logform" onSubmit="return enableLog()">
<button>start</button>
</form>
<textarea readonly id='logs' style="width: 500px; height: 300px; display: none;"></textarea>
</div>
<script>
function getRaw(from, callback){
var xhttp = new XMLHttpRequest();
@ -105,7 +138,8 @@
let r = document.getElementById('gammar').value;
let g = document.getElementById('gammag').value;
let b = document.getElementById('gammab').value;
let url = "/setgamma/" + r+"/"+g+"/"+b;
let w = document.getElementById('gammaw').value;
let url = "/setgamma/" + r+"/"+g+"/"+b+"/"+w;
getRaw(url, function test(){});
return false;
}
@ -117,13 +151,61 @@
return false;
}
function setFlip(){
let x = document.getElementById('flipx').checked;
let y = document.getElementById('flipy').checked;
console.log(x);
console.log(y);
getRaw("/filter/flipx/" + x, function test(){});
getRaw("/filter/flipy/" + y, function test(){});
return false;
}
function setFilter(){
let i = document.getElementById('filtername').value;
let url = "/filter/img/" + i;
getRaw(url, function test(){});
return false;
}
function setFilterExpr(){
let expr = document.getElementById('filterexpr').value;
let url = "/filter/expr/";
post(url, {"expr": expr});
return false;
}
function updateLog(){
getRaw("/apps/log", function(text){
document.getElementById('logs').innerText = text;
document.getElementById('logs').value = text;
});
}
updateLog();
setInterval(updateLog, 1000);
function updateCrashLog(){
getRaw("/apps/crashlog", function(text){
document.getElementById('crashlogs').value = text;
});
}
function enableCrashLog(){
document.getElementById("crashlogform").style.display = "none";
document.getElementById("crashlogs").style.display = "block";
updateCrashLog();
setInterval(updateCrashLog, 1000);
return false;
}
function enableLog(){
document.getElementById("logform").style.display = "none";
document.getElementById("logs").style.display = "block";
updateLog();
setInterval(updateLog, 1000);
return false;
}
getJSON("/apps/list", populateForm);