mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
reverting version
This commit is contained in:
2
data/.exclude.files
Normal file
2
data/.exclude.files
Normal file
@@ -0,0 +1,2 @@
|
||||
/*.js.gz
|
||||
/.exclude.files
|
||||
22
data/config.json
Normal file
22
data/config.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "IoTmanager",
|
||||
"chipID": "",
|
||||
"apssid": "IoTmanager",
|
||||
"appass": "",
|
||||
"routerssid": "VOLODYA",
|
||||
"routerpass": "BELCHENKO",
|
||||
"timezone": 2,
|
||||
"ntp": "pool.ntp.org",
|
||||
"mqttServer": "91.204.228.124",
|
||||
"mqttPort": 1883,
|
||||
"mqttPrefix": "/iotTeam",
|
||||
"mqttUser": "test",
|
||||
"mqttPass": "test",
|
||||
"scen": "1",
|
||||
"pushingboxid": "v7C133E426B0C69E",
|
||||
"weblogin": "admin",
|
||||
"webpass": "admin",
|
||||
"udponoff": "1",
|
||||
"blink": "1",
|
||||
"oneWirePin": "2"
|
||||
}
|
||||
BIN
data/css/build.css.gz
Normal file
BIN
data/css/build.css.gz
Normal file
Binary file not shown.
658
data/edit.htm
Normal file
658
data/edit.htm
Normal file
@@ -0,0 +1,658 @@
|
||||
<!--This is the plain html source of the hex encoded Editor-Page embedded in SPIFFSEditor.cpp -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>FS Editor</title>
|
||||
<style type="text/css" media="screen">
|
||||
.cm {
|
||||
z-index: 300;
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
border: 1px solid #444;
|
||||
background-color: #F5F5F5;
|
||||
display: none;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, .4);
|
||||
font-size: 12px;
|
||||
font-family: sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cm ul {
|
||||
list-style: none;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.cm li {
|
||||
position: relative;
|
||||
min-width: 60px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cm span {
|
||||
color: #444;
|
||||
display: inline-block;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.cm li:hover {
|
||||
background: #444;
|
||||
}
|
||||
|
||||
.cm li:hover span {
|
||||
color: #EEE;
|
||||
}
|
||||
|
||||
.tvu ul,
|
||||
.tvu li {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.tvu input {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.tvu {
|
||||
font: normal 12px Verdana, Arial, Sans-serif;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
color: #444;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
.tvu span {
|
||||
margin-bottom: 5px;
|
||||
padding: 0 0 0 18px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
vertical-align: middle;
|
||||
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADoSURBVBgZBcExblNBGAbA2ceegTRBuIKOgiihSZNTcC5LUHAihNJR0kGKCDcYJY6D3/77MdOinTvzAgCw8ysThIvn/VojIyMjIyPP+bS1sUQIV2s95pBDDvmbP/mdkft83tpYguZq5Jh/OeaYh+yzy8hTHvNlaxNNczm+la9OTlar1UdA/+C2A4trRCnD3jS8BB1obq2Gk6GU6QbQAS4BUaYSQAf4bhhKKTFdAzrAOwAxEUAH+KEM01SY3gM6wBsEAQB0gJ+maZoC3gI6iPYaAIBJsiRmHU0AALOeFC3aK2cWAACUXe7+AwO0lc9eTHYTAAAAAElFTkSuQmCC') no-repeat;
|
||||
background-position: 0px 0px;
|
||||
}
|
||||
|
||||
.tvu span:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
.tvu {
|
||||
-webkit-animation: webkit-adjacent-element-selector-bugfix infinite 1s;
|
||||
}
|
||||
|
||||
@-webkit-keyframes webkit-adjacent-element-selector-bugfix {
|
||||
from {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#uploader {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
height: 28px;
|
||||
line-height: 24px;
|
||||
padding-left: 10px;
|
||||
background-color: #444;
|
||||
color: #EEE;
|
||||
}
|
||||
|
||||
#tree {
|
||||
position: absolute;
|
||||
top: 28px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 160px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#editor,
|
||||
#preview {
|
||||
position: absolute;
|
||||
top: 28px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 160px;
|
||||
border-left: 1px solid #EEE;
|
||||
}
|
||||
|
||||
#preview {
|
||||
background-color: #EEE;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#loader {
|
||||
position: absolute;
|
||||
top: 36%;
|
||||
right: 40%;
|
||||
}
|
||||
|
||||
.loader {
|
||||
z-index: 10000;
|
||||
border: 8px solid #b5b5b5;
|
||||
/* Grey */
|
||||
border-top: 8px solid #3498db;
|
||||
/* Blue */
|
||||
border-bottom: 8px solid #3498db;
|
||||
/* Blue */
|
||||
border-radius: 50%;
|
||||
width: 240px;
|
||||
height: 240px;
|
||||
animation: spin 2s linear infinite;
|
||||
display: none;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
if (typeof XMLHttpRequest === "undefined") {
|
||||
XMLHttpRequest = function () {
|
||||
try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e) { }
|
||||
try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e) { }
|
||||
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { }
|
||||
throw new Error("This browser does not support XMLHttpRequest.");
|
||||
};
|
||||
}
|
||||
|
||||
function ge(a) {
|
||||
return document.getElementById(a);
|
||||
}
|
||||
function ce(a) {
|
||||
return document.createElement(a);
|
||||
}
|
||||
|
||||
function sortByKey(array, key) {
|
||||
return array.sort(function (a, b) {
|
||||
var x = a[key]; var y = b[key];
|
||||
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var QueuedRequester = function () {
|
||||
this.queue = [];
|
||||
this.running = false;
|
||||
this.xmlhttp = null;
|
||||
}
|
||||
QueuedRequester.prototype = {
|
||||
_request: function (req) {
|
||||
this.running = true;
|
||||
if (!req instanceof Object) return;
|
||||
var that = this;
|
||||
|
||||
function ajaxCb(x, d) {
|
||||
return function () {
|
||||
if (x.readyState == 4) {
|
||||
ge("loader").style.display = "none";
|
||||
d.callback(x.status, x.responseText);
|
||||
if (that.queue.length === 0) that.running = false;
|
||||
if (that.running) that._request(that.queue.shift());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ge("loader").style.display = "block";
|
||||
|
||||
var p = "";
|
||||
if (req.params instanceof FormData) {
|
||||
p = req.params;
|
||||
} else if (req.params instanceof Object) {
|
||||
for (var key in req.params) {
|
||||
if (p === "")
|
||||
p += (req.method === "GET") ? "?" : "";
|
||||
else
|
||||
p += "&";
|
||||
p += encodeURIComponent(key) + "=" + encodeURIComponent(req.params[key]);
|
||||
};
|
||||
}
|
||||
|
||||
this.xmlhttp = new XMLHttpRequest();
|
||||
this.xmlhttp.onreadystatechange = ajaxCb(this.xmlhttp, req);
|
||||
if (req.method === "GET") {
|
||||
this.xmlhttp.open(req.method, req.url + p, true);
|
||||
this.xmlhttp.send();
|
||||
} else {
|
||||
this.xmlhttp.open(req.method, req.url, true);
|
||||
if (p instanceof String)
|
||||
this.xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
this.xmlhttp.send(p);
|
||||
}
|
||||
},
|
||||
stop: function () {
|
||||
if (this.running) this.running = false;
|
||||
if (this.xmlhttp && this.xmlhttp.readyState < 4) {
|
||||
this.xmlhttp.abort();
|
||||
}
|
||||
},
|
||||
add: function (method, url, params, callback) {
|
||||
this.queue.push({ url: url, method: method, params: params, callback: callback });
|
||||
if (!this.running) {
|
||||
this._request(this.queue.shift());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var requests = new QueuedRequester();
|
||||
|
||||
function createFileUploader(element, tree, editor) {
|
||||
var xmlHttp;
|
||||
|
||||
var refresh = ce("button");
|
||||
refresh.innerHTML = 'Refresh List';
|
||||
ge(element).appendChild(refresh);
|
||||
|
||||
var input = ce("input");
|
||||
input.type = "file";
|
||||
input.multiple = false;
|
||||
input.name = "data";
|
||||
input.id = "upload-select";
|
||||
ge(element).appendChild(input);
|
||||
|
||||
var path = ce("input");
|
||||
path.id = "upload-path";
|
||||
path.type = "text";
|
||||
path.name = "path";
|
||||
path.defaultValue = "/";
|
||||
ge(element).appendChild(path);
|
||||
|
||||
var button = ce("button");
|
||||
button.innerHTML = 'Upload';
|
||||
ge(element).appendChild(button);
|
||||
|
||||
var mkfile = ce("button");
|
||||
mkfile.innerHTML = 'Create';
|
||||
ge(element).appendChild(mkfile);
|
||||
|
||||
var filename = ce("input");
|
||||
filename.id = "editor-filename";
|
||||
filename.type = "text";
|
||||
filename.disabled = true;
|
||||
filename.size = 20;
|
||||
ge(element).appendChild(filename);
|
||||
|
||||
var savefile = ce("button");
|
||||
savefile.innerHTML = ' Save ';
|
||||
ge(element).appendChild(savefile);
|
||||
|
||||
function httpPostProcessRequest(status, responseText) {
|
||||
if (status != 200)
|
||||
alert("ERROR[" + status + "]: " + responseText);
|
||||
else
|
||||
tree.refreshPath(path.value);
|
||||
}
|
||||
function createPath(p) {
|
||||
var formData = new FormData();
|
||||
formData.append("path", p);
|
||||
requests.add("PUT", "/edit", formData, httpPostProcessRequest);
|
||||
}
|
||||
|
||||
mkfile.onclick = function (e) {
|
||||
createPath(path.value);
|
||||
editor.loadUrl(path.value);
|
||||
path.value = "/";
|
||||
};
|
||||
|
||||
savefile.onclick = function (e) {
|
||||
editor.execCommand('saveCommand');
|
||||
};
|
||||
|
||||
refresh.onclick = function (e) {
|
||||
tree.refreshPath(path.value);
|
||||
};
|
||||
|
||||
button.onclick = function (e) {
|
||||
if (input.files.length === 0) {
|
||||
return;
|
||||
}
|
||||
var formData = new FormData();
|
||||
formData.append("data", input.files[0], path.value);
|
||||
requests.add("POST", "/edit", formData, httpPostProcessRequest);
|
||||
var uploadPath = ge("upload-path");
|
||||
uploadPath.value = "/";
|
||||
var uploadSelect = ge("upload-select");
|
||||
uploadSelect.value = "";
|
||||
};
|
||||
input.onchange = function (e) {
|
||||
if (input.files.length === 0) return;
|
||||
var filename = input.files[0].name;
|
||||
var ext = /(?:\.([^.]+))?$/.exec(filename)[1];
|
||||
var name = /(.*)\.[^.]+$/.exec(filename)[1];
|
||||
if (typeof name !== undefined) {
|
||||
filename = name;
|
||||
}
|
||||
path.value = "/" + filename + "." + ext;
|
||||
};
|
||||
}
|
||||
|
||||
function createTree(element, editor) {
|
||||
var preview = ge("preview");
|
||||
var treeRoot = ce("div");
|
||||
treeRoot.className = "tvu";
|
||||
ge(element).appendChild(treeRoot);
|
||||
|
||||
function loadDownload(path) {
|
||||
ge('download-frame').src = "/edit?download=" + path;
|
||||
}
|
||||
|
||||
function loadPreview(path) {
|
||||
var edfname = ge("editor-filename");
|
||||
edfname.value = path;
|
||||
ge("editor").style.display = "none";
|
||||
preview.style.display = "block";
|
||||
preview.innerHTML = '<img src="/edit?edit=' + path + '&_cb=' + Date.now() + '" style="max-width:100%; max-height:100%; margin:auto; display:block;" />';
|
||||
}
|
||||
|
||||
function fillFileMenu(el, path) {
|
||||
var list = ce("ul");
|
||||
el.appendChild(list);
|
||||
var action = ce("li");
|
||||
list.appendChild(action);
|
||||
if (isImageFile(path)) {
|
||||
action.innerHTML = "<span>Preview</span>";
|
||||
action.onclick = function (e) {
|
||||
loadPreview(path);
|
||||
if (document.body.getElementsByClassName('cm').length > 0) document.body.removeChild(el);
|
||||
};
|
||||
} else if (isTextFile(path)) {
|
||||
action.innerHTML = "<span>Edit</span>";
|
||||
action.onclick = function (e) {
|
||||
editor.loadUrl(path);
|
||||
if (document.body.getElementsByClassName('cm').length > 0) document.body.removeChild(el);
|
||||
};
|
||||
}
|
||||
var download = ce("li");
|
||||
list.appendChild(download);
|
||||
download.innerHTML = "<span>Download</span>";
|
||||
download.onclick = function (e) {
|
||||
loadDownload(path);
|
||||
if (document.body.getElementsByClassName('cm').length > 0) document.body.removeChild(el);
|
||||
};
|
||||
var delFile = ce("li");
|
||||
list.appendChild(delFile);
|
||||
delFile.innerHTML = "<span>Delete</span>";
|
||||
delFile.onclick = function (e) {
|
||||
httpDelete(path);
|
||||
if (document.body.getElementsByClassName('cm').length > 0) document.body.removeChild(el);
|
||||
};
|
||||
}
|
||||
|
||||
function showContextMenu(event, path, isfile) {
|
||||
var divContext = ce("div");
|
||||
var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
|
||||
var scrollLeft = document.body.scrollLeft ? document.body.scrollLeft : document.documentElement.scrollLeft;
|
||||
var left = event.clientX + scrollLeft;
|
||||
var top = event.clientY + scrollTop;
|
||||
divContext.className = 'cm';
|
||||
divContext.style.display = 'block';
|
||||
divContext.style.left = left + 'px';
|
||||
divContext.style.top = top + 'px';
|
||||
fillFileMenu(divContext, path);
|
||||
document.body.appendChild(divContext);
|
||||
var width = divContext.offsetWidth;
|
||||
var height = divContext.offsetHeight;
|
||||
divContext.onmouseout = function (e) {
|
||||
if (e.clientX < left || e.clientX > (left + width) || e.clientY < top || e.clientY > (top + height)) {
|
||||
if (document.body.getElementsByClassName('cm').length > 0) document.body.removeChild(divContext);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function createTreeLeaf(path, name, size) {
|
||||
var leaf = ce("li");
|
||||
leaf.id = name;
|
||||
var label = ce("span");
|
||||
label.innerHTML = name;
|
||||
leaf.appendChild(label);
|
||||
leaf.onclick = function (e) {
|
||||
if (isTextFile(leaf.id.toLowerCase())) {
|
||||
editor.loadUrl(leaf.id);
|
||||
} else if (isImageFile(leaf.id.toLowerCase())) {
|
||||
loadPreview(leaf.id);
|
||||
}
|
||||
};
|
||||
leaf.oncontextmenu = function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
showContextMenu(e, leaf.id, true);
|
||||
};
|
||||
return leaf;
|
||||
}
|
||||
|
||||
function addList(parent, path, items) {
|
||||
sortByKey(items, 'name');
|
||||
var list = ce("ul");
|
||||
parent.appendChild(list);
|
||||
var ll = items.length;
|
||||
for (var i = 0; i < ll; i++) {
|
||||
if (items[i].type === "file")
|
||||
list.appendChild(createTreeLeaf(path, items[i].name, items[i].size));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function isTextFile(path) {
|
||||
var ext = /(?:\.([^.]+))?$/.exec(path)[1];
|
||||
if (typeof ext !== undefined) {
|
||||
switch (ext) {
|
||||
case "cnv":
|
||||
case "txt":
|
||||
case "htm":
|
||||
case "html":
|
||||
case "js":
|
||||
case "css":
|
||||
case "xml":
|
||||
case "json":
|
||||
case "conf":
|
||||
case "ini":
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isImageFile(path) {
|
||||
var ext = /(?:\.([^.]+))?$/.exec(path)[1];
|
||||
if (typeof ext !== undefined) {
|
||||
switch (ext) {
|
||||
case "png":
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
case "gif":
|
||||
case "bmp":
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
this.refreshPath = function (path) {
|
||||
treeRoot.removeChild(treeRoot.childNodes[0]);
|
||||
httpGet(treeRoot, "/");
|
||||
};
|
||||
|
||||
function delCb(path) {
|
||||
return function (status, responseText) {
|
||||
if (status != 200) {
|
||||
alert("ERROR[" + status + "]: " + responseText);
|
||||
} else {
|
||||
treeRoot.removeChild(treeRoot.childNodes[0]);
|
||||
httpGet(treeRoot, "/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function httpDelete(filename) {
|
||||
var formData = new FormData();
|
||||
formData.append("path", filename);
|
||||
requests.add("DELETE", "/edit", formData, delCb(filename));
|
||||
}
|
||||
|
||||
function getCb(parent, path) {
|
||||
return function (status, responseText) {
|
||||
if (status == 200)
|
||||
addList(parent, path, JSON.parse(responseText));
|
||||
}
|
||||
}
|
||||
|
||||
function httpGet(parent, path) {
|
||||
requests.add("GET", "/edit", { list: path }, getCb(parent, path));
|
||||
}
|
||||
|
||||
httpGet(treeRoot, "/");
|
||||
return this;
|
||||
}
|
||||
|
||||
function createEditor(element, file, lang, theme, type) {
|
||||
function getLangFromFilename(filename) {
|
||||
var lang = "plain";
|
||||
var ext = /(?:\.([^.]+))?$/.exec(filename)[1];
|
||||
if (typeof ext !== undefined) {
|
||||
switch (ext) {
|
||||
case "cnv": lang = "plain"; break;
|
||||
case "txt": lang = "plain"; break;
|
||||
case "hex": lang = "plain"; break;
|
||||
case "conf": lang = "plain"; break;
|
||||
case "htm": lang = "html"; break;
|
||||
case "js": lang = "javascript"; break;
|
||||
case "css":
|
||||
case "scss":
|
||||
case "php":
|
||||
case "html":
|
||||
case "json":
|
||||
case "xml":
|
||||
case "ini": lang = ext;
|
||||
}
|
||||
}
|
||||
return lang;
|
||||
}
|
||||
|
||||
if (typeof file === "undefined") file = "/index.html";
|
||||
|
||||
if (typeof lang === "undefined") {
|
||||
lang = getLangFromFilename(file);
|
||||
}
|
||||
|
||||
if (typeof theme === "undefined") theme = "textmate";
|
||||
|
||||
if (typeof type === "undefined") {
|
||||
type = "text/" + lang;
|
||||
if (lang === "c_cpp") type = "text/plain";
|
||||
}
|
||||
|
||||
var editor = ace.edit(element);
|
||||
function httpPostProcessRequest(status, responseText) {
|
||||
if (status != 200) alert("ERROR[" + status + "]: " + responseText);
|
||||
}
|
||||
function httpPost(filename, data, type) {
|
||||
var formData = new FormData();
|
||||
formData.append("data", new Blob([data], { type: type }), filename);
|
||||
requests.add("POST", "/edit", formData, httpPostProcessRequest);
|
||||
}
|
||||
function httpGetProcessRequest(status, responseText) {
|
||||
ge("preview").style.display = "none";
|
||||
ge("editor").style.display = "block";
|
||||
if (status == 200)
|
||||
editor.setValue(responseText);
|
||||
else
|
||||
editor.setValue("");
|
||||
editor.clearSelection();
|
||||
}
|
||||
function httpGet(theUrl) {
|
||||
requests.add("GET", "/edit", { edit: theUrl }, httpGetProcessRequest);
|
||||
}
|
||||
|
||||
if (lang !== "plain") editor.getSession().setMode("ace/mode/" + lang);
|
||||
editor.setTheme("ace/theme/" + theme);
|
||||
editor.$blockScrolling = Infinity;
|
||||
editor.getSession().setUseSoftTabs(true);
|
||||
editor.getSession().setTabSize(2);
|
||||
editor.setHighlightActiveLine(true);
|
||||
editor.setShowPrintMargin(false);
|
||||
editor.commands.addCommand({
|
||||
name: 'saveCommand',
|
||||
bindKey: { win: 'Ctrl-S', mac: 'Command-S' },
|
||||
exec: function (editor) {
|
||||
httpPost(file, editor.getValue() + "", type);
|
||||
},
|
||||
readOnly: false
|
||||
});
|
||||
editor.commands.addCommand({
|
||||
name: 'undoCommand',
|
||||
bindKey: { win: 'Ctrl-Z', mac: 'Command-Z' },
|
||||
exec: function (editor) {
|
||||
editor.getSession().getUndoManager().undo(false);
|
||||
},
|
||||
readOnly: false
|
||||
});
|
||||
editor.commands.addCommand({
|
||||
name: 'redoCommand',
|
||||
bindKey: { win: 'Ctrl-Shift-Z', mac: 'Command-Shift-Z' },
|
||||
exec: function (editor) {
|
||||
editor.getSession().getUndoManager().redo(false);
|
||||
},
|
||||
readOnly: false
|
||||
});
|
||||
editor.loadUrl = function (filename) {
|
||||
var edfname = ge("editor-filename");
|
||||
edfname.value = filename;
|
||||
file = filename;
|
||||
lang = getLangFromFilename(file);
|
||||
type = "text/" + lang;
|
||||
if (lang !== "plain") editor.getSession().setMode("ace/mode/" + lang);
|
||||
httpGet(file);
|
||||
};
|
||||
return editor;
|
||||
}
|
||||
function onBodyLoad() {
|
||||
var vars = {};
|
||||
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) { vars[key] = value; });
|
||||
var editor = createEditor("editor", vars.file, vars.lang, vars.theme);
|
||||
var tree = createTree("tree", editor);
|
||||
createFileUploader("uploader", tree, editor);
|
||||
if (typeof vars.file === "undefined") vars.file = "/dev_conf.txt";
|
||||
editor.loadUrl(vars.file);
|
||||
};
|
||||
</script>
|
||||
<script id='ace' src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/ace.js" type="text/javascript"
|
||||
charset="utf-8"></script>
|
||||
<script>
|
||||
if (typeof ace.edit == "undefined") {
|
||||
var script = document.createElement('script');
|
||||
script.src = "/ace.js";
|
||||
script.async = false;
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="onBodyLoad();">
|
||||
<div id="loader" class="loader"></div>
|
||||
<div id="uploader"></div>
|
||||
<div id="tree"></div>
|
||||
<div id="editor"></div>
|
||||
<div id="preview" style="display:none;"></div>
|
||||
<iframe id=download-frame style='display:none;'></iframe>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
data/favicon.ico
Normal file
BIN
data/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
data/icon.jpeg
Normal file
BIN
data/icon.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
data/index.htm.gz
Normal file
BIN
data/index.htm.gz
Normal file
Binary file not shown.
69
data/index.json
Normal file
69
data/index.json
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"configs": [
|
||||
"/config.live.json",
|
||||
"/config.setup.json",
|
||||
"/lang/lang.ru.json"
|
||||
],
|
||||
"title": "Главная",
|
||||
"class": "col-sm-offset-1 col-sm-10 col-md-offset-2 col-md-8 col-lg-offset-3 col-lg-6",
|
||||
"content": [
|
||||
{
|
||||
"type": "h5",
|
||||
"title": "{{name}}",
|
||||
"class": "alert-default"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"class": "alert alert-light",
|
||||
"title": "<center><img src='/icon.jpeg' alt='IoT Manager'></center>"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Конфигурация устройства",
|
||||
"action": "/?set.device",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Список других устройств в сети",
|
||||
"action": "/?set.udp",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Конфигурация WIFI",
|
||||
"action": "/?set.wifi",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Конфигурация MQTT",
|
||||
"action": "/?set.mqtt",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Конфигурация push",
|
||||
"action": "/?set.push",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Утилиты",
|
||||
"action": "/?set.utilities",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Скачать приложение IoT Manager для android",
|
||||
"action": "https://play.google.com/store/apps/details?id=ru.esp8266.iotmanager",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Скачать приложение IoT Manager для iphone",
|
||||
"action": "https://apps.apple.com/ru/app/iot-manager/id1155934877",
|
||||
"class": "btn btn-block btn-default"
|
||||
}
|
||||
]
|
||||
}
|
||||
1
data/items/analog-adc.txt
Normal file
1
data/items/analog-adc.txt
Normal file
@@ -0,0 +1 @@
|
||||
analog-adc;id;anydata;Сенсоры;Аналоговый;order;pin-adc;map[1,1024,1,1024];c[1]
|
||||
1
data/items/button-in.txt
Normal file
1
data/items/button-in.txt
Normal file
@@ -0,0 +1 @@
|
||||
button-in;id;toggle;Кнопки;Освещение;order;pin;db[20]
|
||||
1
data/items/button-out-i.txt
Normal file
1
data/items/button-out-i.txt
Normal file
@@ -0,0 +1 @@
|
||||
button-out;id;toggle;Кнопки;Освещение;order;pin;inv[1];st[1]
|
||||
1
data/items/button-out-np.txt
Normal file
1
data/items/button-out-np.txt
Normal file
@@ -0,0 +1 @@
|
||||
button-out;id;toggle;Кнопки;Освещение;order;st[0]
|
||||
1
data/items/button-out-p.txt
Normal file
1
data/items/button-out-p.txt
Normal file
@@ -0,0 +1 @@
|
||||
button-out;id;toggle;Кнопки;Освещение;order;pin;st[0]
|
||||
1
data/items/input-digit.txt
Normal file
1
data/items/input-digit.txt
Normal file
@@ -0,0 +1 @@
|
||||
input-digit;id;inputDigit;Ввод;Введите#цифру;order;st[60]
|
||||
1
data/items/input-time.txt
Normal file
1
data/items/input-time.txt
Normal file
@@ -0,0 +1 @@
|
||||
input-time;id;inputTime;Ввод;Введите#время;order;st[10-00-00]
|
||||
1
data/items/output-text.txt
Normal file
1
data/items/output-text.txt
Normal file
@@ -0,0 +1 @@
|
||||
output-text;id;anydata;Вывод;Сигнализация;order;st[Обнаружено#движение]
|
||||
1
data/items/pwm-out.txt
Normal file
1
data/items/pwm-out.txt
Normal file
@@ -0,0 +1 @@
|
||||
pwm-out;id;range;Ползунки;Яркость;order;pin;st[500]
|
||||
5
data/items/signs.json
Normal file
5
data/items/signs.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"more":">",
|
||||
"less":"<",
|
||||
"eq":"="
|
||||
}
|
||||
BIN
data/js/build.chart.js.gz
Normal file
BIN
data/js/build.chart.js.gz
Normal file
Binary file not shown.
BIN
data/js/function.js.gz
Normal file
BIN
data/js/function.js.gz
Normal file
Binary file not shown.
39
data/lang/lang.ru.json
Normal file
39
data/lang/lang.ru.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"SetDevConf": "Конфигурация устройства",
|
||||
"SetDevPreset": "Выберите из списка подходящий пресет кофигурации",
|
||||
|
||||
"ButSave":"Сохранить",
|
||||
"ButMainPage":"Главная",
|
||||
|
||||
|
||||
"SetUDPList": "Список других устройств в сети:",
|
||||
"SetUDPWarn1": "После нажатия на кнопку <b>переформировать список устройств</b> ждите примерно минуту, а затем обновите страницу и список появится вновь",
|
||||
|
||||
"SetUDPUpdateList":"Переформировать список устройств",
|
||||
"SetUDPUpdatePage":"Обновить страницу",
|
||||
"SetUDPNameOfDev":"Имя этого устройства:",
|
||||
"SetUDPDateExchange":"Включить обмен данными между устройствами",
|
||||
"SetUDPWarn2":"Если обмен данными включен, то устройства будут обмениваться широковещательными пакетами udp для формирования списка устройств и для осуществления посылки настроек mqtt. Данный обмен создает дополнительную нагрузку на wifi сеть.",
|
||||
|
||||
"SetWiFiNameOfDev":"Имя устройства:",
|
||||
"SetWiFiRouterConnect":"Подключение к WiFi роутеру:",
|
||||
"SetWiFiAccessPoint":"Точка доступа:",
|
||||
"SetWiFiWeb":"Логин и пароль web interface:",
|
||||
"SetWiFiTimeZone":"Временная зона:",
|
||||
"SetWiFiNTP":"Сервер NTP:",
|
||||
"SetWiFiWarn1":"Имя устройства должно состоять из английских букв и иметь длинну от 6 до 12 символов",
|
||||
"SetWiFiWarn2":"После того как вы введете логин пароль от вашего wifi роутера необходимо нажать кнопку сохранить, а затем обязательно нажать кнопку <b>перезагрузить устройство</b> внизу этой страницы",
|
||||
"SetWiFiWarn3":"Устройство постоянно сканирует сеть на наличие wifi. Если роутер отключен, то устройство автоматически перейдет в режим точки доступа. Когда wifi появится устройство автоматически подключится к роутеру снова, и выключит точку доступа",
|
||||
"SetWiFiWarn4":"После изменения поля <b>NTP сервер</b> необходимо перезагрузить устройство",
|
||||
"SetWiFiWarn5":"Светодиод статуса подключения показывает четыре состояния подключения: <br><b>1. мигает редко</b> - идет подключение к wifi <br><b>2. мигает часто</b> - идет подключение к серверу mqtt <br><b>3. горит постоянно</b> - модуль в режиме точки доступа, <br><b>4. не горит</b> - модуль подключен к wifi и к mqtt. <br>Светодиод подключен к gpio2. Если галочка стоит - то использовать этот пин нельзя",
|
||||
|
||||
"SetMQTTServerName":"Имя сервера:",
|
||||
"SetMQTTPort":"Номер порта:",
|
||||
"SetMQTTPrefix":"Префикс:",
|
||||
"SetMQTTUserName":"Имя пользователя:",
|
||||
"SetMQTTPassword":"Пароль:",
|
||||
|
||||
"SetMQTTSendSettings":"Отправить настройки MQTT с этого устройства на все остальные",
|
||||
"SetMQTTWarn1":"Обратите внимание что поле префикс может состоять только из одного слова и одного разделителя: <b>/prefix</b>, вариант вида: <b>/prefix1/prefix2</b> работать не будет. После изменения поля prefix необходимо перезагрузить устройство",
|
||||
"SetMQTTWarn2":"Прежде чем нажимать на кнопку <b>Отправить настройки MQTT</b> сохрание их, если Вы их меняли. Настройки получат и перезапишут все устройства в локальной сети"
|
||||
}
|
||||
1
data/s.conf.csv
Normal file
1
data/s.conf.csv
Normal file
@@ -0,0 +1 @@
|
||||
Тип элемента;Id;Виджет;Имя вкладки;Имя виджета;Позиция виджета
|
||||
|
1
data/s.scen.txt
Normal file
1
data/s.scen.txt
Normal file
@@ -0,0 +1 @@
|
||||
//
|
||||
143
data/set.device.json
Normal file
143
data/set.device.json
Normal file
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"configs": [
|
||||
"/config.setup.json",
|
||||
"/config.option.json",
|
||||
"/config.live.json",
|
||||
"/lang/lang.ru.json"
|
||||
],
|
||||
"class": "col-sm-offset-1 col-sm-10",
|
||||
"content": [
|
||||
{
|
||||
"type": "h5",
|
||||
"title": "{{name}}",
|
||||
"class": "alert-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "{{ButMainPage}}",
|
||||
"action": "/",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "Device ID: {{chipID}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "IP address: {{ip}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "Time: {{time}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "Uptime: {{uptime}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "Build version: {{firmware_version}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "LittleFS version: 2.4.0"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "dropdown",
|
||||
"name": "help-url",
|
||||
"class": "btn btn-default",
|
||||
"style": "display:inline",
|
||||
"title": {
|
||||
"#": "Выберите элемент из списка<span class=\"caret\"></span>",
|
||||
"/set?addItem=button-out-p": "1.Кнопка управляющая пином",
|
||||
"/set?addItem=button-out-np": "2.Кнопка не привязанная к пину",
|
||||
"/set?addItem=pwm-out": "3.Широтно импульсная модуляция(pwm)",
|
||||
"/set?addItem=button-in": "4.Физическая кнопка",
|
||||
"/set?addItem=input-digit": "5.Окно ввода цифровых значений",
|
||||
"/set?addItem=input-time": "6.Окно ввода времени",
|
||||
"/set?addItem=output-text": "7.Окно вывода любого текста, предупреждения, цифры",
|
||||
"/set?addItem=analog-adc": "8.Аналоговый сенсор"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "csv",
|
||||
"title": [
|
||||
"html",
|
||||
"text",
|
||||
"text",
|
||||
"text",
|
||||
"text",
|
||||
"text"
|
||||
],
|
||||
"state": "s.conf.csv",
|
||||
"style": "width:100%;",
|
||||
"action": "/set?saveItems",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Удалить все",
|
||||
"action": "/set?delAllItems",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "h2",
|
||||
"title": "Сценарии"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"name": "scen",
|
||||
"title": "Включить сценарии",
|
||||
"action": "/set?scen=[[scen]]",
|
||||
"state": "{{scen}}"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"state": "s.scen.txt",
|
||||
"style": "width:100%;height:350px",
|
||||
"title": "Сохранить",
|
||||
"action": "/set?sceninit",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Инструкция к системе автоматизации",
|
||||
"action": "https://github.com/IoTManagerProject/IoTManager/wiki",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Очистить логи сенсоров",
|
||||
"action": "/set?cleanlog",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"name": "my-block",
|
||||
"style": "position:fixed;top:50%;left:50%;width:400px;margin-left:-200px;text-align:center;",
|
||||
"class": "hidden"
|
||||
},
|
||||
{
|
||||
"type": "button",
|
||||
"title": "Обновить прошивку устройства",
|
||||
"action": "/check",
|
||||
"response": "[[my-block]]",
|
||||
"class": "btn btn-block btn-default"
|
||||
}
|
||||
]
|
||||
}
|
||||
143
data/set.deviceold.json
Normal file
143
data/set.deviceold.json
Normal file
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"configs": [
|
||||
"/config.setup.json",
|
||||
"/config.option.json",
|
||||
"/config.live.json",
|
||||
"/lang/lang.ru.json"
|
||||
],
|
||||
"class": "col-sm-offset-1 col-sm-10",
|
||||
"content": [
|
||||
{
|
||||
"type": "h5",
|
||||
"title": "{{name}}",
|
||||
"class": "alert-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "{{ButMainPage}}",
|
||||
"action": "/",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "Device ID: {{chipID}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "IP address: {{ip}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "Time: {{time}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "Uptime: {{uptime}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "Build version: {{firmware_version}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "LittleFS version: 2.3.5"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "dropdown",
|
||||
"name": "help-url",
|
||||
"class": "btn btn-default",
|
||||
"style": "display:inline",
|
||||
"title": {
|
||||
"#": "{{SetDevPreset}}<span class=\"caret\"></span>",
|
||||
"/set?preset=001": "1.Вкл. выкл. локального реле",
|
||||
"/set?preset=002": "2.Вкл. выкл. локального реле в определенное время",
|
||||
"/set?preset=003": "3.Вкл. выкл. локального реле на определенный период времени",
|
||||
"/set?preset=004": "4.Вкл. выкл. нескольких локальных реле кнопкой в приложении",
|
||||
"/set?preset=005": "5.Вкл. выкл. локального реле физической кнопкой и кнопкой в приложении параллельно (для выключателя света)",
|
||||
"/set?preset=006": "6.Вкл. выкл. нескольких удаленных реле кнопкой в приложении (нужно указать Device ID)",
|
||||
"/set?preset=007": "7.Вкл. выкл. нескольких удаленных реле физической кнопкой (нужно указать Device ID)",
|
||||
"/set?preset=008": "8.Широтно импульсная модуляция",
|
||||
"/set?preset=009": "9.Сенсор DHT11 (темп, влажность) и логгирование",
|
||||
"/set?preset=010": "10.Сенсор DHT22, DHT33, DHT44, AM2302, RHT03 (темп, влажность) и логгирование",
|
||||
"/set?preset=011": "11.Аналоговый сенсор и логгирование",
|
||||
"/set?preset=012": "12.Cенсор bmp280 (темп, давление) и логгирование",
|
||||
"/set?preset=013": "13.Cенсор bme280 (темп, давление, влажность, высота) и логгирование",
|
||||
"/set?preset=014": "14.Сенсор DS18B20 (темп) и логгирование",
|
||||
"/set?preset=015": "15.Термостат на DS18B20 с переключением в ручной режим и логгированием",
|
||||
"/set?preset=016": "16.Котроль уровня в баке (датчик расстояния) на сенсорах: JSN-SR04T, HC-SR04, HY-SRF05 и логгирование",
|
||||
"/set?preset=017": "17.Датчик движения включающий свет",
|
||||
"/set?preset=018": "18.Охранный датчик движения",
|
||||
"/set?preset=019": "19.Система управления шаговыми двигателями на основе драйвера A4988 (открытие закрытие штор)",
|
||||
"/set?preset=020": "20.Система управления сервоприводами",
|
||||
"/set?preset=021": "21.Модуль uart (serial). Двухстороняя связь с устройством через uart. Получение данных и отправка команд",
|
||||
"/set?preset=100": "22.Настройки по умолчанию"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "h2",
|
||||
"title": "{{SetDevConf}}"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"state": "dev_conf.txt",
|
||||
"style": "width:100%;height:350px",
|
||||
"title": "Сохранить",
|
||||
"action": "/set?devinit",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "h2",
|
||||
"title": "Сценарии"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"name": "scen",
|
||||
"title": "Включить сценарии",
|
||||
"action": "/set?scen=[[scen]]",
|
||||
"state": "{{scen}}"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"state": "dev_scen.txt",
|
||||
"style": "width:100%;height:350px",
|
||||
"title": "Сохранить",
|
||||
"action": "/set?sceninit",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Инструкция к системе автоматизации",
|
||||
"action": "https://github.com/DmitryBorisenko33/esp32-esp8266_iot-manager_modules_firmware/wiki/Instruction",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Очистить логи сенсоров",
|
||||
"action": "/set?cleanlog",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"name": "my-block",
|
||||
"style": "position:fixed;top:50%;left:50%;width:400px;margin-left:-200px;text-align:center;",
|
||||
"class": "hidden"
|
||||
},
|
||||
{
|
||||
"type": "button",
|
||||
"title": "Обновить прошивку устройства",
|
||||
"action": "/check",
|
||||
"response": "[[my-block]]",
|
||||
"class": "btn btn-block btn-default"
|
||||
}
|
||||
]
|
||||
}
|
||||
133
data/set.mqtt.json
Normal file
133
data/set.mqtt.json
Normal file
@@ -0,0 +1,133 @@
|
||||
{
|
||||
"configs": [
|
||||
"/config.setup.json",
|
||||
"/lang/lang.ru.json"
|
||||
],
|
||||
"class": "col-sm-offset-1 col-sm-10 col-md-offset-2 col-md-8 col-lg-offset-3 col-lg-6",
|
||||
"content": [
|
||||
{
|
||||
"type": "h5",
|
||||
"title": "{{name}}",
|
||||
"class": "alert-default"
|
||||
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "{{ButMainPage}}",
|
||||
"action": "/",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "{{SetMQTTServerName}}",
|
||||
"style": "width:60%;float:left;"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "",
|
||||
"name": "mqttServer-arg",
|
||||
"state": "{{mqttServer}}",
|
||||
"style": "width:40%;float:right"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "{{SetMQTTPort}}",
|
||||
"style": "width:60%;float:left;"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "",
|
||||
"name": "mqttPort-arg",
|
||||
"state": "{{mqttPort}}",
|
||||
"style": "width:40%;float:right"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "{{SetMQTTPrefix}}",
|
||||
"style": "width:60%;float:left;"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "",
|
||||
"name": "mqttPrefix-arg",
|
||||
"state": "{{mqttPrefix}}",
|
||||
"style": "width:40%;float:right"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "{{SetMQTTUserName}}",
|
||||
"style": "width:60%;float:left;"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "",
|
||||
"name": "mqttUser-arg",
|
||||
"state": "{{mqttUser}}",
|
||||
"style": "width:40%;float:right"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "{{SetMQTTPassword}}",
|
||||
"style": "width:60%;float:left;"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "",
|
||||
"name": "mqttPass-arg",
|
||||
"state": "{{mqttPass}}",
|
||||
"style": "width:40%;float:right"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"name": "my-block",
|
||||
"style": "position:fixed;top:30%;left:50%;width:400px;margin-left:-200px;text-align:center;",
|
||||
"class": "hidden"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "button",
|
||||
"title": "{{ButSave}}",
|
||||
"style": "width:100%;float:left;",
|
||||
"action": "set?mqttServer=[[mqttServer-arg]]&mqttPort=[[mqttPort-arg]]&mqttPrefix=[[mqttPrefix-arg]]&mqttUser=[[mqttUser-arg]]&mqttPass=[[mqttPass-arg]]",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "button",
|
||||
"style": "width:100%;float:left;",
|
||||
"title": "{{SetMQTTSendSettings}}",
|
||||
"action": "set?mqttsend",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
|
||||
{
|
||||
"type": "button",
|
||||
"style": "width:100%;float:left;",
|
||||
"title": "Проверить соединение с MQTT",
|
||||
"action": "set?mqttcheck",
|
||||
"response": "[[my-block]]",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"style": "width:100%;float:left;",
|
||||
"title": "<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #F5F5F5; padding: 10px;'>{{SetMQTTWarn1}}</p></font></div>"
|
||||
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"style": "width:100%;float:left;",
|
||||
"title": "<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #F5F5F5; padding: 10px;'>{{SetMQTTWarn2}}</p></font></div>"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"style": "width:100%;float:left;",
|
||||
"title": "Перезагрузить устройство",
|
||||
"action": "javascript:if(confirm(renameBlock(jsonResponse,'Перезагрузить?'))){send_request(this,'/restart?device=ok');}",
|
||||
"class": "btn btn-block btn-danger"
|
||||
}
|
||||
]
|
||||
}
|
||||
51
data/set.push.json
Normal file
51
data/set.push.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"configs": [
|
||||
"/config.setup.json",
|
||||
"/lang/lang.ru.json"
|
||||
],
|
||||
"class": "col-sm-offset-1 col-sm-10 col-md-offset-2 col-md-8 col-lg-offset-3 col-lg-6",
|
||||
"content": [
|
||||
{
|
||||
"type": "h5",
|
||||
"title": "{{name}}",
|
||||
"class": "alert-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "{{ButMainPage}}",
|
||||
"action": "/",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"style": "width:60%;float:left;",
|
||||
"title": "Device id:"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "",
|
||||
"name": "push-arg",
|
||||
"style": "width:40%;float:right",
|
||||
"state": "{{pushingboxid}}"
|
||||
},
|
||||
{
|
||||
"type": "button",
|
||||
"title": "{{ButSave}}",
|
||||
"action": "set?pushingboxid=[[push-arg]]",
|
||||
"class": "btn btn-block btn-default",
|
||||
"style": "width:100%;display:inline"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Перезагрузить устройство",
|
||||
"action": "javascript:if(confirm(renameBlock(jsonResponse,'Перезагрузить?'))){send_request(this,'/restart?device=ok');}",
|
||||
"class": "btn btn-block btn-danger"
|
||||
}
|
||||
]
|
||||
}
|
||||
96
data/set.udp.json
Normal file
96
data/set.udp.json
Normal file
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"configs": [
|
||||
"/config.setup.json",
|
||||
"/lang/lang.ru.json"
|
||||
],
|
||||
"title": "Главная",
|
||||
"class": "col-sm-offset-1 col-sm-10 col-md-offset-2 col-md-8 col-lg-offset-3 col-lg-6",
|
||||
"content": [
|
||||
{
|
||||
"type": "h5",
|
||||
"title": "{{name}}",
|
||||
"class": "alert-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "{{ButMainPage}}",
|
||||
"action": "/",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"title": "{{SetUDPList}}"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "csv",
|
||||
"title": [
|
||||
"html",
|
||||
"html",
|
||||
"html"
|
||||
],
|
||||
"state": "dev.csv",
|
||||
"style": "width:100%;",
|
||||
"class": "nan"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "{{SetUDPUpdateList}}",
|
||||
"action": "/set?updatelist",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "{{SetUDPUpdatePage}}",
|
||||
"action": "/set?updatepage",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"title": "<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #F5F5F5; padding: 10px;'>{{SetUDPWarn1}}</p></font></div>",
|
||||
"style": "width:100%;float:left;"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"title": "{{SetUDPNameOfDev}}"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "{{SetUDPNameOfDev}}",
|
||||
"name": "devname-arg",
|
||||
"state": "{{name}}",
|
||||
"pattern": "[A-Za-z0-9]{6,12}"
|
||||
},
|
||||
{
|
||||
"type": "button",
|
||||
"title": "{{ButSave}}",
|
||||
"action": "/set?devname=[[devname-arg]]",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"name": "udponoff",
|
||||
"title": "{{SetUDPDateExchange}}",
|
||||
"action": "/set?udponoff=[[udponoff]]",
|
||||
"state": "{{udponoff}}"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"title": "<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #F5F5F5; padding: 10px;'>{{SetUDPWarn2}}</p></font></div>"
|
||||
}
|
||||
]
|
||||
}
|
||||
39
data/set.utilities.json
Normal file
39
data/set.utilities.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"configs": [
|
||||
"/config.live.json",
|
||||
"/config.setup.json",
|
||||
"/lang/lang.ru.json"
|
||||
],
|
||||
"title": "Главная",
|
||||
"class": "col-sm-offset-1 col-sm-10 col-md-offset-2 col-md-8 col-lg-offset-3 col-lg-6",
|
||||
"content": [
|
||||
{
|
||||
"type": "h5",
|
||||
"title": "{{name}}",
|
||||
"class": "alert-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "{{ButMainPage}}",
|
||||
"action": "/",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"title": "Сканирование шины i2c"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "{{i2c}}"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Сканировать",
|
||||
"action": "/set?i2c",
|
||||
"class": "btn btn-block btn-default"
|
||||
}
|
||||
]
|
||||
}
|
||||
185
data/set.wifi.json
Normal file
185
data/set.wifi.json
Normal file
@@ -0,0 +1,185 @@
|
||||
{
|
||||
"configs": [
|
||||
"/config.setup.json",
|
||||
"/lang/lang.ru.json"
|
||||
],
|
||||
"title": "Конфигурация",
|
||||
"class": "col-sm-offset-1 col-sm-10 col-md-offset-2 col-md-8 col-lg-offset-3 col-lg-6",
|
||||
"content": [
|
||||
{
|
||||
"type": "h5",
|
||||
"title": "{{name}}",
|
||||
"class": "alert-default"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "{{ButMainPage}}",
|
||||
"action": "/",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"title": "{{SetWiFiNameOfDev}}"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "{{SetWiFiNameOfDev}}",
|
||||
"name": "devname-arg",
|
||||
"state": "{{name}}",
|
||||
"pattern": "[A-Za-z0-9]{6,12}"
|
||||
},
|
||||
{
|
||||
"type": "button",
|
||||
"title": "{{ButSave}}",
|
||||
"action": "set?devname=[[devname-arg]]",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"title": "<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #F5F5F5; padding: 10px;'>{{SetWiFiWarn1}}</p></font></div>"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"title": "{{SetWiFiRouterConnect}}"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "",
|
||||
"name": "routerssid-arg",
|
||||
"state": "{{routerssid}}"
|
||||
},
|
||||
{
|
||||
"type": "password",
|
||||
"title": "",
|
||||
"name": "routerpass-arg",
|
||||
"state": "{{routerpass}}"
|
||||
},
|
||||
{
|
||||
"type": "button",
|
||||
"title": "{{ButSave}}",
|
||||
"class": "btn btn-block btn-default",
|
||||
"action": "set?routerssid=[[routerssid-arg]]&routerpass=[[routerpass-arg]]"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"title": "<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #F5F5F5; padding: 10px;'>{{SetWiFiWarn2}}</p></font></div>"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"name": "blink",
|
||||
"title": "Включить светодиод статуса подключения",
|
||||
"action": "/set?blink=[[blink]]",
|
||||
"state": "{{blink}}"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"title": "<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #F5F5F5; padding: 10px;'>{{SetWiFiWarn5}}</p></font></div>"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"title": "{{SetWiFiAccessPoint}}"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "",
|
||||
"name": "apssid-arg",
|
||||
"state": "{{apssid}}",
|
||||
"pattern": ".{1,20}"
|
||||
},
|
||||
{
|
||||
"type": "password",
|
||||
"title": "",
|
||||
"name": "appass-arg",
|
||||
"state": "{{appass}}",
|
||||
"pattern": ".{8,20}"
|
||||
},
|
||||
{
|
||||
"type": "button",
|
||||
"title": "{{ButSave}}",
|
||||
"action": "set?apssid=[[apssid-arg]]&appass=[[appass-arg]]",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"title": "<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #F5F5F5; padding: 10px;'>{{SetWiFiWarn3}}</p></font></div>"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"title": "{{SetWiFiWeb}}"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "Логин",
|
||||
"name": "weblogin-arg",
|
||||
"state": "{{weblogin}}",
|
||||
"pattern": ".{1,20}"
|
||||
},
|
||||
{
|
||||
"type": "password",
|
||||
"title": "Пароль",
|
||||
"name": "webpass-arg",
|
||||
"state": "{{webpass}}",
|
||||
"pattern": ".{1,20}"
|
||||
},
|
||||
{
|
||||
"type": "button",
|
||||
"title": "{{ButSave}}",
|
||||
"action": "set?weblogin=[[weblogin-arg]]&webpass=[[webpass-arg]]",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "h3",
|
||||
"title": "{{SetWiFiTimeZone}}"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "",
|
||||
"name": "timezone-arg",
|
||||
"state": "{{timezone}}",
|
||||
"pattern": ".{1,20}"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"title": "",
|
||||
"name": "ntp-arg",
|
||||
"state": "{{ntp}}"
|
||||
},
|
||||
{
|
||||
"type": "button",
|
||||
"title": "{{ButSave}}",
|
||||
"action": "set?timezone=[[timezone-arg]]&ntp=[[ntp-arg]]",
|
||||
"class": "btn btn-block btn-default"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"title": "<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #F5F5F5; padding: 10px;'>{{SetWiFiWarn4}}</p></font></div>"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"title": "Перезагрузить устройство",
|
||||
"action": "javascript:if(confirm(renameBlock(jsonResponse,'Перезагрузить?'))){send_request(this,'/set?device=ok');}",
|
||||
"class": "btn btn-block btn-danger"
|
||||
}
|
||||
]
|
||||
}
|
||||
6
data/widgets/alarm.json
Normal file
6
data/widgets/alarm.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"widget": "anydata",
|
||||
"icon": "body",
|
||||
"color": "red",
|
||||
"descrColor": "red"
|
||||
}
|
||||
5
data/widgets/anydata.json
Normal file
5
data/widgets/anydata.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"widget": "anydata",
|
||||
"after": "",
|
||||
"icon": ""
|
||||
}
|
||||
5
data/widgets/chart.json
Normal file
5
data/widgets/chart.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"widget": "chart",
|
||||
"series": "Temperature, °C",
|
||||
"dateFormat": "HH:mm"
|
||||
}
|
||||
7
data/widgets/fillgauge.json
Normal file
7
data/widgets/fillgauge.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"widget": "fillgauge",
|
||||
"circleColor": "#00FFFF",
|
||||
"textColor": "#FFFFFF",
|
||||
"waveTextColor": "#000000",
|
||||
"waveColor": "#00FFFF"
|
||||
}
|
||||
6
data/widgets/inputDate.json
Normal file
6
data/widgets/inputDate.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"widget" : "input",
|
||||
"size" : "small",
|
||||
"color" : "orange",
|
||||
"type" : "date"
|
||||
}
|
||||
5
data/widgets/inputDigit.json
Normal file
5
data/widgets/inputDigit.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"widget" : "input",
|
||||
"color" : "blue",
|
||||
"type" : "number"
|
||||
}
|
||||
6
data/widgets/inputText.json
Normal file
6
data/widgets/inputText.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"widget" : "input",
|
||||
"size" : "small",
|
||||
"color" : "orange",
|
||||
"type" : "text"
|
||||
}
|
||||
5
data/widgets/inputTime.json
Normal file
5
data/widgets/inputTime.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"widget" : "input",
|
||||
"color" : "blue",
|
||||
"type" : "time"
|
||||
}
|
||||
12
data/widgets/progress-line.json
Normal file
12
data/widgets/progress-line.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"widget": "progress-line",
|
||||
"icon": "sunny",
|
||||
"descrColor": "",
|
||||
"color": "",
|
||||
"max": "100",
|
||||
"background": "",
|
||||
"stroke": "10",
|
||||
"disabled": "",
|
||||
"before": "",
|
||||
"after": ""
|
||||
}
|
||||
11
data/widgets/progress-round.json
Normal file
11
data/widgets/progress-round.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"widget": "progress-round",
|
||||
"descrColor": "",
|
||||
"max": "100",
|
||||
"stroke": "20",
|
||||
"color": "#45ccce",
|
||||
"background": "#777",
|
||||
"before": "",
|
||||
"semicircle": "1",
|
||||
"after": ""
|
||||
}
|
||||
9
data/widgets/range.json
Normal file
9
data/widgets/range.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"widget" : "range",
|
||||
"descrColor": "red",
|
||||
"after" : "%",
|
||||
"k" : 0.0977,
|
||||
"min" : 0,
|
||||
"max" : 100,
|
||||
"debounce": 500
|
||||
}
|
||||
7
data/widgets/select.json
Normal file
7
data/widgets/select.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"widget" : "select",
|
||||
"size" : "small",
|
||||
"fill" : "outline",
|
||||
"options" : "["Zero item", "First item", "Second item"]",
|
||||
"status" : 2
|
||||
}
|
||||
5
data/widgets/toggle.json
Normal file
5
data/widgets/toggle.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"widget": "toggle",
|
||||
"icon": "",
|
||||
"iconOff": ""
|
||||
}
|
||||
Reference in New Issue
Block a user