alsmanager_lib 3.0.16 → 3.0.17

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 +28 -0
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -2089,6 +2089,33 @@ function getPCPropertiesByConfig(db_used, id_device, id_conf) {
2089
2089
  }
2090
2090
  //End Manage PC Properties
2091
2091
  // Switch/Patch Properties
2092
+ function existsSwitchPatchPropertiesSQLite(id_device) {
2093
+ var query = "select count(*) as num from device_switch ";
2094
+ query += "where id_device = " + id_device;
2095
+ return query;
2096
+ }
2097
+ function existsSwitchPatchPropertiesMySQL(id_device) {
2098
+ var query = "select count(*) as num from device_switch ";
2099
+ query += "where id_device = :id_device";
2100
+ return query;
2101
+ }
2102
+ function existsSwitchPatchProperties(db_used, id_device) {
2103
+ var query = "";
2104
+ if (db_used) {
2105
+ switch (db_used) {
2106
+ case 'SQLITE':
2107
+ query = existsSwitchPatchPropertiesSQLite(id_device);
2108
+ break;
2109
+ case 'MYSQL':
2110
+ query = existsSwitchPatchPropertiesMySQL(id_device);
2111
+ break;
2112
+ case 'MYSQL2':
2113
+ query = existsSwitchPatchPropertiesSQLite(id_device);
2114
+ break;
2115
+ }
2116
+ }
2117
+ return query;
2118
+ }
2092
2119
  function getSwitchPatchPropertiesSQLite(id_device) {
2093
2120
  var query = "select d.id as Id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello,";
2094
2121
  query += "ds.num_ports as NumeroPorte ";
@@ -13097,6 +13124,7 @@ module.exports = {
13097
13124
  updatePCProperties,
13098
13125
  getLastPCPropertiesInserted,
13099
13126
  getPCPropertiesByConfig,
13127
+ existsSwitchPatchProperties,
13100
13128
  getSwitchPatchProperties,
13101
13129
  createSwitchPatchPropertiesMySQLObj,
13102
13130
  insertSwitchPatchProperties,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  ".": "./lib/modules.js",
5
5
  "./dbconn": "./lib/dbconn.js"
6
6
  },
7
- "version": "3.0.16",
7
+ "version": "3.0.17",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",