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.

223 lines
4.6 KiB

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