Revert "consolidate test-ip definition, added missing Access-Control-Allow-Origin,"

This reverts commit 56cfeb732e.
This commit is contained in:
CaCO3
2023-01-02 00:55:37 +01:00
parent 56cfeb732e
commit 485e55e0b8
28 changed files with 263 additions and 266 deletions

View File

@@ -93,9 +93,9 @@ select {
</tr>
</table>
<script type="text/javascript" src="common.js"></script>
<script type="text/javascript" src="readconfigcommon.js"></script>
<script type="text/javascript" src="readconfigparam.js"></script>
<script type="text/javascript" src="./gethost.js"></script>
<script type="text/javascript" src="./readconfigcommon.js"></script>
<script type="text/javascript" src="./readconfigparam.js"></script>
<script language="JavaScript">
var canvas = document.getElementById('canvas'),
@@ -107,12 +107,13 @@ select {
refInfo,
enhanceCon = false,
param;
domainname = getDomainname();
basepath = "http://192.168.178.26";
basepath = "",
param;
function doReboot() {
if (confirm("Are you sure you want to reboot? Did you save the config?")) {
var stringota = getDomainname() + "/reboot";
var stringota = "/reboot";
window.location = stringota;
window.location.href = stringota;
window.location.assign(stringota);
@@ -127,8 +128,8 @@ function ChangeSelection(){
function SaveToConfig(){
WriteConfigININew();
UpdateConfigReference(domainname)
SaveConfigToServer(domainname);
UpdateConfigReference(basepath)
SaveConfigToServer(basepath);
alert("Config.ini is updated!");
}
@@ -140,7 +141,7 @@ function EnhanceContrast(){
refInfo[aktindex]["dy"] = document.getElementById("refdy").value;
enhanceCon = true;
MakeContrastImageZW(refInfo[aktindex], enhanceCon, domainname);
MakeContrastImageZW(refInfo[aktindex], enhanceCon, basepath);
UpdateReference();
}
@@ -157,11 +158,11 @@ function UpdateReference(){
_filenameurl = refInfo[aktindex]["name"].replace("/config/", "/img_tmp/");
var url = domainname + "/fileserver" + _filenameurl + "?" + Date.now();
var url = basepath + "/fileserver" + _filenameurl + "?" + Date.now();
document.getElementById("img_ref").src = url;
_filenameurl = _filenameurl.replace(".jpg", "_org.jpg");
var url = domainname + "/fileserver" + _filenameurl + "?" + Date.now();
var url = basepath + "/fileserver" + _filenameurl + "?" + Date.now();
document.getElementById("img_ref_org").src = url;
document.getElementById("name").value = refInfo[aktindex]["name"];
@@ -213,17 +214,17 @@ function dataURLtoBlob(dataurl) {
function init() {
domainname = getDomainname();
loadConfig(domainname);
basepath = getbasepath();
loadConfig(basepath);
ParseConfig();
param = getConfigParameters();
canvas.addEventListener('mousedown', mouseDown, false);
canvas.addEventListener('mouseup', mouseUp, false);
canvas.addEventListener('mousemove', mouseMove, false);
loadCanvas(domainname + "/fileserver/config/reference.jpg");
loadCanvas(basepath + "/fileserver/config/reference.jpg");
CopyReferenceToImgTmp(domainname);
CopyReferenceToImgTmp(basepath);
refInfo = GetReferencesInfo();
UpdateReference();
@@ -246,7 +247,7 @@ function dataURLtoBlob(dataurl) {
refInfo[aktindex]["y"] = document.getElementById("refy").value;
refInfo[aktindex]["dx"] = document.getElementById("refdx").value;
refInfo[aktindex]["dy"] = document.getElementById("refdy").value;
MakeRefZW(refInfo[aktindex], domainname);
MakeRefZW(refInfo[aktindex], basepath);
UpdateReference();
document.getElementById("enhancecontrast").disabled = false;
}