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..b07f0015 100644 --- a/Views/app_list.php +++ b/Views/app_list.php @@ -2,69 +2,204 @@ defined('EMONCMS_EXEC') or die('Restricted access'); global $path; ?> - + + +
-
-

+ -
+
+

-
-
- +
+
+ + + {{ apps.length }} +
+
+ + + + + + + + - - - + + - - - - - + - + + + + + +
+ ' : ''" + /> +
{{ app.id }}{{ app.app }} - {{ app.name }} - - - - {{ app.public ? '' : '' }} - - - - +
+ ' + app.name" + /> -
- - - +
{{ app.id }} +
+ {{ app.name }} + ">
-
- - +
+ +
+ + + + + + + + + + + +
-
+
+ + +
+ \ 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/app_model.php b/app_model.php index b468775e..969e2ef5 100644 --- a/app_model.php +++ b/app_model.php @@ -432,7 +432,7 @@ private function migrate_v2_9() { $main_result = $this->mysqli->query("SELECT `userid`, `data` FROM app_config"); while ($row = $main_result->fetch_object()) { - $userid = $row->userid; + $userid = (int) $row->userid; $applist = json_decode($row->data); if (gettype($applist)=="array" || $applist===null) $applist = new stdClass(); @@ -441,8 +441,13 @@ private function migrate_v2_9() { // print "Migrating app $name : $app for userid $row->userid\n"; // Check if app exists with this name in app table - $result = $this->mysqli->query("SELECT `id` FROM app WHERE `userid`='$userid' AND `name`='$name'"); - if ($result->num_rows) { + $stmt = $this->mysqli->prepare("SELECT `id` FROM app WHERE `userid`=? AND `name`=?"); + $stmt->bind_param("is", $userid, $name); + $stmt->execute(); + $stmt->store_result(); + $num_rows = $stmt->num_rows; + $stmt->close(); + if ($num_rows) { // App already exists (this should not happen) // print "App already exists\n"; } else { diff --git a/apps/OpenEnergyMonitor/co2monitor/co2monitor.php b/apps/OpenEnergyMonitor/co2monitor/co2monitor.php index 72a7e20b..b021d8fe 100644 --- a/apps/OpenEnergyMonitor/co2monitor/co2monitor.php +++ b/apps/OpenEnergyMonitor/co2monitor/co2monitor.php @@ -90,12 +90,8 @@ diff --git a/apps/OpenEnergyMonitor/config-nav.php b/apps/OpenEnergyMonitor/config-nav.php index 4b7b04d8..85297671 100644 --- a/apps/OpenEnergyMonitor/config-nav.php +++ b/apps/OpenEnergyMonitor/config-nav.php @@ -1,4 +1,4 @@ \ No newline at end of file +
  • +
  • + diff --git a/apps/OpenEnergyMonitor/costcomparison/costcomparison.php b/apps/OpenEnergyMonitor/costcomparison/costcomparison.php index 4cf0bfdb..781bc69d 100644 --- a/apps/OpenEnergyMonitor/costcomparison/costcomparison.php +++ b/apps/OpenEnergyMonitor/costcomparison/costcomparison.php @@ -11,7 +11,7 @@ - + diff --git a/apps/OpenEnergyMonitor/feedin/feedin.php b/apps/OpenEnergyMonitor/feedin/feedin.php index 8cee0da4..56d59a2f 100644 --- a/apps/OpenEnergyMonitor/feedin/feedin.php +++ b/apps/OpenEnergyMonitor/feedin/feedin.php @@ -12,7 +12,7 @@ - +
    diff --git a/apps/OpenEnergyMonitor/myboiler/myboiler.php b/apps/OpenEnergyMonitor/myboiler/myboiler.php index 7ad145db..bcae87a6 100644 --- a/apps/OpenEnergyMonitor/myboiler/myboiler.php +++ b/apps/OpenEnergyMonitor/myboiler/myboiler.php @@ -10,7 +10,7 @@ - + diff --git a/apps/OpenEnergyMonitor/myelectric2/myelectric2.php b/apps/OpenEnergyMonitor/myelectric2/myelectric2.php index 5b9a280c..1050c420 100644 --- a/apps/OpenEnergyMonitor/myelectric2/myelectric2.php +++ b/apps/OpenEnergyMonitor/myelectric2/myelectric2.php @@ -10,7 +10,7 @@ - +