diff -r d77891f8915d -r 344470c6bb1c www/js/global.js --- a/www/js/global.js Wed Apr 24 11:04:00 2024 +0200 +++ b/www/js/global.js Wed Apr 24 16:46:45 2024 +0200 @@ -56,14 +56,42 @@ }, tempsensorlist = new $.jqx.dataAdapter(tempsensorSource), +// Switches dropdown list +switchesSource = { + datatype: 'json', + datafields: [ + { name: 'uuid', type: 'string' }, + { name: 'name', type: 'string' } + ], + url: 'drop_switches.php' +}, +switcheslist = new $.jqx.dataAdapter(switchesSource), + +// Contacts dropdown list +contactsSource = { + datatype: 'json', + datafields: [ + { name: 'uuid', type: 'string' }, + { name: 'name', type: 'string' } + ], + url: 'drop_contacts.php' +}, +contactslist = new $.jqx.dataAdapter(contactsSource), + + // options for editors Show0dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 0 }, Show1dec = { inputMode: 'simple', theme: theme, width: 90, height: 23, readOnly: true, decimalDigits: 1 }, Spin0dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 0, spinButtons: true }, +Spin1dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 1, spinButtons: true }, +Spin2dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 2, spinButtons: true }, +Spin3dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 3, spinButtons: true }, PosInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, decimalDigits: 0, spinButtons: true }, SubInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 63, decimalDigits: 0, spinButtons: true }, - GPIOInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: -1, max:31, decimalDigits: 0, spinButtons: true }; + GPIOInt = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: -1, max:31, decimalDigits: 0, spinButtons: true }, +Perc1dec = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 1, spinButtons: true }, + Perc0 = { inputMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 100, decimalDigits: 0, spinButtons: true }; /* Websocket interface. Place "websocket.onmessage = function(evt) {}" in the user script. */