alsmanager_lib 3.0.104 → 3.0.105
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 +36 -12
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -11450,41 +11450,40 @@ function getTipiPorta() {
|
|
|
11450
11450
|
return query;
|
|
11451
11451
|
}
|
|
11452
11452
|
|
|
11453
|
-
function insertMatchPortToDevice(id_device, id_network, id_port
|
|
11454
|
-
var query = "insert into
|
|
11453
|
+
function insertMatchPortToDevice(id_device, id_network, id_port) {
|
|
11454
|
+
var query = "insert into device_lan_ports (id_device, id_card, id_port) values ";
|
|
11455
11455
|
query += "(";
|
|
11456
|
-
query += id_device + ", " + id_network + ", " + id_port
|
|
11456
|
+
query += id_device + ", " + id_network + ", " + id_port;
|
|
11457
11457
|
query += ")";
|
|
11458
11458
|
return query;
|
|
11459
11459
|
}
|
|
11460
11460
|
|
|
11461
|
-
function updateMatchPortToDevice(id_match, id_device, id_network, id_port
|
|
11462
|
-
var query = "update
|
|
11461
|
+
function updateMatchPortToDevice(id_match, id_device, id_network, id_port) {
|
|
11462
|
+
var query = "update device_lan_ports set ";
|
|
11463
11463
|
query += "id_device = " + id_device + ", ";
|
|
11464
|
-
query += "
|
|
11464
|
+
query += "id_card = " + id_network + ", ";
|
|
11465
11465
|
query += "id_port = " + id_port + ", ";
|
|
11466
|
-
query += "'" + note + "' ";
|
|
11467
11466
|
query += "where id = " + id_match;
|
|
11468
11467
|
return query;
|
|
11469
11468
|
}
|
|
11470
11469
|
|
|
11471
11470
|
function deleteMatchPortToDevice(id_match) {
|
|
11472
|
-
var query = "delete from
|
|
11471
|
+
var query = "delete from device_lan_ports ";
|
|
11473
11472
|
query += "where id = " + id_match;
|
|
11474
11473
|
return query;
|
|
11475
11474
|
}
|
|
11476
11475
|
|
|
11477
11476
|
function getCurrentMatchByIdDeviceIdNetwork(id_device, id_network) {
|
|
11478
|
-
var query = "select id from
|
|
11479
|
-
query += "where id_device = " + id_device + " and
|
|
11477
|
+
var query = "select id from device_lan_ports ";
|
|
11478
|
+
query += "where id_device = " + id_device + " and id_card = " + id_network;
|
|
11480
11479
|
return query;
|
|
11481
11480
|
}
|
|
11482
11481
|
|
|
11483
11482
|
function getPorteByIdDevice(id_device, id_network) {
|
|
11484
|
-
var query = "select dp.id, sp.port_type as Tipo, sp.port_sign as Porta, sp.note as Note from
|
|
11483
|
+
var query = "select dp.id, sp.port_type as Tipo, sp.port_sign as Porta, sp.note as Note from device_lan_ports dp ";
|
|
11485
11484
|
query += "join site_ports sp on sp.id = dp.id_port "
|
|
11486
11485
|
query += "where dp.id_device = " + id_device + " ";
|
|
11487
|
-
query += "and dp.
|
|
11486
|
+
query += "and dp.id_card = " + id_network + " ";
|
|
11488
11487
|
query += "order by sp.port_type, sp.port_sign";
|
|
11489
11488
|
return query;
|
|
11490
11489
|
}
|
|
@@ -11501,6 +11500,29 @@ function getPorteComboByIdSiteDevice(id_device) {
|
|
|
11501
11500
|
return query;
|
|
11502
11501
|
}
|
|
11503
11502
|
|
|
11503
|
+
function getNetworksAndPortOnDevice(id_device) {
|
|
11504
|
+
var query = "";
|
|
11505
|
+
query += "select dn.id, sp.port_sign as Porta, dn.net_type as Tipo, dn.ipv4_static as IP4, dn.ipv6_static as IP6, dn.mac_address as MAC from device_networks dn ";
|
|
11506
|
+
query += "left join device_lan_ports dlp on dn.id = dlp.id_card ";
|
|
11507
|
+
query += "left join site_ports sp on dlp.id_port = sp.id ";
|
|
11508
|
+
query += "where dn.id_device = " + id_device;
|
|
11509
|
+
return query;
|
|
11510
|
+
}
|
|
11511
|
+
|
|
11512
|
+
function getNetworksAndPortByConfig(id_device, id_conf) {
|
|
11513
|
+
var query = "select dn.id, sp.port_sign as Porta, dn.net_type as Tipo, dn.mac_address as MAC, dn.ipv4_static as IP4, dn.ipv6_static as IP6 from device_networks dn ";
|
|
11514
|
+
query += "left join device_lan_ports dlp on dn.id = dlp.id_card ";
|
|
11515
|
+
query += "left join site_ports sp on dlp.id_port = sp.id ";
|
|
11516
|
+
query += "where dn.id_device = " + id_device + " ";
|
|
11517
|
+
if (id_conf > 0) {
|
|
11518
|
+
query += "and dn.id in (select id_part from change_config where id_conf = " + id_conf + ")";
|
|
11519
|
+
}
|
|
11520
|
+
else {
|
|
11521
|
+
query += "and dn.id in (select id_part from change_config where id_device = " + id_device + " and part_type = 'NETWORK' order by id desc)"
|
|
11522
|
+
}
|
|
11523
|
+
return query;
|
|
11524
|
+
}
|
|
11525
|
+
|
|
11504
11526
|
//End Manage ports
|
|
11505
11527
|
|
|
11506
11528
|
// Manage updateDevicesSite
|
|
@@ -15093,6 +15115,8 @@ module.exports = {
|
|
|
15093
15115
|
getCurrentMatchByIdDeviceIdNetwork,
|
|
15094
15116
|
getPorteByIdDevice,
|
|
15095
15117
|
getPorteComboByIdSiteDevice,
|
|
15118
|
+
getNetworksAndPortOnDevice,
|
|
15119
|
+
getNetworksAndPortByConfig,
|
|
15096
15120
|
//
|
|
15097
15121
|
queryStatistic,
|
|
15098
15122
|
queryStatisticInventary,
|