alsmanager_lib 3.0.142 → 3.0.143
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.
- package/lib/modules.js +34 -35
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -2834,21 +2834,26 @@ function queryOSVersionByFilter(os) {
|
|
|
2834
2834
|
return query;
|
|
2835
2835
|
}
|
|
2836
2836
|
|
|
2837
|
-
function queryStoragesByFilter() {
|
|
2838
|
-
var query = "";
|
|
2839
|
-
query += ""
|
|
2837
|
+
function queryStoragesByFilter(tipo) {
|
|
2838
|
+
var query = "select distinct ds.storage_type, st.name as version from device_storages ds ";
|
|
2839
|
+
query += "join storage_types st on st.id = ds.storage_type "
|
|
2840
|
+
query += "left join devices d on ds.id_device = d.id "
|
|
2841
|
+
query += "where d.type = '" + tipo + "' ";
|
|
2842
|
+
query += "order by st.exp_order";
|
|
2840
2843
|
return query;
|
|
2841
2844
|
}
|
|
2842
2845
|
|
|
2843
2846
|
function queryAddOnsByFilter() {
|
|
2844
|
-
var query = "";
|
|
2845
|
-
query += ""
|
|
2847
|
+
var query = "select distinct da.addon_type, aty.name from device_addons da ";
|
|
2848
|
+
query += "join addon_types aty on aty.id = da.storage_type "
|
|
2849
|
+
query += "order by aty.name";
|
|
2846
2850
|
return query;
|
|
2847
2851
|
}
|
|
2848
2852
|
|
|
2849
2853
|
function queryNetworksByFilter() {
|
|
2850
|
-
var query = "";
|
|
2851
|
-
query += ""
|
|
2854
|
+
var query = "select distinct dn.net_type, aty.name from device_networks dn ";
|
|
2855
|
+
query += "join network_types nty on nty.name = dn.net_type "
|
|
2856
|
+
query += "order by nty.name";
|
|
2852
2857
|
return query;
|
|
2853
2858
|
}
|
|
2854
2859
|
|
|
@@ -3351,9 +3356,7 @@ function getDevicesByDetailsSelectMySQL(search_criteria, details) {
|
|
|
3351
3356
|
}
|
|
3352
3357
|
}
|
|
3353
3358
|
}
|
|
3354
|
-
|
|
3355
|
-
where_clause += " and d.id <> :id_dev_exclude";
|
|
3356
|
-
}
|
|
3359
|
+
|
|
3357
3360
|
if (details) {
|
|
3358
3361
|
if (search_criteria.search_type == "DESKTOP" || search_criteria.search_type == "NOTEBOOK") {
|
|
3359
3362
|
query += "left join device_pc dd on d.id = dd.id_device ";
|
|
@@ -3377,73 +3380,69 @@ function getDevicesByDetailsSelectMySQL(search_criteria, details) {
|
|
|
3377
3380
|
query += "left join device_addons don on d.id = don.id_device ";
|
|
3378
3381
|
}
|
|
3379
3382
|
}
|
|
3380
|
-
/*
|
|
3381
|
-
objDetails.version = version;
|
|
3382
|
-
objDetails.storage = storage;
|
|
3383
|
-
objDetails.addon = addon;
|
|
3384
|
-
objDetails.network = network;
|
|
3385
|
-
objDetails.mac_address = mac_address;
|
|
3386
|
-
objDetails.name = name;
|
|
3387
|
-
*/
|
|
3388
|
-
query += where_clause;
|
|
3389
3383
|
// Filtro su dettagli...
|
|
3390
3384
|
if (details) {
|
|
3391
|
-
if (search_criteria.search_type == "DESKTOP" || search_criteria.search_type == "NOTEBOOK") {
|
|
3385
|
+
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") {
|
|
3392
3386
|
where_clause += " and ";
|
|
3393
3387
|
if (details.os) {
|
|
3394
|
-
where_clause += "(dd.os
|
|
3388
|
+
where_clause += "(dd.os = '" + details.os + "') ";
|
|
3395
3389
|
if (details.version || details.storage || details.addon || details.network || details.storage || details.mac_address || details.name) {
|
|
3396
3390
|
where_clause += " and ";
|
|
3397
3391
|
}
|
|
3398
3392
|
}
|
|
3399
3393
|
if (details.os) {
|
|
3400
|
-
where_clause += "(dd.version
|
|
3394
|
+
where_clause += "(dd.version = '" + details.version + "') ";
|
|
3401
3395
|
if (details.storage || details.addon || details.network || details.mac_address || details.name) {
|
|
3402
3396
|
where_clause += " and ";
|
|
3403
3397
|
}
|
|
3404
3398
|
}
|
|
3405
3399
|
if (details.name) {
|
|
3406
|
-
where_clause += "(dd.pc_name
|
|
3400
|
+
where_clause += "(dd.pc_name = '" + details.name + "') ";
|
|
3407
3401
|
if (details.storage || details.addon || details.network || details.mac_address) {
|
|
3408
3402
|
where_clause += " and ";
|
|
3409
3403
|
}
|
|
3410
3404
|
}
|
|
3411
3405
|
|
|
3412
3406
|
}
|
|
3413
|
-
else if (search_criteria.search_type == "
|
|
3407
|
+
else if (search_criteria.search_type == "MONITOR") {
|
|
3414
3408
|
|
|
3415
3409
|
}
|
|
3416
|
-
else if (search_criteria.search_type == "
|
|
3410
|
+
else if (search_criteria.search_type == "SWITCH") {
|
|
3417
3411
|
|
|
3418
3412
|
}
|
|
3419
3413
|
else if (search_criteria.search_type == "C") {
|
|
3420
3414
|
|
|
3421
3415
|
}
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
3416
|
if (details.network) {
|
|
3426
|
-
where_clause += "(dn.net_type
|
|
3417
|
+
where_clause += "(dn.net_type = '" + details.network + "') ";
|
|
3427
3418
|
if (details.storage || details.addon || details.network || details.mac_address) {
|
|
3428
3419
|
where_clause += " and ";
|
|
3429
3420
|
}
|
|
3430
3421
|
}
|
|
3431
3422
|
if (details.mac_address) {
|
|
3432
|
-
|
|
3433
|
-
if (
|
|
3434
|
-
where_clause += "
|
|
3435
|
-
|
|
3423
|
+
var mac_address_clean = details.mac_address.replaceAll(":","").replaceAll("-","").trim().toLowerCase();
|
|
3424
|
+
if (mac_address_clean != "") {
|
|
3425
|
+
where_clause += "lower(trim(replace(replace(dn.mac_address, ':', ''), '-', ''))) = '" + mac_address_clean + "') ";
|
|
3426
|
+
if (details.storage || details.addon) {
|
|
3427
|
+
where_clause += " and ";
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3436
3430
|
}
|
|
3437
3431
|
if (details.storage) {
|
|
3438
|
-
where_clause += "(dr.storage_type
|
|
3432
|
+
where_clause += "(dr.storage_type = '" + details.storage + "') ";
|
|
3439
3433
|
if (details.addon) {
|
|
3440
3434
|
where_clause += " and ";
|
|
3441
3435
|
}
|
|
3442
3436
|
}
|
|
3443
3437
|
if (details.addon) {
|
|
3444
|
-
where_clause += "(don.addon_type
|
|
3438
|
+
where_clause += "(don.addon_type = '" + details.addon + "') ";
|
|
3445
3439
|
}
|
|
3446
3440
|
}
|
|
3441
|
+
// Esclusione
|
|
3442
|
+
if (search_criteria.id_dev_exclude > 0) {
|
|
3443
|
+
where_clause += " and d.id <> :id_dev_exclude";
|
|
3444
|
+
}
|
|
3445
|
+
query += where_clause;
|
|
3447
3446
|
query += "order by id";
|
|
3448
3447
|
return query;
|
|
3449
3448
|
}
|