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.

213 lines
4.5 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
6 years ago
6 years ago
​
6 years ago
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
6 years ago
​
​
6 years ago
​
​
​
6 years ago
6 years ago
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
​
​
​
​
6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 years ago
6 years ago
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var winW = <?=0+$CUser->Data['width'];?>;
  3. var winH = <?=0+$CUser->Data['height'];?>;
  4. var PanelH = winH-90;
  5. function Refresh(){
  6. window.location="/?t="+123;
  7. };
  8. function updateUserScreenResolution( x, y ){
  9. Ext.Ajax.request({
  10. url: '/lib/controller/updateUserSettings.php',
  11. params: {
  12. SAID: <?=$SiteID;?>,
  13. UID: <?=$UserID;?>,
  14. SID: '<?=$Session;?>',
  15. SSS: 15,
  16. WID: x,
  17. HEI: y
  18. },
  19. success: function( response, opts ){
  20. Refresh();
  21. },
  22. failure: function( response, opts ) {
  23. Ext.Msg.show({
  24. title:'Request Failure!',
  25. msg: 'Ajax Request failed!',
  26. buttons: Ext.Msg.OK,
  27. icon: Ext.MessageBox.INFO
  28. });
  29. }
  30. });
  31. };
  32. function CheckWindowSize(delay){
  33. if (parseInt(navigator.appVersion)>3) {
  34. if (navigator.appName=="Netscape") {
  35. winW2 = window.innerWidth;
  36. winH2 = window.innerHeight;
  37. if ( winH2<700 ) winH2=700;
  38. };
  39. if (navigator.appName.indexOf("Microsoft")!=-1) {
  40. winW2 = document.body.offsetWidth;
  41. winH2 = document.body.offsetHeight;
  42. if ( winH2<700 ) winH2=700;
  43. };
  44. };
  45. //alert(winW2+':'+winW+' '+winH2+':'+winH);
  46. if ( winW2 != winW || winH2!=winH ){
  47. updateUserScreenResolution( winW2, winH2 );
  48. };
  49. };
  50. Ext.onReady(function(){
  51. //Check Screen Size
  52. //alert( winW + 'x' + winH );
  53. CheckWindowSize();
  54. Ext.QuickTips.init();
  55. var viewport = new Ext.Viewport({
  56. id: 'main_viewport',
  57. layout:'border',
  58. items: [{
  59. xtype: 'panel',
  60. region: 'north',
  61. baseCls: 'x-plain',
  62. height: 50,
  63. items:[{
  64. xtype: 'panel',
  65. id:'top',
  66. baseCls: 'x-plain',
  67. html: '<p style="padding:10px;color:#556677;font-size:11px;"><img src="/style/img/logo32.png">&nbsp;R-Goose Security System</p>'
  68. }]
  69. },{
  70. xtype: 'panel',
  71. id:'btns',
  72. region:'west',
  73. bsaseCls:'x-plain',
  74. title: 'R-Goose System',
  75. collapsible: true,
  76. split:true,
  77. width:150,
  78. minWidth: 100,
  79. maxWidth: 250,
  80. layout:'accordion',
  81. margins: '5 0 5 5',
  82. cmargins:'5 5 5 5',
  83. layoutConfig:{
  84. animate:true
  85. },
  86. items: [{
  87. title: 'Dashboard',
  88. layout: 'vbox',
  89. height: 120,
  90. pack: 'center',
  91. align : 'strech',
  92. items:[{
  93. xtype: 'button',
  94. width: '100%',
  95. id:'go_home',
  96. text: 'Go Home',
  97. handler: function( b, e ){
  98. loadDashBoard();
  99. }
  100. },{
  101. xtype: 'button',
  102. width: '100%',
  103. id:'go_monitor',
  104. text: 'Monitor Events',
  105. handler: function( b, e ){
  106. loadTimeLine();
  107. }
  108. },{
  109. xtype: 'button',
  110. width: '100%',
  111. id:'go_out',
  112. text: 'Logout',
  113. handler: function( b, e ){
  114. window.location = '/login.php?UID=1';
  115. }
  116. }]
  117. },{
  118. title: 'System Settings',
  119. layout: 'vbox',
  120. height: 120,
  121. pack: 'center',
  122. align : 'strech',
  123. items:[{
  124. xtype: 'button',
  125. width: '100%',
  126. id:'sys_edit',
  127. text: 'Edit Connections',
  128. handler: function( b, e ){
  129. loadSystemEditor();
  130. }
  131. },{
  132. xtype: 'button',
  133. width: '100%',
  134. id:'map_edit',
  135. text: 'Edit Locations',
  136. handler: function( b, e ){
  137. loadLocationEditor();
  138. }
  139. },{
  140. xtype: 'button',
  141. width: '100%',
  142. id:'logout',
  143. text: 'Logout',
  144. handler: function( b, e ){
  145. window.location = '/login.php?UID=1';
  146. }
  147. }]
  148. },{
  149. title: 'Profile Settings',
  150. html: '<p>Panel content!</p>'
  151. }
  152. <?php
  153. if( $CUser->Data['access'] > 5 ){
  154. ?>,{
  155. title: 'Admin Settings',
  156. items:[{
  157. xtype: 'button',
  158. width: '100%',
  159. id:'adm_acc',
  160. text: 'Users Management',
  161. handler: function( b, e ){
  162. window.location = '/login.php?UID=1';
  163. }
  164. },{
  165. xtype: 'button',
  166. width: '100%',
  167. id:'adm_acclog',
  168. text: 'Access Log',
  169. handler: function( b, e ){
  170. window.location = '/login.php?UID=1';
  171. }
  172. }]
  173. }
  174. <?php
  175. };
  176. ?>
  177. ]
  178. },{
  179. xtype: 'panel',
  180. region:'center',
  181. margins: '5 5 5 0',
  182. id: 'main_content',
  183. title: 'System Dashboard',
  184. items:[{
  185. xtype: 'portal',
  186. id: 'main_portal',
  187. frame: false,
  188. border: false,
  189. items:{
  190. html: '<p style="padding:10px;color:#556677;font-size:11px;"><center><img src="/style/img/logo.png"></center></p>'
  191. },
  192. listeners:{
  193. drop: function( a ){
  194. updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
  195. }
  196. }
  197. }]
  198. }]
  199. });
  200. loadDashBoard();
  201. });