iobroker.javascript 5.2.14 → 5.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -7
- package/admin/asset-manifest.json +3 -3
- package/admin/static/js/{main.7da5f873.chunk.js → main.305d6694.chunk.js} +2 -2
- package/admin/static/js/{main.7da5f873.chunk.js.map → main.305d6694.chunk.js.map} +1 -1
- package/admin/tab.html +1 -1
- package/io-package.json +13 -13
- package/lib/mirror.js +29 -14
- package/main.js +1 -1
- package/package.json +1 -1
package/admin/tab.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"><link rel="shortcut icon" href="favicon.ico"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="manifest.json"><script type="text/javascript" onerror="setTimeout(function(){window.location.reload()}, 5000)" src="./../../lib/js/socket.io.js"></script><title>Scripts</title><script type="text/javascript" src="google-blockly/blockly_compressed.js"></script><script type="text/javascript" src="google-blockly/msg/js/en.js"></script><script type="text/javascript" src="google-blockly/blocks_compressed.js"></script><script type="text/javascript" src="google-blockly/javascript_compressed.js"></script><script type="text/javascript" src="google-blockly/own/blocks_words.js"></script><script type="text/javascript" src="google-blockly/own/field_oid.js"></script><script type="text/javascript" src="google-blockly/own/field_cron.js"></script><script type="text/javascript" src="google-blockly/own/field_script.js"></script><script type="text/javascript" src="google-blockly/own/blocks_system.js"></script><script type="text/javascript" src="google-blockly/own/blocks_action.js"></script><script type="text/javascript" src="google-blockly/own/blocks_sendto.js"></script><script type="text/javascript" src="google-blockly/own/blocks_time.js"></script><script type="text/javascript" src="google-blockly/own/blocks_convert.js"></script><script type="text/javascript" src="google-blockly/own/blocks_trigger.js"></script><script type="text/javascript" src="google-blockly/own/blocks_procedures.js"></script><script type="text/javascript" src="google-blockly/own/blocks_timeout.js"></script><script type="text/javascript" src="google-blockly/own/blocks_switch.js"></script><style>.iobVerticalSplitter .layout-pane-primary{overflow:hidden!important}</style><link href="static/css/2.c0ede684.chunk.css" rel="stylesheet"><link href="static/css/main.f4231949.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><script>"dark"===(window.localStorage&&window.localStorage.getItem("App.theme"))&&(window.document.body.style.background="black")</script><div id="root"></div><xml id="toolbox" style="display:none"><category><block>%%CUSTOM_BLOCKS%%</block></category><sep></sep><category name="{catLogic}" colour="210"><block type="controls_if"></block><block type="logic_compare"></block><block type="logic_operation"></block><block type="logic_negate"></block><block type="logic_boolean"></block><block type="logic_null"></block><block type="logic_ternary"></block><block type="logic_switch_case"></block></category><category name="{catLoops}" colour="120"><block type="controls_repeat_ext"><value name="TIMES"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="controls_whileUntil"></block><block type="controls_for"><value name="FROM"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="math_number"><field name="NUM">10</field></shadow></value><value name="BY"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="controls_forEach"></block><block type="controls_flow_statements"></block></category><category name="{catMath}" colour="230"><block type="math_number"></block><block type="math_arithmetic"><value name="A"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="B"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="math_single"><value name="NUM"><shadow type="math_number"><field name="NUM">9</field></shadow></value></block><block type="math_trig"><value name="NUM"><shadow type="math_number"><field name="NUM">45</field></shadow></value></block><block type="math_constant"></block><block type="math_number_property"><value name="NUMBER_TO_CHECK"><shadow type="math_number"><field name="NUM">0</field></shadow></value></block><block type="math_change"><value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="math_round"><value name="NUM"><shadow type="math_number"><field name="NUM">3.1</field></shadow></value></block><block type="math_rndfixed"><value name="x"><shadow type="math_number"><field name="NUM">3.1234</field></shadow></value><value name="n"><shadow type="math_number"><field name="NUM">2</field></shadow></value></block><block type="math_on_list"></block><block type="math_modulo"><value name="DIVIDEND"><shadow type="math_number"><field name="NUM">64</field></shadow></value><value name="DIVISOR"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="math_constrain"><value name="VALUE"><shadow type="math_number"><field name="NUM">50</field></shadow></value><value name="LOW"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="HIGH"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="math_random_int"><value name="FROM"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="math_random_float"></block></category><category name="{catText}" colour="160"><block type="text"></block><block type="text_newline"></block><block type="text_multiline"></block><block type="text_join"></block><block type="text_append"><value name="TEXT"><shadow type="text"></shadow></value></block><block type="text_length"><value name="VALUE"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_isEmpty"><value name="VALUE"><shadow type="text"><field name="TEXT"></field></shadow></value></block><block type="text_indexOf"><value name="VALUE"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value><value name="FIND"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_charAt"><value name="VALUE"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value></block><block type="text_getSubstring"><value name="STRING"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value></block><block type="text_changeCase"><value name="TEXT"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_trim"><value name="TEXT"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block></category><category name="{catLists}" colour="260"><block type="lists_create_with"><mutation items="0"></mutation></block><block type="lists_create_with"></block><block type="lists_repeat"><value name="NUM"><shadow type="math_number"><field name="NUM">5</field></shadow></value></block><block type="lists_length"></block><block type="lists_isEmpty"></block><block type="lists_indexOf"><value name="VALUE"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_getIndex"><value name="VALUE"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_setIndex"><value name="LIST"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_getSublist"><value name="LIST"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_split"><value name="DELIM"><shadow type="text"><field name="TEXT">,</field></shadow></value></block><block type="lists_sort"></block></category><category name="{catColour}" colour="20"><block type="colour_picker"></block><block type="colour_random"></block><block type="colour_rgb"><value name="RED"><shadow type="math_number"><field name="NUM">100</field></shadow></value><value name="GREEN"><shadow type="math_number"><field name="NUM">50</field></shadow></value><value name="BLUE"><shadow type="math_number"><field name="NUM">0</field></shadow></value></block><block type="colour_blend"><value name="COLOUR1"><shadow type="colour_picker"><field name="COLOUR">#ff0000</field></shadow></value><value name="COLOUR2"><shadow type="colour_picker"><field name="COLOUR">#3333ff</field></shadow></value><value name="RATIO"><shadow type="math_number"><field name="NUM">0.5</field></shadow></value></block></category><sep></sep><category name="{catVariables}" colour="330" custom="VARIABLE"></category><category name="{catFunctions}" colour="290" custom="PROCEDURE"></category></xml><script>!function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++){var i=t[f];0!==o[i]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var f=this.webpackJsonpjs=this.webpackJsonpjs||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=i;t()}([])</script><script src="static/js/2.4cb12e81.chunk.js"></script><script src="static/js/main.7da5f873.chunk.js"></script><script type="text/javascript" src="vs/loader.js"></script><script type="text/javascript" src="vs/configure.js"></script></body></html>
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"><link rel="shortcut icon" href="favicon.ico"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="manifest.json"><script type="text/javascript" onerror="setTimeout(function(){window.location.reload()}, 5000)" src="./../../lib/js/socket.io.js"></script><title>Scripts</title><script type="text/javascript" src="google-blockly/blockly_compressed.js"></script><script type="text/javascript" src="google-blockly/msg/js/en.js"></script><script type="text/javascript" src="google-blockly/blocks_compressed.js"></script><script type="text/javascript" src="google-blockly/javascript_compressed.js"></script><script type="text/javascript" src="google-blockly/own/blocks_words.js"></script><script type="text/javascript" src="google-blockly/own/field_oid.js"></script><script type="text/javascript" src="google-blockly/own/field_cron.js"></script><script type="text/javascript" src="google-blockly/own/field_script.js"></script><script type="text/javascript" src="google-blockly/own/blocks_system.js"></script><script type="text/javascript" src="google-blockly/own/blocks_action.js"></script><script type="text/javascript" src="google-blockly/own/blocks_sendto.js"></script><script type="text/javascript" src="google-blockly/own/blocks_time.js"></script><script type="text/javascript" src="google-blockly/own/blocks_convert.js"></script><script type="text/javascript" src="google-blockly/own/blocks_trigger.js"></script><script type="text/javascript" src="google-blockly/own/blocks_procedures.js"></script><script type="text/javascript" src="google-blockly/own/blocks_timeout.js"></script><script type="text/javascript" src="google-blockly/own/blocks_switch.js"></script><style>.iobVerticalSplitter .layout-pane-primary{overflow:hidden!important}</style><link href="static/css/2.c0ede684.chunk.css" rel="stylesheet"><link href="static/css/main.f4231949.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><script>"dark"===(window.localStorage&&window.localStorage.getItem("App.theme"))&&(window.document.body.style.background="black")</script><div id="root"></div><xml id="toolbox" style="display:none"><category><block>%%CUSTOM_BLOCKS%%</block></category><sep></sep><category name="{catLogic}" colour="210"><block type="controls_if"></block><block type="logic_compare"></block><block type="logic_operation"></block><block type="logic_negate"></block><block type="logic_boolean"></block><block type="logic_null"></block><block type="logic_ternary"></block><block type="logic_switch_case"></block></category><category name="{catLoops}" colour="120"><block type="controls_repeat_ext"><value name="TIMES"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="controls_whileUntil"></block><block type="controls_for"><value name="FROM"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="math_number"><field name="NUM">10</field></shadow></value><value name="BY"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="controls_forEach"></block><block type="controls_flow_statements"></block></category><category name="{catMath}" colour="230"><block type="math_number"></block><block type="math_arithmetic"><value name="A"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="B"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="math_single"><value name="NUM"><shadow type="math_number"><field name="NUM">9</field></shadow></value></block><block type="math_trig"><value name="NUM"><shadow type="math_number"><field name="NUM">45</field></shadow></value></block><block type="math_constant"></block><block type="math_number_property"><value name="NUMBER_TO_CHECK"><shadow type="math_number"><field name="NUM">0</field></shadow></value></block><block type="math_change"><value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block><block type="math_round"><value name="NUM"><shadow type="math_number"><field name="NUM">3.1</field></shadow></value></block><block type="math_rndfixed"><value name="x"><shadow type="math_number"><field name="NUM">3.1234</field></shadow></value><value name="n"><shadow type="math_number"><field name="NUM">2</field></shadow></value></block><block type="math_on_list"></block><block type="math_modulo"><value name="DIVIDEND"><shadow type="math_number"><field name="NUM">64</field></shadow></value><value name="DIVISOR"><shadow type="math_number"><field name="NUM">10</field></shadow></value></block><block type="math_constrain"><value name="VALUE"><shadow type="math_number"><field name="NUM">50</field></shadow></value><value name="LOW"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="HIGH"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="math_random_int"><value name="FROM"><shadow type="math_number"><field name="NUM">1</field></shadow></value><value name="TO"><shadow type="math_number"><field name="NUM">100</field></shadow></value></block><block type="math_random_float"></block></category><category name="{catText}" colour="160"><block type="text"></block><block type="text_newline"></block><block type="text_multiline"></block><block type="text_join"></block><block type="text_append"><value name="TEXT"><shadow type="text"></shadow></value></block><block type="text_length"><value name="VALUE"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_isEmpty"><value name="VALUE"><shadow type="text"><field name="TEXT"></field></shadow></value></block><block type="text_indexOf"><value name="VALUE"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value><value name="FIND"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_charAt"><value name="VALUE"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value></block><block type="text_getSubstring"><value name="STRING"><block type="variables_get"><field name="VAR">{textVariable}</field></block></value></block><block type="text_changeCase"><value name="TEXT"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block><block type="text_trim"><value name="TEXT"><shadow type="text"><field name="TEXT">abc</field></shadow></value></block></category><category name="{catLists}" colour="260"><block type="lists_create_with"><mutation items="0"></mutation></block><block type="lists_create_with"></block><block type="lists_repeat"><value name="NUM"><shadow type="math_number"><field name="NUM">5</field></shadow></value></block><block type="lists_length"></block><block type="lists_isEmpty"></block><block type="lists_indexOf"><value name="VALUE"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_getIndex"><value name="VALUE"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_setIndex"><value name="LIST"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_getSublist"><value name="LIST"><block type="variables_get"><field name="VAR">{listVariable}</field></block></value></block><block type="lists_split"><value name="DELIM"><shadow type="text"><field name="TEXT">,</field></shadow></value></block><block type="lists_sort"></block></category><category name="{catColour}" colour="20"><block type="colour_picker"></block><block type="colour_random"></block><block type="colour_rgb"><value name="RED"><shadow type="math_number"><field name="NUM">100</field></shadow></value><value name="GREEN"><shadow type="math_number"><field name="NUM">50</field></shadow></value><value name="BLUE"><shadow type="math_number"><field name="NUM">0</field></shadow></value></block><block type="colour_blend"><value name="COLOUR1"><shadow type="colour_picker"><field name="COLOUR">#ff0000</field></shadow></value><value name="COLOUR2"><shadow type="colour_picker"><field name="COLOUR">#3333ff</field></shadow></value><value name="RATIO"><shadow type="math_number"><field name="NUM">0.5</field></shadow></value></block></category><sep></sep><category name="{catVariables}" colour="330" custom="VARIABLE"></category><category name="{catFunctions}" colour="290" custom="PROCEDURE"></category></xml><script>!function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++){var i=t[f];0!==o[i]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var f=this.webpackJsonpjs=this.webpackJsonpjs||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var a=0;a<f.length;a++)r(f[a]);var p=i;t()}([])</script><script src="static/js/2.4cb12e81.chunk.js"></script><script src="static/js/main.305d6694.chunk.js"></script><script type="text/javascript" src="vs/loader.js"></script><script type="text/javascript" src="vs/configure.js"></script></body></html>
|
package/io-package.json
CHANGED
|
@@ -20,8 +20,20 @@
|
|
|
20
20
|
"Apollon77 <iobroker@fischer-ka.de>",
|
|
21
21
|
"AlCalzone"
|
|
22
22
|
],
|
|
23
|
-
"version": "5.2.
|
|
23
|
+
"version": "5.2.15",
|
|
24
24
|
"news": {
|
|
25
|
+
"5.2.15": {
|
|
26
|
+
"en": "Added the monitoring of symlinks my mirroring\nFix two crash cases reported by Sentry",
|
|
27
|
+
"de": "Die Überwachung von Symlinks wurde meiner Spiegelung hinzugefügt\nBehebung von zwei Absturzfällen, die von Sentry gemeldet wurden",
|
|
28
|
+
"ru": "Добавлен мониторинг симлинков моего зеркалирования\nИсправить два случая сбоя, о которых сообщает Sentry",
|
|
29
|
+
"pt": "Adicionado o monitoramento de links simbólicos meu espelhamento\nCorrigir dois casos de falha relatados pelo Sentry",
|
|
30
|
+
"nl": "Toegevoegd de monitoring van symbolische links mijn mirroring\nHerstel twee crashgevallen gemeld door Sentry",
|
|
31
|
+
"fr": "Ajout de la surveillance des liens symboliques ma mise en miroir\nCorrection de deux cas de plantage signalés par Sentry",
|
|
32
|
+
"it": "Aggiunto il monitoraggio dei collegamenti simbolici al mio mirroring\nRisolti due casi di crash segnalati da Sentry",
|
|
33
|
+
"es": "Se agregó la supervisión de enlaces simbólicos a mi duplicación.\nArregle dos casos de fallas reportados por Sentry",
|
|
34
|
+
"pl": "Dodano monitorowanie dowiązań symbolicznych w moim dublowaniu\nNapraw dwa przypadki awarii zgłoszone przez Sentry",
|
|
35
|
+
"zh-cn": "添加了对符号链接的监控我的镜像\n修复 Sentry 报告的两个崩溃案例"
|
|
36
|
+
},
|
|
25
37
|
"5.2.14": {
|
|
26
38
|
"en": "Typings imrovement\nadded \"Solar noon\" to astro-list\nAllowed to define different states for reading and writing alias values",
|
|
27
39
|
"de": "Verbesserung der Eingaben\n\"Sonnenmittag\" zur Astro-Liste hinzugefügt\nErlaubt, verschiedene Zustände zum Lesen und Schreiben von Alias-Werten zu definieren",
|
|
@@ -93,18 +105,6 @@
|
|
|
93
105
|
"es": "Se corrigió la depuración de scripts.",
|
|
94
106
|
"pl": "Naprawiono debugowanie skryptów",
|
|
95
107
|
"zh-cn": "修复了脚本的调试"
|
|
96
|
-
},
|
|
97
|
-
"5.2.7": {
|
|
98
|
-
"en": "Fixed error in rules",
|
|
99
|
-
"de": "Fehler in den Regeln behoben",
|
|
100
|
-
"ru": "Исправлена ошибка в правилах",
|
|
101
|
-
"pt": "Erro corrigido nas regras",
|
|
102
|
-
"nl": "Fout in regels opgelost",
|
|
103
|
-
"fr": "Correction d'une erreur dans les règles",
|
|
104
|
-
"it": "Risolto errore nelle regole",
|
|
105
|
-
"es": "Error solucionado en las reglas",
|
|
106
|
-
"pl": "Naprawiono błąd w zasadach",
|
|
107
|
-
"zh-cn": "修正了规则错误"
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
"desc": {
|
package/lib/mirror.js
CHANGED
|
@@ -37,8 +37,7 @@ class Mirror {
|
|
|
37
37
|
try {
|
|
38
38
|
fs.mkdirSync(this.diskRoot);
|
|
39
39
|
} catch (e) {
|
|
40
|
-
this.log.error(`Cannot create directory ${this.diskRoot}: ${e}`);
|
|
41
|
-
return;
|
|
40
|
+
return this.log.error(`Cannot create directory ${this.diskRoot}: ${e}`);
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
|
|
@@ -65,18 +64,34 @@ class Mirror {
|
|
|
65
64
|
files.forEach(file => {
|
|
66
65
|
const name = path.join(root_, file).replace(/\\/g, '/');
|
|
67
66
|
const stat = fs.statSync(name);
|
|
68
|
-
|
|
67
|
+
|
|
68
|
+
if (stat.isDirectory()) {
|
|
69
|
+
this.watchFolders(name);
|
|
70
|
+
} else {
|
|
71
|
+
const lstat = fs.lstatSync(name);
|
|
72
|
+
if (!lstat.isSymbolicLink()) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const linkTarget = fs.realpathSync(name);
|
|
77
|
+
|
|
78
|
+
this.log.info(`Watch symlinked file ${name} -> ${linkTarget}`);
|
|
79
|
+
fs.watch(linkTarget, (eventType/*, _filename*/) => {
|
|
80
|
+
// Pretend the symlink source was changed.
|
|
81
|
+
this.log.debug(`File ${name} ${eventType}`);
|
|
82
|
+
this.onFileChange(eventType, name);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
69
85
|
});
|
|
70
86
|
} catch (err) {
|
|
71
|
-
this.log.warn(`Error while trying to watch folder ${root_}: ${err}`);
|
|
72
|
-
return;
|
|
87
|
+
return this.log.warn(`Error while trying to watch folder ${root_}: ${err}`);
|
|
73
88
|
}
|
|
74
89
|
|
|
75
90
|
if (!this.watchedFolder[root_]) {
|
|
76
91
|
this.log.info('Watch ' + root_);
|
|
77
|
-
this.watchedFolder[root_] = fs.watch(root_, (eventType,
|
|
78
|
-
this.log.debug(
|
|
79
|
-
this.onFileChange(eventType, root_ +
|
|
92
|
+
this.watchedFolder[root_] = fs.watch(root_, (eventType, fileName) => {
|
|
93
|
+
this.log.debug(`File ${root_}${fileName} ${eventType}`);
|
|
94
|
+
this.onFileChange(eventType, root_ + fileName);
|
|
80
95
|
});
|
|
81
96
|
|
|
82
97
|
this.watchedFolder[root_].on('error', err => {
|
|
@@ -221,7 +236,7 @@ class Mirror {
|
|
|
221
236
|
|
|
222
237
|
for (let o = objects.length - 1; o >= 0; o--) {
|
|
223
238
|
// if folder
|
|
224
|
-
if (this.dbList[dirDB + '.' + objects[o]].type === 'channel') {
|
|
239
|
+
if (this.dbList[dirDB + '.' + objects[o]] && this.dbList[dirDB + '.' + objects[o]].type === 'channel') {
|
|
225
240
|
// dive into
|
|
226
241
|
const nextPathDisk = JSON.parse(JSON.stringify(pathDisk));
|
|
227
242
|
nextPathDisk.push(objects[o]);
|
|
@@ -411,14 +426,14 @@ class Mirror {
|
|
|
411
426
|
if (this.dbList[id].common.source !== source) {
|
|
412
427
|
this.dbList[id].common.source = source;
|
|
413
428
|
this.dbList[id].ts = ts;
|
|
414
|
-
this.log.debug(
|
|
429
|
+
this.log.debug(`Update script ${id} in DB`);
|
|
415
430
|
this.dbList[id].from = this.from;
|
|
416
431
|
this.adapter.setForeignObject(id, this.dbList[id]);
|
|
417
432
|
} else {
|
|
418
433
|
this.dbList[id].ts = ts;
|
|
419
434
|
}
|
|
420
435
|
} else {
|
|
421
|
-
this.log.debug(
|
|
436
|
+
this.log.debug(`Create script ${id} in DB`);
|
|
422
437
|
const parts = id.split('.');
|
|
423
438
|
// new script
|
|
424
439
|
this.dbList[id] = {
|
|
@@ -440,7 +455,7 @@ class Mirror {
|
|
|
440
455
|
this.adapter.setForeignObject(id, this.dbList[id]);
|
|
441
456
|
}
|
|
442
457
|
} catch (e) {
|
|
443
|
-
this.log.error(
|
|
458
|
+
this.log.error(`Cannot read file ${file}: ${e}`);
|
|
444
459
|
}
|
|
445
460
|
} else if (event === 'delete' || event === 'rename') {
|
|
446
461
|
// there is a bug: just after creation of script on disk from ioBroker, "rename" event is generated!
|
|
@@ -479,10 +494,10 @@ class Mirror {
|
|
|
479
494
|
|
|
480
495
|
if (fs.existsSync(file)) {
|
|
481
496
|
try {
|
|
482
|
-
this.log.debug(
|
|
497
|
+
this.log.debug(`Delete ${file} on disk`);
|
|
483
498
|
fs.unlinkSync(file);
|
|
484
499
|
} catch (e) {
|
|
485
|
-
this.log.error(
|
|
500
|
+
this.log.error(`Cannot delete ${file}: ${e}`);
|
|
486
501
|
}
|
|
487
502
|
}
|
|
488
503
|
if (this.diskList[id]) {
|
package/main.js
CHANGED
|
@@ -410,7 +410,7 @@ function startAdapter(options) {
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
const n = getName(id);
|
|
413
|
-
let nn = context.objects[id].common.name;
|
|
413
|
+
let nn = context.objects[id].common ? context.objects[id].common.name : '';
|
|
414
414
|
|
|
415
415
|
if (nn && typeof nn === 'object') {
|
|
416
416
|
nn = nn[words.getLanguage()] || nn.en;
|