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.

337 lines
7.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. 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. function tryKeepScreenAlive(minutes) {
  139. navigator.wakeLock.request("screen").then(lock => {
  140. setTimeout(() => lock.release(), minutes * 60 * 1000);
  141. });
  142. }
  143. Ext.onReady(function(){
  144. if ('wakeLock' in navigator) {
  145. // Screen Wake Lock API supported
  146. tryKeepScreenAlive(10);
  147. };
  148. doCheckWindowSize();
  149. gSessionValidatorInterval = window.setInterval( sessionValidator, 1000 );
  150. NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});
  151. //window.onresize = doCheckWindowSize;
  152. Ext.QuickTips.init();
  153. var viewport = new Ext.Viewport({
  154. id: 'main_viewport',
  155. layout:'border',
  156. items: [{
  157. xtype: 'panel',
  158. region: 'north',
  159. baseCls: 'x-plain',
  160. height: 50,
  161. items:[{
  162. xtype: 'panel',
  163. id:'top',
  164. baseCls: 'x-plain',
  165. html: '<p style="padding:10px;zcolor:#556677;font-size:24px;"><img src="/style/img/logo32.png">&nbsp;<?=$Labels->GetLabel('_APP_TITLE_');?></p>'
  166. }]
  167. },{
  168. xtype: 'panel',
  169. id:'btns',
  170. region:'west',
  171. bsaseCls:'x-plain',
  172. title: '<?=$Labels->GetLabel('_SEC_SYSTEM_');?>',
  173. collapsible: true,
  174. split:true,
  175. width:150,
  176. minWidth: 100,
  177. maxWidth: 250,
  178. layout:'accordion',
  179. margins: '5 0 5 5',
  180. cmargins:'5 5 5 5',
  181. layoutConfig:{
  182. animate: true//,
  183. //activeOnTop: true
  184. },
  185. items: [{
  186. title: '<?=$Labels->GetLabel('_DASHBOARD_');?>',
  187. layout: 'vbox',
  188. height: 120,
  189. pack: 'center',
  190. align : 'strech',
  191. collapsed: <?=($CUser->Data['last_content_view']<3)?'false':'true';?>,
  192. items:[{
  193. xtype: 'button',
  194. width: '100%',
  195. id:'go_home',
  196. text: '<?=$Labels->GetLabel('_GO_HOME_');?>',
  197. toggled: (initView == 0 ),
  198. handler: loadDashBoard
  199. },{
  200. xtype: 'button',
  201. width: '100%',
  202. id:'go_monitor',
  203. text: '<?=$Labels->GetLabel('_EVT_MONITOR_');?>',
  204. toggled: (initView == 1 ),
  205. handler: loadMonitoring
  206. },{
  207. xtype: 'button',
  208. width: '100%',
  209. id:'go_archive',
  210. text: '<?=$Labels->GetLabel('_EVT_ARCHIVE_');?>',
  211. toggled: (initView == 2 ),
  212. handler: loadArchive
  213. },{
  214. xtype: 'button',
  215. width: '100%',
  216. id:'go_out',
  217. text: '<?=$Labels->GetLabel('_LOGOUT_');?>',
  218. handler: doLogout
  219. }]
  220. },{
  221. title: '<?=$Labels->GetLabel('_SYS_SETTINGS_');?>',
  222. layout: 'vbox',
  223. height: 120,
  224. pack: 'center',
  225. align : 'strech',
  226. collapsed: <?=($CUser->Data['last_content_view']>2)?'false':'true';?>,
  227. items:[{
  228. xtype: 'button',
  229. width: '100%',
  230. id:'sys_edit',
  231. text: '<?=$Labels->GetLabel('_EDT_CONNECTIONS_');?>',
  232. toggled: (initView == 3 ),
  233. handler: loadSystemEditor
  234. },{
  235. xtype: 'button',
  236. width: '100%',
  237. id:'map_edit',
  238. text: '<?=$Labels->GetLabel('_EDT_LOCATIONS_');?>',
  239. toggled: (initView == 4 ),
  240. handler: loadLocationEditor
  241. },{
  242. xtype: 'button',
  243. width: '100%',
  244. id:'soft_update',
  245. text: '<?=$Labels->GetLabel('_UPGRADE_MNGMNT_');?>',
  246. toggled: (initView == 5 ),
  247. handler: loadUpgradeManagmenet
  248. }]
  249. },{
  250. title: '<?=$Labels->GetLabel('_PROF_SETTINGS_');?>',
  251. html: '<p>Panel content!</p>'
  252. }
  253. <?php
  254. if( $CUser->Data['access'] > 5 ){
  255. ?>,{
  256. title: '<?=$Labels->GetLabel('_ADM_SETTINGS_');?>',
  257. items:[{
  258. xtype: 'button',
  259. width: '100%',
  260. id:'adm_acc',
  261. text: '<?=$Labels->GetLabel('_USERS_MNGMT_');?>',
  262. handler: function( b, e ){
  263. loadUserEditor();
  264. }
  265. },{
  266. xtype: 'button',
  267. width: '100%',
  268. id:'adm_acclog',
  269. text: '<?=$Labels->GetLabel('_ACC_LOG_');?>',
  270. handler: function( b, e ){
  271. loadAccessLog();
  272. }
  273. },{
  274. xtype: 'button',
  275. width: '100%',
  276. id:'adm_servlog',
  277. text: '<?=$Labels->GetLabel('_SERV_LOG_');?>',
  278. handler: function( b, e ){
  279. loadServerLog();
  280. }
  281. }]
  282. }
  283. <?php
  284. };
  285. ?>
  286. ]
  287. },{
  288. xtype: 'panel',
  289. region:'center',
  290. margins: '5 5 5 0',
  291. id: 'main_content',
  292. title: '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>',
  293. items:[{
  294. xtype: 'portal',
  295. id: 'main_portal',
  296. frame: false,
  297. border: false,
  298. items:{
  299. html: ''
  300. },
  301. listeners:{
  302. drop: function( a ){
  303. updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
  304. }
  305. }
  306. }]
  307. }]
  308. });
  309. switch( <?=intval($CUser->Data['last_content_view']);?> ){
  310. case 0: loadDashBoard(); break;
  311. case 1: loadMonitoring(); break;
  312. case 2: loadArchive(); break;
  313. case 3: loadSystemEditor(); break;
  314. case 4: loadLocationEditor(); break;
  315. case 5: loadUpgradeManagmenet(); break;
  316. default:
  317. loadDashBoard();
  318. };
  319. });