Web UI for ARGUS server
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.

149 lines
4.2 KiB

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