alsmanager_lib 3.0.146 → 3.0.148

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 +97 -0
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -3163,6 +3163,7 @@ function buildDevicesQuery(queryList) {
3163
3163
  return whereClause;
3164
3164
  }
3165
3165
 
3166
+
3166
3167
  // End Device select
3167
3168
  // Select devices by details
3168
3169
  function getDevicesByDetailsSelectSQLite(search_criteria, details) {
@@ -3182,6 +3183,20 @@ function getDevicesByDetailsSelectSQLite(search_criteria, details) {
3182
3183
  query += "left join device_gestioni dg on d.id = dg.id_device ";
3183
3184
  if (search_criteria.in_consegna)
3184
3185
  query += "left join consegna_beni cb on d.id = cb.id_bene ";
3186
+ if (details) {
3187
+ if (search_criteria.search_type == "DESKTOP" || search_criteria.search_type == "NOTEBOOK") {
3188
+ query += "left join device_pc dd on d.id = dd.id_device ";
3189
+ }
3190
+ else if (search_criteria.search_type == "A") {
3191
+
3192
+ }
3193
+ else if (search_criteria.search_type == "B") {
3194
+
3195
+ }
3196
+ else if (search_criteria.search_type == "C") {
3197
+
3198
+ }
3199
+ }
3185
3200
 
3186
3201
  var where_clause = " where (d.is_removed is null or d.is_removed = 0) ";
3187
3202
  if (search_criteria.inv_code || search_criteria.dev_type || search_criteria.marca || search_criteria.dev_model || (search_criteria.is_PNRR && search_criteria.is_PNRR > 0) || search_criteria.dev_status || search_criteria.dev_gestione || search_criteria.no_inv || search_criteria.in_consegna) {
@@ -3250,6 +3265,88 @@ function getDevicesByDetailsSelectSQLite(search_criteria, details) {
3250
3265
  }
3251
3266
  }
3252
3267
  }
3268
+ if (details) {
3269
+ if (search_criteria.search_type == "DESKTOP" || search_criteria.search_type == "NOTEBOOK") {
3270
+ query += "left join device_pc dd on d.id = dd.id_device ";
3271
+ }
3272
+ else if (search_criteria.search_type == "A") {
3273
+
3274
+ }
3275
+ else if (search_criteria.search_type == "B") {
3276
+
3277
+ }
3278
+ else if (search_criteria.search_type == "C") {
3279
+
3280
+ }
3281
+ if (details.network || details.mac_address) {
3282
+ query += "left join device_networks dn on d.id = dn.id_device ";
3283
+ }
3284
+ if (details.storage) {
3285
+ query += "left join device_storages dr on d.id = dr.id_device ";
3286
+ }
3287
+ if (details.addon) {
3288
+ query += "left join device_addons don on d.id = don.id_device ";
3289
+ }
3290
+ }
3291
+ // Filtro su dettagli...
3292
+ if (details) {
3293
+ if (search_criteria.search_type == "DESKTOP" || search_criteria.search_type == "NOTEBOOK" || search_criteria.search_type == "TABLET" || search_criteria.search_type == "SMART TV" || search_criteria.search_type == "SERVER") {
3294
+ where_clause += " and ";
3295
+ if (details.os) {
3296
+ where_clause += "(dd.os = '" + details.os + "') ";
3297
+ if (details.version || details.storage || details.addon || details.network || details.storage || details.mac_address || details.name) {
3298
+ where_clause += " and ";
3299
+ }
3300
+ }
3301
+ if (details.os) {
3302
+ where_clause += "(dd.version = '" + details.version + "') ";
3303
+ if (details.storage || details.addon || details.network || details.mac_address || details.name) {
3304
+ where_clause += " and ";
3305
+ }
3306
+ }
3307
+ if (details.name) {
3308
+ where_clause += "(dd.pc_name = '" + details.name + "') ";
3309
+ if (details.storage || details.addon || details.network || details.mac_address) {
3310
+ where_clause += " and ";
3311
+ }
3312
+ }
3313
+
3314
+ }
3315
+ else if (search_criteria.search_type == "MONITOR") {
3316
+
3317
+ }
3318
+ else if (search_criteria.search_type == "SWITCH") {
3319
+
3320
+ }
3321
+ else if (search_criteria.search_type == "C") {
3322
+
3323
+ }
3324
+ if (details.network) {
3325
+ where_clause += "(dn.net_type = '" + details.network + "') ";
3326
+ if (details.storage || details.addon || details.network || details.mac_address) {
3327
+ where_clause += " and ";
3328
+ }
3329
+ }
3330
+ if (details.mac_address) {
3331
+ var mac_address_clean = details.mac_address.replaceAll(":","").replaceAll("-","").trim().toLowerCase();
3332
+ if (mac_address_clean != "") {
3333
+ where_clause += "lower(trim(replace(replace(dn.mac_address, ':', ''), '-', ''))) = '" + mac_address_clean + "') ";
3334
+ if (details.storage || details.addon) {
3335
+ where_clause += " and ";
3336
+ }
3337
+ }
3338
+ }
3339
+ if (details.storage) {
3340
+ where_clause += "(dr.storage_type = '" + details.storage + "') ";
3341
+ if (details.addon) {
3342
+ where_clause += " and ";
3343
+ }
3344
+ }
3345
+ if (details.addon) {
3346
+ where_clause += "(don.addon_type = '" + details.addon + "') ";
3347
+ }
3348
+ }
3349
+ // Esclusione
3253
3350
  if (search_criteria.id_dev_exclude > 0) {
3254
3351
  where_clause += " and d.id <> " + search_criteria.id_dev_exclude;
3255
3352
  }
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.146",
7
+ "version": "3.0.148",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",