alsmanager_lib 1.0.87 → 1.0.88
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 +48 -0
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -1642,6 +1642,53 @@ function updatePCProperties(db_used, id_device, dev_prop) {
|
|
|
1642
1642
|
}
|
|
1643
1643
|
return query;
|
|
1644
1644
|
}
|
|
1645
|
+
//
|
|
1646
|
+
function getPCPropertiesByConfigSQLite(id_device, id_conf) {
|
|
1647
|
+
var query = "select d.id as Id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello,";
|
|
1648
|
+
query += "dp.pc_name as Name, dp.CPU as CPU, dp.CPU_arch as CPUArch, dp.OS_arch as OSArch, dp.OS as OS, dp.OS_version as OSVersion, ";
|
|
1649
|
+
query += "dp.smartboard_ready as SB_Ready, dp.video_card as VideoCardAdded, ";
|
|
1650
|
+
query += "dp.RAM_GB as RAM, dp.note, dp.da_properties ";
|
|
1651
|
+
query += "from devices d ";
|
|
1652
|
+
query += "left join device_pc dp on d.id = dp.id_device ";
|
|
1653
|
+
query += "where d.id = " + id_device;
|
|
1654
|
+
if (id_conf > 0) {
|
|
1655
|
+
query += "and d.id in (select id_part from change_config where id_conf = " + id_conf + ")";
|
|
1656
|
+
}
|
|
1657
|
+
else {
|
|
1658
|
+
query += "and d.id in (select id_part from change_config where id_device = " + id_device + " and part_type = 'PC' order by id desc LIMIT 1)"
|
|
1659
|
+
}
|
|
1660
|
+
return query;
|
|
1661
|
+
}
|
|
1662
|
+
function getPCPropertiesByConfigMySQL(id_device, id_conf) {
|
|
1663
|
+
var query = "select d.id as Id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello,";
|
|
1664
|
+
query += "dp.pc_name as Name, dp.CPU as CPU, dp.CPU_arch as CPUArch, dp.OS_arch as OSArch, dp.OS as OS, dp.OS_version as OSVersion, ";
|
|
1665
|
+
query += "dp.smartboard_ready as SB_Ready, dp.video_card as VideoCardAdded, ";
|
|
1666
|
+
query += "dp.RAM_GB as RAM, dp.note, dp.da_properties ";
|
|
1667
|
+
query += "from devices d ";
|
|
1668
|
+
query += "left join device_pc dp on d.id = dp.id_device ";
|
|
1669
|
+
query += "where d.id = :id_device ";
|
|
1670
|
+
if (id_conf > 0) {
|
|
1671
|
+
query += "and d.id in (select id_part from change_config where id_conf = :id_conf)";
|
|
1672
|
+
}
|
|
1673
|
+
else {
|
|
1674
|
+
query += "and d.id in (select id_part from change_config where id_device = :id_device and part_type = 'PC' order by id desc LIMIT 1)"
|
|
1675
|
+
}
|
|
1676
|
+
return query;
|
|
1677
|
+
}
|
|
1678
|
+
function getPCPropertiesByConfig(db_used, id_device, id_conf) {
|
|
1679
|
+
var query = "";
|
|
1680
|
+
if (db_used) {
|
|
1681
|
+
switch (db_used) {
|
|
1682
|
+
case 'SQLITE':
|
|
1683
|
+
query = getPCPropertiesByConfigSQLite(id_device, id_conf);
|
|
1684
|
+
break;
|
|
1685
|
+
case 'MYSQL':
|
|
1686
|
+
query = getPCPropertiesByConfigMySQL(id_device, id_conf);
|
|
1687
|
+
break;
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
return query;
|
|
1691
|
+
}
|
|
1645
1692
|
//End Manage PC Properties
|
|
1646
1693
|
// Manage Display Part Properties
|
|
1647
1694
|
function getDisplayPartPropertiesSQLite(id_device) {
|
|
@@ -8814,6 +8861,7 @@ module.exports = {
|
|
|
8814
8861
|
createPCPropertiesMySQLObj,
|
|
8815
8862
|
insertPCProperties,
|
|
8816
8863
|
updatePCProperties,
|
|
8864
|
+
getPCPropertiesByConfig,
|
|
8817
8865
|
existsDisplayProperties,
|
|
8818
8866
|
getDisplayProperties,
|
|
8819
8867
|
createDisplayPropertiesMySQLObj,
|