diff --git a/Lib/appconf/appconf.js b/Lib/appconf/appconf.js
index 3a6ea94c..7347e3c6 100644
--- a/Lib/appconf/appconf.js
+++ b/Lib/appconf/appconf.js
@@ -576,25 +576,26 @@ var config = {
}
-var vue_config = new Vue({
- el: '#vue-config',
- data: {
- app_name: "App Name",
- app_name_color: "#44b3e2",
- app_description: "",
- app_instructions: "",
- config_name: "",
- config_public: false,
- config_items: [],
- config_valid: false,
- autogen_node: "",
- autogen_feeds: [],
- autogen_all_present: false,
- autogen_status: "",
- autogen_status_color: "#aaa",
-
- // Button only currently used by myheatpump app.
- enable_process_daily: false
+var vue_config_app = Vue.createApp({
+ data: function() {
+ return {
+ app_name: "App Name",
+ app_name_color: "#44b3e2",
+ app_description: "",
+ app_instructions: "",
+ config_name: "",
+ config_public: false,
+ config_items: [],
+ config_valid: false,
+ autogen_node: "",
+ autogen_feeds: [],
+ autogen_all_present: false,
+ autogen_status: "",
+ autogen_status_color: "#aaa",
+
+ // Button only currently used by myheatpump app.
+ enable_process_daily: false
+ };
},
methods: {
@@ -833,4 +834,6 @@ var vue_config = new Vue({
config.reset_daily_data();
}
}
-});
\ No newline at end of file
+});
+
+var vue_config = vue_config_app.mount('#vue-config');
\ No newline at end of file
diff --git a/Lib/appconf/appconf.php b/Lib/appconf/appconf.php
index 146fb16d..ed5a3e02 100644
--- a/Lib/appconf/appconf.php
+++ b/Lib/appconf/appconf.php
@@ -5,9 +5,6 @@
$app_conf_version = time(); // Use timestamp for cache busting during development, replace with static version for production
?>
-
-
-
@@ -149,4 +146,4 @@
-
+
\ No newline at end of file
diff --git a/Views/app_list.php b/Views/app_list.php
index cc0c9054..d3185313 100644
--- a/Views/app_list.php
+++ b/Views/app_list.php
@@ -2,8 +2,6 @@
defined('EMONCMS_EXEC') or die('Restricted access');
global $path;
?>
-
-
@@ -61,10 +59,11 @@
\ No newline at end of file
diff --git a/Views/app_view.php b/Views/app_view.php
index 18642b01..b4e2dd25 100644
--- a/Views/app_view.php
+++ b/Views/app_view.php
@@ -1,108 +1,133 @@
-
-
+
-
Available Apps
-
Create a new instance of an app by clicking on one of the apps below.
+
Available Apps
+
Create a new instance of an app by clicking on one of the apps below.
-
+
-
Featured apps:
+
Featured apps:
-
-
-
{{ app.title }}
-
{{ app.description || "no description..." }}
-
-
-
-
-
All apps:
+
+
+
{{ entry.app.title }}
+
{{ entry.app.description || "no description..." }}
+
+
+
-
-
-
{{ app.title }}
-
{{ app.description || "no description..." }}
-
-
+
All apps:
-
+
+
+
{{ entry.app.title }}
+
{{ entry.app.description || "no description..." }}
+
+
-
+
-
+
+
diff --git a/apps/OpenEnergyMonitor/myheatpump/myheatpump.js b/apps/OpenEnergyMonitor/myheatpump/myheatpump.js
index 74863c73..5eebe2bf 100644
--- a/apps/OpenEnergyMonitor/myheatpump/myheatpump.js
+++ b/apps/OpenEnergyMonitor/myheatpump/myheatpump.js
@@ -1,3 +1,5 @@
+var urlParams = Object.fromEntries(new URLSearchParams(window.location.search));
+
feed.apikey = apikey;
feed.public_userid = public_userid;
feed.public_username = public_username;
@@ -107,7 +109,7 @@ var realtime_cop_div_mode = "30min";
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
// duration contants (milliseonds)
-const MINUTE = 60 * 1000;
+const MINUTE = 60;
const HOUR = 60 * MINUTE;
const DAY = 24 * HOUR;
@@ -207,14 +209,14 @@ function show() {
resize();
var date = new Date();
- var now = date.getTime();
+ var now = date.getTime() * 0.001;
- end = end_time * 1000;
+ end = end_time;
if (now - end > HOUR) {
$("#last_updated").show();
$("#live_table").hide();
- date.setTime(end);
+ date.setTime(end*1000);
let h = date.getHours();
let m = date.getMinutes();
if (h < 10) h = "0" + h;
@@ -248,13 +250,13 @@ function show() {
// If this is a new dashboard there will be less than a days data
// show power graph directly in this case
- var timeWindow = (end - start_time * 1000);
+ var timeWindow = (end - start_time);
if (timeWindow < 3 * DAY || viewmode == "powergraph") {
if (timeWindow > 3 * DAY) timeWindow = DAY;
var start = end - timeWindow;
- if (urlParams.start != undefined) start = urlParams.start * 1000;
- if (urlParams.end != undefined) end = urlParams.end * 1000;
+ if (urlParams.start != undefined) start = urlParams.start;
+ if (urlParams.end != undefined) end = urlParams.end;
if (urlParams.hours != undefined) start = end - urlParams.hours * HOUR;
view.start = start;
@@ -267,10 +269,10 @@ function show() {
} else {
var timeWindow = 30 * DAY;
var start = end - timeWindow;
- if (start < (start_time * 1000)) start = start_time * 1000;
+ if (start < start_time) start = start_time;
- if (urlParams.start != undefined) start = urlParams.start * 1000;
- if (urlParams.end != undefined) end = urlParams.end * 1000;
+ if (urlParams.start != undefined) start = urlParams.start;
+ if (urlParams.end != undefined) end = urlParams.end;
bargraph_load(start, end);
bargraph_draw();
@@ -506,9 +508,9 @@ $(".viewhistory").click(function () {
$(".powergraph-navigation").hide();
var timeWindow = 30 * DAY;
// var end = (new Date()).getTime();
- var end = end_time * 1000;
+ var end = end_time;
var start = end - timeWindow;
- if (start < (start_time * 1000)) start = start_time * 1000;
+ if (start < start_time) start = start_time;
if (last_bargraph_start && last_bargraph_end) {
start = last_bargraph_start;
@@ -523,13 +525,14 @@ $(".viewhistory").click(function () {
$("#advanced-block").hide();
});
-$('#placeholder').bind("plothover", function (event, pos, item) {
+document.getElementById('placeholder')?.addEventListener('plothover', function (event) {
+ const item = event.detail?.[1];
if (item) {
if (previousPoint != item.datapoint) {
previousPoint = item.datapoint;
$("#tooltip").remove();
- if (viewmode == "bargraph") {
+ if (viewmode == "bargraph") {
bargraph_tooltip(item);
} else if (viewmode == "powergraph") {
powergraph_tooltip(item);
@@ -539,16 +542,18 @@ $('#placeholder').bind("plothover", function (event, pos, item) {
});
// Auto click through to power graph
-$('#placeholder').bind("plotclick", function (event, pos, item) {
+document.getElementById('placeholder')?.addEventListener('plotclick', function (event) {
+ const item = event.detail?.[1];
if (item && !panning && viewmode == "bargraph") {
last_bargraph_start = bargraph_start;
last_bargraph_end = bargraph_end;
var z = item.dataIndex;
- view.start = data["heatpump_elec_kwhd"][z][0];
+ view.start = data["heatpump_elec_kwhd"][z][0]*1;
view.end = view.start + DAY;
viewmode = "powergraph";
+
powergraph_load();
$(".bargraph-navigation").hide();
@@ -562,7 +567,9 @@ $('#placeholder').bind("plotclick", function (event, pos, item) {
}
});
-$('#placeholder').bind("plotselected", function (event, ranges) {
+document.getElementById('placeholder')?.addEventListener('plotselected', function (event) {
+ const ranges = event.detail?.[0];
+ if (!ranges?.xaxis) return;
var start = ranges.xaxis.from;
var end = ranges.xaxis.to;
panning = true;
diff --git a/apps/OpenEnergyMonitor/myheatpump/myheatpump.php b/apps/OpenEnergyMonitor/myheatpump/myheatpump.php
index 3d0a699e..25afe320 100644
--- a/apps/OpenEnergyMonitor/myheatpump/myheatpump.php
+++ b/apps/OpenEnergyMonitor/myheatpump/myheatpump.php
@@ -6,16 +6,13 @@
-
-
-
-
-
-
-
-
-
-
+
@@ -394,8 +391,9 @@
config.db = ;
-
-
-
-
-
+
\ No newline at end of file
diff --git a/apps/OpenEnergyMonitor/myheatpump/myheatpump_bargraph.js b/apps/OpenEnergyMonitor/myheatpump/myheatpump_bargraph.js
index 47cffa06..42449873 100644
--- a/apps/OpenEnergyMonitor/myheatpump/myheatpump_bargraph.js
+++ b/apps/OpenEnergyMonitor/myheatpump/myheatpump_bargraph.js
@@ -52,9 +52,9 @@ function bargraph_load(start, end) {
$("#data-error").hide();
- var intervalms = DAY;
- end = Math.ceil(end / intervalms) * intervalms;
- start = Math.floor(start / intervalms) * intervalms;
+ var interval = DAY;
+ end = Math.ceil(end / interval) * interval;
+ start = Math.floor(start / interval) * interval;
bargraph_start = start;
bargraph_end = end;
@@ -67,7 +67,7 @@ function bargraph_load(start, end) {
// format is csv
$.ajax({
url: path + "app/getdailydata",
- data: { id: config.id, start: start*0.001, end: end*0.001, apikey: apikey },
+ data: { id: config.id, start: start, end: end, apikey: apikey },
async: false,
success: function (data) {
var rows = data.split("\n");
@@ -76,7 +76,7 @@ function bargraph_load(start, end) {
for (var z = 1; z < rows.length; z++) {
var cols = rows[z].split(",");
- var timestamp = cols[1] * 1000;
+ var timestamp = cols[1];
if (cols.length == fields.length) {
for (var i=2; i