Skip to content

Commit

Permalink
fixed an issue (#46) when the attribute webname (Module FHEMWEB) is o…
Browse files Browse the repository at this point in the history
…ther than 'fhem'
  • Loading branch information
knowthelist committed Jan 24, 2024
1 parent 85622bc commit 7b89033
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions controls_ftui.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ UPD 2023-06-04_10:58:28 2118 www/ftui/examples/contents/mobile-power.html
UPD 2022-10-09_20:42:01 8248 www/ftui/examples/contents/mobile-shutter.html
UPD 2023-06-04_11:00:44 1866 www/ftui/examples/contents/mobile-solar.html
UPD 2022-10-07_22:48:38 3397 www/ftui/examples/contents/mobile-temp.html
UPD 2022-06-19_16:52:05 2637 www/ftui/examples/contents/mobile-view-sonos.html
UPD 2024-01-19_17:37:32 3035 www/ftui/examples/contents/mobile-view-sonos.html
UPD 2022-10-24_22:52:16 1378 www/ftui/examples/contents/mobile-view-vacuum.html
UPD 2021-02-01_19:44:46 189 www/ftui/examples/contents/mobile-view1.html
UPD 2022-10-24_23:02:44 2544 www/ftui/examples/contents/mobile-water.html
Expand Down Expand Up @@ -727,8 +727,8 @@ UPD 2020-12-31_16:39:06 49580 www/ftui/modules/chart.js/chartjs-adapter-date-fns
UPD 2021-02-04_22:43:17 8388 www/ftui/modules/circle-menu/circle-menu.js
UPD 2021-02-01_19:44:50 5063 www/ftui/modules/circle-menu/circle-menu.min.js
UPD 2022-05-25_18:05:01 14463 www/ftui/modules/ftui/fhem.service.js
UPD 2022-10-30_16:38:49 8285 www/ftui/modules/ftui/ftui.app.js
UPD 2024-01-17_14:18:17 12969 www/ftui/modules/ftui/ftui.binding.js
UPD 2024-01-24_21:38:22 8347 www/ftui/modules/ftui/ftui.app.js
UPD 2024-01-19_17:33:44 13029 www/ftui/modules/ftui/ftui.binding.js
UPD 2023-05-09_22:35:26 14297 www/ftui/modules/ftui/ftui.helper.js
UPD 2020-12-31_16:39:06 9247 www/ftui/modules/hocon/hocon.js
UPD 2020-12-31_16:39:06 3192 www/ftui/modules/hocon/hocon.min.js
Expand Down
9 changes: 6 additions & 3 deletions www/ftui/modules/ftui/ftui.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ class FtuiApp {
this.config.refreshDelay = this.getMetaString('refresh_restart_delay', 3);
// self path
const fhemUrl = this.getMetaString('fhemweb_url');
this.config.fhemDir = fhemUrl || window.location.origin + '/fhem/';
if (fhemUrl && new RegExp('^((?!http://|https://).)*$').test(fhemUrl)) {
this.config.fhemDir = window.location.origin + '/' + fhemUrl + '/';
if (fhemUrl) {
this.config.fhemDir = new RegExp('^((?!http://|https://).)*$').test(fhemUrl)
? window.location.origin + '/' + fhemUrl + '/'
: fhemUrl;
} else {
this.config.fhemDir = window.location.origin + '/' + location.pathname.split('/')[1] + '/';
}
this.config.fhemDir = this.config.fhemDir.replace('///', '//');
ftui.log(1, 'FHEM dir: ' + this.config.fhemDir);
Expand Down

0 comments on commit 7b89033

Please sign in to comment.