alsmanager_lib 1.0.76 → 1.0.77
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 +22 -24
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -333,8 +333,8 @@ function getStoragesByConfigSQLite(id_device, id_conf) {
|
|
|
333
333
|
function getStoragesByConfigMySQL(id_device, id_conf) {
|
|
334
334
|
var query = "select ds.id, st.name as Tipo, ds.storage_size_unit as Unit, ds.storage_totsize as Dimensione, ds.storage_available as Disponibile, ds.storage_manifacturer as Marca, ds.storage_model as Modello from device_storages ds ";
|
|
335
335
|
query += "join storage_types st on st.id = ds.storage_type ";
|
|
336
|
-
query += "where id_device =
|
|
337
|
-
query += "and ds.id in (select id_part from change_config where id_conf =
|
|
336
|
+
query += "where id_device = :id_device ";
|
|
337
|
+
query += "and ds.id in (select id_part from change_config where id_conf = :id_conf)";
|
|
338
338
|
return query;
|
|
339
339
|
}
|
|
340
340
|
function getStoragesByConfig(db_used, id_device, id_conf) {
|
|
@@ -501,17 +501,15 @@ function removeNetwork(db_used, id_device, network_obj) {
|
|
|
501
501
|
}
|
|
502
502
|
//
|
|
503
503
|
function getNetworksByConfigSQLite(id_device, id_conf) {
|
|
504
|
-
var query = "select
|
|
505
|
-
query += "
|
|
506
|
-
query += "where
|
|
507
|
-
query += "and ds.id in (select id_part from change_config where id_conf = " + id_conf + ")";
|
|
504
|
+
var query = "select dn.id, dn.net_type as Tipo, dn.mac_address as MAC, dn.ipv4_static as IP4, dn.ipv6_static as IP6 from device_networks dn ";
|
|
505
|
+
query += "where dn.id_device = " + id_device + " ";
|
|
506
|
+
query += "and dn.id in (select id_part from change_config where id_conf = " + id_conf + ")";
|
|
508
507
|
return query;
|
|
509
508
|
}
|
|
510
509
|
function getNetworksByConfigMySQL(id_device, id_conf) {
|
|
511
|
-
var query = "select
|
|
512
|
-
query += "
|
|
513
|
-
query += "
|
|
514
|
-
query += "and ds.id in (select id_part from change_config where id_conf = " + id_conf + ")";
|
|
510
|
+
var query = "select dn.id, dn.net_type as Tipo, dn.mac_address as MAC, dn.ipv4_static as IP4, dn.ipv6_static as IP6 from device_networks dn ";
|
|
511
|
+
query += "where dn.id_device = :id_device ";
|
|
512
|
+
query += "and dn.id in (select id_part from change_config where id_conf = :id_conf)";
|
|
515
513
|
return query;
|
|
516
514
|
}
|
|
517
515
|
function getNetworksByConfig(db_used, id_device, id_conf) {
|
|
@@ -675,29 +673,29 @@ function removeAddOn(db_used, id_device, addon_obj) {
|
|
|
675
673
|
return query;
|
|
676
674
|
}
|
|
677
675
|
//
|
|
678
|
-
function
|
|
679
|
-
var query = "select
|
|
680
|
-
query += "join
|
|
681
|
-
query += "where id_device = " + id_device + " ";
|
|
682
|
-
query += "and
|
|
676
|
+
function getAddOnsByConfigSQLite(id_device, id_conf) {
|
|
677
|
+
var query = "select da.id, a.name as Tipo, da.maker as Marca, da.model as Modello, da.description as Descrizione from device_addons da ";
|
|
678
|
+
query += "join addon_types a on a.id = da.addon_type ";
|
|
679
|
+
query += "where da.id_device = " + id_device + " ";
|
|
680
|
+
query += "and da.id in (select id_part from change_config where id_conf = " + id_conf + ")";
|
|
683
681
|
return query;
|
|
684
682
|
}
|
|
685
|
-
function
|
|
686
|
-
var query = "select
|
|
687
|
-
query += "join
|
|
688
|
-
query += "where id_device =
|
|
689
|
-
query += "and
|
|
683
|
+
function getAddOnsByConfigMySQL(id_device, id_conf) {
|
|
684
|
+
var query = "select da.id, a.name as Tipo, da.maker as Marca, da.model as Modello, da.description as Descrizione from device_addons da ";
|
|
685
|
+
query += "join addon_types a on a.id = da.addon_type ";
|
|
686
|
+
query += "where da.id_device = :id_device ";
|
|
687
|
+
query += "and da.id in (select id_part from change_config where id_conf = :id_conf)";
|
|
690
688
|
return query;
|
|
691
689
|
}
|
|
692
|
-
function
|
|
690
|
+
function getAddOnsByConfig(db_used, id_device, id_conf) {
|
|
693
691
|
var query = "";
|
|
694
692
|
if (db_used) {
|
|
695
693
|
switch (db_used) {
|
|
696
694
|
case 'SQLITE':
|
|
697
|
-
query =
|
|
695
|
+
query = getAddOnsByConfigSQLite(id_device, id_conf);
|
|
698
696
|
break;
|
|
699
697
|
case 'MYSQL':
|
|
700
|
-
query =
|
|
698
|
+
query = getAddOnsByConfigMySQL(id_device, id_conf);
|
|
701
699
|
break;
|
|
702
700
|
}
|
|
703
701
|
}
|
|
@@ -8262,7 +8260,7 @@ module.exports = {
|
|
|
8262
8260
|
insertAddOn,
|
|
8263
8261
|
updateAddOn,
|
|
8264
8262
|
removeAddOn,
|
|
8265
|
-
|
|
8263
|
+
getAddOnsByConfig,
|
|
8266
8264
|
//
|
|
8267
8265
|
getDeviceConfigurations,
|
|
8268
8266
|
getLastDeviceConfiguration,
|