Skip to content

Commit

Permalink
update RedMatic-HomeKit
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Dec 1, 2018
1 parent 0e911a0 commit 3909107
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addon_files/redmatic/var/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"node-red-contrib-time-range-switch": "0.6.1",
"redmatic-led": "1.0.0",
"redmatic-webapp": "0.2.1",
"redmatic-homekit": "0.7.7"
"redmatic-homekit": "0.7.8"
}
}
28 changes: 25 additions & 3 deletions addon_files/redmatic/www/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,10 @@ $(document).ready(() => {
}

function save() {
console.log(config);
$.post({
url: 'setconfig.cgi' + location.search,
data: JSON.stringify(config, null, ' '),
success: function (data) {
console.log(data);
if ($.trim(data) === 'ok') {
alert($alertSaved);
} else {
Expand All @@ -156,7 +154,6 @@ $(document).ready(() => {

$.get('getconfig.cgi' + location.search, (data, success) => {
config = JSON.parse(data);
console.log(config, success);
$loglevel.val(config.logging.ain.level);
$contextStorage.val(config.contextStorage.default.module);

Expand Down Expand Up @@ -401,5 +398,30 @@ $(document).ready(() => {
});
});

function setHeader(xhr) {
xhr.setRequestHeader('accept', 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*');
}

$.get('restart_count', data => {
$('#restarts').html(data || 'keine');
});

function download(filename, dataUrl) {

let link = document.createElement("a");
link.download = filename;
link.target = "_blank";

link.href = dataUrl;
document.body.appendChild(link);
link.click();

document.body.removeChild(link);
}

$('#log').on('click', () => {
download('redmatic.' + (new Date()).toISOString() + '.log', 'log.cgi' + location.search);
});

});

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"node-red-node-sqlite": "0.3.5",
"redmatic-led": "1.0.0",
"redmatic-webapp": "0.2.1",
"redmatic-homekit": "0.7.7",
"redmatic-homekit": "0.7.8",
"node-red-node-email": "1.0.6",
"node-red-node-rbe": "0.2.4",
"node-red-node-serialport": "0.6.8"
Expand Down

0 comments on commit 3909107

Please sign in to comment.