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.

127 lines
3.4 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/4_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: 'max_range',
  29. name: 'max_range',
  30. value: %%%MAX_RANGE%%%
  31. },{
  32. xtype: 'hidden',
  33. id: 'dev_id',
  34. name: 'dev_id',
  35. value: %%%DEVICE_ID%%%
  36. },{
  37. xtype: 'panel',
  38. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Range: %%%MAX_RANGE%%%</p>'
  39. },{
  40. xtype: 'panel',
  41. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Dev Address: %%%DEVICE_ID%%%</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: 'Device Name',
  60. id: 'ued_name'
  61. },{
  62. fieldLabel: 'Device Address',
  63. id: 'ued_address'
  64. },{
  65. fieldLabel: 'Maximal Range',
  66. id: 'ued_range'
  67. }]
  68. }],
  69. buttons:[{
  70. text: 'Cancel',
  71. handler: function(){
  72. wAddSocket.close();
  73. wAddSocket = null;
  74. }
  75. },{
  76. text: 'Apply Settings',
  77. handler: function(){
  78. var val_name = Ext.getCmp('ued_name').getValue();
  79. var val_addr = Ext.getCmp('ued_address').getValue();
  80. var val_range = Ext.getCmp('ued_range').getValue();
  81. Ext.Ajax.request({
  82. url: '/lib/controller/updateLrfSettings.php',
  83. params: {
  84. SENSOR: %%%LRF_ID%%%,
  85. SADDR: val_addr,
  86. SNAME: val_name,
  87. SRANGE: val_range
  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_id').getValue());
  103. Ext.getCmp('ued_range').setValue( Ext.getCmp('max_range').getValue());
  104. }
  105. },{
  106. xtype:'fieldset',
  107. title: 'LRF Settings',
  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. }