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.

325 lines
7.5 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. var gSessionValidatorInterval = null;
  97. function sessionValidator(){
  98. Ext.Ajax.request({
  99. url: '/lib/controller/updateUserSssion.php',
  100. params: {
  101. UID: <?=$UserID;?>,
  102. SID: '<?=$Session;?>'
  103. },
  104. success: function( response, opts ){
  105. var data = Ext.decode(response.responseText);
  106. if( !data.sessionIsValid ){
  107. playSound();
  108. Ext.Msg.show({
  109. title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
  110. msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
  111. buttons: Ext.Msg.OK,
  112. icon: Ext.MessageBox.INFO
  113. });
  114. doLogout();
  115. };
  116. },
  117. failure: failureAJAXFunction
  118. });
  119. };
  120. function doCheckWindowSize(){
  121. if (parseInt(navigator.appVersion)>3) {
  122. if (navigator.appName=="Netscape") {
  123. winW2 = window.innerWidth;
  124. winH2 = window.innerHeight;
  125. if ( winH2<700 ) winH2=700;
  126. };
  127. if (navigator.appName.indexOf("Microsoft")!=-1) {
  128. winW2 = document.body.offsetWidth;
  129. winH2 = document.body.offsetHeight;
  130. if ( winH2<700 ) winH2=700;
  131. };
  132. };
  133. if ( winW2 != winW || winH2!=winH ){
  134. updateUserScreenResolution( winW2, winH2 );
  135. };
  136. };
  137. var NotificationStack = null;
  138. Ext.onReady(function(){
  139. doCheckWindowSize();
  140. gSessionValidatorInterval = window.setInterval( sessionValidator, 1000 );
  141. NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});
  142. //window.onresize = doCheckWindowSize;
  143. Ext.QuickTips.init();
  144. var viewport = new Ext.Viewport({
  145. id: 'main_viewport',
  146. layout:'border',
  147. items: [{
  148. xtype: 'panel',
  149. region: 'north',
  150. baseCls: 'x-plain',
  151. height: 50,
  152. items:[{
  153. xtype: 'panel',
  154. id:'top',
  155. baseCls: 'x-plain',
  156. html: '<p style="padding:10px;zcolor:#556677;font-size:24px;"><img src="/style/img/logo32.png">&nbsp;<?=$Labels->GetLabel('_APP_TITLE_');?></p>'
  157. }]
  158. },{
  159. xtype: 'panel',
  160. id:'btns',
  161. region:'west',
  162. bsaseCls:'x-plain',
  163. title: '<?=$Labels->GetLabel('_SEC_SYSTEM_');?>',
  164. collapsible: true,
  165. split:true,
  166. width:150,
  167. minWidth: 100,
  168. maxWidth: 250,
  169. layout:'accordion',
  170. margins: '5 0 5 5',
  171. cmargins:'5 5 5 5',
  172. layoutConfig:{
  173. animate: true//,
  174. //activeOnTop: true
  175. },
  176. items: [{
  177. title: '<?=$Labels->GetLabel('_DASHBOARD_');?>',
  178. layout: 'vbox',
  179. height: 120,
  180. pack: 'center',
  181. align : 'strech',
  182. collapsed: <?=($CUser->Data['last_content_view']<3)?'false':'true';?>,
  183. items:[{
  184. xtype: 'button',
  185. width: '100%',
  186. id:'go_home',
  187. text: '<?=$Labels->GetLabel('_GO_HOME_');?>',
  188. toggled: (initView == 0 ),
  189. handler: loadDashBoard
  190. },{
  191. xtype: 'button',
  192. width: '100%',
  193. id:'go_monitor',
  194. text: '<?=$Labels->GetLabel('_EVT_MONITOR_');?>',
  195. toggled: (initView == 1 ),
  196. handler: loadMonitoring
  197. },{
  198. xtype: 'button',
  199. width: '100%',
  200. id:'go_archive',
  201. text: '<?=$Labels->GetLabel('_EVT_ARCHIVE_');?>',
  202. toggled: (initView == 2 ),
  203. handler: loadArchive
  204. },{
  205. xtype: 'button',
  206. width: '100%',
  207. id:'go_out',
  208. text: '<?=$Labels->GetLabel('_LOGOUT_');?>',
  209. handler: doLogout
  210. }]
  211. },{
  212. title: '<?=$Labels->GetLabel('_SYS_SETTINGS_');?>',
  213. layout: 'vbox',
  214. height: 120,
  215. pack: 'center',
  216. align : 'strech',
  217. collapsed: <?=($CUser->Data['last_content_view']>2)?'false':'true';?>,
  218. items:[{
  219. xtype: 'button',
  220. width: '100%',
  221. id:'sys_edit',
  222. text: '<?=$Labels->GetLabel('_EDT_CONNECTIONS_');?>',
  223. toggled: (initView == 3 ),
  224. handler: loadSystemEditor
  225. },{
  226. xtype: 'button',
  227. width: '100%',
  228. id:'map_edit',
  229. text: '<?=$Labels->GetLabel('_EDT_LOCATIONS_');?>',
  230. toggled: (initView == 4 ),
  231. handler: loadLocationEditor
  232. },{
  233. xtype: 'button',
  234. width: '100%',
  235. id:'soft_update',
  236. text: '<?=$Labels->GetLabel('_UPGRADE_MNGMNT_');?>',
  237. toggled: (initView == 5 ),
  238. handler: loadUpgradeManagmenet
  239. }]
  240. },{
  241. title: '<?=$Labels->GetLabel('_PROF_SETTINGS_');?>',
  242. html: '<p>Panel content!</p>'
  243. }
  244. <?php
  245. if( $CUser->Data['access'] > 5 ){
  246. ?>,{
  247. title: '<?=$Labels->GetLabel('_ADM_SETTINGS_');?>',
  248. items:[{
  249. xtype: 'button',
  250. width: '100%',
  251. id:'adm_acc',
  252. text: '<?=$Labels->GetLabel('_USERS_MNGMT_');?>',
  253. handler: function( b, e ){
  254. loadUserEditor();
  255. }
  256. },{
  257. xtype: 'button',
  258. width: '100%',
  259. id:'adm_acclog',
  260. text: '<?=$Labels->GetLabel('_ACC_LOG_');?>',
  261. handler: function( b, e ){
  262. loadAccessLog();
  263. }
  264. },{
  265. xtype: 'button',
  266. width: '100%',
  267. id:'adm_servlog',
  268. text: '<?=$Labels->GetLabel('_SERV_LOG_');?>',
  269. handler: function( b, e ){
  270. loadServerLog();
  271. }
  272. }]
  273. }
  274. <?php
  275. };
  276. ?>
  277. ]
  278. },{
  279. xtype: 'panel',
  280. region:'center',
  281. margins: '5 5 5 0',
  282. id: 'main_content',
  283. title: '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>',
  284. items:[{
  285. xtype: 'portal',
  286. id: 'main_portal',
  287. frame: false,
  288. border: false,
  289. items:{
  290. html: ''
  291. },
  292. listeners:{
  293. drop: function( a ){
  294. updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
  295. }
  296. }
  297. }]
  298. }]
  299. });
  300. switch( <?=intval($CUser->Data['last_content_view']);?> ){
  301. case 0: loadDashBoard(); break;
  302. case 1: loadMonitoring(); break;
  303. case 2: loadArchive(); break;
  304. case 3: loadSystemEditor(); break;
  305. case 4: loadLocationEditor(); break;
  306. case 5: loadUpgradeManagmenet(); break;
  307. default:
  308. loadDashBoard();
  309. };
  310. });