remove logging and commented code

This commit is contained in:
2023-01-09 09:11:52 -06:00
parent 5ccb3c0828
commit 0d235b5c61
7 changed files with 1 additions and 23 deletions
-5
View File
@@ -27,8 +27,6 @@ function registerDevice(newDevice, discoveryMethod) {
return false;
}
// console.log("Registered new "+newDevice.type)
const id = newDevice.id || uuid();
devices[id] = {
id,
@@ -195,7 +193,6 @@ function initDeviceConnection(id) {
device.send = (data) => {};
}
// device.plugin = plugins[type];
return true;
}
@@ -233,7 +230,6 @@ module.exports.changeActiveType = function changeActiveType(newType) {
initDeviceConnection(device.id);
VIEW.draw(device);
VIEW.updateFields();
// SAVESLOTS.saveAll();
};
module.exports.changeActiveIP = function changeActiveIP(newIP) {
@@ -269,7 +265,6 @@ module.exports.changeActivePinIndex = function changeActivePinIndex(newPin) {
module.exports.changePinIndex = function changePinIndex(device, newPin) {
const d = device;
d.pinIndex = newPin;
// SAVESLOTS.saveAll();
};
module.exports.refreshActive = function refreshActive() {
const device = VIEW.getActiveDevice();
-1
View File
@@ -25,7 +25,6 @@ if (storedDevices) {
function loadSlot(slotIndex) {
VIEW.toggleSlotButtons(slotIndex);
activeSlot = slotIndex;
console.log(DEVICE.all);
Object.keys(DEVICE.all).forEach((d) => {
DEVICE.changePinIndex(DEVICE.all[d], false);
+1 -9
View File
@@ -2,7 +2,6 @@ const { ipcRenderer } = require('electron');
const DEVICE = require('./device.js');
const PLUGINS = require('./plugins.js');
const { saveAll } = require('./saveSlots.js');
// const _ = require('lodash/function');
const pinnedDevices = [];
module.exports.pinnedDevices = pinnedDevices;
@@ -42,9 +41,6 @@ function drawDeviceFrame(id) {
str += generateBodyHTML(d);
// str += "<script src='node_modules/lodash/core.min.js'></script>";
// str += "<script src='./plugins/" +d.type +"/update.js'></script>";
str += '</body></html>';
$deviceDrawArea.setAttribute('class', `${d.type} draw-area`);
@@ -158,14 +154,12 @@ function switchDevice(id) {
document.getElementById('all-devices').style.gridTemplateColumns = `repeat(${cols}, 1fr)`;
if (id === undefined) {
// document.getElementById('refresh-device-button').style.opacity = 0.2;
document.getElementById('refresh-device-button').disabled = true;
document.getElementById('device-settings-table').style.display = 'none';
return;
}
document.getElementById('refresh-device-button').disabled = false;
// document.getElementById('refresh-device-button').style.opacity = 1;
const i = DEVICE.all[id].id;
const $deviceWrapper = document.getElementById(`device-${i}`);
@@ -173,8 +167,6 @@ function switchDevice(id) {
if (!$deviceWrapper) {
const html = `<div class="col device-wrapper" id="device-${i}"><img id="device-${i}-pinned" class="device-pin" src="src/assets/img/outline_push_pin_white_18dp.png"><iframe id="device-${i}-draw-area" class="draw-area"></iframe></div>`;
document.getElementById('all-devices').insertAdjacentHTML('afterbegin', html);
// $deviceWrapper = document.getElementById(`device-${i}`);
}
window.switchClass(document.getElementById(id), 'active-device');
@@ -210,7 +202,7 @@ function updateFields() {
fields.forEach((field) => {
const $elem = document.createElement('input');
$elem.type = 'text';
$elem.value = activeDevice.fields[field.key]; // || field.value;
$elem.value = activeDevice.fields[field.key];
$elem.name = field.key;
$elem.onchange = function onchange(e) {
activeDevice.fields[field.key] = $elem.value;