Skip to content

Commit

Permalink
[minimal] started working on the download function
Browse files Browse the repository at this point in the history
  • Loading branch information
Grovkillen committed Feb 21, 2020
1 parent 1075dc1 commit 59a6edf
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ module.exports = function(grunt) {
JSON.stringify(packageJSON,null,2)
);
grunt.file.write('release.txt',
'major:' + guiEasy.major + '\nminor:' + guiEasy.minor + '\nminimal:' + guiEasy.minimal + '\nrc:' + guiEasy.releaseCandidate
'timestamp:' + packageJSON.timestamp + '\nmajor:' + guiEasy.major + '\nminor:' + guiEasy.minor + '\nminimal:' + guiEasy.minimal + '\nrc:' + guiEasy.releaseCandidate + '\ndev:' + guiEasy.development
);
grunt.log.ok(version);
// add version as a property for the grunt ini loop
Expand Down
2 changes: 1 addition & 1 deletion build/0.0.nightly.1/gui.min.css

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions build/0.0.nightly.1/info/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
{
"name": "gui-easy",
"timestamp": 1578820861737,
"timestamp": 1582300231096,
"version": "0.0.1",
"author": "Jimmy 'Grovkillen' Westberg <jimmy@grovkillen.com> (https://grovkillen.com)",
"license": "GPL-3.0-or-later",
"description": "Front End for ESP Easy",
"bin": {
"main": {
"index.html.gz": "build/main/0.0.nightly.1/"
},
"repository": "github:letscontrolit/GUIEasy",
"repository": {
"type": "git",
"url": "git+https://github.com/letscontrolit/GUIEasy.git"
},
"license": "SEE LICENSE IN LICENSE.md",
"bugs": {
"url": "https://github.com/letscontrolit/GUIEasy/issues"
},
"homepage": "https://github.com/letscontrolit/GUIEasy#readme",
"devDependencies": {
"grunt": "^1.0.4",
"grunt-contrib-uglify-es": "^3.3.0",
Expand Down
4 changes: 3 additions & 1 deletion build/0.0.nightly.1/info/release.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
timestamp:1582300231096
major:0
minor:0
minimal:1
rc:0
rc:0
dev:true
2 changes: 1 addition & 1 deletion build/0.0.nightly.1/info/source_files.json

Large diffs are not rendered by default.

Binary file modified build/0.0.nightly.1/main/index.htm.gz
Binary file not shown.
Binary file modified build/0.0.nightly.1/mini/index.htm.gz
Binary file not shown.
Binary file modified build/0.0.nightly.1/noDash/index.htm.gz
Binary file not shown.
Binary file modified build/0.0.nightly.1/src-0.0.nightly.1.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gui-easy",
"timestamp": 1578820861737,
"timestamp": 1582300231096,
"version": "0.0.1",
"author": "Jimmy 'Grovkillen' Westberg <jimmy@grovkillen.com> (https://grovkillen.com)",
"description": "Front End for ESP Easy",
Expand Down Expand Up @@ -39,4 +39,4 @@
"GUI",
"Frontend"
]
}
}
18 changes: 17 additions & 1 deletion src/forms/gui_easy_forms_c005.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
/* GUIEasy Copyright (C) 2019-2020 Jimmy "Grovkillen" Westberg */

guiEasy.forms.controller.C005 = {};
guiEasy.forms.controller.C005.name = "Home Assistant (openHAB)";
guiEasy.forms.controller.C005.name = "home assistant (openhab)";
guiEasy.forms.controller.C005.category = "mqtt";
guiEasy.forms.controller.C005.state = "normal"; //normal, testing, development
//------------------------------- HTML or CURLY -------------------------------//
guiEasy.forms.controller.C005.html = `
{{IPorHOST--IP--C005-1--ip or hostname}}
{{IPorHOST--PORT--C005-2--C005-1--controller port}}
<hr>
{{IPorHOST--INTERVAL--C005-3--C005-1--minimum send interval}}
{{IPorHOST--QUE--C005-4--C005-1--max in que}}
{{IPorHOST--TRIES--C005-5--C005-1--max send tries}}
{{IPorHOST--QUE_ACTION--C005-6--C005-1--if full que, ignore new|if full que, delete oldest}}
{{IPorHOST--ACKNOWLEDGE--C005-7--C005-1--wait for ok when send|send and forget}}
<div id="c005-1-HOST" class="is-hidden">
{{STRING--settings-hostname--C005-1-HOST--controller hostname}}
{{NUMBER--settings-port--C005-2-HOST--controller port--0}}
{{NUMBER--settings-X--C005-3-HOST--minimum send interval--100}}
{{NUMBER--settings-X--C005-4-HOST--max in que--10}}
{{NUMBER--settings-X--C005-5-HOST--max send tries--10}}
{{TOGGLE--settings-X--C005-6-HOST--if full que, ignore new|if full que, delete oldest}}
{{TOGGLE--settings-X--C005-7-HOST--wait for ok when send|send and forget}}
</div>
<div id="c005-1-IP" class="is-hidden">
{{STRING--extra-ip--C005-1-IP--controller ip}}
{{NUMBER--extra-port--C005-2-IP--controller port--0}}
{{NUMBER--extra-X--C005-3-IP--minimum send interval--100}}
{{NUMBER--extra-X--C005-4-IP--max in que--10}}
{{NUMBER--extra-X--C005-5-IP--max send tries--10}}
{{TOGGLE--extra-X--C005-6-IP--if full que, ignore new|if full que, delete oldest}}
{{TOGGLE--extra-X--C005-7-IP--wait for ok when send|send and forget}}
</div>
`; //--------------------------- HTML or CURLY -------------------------------//

5 changes: 3 additions & 2 deletions src/gui_easy.css
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,9 @@ div.value-name.classic {
}
div.value-digits.classic {
margin: 2px;
padding-left: 2px;
padding-right: 2px;
padding-left: 5px;
padding-right: 5px;
padding-bottom: 2px;
border-radius: calc(0.25 * var(--default-height-size, 20) / var(--button-radius-size, 2));
border: 2px solid rgba(var(--main-inverted-color), 0.2);
background-color: var(--main-success-color-rgba, green);
Expand Down
37 changes: 31 additions & 6 deletions src/gui_easy_curly_forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ guiEasy.curly.forms.iporhost = function (x) {
`;
return html + "</div>";
}
if (x.args[0] === "port") {
if (
x.args[0] === "port" ||
x.args[0] === "interval" ||
x.args[0] === "que" ||
x.args[0] === "tries"
) {
let html = "<div class='row'>";
html += `
<input
Expand All @@ -31,15 +36,35 @@ guiEasy.curly.forms.iporhost = function (x) {
<label
class="number"
for="` + x.args[1] + `"
tabindex="0"
>` +
helpEasy.capitalWord(x.args[3])
+ `</label>
`;
return html + "</div>";
}
if (x.args[0] === "port") {

if (
x.args[0] === "que_action" ||
x.args[0] === "acknowledge"
) {
let html = "<div class='row'>";
let text = x.args[3].split("|");
html += `
<input
type="checkbox"
id="` + x.args[1] + `"
data-alt="settings-change"
data-iporhost="` + x.args[2] + `"
data-true-text="` + helpEasy.capitalWord(text[0]) + `"
data-false-text="` + helpEasy.capitalWord(text[1]) + `"
oninput='guiEasy.curly.forms.controllerSetup(this)'>
<label
class="checkbox"
for="` + x.args[1] + `"
tabindex="0"
>
</label>
`;
return html + "</div>";
}
};

Expand Down Expand Up @@ -67,7 +92,7 @@ guiEasy.curly.forms.string = function (x) {
return html + "</div>";
};

guiEasy.curly.forms.toggle = function (x) {;
guiEasy.curly.forms.toggle = function (x) {
let html = "<div class='row'>";
let text = x.args[2].split("|");
html += `
Expand All @@ -81,6 +106,7 @@ guiEasy.curly.forms.toggle = function (x) {;
data-settings-path="` + x.args[0] + `"
>
<label
class="checkbox"
for="` + x.args[1] + `"
tabindex="0"
>
Expand Down Expand Up @@ -113,7 +139,6 @@ guiEasy.curly.forms.number = function (x) {
<label
class="number"
for="` + x.args[1] + `"
tabindex="0"
>` +
helpEasy.capitalWord(x.args[2])
+ `</label>
Expand Down
3 changes: 2 additions & 1 deletion src/gui_easy_pitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ guiEasy.pitcher = function (processID, processType) {
helpEasy.getGuiInFields();
helpEasy.setCurrentIndex(-1);
if (window.location.hostname === "localhost") {
guiEasy.nodes.push({"ip":"192.168.73.164", "type":"queen"}); //THIS ONE IS USED TO RUN THE GUI FROM LOCALHOST
//guiEasy.nodes.push({"ip":"192.168.73.164", "type":"queen"}); //THIS ONE IS USED TO RUN THE GUI FROM LOCALHOST
guiEasy.nodes.push({"ip":"192.168.43.21", "type":"queen"}); //THIS ONE IS USED TO RUN THE GUI FROM LOCALHOST
} else {
guiEasy.nodes.push({"ip": window.location.hostname, "type":"queen"});
}
Expand Down
17 changes: 14 additions & 3 deletions src/index-minimal.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,23 @@
a.style.color = "red";
}
};
fetchData = function () {
const data = "";
return data;
fetchReleases = async function () {
let releases = "";
let timeStart = Date.now();
const releaseList = "https://raw.githubusercontent.com/letscontrolit/GUIEasy/master/build/releases.txt" + "?callback=" + timeStart;
await fetch(releaseList)
.then(res => res.text())
.then((list) => {
let temp = list.split(/\n/);
releases = temp;
});
return releases;
};
download = function () {
//start downloading gui
console.log(fetchReleases());
const t = document.getElementById("t"); //text
t.style.color = "red";
}
</script>
</head>
Expand Down

0 comments on commit 59a6edf

Please sign in to comment.