alsmanager_lib 1.0.82 → 1.0.83
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 +11 -14
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -156,14 +156,14 @@ function removeConnector(db_used, id_device, conn_obj) {
|
|
|
156
156
|
//End Manage connectors
|
|
157
157
|
// Manage Storage
|
|
158
158
|
function getStorageByIdDeviceSQLite(id_device) {
|
|
159
|
-
var query = "select ds.id, st.name as Tipo, ds.storage_size_unit as Unit, ds.storage_totsize as Dimensione, ds.
|
|
159
|
+
var query = "select ds.id, st.name as Tipo, ds.storage_size_unit as Unit, ds.storage_totsize as Dimensione, ds.storage_manifacturer as Marca, ds.storage_model as Modello from device_storages ds ";
|
|
160
160
|
query += "join storage_types st on st.id = ds.storage_type ";
|
|
161
161
|
query += "where id_device = " + id_device;
|
|
162
162
|
return query;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
function getStorageByIdDeviceMySQL(id_device) {
|
|
166
|
-
var query = "select ds.id, st.name as Tipo, ds.storage_size_unit as Unit, ds.storage_totsize as Dimensione, ds.
|
|
166
|
+
var query = "select ds.id, st.name as Tipo, ds.storage_size_unit as Unit, ds.storage_totsize as Dimensione, ds.storage_manifacturer as Marca, ds.storage_model as Modello from device_storages ds ";
|
|
167
167
|
query += "join storage_types st on st.id = ds.storage_type ";
|
|
168
168
|
query += "where id_device = :id_device";
|
|
169
169
|
return query;
|
|
@@ -252,13 +252,13 @@ function getStorageByIdPartAndIdConf(db_used, id_storage, id_conf) {
|
|
|
252
252
|
|
|
253
253
|
|
|
254
254
|
function getStorageByIdSQLite(id_storage) {
|
|
255
|
-
var query = "select id, id_device, storage_type, storage_size_unit, storage_totsize,
|
|
255
|
+
var query = "select id, id_device, storage_type, storage_size_unit, storage_totsize, storage_manifacturer, storage_model from device_storages ";
|
|
256
256
|
query += "where id = " + id_storage;
|
|
257
257
|
return query;
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
function getStorageByIdMySQL() {
|
|
261
|
-
var query = "select id, id_device, storage_type, storage_size_unit, storage_totsize,
|
|
261
|
+
var query = "select id, id_device, storage_type, storage_size_unit, storage_totsize, storage_manifacturer, storage_model from device_storages ";
|
|
262
262
|
query += "where id = :id_storage";
|
|
263
263
|
return query;
|
|
264
264
|
}
|
|
@@ -285,22 +285,21 @@ function createStorageObjMySQL(id_device, storage_obj) {
|
|
|
285
285
|
obj.tipo = storage_obj.tipo;
|
|
286
286
|
obj.unita = storage_obj.unita;
|
|
287
287
|
obj.dimensione = storage_obj.dimensione;
|
|
288
|
-
obj.dim_disponibile = storage_obj.dim_disponibile;
|
|
289
288
|
obj.marca = storage_obj.marca;
|
|
290
289
|
obj.modello = storage_obj.modello;
|
|
291
290
|
return obj;
|
|
292
291
|
}
|
|
293
292
|
|
|
294
293
|
function insertStorageSQLite(id_device, storage_obj) {
|
|
295
|
-
var query = "insert into device_storages (id_device, storage_type, storage_size_unit, storage_totsize,
|
|
296
|
-
query += "(" + id_device + ", " + storage_obj.tipo + ", '" + storage_obj.unita + "'," + storage_obj.dimensione + ", "
|
|
294
|
+
var query = "insert into device_storages (id_device, storage_type, storage_size_unit, storage_totsize, storage_manifacturer, storage_model) values ";
|
|
295
|
+
query += "(" + id_device + ", " + storage_obj.tipo + ", '" + storage_obj.unita + "'," + storage_obj.dimensione + ", ";
|
|
297
296
|
query += "'" + storage_obj.marca + "', '" + storage_obj.modello + "')";
|
|
298
297
|
return query;
|
|
299
298
|
}
|
|
300
299
|
|
|
301
300
|
function insertStorageMySQL(id_device, storage_obj) {
|
|
302
|
-
var query = "insert into device_storages (id_device, storage_type, storage_size_unit, storage_totsize,
|
|
303
|
-
query += "(:id_device, :tipo, :unita, :dimensione, :
|
|
301
|
+
var query = "insert into device_storages (id_device, storage_type, storage_size_unit, storage_totsize, storage_manifacturer, storage_model) values ";
|
|
302
|
+
query += "(:id_device, :tipo, :unita, :dimensione, :marca, :modello)";
|
|
304
303
|
return query;
|
|
305
304
|
}
|
|
306
305
|
|
|
@@ -325,7 +324,6 @@ function updateStorageSQLite(id_device, storage_obj) {
|
|
|
325
324
|
query += "storage_type = " + storage_obj.tipo + ", ";
|
|
326
325
|
query += "storage_size_unit = '" + storage_obj.unita + "', ";
|
|
327
326
|
query += "storage_totsize = " + storage_obj.dimensione + ", ";
|
|
328
|
-
query += "storage_available = " + storage_obj.dim_disponibile + ", ";
|
|
329
327
|
query += "storage_manifacturer = '" + storage_obj.marca + "', ";
|
|
330
328
|
query += "storage_model = '" + storage_obj.modello + "' ";
|
|
331
329
|
query += "where id = " + storage_obj.id;
|
|
@@ -338,7 +336,6 @@ function updateStorageMySQL(id_device, storage_obj) {
|
|
|
338
336
|
query += "storage_type = :tipo, ";
|
|
339
337
|
query += "storage_size_unit = :unita, ";
|
|
340
338
|
query += "storage_totsize = :dimensione, ";
|
|
341
|
-
query += "storage_available = :dim_disponibile ";
|
|
342
339
|
query += "storage_manifacturer = :marca, ";
|
|
343
340
|
query += "storage_model = :modello ";
|
|
344
341
|
query += "where id = id_storage";
|
|
@@ -367,7 +364,7 @@ function removeStorageSQLite(id_device, storage_obj) {
|
|
|
367
364
|
|
|
368
365
|
function removeStorageMySQL(id_device, storage_obj) {
|
|
369
366
|
var query = "delete from device_storages ";
|
|
370
|
-
query += "where id = id_storage";
|
|
367
|
+
query += "where id = :id_storage";
|
|
371
368
|
return query;
|
|
372
369
|
}
|
|
373
370
|
function removeStorage(db_used, id_device, storage_obj) {
|
|
@@ -386,14 +383,14 @@ function removeStorage(db_used, id_device, storage_obj) {
|
|
|
386
383
|
}
|
|
387
384
|
//
|
|
388
385
|
function getStoragesByConfigSQLite(id_device, id_conf) {
|
|
389
|
-
var query = "select ds.id, st.name as Tipo, ds.storage_size_unit as Unit, ds.storage_totsize as Dimensione, ds.
|
|
386
|
+
var query = "select ds.id, st.name as Tipo, ds.storage_size_unit as Unit, ds.storage_totsize as Dimensione, ds.storage_manifacturer as Marca, ds.storage_model as Modello from device_storages ds ";
|
|
390
387
|
query += "join storage_types st on st.id = ds.storage_type ";
|
|
391
388
|
query += "where id_device = " + id_device + " ";
|
|
392
389
|
query += "and ds.id in (select id_part from change_config where id_conf = " + id_conf + ")";
|
|
393
390
|
return query;
|
|
394
391
|
}
|
|
395
392
|
function getStoragesByConfigMySQL(id_device, id_conf) {
|
|
396
|
-
var query = "select ds.id, st.name as Tipo, ds.storage_size_unit as Unit, ds.storage_totsize as Dimensione, ds.
|
|
393
|
+
var query = "select ds.id, st.name as Tipo, ds.storage_size_unit as Unit, ds.storage_totsize as Dimensione, ds.storage_manifacturer as Marca, ds.storage_model as Modello from device_storages ds ";
|
|
397
394
|
query += "join storage_types st on st.id = ds.storage_type ";
|
|
398
395
|
query += "where id_device = :id_device ";
|
|
399
396
|
query += "and ds.id in (select id_part from change_config where id_conf = :id_conf)";
|