Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
4.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. {
  2. xtype: 'form',
  3. labelWidth: 40, // label settings here cascade unless overridden
  4. frame: false,
  5. bodyStyle:'padding:5px 5px 0',
  6. defaultType: 'textfield',
  7. items: [{
  8. xtype: 'panel',
  9. height: 100,
  10. html: '<p align="center"><img src="/style/assets/5_node.png"><br/>%%%DEV_LABEL%%%<br/></p>'
  11. },{
  12. xtype:'fieldset',
  13. //checkboxToggle:true,
  14. collapsible: true,
  15. title: 'Device',
  16. autoHeight: true,
  17. defaults: {
  18. //width: 180
  19. },
  20. collapsed: false,
  21. items :[{
  22. xtype: 'hidden',
  23. id: 'dev_name',
  24. name: 'dev_name',
  25. value: '%%%DEV_LABEL%%%'
  26. },{
  27. xtype: 'hidden',
  28. id: 'dev_ip',
  29. name: 'dev_ip',
  30. value: '%%%IP_ADDRESS%%%'
  31. },{
  32. xtype: 'hidden',
  33. id: 'dev_port',
  34. name: 'dev_port',
  35. value: %%%IP_PORT%%%
  36. },{
  37. xtype: 'panel',
  38. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">IPv4: %%%IP_ADDRESS%%%</p>'
  39. },{
  40. xtype: 'panel',
  41. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Port: %%%IP_PORT%%%</p>'
  42. }]
  43. },{
  44. xtype: 'button',
  45. text: 'Change Settings',
  46. width: '100%',
  47. handler: function(){
  48. var wAddSocket = new Ext.Window({
  49. title: 'Sensor Settings',
  50. width: 450,
  51. //height: 480,
  52. items:[{
  53. xtype: 'form',
  54. labelWidth: 120, // label settings here cascade unless overridden
  55. frame: false,
  56. bodyStyle:'padding:5px 5px 0',
  57. defaultType: 'textfield',
  58. items:[{
  59. fieldLabel: 'Label',
  60. id: 'ued_name'
  61. },{
  62. fieldLabel: 'IP Address',
  63. id: 'ued_address'
  64. },{
  65. fieldLabel: 'Port',
  66. value: 2222,
  67. readOnly: false,
  68. id: 'ued_port'
  69. }]
  70. }],
  71. buttons:[{
  72. text: 'Cancel',
  73. handler: function(){
  74. wAddSocket.close();
  75. wAddSocket = null;
  76. }
  77. },{
  78. text: 'Apply Settings',
  79. handler: function(){
  80. var val_addr = Ext.getCmp('ued_address').getValue();
  81. var val_name = Ext.getCmp('ued_name').getValue();
  82. Ext.Ajax.request({
  83. url: '/lib/controller/updateLrfSettings.php',
  84. params: {
  85. SENSOR: %%%LRF_ID%%%,
  86. SNAME: val_name,
  87. SIPADDR: val_addr
  88. },
  89. success: function( response, opts ){
  90. wAddSocket.close();
  91. wAddSocket = null;
  92. loadNodeProperties( %%%NODEID%%% );
  93. },
  94. failure: function( response, opts ) {
  95. }
  96. });
  97. }
  98. }]
  99. });
  100. wAddSocket.show();
  101. Ext.getCmp('ued_name').setValue( Ext.getCmp('dev_name').getValue());
  102. Ext.getCmp('ued_address').setValue( Ext.getCmp('dev_ip').getValue());
  103. Ext.getCmp('ued_port').setValue( Ext.getCmp('dev_port').getValue());
  104. }
  105. },{
  106. xtype:'fieldset',
  107. title: 'Master LRF',
  108. collapsible: true,
  109. autoHeight: true,
  110. defaults: {
  111. //width: 168
  112. },
  113. items :[{
  114. xtype: 'panel',
  115. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%M_ORDER%%%</p>'
  116. },{
  117. xtype: 'panel',
  118. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%M_OFFSET%%%</p>'
  119. },{
  120. xtype: 'panel',
  121. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%M_WIDTH%%%</p>'
  122. },{
  123. xtype: 'panel',
  124. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">SST: %%%M_SST%%%</p>'
  125. }]
  126. },{
  127. xtype:'fieldset',
  128. title: 'Slave LRF',
  129. collapsible: true,
  130. autoHeight: true,
  131. defaults: {
  132. //width: 168
  133. },
  134. items :[{
  135. xtype: 'panel',
  136. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%S_ORDER%%%</p>'
  137. },{
  138. xtype: 'panel',
  139. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%S_OFFSET%%%</p>'
  140. },{
  141. xtype: 'panel',
  142. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%S_WIDTH%%%</p>'
  143. },{
  144. xtype: 'panel',
  145. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">SST: %%%S_SST%%%</p>'
  146. }]
  147. }]
  148. }