alsmanager_lib 1.0.88 → 1.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/modules.js +13 -3
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -1108,8 +1108,13 @@ function getDeviceConfigurationById(db_used, id_conf) {
1108
1108
  }
1109
1109
 
1110
1110
  function insertDeviceConfigurationSQLite(id_device, data, note) {
1111
+ var data_str = "";
1112
+ if (data) {
1113
+ var d = new Date(data);
1114
+ data_str = d.getFullYear() + "-" + String((d.getMonth() + 1)).padStart(2, '0') + "-" + String(d.getDate()).padStart(2, '0');
1115
+ }
1111
1116
  var query = "insert into device_changes (id_device, date_conf, note) values (";
1112
- query += id_device + ", '" + data + "', '" + note + "')";
1117
+ query += id_device + ", '" + data_str + "', '" + note + "')";
1113
1118
  return query;
1114
1119
  }
1115
1120
  function insertDeviceConfigurationMySQL(id_device, data, note) {
@@ -1133,8 +1138,13 @@ function insertDeviceConfiguration(db_used, id_device, data, note) {
1133
1138
  }
1134
1139
 
1135
1140
  function updateDeviceConfigurationSQLite(id_conf, data, note) {
1141
+ var data_str = "";
1142
+ if (data) {
1143
+ var d = new Date(data);
1144
+ data_str = d.getFullYear() + "-" + String((d.getMonth() + 1)).padStart(2, '0') + "-" + String(d.getDate()).padStart(2, '0');
1145
+ }
1136
1146
  var query = "update device_changes set ";
1137
- query += "date_conf = '" + data +"',";
1147
+ query += "date_conf = '" + data_str +"',";
1138
1148
  query += "note = '" + note + "' ";
1139
1149
  query += "where id = " + id_conf;
1140
1150
  return query;
@@ -1650,7 +1660,7 @@ function getPCPropertiesByConfigSQLite(id_device, id_conf) {
1650
1660
  query += "dp.RAM_GB as RAM, dp.note, dp.da_properties ";
1651
1661
  query += "from devices d ";
1652
1662
  query += "left join device_pc dp on d.id = dp.id_device ";
1653
- query += "where d.id = " + id_device;
1663
+ query += "where d.id = " + id_device + " ";
1654
1664
  if (id_conf > 0) {
1655
1665
  query += "and d.id in (select id_part from change_config where id_conf = " + id_conf + ")";
1656
1666
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alsmanager_lib",
3
- "version": "1.0.88",
3
+ "version": "1.0.90",
4
4
  "description": "Funzioni per ALSManager",
5
5
  "license": "ISC",
6
6
  "author": "Luca Cattani",