From 8f45554a3552c751eadfa21f77aac663e472c0a6 Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 8 Mar 2022 18:18:00 +0100 Subject: [PATCH 1/4] #30: remove environment from ci workflow to always build defaults --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10258bc..bf2c408 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,5 +21,5 @@ jobs: pip install -U platformio - name: Build run: | - pio run -e m5stack-atom + pio run From 7649487d971b5cc720827d299262cd2a5ad3c438 Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 8 Mar 2022 18:32:49 +0100 Subject: [PATCH 2/4] #26: add hms and firmware type to filename, ensure loading of non existent boatData settings --- web/index.js | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/web/index.js b/web/index.js index d66723b..d9c1d66 100644 --- a/web/index.js +++ b/web/index.js @@ -857,15 +857,18 @@ function showXdrHelp(){ showOverlay(helpContent.innerHTML,true); } } -function formatDate(d){ +function formatDateForFilename(usePrefix,d){ + let rt=""; + if (usePrefix){ + let fwt=document.querySelector('.status-fwtype'); + if (fwt) rt=fwt.textContent; + } if (! d) d=new Date(); - let rt=""+d.getFullYear(); - let v=d.getMonth(); - if (v < 10) rt+="0"+v; - else rt+=v; - v=d.getDate(); - if (v < 10) rt+="0"+v; - else rt+=v; + [d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds()] + .forEach(function(v){ + if (v < 10) rt+="0"+v; + else rt+=""+v; + }) return rt; } function downloadData(data,name){ @@ -879,7 +882,7 @@ function downloadData(data,name){ function exportConfig(){ let data=getAllConfigs(true); if (! data) return; - downloadData(data,"config"+formatDate()+".json"); + downloadData(data,formatDateForFilename(true)+".json"); } function exportXdr(){ let data={}; @@ -893,7 +896,7 @@ function exportXdr(){ } data[name]=value; }) - downloadData(data,"xdr"+formatDate()+".json"); + downloadData(data,"xdr"+formatDateForFilename(true)+".json"); } function importJson(opt_keyPattern){ let clazz='importJson'; @@ -926,7 +929,12 @@ function importJson(opt_keyPattern){ for (let k in idata){ let del=document.querySelector('input[name='+k+']'); if (del){ - del.value=idata[k]; + if (del.tagName === 'SELECT'){ + setSelect(del,idata[k]); + } + else{ + del.value=idata[k]; + } let ev=new Event('change'); del.dispatchEvent(ev); } From ca7fb4ac13c7b0edc4b7bede49247aa270608a83 Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 8 Mar 2022 18:41:51 +0100 Subject: [PATCH 3/4] make input working for select fields --- web/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/index.js b/web/index.js index d9c1d66..5067fbd 100644 --- a/web/index.js +++ b/web/index.js @@ -918,7 +918,7 @@ function importJson(opt_keyPattern){ alert("file contains invalid key "+k); return; } - let del=document.querySelector('input[name='+k+']'); + let del=document.querySelector('[name='+k+']'); if (del){ hasOverwrites=true; } @@ -927,7 +927,7 @@ function importJson(opt_keyPattern){ if (!confirm("overwrite existing data?")) return; } for (let k in idata){ - let del=document.querySelector('input[name='+k+']'); + let del=document.querySelector('[name='+k+']'); if (del){ if (del.tagName === 'SELECT'){ setSelect(del,idata[k]); From e023d056df09c66a6810a9514d0dbbef687176ac Mon Sep 17 00:00:00 2001 From: andreas Date: Tue, 8 Mar 2022 18:53:44 +0100 Subject: [PATCH 4/4] update readme --- Readme.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Readme.md b/Readme.md index 491c0c5..dc23295 100644 --- a/Readme.md +++ b/Readme.md @@ -145,6 +145,12 @@ For details refer to the [example description](lib/exampletask/Readme.md). Changelog --------- +[20220308](../../releases/tag/20220308) +********* +* correctly handle select fields when importing the config +* better names for config save [#26](../../issues/26) +* remove -e in ci build [#30](../../issues/30) + [20220302](../../releases/tag/20220302) ********* * add export and import of config data.