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.

291 lines
6.6 KiB

6 years ago
​
​
5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 years ago
​
​
​
​
5 years ago
​
​
5 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
6 years ago
6 years ago
​
​
6 years ago
​
6 years ago
​
​
​
6 years ago
​
​
​
6 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
​
​
​
​
​
​
5 years ago
​
​
​
​
5 years ago
​
​
​
​
​
5 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 = <?=intval($CUser->Data['width']);?>;
  3. var winH = <?=intval($CUser->Data['height']);?>;
  4. var initView = <?=intval($CUser->Data['last_content_view']);?>;
  5. var PanelW = winW;
  6. var PanelH = winH-90;
  7. var SelectedSite = <?=$SiteID;?>;
  8. var SettingsLidar3D = null;
  9. var SelectedNodeID = 0;
  10. var StatusTS = -1;
  11. var LoadTS = <?=time();?>;
  12. var SoundEnable = <?=intval($CUser->Data['sound_enable']);?>;
  13. var nodeDashboardStatuses = new Array();
  14. var nodeTHREEviewers = new Array();
  15. var nodeTHREEanimationId = 0;
  16. var sndBeep = new Howl({
  17. src: [
  18. '/style/assets/audio/beep-07a.mp3',
  19. '/style/assets/audio/beep-07a.wav'
  20. ],
  21. loop: false,
  22. volume: 0.99,
  23. onend: function() {
  24. //console.log('Finished!');
  25. }
  26. });
  27. var sndExcl = new Howl({
  28. src: [
  29. '/style/assets/audio/button-42.mp3',
  30. '/style/assets/audio/button-42.wav'
  31. ],
  32. loop: false,
  33. volume: 0.99
  34. });
  35. function playSound( t ){
  36. if( SoundEnable ){
  37. switch( t ){
  38. case 1:{
  39. sndBeep.play();
  40. break;
  41. };
  42. default:{
  43. sndExcl.play();
  44. };
  45. };
  46. };
  47. };
  48. function doRefresh(){
  49. window.location="/?t="+123;
  50. };
  51. function doLogout(){
  52. window.location = '/login.php?UID=1';
  53. };
  54. function failureAJAXFunction( responce, opts ){
  55. if( tlInterval!= null ){
  56. window.clearInterval( tlInterval );
  57. tlInterval = null;
  58. };
  59. playSound();
  60. Ext.Msg.show({
  61. title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
  62. msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
  63. buttons: Ext.Msg.OK,
  64. icon: Ext.MessageBox.INFO
  65. });
  66. doLogout();
  67. };
  68. function updateUserScreenResolution( x, y ){
  69. Ext.Ajax.request({
  70. url: '/lib/controller/updateUserSettings.php',
  71. params: {
  72. UID: <?=$UserID;?>,
  73. SID: '<?=$Session;?>',
  74. SSS: 15,
  75. WID: x,
  76. HEI: y
  77. },
  78. success: function( response, opts ){
  79. doRefresh();
  80. },
  81. failure: failureAJAXFunction
  82. });
  83. };
  84. function setUserContent( c_id ){
  85. Ext.Ajax.request({
  86. url: '/lib/controller/updateUserSettings.php',
  87. params: {
  88. UID: <?=$UserID;?>,
  89. SID: '<?=$Session;?>',
  90. SSS: 26,
  91. CID: c_id
  92. },
  93. failure: failureAJAXFunction
  94. });
  95. };
  96. function doCheckWindowSize(){
  97. if (parseInt(navigator.appVersion)>3) {
  98. if (navigator.appName=="Netscape") {
  99. winW2 = window.innerWidth;
  100. winH2 = window.innerHeight;
  101. if ( winH2<700 ) winH2=700;
  102. };
  103. if (navigator.appName.indexOf("Microsoft")!=-1) {
  104. winW2 = document.body.offsetWidth;
  105. winH2 = document.body.offsetHeight;
  106. if ( winH2<700 ) winH2=700;
  107. };
  108. };
  109. if ( winW2 != winW || winH2!=winH ){
  110. updateUserScreenResolution( winW2, winH2 );
  111. };
  112. };
  113. var NotificationStack = null;
  114. Ext.onReady(function(){
  115. doCheckWindowSize();
  116. NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});
  117. //window.onresize = doCheckWindowSize;
  118. Ext.QuickTips.init();
  119. var viewport = new Ext.Viewport({
  120. id: 'main_viewport',
  121. layout:'border',
  122. items: [{
  123. xtype: 'panel',
  124. region: 'north',
  125. baseCls: 'x-plain',
  126. height: 50,
  127. items:[{
  128. xtype: 'panel',
  129. id:'top',
  130. baseCls: 'x-plain',
  131. html: '<p style="padding:10px;zcolor:#556677;font-size:24px;"><img src="/style/img/logo32.png">&nbsp;<?=$Labels->GetLabel('_APP_TITLE_');?></p>'
  132. }]
  133. },{
  134. xtype: 'panel',
  135. id:'btns',
  136. region:'west',
  137. bsaseCls:'x-plain',
  138. title: '<?=$Labels->GetLabel('_SEC_SYSTEM_');?>',
  139. collapsible: true,
  140. split:true,
  141. width:150,
  142. minWidth: 100,
  143. maxWidth: 250,
  144. layout:'accordion',
  145. margins: '5 0 5 5',
  146. cmargins:'5 5 5 5',
  147. layoutConfig:{
  148. animate: true//,
  149. //activeOnTop: true
  150. },
  151. items: [{
  152. title: '<?=$Labels->GetLabel('_DASHBOARD_');?>',
  153. layout: 'vbox',
  154. height: 120,
  155. pack: 'center',
  156. align : 'strech',
  157. collapsed: <?=($CUser->Data['last_content_view']<2)?'false':'true';?>,
  158. items:[{
  159. xtype: 'button',
  160. width: '100%',
  161. id:'go_home',
  162. text: '<?=$Labels->GetLabel('_GO_HOME_');?>',
  163. toggled: (initView == 0 ),
  164. handler: loadDashBoard
  165. },{
  166. xtype: 'button',
  167. width: '100%',
  168. id:'go_monitor',
  169. text: '<?=$Labels->GetLabel('_EVT_MONITOR_');?>',
  170. handler: loadMonitoring
  171. },{
  172. xtype: 'button',
  173. width: '100%',
  174. id:'go_archive',
  175. text: '<?=$Labels->GetLabel('_EVT_ARCHIVE_');?>',
  176. handler: loadArchive
  177. },{
  178. xtype: 'button',
  179. width: '100%',
  180. id:'go_out',
  181. text: '<?=$Labels->GetLabel('_LOGOUT_');?>',
  182. handler: doLogout
  183. }]
  184. },{
  185. title: '<?=$Labels->GetLabel('_SYS_SETTINGS_');?>',
  186. layout: 'vbox',
  187. height: 120,
  188. pack: 'center',
  189. align : 'strech',
  190. collapsed: <?=($CUser->Data['last_content_view']>1)?'false':'true';?>,
  191. items:[{
  192. xtype: 'button',
  193. width: '100%',
  194. id:'sys_edit',
  195. text: '<?=$Labels->GetLabel('_EDT_CONNECTIONS_');?>',
  196. handler: loadSystemEditor
  197. },{
  198. xtype: 'button',
  199. width: '100%',
  200. id:'map_edit',
  201. text: '<?=$Labels->GetLabel('_EDT_LOCATIONS_');?>',
  202. handler: loadLocationEditor
  203. },{
  204. xtype: 'button',
  205. width: '100%',
  206. id:'soft_update',
  207. text: '<?=$Labels->GetLabel('_UPGRADE_MNGMNT_');?>',
  208. handler: loadUpgradeManagmenet
  209. }]
  210. },{
  211. title: '<?=$Labels->GetLabel('_PROF_SETTINGS_');?>',
  212. html: '<p>Panel content!</p>'
  213. }
  214. <?php
  215. if( $CUser->Data['access'] > 5 ){
  216. ?>,{
  217. title: '<?=$Labels->GetLabel('_ADM_SETTINGS_');?>',
  218. items:[{
  219. xtype: 'button',
  220. width: '100%',
  221. id:'adm_acc',
  222. text: '<?=$Labels->GetLabel('_USERS_MNGMT_');?>',
  223. handler: function( b, e ){
  224. loadUserEditor();
  225. }
  226. },{
  227. xtype: 'button',
  228. width: '100%',
  229. id:'adm_acclog',
  230. text: '<?=$Labels->GetLabel('_ACC_LOG_');?>',
  231. handler: function( b, e ){
  232. loadAccessLog();
  233. }
  234. },{
  235. xtype: 'button',
  236. width: '100%',
  237. id:'adm_servlog',
  238. text: '<?=$Labels->GetLabel('_SERV_LOG_');?>',
  239. handler: function( b, e ){
  240. loadServerLog();
  241. }
  242. }]
  243. }
  244. <?php
  245. };
  246. ?>
  247. ]
  248. },{
  249. xtype: 'panel',
  250. region:'center',
  251. margins: '5 5 5 0',
  252. id: 'main_content',
  253. title: '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>',
  254. items:[{
  255. xtype: 'portal',
  256. id: 'main_portal',
  257. frame: false,
  258. border: false,
  259. items:{
  260. html: ''
  261. },
  262. listeners:{
  263. drop: function( a ){
  264. updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
  265. }
  266. }
  267. }]
  268. }]
  269. });
  270. switch( <?=intval($CUser->Data['last_content_view']);?> ){
  271. case 0: loadDashBoard(); break;
  272. case 1: loadMonitoring(); break;
  273. case 2: loadArchive(); break;
  274. case 5: loadUpgradeManagmenet(); break;
  275. default:
  276. loadDashBoard();
  277. };
  278. });