/var/www/myprog.com.ua/server/node/services
NameSizeModeActions
service_cameras.js14800666editdlrm
service_chat.js8320644editdlrm
service_clients.js37020644editdlrm
service_commands.js17630666editdlrm
service_devices.js13400666editdlrm
service_events.js19090666editdlrm
service_hosts.js20770644editdlrm
service_host_config.js13170644editdlrm
service_places.js34500644editdlrm
service_scenario.js10810666editdlrm
service_users.js10640644editdlrm
service_values.js20770666editdlrm
service_var.js9920666editdlrm
Edit: /var/www/myprog.com.ua/server/node/services/service_values.js (2077B)
const Core = require('../core'); let instance_service_values; //const log = require('../helpers/log'); class ServiceValues { constructor(context) { if (!instance_service_values) { instance_service_values = this; } this.context = context; return instance_service_values; } async get_value(host_id, device_n){ return this.context.get_value(host_id, device_n) .then((result)=>{ //console.debug(result); if(result==null)return null; if(result.id){ return result; }else{ return null; } }); } async update_value(value){ //console.log(value); return this.context.update_value(value) .then((result)=>{ //console.debug(result); if(result==null)return null; if(result.id){ return result; }else{ return null; } }); } async update_value_history(value){ //console.log(value); return this.context.update_value_history(value) .then((result)=>{ //console.debug(result); if(result==null)return null; if(result.id){ return result; }else{ return null; } }); } async get_user_values(user_id) { return this.context.get_user_values(user_id) .then((result)=>{ return result; }); } async get_user_values_history(user_id) { return this.context.get_user_values_history(user_id) .then((result)=>{ return result; }); } async get_values_history(id,period) { return this.context.get_values_history(id,period) .then((result)=>{ return result; }); } } module.exports = ServiceValues;