alsmanager_lib 3.0.103 → 3.0.104
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 +28 -9
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -11450,21 +11450,19 @@ function getTipiPorta() {
|
|
|
11450
11450
|
return query;
|
|
11451
11451
|
}
|
|
11452
11452
|
|
|
11453
|
-
function insertMatchPortToDevice(id_device, id_network, id_port,
|
|
11454
|
-
var query = "insert into device_port (id_device, id_network, id_port,
|
|
11453
|
+
function insertMatchPortToDevice(id_device, id_network, id_port, note) {
|
|
11454
|
+
var query = "insert into device_port (id_device, id_network, id_port, note) values ";
|
|
11455
11455
|
query += "(";
|
|
11456
|
-
query += id_device + ", " + id_network + ", " + id_port + ", '" +
|
|
11456
|
+
query += id_device + ", " + id_network + ", " + id_port + ", '" + note + "'";
|
|
11457
11457
|
query += ")";
|
|
11458
11458
|
return query;
|
|
11459
11459
|
}
|
|
11460
11460
|
|
|
11461
|
-
function updateMatchPortToDevice(id_match, id_device, id_network, id_port,
|
|
11461
|
+
function updateMatchPortToDevice(id_match, id_device, id_network, id_port, note) {
|
|
11462
11462
|
var query = "update device_port set ";
|
|
11463
11463
|
query += "id_device = " + id_device + ", ";
|
|
11464
11464
|
query += "id_network = " + id_network + ", ";
|
|
11465
11465
|
query += "id_port = " + id_port + ", ";
|
|
11466
|
-
query += "'" + date_start + "', ";
|
|
11467
|
-
query += "'" + date_end + "', ";
|
|
11468
11466
|
query += "'" + note + "' ";
|
|
11469
11467
|
query += "where id = " + id_match;
|
|
11470
11468
|
return query;
|
|
@@ -11476,7 +11474,13 @@ function deleteMatchPortToDevice(id_match) {
|
|
|
11476
11474
|
return query;
|
|
11477
11475
|
}
|
|
11478
11476
|
|
|
11479
|
-
function
|
|
11477
|
+
function getCurrentMatchByIdDeviceIdNetwork(id_device, id_network) {
|
|
11478
|
+
var query = "select id from device_port ";
|
|
11479
|
+
query += "where id_device = " + id_device + " and id_network = " + id_network;
|
|
11480
|
+
return query;
|
|
11481
|
+
}
|
|
11482
|
+
|
|
11483
|
+
function getPorteByIdDevice(id_device, id_network) {
|
|
11480
11484
|
var query = "select dp.id, sp.port_type as Tipo, sp.port_sign as Porta, sp.note as Note from device_port dp ";
|
|
11481
11485
|
query += "join site_ports sp on sp.id = dp.id_port "
|
|
11482
11486
|
query += "where dp.id_device = " + id_device + " ";
|
|
@@ -11485,6 +11489,18 @@ function getPortByIdDevice(id_device, id_network) {
|
|
|
11485
11489
|
return query;
|
|
11486
11490
|
}
|
|
11487
11491
|
|
|
11492
|
+
function getPorteComboByIdSiteDevice(id_device) {
|
|
11493
|
+
var query = "select distinct sp.id, concat(sp.port_type, ' - ', sp.port_sign) as description from devices d ";
|
|
11494
|
+
query += "join device_site ds on ds.id_device = d.id ";
|
|
11495
|
+
query += "join site_ports sp on sp.id_site = ds.id_site ";
|
|
11496
|
+
query += "where d.id = " + id_device + " ";
|
|
11497
|
+
query += "and date('now') >= ds.date_in and date('now') <= ds.date_out ";
|
|
11498
|
+
query += "and sp.port_type = 'LAN' ";
|
|
11499
|
+
query += "and sp.port_sign is not null "
|
|
11500
|
+
query += "order by port_type, port_sign";
|
|
11501
|
+
return query;
|
|
11502
|
+
}
|
|
11503
|
+
|
|
11488
11504
|
//End Manage ports
|
|
11489
11505
|
|
|
11490
11506
|
// Manage updateDevicesSite
|
|
@@ -15072,8 +15088,11 @@ module.exports = {
|
|
|
15072
15088
|
getSwitches,
|
|
15073
15089
|
getTipiPorta,
|
|
15074
15090
|
insertMatchPortToDevice,
|
|
15075
|
-
updateMatchPortToDevice,
|
|
15076
|
-
|
|
15091
|
+
updateMatchPortToDevice,
|
|
15092
|
+
deleteMatchPortToDevice,
|
|
15093
|
+
getCurrentMatchByIdDeviceIdNetwork,
|
|
15094
|
+
getPorteByIdDevice,
|
|
15095
|
+
getPorteComboByIdSiteDevice,
|
|
15077
15096
|
//
|
|
15078
15097
|
queryStatistic,
|
|
15079
15098
|
queryStatisticInventary,
|