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.

298 lines
6.8 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
​
​
​
4 years ago
6 years ago
​
​
​
6 years ago
​
​
​
4 years ago
5 years ago
​
​
​
​
4 years ago
6 years ago
​
​
​
​
6 years ago
​
6 years ago
​
​
​
4 years ago
6 years ago
​
​
​
4 years ago
6 years ago
​
​
​
4 years ago
6 years ago
​
​
​
4 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
​
​
​
4 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']<3)?'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. toggled: (initView == 1 ),
  171. handler: loadMonitoring
  172. },{
  173. xtype: 'button',
  174. width: '100%',
  175. id:'go_archive',
  176. text: '<?=$Labels->GetLabel('_EVT_ARCHIVE_');?>',
  177. toggled: (initView == 2 ),
  178. handler: loadArchive
  179. },{
  180. xtype: 'button',
  181. width: '100%',
  182. id:'go_out',
  183. text: '<?=$Labels->GetLabel('_LOGOUT_');?>',
  184. handler: doLogout
  185. }]
  186. },{
  187. title: '<?=$Labels->GetLabel('_SYS_SETTINGS_');?>',
  188. layout: 'vbox',
  189. height: 120,
  190. pack: 'center',
  191. align : 'strech',
  192. collapsed: <?=($CUser->Data['last_content_view']>2)?'false':'true';?>,
  193. items:[{
  194. xtype: 'button',
  195. width: '100%',
  196. id:'sys_edit',
  197. text: '<?=$Labels->GetLabel('_EDT_CONNECTIONS_');?>',
  198. toggled: (initView == 3 ),
  199. handler: loadSystemEditor
  200. },{
  201. xtype: 'button',
  202. width: '100%',
  203. id:'map_edit',
  204. text: '<?=$Labels->GetLabel('_EDT_LOCATIONS_');?>',
  205. toggled: (initView == 4 ),
  206. handler: loadLocationEditor
  207. },{
  208. xtype: 'button',
  209. width: '100%',
  210. id:'soft_update',
  211. text: '<?=$Labels->GetLabel('_UPGRADE_MNGMNT_');?>',
  212. toggled: (initView == 5 ),
  213. handler: loadUpgradeManagmenet
  214. }]
  215. },{
  216. title: '<?=$Labels->GetLabel('_PROF_SETTINGS_');?>',
  217. html: '<p>Panel content!</p>'
  218. }
  219. <?php
  220. if( $CUser->Data['access'] > 5 ){
  221. ?>,{
  222. title: '<?=$Labels->GetLabel('_ADM_SETTINGS_');?>',
  223. items:[{
  224. xtype: 'button',
  225. width: '100%',
  226. id:'adm_acc',
  227. text: '<?=$Labels->GetLabel('_USERS_MNGMT_');?>',
  228. handler: function( b, e ){
  229. loadUserEditor();
  230. }
  231. },{
  232. xtype: 'button',
  233. width: '100%',
  234. id:'adm_acclog',
  235. text: '<?=$Labels->GetLabel('_ACC_LOG_');?>',
  236. handler: function( b, e ){
  237. loadAccessLog();
  238. }
  239. },{
  240. xtype: 'button',
  241. width: '100%',
  242. id:'adm_servlog',
  243. text: '<?=$Labels->GetLabel('_SERV_LOG_');?>',
  244. handler: function( b, e ){
  245. loadServerLog();
  246. }
  247. }]
  248. }
  249. <?php
  250. };
  251. ?>
  252. ]
  253. },{
  254. xtype: 'panel',
  255. region:'center',
  256. margins: '5 5 5 0',
  257. id: 'main_content',
  258. title: '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>',
  259. items:[{
  260. xtype: 'portal',
  261. id: 'main_portal',
  262. frame: false,
  263. border: false,
  264. items:{
  265. html: ''
  266. },
  267. listeners:{
  268. drop: function( a ){
  269. updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
  270. }
  271. }
  272. }]
  273. }]
  274. });
  275. switch( <?=intval($CUser->Data['last_content_view']);?> ){
  276. case 0: loadDashBoard(); break;
  277. case 1: loadMonitoring(); break;
  278. case 2: loadArchive(); break;
  279. case 3: loadSystemEditor(); break;
  280. case 4: loadLocationEditor(); break;
  281. case 5: loadUpgradeManagmenet(); break;
  282. default:
  283. loadDashBoard();
  284. };
  285. });