Skip to content

Commit

Permalink
Fix front-end loading
Browse files Browse the repository at this point in the history
  • Loading branch information
SergiuToporjinschi committed Sep 5, 2021
1 parent bbcde49 commit 0d11249
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions nodes/heater/frontEnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
'use strict';
const displayModeFiles = {
buttons: {
html: './nodes/heater/frontEndButtons.html',
css: './nodes/heater/frontEndButtons.css'
html: '/frontEndButtons.html',
css: '/frontEndButtons.css'
},
slider: {
html: './nodes/heater/frontEndSlider.html',
css: './nodes/heater/frontEndSlider.css'
html: '/frontEndSlider.html',
css: '/frontEndSlider.css'
}
}

Expand All @@ -18,8 +18,8 @@ class FrontEnd {
getHTML(displayMode, isDark, theme) {
//TODO take in consideration isDark theme;
var fs = require('fs');
var cssContent = fs.readFileSync(displayModeFiles[displayMode || 'slider'].css, 'utf8');
var htmlContent = fs.readFileSync(displayModeFiles[displayMode || 'slider'].html, 'utf8');
var cssContent = fs.readFileSync(__dirname + displayModeFiles[displayMode || 'slider'].css, 'utf8');
var htmlContent = fs.readFileSync(__dirname + displayModeFiles[displayMode || 'slider'].html, 'utf8');
return '<style>' + cssContent + '</style>' + htmlContent;
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-heater-controller",
"version": "3.0.1",
"version": "3.0.2",
"contributors": [],
"engines": {
"node": ">=12.0.0"
Expand Down

0 comments on commit 0d11249

Please sign in to comment.